diff --git a/DeployingMappings.md b/DeployingMappings.md new file mode 100644 index 0000000..0113162 --- /dev/null +++ b/DeployingMappings.md @@ -0,0 +1,98 @@ +# Mappings and Serialized Object auto Deployment + +!!! warning + * First start with your local instance before attempting to update the live server. + * When configuring the live server, please make sure that **no one** is using the system when doing Step **1** and **2** **Removing and Creating New Container**. + * **Backup live server database before doing any of these steps**. + * It has been noticed that some of the backup services have some technical issues and therefore you are advised to double check the file size after restarting the backup service before removing and stopping the container. The other option you can manually backup facility database by yourself. + + + +### Our automated deployment for mappings and serialized object comprises 5 steps: + +##### 0. Preparatory Steps + +* SSH into the server with `ssh openmrs@_SERVER_IP_ADDRESS` +* First check to see if your server has internet connectivity with `ping github.com` +* If not try to check contents of resolv.conf in /etc/ by running the following command: cat /etc/resolv.conf.Normally you should see google.com nameserver pointing to its ip 8.8.8.8.Edit the file if name server is not configured in the file. +* Nameserver(all in lowercase) 8.8.8.8.Ping 8.8.8.8 or google.com.After you may ping github.com just to make sure you are able to get packets from github.com + +* Then download all of the files need with `git clone https://github.com/eRegister/docs.git ` + +* The command above will create a folder called `docs` in `/home/openmrs` if you didn't change to another directory. All of files that need to be transferred to the server are in **`docs/scripts/MappingsScript`**. Mapping folder contains the following files:
+ `concept_restore.sh`
+ `gitpull_bahmniapps.sh`
+ `gitpull_concepts.sh`
+ `gitpull_mappings.sh`
+ `gitpull_serial.sh`
+ `serializedobject_restore.sh`
+ `gitpullbahmniapps.service`
+ `gitpullconcepts.service`
+ `gitpullmappings.service`
+ `gitpullserializedobject.service`
+* Go to `/development/` and create the following directories `openmrs_reporting_release` and `openmrs_concepts_release` and grant openmrs user permissions to own the files `sudo chown -R openmrs:openmrs directory_name`. +* Move the following files to `/usr/local/bin/` and make them executable: +`concept_restore.sh`,`serializedobject_restore`. +* Move `gitpull_concepts.sh` to `/development/openmrs_concepts_release` and `gitpull_serial.sh` to `/development/openmrs_reporting_release/`, make them executable. + + +!!! note + Files are already on the server + +!!! caution + **PLEASE ENSURE THAT YOU HAVE BACKED UP THE DB BEFORE EXECUTING THE STEPS BELOW!!!** + +##### 1. Removing Current Container + +* check the running container: `docker ps` +* Stop the container: `docker stop openmrseregister` +* Check that the container has stopped run `docker ps` and you should see an empty table +* Create a new image from the stopped container: `docker commit openmrseregister omrsregrepo/bahmni_base:09082020` [*tag should be date at time of creating image*] +* you can check the newly created image with `docker images` +* Remove the container: `docker container rm openmrseregister` + +##### 2. Creating a Volumes and enabling services + +* Now it's time to create a new container from the image we created earlier with: `docker run -e container_name=openmrseregister -it -d --restart always -p 443:443 -p 80:80 -p 8069:8069 -p 8000:8000 --privileged --name openmrseregister -v /development/bahmni_config_release:/development/bahmni_config_release -v /development/dhisconnector_mappings:/development/dhisconnector_mappings -v /development/bahmniapps_release:/development/bahmniapps_release omrsregrepo/bahmni_base:06082020 /bin/bash +` +* Go to `/development/` and grant openmrs user permissions to files in `/development/dhisconnector_mappings` and `/development/bahmniapps_release` +* Move `gitpull_bahmniapps.sh` to `/development/bahmniapps_release` and `gitpull_mappings.sh` to `/development/dhisconnector_mappings`, make them executable. +* Create local repo's in all directories in `/development` except `/development/bahmni_config_release`, commands `git init` , `git remote add origin https://github.com:/eRegister/repo_name` +* test that you are able to fetch files from remote repo's by `git fetch --all` +* move all services `gitpullmappings.service`,`gitpullconcepts.serivce`, +`gitpullbahmniapps.service` and `gitpullserializedobject.service`. +* Nagivate into /etc/system/system/ and type the following commands to enable `gitpull_mappings.service`, `gitpullconcepts.service`, `gitpullbahmniapps.service`,`gitpullserializedobject.service` + + `sudo chmod 664 service_name`
+ `sudo systemctl daemon-reload`
+ `sudo systemctl enable service_name` + + ** Note:when the service has been registered successfully you should see created sym link in ** `/etc/systemd/system/default.target.wants/.` + +##### 3. Configuring **cronjob** +* configure the cronjob to trigger the services everyday 7 am if our servers universal time is at UTC. +* to edit the cronjob do: `sudo crontab -e` if it's first time running the this command it'll probably ask you to choose the default text editor, please be kind enough to choose Nano as it's the easiest editor for most administrators. +* configure the script as shown below and then when the updates have been pulled successfully change the script to trigger services at **7:05**,**7:10**,**7:15**,**7:25** respectively. +**Do not change the command that trigger serialized object script**
+`*/3 * * * * systemctl restart gitpullmappings.service >> /var/log gitpull_mappings.log`
+`*/4 * * * * systemctl restart gitpullserializedobject.service >> /var/log/gitpull_serial.log`
+`*/5 * * * * systemctl restart gitpullconcepts.service >> /var/log/gitpull_concepts.log`
+`*/6 * * * * sudo bash /usr/local/bin/concepts_restore.sh >> /var/log/concept_restore.log`
+`20 7 * * * sudo bash /usr/local/bin/serializedobject_restore.sh >> /var/log/serial_restore.log` +* Wait for a while for cron job to execute the commands and check directories in development have updates from GitHub. For failed services refer to [Automated Deployment](https://eregister.github.io/docs/ereg/automateddeployment/) **Exit Codes** to troubleshoot. + + + +##### 4. Restore database and create soft links + +* Go to into a container and start mysql service. +* Connect to database server using no password `mysql -uroot -p` +* Initialise openmrs database and users by sourcing openmsq.sql file in container root directory, `source openmrs.sql;` +* Wait a moment for databases to be created and once the script is done quit or exit the database server and restart mysql. +* Restore facility database using the command `mysql -uroot -ppassword openmrs;` +* Go to `/opt/openmrs/dhisconnector` +* Remove mappings folder and create soft link to `/development/dhisconnector_mappings/dhisconnector_mappings/mappings`
+ **command:**
`sudo ln -s /development/dhisconnector_mappings/dhisconnector_mappings/mappings/ mappings`
+* Exit the container and go to `/usr/local/bin` and run `serializedobject_restore.sh` +* Restart other services and openmrs the broswer to access openmrs admin page. +* Go to reporting you should see total of 36 openmrs period indicator reports. Refer to staging server to see example [eRegister Staging server](https://3.21.105.229/openmrs/) diff --git a/Integration-DHIS2.md b/Integration-DHIS2.md new file mode 100644 index 0000000..e69de29 diff --git a/contacts.md b/contacts.md deleted file mode 100644 index 1d7c829..0000000 --- a/contacts.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contacts - -For any questions, please don't hesitate to contact Mr Monaheng Maoeng at monaheng.maoeng@gov.ls or Tel: +266 22317707 \ No newline at end of file diff --git a/docs/contacts.md b/docs/contacts.md new file mode 100644 index 0000000..6d3d9cb --- /dev/null +++ b/docs/contacts.md @@ -0,0 +1,3 @@ +# Contact Information + +For more information, please contact below: diff --git a/docs/covid/About-Us.md b/docs/covid/About-Us.md new file mode 100644 index 0000000..0b06be5 --- /dev/null +++ b/docs/covid/About-Us.md @@ -0,0 +1,3 @@ +## This is an About Page + +...information loading....New Version \ No newline at end of file diff --git a/docs/covid/Alerts.md b/docs/covid/Alerts.md new file mode 100644 index 0000000..b1226ac --- /dev/null +++ b/docs/covid/Alerts.md @@ -0,0 +1,2 @@ + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/Capturing-Weekly-Aggregate-Data.md b/docs/covid/Capturing-Weekly-Aggregate-Data.md new file mode 100644 index 0000000..b1226ac --- /dev/null +++ b/docs/covid/Capturing-Weekly-Aggregate-Data.md @@ -0,0 +1,2 @@ + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/How-To-Prepare-Docker-Training-Instance.md b/docs/covid/How-To-Prepare-Docker-Training-Instance.md new file mode 100644 index 0000000..9510db2 --- /dev/null +++ b/docs/covid/How-To-Prepare-Docker-Training-Instance.md @@ -0,0 +1,48 @@ +!!!note + we chose Docker over other many ways of installing DHIS2 because in a few minutes you can have your instance up and running + + +#### Installing Docker on the host server + +Please refer to this [link](../ereg/intro.md) for installing Docker + +#### Installling Docker Compose + +* To install Docker Compose, please refer to the official Docker Compose site [here](https://www.docker.com) +* To prepare the training instance, we used two images: + * `dhis2 core 2.33` + * `dmillon/postgis` (_recommended because it already has postgis which DHIS2 depends on to render maps_) + +#### Downloading the images + + ``` + paste contents of docker-compose.yml + + ``` + +_you can change to whichever image you want to use. But please remember to drop SQL views before creating your dump_ + +You can go ahead and read [this](#) to prepare your instance. Within a few minutes you should by now have your DHIS2 instance running. + +!!!warning + use `postgres` as your user for the db. It poses security threats (yes) but it's easier to deal with PostgreSQL with that setup. Unless ofcourse you're a PostgreSQL ninja. + + +#### Restoring Postgres Database + +As you saw from the previous step, your instance is running two containers with networking between them handled by Docker Compose. +If you have a live connection to Postgres database, you can't drop and restore your db. + +* Do `docker ps` to see all of the running containers. `docker-compose ps` also works fine. + * _it's important to do this step first because docker-compose is going to name according to how you named the folder containing the docker-compose.yml as well as how you labeled them **inside** the file_ +* To do that, you have to kill the frontend DHIS2 container then restore the DB with `docker container kill ` +* Copy DB backup file into Postgres container with `docker cp dhis_db_backup.sql :/` +* Get into the container with `docker exec -it bash` +* Switch account from `root` to `postgres` with `su postgres` and then launch the PostgreSQL interactive terminal with `psql` +* `\l` to list all of the databases +* `drop database dhis2;` to delete the database +* `create database dhis2` to recreate the database. But now it's empty +* `\q` to the interactive terminal +* `psql --username=postgres --dbname=dhis2 < dhis_db_backup.sql` to restore all of data into the empty database. _if the command ran succefully, you should see a trail of verbosely listed SQL commands processed_ +* Then the trail is done, do `exit` to exit the container +* Finally, start the container that we "killed" with `docker container start ` diff --git a/docs/covid/Indicators.md b/docs/covid/Indicators.md new file mode 100644 index 0000000..14877a5 --- /dev/null +++ b/docs/covid/Indicators.md @@ -0,0 +1,4 @@ + + +........content coming soon...... + diff --git a/docs/covid/Overview.md b/docs/covid/Overview.md new file mode 100644 index 0000000..cbbefd1 --- /dev/null +++ b/docs/covid/Overview.md @@ -0,0 +1,32 @@ +## Welcome to the COVID19 Surviellance Tool Technical Guide + +#### Overview + +The COVID19 Surveillance system can be found here: [http://hmis.gov.ls/covid19](http://hmis.gov.ls/covid19) + + +This system is built off of DHIS2's Tracker Module. All of the broader user manuals can be found [here:](https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html) + +#### Table of Contents +In addition to that, we have developed guidelines specific to our context and usecases. The document structure looks like this: + +``` +COVID-19 +└── Overview +└── Data Entry Guidelines + ├── Registering a Case or Suspect + ├── Capturing Weekly Aggregate Data + └── Using Mobile Devices +└── Technical + ├── Alerts Dataset + ├── Program Indicators + ├── Indicators + ├── Program Rules + └── How to Prepare Docker Training Instance +``` + +------------------------------------------------------------------------------------------------------------ + +#### Training Instance +We have also have a training instance which we try by all means to make it an up-to-date replica of the live system. +It can be found here: [http://197.155.193.109:1010/](http://197.155.193.109:1010/) \ No newline at end of file diff --git a/docs/covid/Program-Indicators.md b/docs/covid/Program-Indicators.md new file mode 100644 index 0000000..4e5be51 --- /dev/null +++ b/docs/covid/Program-Indicators.md @@ -0,0 +1,3 @@ + + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/Program_Rules.md b/docs/covid/Program_Rules.md new file mode 100644 index 0000000..4e5be51 --- /dev/null +++ b/docs/covid/Program_Rules.md @@ -0,0 +1,3 @@ + + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/Registering-a-Case-or-Suspect.md b/docs/covid/Registering-a-Case-or-Suspect.md new file mode 100644 index 0000000..fca6c67 --- /dev/null +++ b/docs/covid/Registering-a-Case-or-Suspect.md @@ -0,0 +1,2 @@ + +content loading.... \ No newline at end of file diff --git a/docs/covid/Using-Mobile-Devices.md b/docs/covid/Using-Mobile-Devices.md new file mode 100644 index 0000000..fca6c67 --- /dev/null +++ b/docs/covid/Using-Mobile-Devices.md @@ -0,0 +1,2 @@ + +content loading.... \ No newline at end of file diff --git a/docs/covid/Using-Mobile.md b/docs/covid/Using-Mobile.md new file mode 100644 index 0000000..fca6c67 --- /dev/null +++ b/docs/covid/Using-Mobile.md @@ -0,0 +1,2 @@ + +content loading.... \ No newline at end of file diff --git a/docs/covid/Using-Web-Aggregate.md b/docs/covid/Using-Web-Aggregate.md new file mode 100644 index 0000000..b1226ac --- /dev/null +++ b/docs/covid/Using-Web-Aggregate.md @@ -0,0 +1,2 @@ + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/Validation-Rules.md b/docs/covid/Validation-Rules.md new file mode 100644 index 0000000..b1226ac --- /dev/null +++ b/docs/covid/Validation-Rules.md @@ -0,0 +1,2 @@ + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/Weekly-Report.md b/docs/covid/Weekly-Report.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/covid/registering-a-case-mobile.md b/docs/covid/registering-a-case-mobile.md new file mode 100644 index 0000000..4b6012d --- /dev/null +++ b/docs/covid/registering-a-case-mobile.md @@ -0,0 +1,7 @@ +### User Guide + +........content coming soon...... + +### Trainer Guide + +........content coming soon...... \ No newline at end of file diff --git a/docs/covid/using-web.md b/docs/covid/using-web.md new file mode 100644 index 0000000..544aa5d --- /dev/null +++ b/docs/covid/using-web.md @@ -0,0 +1,5 @@ + +### User Guide +........content coming soon...... +### Trainer Guide +........content coming soon...... \ No newline at end of file diff --git a/docs/dhis2/tb-indicators.md b/docs/dhis2/tb-indicators.md new file mode 100644 index 0000000..7f123ab --- /dev/null +++ b/docs/dhis2/tb-indicators.md @@ -0,0 +1,250 @@ +## TB Program Indicators + +### The following is list of associated indicators that were created: +* TB Notification All (INDTB-2018_1) + +|Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Sum of everything in block 1, excluding Bacteriologically Confirmed not Started on Treatment | Sum of everything in Block 1 | Sum of everything in Block 1 (leave out subtotals) | +| Denominator | 1 | 1 | 1 | + +* TB Notification New and Relapse (INDTB-2018_2) + +|Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Sum of everything in block 1, excluding Bacteriologically Confirmed not Started on Treatment, and also exclude Retreatment excluding Relapse | Sum of everything in Block 1, excluding Treatment After loss to Follow-up, Treatment after Failure and Other Previously Treated | Sum of everything in Block 1 uner New (Pulmonary) (leave out subtotals) and Relapse (previously treated) | +| Denominator | 1 | 1 | 1 | + +* TB Notification New and Relapse Pulmonary Bacteriologically confirmed (INDTB-2018_3) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | sum of Pulmonary Bacteriologically Confirmed (row New and row Relapse) | sum of row Pulmonary, Bacteriologically confirmed (row New and row Relapse) | Sum of row Sputum Smear microscopy positive ( row New and row Relapse) | +| Denominator | 1 | 1 | 1 | + +* Bacteriologically Confirmed not initiated on treatment (INDTB-2018_4) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Sum of everything in column Bacteriologically confirmed not Started on Treatment | N/A | N/A | +| Denominator | 1 | N/A | N/A | + +* Proportion of TB patients with a documented HIV status All (INDTB-2018_5) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column Documented HIV Status (male & female), row New & Relapse and row Retreatment excl Relapse | Block 4: sum of column No. HIV Tested and row New Pulmonary, row Other New and row Retreatments | Block “TB/HIV Activities”: sum of column No. Tested for HIV (both male and female, both rows) | +| Denominator | Sum everything in Block 1 excluding Bacteriologically confirmed not started on treatment | sum everything in Block 1 | sum everything in Block 1 (leave out sub totals) | + +* Proportion of TB patients with a documented HIV status New and Relapse (INDTB-2018_6) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column Documented HIV Status (male & female), row New & Relapse | N/A | N/A | +| Denominator | Sum everything in Block 1 excluding Bacteriologically confirmed not started on treatment | N/A | N/A | + +* TB/HIV Co-infection Rate All (INDTB-2018_7) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Sum of column HIV Positive (both male and female), row New and Relapse, and row Retreatment excl Relapse | Sum of column "No. HIV Positive" - row New Pulmonary, row Other New, row Retreatments | Sum of column No. HIV Positive - row New sputum smear, Other TB | +| Denominator | sum of column Documented HIV Status (both male and female), row New and Relapse and row Retreatment excl Relapse | Sum of column No. HIV Tested - row New Pulmonary, row Other New, row Retreatments | Sum of column Tested for HIV - row New sputum smear, Other TB | + +* TB/HIV co-infected rate New and Relapse (INDTB-2018_8) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Sum of column HIV Positive (both male and female), row New and Relapse | N/A | N/A | +| Denominator | sum of column Documented HIV Status (both male and female), row New and Relapse | N/A | N/A | + +* Proportion of HIV positive TB patients on ART All (INDTB-2018_9) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column HIV Positive on ART, row New and Relapse and row Retreatment excl. Relapse | Block 4: sum of column No. HIV Positive on ART, row New Pulmonary, row Other New, row Retreatments | Block TB/HIV Activities: sum of column No. on ART, row New Sputum Smear, row Other TB | +| Denominator | Block: sum of column HIV Positive, column New and Relapse and row Retreatment excl. Relapse | Block 4: sum of column No. HIV Positive, row New Pulmonary, row Other New, row Retreatments | Block TB/HIV Activities: sum of column No. HIV Positive, row New Sputum Smear, row Other TB | + +* Proportion of HIV positive TB patients on ART New and Relapse (INDTB-2018_10) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column HIV Positive on ART, row New and Relapse | N/A | N/A | +| Denominator | Block: sum of column HIV Positive, column New and Relapse | N/A | N/A | + +* Proportion of HIV positive TB patients on CPT/Dapzone All (INDTB-2018_11) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column HIV Positive on CPT/Dapzone, row New and Relapse and row Retreatment excl. Relapse | Block 4: sum of column No. HIV Positive On CPT, row New Pulmonary, row Other New, row Retreatments | Block TB/HIV Activities: sum of column No. on CPT, row New Sputum Smear, row Other TB | +| Denominator | Block 5: sum of column HIV Positive, column New and Relapse and row Retreatment excl. Relapse | Block 4: sum of column No. HIV Positive, row New Pulmonary, row Other New, row Retreatments | Block TB/HIV Activities: sum of column No. HIV Positive, row New Sputum Smear, row Other TB | + +* Proportion of HIV positive TB patients on CPT/Dapzone New and Relapse (INDTB-2018_12) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 5: sum of column HIV Positive on CPT/Dapzone, column New and Relapse | N/A | N/A | +| Denominator | Block 5: sum of column HIV Positive, column New and Relapse | N/A | N/A | + +* TB Treatment Success Rate All + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | foo | foo | foo | +| Denominator | foo | foo | foo | + +* TB Treatment Success Rate New and Relapse + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | foo | foo | foo | +| Denominator | foo | foo | foo | + +* TB Death Rate All (INDTB-2018_13) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Died, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column Died, all rows | Block 1: sum of column died, all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column No of Cases Registered, all rows | Block 1: sum of column Total number of cases registered | + +* TB Death Rate New and Relapse (INDTB-2018_14) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Died, row New and Relapse | Block 1: sum of column Died, all rows | Block 1: sum of column Died, all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse | Block 1: sum of column No of Cases Registered, row New Pulmonary (B+), row Relapse B(+), row Extra pulmonary B(+), row New Pulmonary CD, row Relapse CD, row Retreatment (Excluding Relapse)-CD | Block 1: sum of column Total number of cases registered, row New, row 2.1 Relapses | + +* TB Lost to Followup Rate All (INDTB-2018_15) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Lost to Follow-up, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column Defaulted/LTFU, all rows | Block 1: sum of column Default(5), all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column No of Cases Registered, all rows | Block 1: sum of column Total number of cases registered | + +* TB Lost to Followup Rate New and Relapse (INDTB-2018_16) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Lost to Follow-up, row New and Relapse | Block 1: sum of column Defaulted/LTFU, all rows | Block 1: sum of column Default(5), all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse | Block 1: sum of column No of Cases Registered, row New Pulmonary (B+), row Relapse B(+), row Extra pulmonary B(+), row New Pulmonary CD, row Relapse CD, row Retreatment (Excluding Relapse)-CD | Block 1: sum of column Total number of cases registered, row New, row 2.1 Relapses | + +* TB Not Evaluated Rate All (INDTB-2018_17) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Not Evaluated, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column Not Evaluated, all rows | Block 1: sum of column Transfer Out(6), column Total Number NOT Evaluated for outcomes, all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column No of Cases Registered, all rows | Block 1: sum of column Total number of cases registered | + +* TB Not Evaluated Rate New and Relapse (INDTB-2018_18) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Not Evaluated, row New and Relapse | Block 1: sum of column Not Evaluated, all rows | Block 1: sum of column Transfer Out(6), column Total Number NOT Evaluated for outcomes, all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse | Block 1: sum of column No of Cases Registered, row New Pulmonary (B+), row Relapse B(+), row Extra pulmonary B(+), row New Pulmonary CD, row Relapse CD, row Retreatment (Excluding Relapse)-CD | Block 1: sum of column Total number of cases registered, row New, row 2.1 Relapses | + +* TB Failure Rate All (INDTB-2018_19) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Failed +(Susceptible), row New and Relapse, row Treatment excl Relapse + | Block 1: sum of column Failure, all rows | Block 1: sum of column Treatment Failure(4), all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse, row Treatment excl Relapse | Block 1: sum of column No of Cases Registered, all rows | Block 1: sum of column Total number of cases registered | + +* TB Failure Rate New and Relapse (INDTB-2018_20) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Failed (Susceptible), row New and Relapse | Block 1: sum of column Failure, all rows | Block 1: sum of column Treatment Failure(4), all rows | +| Denominator | Block 1: sum of column Total number of patients, row New and Relapse | Block 1: sum of column Failure, row New Pulmonary (B+), row Relapse B(+), row Extra pulmonary B(+), row New Pulmonary CD, row Relapse CD, row Retreatment (Excluding Relapse)-CD | Block 1: sum of column Total number of cases registered, row New, row 2.1 Relapses | + +* TB Treatment Success Rate Among HIV Positive All (INDTB-2018_21) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Completed, column Cured, row All HIV positive | Block 3: sum of column Completed, column Cured, row HIV positive all types | Last block: sum of column Cure(1), column Treatment Completed (2), all rows | +| Denominator | Block 1: sum of column Total number of patients, row All HIV positive | Block 3: sum of column Total number registered, row HIV positive all types | Last block: sum of column Total Number of Patients registered , all rows | + +* TB Death Rate Among HIV Positive All (INDTB-2018_22) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Died, row All HIV positive | Block 3: sum of column Died, row HIV positive all types | Last block: sum of column Died(3), all rows | +| Denominator | Block 1: sum of column Total number of patients, row All HIV positive | Block 3: sum of column Total number registered, row HIV positive all types | Last block: sum of column Total Number of Patients registered , all rows | + +* TB Lost to Followup Rate Among HIV Positive All (INDTB-2018_23) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Lost to Follow-up, row All HIV positive | Block 3: sum of column Defaulted/LTFU, row HIV positive all types | Last block: sum of column Default(5), all rows | +| Denominator | Block 1: sum of column Total number of patients, row All HIV positive | Block 3: sum of column Total number registered, row HIV positive all types | Last block: sum of column Total Number of Patients registered , all rows | + +* TB Not Evaluated Rate Among HIV Positive All (INDTB-2018_24) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Lost to Follow-up, row All HIV positive | Block 3: sum of column Defaulted/LTFU, row HIV positive all types | Last block: sum of column Transfer Out(6), column Total Number NOT Evaluated for outcomes, all rows | +| Denominator | Block 1: sum of column Total number of patients, row All HIV positive | Block 3: sum of column Total number registered, row HIV positive all types | Last block: sum of column Total Number of Patients registered , all rows | + +* TB Failure Rate Among HIV Positive All (INDTB-2018_25) + +| Dataset | TB Notification 2018 | TB_Notification_New | TB Case Registration Old | +| --- | --- | --- | --- | +| Numerator | Block 1: sum of column Failed +(Susceptible), row All HIV positive | Block 3: sum of column Failure, row HIV positive all types | Last block: sum of column Treatment failure(4), all rows | +| Denominator | Block 1: sum of column Total number of patients, row All HIV positive | Block 3: sum of column Total number registered, row HIV positive all types | Last block: sum of column Total Number of Patients registered , all rows | + +* TB Proportion of Presumptive cases examined using a bacteriologic test (INDTB-2018_26) + +| Dataset | TB Case Detection 2018 | Presumptive TB Cases | +| --- | --- | --- | +| Numerator | Block 1: Column c), row Total | Block 1: Column c) | +| Denominator | Block 1: Column b), row Total | Block 1: Column b) | + +* TB Positivity Yield (INDTB-2018_27) + +| Dataset | TB Case Detection 2018 | Presumptive TB Cases | +| --- | --- | --- | +| Numerator | Block 1: Column d), row Total | Block 1: Column d) | +| Denominator | Block 1: Column c), row Total | Block 1: Column c) | + +* Proportion of contacts of PTB cases screened for TB (INDTB-2018_28) + +| Dataset | TB Case Detection 2018 | Presumptive TB Cases | +| --- | --- | --- | +| Numerator | Block 2: column Number of contacts of PTB cases who are presumptive TB cases | N/A “because there are no contacts” | +| Denominator | Block 2: column Total number of contacts of PTB cases | N/A “because there are no contacts” | + +* Proportion of Under 5 childhood contacts screened for TB (INDTB-2018_29) + +| Dataset | TB Case Detection 2018 | Presumptive TB Cases | +| --- | --- | --- | +| Numerator | Block 3: column Number of contacts <5 years screened for TB | N/A | +| Denominator | Block 3: column Number of childhood contacts <5 years | N/A | + +* Proportion of Under 5 Childhood contacts without signs and symptoms of TB put on INH prophylaxis + +| Dataset | TB Case Detection 2018 | Presumptive TB Cases | +| --- | --- | --- | +| Numerator | Block 3: column Number of contacts <5 years started on INH after ruling out signs and symptoms of TB | N/A | +| Denominator | Block 3: column Number of contacts <5 years who are not presumptive TB cases | N/A | + +* Proportion of Under 5 Childhood contacts started on INH six months ago who completed their INH course (INDTB-2018_31) + +| Dataset | TB Notification 2018 | TB_Notification_New | +| --- | --- | --- | +| Numerator | Block 4: column Number of contacts <5 years started on INH who completed their IPT course | N/A | +| Denominator | Block 3: column Number of contacts <5 years started on INH | N/A | + +* TB Treatment Success Rate New & Relapse (INDTB-2018_32) + +| Dataset | TB Treatment Outcomes 2018 | TB Treatment Outcomes New | TB Treatment Outcomes Old | +| --- | --- | --- | --- | +| Numerator | Block 1: Sum of column Completed, column Cured - row New & Relapse | Block 1: Block 1: Sum column Cured, Completed - rows New Pulmonary (B+) , Extra pulmonary B(+), New Pulmonary CD, New Extra pulmonary CD, Relapse B(+) and Relapse CD | Block 1: Block 1 sum of column cured and completed of row New (1.1 Smear positive, 1.2 Smear Neg and not done and 1.4 EP) and 2.1 Relapse | +| Denominator | Block 1: Sum column Total number of patients of row New and Relapse | Block 1 Sum column Total No. of Patients registered of row New Pulmonary (B+) , Extra pulmonary B(+), New Pulmonary CD, New Extra pulmonary CD, Relapse B(+) and Relapse CD| Block 1 Sum column Total No. of Patients registered during Quarter Reported on row New (1.1 Smear positive, 1.2 Smear Neg and not done and 1.4 EP) and 2.1 Relapse | + +* TB Treatment Success All (INDTB-2018_33) + +| Dataset | TB Treatment Outcomes 2018 | TB Treatment Outcomes New | TB Treatment Outcomes Old | +| --- | --- | --- | --- | +| Numerator | Block 1 Sum of columns completed and cured of row New and Relapse and Retreatment excluding relapse | Block 1 Sum of columns completed and cured of row New Pulmonary B+, Relapse B+, Extra pulmonary B+, Retreatment(excluding relapse) B+, New pulmonary CD, Retreatment(excluding relapse) CD and New extra pulmonary CD | Block 1 sum of column cured and completed of row 1.New, 2.Retreatment (smear positive) and 3.Other previously treated | +| Denominator | Block 1 sum column total number of patients of row New and Relapse and Retreatment excluding relapses | Block 1 Sum column No of cases registered of row New Pulmonary B+, Relapse B+, Extra pulmonary B+, Retreatment(excluding relapse) B+, New pulmonary CD, Retreatment(excluding relapse) CD and New extra pulmonary CD | Block 1 Sum column Total No. of Patients registered during Quarter Reported on row New, Retreatment (smear positive) and Other previously treated | diff --git a/docs/dhis2/tb-validation-rules.md b/docs/dhis2/tb-validation-rules.md new file mode 100644 index 0000000..8b1960c --- /dev/null +++ b/docs/dhis2/tb-validation-rules.md @@ -0,0 +1,109 @@ +## TB Program Validation Rules + +### To ensure optimal quality of data, the following validation rules were setup. We have named them according to which dataset they apply +* Unsorted list of all validation rules. We'll later sort the according to which datasets they're meant to apply to. This is meant for you to deal better with these validation rules when they pop out. + +| Dataset| Validation Rules | +| --- | --- | +| foo | TB-2018_1 Total number of NEW patients tested for Rifampicin susceptibility should be greater than or equal to Number of patients tested for rifampicin susceptibility | +| foo | TB-2018_2 Total PREVIOUSLY TREATED DR-TB Patients should be greater than or equal to Number of PREVIOUSLY TREATED patients tested for rifampicin susceptibility who are laboratory confirmed RR-TB | +| foo | TB-2018_3 Total NEW DR-TB Patients should be greater than or equal to number of NEW patients tested for rifampicin susceptibility who are laboratory confirmed MDR-TB | +| foo | TB-2018_4 Total Previously Treated DR-TB Patients should be greater or equal to Number of patients tested for rifampicin susceptibility who are laboratory confirmed MDR-TB | +| foo | TB-2018_5 Total NEW DR-TB Patients should be greater than or equal to Number of laboratory confirmed RR-TB or MDT patients started on second-line treatment | +| foo | TB-2018_6 Total Previously Treated DR-TB Patients should be greater then or equal to Number of laboratory confirmed RR-TB or MDT patients started on second-line treatment| +| foo | TB-2018_7 Xpert MTB/RIF + LPA + Phenotypic DST (Block 2) should be less than or equal to Total New patients + Total Previously treated (Block 1) | +| foo | TB-2018_8 Total number of patients resistant to Isoniazid should be less than or equal to Total number of PTB bacteriologically confirmed cases | +| foo | TB-2018_9 Total Number resistant to Rifampicin only should be less than or equal to Total number of PTB bacteriologically confirmed cases | +| foo | TB-2018_10 Total Number resistant to Rifampicin and Isoniazid should be less than or equal to Total number of PTB bacteriologically confirmed cases | +| foo | TB-2018_12 Total Number resistant to Rifampicin and Isoniazid should be less than or equal to Total of Number of patients tested for Rifampicin susceptibility who are laboratory confirmed MDR-TB | +| foo | TB-2018_13 Total of RR or MDR-TB (block 3) should be equal to Total row "c" plus total row "d" (Block 2) | +| foo | TB-2018_14 Total of RR or MDR-TB (Block 4) should be equal to Total of row "c" + row "d" (Block 2) | +| foo | TB-2018_15 Total number of clients screened for TB (column (a), row (total) - Block 1) should be greater than or equal to Clients with signs and symptoms (Column (b), row (total) - Block 1) | +| foo | TB-2018_15a [Total] Total TB Screening greater_than_or_equal_to TB Screening Total Clients with signs and symptoms | +| foo | TB-2018_16 Total Referred by CHW (column(a)) should be greater than or equal to Referred by CHW Clients with signs and symptoms (column (b)) | +| foo | TB-2018_16a [Referred by CHW] Total TB Screening greater_than_or_equal_to Referred by CHW Clients with signs and symptoms | +| foo | TB-2018_17 [Referred by CSO] Total TB Screening greater_than_or_equal_to Referred by SCO Clients with signs and symptoms | +| foo | TB-2018_18 [Children] Total TB Screening greater_than_or_equal_to Children (0-14 years) Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_19 [Mine Workers] Total TB Screening greater_than_or_equal_to Mine Workers Clients with signs and symptoms | +| foo | TB-2018_20 [Ex-mine workers] Total TB Screening greater_than_or_equal_to Ex-Mine Workers Clients with signs and symptoms | +| foo | TB-2018_21 [HHCM] Total TB Screening greater_than_or_equal_to HHCM Clients with signs and symptoms | +| foo | TB-2018_22 [HHXM] Total TB Screening greater_than_or_equal_to HHXM Clients with signs and symptoms | +| foo | TB-2018_23 [Factory Workers] Total TB Screening greater_than_or_equal_to Factory Workers Clients with signs and symptoms | +| foo | TB-2018_24 [Correctional Staff] Total TB Screening greater_than_or_equal_to Correctional Staff or Inmate Clients with signs and symptom | +| foo | TB-2018_25 [Health Workers] Total TB Screening greater_than_or_equal_to Health Workers Clients with signs and symptoms | +| foo | TB-2018_26 [Public Transport Ops] Total TB Screening greater_than_or_equal_to Public Transport Operators Clients with signs and symptoms | +| foo | TB-2018_27 [Total] Total TB Screening greater_than_or_equal_to TB Screening Total Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_28 [Referred by CHW] Total TB Screening greater_than_or_equal_to Referred by CHW Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_29 [Referred by CSO] Total TB Screening greater_than_or_equal_to Referred by SCO Total number of diagnosed | +| foo | TB-2018_30 [Children] Total TB Screening greater_than_or_equal_to Children (0-14 years) Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_31 [Mine Workers] Total TB Screening greater_than_or_equal_to Mine Workers Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_32 [Ex-mine workers] Total TB Screening greater_than_or_equal_to Ex-Mine Workers Total number of diagnosed | +| foo | TB-2018_33 [HHCM] Total TB Screening greater_than_or_equal_to HHCM Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_34 [HHXM] Total TB Screening greater_than_or_equal_to HHXM Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_35 [Factory Workers] Total TB Screening greater_than_or_equal_to Factory Workers Total number of diagnosed | +| foo | TB-2018_37 [Health Workers] Total TB Screening greater_than_or_equal_to Health Workers Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_38 [Public Transport Ops] Total TB Screening greater_than_or_equal_to Public Transport Operators Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_39 TB Screening Total Total number of diagnosed greater_than_or_equal_to TB Screening Total Number started on ant-TB treatment | +| foo | TB-2018_40 Referred by CHW Total number of diagnosed greater_than_or_equal_to Referred by CHW Number started on ant-TB treatment | +| foo | TB-2018_41 Referred by SCO Total number of diagnosed greater_than_or_equal_to Referred by SCO Number started on ant-TB treatment | +| foo | TB-2018_42 Children (0-14 years) Total number of diagnosed greater_than_or_equal_to Children (0-14 years) Number started on ant-TB treatment | +| foo | TB-2018_43 Mine Workers Total number of diagnosed greater_than_or_equal_to Mine Workers Number started on ant-TB treatment | +| foo | TB-2018_44 Ex-Mine Workers Total number of diagnosed greater_than_or_equal_to Ex-Mine Workers Number started on ant-TB treatment | +| foo | TB-2018_45 HHCM Total number of diagnosed greater_than_or_equal_to HHCM Number started on ant-TB treatment | +| foo | TB-2018_46 HHXM Total number of diagnosed greater_than_or_equal_to HHXM Number started on ant-TB treatment | +| foo | TB-2018_47 Factory Workers Total number of diagnosed greater_than_or_equal_to Factory Workers Number started on ant-TB treatment | +| foo | TB-2018_48 Correctional Staff or Inmate Total number of diagnosed greater_than_or_equal_to Correctional Staff or Inmate Number started on ant-TB treatment | +| foo | TB-2018_49 Health Workers Total number of diagnosed greater_than_or_equal_to Health Workers Number started on ant-TB treatment | +| foo | TB-2018_50 Public Transport Operators Total number of diagnosed greater_than_or_equal_to Public Transport Operators Number started on ant-TB treatment | +| foo | TB-2018_51 TB Screening Total Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to TB Screening Total Total number of diagnosed | +| foo | TB-2018_52 Referred by CHW Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Referred by CHW Total number of diagnosed | +| foo | TB-2018_53 Referred by SCO Total number of diagnosed greater_than_or_equal_to Referred by SCO Total number of diagnosed | +| foo | TB-2018_54 Children (0-14 years) Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Children (0-14 years) Total number of diagnosed | +| foo | TB-2018_55 Mine Workers Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Mine Workers Total number of diagnosed | +| foo | TB-2018_56 Ex-Mine Workers Total number of diagnosed greater_than_or_equal_to Ex-Mine Workers Total number of diagnosed | +| foo | TB-2018_57 HHCM Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to HHCM Total number of diagnosed | +| foo | TB-2018_58 HHXM Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to HHXM Total number of diagnosed | +| foo | TB-2018_59 Factory Workers Total number of diagnosed greater_than_or_equal_to Factory Workers Total number of diagnosed | +| foo | TB-2018_60 Correctional Staff or Inmate Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Correctional Staff or Inmate Total number of diagnosed | +| foo | TB-2018_61 Health Workers Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Health Workers Total number of diagnosedm | +| foo | TB-2018_62 Public Transport Operators Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Public Transport Operators Total number of diagnosed | +| foo | TB-2018_63 TB Screening Total Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to TB Screening Total Number started on ant-TB treatment | +| foo | TB-2018_64 Referred by CHW Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Referred by CHW Number started on ant-TB treatment | +| foo | TB-2018_65 Referred by SCO Total number of diagnosed greater_than_or_equal_to Referred by SCO Number started on ant-TB treatment | +| foo | TB-2018_66 Children (0-14 years) Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Children (0-14 years) Number started on ant-TB treatment | +| foo | TB-2018_67 Mine Workers Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Mine Workers Number started on ant-TB treatment | +| foo | TB-2018_68 Ex-Mine Workers Total number of diagnosed greater_than_or_equal_to Ex-Mine Workers Number started on ant-TB treatment | +| foo | TB-2018_69 HHCM Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to HHCM Number started on ant-TB treatment | +| foo | TB-2018_70 HHXM Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to HHXM Number started on ant-TB treatment | +| foo | TB-2018_71 Factory Workers Total number of diagnosed greater_than_or_equal_to Factory Workers Number started on ant-TB treatment | +| foo | TB-2018_72 Correctional Staff or Inmate Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Correctional Staff or Inmate Number started on ant-TB treatment | +| foo | TB-2018_73 Health Workers Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Health Workers Number started on ant-TB treatment | +| foo | TB-2018_74 Public Transport Operators Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Public Transport Operators Number started on ant-TB treatment | +| foo | TB-2018_75 TB Screening Total Clients with signs and symptoms greater_than_or_equal_to TB Screening Total Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_76 Referred by CHW Clients with signs and symptoms greater_than_or_equal_to Referred by CHW Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_77 Referred by SCO Clients with signs and symptoms greater_than_or_equal_to Referred by SCO Total number of diagnosed | +| foo | TB-2018_78 Children (0-14 years) Patients with signs and symptoms who tested bacteriologically greater_than_or_equal_to Children (0-14 years) Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_79 Mine Workers Clients with signs and symptoms greater_than_or_equal_to Mine Workers Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_80 Ex-Mine Workers Clients with signs and symptoms greater_than_or_equal_to Ex-Mine Workers Total number of diagnosed | +| foo | TB-2018_81 HHCM Clients with signs and symptoms greater_than_or_equal_to HHCM Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_82 HHXM Clients with signs and symptoms greater_than_or_equal_to HHXM Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_83 Factory Workers Clients with signs and symptoms greater_than_or_equal_to Factory Workers Total number of diagnosed | +| foo | TB-2018_84 Correctional Staff or Inmate Clients with signs and symptom greater_than_or_equal_to Correctional Staff or Inmate Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_85 Health Workers Clients with signs and symptoms greater_than_or_equal_to Health Workers Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_86 Public Transport Operators Clients with signs and symptoms greater_than_or_equal_to Public Transport Operators Patients with signs and symptoms who tested bacteriologically | +| foo | TB-2018_87 TB Screening Total Number who died anti-TB treatment less_than_or_equal_to TB Screening Total Total number of diagnosed | +| foo | TB-2018_88 Referred by CHW Number who died anti-TB treatment less_than_or_equal_to Referred by CHW Total number of diagnosed | +| foo | TB-2018_89 Referred by SCO Number who died anti-TB treatment less_than_or_equal_to Referred by SCO Total number of diagnosed | +| foo | TB-2018_90 Children (0-14 years) Number who died anti-TB treatment less_than_or_equal_to Children (0-14 years) Total number of diagnosed | +| foo | TB-2018_91 Mine Workers Number who died anti-TB treatment less_than_or_equal_to Mine Workers Total number of diagnosed | +| foo | TB-2018_92 Ex-Mine Workers Number who died anti-TB treatment less_than_or_equal_to Ex-Mine Workers Total number of diagnosed | +| foo | TB-2018_93 HHCM Number who died anti-TB treatment less_than_or_equal_to HHCM Total number of diagnosed | +| foo | TB-2018_94 HHXM Number who died anti-TB treatment less_than_or_equal_to HHXM Total number of diagnosed | +| foo | TB-2018_95 Factory Workers Number who died anti-TB treatment less_than_or_equal_to Factory Workers Total number of diagnosed | +| foo | TB-2018_96 Correctional Staff or Inmate Number who died anti-TB treatment less_than_or_equal_to Correctional Staff or Inmate Total number of diagnosed | +| foo | TB-2018_97 Health Workers Number who died anti-TB treatment less_than_or_equal_to Health Workers Total number of diagnosed | +| foo | TB-2018_98 Public Transport Operators Number who died anti-TB treatment less_than_or_equal_to Public Transport Operators Total number of diagnosed | +| foo | TB-2018_99 TB Screening Total Number who died anti-TB treatment less_than_or_equal_to TB Screening Total Number started on ant-TB treatment | + +>please click on each validation rules to learn how to handle them + diff --git a/docs/dhis2/tb.md b/docs/dhis2/tb.md index f6f1396..c9cd7f9 100644 --- a/docs/dhis2/tb.md +++ b/docs/dhis2/tb.md @@ -1,3 +1,6 @@ # TB -....info on TB \ No newline at end of file +* DR-TB 2018 +* TB Case Detection 2018 +* TB Treatment Outcomes 2018 +* TB Notification 2018 \ No newline at end of file diff --git a/docs/dhis2/usermanual.md b/docs/dhis2/usermanual.md index 9763385..081a918 100644 --- a/docs/dhis2/usermanual.md +++ b/docs/dhis2/usermanual.md @@ -1,3 +1,3 @@ # User Manual -....loading \ No newline at end of file +This manual is inteded for non technical end users \ No newline at end of file diff --git a/docs/ereg/DeployingMappings.md b/docs/ereg/DeployingMappings.md new file mode 100644 index 0000000..cb87eca --- /dev/null +++ b/docs/ereg/DeployingMappings.md @@ -0,0 +1,106 @@ +# Mappings and Serialized Object Pipeline + +!!! warning + * First start with your local instance before attempting to update the live server. + * When configuring the live server, please make sure that **no one** is using the system when doing Step **1** and **2** **Removing and Creating New Container**. + * **Backup live server database before doing any of these steps**. + * It has been noticed that some of the backup services have some technical issues and therefore you are advised to double check the file size after restarting the backup service before removing and stopping the container. The other option you can manually backup facility database by yourself. + + + +### Our automated deployment for mappings and serialized object comprises 5 steps: + +##### 0. Preparatory Steps + +* SSH into the server with `ssh openmrs@_SERVER_IP_ADDRESS` +* First check to see if your server has internet connectivity with `ping github.com` +* If not try to check contents of resolv.conf in /etc/ by running the following command: cat /etc/resolv.conf.Normally you should see google.com nameserver pointing to its ip 8.8.8.8.Edit the file if name server is not configured in the file. +* Nameserver(all in lowercase) 8.8.8.8.Ping 8.8.8.8 or google.com.After you may ping github.com just to make sure you are able to get packets from github.com + +* Then download all of the files need with `git clone https://github.com/eRegister/docs.git ` + +* The command above will create a folder called `docs` in `/home/openmrs` if you didn't change to another directory. All of files that need to be transfered to the server are in [docs/scripts/mappingsscripts](https://github.com/eRegister/docs/tree/master/scripts/MappingsScripts): + + * `concepts_restore.sh` + * `gitpull_bahmniapps.sh` + * `gitpull_concepts.sh` + * `gitpull_mappings.sh` + * `gitpull_serial.sh` + * `gitpullbahmniapps.service` + * `gitpullconcepts.service` + * `gitpullmappings.service` + * `gitpullserializedobject.service` + * `serializedboject_restore.sh` + +* Go to `/development/` and create the following directories `openmrs_reporting_release` and `openmrs_concepts_release` and grant openmrs user permissions to own the files. + +* Move the following files to `/usr/local/bin/` and make them executable: +`concept_restore.sh`,`serializedobject_restore`. +* Move `gitpull_concepts.sh` to `/development/openmrs_concepts_release` and `gitpull_serial.sh` to `/development/openmrs_reporting_release/`, make them executable. + + +!!! note + Files are already on the server + +!!! caution + **PLEASE ENSURE THAT YOU HAVE BACKED UP THE DB BEFORE EXECUTING THE STEPS BELOW!!!** + +##### 1. Removing Current Container + +* check the running container: `docker ps` +* Stop the container: `docker stop openmrseregister` +* Check that the container has stopped run `docker ps` and you should see an empty table +* Create a new image from the stopped container: `docker commit openmrseregister omrsregrepo/bahmni_base:09082020` [*tag should be date at time of creating image*] +* you can check the newly created image with `docker images` +* Remove the container: `docker container rm openmrseregister` + +##### 2. Creating a Volumes and enabling services + +* Now it's time to create a new container from the image we created earlier with: `docker run -e container_name=openmrseregister -it -d --restart always -p 443:443 -p 80:80 -p 8069:8069 -p 8000:8000 --privileged --name openmrseregister -v /development/bahmni_config_release:/development/bahmni_config_release -v /development/dhisconnector_mappings:/development/dhisconnector_mappings -v /development/bahmniapps_release:/development/bahmniapps_release omrsregrepo/bahmni_base:06082020 /bin/bash +` +* Go to `/development/` and grant openmrs user permissions to files in `/development/dhisconnector_mappings` and `/development/bahmniapps_release` +* Move `gitpull_bahmniapps.sh` to `/development/bahmniapps_release` and `gitpull_mappings.sh` to `/development/dhisconnector_mappings`, make them executable. +* Create local repo's in all directories in `/development` except `/development/bahmni_config_release`, with the following commands: + `git init` , + `git remote` add + `git origin https://github.com:/eRegister/repo_name` + +* test that you are able to fetch files from remote repo's by `git fetch --all` +* move all services `gitpullmappings.service`,`gitpullconcepts.serivce`, +`gitpullbahmniapps.service` and `gitpullserializedobject.service`. +* Nagivate into /etc/system/system/ and type the following commands to enable `gitpull_mappings.service`, `gitpullconcepts.service`, `gitpullbahmniapps.service`,`gitpullserializedobject.service` + + `sudo chmod 664 service_name`
+ `sudo systemctl daemon-reload`
+ `sudo systemctl enable service_name` + +!!! note + when the service has been registered successfully you should see created sym link in `/etc/systemd/system/default.target.wants/.` + +##### 3. Configuring **cronjob** +* configure the cronjob to trigger the services everyday 7 am if our servers universal time is at UTC. +* to edit the cronjob do: `sudo crontab -e` if it's first time running the this command it'll probably ask you to choose the default text editor, please be kind enough to choose Nano as it's the easiest editor for most administrators. +* configure the script as shown below and then when the updates have been pulled successfully change the script to trigger services at **7:05**,**7:10**,**7:15**,**7:25** respectively. +**Do not change the command that trigger serialized object script**
+`*/3 * * * * systemctl restart gitpullmappings.service >> /var/log gitpull_mappings.log`
+`*/4 * * * * systemctl restart gitpullserializedobject.service >> /var/log/gitpull_serial.log`
+`*/5 * * * * systemctl restart gitpullconcepts.service >> /var/log/gitpull_concepts.log`
+`*/6 * * * * sudo bash /usr/local/bin/concepts_restore.sh >> /var/log/concept_restore.log`
+`20 7 * * * sudo bash /usr/local/bin/serializedobject_restore.sh >> /var/log/serial_restore.log` +* Wait for a while for cron job to execute the commands and check directories in development have updates from GitHub. For failed services refer to [Automated Deployment](https://eregister.github.io/docs/ereg/automateddeployment/) **Exit Codes** to troubleshoot. + + + +##### 4. Restore database and create soft links + +* Go to into a container and start mysql service. +* Connect to database server using no password `mysql -uroot -p` +* Initialise openmrs database and users by sourcing openmsq.sql file in container root directory, `source openmrs.sql;` +* Wait a moment for databases to be created and once the script is done quit or exit the database server and restart mysql. +* Restore facility database using the command `mysql -uroot -ppassword openmrs;` +* Go to `/opt/openmrs/dhisconnector` +* Remove mappings folder and create soft link to `/development/dhisconnector_mappings/dhisconnector_mappings/mappings`
+ **command:**
`sudo ln -s /development/dhisconnector_mappings/dhisconnector_mappings/mappings/ mappings`
+* Exit the container and go to `/usr/local/bin` and run `serializedobject_restore.sh` +* Restart other services and openmrs the broswer to access openmrs admin page. +* Go to reporting you should see total of 36 openmrs period indicator reports. Refer to staging server to see example [eRegister Staging server](https://3.21.105.229/openmrs/) diff --git a/docs/ereg/IntegrationDHIS2.md b/docs/ereg/IntegrationDHIS2.md new file mode 100644 index 0000000..413e305 --- /dev/null +++ b/docs/ereg/IntegrationDHIS2.md @@ -0,0 +1,37 @@ +# Bahmni DHIS2 Integration + +## Installation +Install git +`$sudo yum update # update system packages` +`$sudo yum install git` + +Install maven +`$sudo yum install maven` + +Install rpm-build +`$sudo yum install rpm-build` + +Clone the source code from the repository +`$sudo git clone ` + +Build the plugin +`$sudo mvn -Dmaven.test.skip=true install` + +Install the plugin +`$sudo yum install dhis-integration-1.0-1.noarch.rpm` + +Configure the plugin - set application properties + +Navigate to the application’s properties configuration file: +`cd /etc/dhis-integration/dhis-integration.yml` + +Configure the application as follows: + + +## Testing +Configure reports - create a concatenated report (in reports.json) for the program and associated query file e.g product_list.sql +`$sudo yum autoremove dhis-integration` + + +## Uninstallation +`$sudo yum autoremove dhis-integration` diff --git a/docs/ereg/TB_Program.md b/docs/ereg/TB_Program.md new file mode 100644 index 0000000..f387edd --- /dev/null +++ b/docs/ereg/TB_Program.md @@ -0,0 +1,37 @@ +## [**TB Patient Flow**](https://drive.google.com/file/d/1b-NrAuPi7WNHNqDrUSnKzMnpSa9JrMsm/view?usp=sharing) + +![Bahmni 092 after upgrade](../pics/TB_patient_flow_2.png ) +[**Fig 1 - TB Patient Flow**](https://drive.google.com/file/d/1b-NrAuPi7WNHNqDrUSnKzMnpSa9JrMsm/view?usp=sharing) + +##### 1. DHIS2 Datasets to report to + +|DHIS2 Dataset | TB Notification 2020 | TB Treatment Outcomes 2020 | Presumptive TB Cases Report | D.R TB Report Surveillance 2020 | D.R TB TB (Hospital) | TB Case Detection | +| --- | --- | --- | --- | --- | --- | --- | +| **Source Documents** | TB Register | TB Register | Tally Sheet, TB Presumptive Register |TB Register |TB Register |Tally Sheet, TB Presumptive Register, Contact Tracing and Screening Register, TPT (Under 15), TB Register | +| **Corresponding eRegister Tools** | TB Intake, TB Followup | TB Intake, TB Followup | Registration Module screening tool | TB Intake, TB Followup | TB Intake, TB Followup | Registration Module screening tool, TPT form, TB Intake, TB Followup | + +##### 2. eRegister Facility Level Patient Reports + +!!! note + * most of these reports are informed by PEPFAR MER Indicators and have been named to align with them + +* **TB-001 | TB Outcomes (List)** +* **TB-002 | TB Case Detection** +* **TB-003 | Documented TB/HIV Activities** +* **TB-004 | TB Testing Strategy** +* **TB-005 | TB Contact Tracing and Screening** +* **TB-006 | All TB Patients on Treatment** +* **TB-007 | New and Relapse Enrolled on TB** +* **TB-008 | TB Status (List)** +* **TB-009 | TB Status (Pivot)** +* **TB-010 | New and Relapse Enrolled on TB (List)** +* **TB-011 | DSD TB_ART (List)** +* **TB-012 | DSD TB_ART (PIVOT)** +* **TB-013 | TB Screening Among HIV Clients** +* **TB-014 | TB Prevention Therapy (List)** +* **TB-015 | TB Prevention Therapy (Pivot)** +* **TB-016 | TB SCREENING** +* **TB-017 | TB Intakes (List)** +* **TB-018 | TB Intakes (Pivot)** +* **TB-019 | TB Indicators (List)** +* **TB-020 | Registered TB Visits with TB Consultation (List)** \ No newline at end of file diff --git a/docs/ereg/automateddeployment.md b/docs/ereg/automateddeployment.md deleted file mode 100644 index 2a6420a..0000000 --- a/docs/ereg/automateddeployment.md +++ /dev/null @@ -1,3 +0,0 @@ -# Automated Deployment - -....info loading... \ No newline at end of file diff --git a/docs/ereg/bahmniaddons.md b/docs/ereg/bahmniaddons.md new file mode 100644 index 0000000..07902cb --- /dev/null +++ b/docs/ereg/bahmniaddons.md @@ -0,0 +1,4 @@ +# Core Addons & Bahmni Addons Pipeline + +!!! warning + * Content coming soon... diff --git a/docs/ereg/bahmniapps.md b/docs/ereg/bahmniapps.md new file mode 100644 index 0000000..9de952d --- /dev/null +++ b/docs/ereg/bahmniapps.md @@ -0,0 +1,4 @@ +# Bahmni Apps Pipeline + +!!! warning + * Content coming soon... diff --git a/docs/ereg/bahmniconfigs.md b/docs/ereg/bahmniconfigs.md new file mode 100644 index 0000000..248ce80 --- /dev/null +++ b/docs/ereg/bahmniconfigs.md @@ -0,0 +1,122 @@ +# Bahmni Configs Pipeline + +!!! warning + * Please make sure that **no one** is using the system + * Backup your database before doing any of these steps. + + +### Our automated deployment comprises 5 steps: + +##### 0. Preparatory Steps + +* SSH into the server with `ssh openmrs@_SERVER_IP_ADDRESS` +* First check to see if your server has internet connectivity with `ping github.com` +* If not try to check contents of `resolv.conf` in `/etc/` by running the following command: `cat /etc/resolv.conf` + +* Normally you should see google.com nameserver pointing to its ip `8.8.8.8`. Edit the file if name server is not configured in the file. + + * `nameserver 8.8.8.8` + + `Ping 8.8.8.8` or `google.com`.After you may ping github.com just to make sure you are able to get packets from github.com + +* Then download all of the files need with `git clone https://github.com/eRegister/docs.git ` + +* The command above will create a folder called `docs` in `/home/openmrs` if you didn't change to another directory. All of files that need to be transfered to the server are in docs/scripts/: + +* `gitpull.service` +* `gitpull.sh` +* `openmrs_global_properties` +* `serialized objects` +* `symbolic_creation.sh` +* `visit_types.sql` + +!!! note + we started by ssh'ng into the server so the files are already in the server + + +* Backup facility specific configurations and configurations: + * if you haven't already, backup your database with invoking the script that does that, that is already in your server: `docker exec -i openmrseregister /usr/bin/mysqldump -u root --password=password -A > $HOME/latestback.sql` _the -A tag is going to backup everything_ + * do `ls -lh` to see the size of `latestback.sql` it should be 200MB or more, not less. + +!!! caution + **PLEASE ENSURE THAT YOU HAVE BACKED UP BOTH THE DB AND CONFIG FILES BEFORE EXECUTING THE STEPS BELOW!!!** + +##### 1. Removing Current Container + +* check the running container: `docker ps` +* Stop the container: `docker stop openmrseregister` +* Check that the container has stopped run `docker ps` and you should see an empty table +* Create a new image from the stopped container: `docker commit openmrseregister omrsregrepo/bahmni_base:19052020` [*tag should be date at time of creating image*] +* you can check the newly created image with* `docker images` +* Remove the container: `docker container rm openmrseregister` + +##### 2. Creating a Volume + +* create development directory `sudo mkdir -p /development/bahmni_config_release` +* change ownership of the new folder from `root` to `openmrs` with `sudo chown -R openmrs:openmrs /development` becuase the service is managed by openmrs user +* get into the directory with `cd /development/bahmni_config_release` +* configure gitpull services + +!!! note +**DO NOT** use `git clone` + +* initialise new local git repo: `git init` +* if you do `ls -a` you'll see a hidden `.git` to show that indeed the folder has been intialized +* connect local repository with remote: `git remote add origin https://github.com/eRegister/bahmni_config_release.git` +* download the latest commits to the repo: `git fetch --all` *you should see a log of all the latest commits downloading* +* now go to the home directory: `cd ~` OR `cd $HOME` +* copy `gitpull.service` file: `sudo cp gitpull.service /etc/systemd/system/` +* move `gitpull.sh` file: `sudo mv gitpull.sh /development/bahmni_config_release` +* change directory `cd /development/bahmni_config_release/` make the script executable `sudo chmod +x gitpull.sh` and `sudo chown openmrs:openmrs gitpull.sh` +* check the contents of the script with `cat gitpull.sh` to make sure that it does `git fetch --all` and `git pull origin master` +* Nagivate into `/etc/systemd/system/` and type the following commands to register gitpull service in system + * `sudo chmod 664 gitpull.service` + * `sudo systemctl daemon-reload` + * `sudo systemctl enable gitpull.service` + + ** Note:when the service has been registered successfully you should see created sym link in ** `/etc/systemd/system/default.target.wants/.` + + +##### 3. Configuring **cronjob** & Restoring database +* configure the cronjob to trigger the service Monday 9 am +* to edit the cronjob do: `sudo crontab -e` if it's first time running the this command it'll probably ask you to choose the default text editor, please be kind enough to choose Nano as it's the easiest editor formost administrators. +* configure the script to run within 2 mins just to make sure everything is running OK: + + + */2 * * * * systemctl restart gitpull.service >> /var/log/gitpull.log2>&1 + + +* inside the crontab editor write: `* 7 * * mon systemctl restart gitpull.service >> /var/log/gitpull.log2>&1` +* Go to /development/bahmni_config_release/ and check the status of cron service to see when it has executed gitpull. service, once done check the file by typing ll or ls. For some reason you may find that the service has not pulled the files from our remote repository, first thing to do is to check the status of the service if it has successfully started. If not check the status code of the service to guide you what might went wrong. The following table shows possible exit codes of the systemd service. Another possible reason it could be that you forgot to change the ownership of the development bahmni config release, check it. + + | **EXIT CODE** | **SYMBOLIC NAME** | **DESCRIPTION** | + | ------------- |:-------------:| -----:| + | 0 | EXIT_SUCCESS | Generic success code | + | 1 | EXIT_FAILURE | Generic failure or unspecified error(try to start the development/bahmni_config_release afresh directory ) | + | 200 | EXIT_CHDIR | Changing to the requested working directory failed | + | 208 | EXIT_STDIN | Failed to setup standard input | + | 209 | EXIT_STDOUT | Failed to set up standard out | + | 203 | EXIT_EXEC | The actual process execution failed. Most likely this is caused by a missing or non-accessible executable file | + + +* Another possible reason could be that the service in unable to fetch from remote repository which is not related to systemd service, check the logs of the service by typing `sudo tail -f /var/log/gitpull.log` + +* If gitpull service has pulled the bahmni config file then make a permanent configuration in cronjob to trigger the service *every Monday 9am*. +* inside the crontab editor write: `* 7 * * mon systemctl restart gitpull.service >> /var/log/gitpull.log2>&1` +* Now it's time to create a new container from the image we created earlier with: `docker run -e container_name=openmrseregister -it -d --restart always -p 443:443 -p 80:80 -p 8069:8069 -p 8000:8000 --privileged --name openmrseregister -v /development/bahmni_config_release:/development/bahmni_config_release -v openmrseregister:/openmrseregister omrsregrepo/bahmni_base:19052020 /bin/bash` +* After the command above you should see a container called openmrseregister running +* If the container has started successfully there is no need to restore database just copy all .sql files to container root `./` and `symbolic_creation.sh` to `/opt/openmrs` into the new running container docker cp latestbackup.sql openmrseregister:/ +* To get into the container do: `docker exec -it openmrseregister bash` +* Change directory to `/development/bahmni_config` to check if the volume was created when starting a new container. You should see the bahmni config release files. +* Go to `/var/www/` and run: `sudo rm bahmni_config` or `unlink bahmni_config` +* Type `sudo ln –s /development/bahmni_config_release/ bahmni_config` +* Go to `/opt/openmrs/` and make symbolic_creation executable and run it +* Start MySQL service: `service mysqld start` +* Restore all sql copied sql files `visit_type.sql`,`patient_identifier.sql`,`openmrs_global_property.sql` and `serial object.sql` +* Start other services `openmrs`,`httpd` and `bahmni-reports` +* Browse to `http://IP_of_eRegister/bahmni/home` and check if the changes have been effected. + + +##### The video below is an attempt to demonstrate the steps above: + +[![asciicast](https://asciinema.org/a/334423.svg)](https://asciinema.org/a/334423) \ No newline at end of file diff --git a/docs/ereg/clientregister.md b/docs/ereg/clientregistry.md similarity index 100% rename from docs/ereg/clientregister.md rename to docs/ereg/clientregistry.md diff --git a/docs/ereg/clinicalsearch.md b/docs/ereg/clinicalsearch.md new file mode 100644 index 0000000..8947bb4 --- /dev/null +++ b/docs/ereg/clinicalsearch.md @@ -0,0 +1,37 @@ +# Clinical Search Deployment Guideline + + +Repositories to pull updates from + + 1. Bahmniaps_release + 2. Openmrs-module-bahmnicore-release + 3. Openmrs-module-xdssender-release + 4. Openmrs-module-dhisconnector-release + 5. Bahmni-docker + + +Updates deployment in eRegister + + 1. Make sure all services are running for all the mentioned repositories.NB don’t git clone please + 2. Copy all downloaded omods files to /opt/openmrs/modules/ + 3. For bahmni docker repo, after pulling from master branch, go to misc folder and restore global_property_15112021.sql + 4. Restart openmrs to load updated modules + +Deployment verification + +**Xdssender** + +Search `xdssender.exportObsEndpoint` and verify the property is set to `http://devbukanals.org/xdsrepositoryrest/openmrs/ws/rest/v1/obs` + +**Bahmni apps** + +*You should see the following snapshot* + +![Registration Module - Pic1](../pics/apps1.png ) + +After clicking view Long. Obs button you should get the following reponse from SHR. +![Registration Module - Pic2](../pics/apps2.png ) + +**DHIS connector** + +Go to location mapping form , under OpenMRS location you should see long list of locations.Make configurations by testing the DHIS server, mapping the right location in OpenMRS to DHIS2, configure the right mappings under automation form. Check that the reporting auto running scheduler is running. diff --git a/docs/ereg/eRegister-092-Release-Notes.md b/docs/ereg/eRegister-092-Release-Notes.md new file mode 100644 index 0000000..7d8f00c --- /dev/null +++ b/docs/ereg/eRegister-092-Release-Notes.md @@ -0,0 +1,30 @@ +### eRegister Release Notes + +!!! warning + * this beta version is going to be deployed at selected pilot facilities. + * Please report issues here: [https://github.com/eRegister/bahmni_docker/issues](https://github.com/eRegister/bahmni_docker/issues) + +## [0.92](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/20185103/Release+Notes) - Release Candidate (RC) #1 + +* ##### Pharmacy Module + * Customized core odoo addons and Bamni addons to fit Lesotho context + * Changed workflow to suite Lesotho context +* ##### Reports + * Ported all Bahmni 0.90 reports to Bahmni 0.92 + * Developed Informed Push Tool reports +* ##### Automated Deployment + * Now supports auto deploying Bahmnni modules (apps), and odoo modules +* ##### Registration Module + * National Search ported from 0.90 and improved + * Rename gender to sex + * Disabled camera and picture icon + * Other Information: change contact to phone number + * Hide PNC & ANC numbers for male patients +* ##### Clinical Module + * Refactoring Bahmni App to align with 0.90 + * Improving the flow of order automation from observation to medication tab + * Numbering on patient queue + * Pregnancy status: use gender attribute to show and hide + * Include both age and sex to the patient payload sent from bahmni to odoo +* ##### Atomfeed + * Atom feed to allow concepts in Bahmni to automatically be pulled in odoo \ No newline at end of file diff --git a/docs/ereg/facilityimplementationchecklist.md b/docs/ereg/facilityimplementationchecklist.md index d68385e..9057791 100644 --- a/docs/ereg/facilityimplementationchecklist.md +++ b/docs/ereg/facilityimplementationchecklist.md @@ -1,3 +1,66 @@ # Facility Implementation Checklist -....info loading... \ No newline at end of file +Below is a checklist of things that should be done and how to do them during rollout: + +1. Disable server laptop lid to hibernate/shutdown when lid is closed. This is done to protect the laptop's monitor and keyboard from dust and potential damage. + + * edit the file `/etc/systemd/logind.conf` and change the line `#HandleLidSwitch=hibernate` to `HandleLidSwitch=ignore`. Don't forget to uncomment the line by removing `#` + +2. Configure automated reporting to DHIS2 (Training Instance) + + * ...CONTENT LOADING.... + +3. Configure Services to Start When the Server Boots + + * ...CONTENT LOADING.... + +4. Configure static IP address + + * ...CONTENT LOADING.... + +5. Changing the login name of eRegister + + ssh in to the server with `ssh openmrs@IPADDRESS` and then get into the running container with `sudo docker exec -it openmrseregister bash` then `vi /var/www/bahmniapps/i18n/home/locale_en.json` and then look for `LOGIN_PAGE_HEADER_TEXT` variable and change it accordingly. + +6. Create usernames for all health facility staff + + * browse to IPADDRESS/openmrs and login + * when logged in, go to Administration -> Manage Users -> Add User. Don't forget to search for the user's account before adding a new user account + * check on appropriate roles + +7. Enabled appropriate "locations" for login into the system + + * ssh in to the server with `ssh openmrs@IPADDRESS` and then get into the running container with `sudo docker exec -it openmrseregister bash` then `vi /var/www/bahmniapps/i18n/home/locale_en.json` and then `mysql -u root -p` enter password when prompted, then `use openmrs` and then run this query to see all location for your site. For example if you're in Lithipeng Health Center you can run `select location_id, name, description, retired from location where description like '%lithipeng%'` and then you'll something like this: + + +---------------+-----------------+--------------+------------+ + | location_id | name | description | retired | + +---------------+-----------------+--------------+------------+ + | 554 | Lithipeng HC | Lithipeng HC | 1 | + | 555 | ART/TB Clinic | Lithipeng HC | 1 | + | 556 | MCH Clinic | Lithipeng HC | 1 | + | 557 | HTS General OPD | Lithipeng HC | 1 | + +---------------+-----------------+--------------+------------+ + + 4 rows in set (0.00 sec) + + Then update retired to be 0 with `update set location retired=0 where location_id=554 AND location_id=555 AND location_id=556 AND location_id=557;` + + NB: Creation of locations is managed centrally and your role is just to enable/disable locations so that we mantain identical schemas of the database across all health facilities in the country. This will help in making Health Information Exchange easy. + +8. Automated Backups + + * ...CONTENT LOADING.... + +9. Blocking The Following Social Media Sites on the Wi-Fi router: + + * whatsapp.com + * facebook.com + * youtube.com + * instagram.com + * tiktok.com + * twitter.com + Browse to http://192.168.8.1 and login, then go to Settings -> Security -> Domain Name Filter, make sure the Blacklist radio button is selected, then Add the domains. Don't forget to change status to "on". + + NB: Make sure "Enable Domain Name Filter" is enabled in here Settings -> Firewall Switch + + \ No newline at end of file diff --git a/docs/ereg/intro.md b/docs/ereg/intro.md index 8021f11..5249297 100644 --- a/docs/ereg/intro.md +++ b/docs/ereg/intro.md @@ -1,3 +1,71 @@ -### eRegister Info +# eRegister Installation Manual -.....info loading.... \ No newline at end of file +!!! warning + * this guide is for Bahmni eRegister 0.90. For version 0.92, please refer to guide [here](upgrading-to-092.md) + +This document attempts to standardize how we prepare our servers to be ready for deployment at health facilities. + +Before we follow the steps on how to prepare the server, we first have to install Ubuntu Server 18.04 LTS from [Ubuntu Site](https://ubuntu.com/#download) + +## Installing Docker + +[![asciicast](https://asciinema.org/a/CZiacOPBRcmlOtjaVXcFUFohr.svg)](https://asciinema.org/a/CZiacOPBRcmlOtjaVXcFUFohr) + +* To install Docker, please follow the instructions detailed in [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) + +_these instructions above were written for Ubuntu 16 but work perfectly for Ubuntu 18_ + +## Pulling the docker image and running it as a container +* In situations of poor internet connectivity where we're committing and sharing images using sneakernet, please follow the guide in [here](Working-with-Docker-Images-Locally) +* To pull the docker, it's not necessary to login from the terminal, just run the following: +`docker pull omrsregrepo/bahmni_base:25012020_release` +* After the image has been pulled you should be able to see it when you do `docker images` +* A container is a running instance of an image. The last step is to run our image to make container with `docker run -e container_name=openmrseregister -it -d --restart always -p 443:443 -p 80:80 -p 8069:8069 -p 8000:8000 --privileged --name openmrseregister -v openmrseregister:/openmrseregister omrsregrepo/bahmni_base:25012020_release /bin/bash` +* To check that indeed we have a container running, you can do `docker ps`. +* Navigate into the container using the command,`docker exec -it openmrseregister bash` +* Once you have landed into the container, make sure that you're in the / directory and then start mysqld service with `services mysqld start`, login to a database without a password and then run the command below: +* `source openmrs.sql` +* After running the command above, do `use openmrs` and then do `source OpenMRS_Start_up_Schema_V1.sql` + + +## Starting Services +Often times, we're going to encounter situations where a container is running but the services inside the container are not, to start your services running the following commands in this order: + +* `service httpd start` +* `service mysqld start` +* `service openmrs start` +* `service bahmni-reports start` + +Now you should be able to see eRegister when you browse to http://server_IP/bahmni/home. *you'll use the IP address of your server* + +## Enabling/Disabling Locations + +Depending on the health facility where the server will be deployed, we'll have to either enable or disable locations in the database. +To do all of these, it is highly recommended that we run all of our sql queries through phpMyAdmin and shy away from using CLI. Browse to http://192.168.8.10/mydb and use the following credentials. *remember to use your IP address* + +* username: +* password: + +On the left pane, you'll see a list of databases, click on `openmrs`. All of the locations are managed by a `location` table. If for example you're in Motebang Hospital, to see all of the locations for Motebang Hospital, run the following query: + +`SELECT location_id, name, retired +FROM location +WHERE name LIKE '%mote%'` + + +`1` is for when retired is `TRUE` and `0` is when retired is `FALSE`. To enable locations we have to set retired to `0`. + * So it will be done with the following `UPDATE` query: +`UPDATE location +SET retired = 0, +WHERE location_id=121;` +to enable `Motebang Hospital` + * So it will be done with the following `UPDATE` query: +`UPDATE location +SET retired = 0, +WHERE location_id=122;` +to enable `ART Corner Motebang Hospital` +* ...and so on and so fourth... + + + ## Configuring Backup +CONTENT LOADING.... diff --git a/docs/ereg/odooreports.md b/docs/ereg/odooreports.md new file mode 100644 index 0000000..fb859ef --- /dev/null +++ b/docs/ereg/odooreports.md @@ -0,0 +1,4 @@ +# Odoo Reports Pipeline + +!!! warning + * Content coming soon... diff --git a/docs/ereg/reppull.md b/docs/ereg/reppull.md new file mode 100644 index 0000000..11866a8 --- /dev/null +++ b/docs/ereg/reppull.md @@ -0,0 +1,46 @@ +## Automated Pulling of Latest Changes from GitHub Repo + +* Get into the container by running `docker exec -it openmrseregister bash`. In the container, you'll land in `/` directory +* If it's not already there, create a folder in the root `/` directory with the following command: + + `mkdir -p scripts` + + NB: you don't need to do `sudo` because we're already logged into the container as `root` + +* Change directory into the `scripts` folder with `cd /scripts` +* Do `pwd` to make sure you're in `/scripts` folder +* Download the `git_sync_branch.sh` script by running `wget https://raw.githubusercontent.com/eRegister/scripts/master/git_sync_branch.sh` +* When you run `ls` you should now see the script. +* Make the script executable by running `chmod +x git_sync_branch.sh` +* You can test that the script is running fine by doing `bash -v git_sync_branch.sh` +* Now let's exit the container with `Exit` +* Now that you're outside the containder, change directory to `/usr/local/bin/` +* In the `/usr/local/bin/` directory create a new file with sudo `touch remote_git_sync_branch.sh` +* Open the `remote_git_sync_branch.sh` file with `sudo vi remote_git_sync_branch.sh` +* Add the following lines in `remote_git_sync_branch.sh` + + #!/usr/bin/env bash + docker exec -i openmrseregister sh /scripts/git_sync_branch.sh + +* Configure a cronjob to run the script everyday at 10:00am or anytime suiting, based on the facility's needs + * `crontab -e` if it's the first that command is bieng run, it'll probably prompt you to choose your preferred editor. I recommend nano because of its shallow learning curve. + * Then add this line: `0 10 * * * /usr/local/bin/remote_git_sync_branch.sh` +* Then lastly add a service to handle running this script + * Change directory to `/etc/systemd/system/` + * Create the file with `sudo touch git_sync_branch.service` + * Open the file with `sudo vi git_sync_branch.service` + * Add the following inside the `git_sync_branch.service` file + + `[Unit]` + + `After=docker.service` + + `[Service]` + + `ExecStart=/usr/local/bin/remote_git_sync_branch.sh` + + `Restart=always` + + `[Install]` + + `WantedBy=default.target` \ No newline at end of file diff --git a/docs/ereg/upgrading-to-092.md b/docs/ereg/upgrading-to-092.md new file mode 100644 index 0000000..35df8c9 --- /dev/null +++ b/docs/ereg/upgrading-to-092.md @@ -0,0 +1,153 @@ +# Upgrading to Bahmni 0.92 + +#### **Preparing Bahmni 0.90 Backup** + +---------------------------------------------------------------------------------- + +* First we have to take a proper backup of the system so that should the upgrade process be problematic, we have can resume facility activities with ease. +We can start by taking a backup of the database with `docker exec -it openmrseregister mysqldump -uroot -p openmrs > openmrs.sql`. This command will create the backup inside the container but put the sql file outside the container. +* Then we can commit the running container to take a snapshot of it as is with `docker commit openmrseregister omrsregrepo/bahmni_092:18052021` _you can use whatever date when doing this for your tag_ +* Before moving forward with the steps below, please make sure you have both the sql file and the docker image with `ls -lh`. The file openmrs.sql should be more than 100M, if in doubt, you can do `cat openmrs.sql` to see the file has content. Also do `docker images` and make sure you can see the image you just created. +* To prevent conflicting ports, we have to finally stop and kill the container with `docker stop openmrseregister` and remove it completely with `docker rm openmrseregister` + +!!! warning + * Please don't skip this step. It's very important to do the backup before upgrading!!! +---------------------------------------------------------------------------------- + +#### Installing Docker + +The hosting should already have docker installed, but if for some reason it's not installed, please refer to this [guide](intro.md) + +_Please go as far as installing docker only and then come back to this guide._ + +#### Installing Docker Compose + +To upgrade to version 0.92, we're going to use Docker Compose we're using more than one container. To install Docker Compose, copy and run the following: + +``` +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +``` + +Then make the binary file you just downloaded executable with the command below (copy and paste) + +``` +sudo chmod +x /usr/local/bin/docker-compose +``` +Check that everything is running well by running `docker-compose version` and you'll see something like this: +``` +docker-compose version 1.28.2, build 67630359 +docker-py version: 4.4.1 +CPython version: 3.7.9 +OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019 +``` +If you don't see anything, you might want to do `su $USER` to reload enviroment variables then do `docker-compose version` again. + +#### Installing Git + +Do `git version` to check if Git is already installed. If it's not, run `sudo apt install git` + +#### Setting up containers + +![docker-compose diagram](../pics/eregister_diagram.png ) + +Fig 1 - eRegister Bahmni 0.92 Diagram + +###### Preparing containers ###### + +* Go to home directory with `cd ~` +* Download the repo with docker-compose file: `git clone https://github.com/eRegister/bahmni_docker.git` +* Change directory into **docker_docker** folder with `cd docker_docker` +* Start the containers with `docker-compose up -d` + * _make sure you have internet connectivity because docker-compose is going to try do download the images to your serve_ +* After running the command abover, While still in **$HOME/docker_docker**, run `docker-compose ps` to check if the containers without any errors. You should see something like: +``` + Name Command State Ports +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +bahmni_docker_emr-service_1 /usr/sbin/init /usr/sbin/i ... Up 0.0.0.0:33062->3306/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:8000->8000/tcp, 0.0.0.0:8050->8050/tcp, 8053/tcp +bahmni_docker_erp-service_1 /usr/sbin/init /usr/sbin/i ... Up 0.0.0.0:8069->8069/tcp +``` +* The above output is also important as it shows names of the two containers created. Now we need to restore out backup into the new instance we just created by: + * copying `openmrs.sql` into the `bahmni_docker_emr-service_1` with `docker cp $HOME/openmrs.sql bahmni_docker_emr-service_1:/` + * get into the `bahmni_docker_emr-service_1` container with `docker exec -it bahmni_docker_emr-service_1 bash` + * run `ls` and you should see `openmrs.sql` + * get into the MySQL database with `mysql -u root -p` then enter password + * run `show databases` and you should see a list all databases which include a database called `openmrs`. + * delete the `openmrs` database with `drop database openmrs` + * recreate the database again with `create database openmrs` + * get into the database with `use openmrs`. Before running the command below, make sure you're in the (blank) openmrs database by running `select database()` and you will see a small table that confirms that indeed you're in the openmrs database. + * restore the backup with `source openmrs.sql` +* Then run `bahmni -ilocal start` to start services and daemons that Bahmni depend on. +* Go to `/var/www/` and run: + * sudo `rm bahmniapps` or `unlink bahmniapps` + * do `sudo ln –s /development/bahmni_apps_release/ bahmniapps` + * do `sudo ln –s /development/bahmni_config092/ bahmni_config_` +Browse to http://IP_of_eRegister/bahmni/home and check if the changes have been effected. +* Check that the system is running by browsing to http://SERVER_IP and you should see the new Bhamni 092 system as shown below: +* + +![Bahmni 092 after upgrade](../pics/bahmni092.png ) +Fig 2 - eRegister Bahmni 0.92 After Upgrade + +---------------------------------------------------------------------------------- + +##### **Configuring Automated Deployment** ##### + + +###### 0. PREPARATORY STEPS ###### +* SSH into the server with ssh `openmrs@_SERVER_IP_ADDRESS` +First check to see if your server has internet connectivity with ping github.com +Then download all of the files need with `git clone https://github.com/eRegister/docs.git` +The command above will create a folder called docs in /home/openmrs if you didn't change to another directory. All of files that need to be transferred to the server are in docs/scripts/: + * `gitpull_bahmniapps.service` + * `gitpull_bahmniapps.sh` + * `openmrs_global_properties` + * `serialized objects` + * `symbolic_creation.sh` + * `Visit_types.sql` + * etc. + +###### 1. CREATING A VOLUME ###### +* create development_emr directory `sudo mkdir -p /development_emr/bahmni_apps_release` +* change ownership of the new folder from root to openmrs with `sudo chown -R openmrs:openmrs /development_emr` because the service is managed by `openmrs` user +get into the directory with `cd /development_emr/bahmni_apps_release` + +###### 2. CONFIGURE BAHMNIAPPS SERVICES ###### + +* initialise new local git repo: `git init` (Do not use git clone) +* if you do `ls -a` you'll see a hidden `.git` to show that indeed the folder has been intialized +* connect local repository with remote: `git remote add origin https://github.com/eRegister/bahmniapps092beta.git` +* download the latest commits to the repo: `git fetch --all` you should see a log of all the latest commits downloading +* now go to the home directory: `cd ~` OR `cd $HOME` +* copy gitpull_bahmniapps.service file: `sudo cp gitpull_bahmniapps.service /etc/systemd/system/` +* move gitpull_bahmniapps.sh file: `sudo mv gitpull_bahmniapps.sh /development_emr/bahmni_apps_release` +* change directory `cd /development_emr/bahmni_apps_release/` make the script executable `sudo chmod +x gitpull_bahmniapps.sh` and `cat` +* check the contents of the script with `cat gitpull.sh` to make sure that it does `git fetch --all` and `git pull origin autobuildmaster` +* Nagivate into `/etc/systemd/system/` and type the following commands to register gitpull service in system + * `sudo chmod 664 gitpull_bahmniapps.service` + * `sudo systemctl daemon-reload` + * `sudo systemctl enable gitpull_bahmniapps.service` +!!! note +when the service has been registered successfully you should see created sym link in `/etc/systemd/system/defacat ult.target.wants/.` + +###### 3. CONFIGURING CRONJOB ###### + +* configure the cronjob to trigger the service Monday 9 am +* to edit the cronjob do: `sudo crontab -e` + * **if it's the first time running this command it'll probably ask you to choose the default text editor, please be kind enough to choose Nano as it's the easiest editor for most administrators.** +* configure the script to run within 2 mins just to make sure everything is running OK: +``` +*/2 * * * * systemctl restart gitpull_bahmniapps.service >> /var/log/gitpull_bahmniapps.log2>& +``` + +* inside the crontab editor write: +``` +* 7 * * mon systemctl restart gitpull_bahmniapps.service >> /var/log/gitpull_bahmniapps.log2>&1 +``` + +* Go to `/development_emr/bahmni_apps_release/` and check the status of **cron** service to see when it has executed **gitpull_bahmniapps** service, once done check the file by typing ll or ls. For some reason you may find that the service has not pulled the files from our remote repository, first thing to do is to check the status of the service if it has successfully started. If not, check the status code of the service to guide you what might gone wrong. The following table shows possible exit codes of the systemd service. Another possible reason it could be that you forgot to change the ownership of the development bahmni config release, check it. +* Another possible reason could be that the service in unable to fetch from remote repository which is not related to systemd service, check the logs of the service by typing `sudo tail -f /var/log/gitpull_bahmniapps.log` +* If gitpull service has pulled the bahmni config file then make a permanent configuration in cronjob to trigger the service every Monday 9am. +* inside the crontab editor write: +``` +* 7 * * mon systemctl restart gitpull.service >> /var/log/gitpull.log2>&1 +``` \ No newline at end of file diff --git a/docs/ereg/workingwithdockerlocally.md b/docs/ereg/workingwithdockerlocally.md index d473198..b882aee 100644 --- a/docs/ereg/workingwithdockerlocally.md +++ b/docs/ereg/workingwithdockerlocally.md @@ -1,3 +1,9 @@ # Working with Docker Images Locally -....info loading..... \ No newline at end of file +## Committing a Container locally +Alternatively, we can package all of the changes done on a running container locally by like so: +* First verify the name of your running container with `docker ps` and then, +* Commit all of the changes in a running container with `docker commit d76b19479a2f omrsregrepo/bahmni_base:24102019` *we normally use the date of committing a container as a tag* +* `docker save bahmni_base:24102019 | gzip > bahmni_base_24102019.tar.gz` +* The newly created tarball can be shared via USB stick and loaded with `docker load < bahmni_base_24102019.tar.gz` +* You should now see your newly loaded image when do `docker images` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 7e06dc6..99a1ab7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,5 @@ # Welcome to SI Project Docs This site is going to document all of the work that Lesotho's Ministry of Health has done on both DHIS2 and eRegister + +For more information, please see the contacts tab. \ No newline at end of file diff --git a/docs/informedpush/informedpush.md b/docs/informedpush/informedpush.md new file mode 100644 index 0000000..7f93ee8 --- /dev/null +++ b/docs/informedpush/informedpush.md @@ -0,0 +1,3 @@ +# Informed Push + +....Information for Informed Push Dataset \ No newline at end of file diff --git a/docs/informedpush/informedpusharv.md b/docs/informedpush/informedpusharv.md new file mode 100644 index 0000000..8e5f054 --- /dev/null +++ b/docs/informedpush/informedpusharv.md @@ -0,0 +1,3 @@ +# Informed Push ARV + +....Information for Informed Push ARV Dataset diff --git a/docs/odoo/Accounting.md b/docs/odoo/Accounting.md new file mode 100644 index 0000000..1a48396 --- /dev/null +++ b/docs/odoo/Accounting.md @@ -0,0 +1,18 @@ +#### Accounting Module + +This module has SALES and PURCHASES menus for Pharmacy + +#### Sales +Sales outlines the following sub-menus; +* Customer Invoices +* Sales Receipts +* Customers +* Sales Receipts +* Sellable Products + +#### Purchases +Purchases outlines the following sub-menus; +* Vendor Bills +* Purchase Receipts +* Vendors +* Purchasable Products \ No newline at end of file diff --git a/docs/odoo/Dispensary.md b/docs/odoo/Dispensary.md new file mode 100644 index 0000000..2648bd2 --- /dev/null +++ b/docs/odoo/Dispensary.md @@ -0,0 +1,42 @@ +#### Dispensing Module + +Dashboard: Dispensing Menu and Invoicing Menu + +#### Dispensing +Dispensing sub-menus; + +* ###### Clients + * _all frontend changes done related to Odoo Customers, renamed to Clients_ + +* ###### Prescriptions + * _all frontend changes done related to Odoo Quotations, renamed to Prescription_ + +* ###### Dispensing Orders + * _all frontend changes done related to Odoo Sales Orders, renamed to Dispensing Orders_ + +* ###### Products + * _all frontend changes done related to Odoo Products_ + + +* #### Dispensing Updates + * _Top Menu item (Sales) changed to Dispensing_ + * _Left Menu item under “Dashboard” (Sales) changed to Dispensing_ + * _Left Menu item under “Dispensing” (Customers) changed to Clients_ + * _Left Menu item under “Dispensing” (Quotations) changed to Prescriptions_ + * _Left Menu item under “Dispensing” (Sales Orders) changed to Dispensing Orders_ + * _Left Menu item under “Configuration” (Shop) changed to Dispensary_ + * _Confirm Sale button changed to confirm dispensing_ + * _Inside Prescriptions: New modified fields { `Prescription number`, `Prescription Date`, `Client, Dispensary`, `Pharmacy Staff`, `Provider name`, `Service Point and Status` } + * _Inside Each Prescription: Locations changed to Pharmacy Locations, removal of Tax and other associated Costs_ + * _Inside Dispensing Orders: New modified fields { `Prescription number`, `Prescription Date`, `Client`, `Pharmacy Staff`}, sales buttons changed to Dispense and new medical kit icon_ + * _Files Changed: `Odoo_addons/sale/views/sale_views.xml`, `Odoo_addons/base/views/res_partner_view.xml`, `Bahmni_addons/views/sale/views/sales_order_views.xml` + + + +#### Invoicing +Invoicing sub-menus; +* ###### Sales to Invoice + * _all frontend changes done related to Sales to Invoice_ + +* ###### Orders to Upsell + * _all frontend changes done related to Orders to Upsell_ \ No newline at end of file diff --git a/docs/odoo/Overview.md b/docs/odoo/Overview.md new file mode 100644 index 0000000..90d7f57 --- /dev/null +++ b/docs/odoo/Overview.md @@ -0,0 +1,10 @@ + +Modules with notable updates: Sales, Purchases +Modules without notable updates: Point Of Sale, Inventory, Accounting + +- Odoo UI changes are stored on the two sub-repositories on eRegister repository namely: bahmni_addons and odoo_addons. +- Bahmni_addons simlink creation must point to the directory: opt/bahmni-erp/bahmni-addons +- Odoo_addons simlink creation must point to the directory: opt/bahmni-erp/odoo/addons +- After creation of Sim links: “systemctl restart odoo.service” command updates the UI accordingly. + + diff --git a/docs/odoo/Requisition.md b/docs/odoo/Requisition.md new file mode 100644 index 0000000..4140fed --- /dev/null +++ b/docs/odoo/Requisition.md @@ -0,0 +1,7 @@ + + +Top Menu item (Purchases) changed to Requisitions +Left Menu item under “Dashboard” (Sales) changed to Product Requisitions +Left Menu item under “Product Requisitions” changed to Clients Request for product(s) +Left Menu item under “Request for product(s)” changed to Requisition Orders +Files Changed: Odoo_addons/views/purchase_views.xml diff --git a/docs/pics/TB_patient_flow.png b/docs/pics/TB_patient_flow.png new file mode 100644 index 0000000..4cf847c Binary files /dev/null and b/docs/pics/TB_patient_flow.png differ diff --git a/docs/pics/TB_patient_flow_2.png b/docs/pics/TB_patient_flow_2.png new file mode 100644 index 0000000..f505ac1 Binary files /dev/null and b/docs/pics/TB_patient_flow_2.png differ diff --git a/docs/pics/apps1.png b/docs/pics/apps1.png new file mode 100644 index 0000000..20d38b9 Binary files /dev/null and b/docs/pics/apps1.png differ diff --git a/docs/pics/apps2.png b/docs/pics/apps2.png new file mode 100644 index 0000000..66e7d2a Binary files /dev/null and b/docs/pics/apps2.png differ diff --git a/docs/pics/bahmni092.png b/docs/pics/bahmni092.png new file mode 100644 index 0000000..66c4248 Binary files /dev/null and b/docs/pics/bahmni092.png differ diff --git a/docs/pics/eregister_diagram.png b/docs/pics/eregister_diagram.png new file mode 100644 index 0000000..854ed28 Binary files /dev/null and b/docs/pics/eregister_diagram.png differ diff --git a/mkdocs-material b/mkdocs-material new file mode 160000 index 0000000..06db2f6 --- /dev/null +++ b/mkdocs-material @@ -0,0 +1 @@ +Subproject commit 06db2f64bd706708a4b00917e5f1dcb94300c9bf diff --git a/mkdocs.yml b/mkdocs.yml index f472271..188b471 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,48 +1,115 @@ # Project information -site_name: Lesotho Health Documentation +site_name: Lesotho Health SI Systems Documentation site_description: "Technical documentation for Lesotho's Health Systems" site_author: "Ministry of Health" -site_url: "" +# Repo +repo_name: eRegister/Documentation +site_url: https://github.com/eRegister/docs # Copyright copyright: "Copyright © 2020 Ministry of Health - Lesotho" # Theme theme: - name: "material" - palette: - primary: "#2d3479" - accent: "indigo" - language: "en" - features: - - tabs - font: - text: "Roboto" - code: "Roboto Mono" - + name: "material" + palette: + primary: "#2d3479" + accent: "indigo" + language: "en" + features: + - navigation.tabs + font: + text: "Roboto" + code: "Roboto Mono" # Nagivation nav: - - Overview: - - 'index.md' - - 'contacts.md' - - DHIS2: - - 'User Manual': - - 'dhis2/usermanual.md' - - 'DataSets': - - 'dhis2/intro.md' - - 'dhis2/hts.md' - - 'dhis2/tb.md' - - 'dhis2/hiv-care-n-tx.md' - - 'Technical Manual': - - 'dhis2/installation.md' - - eRegister: - - 'User Manual': - - 'dhis2/intro.md' - - 'Technical Manual': - - 'ereg/intro.md' - - 'ereg/workwithdockerlocally.md' - - 'ereg/FAQs.md' - - 'ereg/clienregistry.md' - - 'ereg/facilityimplementationchecklist.md' - - 'ereg/automateddeployment.md' \ No newline at end of file + - Overview: + - "index.md" + - "contacts.md" + - DHIS2: + - "User Manual": + - "dhis2/usermanual.md" + - "DataSets": + - "dhis2/intro.md" + - "dhis2/hts.md" + - "dhis2/tb.md" + - "dhis2/tb-indicators.md" + - "dhis2/tb-validation-rules.md" + - "dhis2/hiv-care-n-tx.md" + - "Technical Manual": + - "dhis2/installation.md" + - Informed Push: + - "informedpush/informedpush.md" + - "informedpush/informedpusharv.md" + - eRegister: + - "ereg/eRegister-092-Release-Notes.md" + - "User Manual": + - "ereg/TB_Program.md" + - "Technical Manual": + - "ereg/intro.md" + - "ereg/workingwithdockerlocally.md" + - "ereg/FAQs.md" + - "ereg/clientregistry.md" + - "ereg/facilityimplementationchecklist.md" + - "ereg/Integration-DHIS2.md" + - "ereg/upgrading-to-092.md" + - "Automated Deployment": + - "ereg/bahmniconfigs.md" + - "ereg/bahmniapps.md" + - "ereg/bahmniaddons.md" + - "ereg/odooreports.md" + - "ereg/DeployingMappings.md" + - "ereg/clinicalsearch.md" + - COVID-19: + - "covid/Overview.md" + - "Data Entry Guidelines": + - "covid/Registering-a-Case-or-Suspect.md" + - "covid/Capturing-Weekly-Aggregate-Data.md" + - "covid/Using-Mobile-Devices.md" + - "Technical": + - "covid/Alerts.md" + - "covid/Weekly-Report.md" + - "covid/Validation-Rules.md" + - "covid/Indicators.md" + - "covid/Program-Indicators.md" + - "covid/Program_Rules.md" + - "covid/How-To-Prepare-Docker-Training-Instance.md" + - Odoo-Pharmacy: + - "odoo/Overview.md" + - "Pharmacy Module Guideline": + - "odoo/Dispensary.md" + - "odoo/Accounting.md" + - "Technical": + - "odoo/Menu-Setup.md" + - About Us: + - "covid/About-Us.md" + +markdown_extensions: + - admonition: + - codehilite: + guess_lang: false + - toc: + toc_depth: "1-1" +plugins: + - search + - git-revision-date-localized + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/eRegister/docs +#### + +# EXTENSIONS NOT WORKING - i don't know why. I'll figure it out + +# markdown_extensions: +# - codehilite: +# guess_lang: false +# - toc: +# toc_depth : "1-1" +# - footnotes + +# plugins: +# - pdf-export: +# combined: true diff --git a/scripts/gitpull-concepts.service b/scripts/gitpull-concepts.service new file mode 100644 index 0000000..849df29 --- /dev/null +++ b/scripts/gitpull-concepts.service @@ -0,0 +1,20 @@ +[Unit] +Description=Bahmni continuous deployment [For Drug Concepts] +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/eregister_concepts_release +ExecStart=/development/eregister_concepts_release/restore_concepts.sh +StandardOutput=file:/var/log/restore_concepts.log +StandardOutput=file:/var/log/restore_conceptsbugs.log + +User=administrator +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/scripts/gitpull.service b/scripts/gitpull.service new file mode 100644 index 0000000..da10385 --- /dev/null +++ b/scripts/gitpull.service @@ -0,0 +1,20 @@ +[Unit] +Description=Bahmni continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/bahmni_config_release +ExecStart=/development/bahmni_config_release/gitpull.sh +StandardOutput=file:/var/log/gitpull.log +StandardOutput=file:/var/log/gitpullbugs.log + +User=openmrs +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target diff --git a/scripts/gitpull.sh b/scripts/gitpull.sh new file mode 100644 index 0000000..55cf538 --- /dev/null +++ b/scripts/gitpull.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +git fetch --all +git pull origin master diff --git a/scripts/gitpull_bahmniapps.service b/scripts/gitpull_bahmniapps.service new file mode 100644 index 0000000..8f5da27 --- /dev/null +++ b/scripts/gitpull_bahmniapps.service @@ -0,0 +1,20 @@ +[Unit] +Description=Bahmni Apps continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/bahmni_apps_release +ExecStart=/development/bahmni_apps_release/gitpull_bahmniapps.sh +StandardOutput=file:/var/log/gitpull_bahmniapps.log +StandardOutput=file:/var/log/gitpull_bahmniappsbugs.log + +User=administrator +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target diff --git a/scripts/gitpull_bahmniapps.sh b/scripts/gitpull_bahmniapps.sh new file mode 100755 index 0000000..a3010db --- /dev/null +++ b/scripts/gitpull_bahmniapps.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +git fetch --all +git pull origin autobuildmaster diff --git a/scripts/mappingsscripts/concepts_restore.sh b/scripts/mappingsscripts/concepts_restore.sh new file mode 100644 index 0000000..248a69c --- /dev/null +++ b/scripts/mappingsscripts/concepts_restore.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker exec -i openmrseregister /usr/bin/mysql -u root --password=password openmrs < /development/eregister_concepts_release/omrs_concept_dictionary.sql diff --git a/scripts/mappingsscripts/gitpull_bahmniapps.sh b/scripts/mappingsscripts/gitpull_bahmniapps.sh new file mode 100644 index 0000000..efd804d --- /dev/null +++ b/scripts/mappingsscripts/gitpull_bahmniapps.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +git fetch --all + +git pull origin master diff --git a/scripts/mappingsscripts/gitpull_concepts.sh b/scripts/mappingsscripts/gitpull_concepts.sh new file mode 100644 index 0000000..efd804d --- /dev/null +++ b/scripts/mappingsscripts/gitpull_concepts.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +git fetch --all + +git pull origin master diff --git a/scripts/mappingsscripts/gitpull_mappings.sh b/scripts/mappingsscripts/gitpull_mappings.sh new file mode 100644 index 0000000..efd804d --- /dev/null +++ b/scripts/mappingsscripts/gitpull_mappings.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +git fetch --all + +git pull origin master diff --git a/scripts/mappingsscripts/gitpull_serial.sh b/scripts/mappingsscripts/gitpull_serial.sh new file mode 100644 index 0000000..c6d8ed5 --- /dev/null +++ b/scripts/mappingsscripts/gitpull_serial.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +git fetch -all +git pull origin master diff --git a/scripts/mappingsscripts/gitpullbahmniapps.service b/scripts/mappingsscripts/gitpullbahmniapps.service new file mode 100644 index 0000000..a69f4f1 --- /dev/null +++ b/scripts/mappingsscripts/gitpullbahmniapps.service @@ -0,0 +1,20 @@ +[Unit] +Description=Bahmniapps continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/bahmniapps_release +ExecStart=/development/bahmniapps_release/gitpull_bahmniapps.sh + + +User=openmrs +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target + diff --git a/scripts/mappingsscripts/gitpullconcepts.service b/scripts/mappingsscripts/gitpullconcepts.service new file mode 100644 index 0000000..8d09fb7 --- /dev/null +++ b/scripts/mappingsscripts/gitpullconcepts.service @@ -0,0 +1,19 @@ +[Unit] +Description=Bahmni continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/openmrs_concepts_release +ExecStart=/development/openmrs_concepts_release/gitpull_concepts.sh + + +User=openmrs +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target diff --git a/scripts/mappingsscripts/gitpullmappings.service b/scripts/mappingsscripts/gitpullmappings.service new file mode 100644 index 0000000..7766fb8 --- /dev/null +++ b/scripts/mappingsscripts/gitpullmappings.service @@ -0,0 +1,20 @@ +[Unit] +Description=Mappings continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/dhisconnector_mappings +ExecStart=/development/dhisconnector_mappings/gitpull_mappings.sh + + +User=openmrs +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target + diff --git a/scripts/mappingsscripts/gitpullserializedobject.service b/scripts/mappingsscripts/gitpullserializedobject.service new file mode 100644 index 0000000..614450e --- /dev/null +++ b/scripts/mappingsscripts/gitpullserializedobject.service @@ -0,0 +1,19 @@ +[Unit] +Description=Serialized Onject continuous deployment +After=docker.service +After=mysqlbootstrap.service +After=dockerbootstrap.service + + +[Service] +WorkingDirectory=/development/openmrs_reporting_release +ExecStart=/development/openmrs_reporting_release/gitpull_serial.sh + + +User=openmrs +RestartSec=10 +Restart=always + + +[Install] +WantedBy=default.target diff --git a/scripts/mappingsscripts/serializedobject_restore.sh b/scripts/mappingsscripts/serializedobject_restore.sh new file mode 100644 index 0000000..f8c5ffb --- /dev/null +++ b/scripts/mappingsscripts/serializedobject_restore.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker exec -i openmrseregister /usr/bin/mysql -u root --password=password openmrs < /development/openmrs_reporting_release/Serialized_Object.sql + diff --git a/scripts/openmrs_global_property_07052020.sql b/scripts/openmrs_global_property_07052020.sql new file mode 100644 index 0000000..c6f0063 --- /dev/null +++ b/scripts/openmrs_global_property_07052020.sql @@ -0,0 +1,63 @@ +-- MySQL dump 10.13 Distrib 5.6.40, for Linux (x86_64) +-- +-- Host: localhost Database: openmrs +-- ------------------------------------------------------ +-- Server version 5.6.40 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `global_property` +-- + +DROP TABLE IF EXISTS `global_property`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `global_property` ( + `property` varchar(255) NOT NULL DEFAULT '', + `property_value` text, + `description` text, + `uuid` char(38) NOT NULL, + `datatype` varchar(255) DEFAULT NULL, + `datatype_config` text, + `preferred_handler` varchar(255) DEFAULT NULL, + `handler_config` text, + `date_changed` datetime DEFAULT NULL, + `changed_by` int(11) DEFAULT NULL, + PRIMARY KEY (`property`), + UNIQUE KEY `global_property_uuid_index` (`uuid`), + KEY `global_property_property_index` (`property`), + KEY `global_property_changed_by` (`changed_by`), + CONSTRAINT `global_property_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `global_property` +-- + +LOCK TABLES `global_property` WRITE; +/*!40000 ALTER TABLE `global_property` DISABLE KEYS */; +INSERT INTO `global_property` VALUES ('addresshierarchy.addressToEntryMapUpdaterLastStartTime',NULL,'The module uses this field to store when the AddressToEntryMapUpdater task was last started; DO NOT MODIFY','702f273e-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.allowFreetext','true','Valid values: true/false. When overriding the address portlet, allow the entry of free text for address fields associated with the address hierarchy by providing an \"Other\" option','702f461a-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.database_version','2.10.0','DO NOT MODIFY. Current database version number for the addresshierarchy module.','702f6ccb-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.enableOverrideOfAddressPortlet','true','Valid values: true/false. When enabled, the existing \"edit\" component of the address portlet is overridden by the new functionality provided by the address hierarchy module','702f8db1-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.initializeAddressHierarchyCacheOnStartup','true','Sets whether to initialize the address hierarchy in-memory cache (which is used to speed up address hierarchy searches. Generally, you want to set this to \"true\", though developers may want to set it to false during development to speed module start-up.','702fb052-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.mandatory','false','true/false whether or not the addresshierarchy module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','702fd8be-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.soundexProcessor',NULL,'If the Name Phonetics module is installed, this defines the name of a soundex algorithm used by the getPossibleFullAddresses service method.','70300408-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('addresshierarchy.started','true','DO NOT MODIFY. true/false whether or not the addresshierarchy module has been started. This is used to make sure modules that were running prior to a restart are started again','ac871c38-79e8-4a11-a9be-2e2111127f31',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.allergen.ConceptClasses','Drug,MedSet','A comma-separated list of the allowed concept classes for the allergen field of the allergy dialog','4d1380bb-6c28-4310-993f-88f786863130',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.allergen.drug','162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the drug allergens concept','eaec1e70-b81e-4f6d-8a3a-a4989a4904a1',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.allergen.environment','162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the environment allergens concept','25098738-6de6-45a2-aeba-5fe520847a91',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.allergen.food','162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the food allergens concept','60782b4e-1079-4949-beaa-010fe2b4764a',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.otherNonCoded','5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the allergy other non coded concept','23619e2f-1414-4db1-8229-e0743a65ee44',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.reactions','162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the allergy reactions concept','929a60c9-e57b-4f77-b0a9-e8e608858776',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.severity.mild','1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the MILD severity concept','4e97d0ed-d225-43a7-a626-697bc17dfb43',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.severity.moderate','1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the MODERATE severity concept','9b18b5a2-6961-4a14-ab40-3db611761e39',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.severity.severe','1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the SEVERE severity concept','fa277c6d-9b52-4517-8521-03f6986da79b',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.concept.unknown','1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','UUID for the allergy unknown concept','33fe0f23-294b-45c1-8c65-b49b7351075e',NULL,NULL,NULL,NULL,NULL,NULL),('allergy.reaction.ConceptClasses','Symptom','A comma-separated list of the allowed concept classes for the reaction field of the allergy dialog','70638dbd-a266-4021-bc33-ce139b6978ec',NULL,NULL,NULL,NULL,NULL,NULL),('allowMultipleLoginLocation','false','Allow Connect app to login via Multiple login locations','f483061c-5fd7-4382-962f-5883a448c289',NULL,NULL,NULL,NULL,NULL,NULL),('appframework.mandatory','false','true/false whether or not the appframework module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','87adb5ce-c13a-42fe-b1c8-e6917d8c1471',NULL,NULL,NULL,NULL,NULL,NULL),('appframework.started','true','DO NOT MODIFY. true/false whether or not the appframework module has been started. This is used to make sure modules that were running prior to a restart are started again','38f8f7ca-8586-4213-af9f-c41f032e73d2',NULL,NULL,NULL,NULL,NULL,NULL),('application.name','OpenMRS','The name of this application, as presented to the user, for example on the login and welcome pages.','eafa45ee-c9d3-4c4f-a810-2a373f6e4c35',NULL,NULL,NULL,NULL,NULL,NULL),('appointments.mandatory','false','true/false whether or not the appointments module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','86d62cac-c8aa-4ea4-af3b-291dc42680b9',NULL,NULL,NULL,NULL,NULL,NULL),('appointments.started','true','DO NOT MODIFY. true/false whether or not the appointments module has been started. This is used to make sure modules that were running prior to a restart are started again','dc881e73-bcbe-4ea4-8563-4172fdb095c4',NULL,NULL,NULL,NULL,NULL,NULL),('aqs.config.path','Configure AQS config path','Add the AQS Config path here','bfb33957-b7fb-11e4-9c67-080027b662ec',NULL,NULL,NULL,NULL,NULL,NULL),('atomfeed.event.urlPatternForPatientRelationshipChange',NULL,'URL pattern to use for published relationship events. Default is /openmrs/ws/rest/v1/relationship/%s','43476b97-5572-11e6-8be9-0800270d80ce',NULL,NULL,NULL,NULL,NULL,NULL),('atomfeed.event.urlPatternForProgramStateChange',NULL,'URL pattern to use for published program events. Default is /openmrs/ws/rest/v1/programenrollment/{uuid}?v=full','435e0a54-5572-11e6-8be9-0800270d80ce',NULL,NULL,NULL,NULL,NULL,NULL),('atomfeed.publish.eventsForPatientProgramStateChange',NULL,'If set true, events related to program changes are published','435c645f-5572-11e6-8be9-0800270d80ce',NULL,NULL,NULL,NULL,NULL,NULL),('atomfeed.publish.eventsForPatientRelationshipChange',NULL,'If set true, events related to relationship changes are published','4345c218-5572-11e6-8be9-0800270d80ce',NULL,NULL,NULL,NULL,NULL,NULL),('auditlog.mandatory','false','true/false whether or not the auditlog module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','9af059e1-3322-4ebb-ab72-16e1648faba6',NULL,NULL,NULL,NULL,NULL,NULL),('auditlog.started','true','DO NOT MODIFY. true/false whether or not the auditlog module has been started. This is used to make sure modules that were running prior to a restart are started again','55c9ca11-2a24-4bae-8f3e-502f023eb4ab',NULL,NULL,NULL,NULL,NULL,NULL),('bacteriology.mandatory','false','true/false whether or not the bacteriology module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','e146b819-023e-46c7-bcdf-bfa5085a6c9c',NULL,NULL,NULL,NULL,NULL,NULL),('bacteriology.started','true','DO NOT MODIFY. true/false whether or not the bacteriology module has been started. This is used to make sure modules that were running prior to a restart are started again','83665cce-63c1-44eb-93ef-6c6c6ffe35b8',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.cacheHeadersFilter.expiresDuration','0','Expires duration in minutes','672dc790-e0b6-11e3-8b68-0800200c9a66',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.enableAuditLog','true','Enable or disable audit log','6521cd7a-2aff-4521-b65c-8cb784b177ee',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.encountersession.duration','60','Encountersession duration in minutes','81ef037d-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.encounterType.default','Consultation','Default Encounter Type','01ddaa00-1bc9-11e5-87fc-080027b662ec',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.extraPatientIdentifierTypes','5c1e8ae2-33c6-11e8-8236-0242ac110002,3cdb2f37-33c7-11e8-8236-0242ac110002,0d2ac572-8de3-46c8-9976-1f78899c599f,588f45f8-33ca-11e8-8236-0242ac110002,07f2dc6b-ac44-410d-918d-7d7d685dcabc,d2084c23-edae-4b0f-98a2-cbcdb6708294','A list of UUIDs indicating extra Patient Identifier Types that should be displayed','25133c8e-6923-41fa-9319-81615843454d',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.forms.directory','/home/bahmni/clinical_forms/','Filesystem path for saving the bahmni forms','fb41ee2e-9eb4-4fce-8157-d98485ad668c',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.formTranslations.directory','/home/bahmni/clinical_forms/translations','Filesystem path for saving the bahmni forms translations','a8d99000-30d1-4e1d-8068-cdf6b221e9cb',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.ie.apps.mandatory','false','true/false whether or not the bahmni.ie.apps module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','a3d837fc-936f-4a30-be23-ab24ad07640c',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.ie.apps.started','true','DO NOT MODIFY. true/false whether or not the bahmni.ie.apps module has been started. This is used to make sure modules that were running prior to a restart are started again','f3c61b77-3c89-43d6-847d-06ec343b7543',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.primaryIdentifierType','81433852-3f10-11e4-adec-0800271c1b75','Primary identifier type for looking up patients, generating barcodes, etc','70683b08-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.relationshipTypeMap','{\"provider\":[\"Doctor\"],\"patient\":[\"Parent\",\"Sibling\"]}','Relationships type maps for providers','03f63077-4c7a-11e5-9192-080027b662ec',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.sqlGet.pastAppointments','SELECT\r\n app_service.name AS `DASHBOARD_APPOINTMENTS_SERVICE_KEY`,\r\n app_service_type.name AS `DASHBOARD_APPOINTMENTS_SERVICE_TYPE_KEY`,\r\n DATE_FORMAT(start_date_time, \"%d/%m/%Y\") AS `DASHBOARD_APPOINTMENTS_DATE_KEY`,\r\n CONCAT(DATE_FORMAT(start_date_time, \"%l:%i %p\"), \" - \", DATE_FORMAT(end_date_time, \"%l:%i %p\")) AS `DASHBOARD_APPOINTMENTS_SLOT_KEY`,\r\n CONCAT(pn.given_name, \' \', pn.family_name) AS `DASHBOARD_APPOINTMENTS_PROVIDER_KEY`,\r\n pa.status AS `DASHBOARD_APPOINTMENTS_STATUS_KEY`\r\nFROM\r\n patient_appointment pa\r\n JOIN person p ON p.person_id = pa.patient_id AND pa.voided IS FALSE\r\n JOIN appointment_service app_service\r\n ON app_service.appointment_service_id = pa.appointment_service_id AND app_service.voided IS FALSE\r\n LEFT JOIN provider prov ON prov.provider_id = pa.provider_id AND prov.retired IS FALSE\r\n LEFT JOIN person_name pn ON pn.person_id = prov.person_id AND pn.voided IS FALSE\r\n LEFT JOIN appointment_service_type app_service_type\r\n ON app_service_type.appointment_service_type_id = pa.appointment_service_type_id\r\n WHERE p.uuid = ${patientUuid} AND start_date_time < CURDATE() AND (app_service_type.voided IS FALSE OR app_service_type.voided IS NULL)\r\n ORDER BY start_date_time DESC\r\n LIMIT 5;','Past appointments for patient','7b3ff3a5-250f-11e8-a31f-0242ac110002',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.sqlGet.upComingAppointments','SELECT\r\n app_service.name AS `DASHBOARD_APPOINTMENTS_SERVICE_KEY`,\r\n app_service_type.name AS `DASHBOARD_APPOINTMENTS_SERVICE_TYPE_KEY`,\r\n DATE_FORMAT(start_date_time, \"%d/%m/%Y\") AS `DASHBOARD_APPOINTMENTS_DATE_KEY`,\r\n CONCAT(DATE_FORMAT(start_date_time, \"%l:%i %p\"), \" - \", DATE_FORMAT(end_date_time, \"%l:%i %p\")) AS `DASHBOARD_APPOINTMENTS_SLOT_KEY`,\r\n CONCAT(pn.given_name, \' \', pn.family_name) AS `DASHBOARD_APPOINTMENTS_PROVIDER_KEY`,\r\n pa.status AS `DASHBOARD_APPOINTMENTS_STATUS_KEY`\r\nFROM\r\n patient_appointment pa\r\n JOIN person p ON p.person_id = pa.patient_id AND pa.voided IS FALSE\r\n JOIN appointment_service app_service\r\n ON app_service.appointment_service_id = pa.appointment_service_id AND app_service.voided IS FALSE\r\n LEFT JOIN provider prov ON prov.provider_id = pa.provider_id AND prov.retired IS FALSE\r\n LEFT JOIN person_name pn ON pn.person_id = prov.person_id AND pn.voided IS FALSE\r\n LEFT JOIN appointment_service_type app_service_type\r\n ON app_service_type.appointment_service_type_id = pa.appointment_service_type_id\r\nWHERE p.uuid = ${patientUuid} AND\r\n start_date_time >= CURDATE() AND\r\n (app_service_type.voided IS FALSE OR app_service_type.voided IS NULL)\r\nORDER BY start_date_time ASC;','Upcoming appointments for patient','7b439234-250f-11e8-a31f-0242ac110002',NULL,NULL,NULL,NULL,NULL,NULL),('bahmni.visitMatcher','org.bahmni.module.bahmniOfflineSync.OfflineVisitMatcher','visit matcher for offline','37433e34-7ba1-48b0-a99b-3f73978fe3b5',NULL,NULL,NULL,NULL,NULL,NULL),('bahmniconnect.initsync.directory','/home/bahmni/init_sync','Initial sync artifacts directory for connect app','a2b879d1-67da-44d2-b043-8320bb8080af',NULL,NULL,NULL,NULL,NULL,NULL),('bahmnicore.mandatory','false','true/false whether or not the bahmnicore module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','442643d1-2beb-4eee-a055-6b43a71180c4',NULL,NULL,NULL,NULL,NULL,NULL),('bahmnicore.started','true','DO NOT MODIFY. true/false whether or not the bahmnicore module has been started. This is used to make sure modules that were running prior to a restart are started again','b2db719e-c0c6-4a65-b8ee-9cdcd5e07031',NULL,NULL,NULL,NULL,NULL,NULL),('bahmniOfflineSync.mandatory','false','true/false whether or not the bahmniOfflineSync module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','e1b11c09-be5f-4704-9d2b-1a0f95a33f04',NULL,NULL,NULL,NULL,NULL,NULL),('bahmniOfflineSync.started','true','DO NOT MODIFY. true/false whether or not the bahmniOfflineSync module has been started. This is used to make sure modules that were running prior to a restart are started again','ad801c3c-9cb3-4532-adcd-dffba923418d',NULL,NULL,NULL,NULL,NULL,NULL),('bahmniOfflineSync.strategy',NULL,'custom filter evaluator','792e6cd8-9b1d-11e8-aad8-0242ac110002',NULL,NULL,NULL,NULL,NULL,NULL),('bedmanagement.mandatory','false','true/false whether or not the bedmanagement module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','1678049f-6a44-4ff6-9cc3-b3f8cd58ebad',NULL,NULL,NULL,NULL,NULL,NULL),('bedmanagement.started','true','DO NOT MODIFY. true/false whether or not the bedmanagement module has been started. This is used to make sure modules that were running prior to a restart are started again','70ce745b-d7fe-43f6-8452-4f68bbaaada0',NULL,NULL,NULL,NULL,NULL,NULL),('calculation.mandatory','false','true/false whether or not the calculation module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','f88cb781-ddf3-4dc4-bbb2-4b12a389fb1b',NULL,NULL,NULL,NULL,NULL,NULL),('calculation.started','true','DO NOT MODIFY. true/false whether or not the calculation module has been started. This is used to make sure modules that were running prior to a restart are started again','820b3bec-7a78-4a37-922c-7598d28dc590',NULL,NULL,NULL,NULL,NULL,NULL),('concept.caseSensitiveNamesInConceptNameTable','true','Indicates whether names in the concept_name table are case sensitive or not. Setting this to false for MySQL with a case insensitive collation improves search performance.','4a8c8fdb-a26d-4a7e-b0ac-d798d16fe077',NULL,NULL,NULL,NULL,NULL,NULL),('concept.causeOfDeath','5002','Concept id of the concept defining the CAUSE OF DEATH concept','81860120-b52f-4de4-b24d-195d6f73c56c',NULL,NULL,NULL,NULL,NULL,NULL),('concept.defaultConceptMapType','NARROWER-THAN','Default concept map type which is used when no other is set','9974b56a-9110-4828-bffa-c5fa58352df7',NULL,NULL,NULL,NULL,NULL,NULL),('concept.false','2','Concept id of the concept defining the FALSE boolean concept','d3f13d8c-a37d-4a3e-a2ca-4374d3231d4e',NULL,NULL,NULL,NULL,NULL,NULL),('concept.height','5090','Concept id of the concept defining the HEIGHT concept','5e517d4e-2150-48bc-bb94-64d44eef0146',NULL,NULL,NULL,NULL,NULL,NULL),('concept.medicalRecordObservations','1238','The concept id of the MEDICAL_RECORD_OBSERVATIONS concept. This concept_id is presumed to be the generic grouping (obr) concept in hl7 messages. An obs_group row is not created for this concept.','59922a66-f741-413b-a130-1be2d1a5c9c0',NULL,NULL,NULL,NULL,NULL,NULL),('concept.none','1107','Concept id of the concept defining the NONE concept','3c004f2b-193a-4126-8acb-222f19685693',NULL,NULL,NULL,NULL,NULL,NULL),('concept.otherNonCoded','5622','Concept id of the concept defining the OTHER NON-CODED concept','784d26cb-4476-48eb-8672-a76ebedf839f',NULL,NULL,NULL,NULL,NULL,NULL),('concept.patientDied','3650','Concept id of the concept defining the PATIENT DIED concept','dc19e195-1142-4813-951a-95f8e7503a8b',NULL,NULL,NULL,NULL,NULL,NULL),('concept.problemList','1284','The concept id of the PROBLEM LIST concept. This concept_id is presumed to be the generic grouping (obr) concept in hl7 messages. An obs_group row is not created for this concept.','90239244-e178-4bff-b5f1-1df4cdcaef58',NULL,NULL,NULL,NULL,NULL,NULL),('concept.reasonExitedCare',NULL,'Concept id of the concept defining the REASON EXITED CARE concept','8b099986-5217-4a28-93aa-ba7f802f35ce',NULL,NULL,NULL,NULL,NULL,NULL),('concept.reasonForDeath','Reason For Death','Fully Specified name of the Concept Set created as Reasons for death','40f5ee5f-4c79-11e5-9192-080027b662ec',NULL,NULL,NULL,NULL,NULL,NULL),('concept.reasonOrderStopped','1812','Concept id of the concept defining the REASON ORDER STOPPED concept','6b234867-dfa4-4504-96b7-c90dc1370f3f',NULL,NULL,NULL,NULL,NULL,NULL),('concept.true','1','Concept id of the concept defining the TRUE boolean concept','e96c233a-ad0d-4304-aca8-b45f8ed0ccd2',NULL,NULL,NULL,NULL,NULL,NULL),('concept.weight','5089','Concept id of the concept defining the WEIGHT concept','e2ac406f-0c0f-415b-a4fd-a7db5828941d',NULL,NULL,NULL,NULL,NULL,NULL),('conceptDrug.dosageForm.conceptClasses',NULL,'A comma-separated list of the allowed concept classes for the dosage form field of the concept drug management form.','6dbaf339-7e91-4aed-b679-c20441d860e8',NULL,NULL,NULL,NULL,NULL,NULL),('conceptDrug.route.conceptClasses',NULL,'A comma-separated list of the allowed concept classes for the route field of the concept drug management form.','e9049adb-b745-4edc-b2a4-fc885c222e9b',NULL,NULL,NULL,NULL,NULL,NULL),('concepts.locked','false','if true, do not allow editing concepts','5cd3f671-5e8a-4ec5-abf5-5e519eaaa4ff','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('concept_map_type_management.enable','false','Enables or disables management of concept map types','f8ff45a6-c63a-4a2a-8d7a-4039bac218ff','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('conditionList.endReasonConceptSetUuid',NULL,'UUID of end reason concept set','5b9d4776-2cf0-4777-8fc3-006bc25f811e',NULL,NULL,NULL,NULL,NULL,NULL),('conditionList.nonCodedUuid','71ce0aed-36e8-11e7-be35-080027e99513','UUID of non coded concept','a7273d25-4096-4c6a-a7b0-2bb51cb83cf7',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.maximumNumberToShow',NULL,'An integer which, if specified, would determine the maximum number of encounters to display on the encounter tab of the patient dashboard.','5c1f7e92-65c9-4949-99ea-52e42337f68e',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.providerDisplayRoles',NULL,'A comma-separated list of encounter roles (by name or id). Providers with these roles in an encounter will be displayed on the encounter tab of the patient dashboard.','9849e131-9761-431c-a53a-b6ba53bf98ce',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.showEditLink','true','true/false whether or not to show the \'Edit Encounter\' link on the patient dashboard','b5c50eda-3377-409e-a64e-0cbc5c58d78e','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.showEmptyFields','true','true/false whether or not to show empty fields on the \'View Encounter\' window','b37f0fc2-e17d-414d-a2d3-0cb8a5314e38','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.showViewLink','true','true/false whether or not to show the \'View Encounter\' link on the patient dashboard','778478c0-2fad-496e-b03d-29e219db3b48','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('dashboard.encounters.usePages','smart','true/false/smart on how to show the pages on the \'View Encounter\' window. \'smart\' means that if > 50% of the fields have page numbers defined, show data in pages','d2956122-c821-4055-8c9d-4e32cc552496',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.header.programs_to_show',NULL,'List of programs to show Enrollment details of in the patient header. (Should be an ordered comma-separated list of program_ids or names.)','6aa0071c-c966-4b6f-818c-dba70c41908f',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.header.showConcept','5497','Comma delimited list of concepts ids to show on the patient header overview','258e3748-ae7d-428e-9f34-6f6b63ecd5d2',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.header.workflows_to_show',NULL,'List of programs to show Enrollment details of in the patient header. List of workflows to show current status of in the patient header. These will only be displayed if they belong to a program listed above. (Should be a comma-separated list of program_workflow_ids.)','0bf38415-a8aa-48ff-842a-94233a9cfb3f',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.metadata.caseConversion',NULL,'Indicates which type automatic case conversion is applied to program/workflow/state in the patient dashboard. Valid values: lowercase, uppercase, capitalize. If empty no conversion is applied.','a0092961-f243-4e48-a4b7-a2f559cb0909',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.overview.showConcepts',NULL,'Comma delimited list of concepts ids to show on the patient dashboard overview tab','742bf7ba-d4a6-47c8-b016-b9b02c419aa0',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.regimen.displayDrugSetIds','ANTIRETROVIRAL DRUGS,TUBERCULOSIS TREATMENT DRUGS','Drug sets that appear on the Patient Dashboard Regimen tab. Comma separated list of name of concepts that are defined as drug sets.','4de5e8e4-55c4-4ec7-85ce-f42887bb269e',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.regimen.displayFrequencies','7 days/week,6 days/week,5 days/week,4 days/week,3 days/week,2 days/week,1 days/week','Frequency of a drug order that appear on the Patient Dashboard. Comma separated list of name of concepts that are defined as drug frequencies.','57468c9f-4030-4b9c-8f5c-91f3d27be225',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.regimen.standardRegimens',' 2 1 tab(s) 2/day x 7 days/week 3TC + d4T(30) + NVP (Triomune-30) standardTri30 ANTIRETROVIRAL DRUGS 3 1 tab(s) 2/day x 7 days/week 3TC + d4T(40) + NVP (Triomune-40) standardTri40 ANTIRETROVIRAL DRUGS 39 1 tab(s) 2/day x 7 days/week 22 200 mg 2/day x 7 days/week AZT + 3TC + NVP standardAztNvp ANTIRETROVIRAL DRUGS 11 600 mg 1/day x 7 days/week AZT + 3TC + EFV(600) standardAztEfv ANTIRETROVIRAL DRUGS 5 30 mg 2/day x 7 days/week 42 150 mg 2/day x 7 days/week d4T(30) + 3TC + EFV(600) standardD4t30Efv ANTIRETROVIRAL DRUGS 6 40 mg 2/day x 7 days/week d4T(40) + 3TC + EFV(600) standardD4t40Efv ANTIRETROVIRAL DRUGS ','XML description of standard drug regimens, to be shown as shortcuts on the dashboard regimen entry tab','2ffd37ca-9e6b-4098-a0f2-7bc094c79ba0',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.relationships.show_types',NULL,'Types of relationships separated by commas. Doctor/Patient,Parent/Child','7491e8c0-3234-444d-b383-39c12796d56d',NULL,NULL,NULL,NULL,NULL,NULL),('dashboard.showPatientName','false','Whether or not to display the patient name in the patient dashboard title. Note that enabling this could be security risk if multiple users operate on the same computer.','dc57a4df-28aa-4dfc-b50d-1a8042bec54c','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('datePicker.weekStart','0','First day of the week in the date picker. Domingo/Dimanche/Sunday:0 Lunes/Lundi/Monday:1','820dab62-abee-4382-b960-4e602f8859a2',NULL,NULL,NULL,NULL,NULL,NULL),('default_locale','en','Specifies the default locale. You can specify both the language code(ISO-639) and the country code(ISO-3166), e.g. \'en_GB\' or just country: e.g. \'en\'','de5284c2-1edf-47b7-b421-c70205af8d7f',NULL,NULL,NULL,NULL,NULL,NULL),('default_location','Unknown Location','The name of the location to use as a system default','509e8f89-6b2b-40c3-9a88-6a44292d7399',NULL,NULL,NULL,NULL,NULL,NULL),('default_theme',NULL,'Default theme for users. OpenMRS ships with themes of \'green\', \'orange\', \'purple\', and \'legacy\'','a36be38e-5bac-4a6b-811d-2a3e3236af07',NULL,NULL,NULL,NULL,NULL,NULL),('dhis.mandatory','false','true/false whether or not the dhis module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','741589f5-3c75-4a02-96f1-3ad6257e8df4',NULL,NULL,NULL,NULL,NULL,NULL),('dhis.started','true','DO NOT MODIFY. true/false whether or not the dhis module has been started. This is used to make sure modules that were running prior to a restart are started again','26b2da88-3895-4cf5-b2d4-e0e81a1779d6',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.config.dataAndLogsStoragePeriod','6','DHIS Connector: Number of months backwards from current date for which to store both stored logs and data','ebec4d36-15bb-4eb7-ae35-81e4b43e89df',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.config.dxfToAdxSwitch','false','DHIS Connector: true/false whether or not to use the DXF to ADX conversion before sending data to DHIS2','1603ce84-cfe6-4e05-8608-5994ff00f7b2',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.config.enableAutoRun','true','Set to true to enable this module to run configured openmrs reports and post data into DHIS2 automatically','d341cbda-9ef7-4c58-a9f4-3aa10e2285e5',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.mandatory','false','true/false whether or not the dhisconnector module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','9c9412dd-07ae-47db-9d9e-dc047f652a2d',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.pass','Stle8719#','DHIS Password.','c09af5ff-ae74-4c2b-85ca-d901b6798461',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.started','true','DO NOT MODIFY. true/false whether or not the dhisconnector module has been started. This is used to make sure modules that were running prior to a restart are started again','72927e55-957d-4ab2-a1ca-fb3c8d61dd83',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.url','http://41.203.191.110/training','DHIS Server URL.','159d9a36-a83c-4c07-b411-df78d89f4364',NULL,NULL,NULL,NULL,NULL,NULL),('dhisconnector.user','leqelat','DHIS Username.','efb9a22a-25a9-4564-b747-cdfcbe96ce34',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.database_version','1.2','DO NOT MODIFY. Current database version number for the dhisreport module.','e3f262a7-9f6b-4c0b-b548-7ba47c7f5a85',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.dhis2Password',NULL,'The Password of the DHIS Server','a4aadd92-8be5-41f6-8ab3-6317a43d65d2',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.dhis2SyncDate',NULL,'The last sync date of reports.','d0b8b6a4-36c2-48d4-bbc8-e5146c8d4670',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.dhis2URL','http://httpbin.org/post','DHIS2 URL where the report has to be sent.','b0cc2773-f398-46b3-b4e4-c5ee35cb02ce',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.dhis2UserName','dhis2 username','The Username of the DHIS Server','7dbe95b6-86cc-4b99-92d0-294a271d5429',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.mandatory','false','true/false whether or not the dhisreport module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','aa520f4e-4f9d-415d-97d2-3d0892c46908',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.SchedulerURL',NULL,'URL of the page where we post reports (e.g. http://localhost:8081/openmrs18/module/dhisreport/executeReport.form )','7da153ba-5bb6-4773-aa1b-9c0d2021ee9c',NULL,NULL,NULL,NULL,NULL,NULL),('dhisreport.started','true','DO NOT MODIFY. true/false whether or not the dhisreport module has been started. This is used to make sure modules that were running prior to a restart are started again','97bd26aa-ee6b-49f7-9bc7-8b22eaf2d7b1',NULL,NULL,NULL,NULL,NULL,NULL),('disableDefaultAppointmentValidations','false','Disable default appointment validations','3c43a10a-d118-4861-8298-44362a8b1481',NULL,NULL,NULL,NULL,NULL,NULL),('drugOrder.drugOther','063ee60c-99a5-11e5-bbf3-080027b662ec','Specifies the uuid of the concept which represents drug other non coded','f1f00447-f3fb-41c2-99ba-96ed9086b7bb',NULL,NULL,NULL,NULL,NULL,NULL),('drugOrder.requireDrug','false','Set to value true if you need to specify a formulation(Drug) when creating a drug order.','553e98eb-9e62-4393-a7ed-7459cdd17a9d',NULL,NULL,NULL,NULL,NULL,NULL),('elisatomfeedclient.mandatory','false','true/false whether or not the elisatomfeedclient module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','46a6c514-f31a-4714-b316-d48161c83fbe',NULL,NULL,NULL,NULL,NULL,NULL),('elisatomfeedclient.started','true','DO NOT MODIFY. true/false whether or not the elisatomfeedclient module has been started. This is used to make sure modules that were running prior to a restart are started again','6a886279-77d2-4f90-83c7-3fbafd92ff37',NULL,NULL,NULL,NULL,NULL,NULL),('emr.admissionEncounterType','This global property had been migrated to metadata mapping in source \'org.openmrs.module.emrapi\' with code \'&s\'','UUID of the encounter type for admitting a patient','e209c792-8093-4894-86a6-de3b3eb82075',NULL,NULL,NULL,NULL,NULL,NULL),('emr.admissionForm',NULL,'UUID of the Admission Form (not required)','ef9b40fc-7e26-4011-954b-adfc4674d053',NULL,NULL,NULL,NULL,NULL,NULL),('emr.atFacilityVisitType',NULL,'UUID of the VisitType that we use for newly-created visits','7e35b5d9-f058-4f57-bdf1-f11fa08d95cd',NULL,NULL,NULL,NULL,NULL,NULL),('emr.concept.diagnosisSetOfSets','dbc2ecdb-4e14-11e4-8a57-0800271c1b75',NULL,'e0f02e9c-72a6-4f13-b619-c678af2d3609',NULL,NULL,NULL,NULL,NULL,NULL),('emr.encounterMatcher','org.bahmni.module.bahmnicore.matcher.EncounterSessionMatcher','custom encounter session matcher','81f078c9-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('emr.exitFromInpatientEncounterType','This global property had been migrated to metadata mapping in source \'org.openmrs.module.emrapi\' with code \'&s\'','UUID of the encounter type for exiting a patient from inpatient care','a6ae78f4-8624-4c08-ad7e-8fb847ac8fc8',NULL,NULL,NULL,NULL,NULL,NULL),('emr.exitFromInpatientForm',NULL,'UUID of the Discharge Form (not required)','53fd133c-ca9b-442e-b4de-719447cc6de8',NULL,NULL,NULL,NULL,NULL,NULL),('emr.personImagesDirectory','/home/bahmni/patient_images','Location of patient images - required by emrapi','c467177b-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('emr.transferWithinHospitalEncounterType',NULL,'UUID of the encounter type for transferring a patient within the hospital','b17a5357-a036-4871-9a64-74aab9ec11a5',NULL,NULL,NULL,NULL,NULL,NULL),('emr.transferWithinHospitalForm',NULL,'UUID of the Transfer Form (not required)','23489e82-8ebc-4f15-ac35-184b5e6bd3c9',NULL,NULL,NULL,NULL,NULL,NULL),('emr.unknownLocation',NULL,'UUID of the Location that represents an Unknown Location','490be82d-9831-48b5-8b1e-921a9d03b0ea',NULL,NULL,NULL,NULL,NULL,NULL),('emr.unknownProvider','f9badd80-ab76-11e2-9e96-0800200c9a66','UUID of the Provider that represents an Unknown Provider','4df46b77-962e-4ff1-98f7-27b84dadf843',NULL,NULL,NULL,NULL,NULL,NULL),('emr.visitNoteEncounterType',NULL,'UUID of the encounter type for a visit note','99c27416-f5e7-4c80-847a-87c83a5589fb',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.EmrApiVisitAssignmentHandler.encounterTypeToNewVisitTypeMap',NULL,'Specifies the mapping of encounter types to new visit types for more see https://wiki.openmrs.org/x/vgF4Aw','85d6dfeb-cd3f-4587-a194-ff95d72962c5',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.lastViewedPatientSizeLimit','50','Specifies the system wide number of patients to store as last viewed for a single user,\r\n defaults to 50 if not specified','4262a261-ab49-4dec-bc1c-7c10687fbb76',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.mandatory','false','true/false whether or not the emrapi module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','c4c31180-3583-4ca0-849b-4340bd2bd6a4',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.nonDiagnosisConceptSets',NULL,'UUIDs or mapping of non diagnosis concept sets','6f488ef4-f8ae-4e54-b702-ecb260d8d0d7',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlGet.wardsListDetails','SELECT\r\n b.bed_number AS \'Bed\',\r\n concat(pn.given_name, \' \', ifnull(pn.family_name,\'\')) AS \'Name\',\r\n pv.uuid AS \'Patient Uuid\',\r\n pi.identifier AS \'Id\',\r\n pv.gender AS \'Gender\',\r\n TIMESTAMPDIFF(YEAR, pv.birthdate, CURDATE()) AS \'Age\',\r\n pa.county_district AS \'District\',\r\n pa.city_village AS \'Village\',\r\n admission_provider_name.given_name AS \'Admission By\',\r\n cast(DATE_FORMAT(latestAdmissionEncounter.max_encounter_datetime, \'%d %b %y %h:%i %p\') AS CHAR) AS \'Admission Time\',\r\n diagnosis.diagnosisConcept AS \'Diagnosis\',\r\n diagnosis.certainty AS \'Diagnosis Certainty\',\r\n diagnosis.diagnosisOrder AS \'Diagnosis Order\',\r\n diagnosis.status AS \'Diagnosis Status\',\r\n diagnosis.diagnosis_provider AS \'Diagnosis Provider\',\r\n cast(DATE_FORMAT(diagnosis.diagnosis_datetime, \'%d %b %y %h:%i %p\') AS\r\n CHAR) AS \'Diagnosis Datetime\',\r\n dispositionInfo.providerName AS \'Disposition By\',\r\n cast(DATE_FORMAT(dispositionInfo.providerDate, \'%d %b %y %h:%i %p\') AS CHAR) AS \'Disposition Time\',\r\n adtNotes.value_text AS \'ADT Notes\',\r\n v.uuid AS \'Visit Uuid\'\r\nFROM bed_location_map blm\r\n INNER JOIN bed b\r\n ON blm.bed_id = b.bed_id AND\r\n b.status = \'OCCUPIED\' AND\r\n blm.location_id IN (SELECT child_location.location_id\r\n FROM location child_location JOIN\r\n location parent_location\r\n ON parent_location.location_id =\r\n child_location.parent_location\r\n WHERE\r\n parent_location.name = ${location_name})\r\n INNER JOIN bed_patient_assignment_map bpam ON b.bed_id = bpam.bed_id AND date_stopped IS NULL\r\n INNER JOIN person pv ON pv.person_id = bpam.patient_id\r\n INNER JOIN person_name pn ON pn.person_id = pv.person_id\r\n INNER JOIN patient_identifier pi ON pv.person_id = pi.patient_id\r\n INNER JOIN patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n INNER JOIN global_property gp on gp.property=\'bahmni.primaryIdentifierType\' and gp.property_value=pit.uuid\r\n LEFT JOIN person_address pa ON pa.person_id = pv.person_id\r\n INNER JOIN (SELECT\r\n patient_id,\r\n max(encounter_datetime) AS max_encounter_datetime,\r\n max(visit_id) as visit_id,\r\n max(encounter_id) AS encounter_id\r\n FROM encounter\r\n INNER JOIN encounter_type ON encounter_type.encounter_type_id = encounter.encounter_type\r\n WHERE encounter_type.name = \'ADMISSION\'\r\n GROUP BY patient_id) latestAdmissionEncounter ON pv.person_id = latestAdmissionEncounter.patient_id\r\n INNER JOIN visit v ON latestAdmissionEncounter.visit_id = v.visit_id\r\n LEFT OUTER JOIN obs adtNotes\r\n ON adtNotes.encounter_id = latestAdmissionEncounter.encounter_id AND adtNotes.voided = 0 AND\r\n adtNotes.concept_id = (SELECT concept_id\r\n FROM concept_name\r\n WHERE name = \'Adt Notes\' AND concept_name_type = \'FULLY_SPECIFIED\')\r\n LEFT OUTER JOIN encounter_provider ep ON ep.encounter_id = latestAdmissionEncounter.encounter_id\r\n LEFT OUTER JOIN provider admission_provider ON admission_provider.provider_id = ep.provider_id\r\n LEFT OUTER JOIN person_name admission_provider_name\r\n ON admission_provider_name.person_id = admission_provider.person_id\r\n LEFT OUTER JOIN (\r\n SELECT\r\n bpam.patient_id AS person_id,\r\n concept_name.name AS disposition,\r\n latestDisposition.obs_datetime AS providerDate,\r\n person_name.given_name AS providerName\r\n FROM bed_patient_assignment_map bpam\r\n INNER JOIN (SELECT\r\n person_id,\r\n max(obs_id) obs_id\r\n FROM obs\r\n WHERE concept_id = (SELECT concept_id\r\n FROM concept_name\r\n WHERE\r\n name = \'Disposition\' AND concept_name_type = \'FULLY_SPECIFIED\')\r\n GROUP BY person_id) maxObsId ON maxObsId.person_id = bpam.patient_id\r\n INNER JOIN obs latestDisposition\r\n ON maxObsId.obs_id = latestDisposition.obs_id AND latestDisposition.voided = 0\r\n INNER JOIN concept_name ON latestDisposition.value_coded = concept_name.concept_id AND\r\n concept_name_type = \'FULLY_SPECIFIED\'\r\n LEFT OUTER JOIN encounter_provider ep ON latestDisposition.encounter_id = ep.encounter_id\r\n LEFT OUTER JOIN provider disp_provider ON disp_provider.provider_id = ep.provider_id\r\n LEFT OUTER JOIN person_name ON person_name.person_id = disp_provider.person_id\r\n WHERE bpam.date_stopped IS NULL\r\n ) dispositionInfo ON pv.person_id = dispositionInfo.person_id\r\n LEFT OUTER JOIN (\r\n SELECT\r\n diagnosis.person_id AS person_id,\r\n diagnosis.obs_id AS obs_id,\r\n diagnosis.obs_datetime AS diagnosis_datetime,\r\n if(diagnosisConceptName.name IS NOT NULL, diagnosisConceptName.name,\r\n diagnosis.value_text) AS diagnosisConcept,\r\n certaintyConceptName.name AS certainty,\r\n diagnosisOrderConceptName.name AS diagnosisOrder,\r\n diagnosisStatusConceptName.name AS status,\r\n person_name.given_name AS diagnosis_provider\r\n FROM bed_patient_assignment_map bpam\r\n INNER JOIN visit latestVisit\r\n ON latestVisit.patient_id = bpam.patient_id AND latestVisit.date_stopped IS NULL AND\r\n bpam.date_stopped IS NULL\r\n INNER JOIN encounter ON encounter.visit_id = latestVisit.visit_id\r\n INNER JOIN obs diagnosis ON bpam.patient_id = diagnosis.person_id AND diagnosis.voided = 0 AND\r\n diagnosis.encounter_id = encounter.encounter_id AND\r\n diagnosis.concept_id IN (SELECT concept_id\r\n FROM concept_name\r\n WHERE name IN\r\n (\'Coded Diagnosis\', \'Non-Coded Diagnosis\')\r\n AND\r\n concept_name_type = \'FULLY_SPECIFIED\')\r\n LEFT OUTER JOIN concept_name diagnosisConceptName\r\n ON diagnosis.value_coded IS NOT NULL AND diagnosis.value_coded = diagnosisConceptName.concept_id\r\n AND diagnosisConceptName.concept_name_type = \'FULLY_SPECIFIED\'\r\n LEFT OUTER JOIN encounter_provider ep ON diagnosis.encounter_id = ep.encounter_id\r\n LEFT OUTER JOIN provider diagnosis_provider ON diagnosis_provider.provider_id = ep.provider_id\r\n LEFT OUTER JOIN person_name ON person_name.person_id = diagnosis_provider.person_id\r\n INNER JOIN obs certainty\r\n ON diagnosis.obs_group_id = certainty.obs_group_id AND certainty.voided = 0 AND\r\n certainty.concept_id = (SELECT concept_id\r\n FROM concept_name\r\n WHERE name = \'Diagnosis Certainty\' AND\r\n concept_name_type = \'FULLY_SPECIFIED\')\r\n LEFT OUTER JOIN concept_name certaintyConceptName\r\n ON certainty.value_coded IS NOT NULL AND certainty.value_coded = certaintyConceptName.concept_id\r\n AND certaintyConceptName.concept_name_type = \'FULLY_SPECIFIED\'\r\n INNER JOIN obs diagnosisOrder\r\n ON diagnosis.obs_group_id = diagnosisOrder.obs_group_id AND diagnosisOrder.voided = 0 AND\r\n diagnosisOrder.concept_id = (SELECT concept_id\r\n FROM concept_name\r\n WHERE name = \'Diagnosis order\' AND\r\n concept_name_type = \'FULLY_SPECIFIED\')\r\n LEFT OUTER JOIN concept_name diagnosisOrderConceptName ON diagnosisOrder.value_coded IS NOT NULL\r\n AND diagnosisOrder.value_coded =\r\n diagnosisOrderConceptName.concept_id\r\n AND\r\n diagnosisOrderConceptName.concept_name_type\r\n = \'FULLY_SPECIFIED\'\r\n LEFT JOIN obs diagnosisStatus\r\n ON diagnosis.obs_group_id = diagnosisStatus.obs_group_id AND diagnosisStatus.voided = 0 AND\r\n diagnosisStatus.concept_id = (SELECT concept_id\r\n FROM concept_name\r\n WHERE name = \'Bahmni Diagnosis Status\' AND\r\n concept_name_type = \'FULLY_SPECIFIED\')\r\n LEFT OUTER JOIN concept_name diagnosisStatusConceptName ON diagnosisStatus.value_coded IS NOT NULL\r\n AND diagnosisStatus.value_coded =\r\n diagnosisStatusConceptName.concept_id\r\n AND\r\n diagnosisStatusConceptName.concept_name_type\r\n = \'FULLY_SPECIFIED\'\r\n ) diagnosis ON diagnosis.person_id = pv.person_id','Sql query to get list of wards','71bd93a9-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.activePatients','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted,\r\n IF(datediff(now(), obs_blooddrawdue.value_datetime) >= 182.62, \"true\", \"false\") as BloodDrawDue\r\nfrom visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0 \r\n left outer JOIN (SELECT\r\n max(test_obs.obs_group_id) AS max_id,\r\n test_obs.concept_id,\r\n test_obs.person_id\r\n FROM obs test_obs\r\n INNER JOIN concept c ON c.concept_id = test_obs.concept_id AND test_obs.voided = 0\r\n INNER JOIN concept_name cn\r\n ON c.concept_id = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n cn.name IN (\'HIVTC, Viral Load Blood drawn date\')\r\n GROUP BY test_obs.person_id, test_obs.concept_id) AS tests ON tests.person_id = v.patient_id\r\n left outer join obs obs_blooddrawdue on obs_blooddrawdue.obs_group_id=tests.max_id and obs_blooddrawdue.concept_id=4267\r\n and obs_blooddrawdue.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and v.voided=0\r\norder by en.encounter_datetime asc','Sql query to get list of active patients','71b9ac84-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.activePatientsByLocation','select distinct concat(pn.given_name,\" \", ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from\r\n visit v join person_name pn on v.patient_id = pn.person_id and pn.voided = 0 and v.voided=0\r\n join patient_identifier pi on v.patient_id = pi.patient_id and pi.voided=0\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id and p.voided=0\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n left outer join location loc on en.location_id = loc.location_id\r\n join encounter_provider ep on ep.encounter_id = en.encounter_id and ep.voided=0\r\n join provider pr on ep.provider_id=pr.provider_id and pr.retired=0\r\n join person per on pr.person_id=per.person_id and per.voided=0\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n )\r\n where\r\n v.date_stopped is null and\r\n loc.uuid=${location_uuid}\r\n order by en.encounter_datetime desc','SQL query to get list of active patients by location','71ba007a-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.activePatientsByProvider','select distinct concat(pn.given_name,\" \", ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from\r\n visit v join person_name pn on v.patient_id = pn.person_id and pn.voided = 0 and v.voided=0\r\n join patient_identifier pi on v.patient_id = pi.patient_id and pi.voided=0\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id and p.voided=0\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join encounter_provider ep on ep.encounter_id = en.encounter_id and ep.voided=0\r\n join provider pr on ep.provider_id=pr.provider_id and pr.retired=0\r\n join person per on pr.person_id=per.person_id and per.voided=0\r\n join location l on l.uuid=${visit_location_uuid} and l.location_id = v.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.voided = 0 and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n )\r\n where\r\n v.date_stopped is null and\r\n pr.uuid=${provider_uuid}\r\n order by en.encounter_datetime desc','Sql query to get list of active patients by provider uuid','71b9c592-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.additionalSearchHandler','cn.name = \'${testName}\'','Sql query to get list of admitted patients','03be7b86-102c-11e5-b1c7-080027b662ec',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.admittedPatients','select distinct\r\n concat(pn.given_name,\" \", ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on v.patient_id = p.person_id\r\n join visit_attribute va on v.visit_id = va.visit_id and va.value_reference = \"Admitted\" and va.voided = 0\r\n join visit_attribute_type vat on vat.visit_attribute_type_id = va.attribute_type_id and vat.name = \"Admission Status\"\r\n join location l on l.uuid=${visit_location_uuid} and v.location_id = l.location_id\r\n where v.date_stopped is null AND v.voided = 0','Sql query to get list of admitted patients','71b9e1ce-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.anc','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=16\r\norder by en.encounter_datetime asc',NULL,'fd4bfe62-4be4-454e-bdf8-1e9660637afa',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.arvregimendrugpickup','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted,\r\n IF(datediff(now(), obs_blooddrawdue.value_datetime) >= 182.62, \"true\", \"false\") as BloodDrawDue\r\nfrom visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0 \r\n left outer JOIN (SELECT\r\n max(test_obs.obs_group_id) AS max_id,\r\n test_obs.concept_id,\r\n test_obs.person_id\r\n FROM obs test_obs\r\n INNER JOIN concept c ON c.concept_id = test_obs.concept_id AND test_obs.voided = 0\r\n INNER JOIN concept_name cn\r\n ON c.concept_id = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n cn.name IN (\'HIVTC, Viral Load Blood drawn date\')\r\n GROUP BY test_obs.person_id, test_obs.concept_id) AS tests ON tests.person_id = v.patient_id\r\n left outer join obs obs_blooddrawdue on obs_blooddrawdue.obs_group_id=tests.max_id and obs_blooddrawdue.concept_id=4267\r\n and obs_blooddrawdue.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=10\r\norder by en.encounter_datetime asc',NULL,'852c4bce-90f0-4a45-8dff-332c5f9c8951',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.hei','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=18\r\norder by en.encounter_datetime asc',NULL,'761dcbf4-6a78-4f5d-915a-25816d00b1de',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.highRiskPatients','SELECT DISTINCT\r\n concat(pn.given_name, \" \", ifnull(pn.family_name,\'\')) AS name,\r\n pi.identifier AS identifier,\r\n concat(\"\", p.uuid) AS uuid,\r\n concat(\"\", v.uuid) AS activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") AS hasBeenAdmitted\r\nFROM person p\r\n INNER JOIN person_name pn ON pn.person_id = p.person_id\r\n INNER JOIN patient_identifier pi ON pn.person_id = pi.patient_id\r\n INNER JOIN patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n INNER JOIN global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n INNER JOIN visit v ON v.patient_id = p.person_id AND v.date_stopped IS NULL AND v.voided = 0\r\n INNER JOIN (SELECT\r\n max(test_obs.obs_group_id) AS max_id,\r\n test_obs.concept_id,\r\n test_obs.person_id\r\n FROM obs test_obs\r\n INNER JOIN concept c ON c.concept_id = test_obs.concept_id AND test_obs.voided = 0\r\n INNER JOIN concept_name cn\r\n ON c.concept_id = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n cn.name IN (${testName})\r\n GROUP BY test_obs.person_id, test_obs.concept_id) AS tests ON tests.person_id = v.patient_id\r\n INNER JOIN obs abnormal_obs\r\n ON abnormal_obs.obs_group_id = tests.max_id AND abnormal_obs.value_coded = 1 AND abnormal_obs.voided = 0\r\n INNER JOIN concept abnormal_concept ON abnormal_concept.concept_id = abnormal_obs.concept_id\r\n INNER JOIN concept_name abnormal_concept_name\r\n ON abnormal_concept.concept_id = abnormal_concept_name.concept_id AND\r\n abnormal_concept_name.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n abnormal_concept_name.name IN (\"LAB_ABNORMAL\")\r\n LEFT OUTER JOIN visit_attribute va ON va.visit_id = v.visit_id AND va.attribute_type_id =\r\n (SELECT visit_attribute_type_id\r\n FROM visit_attribute_type\r\n WHERE name = \"Admission Status\")','SQL QUERY TO get LIST of patients with high risk','71ba1160-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.highviralload','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted,\r\n IF(datediff(now(), obs_blooddrawdue.value_datetime) >= 182.62, \"true\", \"false\") as BloodDrawDue\r\nfrom visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0 \r\n left outer JOIN (SELECT\r\n max(test_obs.obs_group_id) AS max_id,\r\n test_obs.concept_id,\r\n test_obs.person_id\r\n FROM obs test_obs\r\n INNER JOIN concept c ON c.concept_id = test_obs.concept_id AND test_obs.voided = 0\r\n INNER JOIN concept_name cn\r\n ON c.concept_id = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n cn.name IN (\'HIVTC, Viral Load Blood drawn date\')\r\n GROUP BY test_obs.person_id, test_obs.concept_id) AS tests ON tests.person_id = v.patient_id\r\n left outer join obs obs_blooddrawdue on obs_blooddrawdue.obs_group_id=tests.max_id and obs_blooddrawdue.concept_id=4267\r\n and obs_blooddrawdue.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=12\r\norder by en.encounter_datetime asc',NULL,'647c7cbf-83de-44e6-a9a6-f33e4e8d3feb',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.htsonly','select distinct\r\n p.person_id,\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted,\r\n if(obs_positive.value_coded=1738, \"true\", \"false\") as CodedP\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n left outer JOIN (SELECT\r\n max(test_obs.obs_group_id) AS max_id,\r\n test_obs.concept_id,\r\n test_obs.person_id\r\n FROM obs test_obs\r\n INNER JOIN concept c ON c.concept_id = test_obs.concept_id AND test_obs.voided = 0\r\n INNER JOIN concept_name cn\r\n ON c.concept_id = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND\r\n cn.name IN (\'HTC, Final HIV status\')\r\n GROUP BY test_obs.person_id, test_obs.concept_id) AS tests ON tests.person_id = v.patient_id\r\n left outer join obs obs_positive on obs_positive.obs_group_id=tests.max_id and obs_positive.value_coded=1738\r\n and obs_positive.voided=0\r\n join location l on v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=15\r\norder by en.encounter_datetime asc',NULL,'dc1d0217-5d58-4773-82bc-2fb817797d3e',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.htspositivelinkedtocare','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join obs obs_linked on obs_linked.encounter_id=en.encounter_id and obs_linked.person_id=p.person_id\r\n and obs_linked.concept_id=4239 and obs_linked.value_coded=2146\r\n join obs obs_positive on obs_positive.encounter_id=en.encounter_id and obs_positive.person_id=p.person_id\r\n and obs_positive.concept_id=2165 and obs_positive.value_coded=1738\r\n join location l on v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=15\r\norder by en.encounter_datetime asc',NULL,'236b2f2f-5c77-480b-a18d-df0f5f3502b0',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.neworpreart','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=9\r\norder by en.encounter_datetime asc',NULL,'1086fc26-0f7e-44c4-801e-ca6d57f8d525',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.patientsHasPendingOrders','select distinct\r\n concat(pn.given_name, \" \", ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join orders on orders.patient_id = v.patient_id\r\n join order_type on orders.order_type_id = order_type.order_type_id and order_type.name != \"Order\" and order_type.name != \"Drug Order\"\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.voided = 0 and va.attribute_type_id =\r\n (select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\")\r\n where v.date_stopped is null AND v.voided = 0 and order_id not in\r\n (select obs.order_id\r\n from obs\r\n where person_id = pn.person_id and order_id = orders.order_id)','Sql query to get list of patients who has pending orders','71ba1bf0-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.patientsToAdmit','select distinct concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0 AND v.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on v.patient_id = p.person_id\r\n join encounter e on v.visit_id = e.visit_id\r\n join obs o on e.encounter_id = o.encounter_id and o.voided = 0\r\n join concept c on o.value_coded = c.concept_id\r\n join concept_name cn on c.concept_id = cn.concept_id\r\n join location l on l.uuid=${visit_location_uuid} and v.location_id = l.location_id\r\n where v.date_stopped is null and cn.name = \'Admit Patient\' and v.visit_id not in (select visit_id\r\n from encounter ie join encounter_type iet\r\n on iet.encounter_type_id = ie.encounter_type\r\n where iet.name = \'ADMISSION\')','Sql query to get list of patients to be admitted','71b9d436-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.patientsToDischarge','SELECT DISTINCT\r\n concat(pn.given_name, \' \', ifnull(pn.family_name,\'\')) AS name,\r\n pi.identifier AS identifier,\r\n concat(\"\", p.uuid) AS uuid,\r\n concat(\"\", v.uuid) AS activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n FROM visit v\r\n INNER JOIN person_name pn ON v.patient_id = pn.person_id and pn.voided is FALSE\r\n INNER JOIN patient_identifier pi ON v.patient_id = pi.patient_id and pi.voided is FALSE\r\n INNER JOIN patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n INNER JOIN global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n INNER JOIN person p ON v.patient_id = p.person_id\r\n Inner Join (SELECT DISTINCT v.visit_id\r\n FROM encounter en\r\n INNER JOIN visit v ON v.visit_id = en.visit_id AND en.encounter_type =\r\n (SELECT encounter_type_id\r\n FROM encounter_type\r\n WHERE name = \"ADMISSION\")) v1 on v1.visit_id = v.visit_id\r\n INNER JOIN encounter e ON v.visit_id = e.visit_id\r\n INNER JOIN obs o ON e.encounter_id = o.encounter_id\r\n INNER JOIN concept_name cn ON o.value_coded = cn.concept_id AND cn.concept_name_type = \"FULLY_SPECIFIED\" AND cn.voided is FALSE\r\n JOIN location l on l.uuid=${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id =\r\n (select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\")\r\n LEFT OUTER JOIN encounter e1 ON e1.visit_id = v.visit_id AND e1.encounter_type = (\r\n SELECT encounter_type_id\r\n FROM encounter_type\r\n WHERE name = \"DISCHARGE\") AND e1.voided is FALSE\r\n WHERE v.date_stopped IS NULL AND v.voided = 0 AND o.voided = 0 AND cn.name = \"Discharge Patient\" AND e1.encounter_id IS NULL','Sql query to get list of patients to discharge','71b9f236-36e8-11e7-be35-080027e99513',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.pnc','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=17\r\norder by en.encounter_datetime asc',NULL,'74e43089-f6fd-4f6b-a5cd-6af310d939d6',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.tbcases','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=13\r\norder by en.encounter_datetime asc',NULL,'9a63db99-482e-4c29-acd4-c4c1c9a0e2d8',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.tbintakeorfollowup','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=11\r\norder by en.encounter_datetime asc',NULL,'d104fb8e-78d4-4f41-bf4a-5968e2c6f7d1',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.sqlSearch.transferin','select distinct\r\n concat(pn.given_name,\' \', ifnull(pn.family_name,\'\')) as name,\r\n pi.identifier as identifier,\r\n concat(\"\",p.uuid) as uuid,\r\n concat(\"\",v.uuid) as activeVisitUuid,\r\n IF(va.value_reference = \"Admitted\", \"true\", \"false\") as hasBeenAdmitted\r\n from visit v\r\n join person_name pn on v.patient_id = pn.person_id and pn.voided = 0\r\n join patient_identifier pi on v.patient_id = pi.patient_id\r\n join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id\r\n join global_property gp on gp.property=\"bahmni.primaryIdentifierType\" and gp.property_value=pit.uuid\r\n join person p on p.person_id = v.patient_id\r\n join encounter en on en.visit_id = v.visit_id and en.voided=0\r\n join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id\r\n left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (\r\n select visit_attribute_type_id from visit_attribute_type where name=\"Admission Status\"\r\n ) and va.voided = 0\r\nwhere\r\nv.date_stopped is null and\r\nv.visit_type_id=14\r\norder by en.encounter_datetime asc',NULL,'c18ec550-4878-4a5a-85b2-52a15d000992',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.started','true','DO NOT MODIFY. true/false whether or not the emrapi module has been started. This is used to make sure modules that were running prior to a restart are started again','f3ce398a-c275-4744-a727-cb02ac5d709d',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.suppressedDiagnosisConcepts',NULL,'UUIDs or mappings of suppressed diagnosis concepts','b339beb8-f6d3-41d9-a5fa-827c14756f2f',NULL,NULL,NULL,NULL,NULL,NULL),('emrapi.visitExpireHours','24','Number of hours after which visit can be auto closed','c22c5a73-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('encounter.feed.publish.url','/openmrs/ws/rest/v1/bahmnicore/bahmniencounter/%s?includeAll=true','Url to be published on encounter save.','242982b8-8a92-11e4-977f-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('encounterForm.obsSortOrder','number','The sort order for the obs listed on the encounter edit form. \'number\' sorts on the associated numbering from the form schema. \'weight\' sorts on the order displayed in the form schema.','de214640-9698-40c0-8b9e-6c1cf53ce4c3',NULL,NULL,NULL,NULL,NULL,NULL),('encounterModifier.groovy.allowCaching','true','Allow Groovy Caching','e16605a1-266a-47cb-8385-d07742646640',NULL,NULL,NULL,NULL,NULL,NULL),('EncounterType.encounterTypes.locked','false','saving, retiring or deleting an Encounter Type is not permitted, if true','a23b0d0f-5a6d-4190-8b46-c2207ef5d370','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('episodes.mandatory','false','true/false whether or not the episodes module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','deadd888-e1e7-44a5-a671-138c2a1998e4',NULL,NULL,NULL,NULL,NULL,NULL),('episodes.started','true','DO NOT MODIFY. true/false whether or not the episodes module has been started. This is used to make sure modules that were running prior to a restart are started again','d4fec83a-e7f5-47c4-ba51-8cce103aa33c',NULL,NULL,NULL,NULL,NULL,NULL),('event.ActiveMQDataDirectory','activemq-default-data','Directory where activeMQ files will be stored.','d8852aae-4778-44e0-b94f-625099459c3b',NULL,NULL,NULL,NULL,NULL,NULL),('event.mandatory','false','true/false whether or not the event module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','bca3d36b-b680-44e4-8065-6993412169d6',NULL,NULL,NULL,NULL,NULL,NULL),('event.started','true','DO NOT MODIFY. true/false whether or not the event module has been started. This is used to make sure modules that were running prior to a restart are started again','5dcd8d6b-4f9b-4d9b-a866-74fe998f0680',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.allergy.allergyStrategy','ActiveListAllergyStrategy','Set allergy strategy','4c8abce4-e5c7-4799-ada9-d0a140b483ce',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.allergy.ObsAllergyStrategy.concept.uuid','1234','Concept id for allergy obs','380be3fe-bd9c-45f7-bdb6-f3bd091c405e',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.baseUrl','http://localhost:8080/openmrs/ws/fhir','The URI prefix through which clients consuming FHIR services will connect to the web application, should\r\n be of the form http://{ipAddress}:{port}/{contextPath}/ws/fhir','a4ec8431-d247-4d2c-9086-cd0c21666306',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.concept.codingSystem','OPENMRS','Concept Coding System','b53fac2c-ff77-4127-8bad-3b05a1a3841f',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.concepts.conditions',NULL,'The set of IDs of the concepts that can be matched to conditions which is needed to be stored as\r\n Observations','82bc669e-5c33-4ae8-8ed9-5a7edcb40bb5',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.customNarrativePropertiesPath','classpath:/com/foo/customnarrative.properties','Set custom narratives property path','0785a87c-917f-4083-b948-196c7f532611',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.imagingstudy','0123456789','Concept Id for \'ImagingStudy\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','0a396f76-937e-4dc0-8564-2e900e28728e',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.name','0123456789','Concept Id for \'Name\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','7fff16aa-86cc-4fb1-98c6-a095f32efcb5',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.presentedform','0123456789','Concept Id for \'PresentedForm\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','abe6b214-3d2a-40ca-9788-77960a87222c',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.radiology.server','http://fhir-dev.healthintersections.com.au/open','The URL of third party FHIR base server that use to retrieve Radiology Diagnostic Reports','97462f46-2aa0-4358-9205-71cb4c4a9b14',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.result','0123456789','Concept Id for \'Result\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','e838fa93-aa2e-4193-9740-5bd563f8c6a8',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.diagnosticreport.status','0123456789','Concept Id for \'Status\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','9c864e9f-044a-4f27-8f44-e4ecfdb71f0c',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.encounter.encounterRoleUuid','73bbb069-9781-4afc-a9d1-54b6b2270e03','Encounter Role uuid','2fc25a50-1db1-4001-a486-806e62f02945',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.encounter.encounterStrategy','DefaultEncounterStrategy','Set encounter strategy.','1ecd7676-e741-4d29-bba0-298d85eaf376',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.encounter.encounterType.DEFAULT','01234-abcde-56789','EncounterType uuid for Default (not available in http://hl7.org/implement/standards/fhir/v2/0074/index\r\n .html)','3263246c-509f-4159-883a-e85972b7ef80',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.encounter.encounterType.LAB','01234-abcde-56789','EncounterType uuid for Laboratory in http://hl7.org/implement/standards/fhir/v2/0074/index.html','c7336515-5733-4a82-8c0c-4deb6dea06b8',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.encounter.encounterType.RAD','01234-abcde-56789','EncounterType uuid for Radiology in http://hl7.org/implement/standards/fhir/v2/0074/index.html','fb381d06-5a12-4350-82aa-d6e550743434',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.imagingstudy.series','0123456789','Concept Id for \'ImagingStudy.Series\' field in http://www.hl7.org/FHIR/2015May/diagnosticreport.html','7466045c-a442-45f1-bd4b-0d1e90f5d707',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.imagingstudy.series.instance','0123456789','Concept Id for \'ImagingStudy.Series.Instance\' field in\r\n http://www.hl7.org/FHIR/2015May/diagnosticreport.html','ad058cb9-597d-4ebc-9a4a-dfc51e6bfe1b',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.imagingstudy.series.instance.content','0123456789','Concept Id for \'ImagingStudy.Series.Content\' field in http://www.hl7.org/FHIR/2015May/imagingstudy.html','5869ba30-56ce-4e22-a479-7cdbe80a5a6c',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.isCustomerNarrativesEnabled','false','Set true if you need to enable custom narratives','a51bf278-ab9a-46c1-a65d-392c7d02b8a3',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.location.locationStrategy','DefaultLocationStrategy','Set location strategy','ac4473a6-94d6-476a-a88d-f0f2af3fa944',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.mandatory','false','true/false whether or not the fhir module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','a3fb1218-64bf-4dbf-8b25-99b401faa95f',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.observation.observationStrategy','DefaultObservationStrategy','Set observation strategy.','334da591-ec85-44e3-adaf-b3d5d36803c0',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.patient.patientStrategy','DefaultPatientStrategy','Set patient strategy.','54744fdf-d3de-4a8a-9c92-eaf3fe43b36e',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.person.personStrategy','DefaultPersonStrategy','Set person strategy.','bbb1b500-a7ca-43a6-bfc7-41f2de0b172b',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.practitioner.practitionerStrategy','DefaultPractitionerStrategy','Set practitioner strategy.','c01dcff2-9bd3-4ca6-85ae-66b872269119',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.relatedPerson.relatedPersonStrategy','DefaultRelatedPersonStrategy','Set related person strategy.','d9b909e0-2892-4cbe-bdcc-3e3ff6237ac7',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.started','true','DO NOT MODIFY. true/false whether or not the fhir module has been started. This is used to make sure modules that were running prior to a restart are started again','96f55c08-1127-4582-a98a-b22568d30818',NULL,NULL,NULL,NULL,NULL,NULL),('fhir.uriPrefix',NULL,'The URI prefix through which clients consuming web services will connect to the web application, should be of the form http://{ipAddress}:{port}/{contextPath}','53222978-8594-4a07-ab0c-20a72aecf789',NULL,NULL,NULL,NULL,NULL,NULL),('Form.forms.locked','false','Set to a value of true if you do not want any changes to be made on forms, else set to false.','993197ed-e8da-42de-8b62-1d00c33ad498',NULL,NULL,NULL,NULL,NULL,NULL),('FormEntry.enableDashboardTab','true','true/false whether or not to show a Form Entry tab on the patient dashboard','792466d4-2eee-4dc7-b934-3fa6dfef9a67','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('FormEntry.enableOnEncounterTab','false','true/false whether or not to show a Enter Form button on the encounters tab of the patient dashboard','5e4abcdd-46ec-4925-b99a-8a55e33cd3e7','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('forms.locked','false','Set to a value of true if you do not want any changes to be made on forms, else set to false.','4a47af93-ec78-49fb-b9d6-07a5ad53d6b3',NULL,NULL,NULL,NULL,NULL,NULL),('graph.color.absolute','rgb(20,20,20)','Color of the \'invalid\' section of numeric graphs on the patient dashboard.','6819ac4b-2dda-4e5c-a822-7583a4988316',NULL,NULL,NULL,NULL,NULL,NULL),('graph.color.critical','rgb(200,0,0)','Color of the \'critical\' section of numeric graphs on the patient dashboard.','322e459a-aed4-4e0f-ae70-9130d1f6156c',NULL,NULL,NULL,NULL,NULL,NULL),('graph.color.normal','rgb(255,126,0)','Color of the \'normal\' section of numeric graphs on the patient dashboard.','792feb98-9434-41d1-a588-d02f0f509397',NULL,NULL,NULL,NULL,NULL,NULL),('gzip.enabled','false','Set to \'true\' to turn on OpenMRS\'s gzip filter, and have the webapp compress data before sending it to any client that supports it. Generally use this if you are running Tomcat standalone. If you are running Tomcat behind Apache, then you\'d want to use Apache to do gzip compression.','9e7bfcbf-3f84-4c13-8f65-4bb460841663','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('hl7_archive.dir','hl7_archives','The default name or absolute path for the folder where to write the hl7_in_archives.','a1a70f16-733f-48ba-9701-82877156ab04',NULL,NULL,NULL,NULL,NULL,NULL),('hl7_processor.ignore_missing_patient_non_local','false','If true, hl7 messages for patients that are not found and are non-local will silently be dropped/ignored','6dddbb11-8980-49b7-b432-a21951ea5d8e','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('htmlwidgets.mandatory','false','true/false whether or not the htmlwidgets module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','d78cef29-f600-45e7-9328-e341f7542634',NULL,NULL,NULL,NULL,NULL,NULL),('htmlwidgets.started','true','DO NOT MODIFY. true/false whether or not the htmlwidgets module has been started. This is used to make sure modules that were running prior to a restart are started again','d39d17b3-3ce7-4f97-b2bd-a1b544a809ae',NULL,NULL,NULL,NULL,NULL,NULL),('idgen-webservices.mandatory','false','true/false whether or not the idgen-webservices module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','671b643a-e4ec-40b9-83ab-68d5cfe1c41c',NULL,NULL,NULL,NULL,NULL,NULL),('idgen-webservices.started','true','DO NOT MODIFY. true/false whether or not the idgen-webservices module has been started. This is used to make sure modules that were running prior to a restart are started again','608946c8-af00-48f1-93d4-f438724cf6b0',NULL,NULL,NULL,NULL,NULL,NULL),('idgen.database_version','2.5.1','DO NOT MODIFY. Current database version number for the idgen module.','705e4713-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('idgen.mandatory','false','true/false whether or not the idgen module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','08413c3e-7d96-4d0f-9e1d-788df2c80e6c',NULL,NULL,NULL,NULL,NULL,NULL),('idgen.started','true','DO NOT MODIFY. true/false whether or not the idgen module has been started. This is used to make sure modules that were running prior to a restart are started again','f37b76d3-33e1-4d85-8f3e-74bb8683067f',NULL,NULL,NULL,NULL,NULL,NULL),('layout.address.format','\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n address1\r\n address2\r\n cityVillage stateProvince country postalCode\r\n latitude longitude\r\n startDate endDate\r\n \r\n ','XML description of address formats','494499c0-23fe-4a9e-b6f0-eeaeb04cf3b2',NULL,NULL,NULL,NULL,NULL,NULL),('layout.name.format','short','Format in which to display the person names. Valid values are short, long','623aad31-3143-422a-9f37-d21c99c6ccd2',NULL,NULL,NULL,NULL,NULL,NULL),('legacyui.mandatory','false','true/false whether or not the legacyui module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','8fd39c14-eb45-468b-a5e5-f207e25ba87c',NULL,NULL,NULL,NULL,NULL,NULL),('legacyui.started','true','DO NOT MODIFY. true/false whether or not the legacyui module has been started. This is used to make sure modules that were running prior to a restart are started again','f2038149-4c27-417b-91b1-5c31ccba4d82',NULL,NULL,NULL,NULL,NULL,NULL),('locale.allowed.list','en, es, fr, it, pt_BR','Comma delimited list of locales allowed for use on system','99f24877-92ff-435c-8429-4a7ae3773f4e',NULL,NULL,NULL,NULL,NULL,NULL),('location.field.style','default','Type of widget to use for location fields','d65fb5b9-20b1-484c-9e1b-7643fbe16d04',NULL,NULL,NULL,NULL,NULL,NULL),('log.layout','%p - %C{1}.%M(%L) |%d{ISO8601}| %m%n','A log layout pattern which is used by the OpenMRS file appender.','67171cd3-108f-4a25-985a-8b0555b5b352',NULL,NULL,NULL,NULL,NULL,NULL),('log.level','org.openmrs.api:warn','Logging levels for log4j.xml. Valid format is class:level,class:level. If class not specified, \'org.openmrs.api\' presumed. Valid levels are trace, debug, info, warn, error or fatal','f69ef4c0-caaa-4945-8755-e7c72ff21632',NULL,NULL,NULL,NULL,NULL,NULL),('log.location',NULL,'A directory where the OpenMRS log file appender is stored. The log file name is \'openmrs.log\'.','2de8aed5-90e0-46b4-be48-2342c984335c',NULL,NULL,NULL,NULL,NULL,NULL),('mail.debug','false','true/false whether to print debugging information during mailing','6150d0e0-a1ca-4808-af69-355e8a625725',NULL,NULL,NULL,NULL,NULL,NULL),('mail.default_content_type','text/plain','Content type to append to the mail messages','4dc73071-3366-4745-9b42-2f6acecf313e',NULL,NULL,NULL,NULL,NULL,NULL),('mail.from','info@openmrs.org','Email address to use as the default from address','3e543dd1-128f-4520-bed4-ab346ac43318',NULL,NULL,NULL,NULL,NULL,NULL),('mail.password','test','Password for the SMTP user (if smtp_auth is enabled)','fb48ea7a-aa17-4f6f-b571-2c45c9d23a1f',NULL,NULL,NULL,NULL,NULL,NULL),('mail.smtp.starttls.enable','false','Set to true to enable TLS encryption, else set to false','ab1a263e-3c96-4220-9952-409a698f963e',NULL,NULL,NULL,NULL,NULL,NULL),('mail.smtp_auth','false','true/false whether the smtp host requires authentication','2595a4b7-d351-4138-9e52-d089a97a00a8',NULL,NULL,NULL,NULL,NULL,NULL),('mail.smtp_host','localhost','SMTP host name','7577eb07-1f87-4508-9842-8aaac8bb100e',NULL,NULL,NULL,NULL,NULL,NULL),('mail.smtp_port','25','SMTP port','6102da96-2434-47b2-813e-7e1830c011c0',NULL,NULL,NULL,NULL,NULL,NULL),('mail.transport_protocol','smtp','Transport protocol for the messaging engine. Valid values: smtp','b3955b98-691e-4697-a436-c1a7f64c4442',NULL,NULL,NULL,NULL,NULL,NULL),('mail.user','test','Username of the SMTP user (if smtp_auth is enabled)','a8b3fb8f-b424-49dd-9862-fe6930a340e6',NULL,NULL,NULL,NULL,NULL,NULL),('metadatamapping.addLocalMappings',NULL,'Specifies whether the concept mappings to the local dictionary should be created when exporting concepts','317bee27-8e72-4460-a142-667e468a8705',NULL,NULL,NULL,NULL,NULL,NULL),('metadatamapping.mandatory','false','true/false whether or not the metadatamapping module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','6e4f03c7-3f36-481c-8d68-6cda1b5ea632',NULL,NULL,NULL,NULL,NULL,NULL),('metadatamapping.started','true','DO NOT MODIFY. true/false whether or not the metadatamapping module has been started. This is used to make sure modules that were running prior to a restart are started again','809f4bd6-a9c5-449d-aac6-7da021c2559c',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.database_version','1.0','DO NOT MODIFY. Current database version number for the metadatasharing module.','718259e7-b309-4a83-8a49-feb24d3c66da',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.enableOnTheFlyPackages','false','Specifies whether metadata packages can be exported on the fly','7dd8af44-cc61-4fdb-9256-266b39cd2815',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.mandatory','false','true/false whether or not the metadatasharing module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','3a408900-554f-40cb-92b7-9c4dc77d9b96',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.persistIdsForClasses',NULL,'A comma separated list of class package/names that denotes classes to try and persist ids for. Common options: org.openmrs.Concept,org.openmrs.Form,org.openmrs.ConceptDatatype,org.openmrs.ConceptClass,org.openmrs.EncounterType,org.openmrs.IdentifierType,org.openmrs.RelationshipType,org.openmrs.Location','9972a45c-622c-4904-b726-6b5ee00c6af4',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.preferredConceptSourceIds',NULL,'Comma-separated list of concept source Ids for preferred sources, in case an incoming concept \r\nhas duplicate mappings to any of these sources, no confirmation will be required unless its \r\ndatatype or concept class differs from that of the existing concept','cfb18f41-4fd8-49aa-bfb5-f776a9915535',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.started','true','DO NOT MODIFY. true/false whether or not the metadatasharing module has been started. This is used to make sure modules that were running prior to a restart are started again','c58da326-8acf-4c79-b262-bfcdb7af7db7',NULL,NULL,NULL,NULL,NULL,NULL),('metadatasharing.webservicesKey',NULL,'Key to grant access to remote systems to consume module webservices RESTfully','e091e673-2d65-447f-b7bd-87fdc5c64928',NULL,NULL,NULL,NULL,NULL,NULL),('minSearchCharacters','3','Number of characters user must input before searching is started.','1df4fdb6-1857-4f88-aa74-65dc30258ec8',NULL,NULL,NULL,NULL,NULL,NULL),('module_repository_folder','modules','Name of the folder in which to store the modules','fd243812-aa5f-4bda-bd8d-a275e2c5f2e9',NULL,NULL,NULL,NULL,NULL,NULL),('mrs.genders','{\"M\":\"Male\", \"F\":\"Female\"}','List of gender and gender codes used across MRS','a110bb9c-f97d-495c-8778-3b5eb02ec441',NULL,NULL,NULL,NULL,NULL,NULL),('newPatientForm.relationships',NULL,'Comma separated list of the RelationshipTypes to show on the new/short patient form. The list is defined like \'3a, 4b, 7a\'. The number is the RelationshipTypeId and the \'a\' vs \'b\' part is which side of the relationship is filled in by the user.','3b5d2bc8-a239-4555-92db-92b6480c9e3d',NULL,NULL,NULL,NULL,NULL,NULL),('new_patient_form.showRelationships','false','true/false whether or not to show the relationship editor on the addPatient.htm screen','4a174a81-91e0-4eca-b1a9-b037cc909dcc','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('obs.complex_obs_dir','complex_obs','Default directory for storing complex obs.','6f431c35-e7f9-4f78-abfd-e650a0226976',NULL,NULL,NULL,NULL,NULL,NULL),('openerpatomfeedclient.mandatory','false','true/false whether or not the openerpatomfeedclient module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','cb5f81d2-6e65-4676-9d49-ef3fd330e09d',NULL,NULL,NULL,NULL,NULL,NULL),('openerpatomfeedclient.started','true','DO NOT MODIFY. true/false whether or not the openerpatomfeedclient module has been started. This is used to make sure modules that were running prior to a restart are started again','89419e15-a14a-43a8-8a04-bbeae95b47f5',NULL,NULL,NULL,NULL,NULL,NULL),('openmrs-atomfeed.mandatory','false','true/false whether or not the openmrs-atomfeed module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','004d8195-163f-4cba-b0d9-459f3f176d0b',NULL,NULL,NULL,NULL,NULL,NULL),('openmrs-atomfeed.started','true','DO NOT MODIFY. true/false whether or not the openmrs-atomfeed module has been started. This is used to make sure modules that were running prior to a restart are started again','092a0a1d-175e-45b1-a899-1affe0e0a579',NULL,NULL,NULL,NULL,NULL,NULL),('order.dosingInstructionsConceptUuid','9d86785e-3f10-11e4-adec-0800271c1b75','Global property pointing to duration units concept set','9d8fbf9e-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('order.drugDispensingUnitsConceptUuid','87a0c56d-3f10-11e4-adec-0800271c1b75','Dose Quantity Units UUID','87a08f0d-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('order.drugDosingUnitsConceptUuid','9d5b708e-3f10-11e4-adec-0800271c1b75','Global property pointing to dosing units concept set','9d6753fa-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('order.drugRoutesConceptUuid','9d697972-3f10-11e4-adec-0800271c1b75','Global property pointing to drug routes concept set','9d718b33-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('order.durationUnitsConceptUuid','9d735b63-3f10-11e4-adec-0800271c1b75','Global property pointing to duration units concept set','9d74f171-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('order.nextOrderNumberSeed','310','The next order number available for assignment','53c00d2f-5406-4646-b6a3-7ff831d85e27',NULL,NULL,NULL,NULL,NULL,NULL),('order.orderNumberGeneratorBeanId',NULL,'Specifies spring bean id of the order generator to use when assigning order numbers','14aeb40c-fede-45d5-be49-ff9a25151791',NULL,NULL,NULL,NULL,NULL,NULL),('order.testSpecimenSourcesConceptUuid',NULL,'Specifies the uuid of the concept set where its members represent the possible test specimen sources','cf99870d-0b08-4314-bae3-98afb7ee5e4e',NULL,NULL,NULL,NULL,NULL,NULL),('patient.defaultPatientIdentifierValidator','org.openmrs.patient.impl.LuhnIdentifierValidator','This property sets the default patient identifier validator. The default validator is only used in a handful of (mostly legacy) instances. For example, it\'s used to generate the isValidCheckDigit calculated column and to append the string \"(default)\" to the name of the default validator on the editPatientIdentifierType form.','ff7883a2-141c-4cf5-bb93-add6da5c91f5',NULL,NULL,NULL,NULL,NULL,NULL),('patient.headerAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that will be shown on the patient dashboard','e2df03d3-43d6-44ba-8ad8-69a0844c4c6f',NULL,NULL,NULL,NULL,NULL,NULL),('patient.identifierPrefix',NULL,'This property is only used if patient.identifierRegex is empty. The string here is prepended to the sql indentifier search string. The sql becomes \"... where identifier like \'\';\". Typically this value is either a percent sign (%) or empty.','2738bc71-791c-421e-afcd-10c9fdf0f205',NULL,NULL,NULL,NULL,NULL,NULL),('patient.identifierRegex',NULL,'WARNING: Using this search property can cause a drop in mysql performance with large patient sets. A MySQL regular expression for the patient identifier search strings. The @SEARCH@ string is replaced at runtime with the user\'s search string. An empty regex will cause a simply \'like\' sql search to be used. Example: ^0*@SEARCH@([A-Z]+-[0-9])?$','e72ad4ef-6e39-4ff8-b8ce-9c90719e503e',NULL,NULL,NULL,NULL,NULL,NULL),('patient.identifierSearchPattern',NULL,'If this is empty, the regex or suffix/prefix search is used. Comma separated list of identifiers to check. Allows for faster searching of multiple options rather than the slow regex. e.g. @SEARCH@,0@SEARCH@,@SEARCH-1@-@CHECKDIGIT@,0@SEARCH-1@-@CHECKDIGIT@ would turn a request for \"4127\" into a search for \"in (\'4127\',\'04127\',\'412-7\',\'0412-7\')\"','b88cfbac-213f-4560-bca7-b6a2ccec59d2',NULL,NULL,NULL,NULL,NULL,NULL),('patient.identifierSuffix',NULL,'This property is only used if patient.identifierRegex is empty. The string here is prepended to the sql indentifier search string. The sql becomes \"... where identifier like \'\';\". Typically this value is either a percent sign (%) or empty.','ebfb82ef-43c9-41e1-a5a0-621a9aa0c516',NULL,NULL,NULL,NULL,NULL,NULL),('patient.listingAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that should be displayed for patients in _lists_','2af95a77-0e73-4382-8269-800c740ba167',NULL,NULL,NULL,NULL,NULL,NULL),('patient.nameValidationRegex','^[a-zA-Z \\-]+$','Names of the patients must pass this regex. Eg : ^[a-zA-Z \\-]+$ contains only english alphabet letters, spaces, and hyphens. A value of .* or the empty string means no validation is done.','4315a7c2-24a2-4d4a-b776-95ed983ff978',NULL,NULL,NULL,NULL,NULL,NULL),('patient.viewingAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that should be displayed for patients when _viewing individually_','0fb974b6-07b9-4bd1-b823-e20637113c72',NULL,NULL,NULL,NULL,NULL,NULL),('PatientIdentifierType.locked','false','Set to a value of true if you do not want allow editing patient identifier types, else set to false.','7b223852-4f8b-40fd-8596-a0be16c2eddc',NULL,NULL,NULL,NULL,NULL,NULL),('patientIdentifierTypes.locked','false','Set to a value of true if you do not want allow editing patient identifier types, else set to false.','2473dc4a-c854-4126-bc89-da9898176900',NULL,NULL,NULL,NULL,NULL,NULL),('patientSearch.matchMode','START','Specifies how patient names are matched while searching patient. Valid values are \'ANYWHERE\' or \'START\'. Defaults to start if missing or invalid value is present.','a4f4ce84-59b3-422c-9a4f-cbf7e27c185e',NULL,NULL,NULL,NULL,NULL,NULL),('patient_identifier.importantTypes',NULL,'A comma delimited list of PatientIdentifier names : PatientIdentifier locations that will be displayed on the patient dashboard. E.g.: TRACnet ID:Rwanda,ELDID:Kenya','82c42f90-b68f-4ff3-96f0-6955f43959e4',NULL,NULL,NULL,NULL,NULL,NULL),('person.attributeSearchMatchMode','EXACT','Specifies how person attributes are matched while searching person. Valid values are \'ANYWHERE\' or \'EXACT\'. Defaults to exact if missing or invalid value is present.','850c97ed-9548-437c-a326-a7d63df4bdf7',NULL,NULL,NULL,NULL,NULL,NULL),('person.searchMaxResults','1000','The maximum number of results returned by patient searches','526b5e22-6e8f-4970-babc-af61872fdb09',NULL,NULL,NULL,NULL,NULL,NULL),('PersonAttributeType.locked','false','Set to a value of true if you do not want allow editing person attribute types, else set to false.','dbc7dadc-3e67-4186-97e5-d8b0ce544505',NULL,NULL,NULL,NULL,NULL,NULL),('personAttributeTypes.locked','false','Set to a value of true if you do not want allow editing person attribute types, else set to false.','37d9d6cb-d67e-4526-b1cb-99fc43f1a0d1',NULL,NULL,NULL,NULL,NULL,NULL),('provider.unknownProviderUuid','f9badd80-ab76-11e2-9e96-0800200c9a66','Specifies the uuid of the Unknown Provider account','c26954b7-cb13-4648-b52d-e2c31a397144',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.addressWidget','personAddress','Address widget to use throughout the module','a68ee612-26a9-4ebf-b7c2-af3496a261af',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.advancedSearchPersonAttributeType',NULL,'Person attribute type, specified by uuid, to use as a search field on the advanced search page','bd6a2252-91f3-46ac-a135-b87dd765027d',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.database_version','1.0','DO NOT MODIFY. Current database version number for the providermanagement module.','73015f7a-cd7b-4f64-b43c-658991908588',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.historicalPatientListDisplayFields','Identifier:patient.patientIdentifier.identifier|Given Name:patient.personName.givenName|Family Name:patient.personName.familyName|Age:patient.age|Gender:patient.gender|Start Date:relationship.startDate|End Date:relationship.endDate','Fields to display in the historical patient lists; specified as a pipe-delimited list of label/field pairs','ea29efe5-b5e3-47e4-ba16-122f47cd283d',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.historicalProviderListDisplayFields','Identifier:provider.identifier|Given Name:provider.person.personName.givenName|Family Name:provider.person.personName.familyName|Role:provider.providerRole|Gender:provider.person.gender|Start Date:relationship.startDate|End Date:relationship.endDate','Fields to display in the historical provider lists; specified as a pipe-delimited list of label/field pairs','9a478125-6f2c-40cd-8620-a8674b23a9b8',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.mandatory','false','true/false whether or not the providermanagement module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','2e1501f0-23e1-4d96-9376-56bf4da947b0',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.patientListDisplayFields','Identifier:patient.patientIdentifier.identifier|Given Name:patient.personName.givenName|Family Name:patient.personName.familyName|Age:patient.age|Gender:patient.gender|Start Date:relationship.startDate','Fields to display in the patient lists; specified as a pipe-delimited list of label/field pairs','4e0dcf7f-f737-4638-a939-a9986eb51333',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.patientSearchDisplayFields','Identifier:patient.patientIdentifier.identifier|Given Name:patient.personName.givenName|Family Name:patient.personName.familyName|Age:patient.age|Gender:patient.gender','Fields to display in the patient search results; specified as a pipe-delimited list of label/field pairs','e0df3e10-4951-4656-bab2-c703c00a3ac8',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.personAttributeTypes',NULL,'Person attributes to display on the provider dashboard; specified as a pipe-delimited list of person attribute type uuids','47ba7340-88b0-4784-a305-0a935f53d96d',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.personSearchDisplayFields','Given Name:person.personName.givenName|Family Name:person.personName.familyName|Age:person.age|Gender:person.gender','Fields to display in the person search results; specified as a pipe-delimited list of label/field pairs','b82e330e-90e9-4356-899d-992686d92543',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.providerListDisplayFields','Identifier:provider.identifier|Given Name:provider.person.personName.givenName|Family Name:provider.person.personName.familyName|Role:provider.providerRole|Gender:provider.person.gender|Start Date:relationship.startDate','Fields to display in the provider lists; specified as a pipe-delimited list of label/field pairs','354791e4-5abd-4421-a6f1-6f23b7b1ae8e',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.providerSearchDisplayFields','Identifier:provider.identifier|Given Name:provider.person.personName.givenName|Family Name:provider.person.personName.familyName|Role:provider.providerRole|Gender:provider.person.gender','Fields to display in the provider search results; specified as a pipe-delimited list of label/field pairs','9b935508-8746-45f4-b491-aa783adb7752',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.restrictSearchToProvidersWithProviderRoles','false','True/false whether to restrict providers to those with roles','35404dc4-8961-4c7d-a0b2-c4850f7224e8',NULL,NULL,NULL,NULL,NULL,NULL),('providermanagement.started','true','DO NOT MODIFY. true/false whether or not the providermanagement module has been started. This is used to make sure modules that were running prior to a restart are started again','46d981db-dc99-4933-ab15-cf832bb0fab3',NULL,NULL,NULL,NULL,NULL,NULL),('providerSearch.matchMode','EXACT','Specifies how provider identifiers are matched while searching for providers. Valid values are START,EXACT, END or ANYWHERE','a11c129b-c2dc-4146-95aa-32fde8d6bb97',NULL,NULL,NULL,NULL,NULL,NULL),('reference-data.mandatory','false','true/false whether or not the reference-data module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','b0741544-4e92-47ef-a2c6-68c22c6ce57e',NULL,NULL,NULL,NULL,NULL,NULL),('reference-data.started','true','DO NOT MODIFY. true/false whether or not the reference-data module has been started. This is used to make sure modules that were running prior to a restart are started again','573bc7a3-9e4a-4d20-a0e2-6f051933c860',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.biometrics.implementation',NULL,'Which Biometrics engine implementation to should we connect to?\r\nSpecify a Spring bean name, or leave blank to disable','4e3703be-f2b0-4c88-b490-c4c9236c4369',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.birthdateEstimationStartMonth','0','The month from which the birth date is estimated, with January having a value of 0','436cd1dd-c77c-430b-ad45-9328de175d53',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.familyNameAutoSuggestList',NULL,'A comma separated list of common names to auto suggest for the family name field, when registering patients.','51470255-a12b-4dea-877c-b8008646aff8',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.fastSimilarPatientSearchAlgorithm','registrationcore.BasicSimilarPatientSearchAlgorithm','Specifies a bean used for the fast similar patient search algorithm.','015352ab-f317-4668-9c4d-5a356a4f08d1',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.givenNameAutoSuggestList',NULL,'A comma separated list of common names to auto suggest for the given name field, when registering patients.','dbe1a1b3-e313-4189-85df-f207d907b893',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.identifierSourceId',NULL,'Specifies the identifier source to use when generating patient identifiers','04fd4089-99a0-4f02-a62a-a45547eb5373',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.local_mpi_identifierTypeMap.OpenEMPI ID','a5d38e09-efcb-4d91-a526-50ce1ba5011a:2.16.840.1.113883.4.357:ISO','Specifies the mapping from OpenEMPI Object ID (OID) to the local OpenMRS Application\'s identifier for OpenEMPI ID UUID.\r\nOpenEMPI ID is the default Global Identifier Domain (GID) for OpenEMPI but this can be changed.','7a5cc131-ad04-4011-9c61-b044207127d9',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.local_mpi_identifierTypeMap.OpenMRS ID','81433852-3f10-11e4-adec-0800271c1b75:2.25.71280592878078638113873461180761116320:PI','Specifies the mapping from OpenEMPI Object ID (OID) to the local OpenMRS Application\'s identifier for OpenMRS ID UUID.\r\nOpenMRS ID is the default generated identifier for OpenMRS but this can be changed.','2419b8fd-8268-4d99-8860-8f7457789701',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mandatory','false','true/false whether or not the registrationcore module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','e5e56bb2-547a-4e71-9365-a97cbb7d715b',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.Hl7implementation','registrationcore.mpiHl7v2HttpSender','Specifies which bean should be used to send the Hl7 Message. Current options are:\r\n\"registrationcore.mpiHl7v2HttpSender\", \"registrationcore.mpiHl7v2MllpSender\".','941b0078-0525-4e7d-8d0c-546ac5de7e31',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.implementation',NULL,'Which MPI to should we connect to? Specify a Spring bean name, or leave blank to disable MPI integration. Options include:\r\n\"registrationcore.mpi.implementation.PixPdq\", \"registrationcore.mpi.implementation.OpenEMPI\".','06c3a167-1310-4147-9820-48adead81277',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pdq.errorHandler.implementation',NULL,'Specify a Spring bean name of PDQ error handler service. It requires the xds-sender module and outgoing message\r\nexception module developed by SolDevelo. Set value to \"outgoingmessageexceptions.PdqErrorHandlingService\" and\r\ninstall those two modules to enable pix error handling functionality.','ad51a045-444c-49c3-a066-159e46eebec8',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pdqEndpoint','http://18.223.38.222:5001/pdq','Specifies endpoint for Hl7 PDQ Message','01b493b9-263e-4ea5-9b7c-0cc426df4fe3',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pdqIdentifierTypeUuidList','81433852-3f10-11e4-adec-0800271c1b75,a5d38e09-efcb-4d91-a526-50ce1ba5011a','Specifies the list of identifiers to send in a PDQ query to get patient data from the MPI. Takes a list of UUID of patient identifier types - separate them with commas.\r\nUUIDs can be found in the patient_identifier_type database table.','295e2d94-da7f-4f0e-9f91-3e515f212f1b',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pdqPort','3700','Specifies port for Hl7 PDQ Message','d640db66-d073-4eaa-ab2c-a7857a7953df',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.personIdentifierTypeUuid','a5d38e09-efcb-4d91-a526-50ce1ba5011a','Specifies UUID of the identifier type that is used as the Global Identifier Domain (GID) in the MPI.\r\nIt is generated by the MPI and is persisted in OpenMRS.','3a6d13c1-1295-496a-9f7c-7ee3612eb9c7',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pix.errorHandler.implementation',NULL,'Specify a Spring bean name of PIX error handler service. It requires the xds-sender module and outgoing message\r\nexception module developed by SolDevelo. Set value to \"outgoingmessageexceptions.PixErrorHandlingService\" and\r\ninstall those two modules to enable pix error handling functionality.','ed46324d-6f72-488b-b969-4ca8bb903c2b',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pixEndpoint','http://18.223.38.222:5001/pix','Specifies the endpoint for the Hl7 PIX Message','a1b01747-7065-41ad-ae33-7ec9de5aaeb7',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pixIdentifierTypeUuidList','81433852-3f10-11e4-adec-0800271c1b75,a5d38e09-efcb-4d91-a526-50ce1ba5011a','Specifies the list of identifiers to send in a PIX query to save the patient in the MPI. Takes a list of UUID of patient identifier types - separate them with commas.\r\nUUIDs can be found in the patient_identifier_type database table.','b899ba0b-1522-4f7d-94da-2564e6b5313e',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.pixPort','3600','Specifies port for Hl7 PIX Message','911ef37b-7bb2-40bc-9acf-b9c79da1ecf4',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.receivingApplication','TsebaMokuli','Specifies the receiving application in the MSH header section of the HL7 message','93e61efb-6ea3-4713-bc03-4b89d5267225',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.receivingFacility','LSHIE','Specifies sending Facility in the MSH header section of the HL7 message','1f524659-1e24-4a87-b350-2f6d9eeb9bde',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.sendingApplication','eRegisterMuela','Specifies the sending application in the MSH header section of the HL7 message','72ab7076-3dd4-49eb-bb33-866459e27851',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.sendingFacility','MuelaHC','Specifies sending Facility in the MSH header section of the HL7 message','b20377fb-6bce-472a-b435-d8ba338394f4',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.mpi.url',NULL,'Specifies url to MPI server. (GSOC OpenEMPI Specific Implementation)','7dccade2-67cb-413a-b1f5-449d384e4ab2',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.openempi.enableProbabilisticMatching','false','Specifies if probability matching should be used (GSOC OpenEMPI Specific Implementation)','dfec7b0e-9812-4778-b3c2-f70ab093f9e9',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.openempi.globalIdentifierDomainId',NULL,'Specifies main identifier on MPI server (e.g. \"xyz\" for OpenEMPI) (GSOC OpenEMPI Specific Implementation)','b205694d-cee2-4aac-af16-f80fb6c0ed17',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.openmrsIdentifier.uuid','81433852-3f10-11e4-adec-0800271c1b75','UUID of the OpenMRS identifier that will be generated during MPI import unless it is present. By default set to the UUID of OpenMRS ID.\r\nNote: You have to have a Patient Identifier Source correctly configured and stored in the global property identifierSourceId','827c6e4c-4696-4c3e-bf46-bd6e6f438126',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.patientNameSearch','registrationcore.BasicPatientNameSearch','Specifies a bean used for the auto suggest name feature.','b47bf436-bd91-49b2-95ed-3a347ba55de9',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.preciseSimilarPatientSearchAlgorithm','registrationcore.BasicExactPatientSearchAlgorithm','Specifies a bean used for the precise similar patient search algorithm.','9a5244ef-6717-4639-990e-954ff5681b80',NULL,NULL,NULL,NULL,NULL,NULL),('registrationcore.started','true','DO NOT MODIFY. true/false whether or not the registrationcore module has been started. This is used to make sure modules that were running prior to a restart are started again','67321f92-904e-4cf9-99af-d69fe5008d01',NULL,NULL,NULL,NULL,NULL,NULL),('report.deleteReportsAgeInHours','72','Reports that are not explicitly saved are deleted automatically when they are this many hours old. (Values less than or equal to zero means do not delete automatically)','e7116b5c-adb9-46a0-ae6f-4d990b10d508',NULL,NULL,NULL,NULL,NULL,NULL),('report.xmlMacros',NULL,'Macros that will be applied to Report Schema XMLs when they are interpreted. This should be java.util.properties format.','85d33560-e355-4cf2-b81f-1c6c94e84f62',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.dataEvaluationBatchSize','-1','This determines whether to run evaluators for Data in batches and what the size of those batches should be.\r\nA value of less than or equal to 0 indicates that no batching is desired.','7204b3c4-92d9-4445-acb9-be5509fa292b',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.defaultDateFormat','dd/MMM/yyyy','Default date format to use when formatting report data','20e968af-8c02-4c72-979a-6e0cf6ee20bd',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.defaultLocale','en','Default locale to use when formatting report data','f929c2b7-b812-4384-b8e9-03c8425ad35b',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.evaluationLoggerEnabled','false','If false, will disable the built in use of the evaluation logger to log evaluation information for performance diagnostics','981c91de-dbec-4c29-99b5-7f706983d40b',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.includeDataExportsAsDataSetDefinitions','false','If reportingcompatibility is installed, this indicates whether data exports should be exposed as Dataset Definitions','76778228-86cd-4192-9f30-361f698051e6',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.mandatory','false','true/false whether or not the reporting module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','9b538a20-228c-4ba2-b73e-9e01d84bcdce',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.maxCachedReports','10','The maximum number of reports whose underlying data and output should be kept in the cache at any one time','f1c19677-88e3-474a-9ae5-59261381bff5',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.maxReportsToRun','1','The maximum number of reports that should be processed at any one time','2ee2fb45-e5bc-4ec3-81e0-05eaea563370',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.preferredIdentifierTypes',NULL,'Pipe-separated list of patient identifier type names, which should be displayed on default patient datasets','96c7caf0-232e-4147-81c6-de66e5a5cfb4',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.runReportCohortFilterMode','showIfNull','Supports the values hide,showIfNull,show which determine whether the cohort selector should be available in the run report page','d0eeb046-bc6c-4a97-ae7b-97e13d32400d',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.started','true','DO NOT MODIFY. true/false whether or not the reporting module has been started. This is used to make sure modules that were running prior to a restart are started again','546ae5ff-473d-4b92-bebc-67a7294ab437',NULL,NULL,NULL,NULL,NULL,NULL),('reporting.testPatientsCohortDefinition',NULL,'Points to a cohort definition representing all test/fake patients that you want to exclude from all queries and reports. You may set this to the UUID of a saved cohort definition, or to \"library:keyInADefinitionLibrary\"','d7d07f99-a994-43d6-b74c-24bf07d1da0b',NULL,NULL,NULL,NULL,NULL,NULL),('reportingcompatibility.data_export_batch_size','7500','The number of patients to export at a time in a data export. The larger this number the faster and more memory that is used. The smaller this number the slower and less memory is used.','e7c4bc1f-0d05-41ef-8d26-14b927bf72d5',NULL,NULL,NULL,NULL,NULL,NULL),('reportingcompatibility.mandatory','false','true/false whether or not the reportingcompatibility module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','ad25b9b2-1ff9-4d92-9d95-3b3b3dfcb752',NULL,NULL,NULL,NULL,NULL,NULL),('reportingcompatibility.patientLinkUrl','patientDashboard.form','The link url for a particular patient to view from the cohort builder','544a85e9-85f9-4505-a4e1-ddd0fca3d7ec',NULL,NULL,NULL,NULL,NULL,NULL),('reportingcompatibility.started','true','DO NOT MODIFY. true/false whether or not the reportingcompatibility module has been started. This is used to make sure modules that were running prior to a restart are started again','bc32ab21-9852-42ea-9c43-7f67f8929b05',NULL,NULL,NULL,NULL,NULL,NULL),('reportingrest.mandatory','false','true/false whether or not the reportingrest module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','8607de51-4b0d-491c-8ece-f744f0d037dd',NULL,NULL,NULL,NULL,NULL,NULL),('reportingrest.started','true','DO NOT MODIFY. true/false whether or not the reportingrest module has been started. This is used to make sure modules that were running prior to a restart are started again','884304f4-3deb-42a7-b9ac-4eda185c8dcd',NULL,NULL,NULL,NULL,NULL,NULL),('reportProblem.url','http://errors.openmrs.org/scrap','The openmrs url where to submit bug reports','1ccf2dc4-b32c-41fd-8d2e-0dc01a884359',NULL,NULL,NULL,NULL,NULL,NULL),('rulesengine.mandatory','false','true/false whether or not the rulesengine module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','62a4ab9c-52ac-4513-9841-a9613dddd461',NULL,NULL,NULL,NULL,NULL,NULL),('rulesengine.started','true','DO NOT MODIFY. true/false whether or not the rulesengine module has been started. This is used to make sure modules that were running prior to a restart are started again','6b82428f-8e5a-434a-a39d-3a421f89dae2',NULL,NULL,NULL,NULL,NULL,NULL),('scheduler.password','test','Password for the OpenMRS user that will perform the scheduler activities','4f075c92-a447-4c89-b058-230ec8a738c5',NULL,NULL,NULL,NULL,NULL,NULL),('scheduler.username','admin','Username for the OpenMRS user that will perform the scheduler activities','ffded5ea-4625-4545-9efa-ea78a50445ca',NULL,NULL,NULL,NULL,NULL,NULL),('SchedulerMarksComplete','false','Scheduler marks checked in appointments as complete when it turned on','e82ac4cd-827e-4238-ace9-6c0399f62727',NULL,NULL,NULL,NULL,NULL,NULL),('SchedulerMarksMissed','false','Scheduler marks scheduled appointments as missed when it is turned on','51715641-7af6-4f46-ac38-35147b3242ee',NULL,NULL,NULL,NULL,NULL,NULL),('search.caseSensitiveDatabaseStringComparison','false','Indicates whether database string comparison is case sensitive or not. Setting this to false for MySQL with a case insensitive collation improves search performance.','ac4c736a-9bcd-4cb5-b992-9f00115bd347',NULL,NULL,NULL,NULL,NULL,NULL),('search.indexVersion','7','Indicates the index version. If it is blank, the index needs to be rebuilt.','81bfa679-5f2c-4c12-a8fc-5345f09dcd93',NULL,NULL,NULL,NULL,NULL,NULL),('searchWidget.batchSize','200','The maximum number of search results that are returned by an ajax call','b3b4c64b-9cfe-48d1-8bf0-1949f1695815',NULL,NULL,NULL,NULL,NULL,NULL),('searchWidget.dateDisplayFormat',NULL,'Date display format to be used to display the date somewhere in the UI i.e the search widgets and autocompletes','e6b2842f-07bb-4f73-9ffe-ab9511738ebc',NULL,NULL,NULL,NULL,NULL,NULL),('searchWidget.maximumResults','2000','Specifies the maximum number of results to return from a single search in the search widgets','adae79fc-9fde-4fbb-8265-dbc804ca9465',NULL,NULL,NULL,NULL,NULL,NULL),('searchWidget.runInSerialMode','false','Specifies whether the search widgets should make ajax requests in serial or parallel order, a value of true is appropriate for implementations running on a slow network connection and vice versa','05ceff5c-3681-4fbd-b803-3f0985135cc2','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('searchWidget.searchDelayInterval','400','Specifies time interval in milliseconds when searching, between keyboard keyup event and triggering the search off, should be higher if most users are slow when typing so as to minimise the load on the server','6f1b982e-e920-44d8-a195-f6ca2f9dca38',NULL,NULL,NULL,NULL,NULL,NULL),('security.allowedFailedLoginsBeforeLockout','7','Maximum number of failed logins allowed after which username is locked out','ad937514-59a9-444e-b23e-2961e047c2c8',NULL,NULL,NULL,NULL,NULL,NULL),('security.passwordCannotMatchUsername','true','Configure whether passwords must not match user\'s username or system id','243a0045-1dd8-4412-8443-b186a0b36354','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('security.passwordCustomRegex',NULL,'Configure a custom regular expression that a password must match','8e142d81-dfc7-4874-9e5e-f11e107c029e',NULL,NULL,NULL,NULL,NULL,NULL),('security.passwordMinimumLength','8','Configure the minimum length required of all passwords','1e33de83-dd54-4e11-8aea-045e5dc269a1',NULL,NULL,NULL,NULL,NULL,NULL),('security.passwordRequiresDigit','true','Configure whether passwords must contain at least one digit','e1b047c7-f4d5-4f5d-8eae-96e58db43bce','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('security.passwordRequiresNonDigit','true','Configure whether passwords must contain at least one non-digit','ea31d9d1-6544-4edb-b19b-4cf525cc0238','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('security.passwordRequiresUpperAndLowerCase','true','Configure whether passwords must contain both upper and lower case characters','961cc724-b9b9-4ef6-bd26-0b7c0c9f6ab0','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('serialization.xstream.mandatory','false','true/false whether or not the serialization.xstream module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','4d3029c6-6218-4ecb-a7dd-100226ad8252',NULL,NULL,NULL,NULL,NULL,NULL),('serialization.xstream.started','true','DO NOT MODIFY. true/false whether or not the serialization.xstream module has been started. This is used to make sure modules that were running prior to a restart are started again','6d0e98f1-cff1-4644-a6c3-8d243f614fd2',NULL,NULL,NULL,NULL,NULL,NULL),('uicommons.mandatory','false','true/false whether or not the uicommons module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','9c883c63-50f9-4d2b-9cfe-48b3237168d2',NULL,NULL,NULL,NULL,NULL,NULL),('uicommons.started','true','DO NOT MODIFY. true/false whether or not the uicommons module has been started. This is used to make sure modules that were running prior to a restart are started again','5e035208-3f7f-46a8-a4a8-f370b12c2741',NULL,NULL,NULL,NULL,NULL,NULL),('uiframework.formatter.dateAndTimeFormat','dd.MMM.yyyy, HH:mm:ss','Format used by UiUtils.format for dates that have a time component','98a3c5ca-c0cd-4249-ac9a-ec58b98c0897',NULL,NULL,NULL,NULL,NULL,NULL),('uiframework.formatter.dateFormat','dd.MMM.yyyy','Format used by UiUtils.format for dates that do not have a time component','6f429d40-972f-4d28-8d32-6952d3374d0a',NULL,NULL,NULL,NULL,NULL,NULL),('uiframework.mandatory','false','true/false whether or not the uiframework module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','3fba7fce-33fd-4748-a9f4-b33f8b61bdcc',NULL,NULL,NULL,NULL,NULL,NULL),('uiframework.started','true','DO NOT MODIFY. true/false whether or not the uiframework module has been started. This is used to make sure modules that were running prior to a restart are started again','f0929aa0-cb0a-4e1b-b20e-3c57d22b5734',NULL,NULL,NULL,NULL,NULL,NULL),('uilibrary.mandatory','false','true/false whether or not the uilibrary module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','1098fb91-8d76-4c58-8919-939b06fc25cc',NULL,NULL,NULL,NULL,NULL,NULL),('uilibrary.started','true','DO NOT MODIFY. true/false whether or not the uilibrary module has been started. This is used to make sure modules that were running prior to a restart are started again','71a95588-ce7a-44c4-be40-eeb96fe059ba',NULL,NULL,NULL,NULL,NULL,NULL),('uploaded.files.directory','/home/bahmni/uploaded-files/mrs/','Directory where files uploaded to Bahmni are stored','bb33d8bc-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL,NULL,NULL,NULL),('user.headerAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that will be shown on the user dashboard. (not used in v1.5)','5bca62d2-c71d-4187-ad42-87f744bdcc2d',NULL,NULL,NULL,NULL,NULL,NULL),('user.listingAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that should be displayed for users in _lists_','b433af18-c843-4e68-bbb4-decb99c97784',NULL,NULL,NULL,NULL,NULL,NULL),('user.requireEmailAsUsername','false','Indicates whether a username must be a valid e-mail or not.','bf0d3012-c9f7-4012-b7d1-2aa793dea966','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('user.viewingAttributeTypes',NULL,'A comma delimited list of PersonAttributeType names that should be displayed for users when _viewing individually_','2bdc0621-bd24-4873-8edf-be31d4fdd673',NULL,NULL,NULL,NULL,NULL,NULL),('use_patient_attribute.healthCenter','false','Indicates whether or not the \'health center\' attribute is shown when viewing/searching for patients','ca1419ea-b351-4767-8e95-6d6cf9b9d3f2','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('use_patient_attribute.mothersName','false','Indicates whether or not mother\'s name is able to be added/viewed for a patient','4a024c74-6003-41f9-801a-752bb30d2ef9','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('validation.disable','false','Disables validation of OpenMRS Objects. Only takes affect on next restart. Warning: only do this is you know what you are doing!','27c3226c-b88e-4329-8027-0d8b1ae5128c',NULL,NULL,NULL,NULL,NULL,NULL),('visits.allowOverlappingVisits','true','true/false whether or not to allow visits of a given patient to overlap','de638cfe-bd4c-46e8-9609-970766f3dde9','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('visits.assignmentHandler','org.openmrs.module.emrapi.adt.EmrApiVisitAssignmentHandler','Set to the name of the class responsible for assigning encounters to visits.','71f5f74d-2b4a-47df-9c81-a0b8bc27e630',NULL,NULL,NULL,NULL,NULL,NULL),('visits.autoCloseVisitType','New or Pre-ART,ARV Drug Pickup,Sick or Presumptive TB,High Viral Load Result,HTS Only','comma-separated list of the visit type(s) to automatically close','eb6f071e-3c12-4dc5-ad0c-953c0e5d2021',NULL,NULL,NULL,NULL,NULL,NULL),('visits.enabled','true','Set to true to enable the Visits feature. This will replace the \'Encounters\' tab with a \'Visits\' tab on the dashboard.','1f1b13f9-2def-44c1-844b-708ca04e9fe7','org.openmrs.customdatatype.datatype.BooleanDatatype',NULL,NULL,NULL,NULL,NULL),('visits.encounterTypeToVisitTypeMapping',NULL,'Specifies how encounter types are mapped to visit types when automatically assigning encounters to visits. e.g 1:1, 2:1, 3:2 in the format encounterTypeId:visitTypeId or encounterTypeUuid:visitTypeUuid or a combination of encounter/visit type uuids and ids e.g 1:759799ab-c9a5-435e-b671-77773ada74e4','50722a0e-6e2a-4742-81d9-74345d56e04d',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.allowedips',NULL,'A comma-separate list of IP addresses that are allowed to access the web services. An empty string allows everyone to access all ws. \r\n IPs can be declared with bit masks e.g. 10.0.0.0/30 matches 10.0.0.0 - 10.0.0.3 and 10.0.0.0/24 matches 10.0.0.0 - 10.0.0.255.','55e8bfdd-0d74-4109-a5bc-ae88a1f01603',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.mandatory','false','true/false whether or not the webservices.rest module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','c32a4641-f635-46a3-b78c-bdb85d04cf21',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.maxResultsAbsolute','2000','The absolute max results limit. If the client requests a larger number of results, then will get an error','eb8dbd29-b1ac-4c03-b435-2db89179ae2a',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.maxResultsDefault','500','The default max results limit if the user does not provide a maximum when making the web service call.','0c292473-777e-4aa3-b8ae-ab9e29e7a892',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.quietDocs','true','If the value of this setting is \"true\", then nothing is logged while the Swagger specification is being generated.','85b77fd1-5461-41ee-b1e9-d4b1c5785d50',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.started','true','DO NOT MODIFY. true/false whether or not the webservices.rest module has been started. This is used to make sure modules that were running prior to a restart are started again','49fe025a-f8ed-460d-8c5c-9bcf942840ef',NULL,NULL,NULL,NULL,NULL,NULL),('webservices.rest.uriPrefix',NULL,'The URI prefix through which clients consuming web services will connect to the web application, should be of the form http://{ipAddress}:{port}/{contextPath}','2e29060d-5faf-4011-8b63-b337e1e6aae3',NULL,NULL,NULL,NULL,NULL,NULL),('xds-sender.mandatory','false','true/false whether or not the xds-sender module MUST start when openmrs starts. This is used to make sure that mission critical modules are always running if openmrs is running.','dfab58f1-dcba-49aa-b470-42ce1a1a232a',NULL,NULL,NULL,NULL,NULL,NULL),('xds-sender.started','true','DO NOT MODIFY. true/false whether or not the xds-sender module has been started. This is used to make sure modules that were running prior to a restart are started again','7b714dbd-4ce9-4a39-81b6-bbb33d6a4518',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.ccd.errorHandler.implementation','outgoingmessageexceptions.CcdErrorHandlingService','Specify a Spring bean name of CCD error handler service','e388ac50-bfb2-4602-9e4f-3efe62863bd0',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.codeNationalRoot','2.25.71280592878078638113873461180761116320','Authority domain for the specific health facility patient identifier domain','aa0909fd-c8e4-4993-a735-561203a2fbb3',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.ecidRoot','2.16.840.1.113883.4.357','Authority domain for the OpenEMPI enterprise Global ID','1820537c-d38d-4ef7-8935-5ba2d60ae651',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.exportCcd.ignoreCerts','false','Determines if ccd downloading from OpenSHR should ignore certificates','66beb1b9-341c-4826-89db-8966ce4c5df0',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.exportCcdEndpoint','http://thebukana.org:8080/openmrs/ws/rest/exportccd/ccd','Specifies the export ccd module endpoint address (OpenSHR)','68a7890e-75e1-4ae1-a62a-233a4de82923',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.notificationsPullPoint.endpoint',NULL,'Endpoint used to fetch Notifications from the Pull Point','df3d38b7-9a0c-417e-9a8b-2f68afdf89b7',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.notificationsPullPoint.password',NULL,'Password to authorize int the Notifications Pull Point','f813e418-8fc5-4233-9f98-97121e700b3b',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.notificationsPullPoint.username',NULL,'Username to authorize int the Notifications Pull Point','5605fa89-b8af-4990-85fd-edc9a04c7f13',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.openmrs.moduleUsedToDetermineSoftwareVersion','isanteplusreports','Specifies the module name which will be used to determine the software version.','5ed53e4d-847a-4c48-ad57-bb888d860207',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.openmrs.password','P@$$w0rd!','Specifies password for authentication in OpenMRS','c0012d0e-c775-4cac-8a15-3931de2805ef',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.openmrs.provider.role.clinician',NULL,'Specifies role for add provider to XDS documents','7aa265f2-d0d1-448d-aa15-ca756c0aae91',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.openmrs.provider.role.doctor',NULL,'Specifies role for add provider to XDS documents','b90eaa63-95ac-47c4-b4d6-09bbfb3a31ed',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.openmrs.username','superman','Specifies username for authentication in OpenMRS','defac893-17a5-4b73-aab8-bc26f90a4773',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.oshr.password','OpenSHR#123','Specifies the OpenSHR password','583e7583-b0fe-40b5-9fd8-dba4de90d54a',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.oshr.username','admin','Specifies the OpenSHR username','83da5158-6a8a-4ceb-aaa0-7bb6f1bee47b',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.pullNotificationsTaskInterval','3600','Interval time (in seconds) to execute pulling notifications from Pull Point task','96eb41f2-fabf-4bc2-a738-e8155e87cb9c',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.registryEndpoint','http://18.223.38.222:5001/xdsregistry','Specifies endpoint to XDS registry','91c28b4b-8928-4372-a179-63f21dc43d00',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.repositoryEndpoint','http://18.223.38.222:5001/xdsrepository','Specifies endpoint to XDS repository','ab7d64f4-1bf2-42b9-94d3-f5ecf91f61d2',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.xdsB.errorHandler.implementation','outgoingmessageexceptions.XdsBErrorHandlingService','Specify a Spring bean name of XDS.b error handler service','8ed44ba0-ea24-4c83-834d-3c8407f2eab1',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.xdsrepository.password',NULL,'Specifies password for authentication to XDS repository','e3bc50ad-10ab-41b3-a3b9-564fbda3e359',NULL,NULL,NULL,NULL,NULL,NULL),('xdssender.xdsrepository.username','pixclient_b2101','Specifies username for authentication to XDS repository','9ef76352-e85e-4285-b9cf-61e2aad08306',NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `global_property` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-05-07 18:45:07 diff --git a/scripts/patient_identifier_type.sql b/scripts/patient_identifier_type.sql new file mode 100644 index 0000000..1715d7d --- /dev/null +++ b/scripts/patient_identifier_type.sql @@ -0,0 +1,76 @@ +-- MySQL dump 10.13 Distrib 5.6.40, for Linux (x86_64) +-- +-- Host: localhost Database: openmrs +-- ------------------------------------------------------ +-- Server version 5.6.40 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `patient_identifier_type` +-- + +DROP TABLE IF EXISTS `patient_identifier_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `patient_identifier_type` ( + `patient_identifier_type_id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '', + `description` text, + `format` varchar(255) DEFAULT NULL, + `check_digit` tinyint(1) NOT NULL DEFAULT '0', + `creator` int(11) NOT NULL DEFAULT '0', + `date_created` datetime NOT NULL, + `required` tinyint(1) NOT NULL DEFAULT '0', + `format_description` varchar(255) DEFAULT NULL, + `validator` varchar(200) DEFAULT NULL, + `location_behavior` varchar(50) DEFAULT NULL, + `retired` tinyint(1) NOT NULL DEFAULT '0', + `retired_by` int(11) DEFAULT NULL, + `date_retired` datetime DEFAULT NULL, + `retire_reason` varchar(255) DEFAULT NULL, + `uuid` char(38) NOT NULL, + `uniqueness_behavior` varchar(50) DEFAULT NULL, + `date_changed` datetime DEFAULT NULL, + `changed_by` int(11) DEFAULT NULL, + PRIMARY KEY (`patient_identifier_type_id`), + UNIQUE KEY `patient_identifier_type_uuid_index` (`uuid`), + KEY `patient_identifier_type_retired_status` (`retired`), + KEY `type_creator` (`creator`), + KEY `user_who_retired_patient_identifier_type` (`retired_by`), + KEY `patient_identifier_type_changed_by` (`changed_by`), + CONSTRAINT `patient_identifier_type_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`), + CONSTRAINT `type_creator` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), + CONSTRAINT `user_who_retired_patient_identifier_type` FOREIGN KEY (`retired_by`) REFERENCES `users` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `patient_identifier_type` +-- + +LOCK TABLES `patient_identifier_type` WRITE; +/*!40000 ALTER TABLE `patient_identifier_type` DISABLE KEYS */; +INSERT INTO `patient_identifier_type` VALUES (1,'OpenMRS Identification Number','Unique number used in OpenMRS','',1,1,'2005-09-22 00:00:00',0,NULL,'org.openmrs.patient.impl.LuhnIdentifierValidator',NULL,0,NULL,NULL,NULL,'8d793bee-c2cc-11de-8d13-0010c6dffd0f',NULL,NULL,NULL),(2,'Old Identification Number','Number given out prior to the OpenMRS system (No check digit)','',0,1,'2005-09-22 00:00:00',0,NULL,NULL,NULL,0,NULL,NULL,NULL,'8d79403a-c2cc-11de-8d13-0010c6dffd0f',NULL,NULL,NULL),(3,'Patient Identifier','New patient identifier type created for use by the Bahmni Registration System',NULL,0,1,'2014-09-18 00:00:00',1,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'81433852-3f10-11e4-adec-0800271c1b75',NULL,NULL,NULL),(4,'National ID','National ID','[0-9]{12,12}',0,4,'2016-11-10 12:03:26',0,'Should contain a 12 digit number',NULL,'NOT_USED',0,NULL,NULL,NULL,'0d2ac572-8de3-46c8-9976-1f78899c599f',NULL,'2018-04-14 20:59:24',4),(5,'HIV Program ID','Unique patient identifier for clients that are currently on ART','[A-Z]{1}[0-9]{2,2}[0-9]{4,8}\\/[0-9]{2,2}-[0-9]{2,2}',0,1,'2018-03-30 04:59:27',0,'Should a contain a unique number with a min. of 4 and max 8 digits and should be suffixed with /mm-yy representing the clients cohort i.e. /02-14',NULL,'NOT_USED',0,NULL,NULL,NULL,'5c1e8ae2-33c6-11e8-8236-0242ac110002',NULL,'2020-01-16 10:09:29',4),(6,'Biometric Fingerprint ID','Identifier type to be used for capturing patients\' fingerprint as an additional identifier',NULL,0,1,'2018-03-30 05:04:53',0,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'1e494229-33c7-11e8-8236-0242ac110002',NULL,'2018-03-30 11:58:15',4),(7,'TB Program ID','Identifier type used for patient started on TB treatment','[A-Z]{1}[0-9]{4,4}[0-9]{4,6}\\/[0-9]{2,2}',0,1,'2018-03-30 05:05:44',0,'Prefix with facility code B1011 followed by a 4 digit number and suffixed by /yy where yy is the year',NULL,'NOT_USED',0,NULL,NULL,NULL,'3cdb2f37-33c7-11e8-8236-0242ac110002',NULL,'2018-05-22 15:48:48',4),(8,'ANC Program ID','Identifier type used for patients enrolled into the ANC program',NULL,0,1,'2018-03-30 05:27:59',0,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'588f45f8-33ca-11e8-8236-0242ac110002',NULL,'2018-03-30 11:58:27',4),(9,'ECID','Specifies UUID of the identifier type that is used as the Global Identifier Domain (GID) in the MPI. It is generated by the MPI and is persisted in OpenMRS.',NULL,0,2,'2018-06-28 00:00:00',0,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'a5d38e09-efcb-4d91-a526-50ce1ba5011a',NULL,'2020-01-16 10:14:06',4),(10,'PNC Program ID','Unique identifier for PNC clients',NULL,0,4,'2020-01-16 10:17:27',0,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'07f2dc6b-ac44-410d-918d-7d7d685dcabc',NULL,NULL,NULL),(11,'File Number','Other numbers used to uniquely identify a patient',NULL,0,4,'2020-01-16 10:18:59',0,NULL,NULL,'NOT_USED',0,NULL,NULL,NULL,'d2084c23-edae-4b0f-98a2-cbcdb6708294',NULL,NULL,NULL); +/*!40000 ALTER TABLE `patient_identifier_type` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-05-20 6:43:59 diff --git a/scripts/restore_concepts.sh b/scripts/restore_concepts.sh new file mode 100644 index 0000000..a27edeb --- /dev/null +++ b/scripts/restore_concepts.sh @@ -0,0 +1,14 @@ +#!/bin/bash +user=root +password=mypassword +db=openmrs +container=bahmni_docker_emr-service_1 +concept_backup=omrs_concept_dictionary.sql + +# pull the latest file +git fetch --all +git pull origin master + +# restore it into MySQL + +docker exec -it $container mysql -u$user -p$password < $concept_backup \ No newline at end of file diff --git a/scripts/serial_08May2020.sql b/scripts/serial_08May2020.sql new file mode 100644 index 0000000..2515001 --- /dev/null +++ b/scripts/serial_08May2020.sql @@ -0,0 +1,74 @@ +-- MySQL dump 10.13 Distrib 5.6.41, for Linux (x86_64) +-- +-- Host: localhost Database: openmrs +-- ------------------------------------------------------ +-- Server version 5.6.41 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `serialized_object` +-- + +DROP TABLE IF EXISTS `serialized_object`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `serialized_object` ( + `serialized_object_id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `description` varchar(5000) DEFAULT NULL, + `type` varchar(255) NOT NULL, + `subtype` varchar(255) NOT NULL, + `serialization_class` varchar(255) NOT NULL, + `serialized_data` mediumtext NOT NULL, + `date_created` datetime NOT NULL, + `creator` int(11) NOT NULL, + `date_changed` datetime DEFAULT NULL, + `changed_by` int(11) DEFAULT NULL, + `retired` tinyint(1) NOT NULL DEFAULT '0', + `date_retired` datetime DEFAULT NULL, + `retired_by` int(11) DEFAULT NULL, + `retire_reason` varchar(1000) DEFAULT NULL, + `uuid` char(38) NOT NULL, + PRIMARY KEY (`serialized_object_id`), + UNIQUE KEY `serialized_object_uuid_index` (`uuid`), + KEY `serialized_object_creator` (`creator`), + KEY `serialized_object_changed_by` (`changed_by`), + KEY `serialized_object_retired_by` (`retired_by`), + CONSTRAINT `serialized_object_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`), + CONSTRAINT `serialized_object_creator` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), + CONSTRAINT `serialized_object_retired_by` FOREIGN KEY (`retired_by`) REFERENCES `users` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=500 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `serialized_object` +-- + +LOCK TABLES `serialized_object` WRITE; +/*!40000 ALTER TABLE `serialized_object` DISABLE KEYS */; +INSERT INTO `serialized_object` VALUES (1,'ART Monthly Period Indicator Report','Period indicator report to be used to report to DHIS2 Lesotho Monthly ART Aggregate Report','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Monthly Period Indicator Report\n Period indicator report to be used to report to DHIS2 Lesotho Monthly ART Aggregate Report\n \n 2018-02-21 08:48:22 UTC\n \n 2018-03-01 07:14:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-02-21 08:48:22',4,'2018-03-01 07:14:19',4,0,NULL,NULL,NULL,'c097de3d-fba8-40f1-ba07-580002f61d2b'),(2,'ART_test Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART_test Data Set\n \n 2018-02-21 08:48:23 UTC\n \n 2018-07-11 11:24:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n 001\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n 002\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n 003\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n 004\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n 005\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n 006\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n 007\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n 008\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n 009\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n 010\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n 011\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n 012\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n 013\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 25to49yrs\n \n \n \n \n \n 014\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 25to49yrs\n \n \n \n \n \n 015\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 50+yrs\n \n \n \n \n \n 016\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 50+yrs\n \n \n \n \n \n 017\n \n \n \n \n \n \n \n \n 018\n \n \n \n \n \n \n 019\n \n \n \n \n \n \n 020\n \n \n \n \n \n \n 021\n \n \n \n \n \n \n 022\n \n \n \n \n \n \n 023\n \n \n \n \n \n \n 024\n \n \n \n \n \n \n 025\n \n \n \n \n \n \n 026\n \n \n \n \n \n \n 027\n \n \n \n \n \n \n 028\n \n \n \n \n \n \n 029\n \n \n \n \n \n \n 030\n \n \n \n \n \n \n 031\n \n \n \n \n \n \n 032\n \n \n \n \n \n \n 033\n \n \n \n \n \n \n \n \n \n 034\n \n \n \n \n \n \n 035\n \n \n \n \n \n \n 036\n \n \n \n \n \n \n 037\n \n \n \n \n \n \n 038\n \n \n \n \n \n \n 039\n \n \n \n \n \n \n 040\n \n \n \n \n \n \n 041\n \n \n \n \n \n \n 042\n \n \n \n \n \n \n 043\n \n \n \n \n \n \n 044\n \n \n \n \n \n \n 045\n \n \n \n \n \n \n 046\n \n \n \n \n \n \n 047\n \n \n \n \n \n \n 048\n \n \n \n \n \n \n 049\n \n \n \n \n \n \n \n \n \n 050\n \n \n \n \n \n \n \n \n \n 051\n \n \n \n \n \n \n \n \n \n 052\n \n \n \n \n \n \n \n \n \n 053\n \n \n \n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n 054\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n 055\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n 056\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n 057\n \n \n \n \n \n \n \n \n \n 058\n \n \n \n \n \n \n 059\n \n \n \n \n \n \n 060\n \n \n \n \n \n \n 192\n \n \n \n \n \n \n \n \n \n 193\n \n \n \n \n \n \n 194\n \n \n \n \n \n \n 195\n \n \n \n \n \n \n 196\n \n \n \n \n \n \n 197\n \n \n \n \n \n \n 198\n \n \n \n \n \n \n 199\n \n \n \n \n \n \n 200\n \n \n \n \n \n \n 201\n \n \n \n \n \n \n 202\n \n \n \n \n \n \n 203\n \n \n \n \n \n \n 204\n \n \n \n \n \n \n 205\n \n \n \n \n \n \n 206\n \n \n \n \n \n \n 207\n \n \n \n \n \n \n 208\n \n \n \n \n \n \n \n \n \n 209\n \n \n \n \n \n \n 210\n \n \n \n \n \n \n 211\n \n \n \n \n \n \n 212\n \n \n \n \n \n \n 213\n \n \n \n \n \n \n 214\n \n \n \n \n \n \n 215\n \n \n \n \n \n \n 216\n \n \n \n \n \n \n 217\n \n \n \n \n \n \n 218\n \n \n \n \n \n \n 219\n \n \n \n \n \n \n 220\n \n \n \n \n \n \n 221\n \n \n \n \n \n \n 222\n \n \n \n \n \n \n 223\n \n \n \n \n \n \n','2018-02-21 14:18:23',4,'2018-07-11 16:54:16',4,0,NULL,NULL,NULL,'0e2ab4bb-abdb-4097-916c-794d14bd9664'),(3,'Sex_Cohort_Query','Patients sex','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Sex_Cohort_Query\n Patients sex\n \n 2018-02-21 08:55:41 UTC\n \n 2018-02-27 09:19:19 UTC\n \n \n maleIncluded\n \n java.lang.Boolean\n true\n \n \n femaleIncluded\n \n java.lang.Boolean\n true\n \n \n 3\n false\n','2018-02-21 08:55:41',4,'2018-02-27 09:19:19',4,0,NULL,NULL,NULL,'a1ddc580-da2c-4297-8c69-866de9252263'),(4,'Age_cohort_Query','patients ages','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Age_cohort_Query\n patients ages\n \n 2018-02-21 09:00:07 UTC\n \n 2019-03-26 13:41:51 UTC\n \n \n minAge\n \n java.lang.Integer\n true\n \n \n maxAge\n \n java.lang.Integer\n true\n \n \n effectiveDate\n \n java.util.Date\n true\n \n \n 4\n YEARS\n YEARS\n false\n','2018-02-21 09:00:07',4,'2019-03-26 13:41:51',4,0,NULL,NULL,NULL,'f8d3dd08-0b1f-4780-b77f-97d021b803af'),(5,'ART start date','ART clients newly started on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART start date\n ART clients newly started on ART\n \n 2018-02-21 09:08:47 UTC\n \n 2018-03-01 07:22:25 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n value1\n \n java.util.Date\n true\n \n \n value2\n \n java.util.Date\n true\n \n \n 5\n ANY\n \n \n \n \n GREATER_EQUAL\n LESS_EQUAL\n','2018-02-21 09:08:47',4,'2018-03-01 07:22:25',4,0,NULL,NULL,NULL,'3cfb3f8e-ceff-4201-8fcb-25e2d61a77c5'),(6,'CI_01: Clients newly started on ART','Cohort Indicator for clients newly started on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI_01: Clients newly started on ART\n Cohort Indicator for clients newly started on ART\n \n 2018-02-21 09:55:13 UTC\n \n 2019-01-31 18:03:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 6\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-02-21 09:55:13',4,'2019-01-31 18:03:42',4,0,NULL,NULL,NULL,'e815a8e7-ba99-4a34-9e3b-038a0fbaa34d'),(9,'DM_Age','age dimensions','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n DM_Age\n age dimensions\n \n 2018-02-27 09:21:44 UTC\n \n 2020-04-26 11:02:40 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n 9\n \n \n 01to04yrs\n \n \n \n \n maxAge\n 4\n \n \n minAge\n 1\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 05to09yrs\n \n \n \n \n maxAge\n 9\n \n \n minAge\n 5\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 05yrsto14yrs\n \n \n \n \n maxAge\n 14\n \n \n minAge\n 5\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 06Mnths-5yrs\n \n \n \n \n maxAge\n 5\n \n \n minAge\n 6\n \n \n \n \n \n 06yrs-14yrs\n \n \n \n \n maxAge\n 14\n \n \n minAge\n 6\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 0Mnths-4yrs\n \n \n \n \n maxAge\n 4\n \n \n minAge\n 0\n \n \n \n \n \n 100to150yrs\n \n \n \n \n maxAge\n 150\n \n \n minAge\n 120\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 10to14yrs\n \n \n \n \n maxAge\n 14\n \n \n minAge\n 10\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 15+yrs\n \n \n \n \n maxAge\n 120\n \n \n minAge\n 15\n \n \n \n \n \n 15to19yrs\n \n \n \n \n maxAge\n 19\n \n \n minAge\n 15\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 20to24yrs\n \n \n \n \n maxAge\n 24\n \n \n minAge\n 20\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 25to29yrs\n \n \n \n \n maxAge\n 29\n \n \n minAge\n 25\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 25to49yrs\n \n \n \n \n maxAge\n 49\n \n \n minAge\n 25\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 30to34yrs\n \n \n \n \n maxAge\n 34\n \n \n minAge\n 30\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 35to39yrs\n \n \n \n \n maxAge\n 39\n \n \n minAge\n 35\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 40to44yrs\n \n \n \n \n maxAge\n 44\n \n \n minAge\n 40\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 45to49yrs\n \n \n \n \n maxAge\n 49\n \n \n minAge\n 45\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 50+yrs\n \n \n \n \n maxAge\n 110\n \n \n minAge\n 50\n \n \n \n \n \n 50to100yrs\n \n \n \n \n maxAge\n 119\n \n \n minAge\n 50\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n <6Months\n \n \n \n \n maxAge\n 5\n \n \n minAge\n 0\n \n \n \n \n \n Adults\n \n \n \n Age_cohort_Query\n \n \n \n \n maxAge\n 100\n \n \n minAge\n 50\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n Children 0to14\n \n \n \n \n maxAge\n 14\n \n \n minAge\n 0\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n Under 1yr\n \n \n \n \n maxAge\n 0\n \n \n minAge\n 0\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n','2018-02-27 09:21:44',4,'2020-04-26 11:02:40',4,0,NULL,NULL,NULL,'93da8e26-c1ea-44e3-a0f3-f325c7797d9a'),(10,'DM_Sex','Sex dimession','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n DM_Sex\n Sex dimession\n \n 2018-02-27 09:39:18 UTC\n \n 2018-02-27 09:42:20 UTC\n \n 10\n \n \n Females\n \n \n \n \n femaleIncluded\n true\n \n \n maleIncluded\n false\n \n \n \n \n \n Males\n \n \n \n \n femaleIncluded\n false\n \n \n maleIncluded\n true\n \n \n \n \n \n','2018-02-27 09:39:18',4,'2018-02-27 09:42:20',4,0,NULL,NULL,NULL,'dec74189-72cc-4981-b956-557f37b82a87'),(11,'Weight_Cohort_Query','for weight bands','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Weight_Cohort_Query\n for weight bands\n \n 2018-02-27 10:06:14 UTC\n \n 2018-06-05 07:39:13 UTC\n \n \n value1\n \n java.lang.Double\n true\n \n \n value2\n \n java.lang.Double\n true\n \n \n 11\n LAST\n \n GREATER_EQUAL\n LESS_EQUAL\n','2018-02-27 12:06:14',4,'2018-06-05 09:39:13',4,0,NULL,NULL,NULL,'33a425d0-d6f9-42b8-8afe-08df159de8b7'),(12,'DM_Weight','patient weight','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n DM_Weight\n patient weight\n \n 2018-02-27 10:11:05 UTC\n \n 2018-06-05 07:39:28 UTC\n \n 12\n \n \n 03to3.9kg\n \n \n \n \n value2\n 3.9\n \n \n value1\n 0.0\n \n \n \n \n \n 04to5.9kg\n \n \n \n \n locationList\n \n \n \n value2\n 5.9\n \n \n value1\n 4.0\n \n \n \n \n \n 06to9.9kg\n \n \n \n \n locationList\n \n \n \n value2\n 9.9\n \n \n value1\n 6.0\n \n \n \n \n \n 10to13.9kg\n \n \n \n \n locationList\n \n \n \n value2\n 13.9\n \n \n value1\n 10.0\n \n \n \n \n \n 14to19.9kg\n \n \n \n \n locationList\n \n \n \n value2\n 19.9\n \n \n value1\n 14.0\n \n \n \n \n \n 20to24.9kg\n \n \n \n \n locationList\n \n \n \n value2\n 24.9\n \n \n value1\n 20.0\n \n \n \n \n \n 25+kg\n \n \n \n \n locationList\n \n \n \n value2\n 200.0\n \n \n value1\n 25.0\n \n \n \n \n \n','2018-02-27 12:11:05',4,'2018-06-05 09:39:28',4,0,NULL,NULL,NULL,'776ab68c-5afb-4054-8ee1-e9d6667c53cf'),(13,'Clients seen','','org.openmrs.module.reporting.query.encounter.definition.EncounterQuery','org.openmrs.module.reporting.query.encounter.definition.SqlEncounterQuery','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen\n \n \n 2018-02-27 13:17:12 UTC\n \n 2018-02-27 15:09:07 UTC\n \n \n client_type_seen\n \n org.openmrs.Concept\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 13\n select count(*) as numEncounters \nfrom encounter enc inner join obs on enc.encounter_id = obs.encounter_id \nwhere \nencounter_type = 1 and enc.location_id = 7 and \n(DATE(encounter_datetime) >= '2018-02-01' and DATE(encounter_datetime) <= '2018-02-28') and \nconcept_id = 3843 and value_coded = 3842 \nGROUP BY enc.encounter_id;\n','2018-02-27 13:17:12',4,'2018-02-27 15:09:07',4,0,NULL,NULL,NULL,'23eb8d9f-180f-4522-a23b-8298c7cedb8f'),(15,'Clients seen for consultation','Any client seen at the location specified and period (ENCOUNTER QUERY)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen for consultation\n Any client seen at the location specified and period (ENCOUNTER QUERY)\n \n 2018-02-28 11:01:22 UTC\n \n 2019-01-22 09:51:11 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n 15\n ANY\n \n \n \n 1\n','2018-02-28 13:01:22',4,'2019-01-22 11:51:11',4,0,NULL,NULL,NULL,'0b52550f-d47c-46ba-81f1-ca8aa8eeb4b3'),(16,'type of client','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n type of client\n \n \n 2018-02-28 11:06:40 UTC\n \n 2018-10-30 14:11:35 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 16\n ANY\n \n \n \n \n IN\n \n \n \n \n','2018-02-28 13:06:40',4,'2018-10-30 16:11:35',4,0,NULL,NULL,NULL,'14d6cb12-1b59-4023-b7d7-f67a5138423a'),(17,'ART clients_seen','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients_seen\n \n \n 2018-02-28 11:08:24 UTC\n \n 2018-03-28 08:56:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 17\n type-of-client AND Clients-seen\n \n \n type-of-client\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n Clients-seen\n \n \n \n \n \n \n','2018-02-28 13:08:24',4,'2018-03-28 10:56:10',4,0,NULL,NULL,NULL,'a01c89db-b405-4c76-9f33-14e918211569'),(19,'CI03: Tx Curr Previous Months','Clients seen for ART services in the reporting period males (under 1) (excludes) new initiations','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI03: Tx Curr Previous Months\n Clients seen for ART services in the reporting period males (under 1) (excludes) new initiations\n \n 2018-03-01 07:23:08 UTC\n \n 2019-02-27 14:28:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 19\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-01 07:23:08',4,'2019-02-27 14:28:13',4,0,NULL,NULL,NULL,'ba6124a3-7406-4cd9-9f5b-32cc0c56286c'),(20,'Current on ART clients who made visits in previous 2 months','Current on ART clients who made visits in previous 2 months (2 months ARV drug supply)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Current on ART clients who made visits in previous 2 months\n Current on ART clients who made visits in previous 2 months (2 months ARV drug supply)\n \n 2018-03-01 08:15:35 UTC\n \n 2018-03-01 08:42:34 UTC\n \n \n location\n \n org.openmrs.Location\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n 20\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand (o.concept_id = 3843 and o.value_coded = 3842) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH))\n','2018-03-01 08:15:35',4,'2018-03-01 08:42:34',4,0,NULL,NULL,NULL,'6fc68835-cd3f-4241-8d81-346182b4f552'),(21,'Current on ART clients who made visits in previous 3 months','ART Clients who made visits in previous 3 Months (3 months drug supply)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Current on ART clients who made visits in previous 3 months\n ART Clients who made visits in previous 3 Months (3 months drug supply)\n \n 2018-03-01 08:16:01 UTC\n \n 2018-10-30 09:18:30 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 21\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand (o.concept_id = 3843 and o.value_coded = 3842) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH))\n','2018-03-01 10:16:01',4,'2018-10-30 11:18:30',4,0,NULL,NULL,NULL,'96bee18b-f015-4f51-9684-58a0be770afc'),(22,'Current on ART clients who made visits in the previous month','Current on ART clients who made visits in the previous month (1 month ARV Drug Supply)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Current on ART clients who made visits in the previous month\n Current on ART clients who made visits in the previous month (1 month ARV Drug Supply)\n \n 2018-03-01 08:20:17 UTC\n \n 2018-03-01 08:45:22 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 22\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand (o.concept_id = 3843 and o.value_coded = 3842) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -0 MONTH))\n','2018-03-01 08:20:17',4,'2018-03-01 08:45:22',4,0,NULL,NULL,NULL,'18b8f912-a433-4fe7-9181-44b5f752db66'),(23,'ARV Drug Supply for 2 Months','Current on ART clients who made visits in previous months (2 months ARV drug supply)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Drug Supply for 2 Months\n Current on ART clients who made visits in previous months (2 months ARV drug supply)\n \n 2018-03-01 08:59:39 UTC\n \n 2018-03-01 18:11:21 UTC\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 23\n ANY\n \n \n \n \n GREATER_THAN\n 30.0\n','2018-03-01 08:59:39',4,'2018-03-01 18:11:21',4,0,NULL,NULL,NULL,'fd31f026-4f55-484b-bed1-8d3a9d1a1b70'),(24,'ARV Drug Supply for 3 Months','Current on ART clients who made visits in previous months (3 months ARV drug supply)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Drug Supply for 3 Months\n Current on ART clients who made visits in previous months (3 months ARV drug supply)\n \n 2018-03-01 09:03:05 UTC\n \n 2018-03-01 18:15:05 UTC\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 24\n ANY\n \n \n \n \n GREATER_EQUAL\n 90.0\n','2018-03-01 09:03:05',4,'2018-03-01 18:15:05',4,0,NULL,NULL,NULL,'96c4ce6b-436f-499e-9c07-9dedadc0f60e'),(25,'Tx. Curr. with visits in prev. 2 months and 2 months ARV Drug Supply','Current on ART clients who made visits in previous 2 months and ARV Drug Supply for 2 Months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Tx. Curr. with visits in prev. 2 months and 2 months ARV Drug Supply\n Current on ART clients who made visits in previous 2 months and ARV Drug Supply for 2 Months\n \n 2018-03-01 09:09:51 UTC\n \n 2018-03-01 18:16:50 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 25\n Current-on-ART-clients-who-made-visits-in-previous-2-months AND ARV-Drug-Supply-for-2-Months\n \n \n Current-on-ART-clients-who-made-visits-in-previous-2-months\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n ARV-Drug-Supply-for-2-Months\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n \n \n \n','2018-03-01 09:09:51',4,'2018-03-01 18:16:50',4,0,NULL,NULL,NULL,'796bd0e5-9af3-4536-9d6c-c80410cbede3'),(26,'Tx. Curr. with visits in prev. 3 months and 3 months ARV Drug Supply','Current on ART clients with visits in prev. 3 months and 3 months ARV Drug Supply','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Tx. Curr. with visits in prev. 3 months and 3 months ARV Drug Supply\n Current on ART clients with visits in prev. 3 months and 3 months ARV Drug Supply\n \n 2018-03-01 09:13:01 UTC\n \n 2018-03-01 18:17:30 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 26\n Current-on-ART-clients-who-made-visits-in-previous-3-months AND ARV-Drug-Supply-for-3-Months\n \n \n Current-on-ART-clients-who-made-visits-in-previous-3-months\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n ARV-Drug-Supply-for-3-Months\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n \n \n \n','2018-03-01 09:13:01',4,'2018-03-01 18:17:30',4,0,NULL,NULL,NULL,'963f27e9-75ea-42d0-8611-a66a3de9d6ab'),(27,'Tx. Curr. with visits in prev. 2 or 3 months and 2 or 3 months ARV Drug Supply','Current on ART clients with visits in prev. 2 or 3 months and 2 or 3 months ARV Drug Supply','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Tx. Curr. with visits in prev. 2 or 3 months and 2 or 3 months ARV Drug Supply\n Current on ART clients with visits in prev. 2 or 3 months and 2 or 3 months ARV Drug Supply\n \n 2018-03-01 09:17:02 UTC\n \n 2018-03-01 09:19:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 27\n Tx.-Curr.-with-visits-in-prev.-3-months-and-3-months-ARV-Drug-Supply OR Tx.-Curr.-with-visits-in-prev.-2-months-and-2-months-ARV-Drug-Supply\n \n \n Tx.-Curr.-with-visits-in-prev.-3-months-and-3-months-ARV-Drug-Supply\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Tx.-Curr.-with-visits-in-prev.-2-months-and-2-months-ARV-Drug-Supply\n \n \n \n \n \n \n','2018-03-01 09:17:02',4,'2018-03-01 09:19:22',4,0,NULL,NULL,NULL,'7aaa2b3f-5eb7-45bc-93f7-8e22534e6f2d'),(28,'ART Summary (DSD)',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.LogicDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Summary (DSD)\n \n 2018-03-01 09:42:19 UTC\n \n \n','2018-03-01 09:42:19',4,NULL,NULL,0,NULL,NULL,NULL,'3245fc9e-d4b6-46fb-9f14-b9f5db7ca56a'),(31,'ART patients transferred Into site','Transfer In for ART clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART patients transferred Into site\n Transfer In for ART clients\n \n 2018-03-15 07:44:35 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 09:44:35',4,NULL,NULL,0,NULL,NULL,NULL,'5a9986bc-e592-4fbe-9c2d-67a68975be60'),(32,'ART patients transferred to other sites','Transfer out for ART patients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART patients transferred to other sites\n Transfer out for ART patients\n \n 2018-03-15 08:08:19 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 10:08:19',4,NULL,NULL,0,NULL,NULL,NULL,'0fe1183e-5cfd-4a12-bb33-915bd3212d52'),(33,'Date Restarted ART','Date ART was restarted after being stopped','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date Restarted ART\n Date ART was restarted after being stopped\n \n 2018-03-15 08:14:46 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n value1\n \n java.util.Date\n true\n \n \n value2\n \n java.util.Date\n true\n \n \n ANY\n \n \n \n \n GREATER_EQUAL\n LESS_EQUAL\n','2018-03-15 10:14:46',4,NULL,NULL,0,NULL,NULL,NULL,'19676fac-ac6b-4f91-a407-e179e74e9d27'),(34,'Children CD4 percent','Count the number of baseline CD4 percentages','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children CD4 percent\n Count the number of baseline CD4 percentages\n \n 2018-03-15 08:21:54 UTC\n \n 2018-03-15 08:35:26 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 34\n ANY\n \n \n \n \n','2018-03-15 10:21:54',4,'2018-03-15 10:35:26',4,0,NULL,NULL,NULL,'c82c286a-90c2-44f4-8ce1-671df77529cd'),(35,'Adult CD4 Count','Return patient with a baseline CD4 counts','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Adult CD4 Count\n Return patient with a baseline CD4 counts\n \n 2018-03-15 08:26:07 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n','2018-03-15 10:26:07',4,NULL,NULL,0,NULL,NULL,NULL,'954ae31e-21d8-4ed6-8a4f-c9be726a5cf0'),(36,'New ART clients with baseline CD4 counts','New ART clients with baseline CD4 counts','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New ART clients with baseline CD4 counts\n New ART clients with baseline CD4 counts\n \n 2018-03-15 08:28:17 UTC\n \n 2018-03-15 08:40:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 36\n (Adult-CD4-Count OR Children-CD4-percent) AND ART-start-date\n \n \n Adult-CD4-Count\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n Children-CD4-percent\n \n \n \n \n \n \n ART-start-date\n \n \n \n \n locationList\n ${location}\n \n \n value2\n ${endDate}\n \n \n value1\n ${startDate}\n \n \n \n \n \n','2018-03-15 10:28:17',4,'2018-03-15 10:40:18',4,0,NULL,NULL,NULL,'b23434a0-ea24-4c1e-82e4-86fd50568241'),(37,'HIV care clients screened for TB','HIV care clients screened for TB','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV care clients screened for TB\n HIV care clients screened for TB\n \n 2018-03-15 13:41:45 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n \n \n','2018-03-15 15:41:45',4,NULL,NULL,0,NULL,NULL,NULL,'e74b63f9-655b-46fe-9397-29b07625ce61'),(38,'Presumptive TB case','Presumptive TB case- these are clients suspected for TB','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Presumptive TB case\n Presumptive TB case- these are clients suspected for TB\n \n 2018-03-15 13:47:06 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 15:47:06',4,NULL,NULL,0,NULL,NULL,NULL,'aa138e08-67c8-48bb-a54e-ce7ed7891547'),(41,'ARV regimen 1e TDF-3TC-NVP','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 1e TDF-3TC-NVP\n \n \n 2018-03-15 14:43:00 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 16:43:00',4,NULL,NULL,0,NULL,NULL,NULL,'f62bc2e5-0c7f-462a-bb28-ae0a6925c088'),(42,'ARV regimen 1f TDF-3TC-EFV','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 1f TDF-3TC-EFV\n \n \n 2018-03-15 14:44:30 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 16:44:30',4,NULL,NULL,0,NULL,NULL,NULL,'06693a67-bb3d-45d7-b9ba-a145d08bb974'),(43,'ARV regimen 1g ABC-3TC-NVP','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 1g ABC-3TC-NVP\n \n \n 2018-03-15 14:46:39 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 16:46:39',4,NULL,NULL,0,NULL,NULL,NULL,'4a1b3589-2ffd-493d-be4f-53a009ec903b'),(44,'ARV regimen 4b AZT-3TC-NVP','ARV regimen 4b AZT-3TC-NVP','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 4b AZT-3TC-NVP\n ARV regimen 4b AZT-3TC-NVP\n \n 2018-03-15 14:55:56 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 16:55:56',4,NULL,NULL,0,NULL,NULL,NULL,'f7ea0f19-995c-4563-b17a-5e0028fafb7b'),(45,'ARV regimen 1h ABC-3TC-EFV','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 1h ABC-3TC-EFV\n \n \n 2018-03-15 14:57:38 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 16:57:38',4,NULL,NULL,0,NULL,NULL,NULL,'99a80476-a4fa-4df3-be47-4dd669a8f34e'),(47,'ARV regimen 2d AZT-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2d AZT-3TC-LPV/r\n \n \n 2018-03-15 15:02:27 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:02:27',4,NULL,NULL,0,NULL,NULL,NULL,'d03c0f54-dd1d-4fdd-9b52-d9b4ae023df6'),(48,'ARV regimen 2c TDF-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2c TDF-3TC-LPV/r\n \n \n 2018-03-15 15:04:34 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:04:34',4,NULL,NULL,0,NULL,NULL,NULL,'46d6acb9-6e78-4194-bd7c-31b8894461cd'),(49,'ARV regimen 4d ABC-3TC-NVP','ARV regimen 4d ABC-3TC-NVP','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 4d ABC-3TC-NVP\n ARV regimen 4d ABC-3TC-NVP\n \n 2018-03-15 15:05:00 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:05:00',4,NULL,NULL,0,NULL,NULL,NULL,'84c300d3-4f0c-4861-b59f-7bd95b6250c1'),(50,'ARV regimen 2e TDF-3TC-ATV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2e TDF-3TC-ATV/r\n \n \n 2018-03-15 15:07:00 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:07:00',4,NULL,NULL,0,NULL,NULL,NULL,'3487cef8-a434-4bf5-93e3-d7b1d35de3b7'),(51,'ARV regimen 4c ABC-3TC-EFV','ARV regimen 4c ABC-3TC-EFV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 4c ABC-3TC-EFV\n ARV regimen 4c ABC-3TC-EFV\n \n 2018-03-15 15:07:42 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:07:42',4,NULL,NULL,0,NULL,NULL,NULL,'44e9041e-b27a-4d4f-9dcb-61a4e6013818'),(52,'ARV regimen 2f AZT-3TC-ATV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2f AZT-3TC-ATV/r\n \n \n 2018-03-15 15:09:16 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:09:16',4,NULL,NULL,0,NULL,NULL,NULL,'03d90077-1768-4abb-a91e-4f2e80d5bab1'),(53,'ARV regimen 2g AZT-3TC-TDF-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2g AZT-3TC-TDF-LPV/r\n \n \n 2018-03-15 15:12:02 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:12:02',4,NULL,NULL,0,NULL,NULL,NULL,'cbbbe740-93a5-4c78-81b4-998dc76bc27f'),(54,'ARV regimen 4a AZT-3TC-EFV','ARV regimen 4a AZT-3TC-EFV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 4a AZT-3TC-EFV\n ARV regimen 4a AZT-3TC-EFV\n \n 2018-03-15 15:13:49 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:13:49',4,NULL,NULL,0,NULL,NULL,NULL,'29d5515c-bd24-40ac-8dad-048138385125'),(55,'ARV regimen 2g ABC-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2g ABC-3TC-LPV/r\n \n \n 2018-03-15 15:16:19 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:16:19',4,NULL,NULL,0,NULL,NULL,NULL,'cf84777c-279b-4830-bfd3-c5ec1b424850'),(57,'ARV regimen 2h ABC-3TC-ATV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 2h ABC-3TC-ATV/r\n \n \n 2018-03-15 15:17:46 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:17:46',4,NULL,NULL,0,NULL,NULL,NULL,'7f02425f-cf7d-469a-9655-d637938673ae'),(59,'ARV regimen 5b AZT-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 5b AZT-3TC-LPV/r\n \n \n 2018-03-15 15:20:34 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:20:34',4,NULL,NULL,0,NULL,NULL,NULL,'20b53122-3fa7-462d-82e3-f27f0ed30aa0'),(60,'ARV regimen 5a ABC-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 5a ABC-3TC-LPV/r\n \n \n 2018-03-15 15:22:30 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:22:30',4,NULL,NULL,0,NULL,NULL,NULL,'ffad5bd5-cc99-4a0c-9e2a-6fd312687894'),(61,'ARV Regimen 6a Ral-3TC-LPV/r','ARV Regimen 6a Ral-3TC-LPV/r','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Regimen 6a Ral-3TC-LPV/r\n ARV Regimen 6a Ral-3TC-LPV/r\n \n 2018-03-15 15:22:41 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:22:41',4,NULL,NULL,0,NULL,NULL,NULL,'a4dfb5bf-0027-4631-b4f4-c08b481af363'),(62,'ARV regimen 3a Ral-3TC-LPV/r','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV regimen 3a Ral-3TC-LPV/r\n \n \n 2018-03-15 15:29:30 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:29:30',4,NULL,NULL,0,NULL,NULL,NULL,'52db4eec-2908-498f-a2fd-065b6eab6b50'),(63,'ARV Regimen 3b TDF-3TC-Ral-DRV/r','ARV Regimen 3b TDF-3TC-Ral-DRV/r','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Regimen 3b TDF-3TC-Ral-DRV/r\n ARV Regimen 3b TDF-3TC-Ral-DRV/r\n \n 2018-03-15 15:30:20 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-03-15 17:30:20',4,NULL,NULL,0,NULL,NULL,NULL,'d0de30d5-9680-415c-a00d-ad9cc587616a'),(64,'CI04: Adults 1st Line ARV Regimen 1(c)AZT-3TC-NVP','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI04: Adults 1st Line ARV Regimen 1(c)AZT-3TC-NVP\n \n \n 2018-03-19 02:13:36 UTC\n \n 2019-01-10 19:00:35 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 64\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:13:36',4,'2019-01-10 19:00:35',4,0,NULL,NULL,NULL,'5891f5b4-bfe3-48cb-b782-6339f9d46ad6'),(65,'CI05: Adults 1st Line ARV Regimen 1(d)AZT-3TC-EFV','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI05: Adults 1st Line ARV Regimen 1(d)AZT-3TC-EFV\n \n \n 2018-03-19 02:17:34 UTC\n \n 2019-01-10 19:02:01 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 65\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:17:34',4,'2019-01-10 19:02:01',4,0,NULL,NULL,NULL,'19e9cc1b-0ffc-4415-84b6-a5b56edf5a23'),(66,'CI06: Adults 1st Line ARV Regimen 1(e)TDF-3TC-NVP','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI06: Adults 1st Line ARV Regimen 1(e)TDF-3TC-NVP\n \n \n 2018-03-19 02:19:37 UTC\n \n 2019-01-10 19:03:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 66\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:19:37',4,'2019-01-10 19:03:17',4,0,NULL,NULL,NULL,'302479e6-10a0-47c8-9931-21133317a576'),(67,'CI07: Adults 1st Line ARV Regimen 1(f)TDF-3TC-EFV','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI07: Adults 1st Line ARV Regimen 1(f)TDF-3TC-EFV\n \n \n 2018-03-19 02:21:35 UTC\n \n 2019-01-10 19:04:01 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 67\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:21:35',4,'2019-01-10 19:04:01',4,0,NULL,NULL,NULL,'1f6b7448-9557-4335-8d9c-3d1310626aa0'),(68,'CI08: Adults 1st Line ARV Regimen 1(g)ABC-3TC-NVP','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI08: Adults 1st Line ARV Regimen 1(g)ABC-3TC-NVP\n \n \n 2018-03-19 02:22:50 UTC\n \n 2019-01-10 19:05:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 68\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:22:50',4,'2019-01-10 19:05:20',4,0,NULL,NULL,NULL,'4a4a1d6a-5c08-451e-b63e-e590890bc6fc'),(69,'CI09: Adults 1st Line ARV Regimen 1(h)ABC-3TC-EFV','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI09: Adults 1st Line ARV Regimen 1(h)ABC-3TC-EFV\n \n \n 2018-03-19 02:24:03 UTC\n \n 2019-01-10 19:06:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 69\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:24:03',4,'2019-01-10 19:06:22',4,0,NULL,NULL,NULL,'e1a6903f-5c76-4d1f-85cb-561bc2a1ea1e'),(70,'CI09: Children 1st Line ARV Regimen 4(c)AZT-3TC-NVP','4(c)AZT-3TC-NVP','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI09: Children 1st Line ARV Regimen 4(c)AZT-3TC-NVP\n 4(c)AZT-3TC-NVP\n \n 2018-03-19 02:26:02 UTC\n \n 2019-02-08 07:20:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 70\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:26:02',4,'2019-02-08 07:20:57',4,0,NULL,NULL,NULL,'b92c628d-b93e-40aa-a5d0-c8f354ab12c9'),(71,'CI10: Children 1st Line ARV Regimen 4(d)AZT-3TC-EFV','4(d)AZT-3TC-EFV','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI10: Children 1st Line ARV Regimen 4(d)AZT-3TC-EFV\n 4(d)AZT-3TC-EFV\n \n 2018-03-19 02:27:41 UTC\n \n 2019-02-08 07:29:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 71\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:27:41',4,'2019-02-08 07:29:58',4,0,NULL,NULL,NULL,'5401502e-24d3-4a01-85c9-f8389c59b566'),(72,'CI11: Children 1st Line ARV Regimen 4(e)ABC-3TC-NVP','4(e)ABC-3TC-NVP','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI11: Children 1st Line ARV Regimen 4(e)ABC-3TC-NVP\n 4(e)ABC-3TC-NVP\n \n 2018-03-19 02:29:03 UTC\n \n 2019-02-08 07:32:26 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 72\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:29:03',4,'2019-02-08 07:32:26',4,0,NULL,NULL,NULL,'183a5f26-6f97-427c-9409-d6263e015aab'),(73,'CI12: Children 1st Line ARV Regimen 4(f)ABC-3TC-EFV','4(f)ABC-3TC-EFV','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI12: Children 1st Line ARV Regimen 4(f)ABC-3TC-EFV\n 4(f)ABC-3TC-EFV\n \n 2018-03-19 02:30:25 UTC\n \n 2019-02-08 07:34:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 73\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:30:25',4,'2019-02-08 07:34:32',4,0,NULL,NULL,NULL,'d84fd2f9-951d-4bbc-b6fc-f59b71dbba6b'),(74,'CI13: Adult 2nd Line ARV Regimen 2(d)TDF-3TC-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI13: Adult 2nd Line ARV Regimen 2(d)TDF-3TC-LPV/r\n \n \n 2018-03-19 02:32:22 UTC\n \n 2019-04-04 06:51:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 74\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:32:22',4,'2019-04-04 06:51:57',4,0,NULL,NULL,NULL,'20bdcee4-fe92-4457-a041-6db72def1895'),(75,'CI14: Adult 2nd Line ARV Regimen 2(c)AZT-3TC-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI14: Adult 2nd Line ARV Regimen 2(c)AZT-3TC-LPV/r\n \n \n 2018-03-19 02:33:44 UTC\n \n 2019-04-04 06:50:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 75\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:33:44',4,'2019-04-04 06:50:57',4,0,NULL,NULL,NULL,'998aa33c-d34b-438a-b4c4-c2dbe25aa481'),(76,'CI15: Adult 2nd Line ARV Regimen 2(e)AZT-3TC-ATV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI15: Adult 2nd Line ARV Regimen 2(e)AZT-3TC-ATV/r\n \n \n 2018-03-19 02:35:46 UTC\n \n 2019-04-04 06:53:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 76\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:35:46',4,'2019-04-04 06:53:03',4,0,NULL,NULL,NULL,'78ffec82-cb3a-49ad-aaa2-1f50bfe12e80'),(77,'CI16: Adult 2nd Line ARV Regimen 2(f)TDF-3TC-ATV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI16: Adult 2nd Line ARV Regimen 2(f)TDF-3TC-ATV/r\n \n \n 2018-03-19 02:36:59 UTC\n \n 2019-04-04 06:53:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 77\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:36:59',4,'2019-04-04 06:53:58',4,0,NULL,NULL,NULL,'f5c9b6ce-13e2-4305-b991-045536fd153e'),(78,'CI17: Adult 2nd Line ARV Regimen 2(g)AZT-3TC-TDF-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI17: Adult 2nd Line ARV Regimen 2(g)AZT-3TC-TDF-LPV/r\n \n \n 2018-03-19 02:38:02 UTC\n \n 2018-03-19 02:42:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 78\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-03-19 04:38:02',4,'2018-03-19 04:42:22',4,0,NULL,NULL,NULL,'00a49e20-9f14-437e-a4cd-857ae281e238'),(79,'CI18: Adults 2nd Line ARV Regimen 2(g) ABC-3TC-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI18: Adults 2nd Line ARV Regimen 2(g) ABC-3TC-LPV/r\n \n \n 2018-03-19 02:40:22 UTC\n \n 2019-01-10 19:18:05 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 79\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:40:22',4,'2019-01-10 19:18:05',4,0,NULL,NULL,NULL,'8b70c3a8-a114-4ace-a458-9677150c48e2'),(80,'CI19: Adults 2nd Line ARV Regimen 2(h) ABC-3TC-ATV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI19: Adults 2nd Line ARV Regimen 2(h) ABC-3TC-ATV/r\n \n \n 2018-03-19 02:43:15 UTC\n \n 2019-01-10 19:19:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 80\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:43:15',4,'2019-01-10 19:19:12',4,0,NULL,NULL,NULL,'11e7ab47-8ee4-4bbb-8199-32619d304e32'),(81,'CI20: Adults 3rd Line ARV Regimen 3(a) Ral-3TC-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI20: Adults 3rd Line ARV Regimen 3(a) Ral-3TC-LPV/r\n \n \n 2018-03-19 02:45:12 UTC\n \n 2019-01-10 19:20:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 81\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:45:12',4,'2019-01-10 19:20:10',4,0,NULL,NULL,NULL,'e22a68da-5893-42c3-b261-1b0e0a5a98aa'),(82,'CI21: Adults 3rd Line ARV Regimen 3(b) TDF/3TC/Ral/DRV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI21: Adults 3rd Line ARV Regimen 3(b) TDF/3TC/Ral/DRV/r\n \n \n 2018-03-19 02:46:35 UTC\n \n 2019-01-10 19:21:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 82\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:46:35',4,'2019-01-10 19:21:13',4,0,NULL,NULL,NULL,'5b189710-2a56-477b-b2d4-569b7a16a30f'),(83,'CI22: Adults and Children 3rd Line ARV Regimen 3(c)EFV-DRV/r-Ral','replaced 6(a) ETV DRV/r/ral must ahve been a typo error','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI22: Adults and Children 3rd Line ARV Regimen 3(c)EFV-DRV/r-Ral\n replaced 6(a) ETV DRV/r/ral must ahve been a typo error\n \n 2018-03-19 02:48:05 UTC\n \n 2019-02-21 09:31:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 83\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:48:05',4,'2019-02-21 09:31:19',4,0,NULL,NULL,NULL,'51510b74-2bad-4e95-8a68-7211097e16b2'),(84,'CI23: Children 2nd Line ARV Regimen 5(a)AZT-3TC-LPV/r','5(a)AZT-3TC-LPV/r','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI23: Children 2nd Line ARV Regimen 5(a)AZT-3TC-LPV/r\n 5(a)AZT-3TC-LPV/r\n \n 2018-03-19 02:49:37 UTC\n \n 2019-04-04 09:44:35 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 84\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:49:37',4,'2019-04-04 09:44:35',4,0,NULL,NULL,NULL,'cd5977ea-be20-4b8c-af53-2dd17d4b771b'),(85,'CI24: Children 2nd Line ARV Regimen 5(b)ABC-3TC-LPV/r','5(b)ABC-3TC-LPV/r','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI24: Children 2nd Line ARV Regimen 5(b)ABC-3TC-LPV/r\n 5(b)ABC-3TC-LPV/r\n \n 2018-03-19 02:50:49 UTC\n \n 2019-04-04 09:45:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 85\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:50:49',4,'2019-04-04 09:45:40',4,0,NULL,NULL,NULL,'c9fca87c-8069-49ef-b8fd-aae5f6ab4de8'),(86,'CI25: Children 3rd Line ARV Regimen 6(a) Ral-3TC-LPV/r','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI25: Children 3rd Line ARV Regimen 6(a) Ral-3TC-LPV/r\n \n \n 2018-03-19 02:52:07 UTC\n \n 2019-02-08 08:05:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 86\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:52:07',4,'2019-02-08 08:05:17',4,0,NULL,NULL,NULL,'b7afeb4d-f5f6-49fc-bf16-b65fa53f485a'),(87,'CI26: ART Transfer Ins','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI26: ART Transfer Ins\n \n \n 2018-03-19 02:53:56 UTC\n \n 2019-01-31 18:12:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 87\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:53:56',4,'2019-01-31 18:12:52',4,0,NULL,NULL,NULL,'d31412f8-9a7a-46d8-9f2e-7c51ed7f2057'),(88,'CI27: ART Transfer Outs','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI27: ART Transfer Outs\n \n \n 2018-03-19 02:55:42 UTC\n \n 2019-01-31 18:11:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 88\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:55:42',4,'2019-01-31 18:11:39',4,0,NULL,NULL,NULL,'939c91e7-c164-456f-a4dc-4da80bacc4b3'),(89,'CI28: Client who Restarted ART','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI28: Client who Restarted ART\n \n \n 2018-03-19 02:57:34 UTC\n \n 2019-01-31 18:08:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 89\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 02:57:34',4,'2019-01-31 18:08:06',4,0,NULL,NULL,NULL,'65cd06c4-31ed-4a82-a6a4-02e217b1e0ba'),(90,'CI29: New ART clients with baseline CD4+ counts','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI29: New ART clients with baseline CD4+ counts\n \n \n 2018-03-19 03:00:05 UTC\n \n 2018-03-19 03:01:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 90\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 05:00:05',4,'2018-03-19 05:01:21',4,0,NULL,NULL,NULL,'bf36f124-d930-431e-b22a-fd0d7f7353c4'),(91,'CI30: HIV Care clients screened for TB','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI30: HIV Care clients screened for TB\n \n \n 2018-03-19 03:03:31 UTC\n \n 2019-02-03 09:56:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 91\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 03:03:31',4,'2019-02-03 09:56:53',4,0,NULL,NULL,NULL,'47456755-c716-4eab-b686-c9d372ea7468'),(92,'CI31: Presumptive TB HIV Care cases','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI31: Presumptive TB HIV Care cases\n \n \n 2018-03-19 03:06:01 UTC\n \n 2019-02-03 09:58:15 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 92\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-19 03:06:01',4,'2019-02-03 09:58:15',4,0,NULL,NULL,NULL,'cd4971f7-81a7-45f8-b49b-9de683d0c8d3'),(94,'Date confirmed HIV Positive test','Date confirmed HIV+ test','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date confirmed HIV Positive test\n Date confirmed HIV+ test\n \n 2018-03-20 14:23:54 UTC\n \n 2018-03-20 14:33:43 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 94\n ANY\n \n \n \n \n','2018-03-20 16:23:54',4,'2018-03-20 16:33:43',4,0,NULL,NULL,NULL,'c62c2f3b-3f3e-442b-beab-c25809316b25'),(95,'Date enrolled in Pre-ART','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date enrolled in Pre-ART\n \n \n 2018-03-20 14:25:52 UTC\n \n 2019-01-23 08:27:20 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n value1\n \n java.util.Date\n true\n \n \n value2\n \n java.util.Date\n true\n \n \n 95\n ANY\n \n \n \n \n GREATER_EQUAL\n LESS_EQUAL\n','2018-03-20 16:25:52',4,'2019-01-23 10:27:20',4,0,NULL,NULL,NULL,'d785b586-bd07-4359-b733-54968416b764'),(97,'Clients newly diagnosed and enrolled into HIV Care/Pre-ART','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly diagnosed and enrolled into HIV Care/Pre-ART\n \n \n 2018-03-20 14:36:25 UTC\n \n 2019-01-31 20:12:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 97\n PreART-Clients-not-initiated-on-ART AND Date-Confirmed-HIV-positive-SQL\n \n \n PreART-Clients-not-initiated-on-ART\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n Date-Confirmed-HIV-positive-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-20 14:36:25',4,'2019-01-31 20:12:16',4,0,NULL,NULL,NULL,'77c109da-808a-4a26-8e7f-41839ab40574'),(98,'CI32: Clients newly diagnosed and started on Pre-ART','Clients newly diagnosed and started on HIV Care','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI32: Clients newly diagnosed and started on Pre-ART\n Clients newly diagnosed and started on HIV Care\n \n 2018-03-22 08:48:54 UTC\n \n 2019-02-04 08:17:38 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 98\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-22 08:48:54',4,'2019-02-04 08:17:38',4,0,NULL,NULL,NULL,'05e583fe-4a8b-4359-8ac8-8df7f02f8e96'),(99,'CI33: Clients Started on Pre-ART','Clients Started on HIV Care','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI33: Clients Started on Pre-ART\n Clients Started on HIV Care\n \n 2018-03-22 08:48:55 UTC\n \n 2019-02-04 08:21:41 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 99\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-22 08:48:55',4,'2019-02-04 08:21:41',4,0,NULL,NULL,NULL,'6ba04297-1210-4d0e-8728-0ac24c4b0a3a'),(100,'PIR02: Pre-ART Report','Reports all Pre-ART or Current in HIV Care indicators into DHIS2 i.e. Newly enrolled, Current in HIV Care etc. ','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR02: Pre-ART Report\n Reports all Pre-ART or Current in HIV Care indicators into DHIS2 i.e. Newly enrolled, Current in HIV Care etc. \n \n 2018-03-27 08:30:37 UTC\n \n 2018-03-27 08:31:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 100\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-27 10:30:37',4,'2018-03-27 10:31:03',4,0,NULL,NULL,NULL,'5b3a4b6f-1584-43c0-a3cb-7973270912f2'),(101,'PIR02: Pre-ART Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR02: Pre-ART Report Data Set\n \n 2018-03-27 08:30:38 UTC\n \n 2019-03-11 12:08:33 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 101\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age_DATE\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n CnPrF10-14\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 10to14yrs\n \n \n \n \n \n CnPrF15-19\n \n \n \n \n \n \n CnPrF20-24\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 20to24yrs\n \n \n \n \n \n CnPrF25-49\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 25to49yrs\n \n \n \n \n \n CnPrM10-14\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 10to14yrs\n \n \n \n \n \n CnPrM15-19\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 15to19yrs\n \n \n \n \n \n CnPrM20-24\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 20to24yrs\n \n \n \n \n \n CnPrM25-49\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 25to49yrs\n \n \n \n \n \n CnPreF1-4\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 01to04yrs\n \n \n \n \n \n CnPreF5-9\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 05to09yrs\n \n \n \n \n \n CnPreF50+\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 50+yrs\n \n \n \n \n \n CnPreFU1\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n Under 1yr\n \n \n \n \n \n CnPreM1-4\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 01to04yrs\n \n \n \n \n \n CnPreM5-9\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 05to09yrs\n \n \n \n \n \n CnPreM50+\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 50+yrs\n \n \n \n \n \n CnPreMU1\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n Under 1yr\n \n \n \n \n \n NuPrF10-14\n \n \n \n \n \n \n \n \n \n NuPrF15-19\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 15to19yrs\n \n \n \n \n \n NuPrF20-24\n \n \n \n \n \n \n NuPrF25-49\n \n \n \n \n \n \n NuPrM10-14\n \n \n \n \n \n \n NuPrM15-19\n \n \n \n \n \n \n NuPrM20-24\n \n \n \n \n \n \n NuPrM25-49\n \n \n \n \n \n \n NuPreF1-4\n \n \n \n \n \n \n NuPreF5-9\n \n \n \n \n \n \n NuPreF50+\n \n \n \n \n \n \n NuPreFU1\n \n \n \n \n \n \n NuPreM1-4\n \n \n \n \n \n \n NuPreM5-9\n \n \n \n \n \n \n NuPreM50+\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 50+yrs\n \n \n \n \n \n NuPreMU1\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n PreMF1-4\n \n \n \n \n \n \n \n \n \n PreMF10-14\n \n \n \n \n \n \n PreMF15-19\n \n \n \n \n \n \n PreMF20-24\n \n \n \n \n \n \n PreMF25-49\n \n \n \n \n \n \n PreMF5-9\n \n \n \n \n \n \n PreMF50+\n \n \n \n \n \n \n PreMFU1\n \n \n \n \n \n \n PreMM1-4\n \n \n \n \n \n \n PreMM10-14\n \n \n \n \n \n \n PreMM15-19\n \n \n \n \n \n \n PreMM20-24\n \n \n \n \n \n \n PreMM25-49\n \n \n \n \n \n \n PreMM5-9\n \n \n \n \n \n \n PreMM50+\n \n \n \n \n \n \n PreMMU1\n \n \n \n \n \n \n StaPF10-14\n \n \n \n \n \n \n \n \n \n StaPF15-19\n \n \n \n \n \n \n StaPF20-24\n \n \n \n \n \n \n StaPF25-49\n \n \n \n \n \n \n StaPM10-14\n \n \n \n \n \n \n StaPM15-19\n \n \n \n \n \n \n StaPM20-24\n \n \n \n \n \n \n StaPM25-49\n \n \n \n \n \n \n StaPreF1-4\n \n \n \n \n \n \n StaPreF5-9\n \n \n \n \n \n \n StaPreFU1\n \n \n \n \n \n \n StaPreM1-4\n \n \n \n \n \n \n StaPreM5-9\n \n \n \n \n \n \n StaPreM50+\n \n \n \n \n \n \n StaPreMU1\n \n \n \n \n \n \n','2018-03-27 08:30:38',4,'2019-03-11 12:08:33',4,0,NULL,NULL,NULL,'4cc67faa-d329-4188-95ac-8a6b0e61cbee'),(103,'PIR03: ARV Regimen at end of every month (1st Line)','ARV Regimen at end of month (1st Line Adults and Children)','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR03: ARV Regimen at end of every month (1st Line)\n ARV Regimen at end of month (1st Line Adults and Children)\n \n 2018-03-27 13:44:01 UTC\n \n 2018-03-28 09:03:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 103\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-27 15:44:01',4,'2018-03-28 11:03:14',4,0,NULL,NULL,NULL,'002b0672-d10e-44cd-a31a-322d90d5ce04'),(104,'PIR03: 5. ARV Regimen at end of every month Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR03: 5. ARV Regimen at end of every month Data Set\n \n 2018-03-27 13:44:01 UTC\n \n 2019-04-26 08:21:29 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 104\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n DM_Weight_Updated\n \n \n \n \n \n \n \n \n 1cAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n \n \n \n 1cAdultM\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n 1dAdultF\n \n \n \n \n \n \n \n \n \n 1dAdultM\n \n \n \n \n \n \n 1eAdultF\n \n \n \n \n \n \n \n \n \n 1eAdultM\n \n \n \n \n \n \n 1fAdultF\n \n \n \n \n \n \n \n \n \n 1fAdultM\n \n \n \n \n \n \n 1gAdultF\n \n \n \n \n \n \n \n \n \n 1gAdultM\n \n \n \n \n \n \n 1hAdultF\n \n \n \n \n \n \n \n \n \n 1hAdultM\n \n \n \n \n \n \n 1st4c13.9F\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 1st4c13.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 1st4c19.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 1st4c19.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 1st4c24.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 1st4c24.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 1st4c25F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 1st4c25M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 1st4c3.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 1st4c3.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 1st4c5.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 1st4c5.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 1st4c9.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 1st4c9.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 1st4d13.9F\n \n \n \n \n \n \n \n \n \n 1st4d13.9M\n \n \n \n \n \n \n 1st4d19.9F\n \n \n \n \n \n \n 1st4d19.9M\n \n \n \n \n \n \n 1st4d24.9F\n \n \n \n \n \n \n 1st4d24.9M\n \n \n \n \n \n \n 1st4d25F\n \n \n \n \n \n \n 1st4d25M\n \n \n \n \n \n \n 1st4d3.9F\n \n \n \n \n \n \n 1st4d3.9M\n \n \n \n \n \n \n 1st4d5.9F\n \n \n \n \n \n \n 1st4d5.9M\n \n \n \n \n \n \n 1st4d9.9F\n \n \n \n \n \n \n 1st4d9.9M\n \n \n \n \n \n \n 4e10-13.9F\n \n \n \n \n \n \n \n \n \n 4e10-13.9M\n \n \n \n \n \n \n 4e14-19.9F\n \n \n \n \n \n \n 4e14-19.9M\n \n \n \n \n \n \n 4e20-24.9F\n \n \n \n \n \n \n 4e20-24.9M\n \n \n \n \n \n \n 4e25+F\n \n \n \n \n \n \n 4e25+M\n \n \n \n \n \n \n 4e3-3.9F\n \n \n \n \n \n \n 4e3-3.9M\n \n \n \n \n \n \n 4e4-5.9F\n \n \n \n \n \n \n 4e4-5.9M\n \n \n \n \n \n \n 4e6-9.9F\n \n \n \n \n \n \n 4e6-9.9M\n \n \n \n \n \n \n 4f10-13.9F\n \n \n \n \n \n \n \n \n \n 4f10-13.9M\n \n \n \n \n \n \n 4f14-19.9F\n \n \n \n \n \n \n 4f14-19.9M\n \n \n \n \n \n \n 4f20-24.9F\n \n \n \n \n \n \n 4f20-24.9M\n \n \n \n \n \n \n 4f25+F\n \n \n \n \n \n \n 4f25+M\n \n \n \n \n \n \n 4f3-3.9F\n \n \n \n \n \n \n 4f3-3.9M\n \n \n \n \n \n \n 4f4-5.9F\n \n \n \n \n \n \n 4f4-5.9M\n \n \n \n \n \n \n 4f6-9.9F\n \n \n \n \n \n \n 4f6-9.9M\n \n \n \n \n \n \n','2018-03-27 13:44:01',4,'2019-04-26 08:21:29',4,0,NULL,NULL,NULL,'3b30ec64-f372-4307-9988-e169bd149057'),(105,'PIR04: ARV Regimen at end of month (2nd Line)','ARV Regimen at end of month (2nd Line Adults and Children)','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR04: ARV Regimen at end of month (2nd Line)\n ARV Regimen at end of month (2nd Line Adults and Children)\n \n 2018-03-27 13:48:06 UTC\n \n 2018-03-28 09:03:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 105\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-27 15:48:06',4,'2018-03-28 11:03:45',4,0,NULL,NULL,NULL,'65406ae1-061f-409e-b69b-8bc406bc0e0f'),(106,'PIR04: 4. ARV Regimen at end of month (2nd Line Adults and Children) Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR04: 4. ARV Regimen at end of month (2nd Line Adults and Children) Data Set\n \n 2018-03-27 13:48:07 UTC\n \n 2019-04-29 14:42:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 106\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n DM_Weight_Updated\n \n \n \n \n \n \n \n \n 2cAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n \n \n \n 2cAdultM\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n 2dAdultF\n \n \n \n \n \n \n \n \n \n 2dAdultM\n \n \n \n \n \n \n 2eAdultF\n \n \n \n \n \n \n \n \n \n 2eAdultM\n \n \n \n \n \n \n 2fAdultF\n \n \n \n \n \n \n \n \n \n 2fAdultM\n \n \n \n \n \n \n 2gBCAdultF\n \n \n \n \n \n \n \n \n \n 2gBCAdultM\n \n \n \n \n \n \n 2hAdultF\n \n \n \n \n \n \n \n \n \n 2hAdultM\n \n \n \n \n \n \n 5a10-13.9F\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 5a10-13.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 5a14-19.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 5a14-19.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 5a20-24.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 5a20-24.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 5a25+F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 5a25+M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 5a3-3.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 5a3-3.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 5a4-5.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 5a4-5.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 5a6-9.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 5a6-9.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 5b10-13.9F\n \n \n \n \n \n \n \n \n \n 5b10-13.9M\n \n \n \n \n \n \n 5b14-19.9F\n \n \n \n \n \n \n 5b14-19.9M\n \n \n \n \n \n \n 5b20-24.9F\n \n \n \n \n \n \n 5b20-24.9M\n \n \n \n \n \n \n 5b25+F\n \n \n \n \n \n \n 5b25+M\n \n \n \n \n \n \n 5b3-3.9F\n \n \n \n \n \n \n 5b3-3.9M\n \n \n \n \n \n \n 5b4-5.9F\n \n \n \n \n \n \n 5b4-5.9M\n \n \n \n \n \n \n 5b6-9.9F\n \n \n \n \n \n \n 5b6-9.9M\n \n \n \n \n \n \n','2018-03-27 13:48:07',4,'2019-04-29 14:42:44',4,0,NULL,NULL,NULL,'8d27c88e-c64d-41d1-93ac-09194a43b8c6'),(107,'All clients ever enrolled in Pre-ART','Uses the Date Enrolled in HIV Care concept to check if there are any observation of this concept before today\'s date','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All clients ever enrolled in Pre-ART\n Uses the Date Enrolled in HIV Care concept to check if there are any observation of this concept before today's date\n \n 2018-03-28 07:47:30 UTC\n \n 2018-03-28 07:49:38 UTC\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 107\n ANY\n \n \n \n \n','2018-03-28 09:47:30',4,'2018-03-28 09:49:38',4,0,NULL,NULL,NULL,'b29f40a8-f100-43d2-a841-753081556358'),(108,'Clients not initiated on ART','This cohort query is used in conjunction with the Clients ever enrolled on Pre-ART query to select only those who are not initiated on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not initiated on ART\n This cohort query is used in conjunction with the Clients ever enrolled on Pre-ART query to select only those who are not initiated on ART\n \n 2018-03-28 08:00:39 UTC\n \n 2019-01-22 14:26:10 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 108\n NO\n \n \n \n \n','2018-03-28 10:00:39',4,'2019-01-22 16:26:10',4,0,NULL,NULL,NULL,'e9fa623d-a779-4533-a4b2-26b701863195'),(109,'Clients currently enrolled on Pre-ART','Client currently on Pre-ART and not Started on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients currently enrolled on Pre-ART\n Client currently on Pre-ART and not Started on ART\n \n 2018-03-28 08:04:27 UTC\n \n 2019-01-31 19:53:17 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 109\n All-clients-ever-enrolled-in-Pre-ART AND Clients-not-initiated-on-ART-SQL-Query-Version\n \n \n All-clients-ever-enrolled-in-Pre-ART\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n \n \n \n Clients-not-initiated-on-ART-SQL-Query-Version\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n','2018-03-28 08:04:27',4,'2019-01-31 19:53:17',4,0,NULL,NULL,NULL,'74a0a573-ec85-4624-80e7-f4b4fb69155b'),(110,'Current in Pre-ART clients Seen for Revisits','Current in HIV Care clients SEEN for revisits this month','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Current in Pre-ART clients Seen for Revisits\n Current in HIV Care clients SEEN for revisits this month\n \n 2018-03-28 08:43:12 UTC\n \n 2019-01-24 13:44:00 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 110\n PreART-Clients-not-initiated-on-ART AND Clients-seen\n \n \n PreART-Clients-not-initiated-on-ART\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n Clients-seen\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n','2018-03-28 08:43:12',4,'2019-01-24 13:44:00',4,0,NULL,NULL,NULL,'12070eb5-96e0-4684-b71f-c0e1f7b88bcd'),(111,'PIR05: ART Report','Reports all Current in ART indicators into DHIS2 i.e. Newly Initiated, Current in ART etc.','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR05: ART Report\n Reports all Current in ART indicators into DHIS2 i.e. Newly Initiated, Current in ART etc.\n \n 2018-03-28 09:05:07 UTC\n \n 2018-03-28 09:08:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 111\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-28 11:05:07',4,'2018-03-28 11:08:08',4,0,NULL,NULL,NULL,'5e05f218-9849-4e55-8c1c-e3d02422227c'),(112,'ART Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Report Data Set\n \n 2018-03-28 09:05:08 UTC\n \n 2019-03-26 13:07:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 112\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age_DATE\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n Discordant\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n NuStF10-14\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 10to14yrs\n \n \n \n \n \n NuStF15-19\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 15to19yrs\n \n \n \n \n \n NuStF20-24\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 20to24yrs\n \n \n \n \n \n NuStF25-49\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 25to49yrs\n \n \n \n \n \n NuStM10-14\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 10to14yrs\n \n \n \n \n \n NuStM15-19\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 15to19yrs\n \n \n \n \n \n NuStM20-24\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 20to24yrs\n \n \n \n \n \n NuStM25-49\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 25to49yrs\n \n \n \n \n \n NuStatF1-4\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 01to04yrs\n \n \n \n \n \n NuStatF5-9\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 05to09yrs\n \n \n \n \n \n NuStatF50\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 50+yrs\n \n \n \n \n \n NuStatFU1\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n Under 1yr\n \n \n \n \n \n NuStatM1-4\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 01to04yrs\n \n \n \n \n \n NuStatM5-9\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 05to09yrs\n \n \n \n \n \n NuStatM50\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 50+yrs\n \n \n \n \n \n NustatMU1\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n Under 1yr\n \n \n \n \n \n RestartAll\n \n \n \n \n \n \n \n \n \n SeenF1-4\n \n \n \n \n \n \n \n \n \n SeenF10-14\n \n \n \n \n \n \n SeenF15-19\n \n \n \n \n \n \n SeenF20-24\n \n \n \n \n \n \n SeenF25-49\n \n \n \n \n \n \n SeenF5-9\n \n \n \n \n \n \n SeenF50\n \n \n \n \n \n \n SeenFU1\n \n \n \n \n \n \n SeenM1-4\n \n \n \n \n \n \n SeenM10-14\n \n \n \n \n \n \n SeenM15-19\n \n \n \n \n \n \n SeenM20-24\n \n \n \n \n \n \n SeenM25-49\n \n \n \n \n \n \n SeenM5-9\n \n \n \n \n \n \n SeenM50\n \n \n \n \n \n \n SeenMU1\n \n \n \n \n \n \n TranOutAll\n \n \n \n \n \n \n \n \n \n TransInAll\n \n \n \n \n \n \n \n \n \n TxPrF15-19\n \n \n \n \n \n \n \n \n \n TxPrF20-24\n \n \n \n \n \n \n TxPrF25-49\n \n \n \n \n \n \n TxPrM10-14\n \n \n \n \n \n \n TxPrM15-19\n \n \n \n \n \n \n TxPrM20-24\n \n \n \n \n \n \n TxPrM25-49\n \n \n \n \n \n \n TxPreF1-4\n \n \n \n \n \n \n TxPreF5-9\n \n \n \n \n \n \n TxPreF50\n \n \n \n \n \n \n TxPreFU1\n \n \n \n \n \n \n TxPreM1-4\n \n \n \n \n \n \n TxPreM5-9\n \n \n \n \n \n \n TxPreM50\n \n \n \n \n \n \n TxPreMU1\n \n \n \n \n \n \n TxprF10-14\n \n \n \n \n \n \n baseCD4All\n \n \n \n \n \n \n \n \n \n','2018-03-28 09:05:08',4,'2019-03-26 13:07:32',4,0,NULL,NULL,NULL,'6618a6b4-5678-4525-9785-0ae3abf0eb41'),(113,'Clients ever enrolled in Pre-ART and seen in previous 1 or 2 months','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients ever enrolled in Pre-ART and seen in previous 1 or 2 months\n \n \n 2018-03-28 10:13:44 UTC\n \n 2019-01-24 13:19:29 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 113\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 2223 \nand (MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) OR \nMONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH))) \nand person_id not in ( \n select distinct person_id \n from obs os \n where os.location_id =:location \n and (os.concept_id = 3843 and os.value_coded = 3842) \n and MONTH(os.obs_datetime) = MONTH(DATE(:endDate)) \n and YEAR(os.obs_datetime) = YEAR(DATE(:endDate)) \n )\n','2018-03-28 10:13:44',4,'2019-01-24 13:19:29',4,0,NULL,NULL,NULL,'0d2bc33a-007b-4c9b-a6be-439f126f3c27'),(114,'ARV Regimen at end of month (3rd Line)','ARV Regimen at end of month (3rd Line Adults and Children)','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Regimen at end of month (3rd Line)\n ARV Regimen at end of month (3rd Line Adults and Children)\n \n 2018-03-28 10:34:02 UTC\n \n 2018-03-28 10:34:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 114\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-28 12:34:02',4,'2018-03-28 12:34:45',4,0,NULL,NULL,NULL,'5db0a89b-cb19-4d62-b005-a76877a2cebb'),(115,'ARV Regimen at end of month (3rd Line Adults and Children) Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ARV Regimen at end of month (3rd Line Adults and Children) Data Set\n \n 2018-03-28 10:34:02 UTC\n \n 2019-03-20 14:13:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 115\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n DM_Weight_Updated\n \n \n \n \n \n \n \n \n 3aAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n 3aAdultM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n 3bAdultF\n \n \n \n \n \n \n \n \n \n 3bAdultM\n \n \n \n \n \n \n 3cAdultF\n \n \n \n \n \n \n \n \n \n 3cAdultM\n \n \n \n \n \n \n 6a10-13.9F\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 6a10-13.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 6a14-19.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 6a14-19.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 6a20-24.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 6a20-24.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 6a25+F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 6a25+M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 6a3-3.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 6a3-3.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 6a4-5.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 6a4-5.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 6a6-9.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 6a6-9.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n','2018-03-28 10:34:02',4,'2019-03-20 14:13:11',4,0,NULL,NULL,NULL,'f623aaa7-e30a-4eac-9853-704b715fd1c5'),(116,'Current in Pre-ART clients seen in previous months','Current in Pre-ART clients seen in previous months, but not seen this current month','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Current in Pre-ART clients seen in previous months\n Current in Pre-ART clients seen in previous months, but not seen this current month\n \n 2018-03-28 10:39:06 UTC\n \n 2019-01-24 13:49:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 116\n PreART-Clients-not-initiated-on-ART AND Clients-enrolled-in-Pre-ART-and-seen-in-previous-1-or-2-months\n \n \n PreART-Clients-not-initiated-on-ART\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n Clients-enrolled-in-Pre-ART-and-seen-in-previous-1-or-2-months\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-03-28 10:39:06',4,'2019-01-24 13:49:58',4,0,NULL,NULL,NULL,'32d35d67-0663-4adf-bfc7-2e9af3ce7faf'),(117,'Clients not initiated on ART SQL Query Version','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not initiated on ART SQL Query Version\n \n \n 2018-03-29 00:51:58 UTC\n \n 2019-01-31 19:54:24 UTC\n \n \n location\n \n org.openmrs.Location\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n 117\n select distinct person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2223 \nand person_id not in \n (select person_id \n from obs \n where concept_id = 2249 AND \n location_id =:location \n );\n','2018-03-29 00:51:58',4,'2019-01-31 19:54:24',4,0,NULL,NULL,NULL,'ada14623-f50b-4cee-9e9b-7744165da486'),(118,'CI34: Current in Pre-ART clients seen for revisits','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI34: Current in Pre-ART clients seen for revisits\n \n \n 2018-03-29 02:41:52 UTC\n \n 2018-03-29 02:43:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 118\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-29 04:41:52',4,'2018-03-29 04:43:20',4,0,NULL,NULL,NULL,'c6c76e05-1ee3-43cd-b5e1-a6cf8532f154'),(119,'CI35: Current in Pre-ART clients seen for revisits in previous months','Not seen this month','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI35: Current in Pre-ART clients seen for revisits in previous months\n Not seen this month\n \n 2018-03-29 02:45:09 UTC\n \n 2018-03-29 02:49:51 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 119\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-03-29 04:45:09',4,'2018-03-29 04:49:51',4,0,NULL,NULL,NULL,'6eda74b4-c3d1-4a03-ab99-f274069f3f20'),(120,'Patient Death Query','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.BirthAndDeathCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Patient Death Query\n \n \n 2018-04-17 10:29:46 UTC\n \n \n diedOnOrAfter\n \n java.util.Date\n true\n \n \n diedOnOrBefore\n \n java.util.Date\n true\n \n \n','2018-04-17 12:29:46',4,NULL,NULL,0,NULL,NULL,NULL,'058a4ed9-14ec-46dc-bd83-b99c93da0558'),(123,'Clients ever enrolled on ART','Clients with any date observation of ART Start before the current date','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients ever enrolled on ART\n Clients with any date observation of ART Start before the current date\n \n 2018-04-17 12:53:04 UTC\n \n 2019-01-23 08:21:35 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n value1\n \n java.util.Date\n true\n \n \n 123\n ANY\n \n \n \n \n LESS_EQUAL\n','2018-04-17 14:53:04',4,'2019-01-23 10:21:35',4,0,NULL,NULL,NULL,'761a1a86-745d-4fe7-a656-0eba474bb2d6'),(124,'Clients ever enrolled on ART who died','All clients who died whilst on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients ever enrolled on ART who died\n All clients who died whilst on ART\n \n 2018-04-17 12:57:20 UTC\n \n 2018-04-17 13:00:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 124\n Patient-Death-Query AND Clients-ever-enrolled-on-ART\n \n \n Patient-Death-Query\n \n \n \n \n diedOnOrBefore\n ${endDate}\n \n \n diedOnOrAfter\n ${startDate}\n \n \n \n \n \n Clients-ever-enrolled-on-ART\n \n \n \n \n locationList\n ${location}\n \n \n value1\n ${endDate}\n \n \n \n \n \n','2018-04-17 14:57:20',4,'2018-04-17 15:00:34',4,0,NULL,NULL,NULL,'b51679db-9c8f-4574-b742-8b609a5bd653'),(125,'ART clients Lost','Defined as ART clients who missed their appointment date by 90 or more days','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients Lost\n Defined as ART clients who missed their appointment date by 90 or more days\n \n 2018-04-17 13:32:13 UTC\n \n 2019-05-02 09:14:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 125\n select distinct o.person_id \nFROM obs o \nINNER JOIN person ON person.person_id = o.person_id AND person.voided = 0 \nand o.concept_id = 3752 \nand o.value_datetime in \n ( \n select latestFU from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), max(value_datetime)) AS \n Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n group by os.person_id \n having Num_Days >= 90 \n ) as lost \n ) \nand o.person_id in \n ( \n select person_id from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), \n max(value_datetime)) AS Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n group by os.person_id \n having Num_Days >= 90 \n ) as lost \n ) \nand o.person_id not in ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \nand o.person_id not in( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \n;\n','2018-04-17 13:32:13',4,'2019-05-02 09:14:57',4,0,NULL,NULL,NULL,'e2671095-bdf2-44cf-a857-065e2e2ad518'),(126,'ART clients with Missed Appointments','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients with Missed Appointments\n \n \n 2018-04-17 17:56:59 UTC\n \n 2019-05-02 09:04:29 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 126\n select distinct o.person_id \nFROM obs o \nINNER JOIN patient ON o.person_id = patient.patient_id \nand o.concept_id = 3752 \nand o.value_datetime in \n ( \n select latestFU from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), max(value_datetime)) AS \n Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n and obs_datetime <= :endDate \n group by os.person_id \n having Num_Days > 7 \n and Num_Days < 30 \n ) as lost \n ) \nand o.person_id in \n ( \n select person_id from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), \n max(value_datetime)) AS Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n and obs_datetime <= :endDate \n group by os.person_id \n having Num_Days > 7 \n and Num_Days < 30 \n ) as lost \n ) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND o.person_id not in ( \n select person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n;\n','2018-04-17 17:56:59',4,'2019-05-02 09:04:29',4,0,NULL,NULL,NULL,'99784926-bc17-4308-9947-078e59b006ff'),(127,'ART clients who Defaulted','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients who Defaulted\n \n \n 2018-04-17 18:01:09 UTC\n \n 2019-05-02 08:58:41 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 127\n select distinct o.person_id \nFROM obs o \nINNER JOIN patient ON o.person_id = patient.patient_id \nand o.concept_id = 3752 \nand o.value_datetime in \n ( \n select latestFU from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), max(value_datetime)) AS \n Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n and obs_datetime <= :endDate \n group by os.person_id \n having Num_Days > 30 \n and Num_Days < 90 \n ) as defaulter \n ) \nand o.person_id in \n ( \n select person_id from \n ( \n select distinct os.person_id, max(os.value_datetime) AS latestFU, datediff(CAST(:endDate AS DATE), \n max(value_datetime)) AS Num_Days \n from obs os \n inner join person_name pn on os.person_id = pn.person_id \n inner join patient p on pn.person_id = p.patient_id and pn.voided = 0 \n inner join person ps on ps.person_id = p.patient_id and ps.voided = 0 \n where os.concept_id = 3752 \n and obs_datetime <= :endDate \n group by os.person_id \n having Num_Days > 30 \n and Num_Days < 90 \n ) as defaulter \n ) \n \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND o.person_id not in ( \n select person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n;\n','2018-04-17 18:01:09',4,'2019-05-02 08:58:41',4,0,NULL,NULL,NULL,'32051001-863f-4e02-9165-599c2a3a9137'),(128,'ART clients stopped Query','ART patients who stopped ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients stopped Query\n ART patients who stopped ART\n \n 2018-04-18 07:35:57 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-18 09:35:57',4,NULL,NULL,0,NULL,NULL,NULL,'141ce68c-09b5-40ee-9c51-bff2aa09a54d'),(129,'Scheduled appointment','scheduled appointment. this are clients who came on the set date','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Scheduled appointment\n scheduled appointment. this are clients who came on the set date\n \n 2018-04-18 08:30:00 UTC\n \n 2018-04-18 08:31:09 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 129\n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-18 10:30:00',4,'2018-04-18 10:31:09',4,0,NULL,NULL,NULL,'44383c6e-b552-4703-9f88-faf374ff3b8e'),(130,'All ART drug refill visits','all clients who made a drug pick up visit','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All ART drug refill visits\n all clients who made a drug pick up visit\n \n 2018-04-18 09:45:26 UTC\n \n 2019-01-31 04:58:43 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 130\n select distinct person_id \nfrom obs o, encounter e, visit v \nwhere o.encounter_id = e.encounter_id \nand e.visit_id = v.visit_id and \nv.visit_type_id = 10 \nand o.location_id =:location \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate;\n','2018-04-18 09:45:26',4,'2019-01-31 04:58:43',4,0,NULL,NULL,NULL,'da54992a-b327-4dff-a9d7-d9cc53f6697d'),(131,'On time Drug pick-up','Clients who picked their drug refill on the scheduled date','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n On time Drug pick-up\n Clients who picked their drug refill on the scheduled date\n \n 2018-04-18 10:34:10 UTC\n \n 2018-04-18 10:39:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 131\n All-ART-drug-refill-visits AND Scheduled-appointment\n \n \n All-ART-drug-refill-visits\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Scheduled-appointment\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n','2018-04-18 12:34:10',4,'2018-04-18 12:39:15',4,0,NULL,NULL,NULL,'23622729-be20-496f-ac0f-f6647093eb90'),(132,'ART clients provided nutrition supplements','ART clients provided nutrition suppements','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients provided nutrition supplements\n ART clients provided nutrition suppements\n \n 2018-04-19 10:11:22 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n','2018-04-19 12:11:22',4,NULL,NULL,0,NULL,NULL,NULL,'92e1c320-c133-4f98-9833-ad680b8f5bd5'),(133,'Plumpy Nut','ART clients who received plumpy nut','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Plumpy Nut\n ART clients who received plumpy nut\n \n 2018-04-19 10:22:41 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-19 12:22:41',4,NULL,NULL,0,NULL,NULL,NULL,'a1f707c2-4bb8-4d48-8c62-680746e324b2'),(134,'Given F75','Client who were given nutritional support F75','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Given F75\n Client who were given nutritional support F75\n \n 2018-04-19 10:25:36 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-19 12:25:36',4,NULL,NULL,0,NULL,NULL,NULL,'20aa6768-f594-4e25-87fb-032f27a018c2'),(135,'Given F100','clients who picked F100','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Given F100\n clients who picked F100\n \n 2018-04-19 10:26:53 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-19 12:26:53',4,NULL,NULL,0,NULL,NULL,NULL,'75622551-c46c-4797-a9cf-62ebc4871b86'),(136,'Other nutritional products','Client who were given nutritional support Other nutritional products','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Other nutritional products\n Client who were given nutritional support Other nutritional products\n \n 2018-04-19 10:27:43 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-19 12:27:43',4,NULL,NULL,0,NULL,NULL,NULL,'9852762a-1c2e-4bc4-b85f-f90b07245cbd'),(137,'ART clients given cotrimoxazole','ART clients given cotrimoxazole','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients given cotrimoxazole\n ART clients given cotrimoxazole\n \n 2018-04-19 10:43:03 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n GREATER_THAN\n 0.0\n','2018-04-19 12:43:03',4,NULL,NULL,0,NULL,NULL,NULL,'bd653d50-7c8b-4eef-b4df-f43b6895e687'),(138,'HIV positive clients Started IPT','HIV positive clients, in HIV care (preART or ART) Started IPT','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV positive clients Started IPT\n HIV positive clients, in HIV care (preART or ART) Started IPT\n \n 2018-04-19 13:45:43 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n IN\n \n \n \n','2018-04-19 15:45:43',4,NULL,NULL,0,NULL,NULL,NULL,'861f8278-7e7b-45b0-b3e4-62fbfbc1658a'),(139,'New pre-ART clients started IPT','New pre-ART clients started IPT','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New pre-ART clients started IPT\n New pre-ART clients started IPT\n \n 2018-04-19 13:57:23 UTC\n \n 2018-04-19 14:09:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 139\n Date-enrolled-in-Pre-ART AND HIV-positive-clients-Started-IPT\n \n \n Date-enrolled-in-Pre-ART\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n HIV-positive-clients-Started-IPT\n \n \n \n \n \n \n','2018-04-19 15:57:23',4,'2018-04-19 16:09:54',4,0,NULL,NULL,NULL,'862c77cd-5bcb-4858-9cd3-d0b60704d05b'),(140,'New ART clients started IPT','New ART clients started IPT','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New ART clients started IPT\n New ART clients started IPT\n \n 2018-04-19 14:10:35 UTC\n \n 2018-04-19 14:16:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 140\n ART-start-date AND HIV-positive-clients-Started-IPT\n \n \n ART-start-date\n \n \n \n \n locationList\n ${location}\n \n \n value2\n ${endDate}\n \n \n value1\n ${startDate}\n \n \n \n \n \n HIV-positive-clients-Started-IPT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n','2018-04-19 16:10:35',4,'2018-04-19 16:16:14',4,0,NULL,NULL,NULL,'02a211e3-0e79-4f07-b131-84b2c28a7f93'),(141,'No. of persons in original cohort 6 months','No. of persons in original cohort 6 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n No. of persons in original cohort 6 months\n No. of persons in original cohort 6 months\n \n 2018-04-20 07:40:13 UTC\n \n 2018-10-16 14:41:18 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 141\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 2249 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH));\n','2018-04-20 09:40:13',4,'2018-10-16 16:41:18',4,0,NULL,NULL,NULL,'d768b001-7c65-49d1-b8db-d3bc04ccbf6c'),(142,'No. of persons in original cohort 12 months','No. of persons in original cohort 12 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n No. of persons in original cohort 12 months\n No. of persons in original cohort 12 months\n \n 2018-04-20 07:41:37 UTC\n \n 2018-10-16 14:39:12 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 142\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 2249 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH));\n','2018-04-20 09:41:37',4,'2018-10-16 16:39:12',4,0,NULL,NULL,NULL,'d153ef33-2ae2-43c7-8c1a-ed070d4e0022'),(143,'Number of persons transfer in- 6 months','Number of persons transfer in- 6 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons transfer in- 6 months\n Number of persons transfer in- 6 months\n \n 2018-04-20 08:19:32 UTC\n \n 2018-04-20 08:27:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 143\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 4168 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH))\n','2018-04-20 10:19:32',4,'2018-04-20 10:27:22',4,0,NULL,NULL,NULL,'c9387748-c920-4665-886b-aaae0c5609f9'),(144,'Number of persons transfer in- 12 months','Number of persons transfer in- 12 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons transfer in- 12 months\n Number of persons transfer in- 12 months\n \n 2018-04-20 08:22:18 UTC\n \n 2018-04-20 08:26:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 144\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 4168 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH))\n','2018-04-20 10:22:18',4,'2018-04-20 10:26:32',4,0,NULL,NULL,NULL,'3528e2a5-002d-4a15-8565-e80d7e4a56e1'),(145,'Date transferred out','Date transferred out','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date transferred out\n Date transferred out\n \n 2018-04-20 08:47:48 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n value1\n \n java.util.Date\n true\n \n \n ANY\n \n \n \n \n LESS_EQUAL\n','2018-04-20 10:47:48',4,NULL,NULL,0,NULL,NULL,NULL,'e085074b-37f3-453c-a51e-7c11b6421d5d'),(146,'Number of persons in cohort transferred out 6 months','Number of persons cohort transferred out 6 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons in cohort transferred out 6 months\n Number of persons cohort transferred out 6 months\n \n 2018-04-20 08:53:19 UTC\n \n 2018-04-20 09:16:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 146\n Date-transferred-out AND No.-of-persons-in-original-cohort-6-months\n \n \n Date-transferred-out\n \n \n \n \n locationList\n ${location}\n \n \n value1\n ${endDate}\n \n \n \n \n \n No.-of-persons-in-original-cohort-6-months\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n','2018-04-20 10:53:19',4,'2018-04-20 11:16:16',4,0,NULL,NULL,NULL,'2172c378-b654-491b-8342-a2aec11d99eb'),(148,'Number of persons in cohort transferred out 12 months','Number of persons in cohort transferred out 12 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons in cohort transferred out 12 months\n Number of persons in cohort transferred out 12 months\n \n 2018-04-20 09:08:34 UTC\n \n 2018-04-20 09:13:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 148\n Date-transferred-out AND No.-of-persons-in-original-cohort-12-months\n \n \n Date-transferred-out\n \n \n \n \n locationList\n ${location}\n \n \n value1\n ${endDate}\n \n \n \n \n \n No.-of-persons-in-original-cohort-12-months\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n','2018-04-20 11:08:34',4,'2018-04-20 11:13:16',4,0,NULL,NULL,NULL,'e50bdec3-0982-4a13-a94d-c1c860b767b6'),(149,'No. of baseline CD4+ counts 6 months','No. of baseline CD4+ counts 6 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n No. of baseline CD4+ counts 6 months\n No. of baseline CD4+ counts 6 months\n \n 2018-04-20 09:27:44 UTC\n \n 2019-02-05 08:55:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 149\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \nand obs_datetime in \n (select min(os.obs_datetime) from obs os \n where ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)) \n group by os.person_id) \nand person_id in \n (select distinct person_id from obs os \n where ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)));\n','2018-04-20 11:27:44',4,'2019-02-05 10:55:59',4,0,NULL,NULL,NULL,'0a267111-8e29-46c3-8299-cb199c6b74aa'),(150,'No. of baseline CD4+ counts 12 months','No. of baseline CD4+ counts 12 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n No. of baseline CD4+ counts 12 months\n No. of baseline CD4+ counts 12 months\n \n 2018-04-20 09:40:28 UTC\n \n 2018-10-16 13:38:46 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 150\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \nand obs_datetime in \n (select min(os.obs_datetime) from obs os \n where ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)) \n group by os.person_id) \nand person_id in \n (select distinct person_id from obs os \n where ((o.concept_id = 1187 and o.value_numeric > 0) OR (o.concept_id = 3661 and o.value_numeric > 0)));\n','2018-04-20 11:40:28',4,'2018-10-16 15:38:46',4,0,NULL,NULL,NULL,'3dc23527-d716-4e4b-bb05-7a504e0db44d'),(153,'TestMedian','TestMedian','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.SqlIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TestMedian\n TestMedian\n \n 2018-04-20 11:34:00 UTC\n \n 2018-04-20 11:37:22 UTC\n \n 153\n SELECT \n AVG(sorted_obs.cd4) \nFROM \n (SELECT @rowindex:=@rowindex + 1 AS rowindex, \n o.value_numeric AS cd4 \n FROM obs o \n where location_id = 16 \n and o.concept_id = 1187 \n and MONTH(o.obs_datetime) = MONTH(DATE_ADD(now(), INTERVAL -2 MONTH)) \n ORDER BY o.value_numeric) AS sorted_obs \nWHERE \nsorted_obs.rowindex IN (FLOOR(@rowindex / 2) , CEIL(@rowindex / 2));\n','2018-04-20 13:34:00',4,'2018-04-20 13:37:22',4,0,NULL,NULL,NULL,'a5979205-f1fa-4ebe-ad68-8e3f5d4d311a'),(154,'DM_Weight_Updated','patient weight','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n DM_Weight_Updated\n patient weight\n \n 2018-06-05 07:42:11 UTC\n \n 2018-06-05 07:45:30 UTC\n \n 154\n \n \n 03to3.9kg\n \n \n \n \n value2\n 3.9\n \n \n value1\n 0.0\n \n \n \n \n \n 04to5.9kg\n \n \n \n \n value2\n 5.9\n \n \n value1\n 4.0\n \n \n \n \n \n 06to9.9kg\n \n \n \n \n value2\n 9.9\n \n \n value1\n 6.0\n \n \n \n \n \n 10to13.9kg\n \n \n \n \n value2\n 13.9\n \n \n value1\n 10.0\n \n \n \n \n \n 14to19.9kg\n \n \n \n \n value2\n 19.9\n \n \n value1\n 14.0\n \n \n \n \n \n 20to24.9kg\n \n \n \n \n value2\n 24.9\n \n \n value1\n 20.0\n \n \n \n \n \n 25+kg\n \n \n \n \n value2\n 34.9\n \n \n value1\n 25.0\n \n \n \n \n \n','2018-06-05 09:42:11',4,'2018-06-05 09:45:30',4,0,NULL,NULL,NULL,'3cf562e6-0290-45c0-a999-6133791b0652'),(155,'Clients registered during period','Clients registered during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients registered during period\n Clients registered during period\n \n 2018-06-05 08:36:35 UTC\n \n 2018-06-08 06:51:40 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n 155\n ANY\n \n \n \n','2018-06-05 10:36:35',4,'2018-06-08 08:51:40',4,0,NULL,NULL,NULL,'1f5202c9-90ed-4203-ab0c-969c40bd5ec7'),(159,'PIR05: Patient consultation completeness report (Registration vs. Consultation) Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR05: Patient consultation completeness report (Registration vs. Consultation) Data Set\n \n 2018-06-07 10:43:04 UTC\n \n 2018-06-07 14:46:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 159\n \n \n \n 900\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n 901\n \n \n \n \n \n \n \n \n \n 902\n \n \n \n \n \n \n \n \n \n','2018-06-07 12:43:04',4,'2018-06-07 16:46:17',4,0,NULL,NULL,NULL,'040a8664-4033-4958-bcad-064f51e6889a'),(169,'Clients not registered during period','Clients not registered during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not registered during period\n Clients not registered during period\n \n 2018-06-08 06:53:29 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n ANY\n \n \n \n true\n','2018-06-08 08:53:29',4,NULL,NULL,0,NULL,NULL,NULL,'56bc4ef4-3f60-47bd-b6c4-89f203ee199d'),(170,'Clients not seen for consultation during period','Clients not seen for consultation during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not seen for consultation during period\n Clients not seen for consultation during period\n \n 2018-06-08 06:54:57 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n ANY\n \n \n \n true\n','2018-06-08 08:54:57',4,NULL,NULL,0,NULL,NULL,NULL,'1791b273-ab2c-4d1b-9029-77203be5ea4d'),(171,'Clients not registered but seen for consultation during the period','Clients not registered but seen for consultation during the period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not registered but seen for consultation during the period\n Clients not registered but seen for consultation during the period\n \n 2018-06-08 06:57:10 UTC\n \n 2018-06-08 07:05:55 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 171\n Clients-seen-for-consultation AND Clients-not-registered-during-period\n \n \n Clients-seen-for-consultation\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n Clients-not-registered-during-period\n \n \n \n \n \n \n','2018-06-08 08:57:10',4,'2018-06-08 09:05:55',4,0,NULL,NULL,NULL,'331400b1-dd20-4e48-b06c-28356df8e88b'),(172,'Clients registered and not seen for consultation','Clients registered and not seen for consultation','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients registered and not seen for consultation\n Clients registered and not seen for consultation\n \n 2018-06-08 07:06:23 UTC\n \n 2018-06-08 07:41:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 172\n Clients-registered-during-period AND Clients-not-seen-for-consultation-during-period\n \n \n Clients-registered-during-period\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n Clients-not-seen-for-consultation-during-period\n \n \n \n \n \n \n','2018-06-08 09:06:23',4,'2018-06-08 09:41:52',4,0,NULL,NULL,NULL,'6ed321bb-a8b7-4c95-aed0-9f126b9225c0'),(173,'Clients registered and seen for consultation during period','Clients registered and seen for consultation during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients registered and seen for consultation during period\n Clients registered and seen for consultation during period\n \n 2018-06-08 07:11:35 UTC\n \n 2018-06-08 07:13:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 173\n Clients-seen-for-consultation AND Clients-registered-during-period\n \n \n Clients-seen-for-consultation\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n Clients-registered-during-period\n \n \n \n \n \n \n','2018-06-08 09:11:35',4,'2018-06-08 09:13:37',4,0,NULL,NULL,NULL,'c2ff0485-8637-4415-893d-70b6b18c1c71'),(174,'Clients not registered but seen for consultation during the period','Clients not registered but seen for consultation during the period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not registered but seen for consultation during the period\n Clients not registered but seen for consultation during the period\n \n 2018-06-08 07:14:53 UTC\n \n 2018-06-08 07:15:36 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 174\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-06-08 09:14:53',4,'2018-06-08 09:15:36',4,0,NULL,NULL,NULL,'7874aba7-94c7-43be-9601-0aeee2fafe41'),(175,'Clients not seen for consultation during period','Clients not seen for consultation during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not seen for consultation during period\n Clients not seen for consultation during period\n \n 2018-06-08 07:16:43 UTC\n \n 2018-06-08 07:17:27 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 175\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-06-08 09:16:43',4,'2018-06-08 09:17:27',4,0,NULL,NULL,NULL,'5697c599-0bc4-45e2-b2d7-23b6643742db'),(176,'Clients registered and not seen for consultation','Clients registered and not seen for consultation','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients registered and not seen for consultation\n Clients registered and not seen for consultation\n \n 2018-06-08 07:18:15 UTC\n \n 2018-06-08 07:18:48 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 176\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-06-08 09:18:15',4,'2018-06-08 09:18:48',4,0,NULL,NULL,NULL,'786a69e3-f9a4-4aad-903c-b511c7bca134'),(177,'Clients with visits and documented vitals encounter with documented consultation during period','Clients with visits and documented vitals encounter with documented consultation during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with visits and documented vitals encounter with documented consultation during period\n Clients with visits and documented vitals encounter with documented consultation during period\n \n 2018-06-08 07:19:27 UTC\n \n 2018-06-17 05:17:09 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 177\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-06-08 07:19:27',4,'2018-06-17 05:17:09',4,0,NULL,NULL,NULL,'2b76b4a6-12ab-43f1-b4fd-f0baf1f31e35'),(178,'Clients with visits and documented vitals encounter at registration during period','Clients registered during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with visits and documented vitals encounter at registration during period\n Clients registered during period\n \n 2018-06-08 07:20:29 UTC\n \n 2018-06-17 05:17:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 178\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-06-08 07:20:29',4,'2018-06-17 05:17:58',4,0,NULL,NULL,NULL,'b6c39f5c-2e9b-4250-9216-5a6eb1cabfca'),(179,'Clients seen for consultation during period','Clients seen for consultation during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen for consultation during period\n Clients seen for consultation during period\n \n 2018-06-08 07:21:56 UTC\n \n 2018-06-08 07:24:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 179\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-06-08 09:21:56',4,'2018-06-08 09:24:22',4,0,NULL,NULL,NULL,'3323b353-6f81-44b5-80d8-41b31c1071f0'),(180,'Percentage of clients with visits started but not seen for consultation during period','Percentage of clients with visits started but not seen for consultation during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Percentage of clients with visits started but not seen for consultation during period\n Percentage of clients with visits started but not seen for consultation during period\n \n 2018-06-08 07:24:56 UTC\n \n 2018-10-29 15:30:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 180\n FRACTION\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n \n \n locationList\n ${location}\n \n \n stoppedOnOrBefore\n ${endDate}\n \n \n startedOnOrAfter\n ${startDate}\n \n \n \n','2018-06-08 09:24:56',4,'2018-10-29 17:30:13',4,0,NULL,NULL,NULL,'e4155685-6661-42d0-9c74-be6a136eef5b'),(181,'Percentage of clients with visits started and also seen for consultation during period','Percentage of clients with visits started and also seen for consultation during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Percentage of clients with visits started and also seen for consultation during period\n Percentage of clients with visits started and also seen for consultation during period\n \n 2018-06-08 07:26:26 UTC\n \n 2018-10-29 15:28:47 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 181\n FRACTION\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n \n \n locationList\n ${location}\n \n \n stoppedOnOrBefore\n ${endDate}\n \n \n startedOnOrAfter\n ${startDate}\n \n \n \n','2018-06-08 09:26:26',4,'2018-10-29 17:28:47',4,0,NULL,NULL,NULL,'e7f1eed7-f423-42e0-a37e-74e41ddfe4da'),(182,'PIR99: Registration vs Consultation (Completeness)','Registration vs Consultation (Completeness)','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR99: Registration vs Consultation (Completeness)\n Registration vs Consultation (Completeness)\n \n 2018-06-08 07:28:55 UTC\n \n 2018-06-08 07:28:56 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 182\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-06-08 09:28:55',4,'2018-06-08 09:28:56',4,0,NULL,NULL,NULL,'685dbc9b-752a-4b5b-a948-8bd8830f80fb'),(183,'PIR99: Registration vs Consultation (Completeness) Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR99: Registration vs Consultation (Completeness) Data Set\n \n 2018-06-08 07:28:56 UTC\n \n 2018-10-15 13:22:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 183\n \n \n \n 900\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n 901\n \n \n \n \n \n \n \n \n \n 903\n \n \n \n \n \n \n \n \n \n 904\n \n \n \n \n \n \n \n \n \n 905\n \n \n \n \n \n \n \n \n \n 906\n \n \n \n \n \n \n \n \n \n 907\n \n \n \n \n \n \n \n \n \n 908\n \n \n \n \n \n \n \n \n \n 909\n \n \n \n \n \n \n \n \n \n 910\n \n \n \n \n \n \n \n \n \n','2018-06-08 09:28:56',4,'2018-10-15 15:22:12',4,0,NULL,NULL,NULL,'6a4ca4b9-1fce-4ab1-b1dd-7d3d68c7e40a'),(184,'CI_Clients_seen','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI_Clients_seen\n \n \n 2018-06-08 10:21:40 UTC\n \n 2019-01-31 18:09:56 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 184\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-06-08 10:21:40',4,'2019-01-31 18:09:56',4,0,NULL,NULL,NULL,'ec42c51f-70c7-437f-8d1b-00d531626486'),(185,'Clients with visits started during period','Clients with visits started during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.VisitCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with visits started during period\n Clients with visits started during period\n \n 2018-06-17 05:01:34 UTC\n \n 2018-10-29 15:24:40 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n startedOnOrAfter\n \n java.util.Date\n true\n \n \n stoppedOnOrBefore\n \n java.util.Date\n true\n \n \n 185\n false\n','2018-06-17 07:01:34',4,'2018-10-29 17:24:40',4,0,NULL,NULL,NULL,'2e034999-51ce-4694-8cfa-3892c11c9d83'),(186,'Clients with an active visit during period','Clients with an active visit during period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.VisitCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with an active visit during period\n Clients with an active visit during period\n \n 2018-06-17 05:03:41 UTC\n \n 2018-06-17 05:05:02 UTC\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n activeOnOrAfter\n \n java.util.Date\n true\n \n \n activeOnOrBefore\n \n java.util.Date\n true\n \n \n 186\n true\n false\n','2018-06-17 05:03:41',4,'2018-06-17 05:05:02',4,0,NULL,NULL,NULL,'18a150f9-baa1-47a1-a81f-8cdbf0e11bb7'),(187,'Clients with visits started during period','Clients with active visits which were started during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with visits started during period\n Clients with active visits which were started during period\n \n 2018-06-17 05:06:57 UTC\n \n 2018-10-29 15:26:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 187\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n stoppedOnOrBefore\n ${endDate}\n \n \n startedOnOrAfter\n ${startDate}\n \n \n \n','2018-06-17 07:06:57',4,'2018-10-29 17:26:02',4,0,NULL,NULL,NULL,'94e360fc-bc15-4848-8af4-c49a1fc30cc9'),(188,'Clients with an active visit during period','Clients with an active visit during period','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with an active visit during period\n Clients with an active visit during period\n \n 2018-06-17 05:09:21 UTC\n \n 2018-06-17 05:10:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 188\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n activeOnOrAfter\n ${startDate}\n \n \n activeOnOrBefore\n ${endDate}\n \n \n \n','2018-06-17 05:09:21',4,'2018-06-17 05:10:06',4,0,NULL,NULL,NULL,'0093fd77-6601-466d-abf7-bc38c91291ff'),(189,'All patients','All patients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.AllPatientsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All patients\n All patients\n \n 2018-06-19 11:07:07 UTC\n \n','2018-06-19 11:07:07',4,NULL,NULL,0,NULL,NULL,NULL,'2ba82672-5807-417c-bd4f-85216bee2b75'),(190,'Ratio of patient registered to those who are current of ART','Ratio of patient registered to those who are current of ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ratio of patient registered to those who are current of ART\n Ratio of patient registered to those who are current of ART\n \n 2018-06-19 11:08:40 UTC\n \n 2018-06-19 11:09:15 UTC\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 190\n FRACTION\n \n \n \n \n','2018-06-19 11:08:40',4,'2018-06-19 11:09:15',4,0,NULL,NULL,NULL,'5d1d8893-ea50-4e58-900f-21bbd217d9a5'),(191,'testing_dataset_def','','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n testing_dataset_def\n \n \n 2018-06-29 11:54:48 UTC\n \n 2018-06-29 11:55:28 UTC\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 191\n','2018-06-29 17:24:48',4,'2018-06-29 17:25:28',4,0,NULL,NULL,NULL,'83c4af16-1133-4662-b4c5-e7c316e574ff'),(192,'New on ART_test','sql script here','org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.SqlDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New on ART_test\n sql script here\n \n 2018-06-29 12:04:50 UTC\n \n 2018-06-29 12:14:22 UTC\n \n 192\n select * from visit where date_started >= '20-jun-2018'\n','2018-06-29 17:34:50',4,'2018-06-29 17:44:22',4,0,NULL,NULL,NULL,'d1b7fbd9-eabb-4a41-b40a-a0000bc9bb7d'),(193,'PIR06: Presumptive TB Cases','Reports Presumptive TB indicators into DHIS2 i.e. screened,presumptive and diagnosed','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR06: Presumptive TB Cases\n Reports Presumptive TB indicators into DHIS2 i.e. screened,presumptive and diagnosed\n \n 2018-07-11 13:00:38 UTC\n \n 2018-07-11 14:15:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 193\n \n \n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-07-11 18:30:38',4,'2018-07-11 19:45:16',4,0,NULL,NULL,NULL,'3c4e0eb9-54e4-4902-926b-40054003ade2'),(194,'PIR06: Presumptive TB Cases Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR06: Presumptive TB Cases Data Set\n \n 2018-07-11 13:00:39 UTC\n \n 2018-07-11 15:17:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 194\n \n \n Gender\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n ScrinAdulF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Gender\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n ScrinAdulM\n \n \n \n \n Gender\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n ScrinKidsF\n \n \n \n \n Gender\n Females\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n ScrinKidsM\n \n \n \n \n Gender\n Males\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n TBCaseAdF\n \n \n \n \n \n \n \n \n \n TBCaseAdM\n \n \n \n \n \n \n TBCaseChF\n \n \n \n \n \n \n TBCaseChM\n \n \n \n \n \n \n TBTreatAdF\n \n \n \n \n \n \n \n \n \n TBTreatAdM\n \n \n \n \n \n \n TBTreatChF\n \n \n \n \n \n \n TBTreatChM\n \n \n \n \n \n \n','2018-07-11 18:30:39',4,'2018-07-11 20:47:59',4,0,NULL,NULL,NULL,'0f8411d8-3f05-4bdf-aec2-8e98424dc083'),(195,'Male','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Male\n \n \n 2018-07-11 13:13:49 UTC\n \n true\n false\n false\n','2018-07-11 18:43:49',4,NULL,NULL,0,NULL,NULL,NULL,'8d691fae-5ceb-43dc-b4d6-5bac71678c96'),(196,'Presumptive TB Cases','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.InProgramCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Presumptive TB Cases\n \n \n 2018-07-11 13:26:30 UTC\n \n \n onDate\n \n java.util.Date\n true\n \n \n \n \n \n','2018-07-11 18:56:30',4,NULL,NULL,0,NULL,NULL,NULL,'b8632f66-eaff-4483-ace7-77ad437ae84f'),(198,'PIR06: Presumptive TB Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR06: Presumptive TB Data Set\n \n 2018-07-11 13:54:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n \n \n','2018-07-11 19:24:59',4,NULL,NULL,0,NULL,NULL,NULL,'b7cbdb76-1601-4381-a659-c08f500a0692'),(199,'Diagnosed with TB and started on treatment','No of people diagnosed with TB and started on TB treatment this month','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Diagnosed with TB and started on treatment\n No of people diagnosed with TB and started on TB treatment this month\n \n 2018-07-11 14:46:45 UTC\n \n 2019-02-03 09:59:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 199\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-07-11 14:46:45',4,'2019-02-03 09:59:14',4,0,NULL,NULL,NULL,'026262eb-a4f9-4efa-95c1-08c7e3379bcb'),(200,'Lost Clients Indicator','counts clients we have not seen in over 90 days','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Lost Clients Indicator\n counts clients we have not seen in over 90 days\n \n 2018-08-01 10:27:04 UTC\n \n 2018-08-01 14:02:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 200\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-01 15:57:04',4,'2018-08-01 19:32:54',4,0,NULL,NULL,NULL,'7a98264d-45da-4d7f-a6f8-2d26af7c761f'),(202,'Lost CLients Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Lost CLients Report Data Set\n \n 2018-08-01 12:22:39 UTC\n \n 2018-08-01 14:38:09 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 202\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n LostClient\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n','2018-08-01 17:52:39',4,'2018-08-01 20:08:09',4,0,NULL,NULL,NULL,'f3477198-4d0c-417f-8bae-8a537e014a99'),(203,'Missed Appointments Indicator','These are clients whose appointments are over 7 days due','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Missed Appointments Indicator\n These are clients whose appointments are over 7 days due\n \n 2018-08-01 14:09:12 UTC\n \n 2018-08-01 14:12:27 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 203\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-01 19:39:12',4,'2018-08-01 19:42:27',4,0,NULL,NULL,NULL,'e03fafd4-1495-4a09-b01f-f899be47cb38'),(205,'Missed Appointments Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Missed Appointments Report Data Set\n \n 2018-08-01 14:41:28 UTC\n \n 2018-08-01 14:52:07 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 205\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n MissedAP-F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n \n \n \n MissedAP-M\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n','2018-08-01 20:11:28',4,'2018-08-01 20:22:07',4,0,NULL,NULL,NULL,'22300a2c-9096-4518-bb47-cae4c283bd72'),(206,'Defaulters Indicator','clients who havent come for appointments for over 7 days but less than 90','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Defaulters Indicator\n clients who havent come for appointments for over 7 days but less than 90\n \n 2018-08-01 15:10:40 UTC\n \n 2018-08-01 15:24:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 206\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-01 20:40:40',4,'2018-08-01 20:54:58',4,0,NULL,NULL,NULL,'0ec8e212-181e-41a3-9726-ff31fcf99c21'),(208,'Defaulted Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Defaulted Report Data Set\n \n 2018-08-01 15:28:51 UTC\n \n 2018-08-01 15:30:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 208\n \n \n \n Defaulters\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n','2018-08-01 20:58:51',4,'2018-08-01 21:00:11',4,0,NULL,NULL,NULL,'c41a9e0d-ac74-443f-98cf-52b341ecc1b2'),(209,'Clients who did not pick up ARV lost','Persons who did not pick upp their ARV regimen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients who did not pick up ARV lost\n Persons who did not pick upp their ARV regimen\n \n 2018-08-02 13:47:29 UTC\n \n 2018-08-03 07:09:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 209\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-02 19:17:29',4,'2018-08-03 12:39:42',4,0,NULL,NULL,NULL,'ddcbd8c5-7e15-4006-be8b-0428db54bc51'),(211,'PIR_07_Persons_who_did_not_pick_up_their_ARV_regimen Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR_07_Persons_who_did_not_pick_up_their_ARV_regimen Data Set\n \n 2018-08-02 13:57:46 UTC\n \n 2018-08-02 14:05:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 211\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n LostAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n','2018-08-02 19:27:46',4,'2018-08-02 19:35:08',4,0,NULL,NULL,NULL,'6dbb2065-f8d0-4740-ba44-0e8f5cb5ced0'),(212,'Clients who died','Didnt pick up ARV due to death','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients who died\n Didnt pick up ARV due to death\n \n 2018-08-02 14:22:00 UTC\n \n 2019-03-29 06:58:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 212\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-02 14:22:00',4,'2019-03-29 06:58:08',4,0,NULL,NULL,NULL,'54fccccb-8c30-4235-a6a2-b40a3a6cc2ab'),(213,'Reason not yet known','didnt pick up ARV for unknown reasons','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Reason not yet known\n didnt pick up ARV for unknown reasons\n \n 2018-08-02 14:34:48 UTC\n \n 2018-08-02 14:56:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 213\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-02 20:04:48',4,'2018-08-02 20:26:02',4,0,NULL,NULL,NULL,'a15498e0-c11d-4691-aec6-be8cda80543d'),(214,'Clients not seen for unknown reasons','clients who didnt pick up their ARVs for unknown reasons','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not seen for unknown reasons\n clients who didnt pick up their ARVs for unknown reasons\n \n 2018-08-02 15:04:22 UTC\n \n 2019-01-23 13:55:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 214\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-02 17:04:22',4,'2019-01-23 15:55:44',4,0,NULL,NULL,NULL,'e30a1ade-3819-40c5-b6f6-bc031d22e3ce'),(216,'PIR_NO_PICKUP_TEST Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR_NO_PICKUP_TEST Data Set\n \n 2018-08-02 15:17:09 UTC\n \n 2018-08-02 15:20:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 216\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n LostAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n','2018-08-02 20:47:09',4,'2018-08-02 20:50:06',4,0,NULL,NULL,NULL,'16735ee0-0160-43f8-8eb4-beee79866db9'),(217,'Clients who picked up their ARVs','Number of persons who picked up their ARV regimens on time','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients who picked up their ARVs\n Number of persons who picked up their ARV regimens on time\n \n 2018-08-03 07:01:40 UTC\n \n 2019-02-03 11:21:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 217\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-03 07:01:40',4,'2019-02-03 11:21:37',4,0,NULL,NULL,NULL,'6fa66b18-d626-4ffa-bc4d-99aacb661f68'),(219,'TEst Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TEst Data Set\n \n 2018-08-03 07:05:32 UTC\n \n 2018-08-03 07:06:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 219\n \n \n \n ddfgh\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n gthhgh\n \n \n \n \n \n \n \n \n \n','2018-08-03 12:35:32',4,'2018-08-03 12:36:53',4,0,NULL,NULL,NULL,'9c60044d-a35f-45fb-81d7-2ec6fff3c769'),(220,'PIR07_Clients_who_did_not_pick_up_ARV','Persons who did not pick up their ARV regimens for different reasons, lost,died,unknown reason and those who stopped ART','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR07_Clients_who_did_not_pick_up_ARV\n Persons who did not pick up their ARV regimens for different reasons, lost,died,unknown reason and those who stopped ART\n \n 2018-08-03 07:10:51 UTC\n \n 2018-08-03 10:43:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 220\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-08-03 12:40:51',4,'2018-08-03 16:13:16',4,0,NULL,NULL,NULL,'a4d5077a-b21c-473b-9636-8dc0237a9bb7'),(221,'Clients_who_did Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients_who_did Data Set\n \n 2018-08-03 07:10:52 UTC\n \n 2019-02-03 10:45:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 221\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n DiedAdultF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n DiedAdultM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n DiedChild\n \n \n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n LostAdultF\n \n \n \n \n \n \n \n \n \n LostAdultM\n \n \n \n \n \n \n LostChild\n \n \n \n \n \n \n StoppedAdF\n \n \n \n \n \n \n \n \n \n StoppedAdM\n \n \n \n \n \n \n StoppedChi\n \n \n \n \n \n \n UnknownADF\n \n \n \n \n \n \n \n \n \n UnknownADM\n \n \n \n \n \n \n UnknownChi\n \n \n \n \n \n \n','2018-08-03 07:10:52',4,'2019-02-03 10:45:21',4,0,NULL,NULL,NULL,'41f52fdf-9b2f-4f40-9420-19f8470f76fa'),(222,'Stopped ART','Clients who did not pick up ARVs because they stopped ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Stopped ART\n Clients who did not pick up ARVs because they stopped ART\n \n 2018-08-03 08:50:56 UTC\n \n 2018-08-03 08:53:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 222\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-03 14:20:56',4,'2018-08-03 14:23:54',4,0,NULL,NULL,NULL,'7303b17a-e4ab-4b5e-b3ce-7880cf36bade'),(223,'On_time_pick_up','Number of persons who picked up their ARV regimens on time','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n On_time_pick_up\n Number of persons who picked up their ARV regimens on time\n \n 2018-08-03 09:11:49 UTC\n \n 2018-08-03 09:11:50 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 223\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-08-03 14:41:49',4,'2018-08-03 14:41:50',4,0,NULL,NULL,NULL,'fcb6a10d-d364-4aa3-a8fc-f4fbb961cbe4'),(224,'On_time_pick_up Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n On_time_pick_up Data Set\n \n 2018-08-03 09:11:50 UTC\n \n 2018-08-03 09:12:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 224\n \n \n \n TimePickUp\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n','2018-08-03 14:41:50',4,'2018-08-03 14:42:57',4,0,NULL,NULL,NULL,'75ff5ab7-0178-40ad-9960-d641a8895a7c'),(225,'NutritionalSupp1','Number of clients who received nutritional supplements RUFT- Plumpy nut','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NutritionalSupp1\n Number of clients who received nutritional supplements RUFT- Plumpy nut\n \n 2018-08-03 09:21:57 UTC\n \n 2018-08-03 09:23:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 225\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-03 14:51:57',4,'2018-08-03 14:53:18',4,0,NULL,NULL,NULL,'e871b95a-9ea4-4dfe-8b2a-dd2c569bc2f7'),(226,'NutritionalSupp2','No of clients who received nutritional supplement F100','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NutritionalSupp2\n No of clients who received nutritional supplement F100\n \n 2018-08-03 09:24:35 UTC\n \n 2018-08-03 09:25:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 226\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-03 14:54:35',4,'2018-08-03 14:55:39',4,0,NULL,NULL,NULL,'c63d9c45-d226-4110-8f54-e8a50ddcec95'),(227,'NutriotionalSupp3','NO of clients who received nutritional supplement F75','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NutriotionalSupp3\n NO of clients who received nutritional supplement F75\n \n 2018-08-03 09:26:57 UTC\n \n 2018-08-03 09:27:56 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 227\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-03 14:56:57',4,'2018-08-03 14:57:56',4,0,NULL,NULL,NULL,'0a8b4609-1638-40a5-9b34-03a8de87a6a6'),(228,'NutritionalSupp4','No of clients who received nutritional supplement Other1','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NutritionalSupp4\n No of clients who received nutritional supplement Other1\n \n 2018-08-03 09:29:48 UTC\n \n 2018-08-03 09:32:07 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 228\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2018-08-03 14:59:48',4,'2018-08-03 15:02:07',4,0,NULL,NULL,NULL,'83de7902-07a8-4ad8-a28d-efda8a8c302b'),(229,'Clients who received Cotrimox','Clients who received Cotrimox','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients who received Cotrimox\n Clients who received Cotrimox\n \n 2018-08-03 09:34:41 UTC\n \n 2019-02-03 11:53:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 229\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-03 09:34:41',4,'2019-02-03 11:53:59',4,0,NULL,NULL,NULL,'fe5bdf32-e7d2-4239-943e-38eb65e4b4ac'),(230,'Newly Enrolled in HIV care Started IPT','Newly Enrolled in HIV/ care Started IPT','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Newly Enrolled in HIV care Started IPT\n Newly Enrolled in HIV/ care Started IPT\n \n 2018-08-03 09:36:54 UTC\n \n 2019-02-03 20:20:25 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 230\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-03 09:36:54',4,'2019-02-03 20:20:25',4,0,NULL,NULL,NULL,'0dfe1170-9501-446f-8c7d-515881db67e4'),(231,'newly started on ART and IPT','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n newly started on ART and IPT\n \n \n 2018-08-03 10:23:17 UTC\n \n 2019-02-03 20:21:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 231\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-08-03 10:23:17',4,'2019-02-03 20:21:44',4,0,NULL,NULL,NULL,'b0be49b4-1ac5-4165-a934-05823c8faa5e'),(232,'PIR09: Nutritional_Supplement','Nutritional Supplements','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR09: Nutritional_Supplement\n Nutritional Supplements\n \n 2018-08-03 10:45:53 UTC\n \n 2018-10-17 10:14:43 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 232\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-08-03 12:45:53',4,'2018-10-17 12:14:43',4,0,NULL,NULL,NULL,'b9e11bf1-144c-4412-a09e-910c14d3e92c'),(233,'PIR08: Nutritional_Supplement Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR08: Nutritional_Supplement Data Set\n \n 2018-08-03 10:45:54 UTC\n \n 2018-08-06 07:13:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 233\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n Nutri2AduF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n Nutri2AduM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n Nutri2ChiF\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n Nutri2ChiM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n \n \n \n Nutri3AduF\n \n \n \n \n \n \n \n \n \n Nutri3AduM\n \n \n \n \n \n \n Nutri3ChiF\n \n \n \n \n \n \n Nutri3ChiM\n \n \n \n \n \n \n Nutri4AduF\n \n \n \n \n \n \n \n \n \n Nutri4AduM\n \n \n \n \n \n \n Nutri4ChiF\n \n \n \n \n \n \n Nutri4ChiM\n \n \n \n \n \n \n NutriAduF\n \n \n \n \n \n \n \n \n \n NutriAduM\n \n \n \n \n \n \n NutriChiF\n \n \n \n \n \n \n NutriChiM\n \n \n \n \n \n \n','2018-08-03 16:15:54',4,'2018-08-06 12:43:45',4,0,NULL,NULL,NULL,'6293f829-6d59-4aff-a121-5af73e522c28'),(234,'PIR10: Cotrimox','clients who received cotrimox','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR10: Cotrimox\n clients who received cotrimox\n \n 2018-08-06 07:44:18 UTC\n \n 2018-08-06 07:44:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 234\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-08-06 13:14:18',4,'2018-08-06 13:14:19',4,0,NULL,NULL,NULL,'2000f64b-2cea-41f3-b028-39f1b4c3e2fd'),(235,'PIR10: Cotrimox Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR10: Cotrimox Data Set\n \n 2018-08-06 07:44:19 UTC\n \n 2019-03-11 17:35:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 235\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age_DATE\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n Cotr6to14F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 06yrs-14yrs\n \n \n \n \n \n Cotr6to14M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 06yrs-14yrs\n \n \n \n \n \n Cotri5mtsF\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n <6Months\n \n \n \n \n \n Cotri5mtsM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n <6Months\n \n \n \n \n \n Cotri6to5F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age_DATE\n 06Mnths-5yrs\n \n \n \n \n \n Cotri6to5M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age_DATE\n 06Mnths-5yrs\n \n \n \n \n \n CotriAduF\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n CotriAduM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n','2018-08-06 07:44:19',4,'2019-03-11 17:35:13',4,0,NULL,NULL,NULL,'ce6e1b61-d77d-430c-85ea-5f2c8499cb69'),(237,'Month_to_month_age_cohort','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Month_to_month_age_cohort\n \n \n 2018-08-06 09:02:48 UTC\n \n 2018-08-06 09:15:44 UTC\n \n \n minAge\n \n java.lang.Integer\n true\n \n \n maxAge\n \n java.lang.Integer\n true\n \n \n 237\n MONTHS\n MONTHS\n false\n','2018-08-06 14:32:48',4,'2018-08-06 14:45:44',4,0,NULL,NULL,NULL,'b0fc9529-1c40-4ad0-b458-ef1d530c11ec'),(238,'Month_to_year_age_cohort','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Month_to_year_age_cohort\n \n \n 2018-08-06 09:05:50 UTC\n \n 2018-08-06 09:19:22 UTC\n \n \n minAge\n \n java.lang.Integer\n true\n \n \n maxAge\n \n java.lang.Integer\n true\n \n \n 238\n MONTHS\n YEARS\n false\n','2018-08-06 14:35:50',4,'2018-08-06 14:49:22',4,0,NULL,NULL,NULL,'88e4af2a-3f98-405c-b041-af814a86668c'),(239,'PIR12: Isoniazid Preventive Therapy','Clients on Isoniazid Preventive Therapy','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR12: Isoniazid Preventive Therapy\n Clients on Isoniazid Preventive Therapy\n \n 2018-08-06 10:08:28 UTC\n \n 2018-08-06 13:28:50 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 239\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-08-06 15:38:28',4,'2018-08-06 18:58:50',4,0,NULL,NULL,NULL,'94f0e9c8-b2a5-4d0b-8f69-8e0a590b6d8f'),(240,'Isoniazid Preventive Therapy Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Isoniazid Preventive Therapy Data Set\n \n 2018-08-06 10:08:29 UTC\n \n 2019-03-11 17:42:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 240\n \n \n DM_Age_DATE\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n \n \n IPTart0to4\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Age_DATE\n 0Mnths-4yrs\n \n \n \n \n \n IPTart15\n \n \n \n \n DM_Age_DATE\n 15+yrs\n \n \n \n \n \n IPTat5to14\n \n \n \n \n DM_Age_DATE\n 05yrsto14yrs\n \n \n \n \n \n IPTpr5to14\n \n \n \n \n \n \n \n \n \n IPTpre0to4\n \n \n \n \n \n \n IPTpre15\n \n \n \n \n \n \n','2018-08-06 10:08:29',4,'2019-03-11 17:42:02',4,0,NULL,NULL,NULL,'f3cc2da8-ca50-481d-9010-d0614a43606e'),(241,'Change_in_CD4_Count','change in CD4 count and adherence to ART for 6 and 12 months','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Change_in_CD4_Count\n change in CD4 count and adherence to ART for 6 and 12 months\n \n 2018-10-16 12:45:34 UTC\n \n 2018-10-16 12:45:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 241\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2018-10-16 14:45:34',4,'2018-10-16 14:45:37',4,0,NULL,NULL,NULL,'233d30b8-2ee3-4742-aab9-7814ef2adbb1'),(242,'Change_in_CD4_Count Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Change_in_CD4_Count Data Set\n \n 2018-10-16 12:45:37 UTC\n \n 2019-02-05 09:54:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 242\n \n \n \n Dead12mts\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n Dead6mts\n \n \n \n \n \n \n \n \n \n TransOut12\n \n \n \n \n \n \n \n \n \n TransOut6m\n \n \n \n \n \n \n \n \n \n alt1st12m\n \n \n \n \n \n \n \n \n \n alt1st6m\n \n \n \n \n \n \n \n \n \n basecd412m\n \n \n \n \n \n \n \n \n \n basecd46m\n \n \n \n \n \n \n \n \n \n follow12mt\n \n \n \n \n \n \n \n \n \n follow6mt\n \n \n \n \n \n \n \n \n \n lost12mts\n \n \n \n \n \n \n \n \n \n lost6mts\n \n \n \n \n \n \n \n \n \n origin12mn\n \n \n \n \n \n \n \n \n \n origin6mnt\n \n \n \n \n \n \n \n \n \n stil1st12m\n \n \n \n \n \n \n \n \n \n stil1st6m\n \n \n \n \n \n \n \n \n \n stopped12m\n \n \n \n \n \n \n \n \n \n stopped6mt\n \n \n \n \n \n \n \n \n \n swich2nd12\n \n \n \n \n \n \n \n \n \n switch2nd6\n \n \n \n \n \n \n \n \n \n transIn12m\n \n \n \n \n \n \n \n \n \n transIn6mn\n \n \n \n \n \n \n \n \n \n viral12mts\n \n \n \n \n \n \n \n \n \n viral6mts\n \n \n \n \n \n \n \n \n \n','2018-10-16 14:45:37',4,'2019-02-05 11:54:13',4,0,NULL,NULL,NULL,'e396adf4-cca6-4add-9638-46750e10468b'),(243,'Number of persons in original cohort 6 mnths','Number of persons in original cohort 6 mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons in original cohort 6 mnths\n Number of persons in original cohort 6 mnths\n \n 2018-10-16 12:54:53 UTC\n \n 2018-10-16 13:15:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 243\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n','2018-10-16 14:54:53',4,'2018-10-16 15:15:13',4,0,NULL,NULL,NULL,'9bfc4aae-1960-41e9-b763-c6ed0af8416e'),(244,'Number of persons in original cohort 12 mnths','Number of persons in original cohort 12 mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number of persons in original cohort 12 mnths\n Number of persons in original cohort 12 mnths\n \n 2018-10-16 12:57:51 UTC\n \n 2018-10-16 13:12:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 244\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n','2018-10-16 14:57:51',4,'2018-10-16 15:12:54',4,0,NULL,NULL,NULL,'4db88cd3-7834-419e-9078-cf8c676c317e'),(245,'Persons transfer in 6 months','number of persons transfer in 6 months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer in 6 months\n number of persons transfer in 6 months\n \n 2018-10-16 13:04:30 UTC\n \n 2018-10-16 13:06:52 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 245\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-10-16 15:04:30',4,'2018-10-16 15:06:52',4,0,NULL,NULL,NULL,'087ec921-1bc9-4801-8a08-b42c30c0e182'),(246,'Persons transfer in 12 months','Number of persons transferred in 12 months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer in 12 months\n Number of persons transferred in 12 months\n \n 2018-10-16 13:08:13 UTC\n \n 2018-10-16 13:09:51 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 246\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-10-16 15:08:13',4,'2018-10-16 15:09:51',4,0,NULL,NULL,NULL,'4a013856-0a85-49fb-8b38-b56ad12f91e8'),(247,'Persons transfer out 6 months','number of persons transferred out 6 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer out 6 months\n number of persons transferred out 6 months\n \n 2018-10-16 13:27:14 UTC\n \n 2018-10-16 13:34:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 247\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 2398 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH))\n','2018-10-16 15:27:14',4,'2018-10-16 15:34:20',4,0,NULL,NULL,NULL,'a5e955fe-3d68-426e-be12-bfdd8ae80f0e'),(248,'Persons transfer out 12 months','Number of persons transferred out 12 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer out 12 months\n Number of persons transferred out 12 months\n \n 2018-10-16 13:36:21 UTC\n \n 2018-10-16 13:37:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 248\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 2398 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH))\n','2018-10-16 15:36:21',4,'2018-10-16 15:37:17',4,0,NULL,NULL,NULL,'d1cb0ee5-2dba-4ee8-8661-fdf9e2b67d47'),(249,'Persons transfer out 12 months','number of persons transferred out 12 months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer out 12 months\n number of persons transferred out 12 months\n \n 2018-10-16 14:15:41 UTC\n \n 2018-10-16 14:17:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 249\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-10-16 16:15:41',4,'2018-10-16 16:17:54',4,0,NULL,NULL,NULL,'0695ac41-71c8-44b9-bba7-18b6601a2eb3'),(250,'Persons transfer out 6 months','number f persons transferred out 6 months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Persons transfer out 6 months\n number f persons transferred out 6 months\n \n 2018-10-16 14:19:33 UTC\n \n 2018-10-16 14:27:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 250\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-10-16 16:19:33',4,'2018-10-16 16:27:52',4,0,NULL,NULL,NULL,'ffbeae3c-4bc4-4321-a654-14378436f973'),(251,'Number with follow up CD4 6mnths','Number with follow up CD4 subset of net cohort 6mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number with follow up CD4 6mnths\n Number with follow up CD4 subset of net cohort 6mnths\n \n 2018-10-17 06:57:53 UTC\n \n 2018-10-18 14:41:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 251\n select distinct person_id \nfrom obs o \nwhere person_id in \n (select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n and person_id not in \n \n ( select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n and location_id =:location \n and o.concept_id = 2256 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n \n;\n','2018-10-17 08:57:53',4,'2018-10-18 16:41:53',4,0,NULL,NULL,NULL,'efc3aa8f-0827-4d20-b258-6f8e819e3068'),(252,' New discordant couples who started ART',' New discordant couples who started ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New discordant couples who started ART\n New discordant couples who started ART\n \n 2018-10-17 16:17:34 UTC\n \n 2019-01-31 17:58:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 252\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2018-10-17 16:17:34',4,'2019-01-31 17:58:53',4,0,NULL,NULL,NULL,'830d6157-f04e-4f1e-bfa8-39f471518945'),(253,'Discordant couple','HIV+ person in discordant couple','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.NumericObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Discordant couple\n HIV+ person in discordant couple\n \n 2018-10-17 19:30:31 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n','2018-10-17 21:30:31',4,NULL,NULL,0,NULL,NULL,NULL,'85395524-996e-48a4-b8ec-148549099e39'),(254,'Number with follow up CD4 12mnths','Number with follow up CD4 12mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number with follow up CD4 12mnths\n Number with follow up CD4 12mnths\n \n 2018-10-18 13:53:50 UTC\n \n 2018-10-18 14:41:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 254\n select distinct person_id \nfrom obs o \nwhere person_id in \n (select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \n and person_id not in \n \n ( select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \n and location_id =:location \n and o.concept_id = 2256 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n \n;\n','2018-10-18 15:53:50',4,'2018-10-18 16:41:08',4,0,NULL,NULL,NULL,'cbb4ec5e-947f-4c02-a46d-1d4d9cc1f28a'),(255,'Patients with follow up viral load 6 months','Patients with follow up viral load','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Patients with follow up viral load 6 months\n Patients with follow up viral load\n \n 2018-10-18 13:58:41 UTC\n \n 2018-10-18 14:10:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 255\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 4186 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 15:58:41',4,'2018-10-18 16:10:22',4,0,NULL,NULL,NULL,'a886ed5e-0e11-4590-9dd0-456e26e6669f'),(256,'Patients with follow up viral load 12 months','Patients with follow up viral load','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Patients with follow up viral load 12 months\n Patients with follow up viral load\n \n 2018-10-18 14:42:51 UTC\n \n 2019-02-05 09:24:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 256\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 4186 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:42:51',4,'2019-02-05 11:24:45',4,0,NULL,NULL,NULL,'77652a52-5c8c-46de-bf39-36b34fb3f0a7'),(257,'Clients lost to follow up 6months','Clients lost to follow up','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients lost to follow up 6months\n Clients lost to follow up\n \n 2018-10-18 14:45:16 UTC\n \n 2018-10-18 14:45:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 257\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 2302 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:45:16',4,'2018-10-18 16:45:57',4,0,NULL,NULL,NULL,'cc22e6d5-7614-4234-9241-861eac14b7e5'),(258,'Clients Dead 6 months','Clients Dead','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients Dead 6 months\n Clients Dead\n \n 2018-10-18 14:47:21 UTC\n \n 2018-10-18 14:49:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 258\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 3164 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:47:21',4,'2018-10-18 16:49:03',4,0,NULL,NULL,NULL,'3b2f4c98-1621-4a1b-b352-95367ce251ca'),(259,'Clients Stopped 6 months','Clients Stopped ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients Stopped 6 months\n Clients Stopped \n \n 2018-10-18 14:50:25 UTC\n \n 2018-10-18 14:51:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 259\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 2300 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:50:25',4,'2018-10-18 16:51:22',4,0,NULL,NULL,NULL,'5791856e-2f04-4eeb-980b-b151a820da7b'),(260,'Clients lost to follow up 12 months','Clients lost to follow up','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients lost to follow up 12 months\n Clients lost to follow up\n \n 2018-10-18 14:52:40 UTC\n \n 2018-10-18 14:54:05 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 260\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 2302 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:52:40',4,'2018-10-18 16:54:05',4,0,NULL,NULL,NULL,'6cd2d49e-36d2-40ed-857e-5b2e65e1fc16'),(261,'Clients Dead 12 months','Clients Dead','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients Dead 12 months\n Clients Dead\n \n 2018-10-18 14:55:18 UTC\n \n 2018-10-18 14:57:01 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 261\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 3164 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:55:18',4,'2018-10-18 16:57:01',4,0,NULL,NULL,NULL,'ff4f67ac-f450-4d32-b964-d2a978bd9249'),(262,'Clients Stopped 12 months','Clients Stopped','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients Stopped 12 months\n Clients Stopped\n \n 2018-10-18 14:57:50 UTC\n \n 2018-10-18 14:59:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 262\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id = 2300 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-18 16:57:50',4,'2018-10-18 16:59:34',4,0,NULL,NULL,NULL,'f24fd74d-6a99-4a66-81d7-c29f7bce2392'),(263,'Number still on original first line 6months','Number still on original first line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Number still on original first line 6months\n Number still on original first line\n \n 2018-10-19 07:48:00 UTC\n \n 2018-10-19 07:56:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 263\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3689,3691) \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 09:48:00',4,'2018-10-19 09:56:34',4,0,NULL,NULL,NULL,'de663b24-02ce-4d61-b039-dc505ede607d'),(264,'Clients still on original first line 12 months','clients of original 1st line regimen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients still on original first line 12 months\n clients of original 1st line regimen\n \n 2018-10-19 08:09:03 UTC\n \n 2018-10-19 08:12:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 264\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3689,3691) \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 10:09:03',4,'2018-10-19 10:12:11',4,0,NULL,NULL,NULL,'490b6050-d002-47db-8214-0e48246f925d'),(265,'Clients on alternative 1st line ART 6months','Clients on alternative 1st line ART (switched)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on alternative 1st line ART 6months\n Clients on alternative 1st line ART (switched)\n \n 2018-10-19 08:14:11 UTC\n \n 2018-10-19 08:16:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 265\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3689,3691) AND o.concept_id = 2399 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 10:14:11',4,'2018-10-19 10:16:57',4,0,NULL,NULL,NULL,'2e3d9aae-ab50-47e2-9c28-92726668cc78'),(266,'Clients on alternative 1st line ART 12 months','clients on alternative 1st line switched','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on alternative 1st line ART 12 months\n clients on alternative 1st line switched\n \n 2018-10-19 08:21:27 UTC\n \n 2018-10-19 08:29:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 266\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3689,3691) AND o.concept_id = 2399 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 10:21:27',4,'2018-10-19 10:29:03',4,0,NULL,NULL,NULL,'dfb1ed02-163a-4814-b5d0-0c630fc969a5'),(267,'Clients switched to 2nd line 6months','swicthed second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients switched to 2nd line 6months\n swicthed second line\n \n 2018-10-19 08:34:22 UTC\n \n 2018-10-19 08:36:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 267\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3692,3690) AND o.concept_id = 2399 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 10:34:22',4,'2018-10-19 10:36:21',4,0,NULL,NULL,NULL,'a3ccbabd-a7c3-4bf6-af4a-a25ad0d0b8ec'),(268,'Clients switched to 2nd line 12 months','switched 2nd line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients switched to 2nd line 12 months\n switched 2nd line\n \n 2018-10-19 08:37:24 UTC\n \n 2018-10-19 08:38:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 268\n select distinct person_id \nfrom obs o \nwhere person_id in \n ( \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 2249 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n union \n select person_id \n from obs o \n where location_id =:location \n and o.concept_id = 4168 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand person_id not in \n ( \n select person_id \n from obs o \n where o.concept_id = 2398 \n and MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -12 MONTH)) \n ) \nand location_id =:location \nand o.concept_id in (3692,3690) AND o.concept_id = 2399 \nand MONTH(o.value_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n;\n','2018-10-19 10:37:24',4,'2018-10-19 10:38:19',4,0,NULL,NULL,NULL,'800b7890-ee58-47d4-9133-66bffe5400ba'),(269,'SQL ARV Regimen 2 or 3 months drug prescription in prev. 1 month','ARV Regimen 2 or 3 months drug prescription in previous 1 month SQL Cohort Query Version','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL ARV Regimen 2 or 3 months drug prescription in prev. 1 month\n ARV Regimen 2 or 3 months drug prescription in previous 1 month SQL Cohort Query Version\n \n 2018-10-29 14:12:49 UTC\n \n 2018-10-30 10:06:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 269\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand (o.concept_id = 4174 and (o.value_coded = 4176 or o.value_coded = 4177)) \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) and YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \nand o.voided = 0 \n \nand \n \nperson_id not in ( \nselect distinct person_id \nfrom obs os \nwhere os.location_id =:location \nand (os.concept_id = 3843 and os.value_coded = 3842) \nand MONTH(os.obs_datetime) = MONTH(DATE(:endDate)) and YEAR(os.obs_datetime) = YEAR(DATE(:endDate)) \n)\n','2018-10-29 16:12:49',4,'2018-10-30 12:06:37',4,0,NULL,NULL,NULL,'d987055f-14bb-4a9e-be79-050bba503637'),(270,'SQL ARV Regimen 3 months drug prescription in prev. 2 months','ARV Regimen 3 months drug prescription in previous 2 months SQL Cohort Query version','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL ARV Regimen 3 months drug prescription in prev. 2 months\n ARV Regimen 3 months drug prescription in previous 2 months SQL Cohort Query version\n \n 2018-10-29 14:17:36 UTC\n \n 2018-10-30 10:07:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 270\n select distinct person_id \nfrom obs o \nwhere location_id =:location \nand o.concept_id = 4174 and o.value_coded = 4177 \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) and YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \nand o.voided = 0 \n \nand \n \nperson_id not in ( \nselect distinct person_id \nfrom obs os \nwhere os.location_id =:location \nand (os.concept_id = 3843 and os.value_coded = 3842) \nand MONTH(os.obs_datetime) = MONTH(DATE(:endDate)) and YEAR(os.obs_datetime) = YEAR(DATE(:endDate)) \n)\n','2018-10-29 16:17:36',4,'2018-10-30 12:07:31',4,0,NULL,NULL,NULL,'98a1122a-d39d-4a67-bed0-7489dd29608d'),(271,'Tx. Curr. SQL Version with visits in previous 1 or 2 months and were given 2 or 3 months drug prescription','Tx. Curr. SQL Version with visits in previous 1 or 2 months and were given 2 or 3 months drug prescription','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Tx. Curr. SQL Version with visits in previous 1 or 2 months and were given 2 or 3 months drug prescription\n Tx. Curr. SQL Version with visits in previous 1 or 2 months and were given 2 or 3 months drug prescription\n \n 2018-10-29 14:18:41 UTC\n \n 2018-10-29 14:22:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 271\n SQL-ARV-Regimen-2-or-3-months-drug-prescription-in-prev.-1-month OR SQL-ARV-Regimen-3-months-drug-prescription-in-prev.-2-months\n \n \n SQL-ARV-Regimen-2-or-3-months-drug-prescription-in-prev.-1-month\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n SQL-ARV-Regimen-3-months-drug-prescription-in-prev.-2-months\n \n \n \n \n \n \n','2018-10-29 16:18:41',4,'2018-10-29 16:22:28',4,0,NULL,NULL,NULL,'f2af4f7d-643e-4ee6-93eb-74488cf98704'),(272,'Clients seen 1f','1f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1f\n 1f\n \n 2018-10-30 08:31:02 UTC\n \n 2019-05-09 08:58:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 272\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND MONTH(o.obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(o.obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2018-10-30 08:31:02',4,'2019-05-09 08:58:37',4,0,NULL,NULL,NULL,'55df743e-4818-40e3-9df4-f76db645b660'),(273,'Clients multi month 1f','1f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1f\n 1f\n \n 2018-10-30 08:55:29 UTC\n \n 2019-05-09 09:02:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 273\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND MONTH(obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2018-10-30 08:55:29',4,'2019-05-09 09:02:12',4,0,NULL,NULL,NULL,'a018ec2e-bf15-49cb-96e2-cbfe9201211e'),(274,'Clients given 1f current and multi month','Clients with visits in months 1 through 6 and were given 1f=TDF-3TC-EFV prescription','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1f current and multi month\n Clients with visits in months 1 through 6 and were given 1f=TDF-3TC-EFV prescription\n \n 2018-10-30 09:01:24 UTC\n \n 2019-04-23 13:14:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 274\n arv-regimen-1f-SQL- OR Clients-given-2-or-3mnths-1f-in-previous-1-mnth OR Clients-given-3-months-1f-in-previous-2months\n \n \n arv-regimen-1f-SQL-\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-2-or-3mnths-1f-in-previous-1-mnth\n \n \n \n \n \n \n Clients-given-3-months-1f-in-previous-2months\n \n \n \n \n \n \n','2018-10-30 09:01:24',4,'2019-04-23 13:14:52',4,0,NULL,NULL,NULL,'af784bca-5138-4cb1-9f88-83a571d00101'),(275,'Clients seen 1c ','1c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1c \n 1c\n \n 2019-01-09 23:00:14 UTC\n \n 2019-05-08 07:50:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 275\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:00:14',4,'2019-05-08 07:50:10',4,0,NULL,NULL,NULL,'cc807875-4872-45bc-9b92-f1d98ed9c1c9'),(276,'Clients seen 1d','1d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1d\n 1d\n \n 2019-01-09 23:06:41 UTC\n \n 2019-05-08 08:07:00 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 276\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:06:41',4,'2019-05-08 08:07:00',4,0,NULL,NULL,NULL,'9d433224-b4de-4540-b350-c3ef93507f1e'),(277,'Clients seen 1e','1e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1e\n 1e\n \n 2019-01-09 23:10:05 UTC\n \n 2019-05-08 08:08:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 277\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:10:05',4,'2019-05-08 08:08:46',4,0,NULL,NULL,NULL,'c08132fe-9f08-4c82-a42c-3228fa855d5c'),(278,'Clients seen 1g','1g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1g\n 1g\n \n 2019-01-09 23:11:31 UTC\n \n 2019-05-08 08:12:38 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 278\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:11:31',4,'2019-05-08 08:12:38',4,0,NULL,NULL,NULL,'5e7ddc90-35bd-44be-b561-9b0887891e67'),(279,'Clients seen 1h','1h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 1h\n 1h\n \n 2019-01-09 23:12:35 UTC\n \n 2019-05-08 08:13:49 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 279\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:12:35',4,'2019-05-08 08:13:49',4,0,NULL,NULL,NULL,'3db0f8da-5cfd-460e-a6b3-c0990a276802'),(280,'Clients seen 2c','2c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2c\n 2c\n \n 2019-01-09 23:17:52 UTC\n \n 2019-05-08 09:58:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 280\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:17:52',4,'2019-05-08 09:58:10',4,0,NULL,NULL,NULL,'5b37bb40-282b-4d97-9981-a3d8198b8627'),(281,'Clients seen 2d','2d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2d\n 2d\n \n 2019-01-09 23:18:59 UTC\n \n 2019-05-08 10:03:25 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 281\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:18:59',4,'2019-05-08 10:03:25',4,0,NULL,NULL,NULL,'649d5831-2887-4080-bcff-6a71897413a2'),(282,'Clients seen 2e','2e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2e\n 2e\n \n 2019-01-09 23:20:18 UTC\n \n 2019-05-08 10:04:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 282\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:20:18',4,'2019-05-08 10:04:34',4,0,NULL,NULL,NULL,'60e76070-aea0-4257-ae5a-a954455d9e99'),(283,'Clients seen 2f','2f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2f\n 2f\n \n 2019-01-09 23:22:24 UTC\n \n 2019-05-08 10:05:36 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 283\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:22:24',4,'2019-05-08 10:05:36',4,0,NULL,NULL,NULL,'8c729f10-ec54-45b3-aea2-aeb95a4c3694'),(284,'Clients seen 2g','2g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2g\n 2g\n \n 2019-01-09 23:30:40 UTC\n \n 2019-05-08 10:10:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 284\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:30:40',4,'2019-05-08 10:10:12',4,0,NULL,NULL,NULL,'5f942d03-1351-4fc6-8617-f64ab62eba7a'),(285,'Clients seen 2h','2h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 2h\n 2h\n \n 2019-01-09 23:32:06 UTC\n \n 2019-05-08 10:13:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 285\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-09 23:32:06',4,'2019-05-08 10:13:08',4,0,NULL,NULL,NULL,'a7416bdd-ffb1-4658-afb2-1e646a52ebf4'),(286,'Clients multi month 1c','1c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1c\n 1c\n \n 2019-01-09 23:49:58 UTC\n \n 2019-05-09 09:09:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 286\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-09 23:49:58',4,'2019-05-09 09:09:54',4,0,NULL,NULL,NULL,'128fe28c-9f9b-494c-a220-314433181501'),(287,'Clients multi month 1d','1d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1d\n 1d\n \n 2019-01-09 23:54:38 UTC\n \n 2019-05-09 09:11:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 287\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-09 23:54:38',4,'2019-05-09 09:11:37',4,0,NULL,NULL,NULL,'6591b115-2cd0-42ef-ab14-d4c229ed05e8'),(288,'Clients multi month 1e','1e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1e\n 1e\n \n 2019-01-09 23:56:11 UTC\n \n 2019-05-09 09:12:55 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 288\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-09 23:56:11',4,'2019-05-09 09:12:55',4,0,NULL,NULL,NULL,'2bee1266-3b05-4cd1-9eaa-3a9dce01ed06'),(289,'Clients multi month 1g','1g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1g\n 1g\n \n 2019-01-09 23:57:13 UTC\n \n 2019-05-09 09:17:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 289\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-09 23:57:13',4,'2019-05-09 09:17:19',4,0,NULL,NULL,NULL,'894b729d-bded-4fa0-b54e-30a379dc4927'),(290,'Clients multi month 1h','1h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 1h\n 1h\n \n 2019-01-09 23:58:17 UTC\n \n 2019-05-09 09:43:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 290\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-09 23:58:17',4,'2019-05-09 09:43:44',4,0,NULL,NULL,NULL,'2e5a0852-2047-4c6e-be30-d19665f1f838'); +INSERT INTO `serialized_object` VALUES (291,'Clients multi month 2c','2c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2c\n 2c\n \n 2019-01-10 00:00:16 UTC\n \n 2019-05-09 09:27:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 291\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:00:16',4,'2019-05-09 09:27:52',4,0,NULL,NULL,NULL,'dc0406d3-2c3c-4157-ae83-537ae4e65e59'),(292,'Clients multi month 2d','2d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2d\n 2d\n \n 2019-01-10 00:01:21 UTC\n \n 2019-05-09 09:29:04 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 292\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:01:21',4,'2019-05-09 09:29:04',4,0,NULL,NULL,NULL,'4452e974-8c6e-442e-bb45-d6e09d26765a'),(293,'Clients multi month 2e','2e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2e\n 2e\n \n 2019-01-10 00:02:30 UTC\n \n 2019-05-09 09:30:24 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 293\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:02:30',4,'2019-05-09 09:30:24',4,0,NULL,NULL,NULL,'b70551ca-7dda-4d71-be21-852530c01b27'),(294,'Clients multi month 2f','2f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2f\n 2f\n \n 2019-01-10 00:04:54 UTC\n \n 2019-05-09 09:31:55 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 294\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:04:54',4,'2019-05-09 09:31:55',4,0,NULL,NULL,NULL,'7b572190-3a8e-41fd-9f13-b857c5a2d5a6'),(295,'Clients multi month 2g','2g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2g\n 2g\n \n 2019-01-10 00:05:54 UTC\n \n 2019-05-09 09:32:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 295\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:05:54',4,'2019-05-09 09:32:54',4,0,NULL,NULL,NULL,'5aa75e1d-5ae4-47d7-9b0b-e099ecdfbde9'),(296,'Clients multi month 2h','2h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 2h\n 2h\n \n 2019-01-10 00:06:48 UTC\n \n 2019-05-09 09:34:00 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 296\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:06:48',4,'2019-05-09 09:34:00',4,0,NULL,NULL,NULL,'e008404a-b1f1-442a-b667-5590a15ed2e9'),(297,'Clients multi month 3a','3a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 3a\n 3a\n \n 2019-01-10 00:08:01 UTC\n \n 2019-05-09 09:38:07 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 297\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:08:01',4,'2019-05-09 09:38:07',4,0,NULL,NULL,NULL,'88b2c868-7a1f-49e1-9277-e8dc122cafdd'),(298,'Clients multi month 3b','3b','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 3b\n 3b\n \n 2019-01-10 00:09:34 UTC\n \n 2019-05-09 09:39:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 298\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-01-10 00:09:34',4,'2019-05-09 09:39:22',4,0,NULL,NULL,NULL,'c3243091-3cc9-4c2d-94d8-0b3c1b7c226a'),(299,'Clients seen 3a','3a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 3a\n 3a\n \n 2019-01-10 00:11:14 UTC\n \n 2019-05-08 10:25:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 299\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-10 00:11:14',4,'2019-05-08 10:25:34',4,0,NULL,NULL,NULL,'f635e506-399a-49f2-8016-c9b3410fb65d'),(300,'Clients seen 3b','3b','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 3b\n 3b\n \n 2019-01-10 00:12:05 UTC\n \n 2019-05-08 10:37:48 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 300\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-01-10 00:12:05',4,'2019-05-08 10:37:48',4,0,NULL,NULL,NULL,'56b9db93-8aab-4bb7-9296-06b385249737'),(309,'Clients given 1c current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1c current and multi month\n \n \n 2019-01-10 16:41:42 UTC\n \n 2019-03-29 08:24:24 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 309\n arv-regimen-1C-SQL-no-duration OR Clients-given-3mnths-1c-in-previous-2mnths OR Clients-given-2-or-3mnths-1c-in-previous-1mnth\n \n \n arv-regimen-1C-SQL-no-duration\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-1c-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-1c-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 16:41:42',4,'2019-03-29 08:24:24',4,0,NULL,NULL,NULL,'36e870b9-ea69-42f4-af1c-ab0dc12652d1'),(310,'Clients given 1d current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1d current and multi month\n \n \n 2019-01-10 16:51:23 UTC\n \n 2019-03-29 08:29:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 310\n Clients-given-2-or-3mnths-1d-in-previous-1mnth OR Clients-given-3mnths-1d-in-previous-2mnths OR arv-regimen-1d-SQL-\n \n \n Clients-given-2-or-3mnths-1d-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-1d-in-previous-2mnths\n \n \n \n \n \n \n arv-regimen-1d-SQL-\n \n \n \n \n \n \n','2019-01-10 16:51:23',4,'2019-03-29 08:29:02',4,0,NULL,NULL,NULL,'ab5ee2c6-b62a-4730-ab20-93402f758aba'),(311,'Clients given 1e current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1e current and multi month\n \n \n 2019-01-10 17:18:53 UTC\n \n 2019-04-01 07:25:00 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 311\n Clients-given-3mnths-1e-in-previous-2mnths OR arv-regimen-1e-SQL- OR Clients-given-2-or-3mnths-1e-in-previous-1mnth\n \n \n Clients-given-3mnths-1e-in-previous-2mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n arv-regimen-1e-SQL-\n \n \n \n \n \n \n Clients-given-2-or-3mnths-1e-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 17:18:53',4,'2019-04-01 07:25:00',4,0,NULL,NULL,NULL,'6fab4ceb-75e5-4687-ab3d-96d87493c83c'),(312,'Clients given 1g current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1g current and multi month\n \n \n 2019-01-10 17:30:56 UTC\n \n 2019-04-01 07:28:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 312\n Clients-given-2-or-3mnths-1g-in-previous-1mnth OR Clients-given-3mnths-1g-in-previous-2mnths OR arv-regimen-1g-SQL-\n \n \n Clients-given-2-or-3mnths-1g-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-1g-in-previous-2mnths\n \n \n \n \n \n \n arv-regimen-1g-SQL-\n \n \n \n \n \n \n','2019-01-10 17:30:56',4,'2019-04-01 07:28:28',4,0,NULL,NULL,NULL,'5b53d187-636a-4b70-9d6a-56be8a998fe5'),(313,'Clients given 1h current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 1h current and multi month\n \n \n 2019-01-10 17:40:48 UTC\n \n 2019-04-01 07:30:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 313\n Clients-given-2-or-3mnths-1h-in-previous-1mnth OR Clients-given-3mnths-1h-in-previous-2mnths OR ARV-regimen-1h-SQL-\n \n \n Clients-given-2-or-3mnths-1h-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-1h-in-previous-2mnths\n \n \n \n \n \n \n ARV-regimen-1h-SQL-\n \n \n \n \n \n \n','2019-01-10 17:40:48',4,'2019-04-01 07:30:03',4,0,NULL,NULL,NULL,'817075e8-f801-429c-8ffa-b5b9ce9967ff'),(314,'Clients given 2c current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2c current and multi month\n \n \n 2019-01-10 17:54:49 UTC\n \n 2019-04-01 08:26:25 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 314\n Clients-given-3mnths-2c-in-previous-2mnths OR arv-regimen-2c-SQL- OR Clients-given-2-or-3mnths-2c-in-previous-1mnth\n \n \n Clients-given-3mnths-2c-in-previous-2mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n arv-regimen-2c-SQL-\n \n \n \n \n \n \n Clients-given-2-or-3mnths-2c-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 17:54:49',4,'2019-04-01 08:26:25',4,0,NULL,NULL,NULL,'41d660e4-321c-42e4-995f-073161a5a1f0'),(315,'Clients given 2d current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2d current and multi month\n \n \n 2019-01-10 18:05:16 UTC\n \n 2019-04-01 08:27:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 315\n Clients-given-2-or-3mnths-2d-in-previous-1mnth OR Clients-given-3mnths-2d-in-previous-2mnths OR arv-regimen-2d-SQL-\n \n \n Clients-given-2-or-3mnths-2d-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-2d-in-previous-2mnths\n \n \n \n \n \n \n arv-regimen-2d-SQL-\n \n \n \n \n \n \n','2019-01-10 18:05:16',4,'2019-04-01 08:27:39',4,0,NULL,NULL,NULL,'0f5b1812-4fd6-4ded-b64e-16def8e64d81'),(316,'Clients given 2e current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2e current and multi month\n \n \n 2019-01-10 18:17:31 UTC\n \n 2019-04-01 08:28:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 316\n Clients-given-2-or-3mnths-2e-in-previous-1mnth OR Clients-given-3mnths-2e-in-previous-2mnths OR arv-regimen-2e-SQL-\n \n \n Clients-given-2-or-3mnths-2e-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-2e-in-previous-2mnths\n \n \n \n \n \n \n arv-regimen-2e-SQL-\n \n \n \n \n \n \n','2019-01-10 18:17:31',4,'2019-04-01 08:28:58',4,0,NULL,NULL,NULL,'9f6b4f25-5941-4798-ac05-75721fc60f5a'),(317,'Clients given 2f current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2f current and multi month\n \n \n 2019-01-10 18:25:53 UTC\n \n 2019-04-01 08:33:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 317\n arv-regimen-2f-SQL- OR Clients-given-3mnths-2f-in-previous-2mnths OR Clients-given-2-or-3mnths-2f-in-previous-1mnth\n \n \n arv-regimen-2f-SQL-\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-2f-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-2f-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 18:25:53',4,'2019-04-01 08:33:37',4,0,NULL,NULL,NULL,'edfa3d6d-49de-4b92-80e3-06fbf1ac7064'),(318,'Clients given 2g current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2g current and multi month\n \n \n 2019-01-10 18:32:59 UTC\n \n 2019-04-01 08:41:09 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 318\n arv-regimen-2g-SQL- OR Clients-given-3mnths-2g-in-previous-2mnths OR Clients-given-2-or-3mnths-2g-in-previous-1mnth\n \n \n arv-regimen-2g-SQL-\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-2g-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-2g-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 18:32:59',4,'2019-04-01 08:41:09',4,0,NULL,NULL,NULL,'e7054506-95ba-4086-8f65-bd053e845fcf'),(319,'Clients given 2h current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2h current and multi month\n \n \n 2019-01-10 18:40:05 UTC\n \n 2019-03-20 13:32:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 319\n arv-regimen-2h-SQL- OR Clients-given-2-or-3mnths-2h-in-previous-1mnth\n \n \n arv-regimen-2h-SQL-\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-2-or-3mnths-2h-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 18:40:05',4,'2019-03-20 13:32:19',4,0,NULL,NULL,NULL,'78bbfb25-ec26-40c2-8077-f300dabe0a0f'),(320,'Clients given 3a current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 3a current and multi month\n \n \n 2019-01-10 18:44:24 UTC\n \n 2019-04-01 08:47:38 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 320\n ARV-regimen-3a-SQL OR Clients-given-2-or-3mnths-3a-in-previous-1mnth\n \n \n Clients-given-3mnths-3a-in-previous-2mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ARV-regimen-3a-SQL\n \n \n \n \n \n \n Clients-given-2-or-3mnths-3a-in-previous-1mnth\n \n \n \n \n \n \n','2019-01-10 18:44:24',4,'2019-04-01 08:47:38',4,0,NULL,NULL,NULL,'4efdb85c-372c-4623-808d-7c9bc93eeff1'),(321,'Clients given 3b current and multi month','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 3b current and multi month\n \n \n 2019-01-10 18:49:28 UTC\n \n 2019-04-01 08:52:15 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 321\n Clients-given-2-or-3mnths-3b-in-previous-1mnth OR Clients-given-3mnths-3b-in-previous-2mnths OR ARV-Regimen-3b-SQL\n \n \n Clients-given-2-or-3mnths-3b-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-3b-in-previous-2mnths\n \n \n \n \n \n \n ARV-Regimen-3b-SQL\n \n \n \n \n \n \n','2019-01-10 18:49:28',4,'2019-04-01 08:52:15',4,0,NULL,NULL,NULL,'2b09727b-e984-4c6f-841b-6e73c973622c'),(322,'Clients enroled on PreART exlcuding those with an ART start date','Combines client enrolled on PreART and excludes clients with an ART start date before end of period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients enroled on PreART exlcuding those with an ART start date\n Combines client enrolled on PreART and excludes clients with an ART start date before end of period\n \n 2019-01-23 08:29:09 UTC\n \n 2019-01-23 08:45:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 322\n Date-enrolled-in-Pre-ART AND Clients-ever-enrolled-on-ART\n \n \n Date-enrolled-in-Pre-ART\n \n \n \n \n locationList\n ${location}\n \n \n value2\n ${endDate}\n \n \n value1\n ${startDate}\n \n \n \n \n \n Clients-ever-enrolled-on-ART\n \n \n \n \n locationList\n ${location}\n \n \n value1\n ${endDate}\n \n \n \n \n \n','2019-01-23 10:29:09',4,'2019-01-23 10:45:31',4,0,NULL,NULL,NULL,'1feca9b1-e0d7-4c4e-b898-0dc32b0cc71b'),(323,'CITest33: Clients enrolled on PreART','Testing','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITest33: Clients enrolled on PreART\n Testing\n \n 2019-01-23 08:37:15 UTC\n \n 2019-01-23 08:38:29 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n java.util.List\n true\n \n \n 323\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-01-23 10:37:15',4,'2019-01-23 10:38:29',4,0,NULL,NULL,NULL,'2e5bfe4e-6d66-4087-80db-71b46d544763'),(324,'Test Client Enrolled in PreART','Just testing','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Test Client Enrolled in PreART\n Just testing\n \n 2019-01-23 08:39:17 UTC\n \n 2019-01-23 08:39:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 324\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-01-23 10:39:17',4,'2019-01-23 10:39:18',4,0,NULL,NULL,NULL,'c74e3afc-489b-460b-906a-09b049ba7614'),(325,'Test Client Enrolled in PreART Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Test Client Enrolled in PreART Data Set\n \n 2019-01-23 08:39:18 UTC\n \n 2019-03-26 13:22:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 325\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n TXCurrPrev\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n','2019-01-23 08:39:18',4,'2019-03-26 13:22:19',4,0,NULL,NULL,NULL,'127b8507-13c4-4484-8957-880f8a03fbfd'),(326,'Pre-ART clients seen in previous months','preart multi month','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pre-ART clients seen in previous months\n preart multi month\n \n 2019-01-23 10:54:36 UTC\n \n 2019-01-23 10:54:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 326\n','2019-01-23 12:54:36',4,'2019-01-23 12:54:46',4,0,NULL,NULL,NULL,'9becf662-98cd-4606-bbb2-e8dffabf1be0'),(328,'Clients not seen for unknown reasons','defaulters and missed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients not seen for unknown reasons\n defaulters and missed\n \n 2019-01-23 13:50:54 UTC\n \n 2019-02-03 11:02:39 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 328\n ART-clients-with-Missed-Appointments OR ART-clients-who-Defaulted\n \n \n ART-clients-with-Missed-Appointments\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ART-clients-who-Defaulted\n \n \n \n \n \n \n','2019-01-23 13:50:54',4,'2019-02-03 11:02:39',4,0,NULL,NULL,NULL,'b97be60d-0f0b-44bc-a6e6-fa57577e7889'),(329,'PreART Clients not initiated on ART','enrolled but no ART start date','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PreART Clients not initiated on ART\n enrolled but no ART start date\n \n 2019-01-24 12:41:36 UTC\n \n 2019-01-24 13:04:43 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 329\n select distinct person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2223 \nand person_id not in ( \n select distinct person_id \n from obs os inner join location l on os.location_id = l.location_id \n where (os.location_id =:location or parent_location =:location) \n and os.concept_id = 2249 \n )\n','2019-01-24 12:41:36',4,'2019-01-24 13:04:43',4,0,NULL,NULL,NULL,'d0381567-7eab-475a-8525-9d9bd207ea6d'),(330,'New Persons enrolled in Pre ART','enrolled and no art start','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New Persons enrolled in Pre ART\n enrolled and no art start\n \n 2019-01-24 13:57:17 UTC\n \n 2019-01-31 20:30:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 330\n PreART-Clients-not-initiated-on-ART AND Date-enrolled-in-Pre-ART\n \n \n PreART-Clients-not-initiated-on-ART\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n Date-enrolled-in-Pre-ART-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-01-24 13:57:17',4,'2019-01-31 20:30:08',4,0,NULL,NULL,NULL,'e7aaf7be-3ce1-4d84-9e78-2da603a5961f'),(331,'clients given multi month ARVs 2 or 3mnths','clients given multi month ARVs 2 or 3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients given multi month ARVs 2 or 3mnths\n clients given multi month ARVs 2 or 3mnths\n \n 2019-01-29 21:03:46 UTC\n \n 2019-03-29 07:50:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 331\n select distinct Id from \n (select distinct Id from \n ( \n (select distinct o.person_id AS Id \n from obs o \n inner join location l on o.location_id = l.location_id \n where ( o.location_id = :location or parent_location = :location) \n and o.concept_id = 2250 \n and o.value_coded in (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n and o.voided = 0 \n and obs_datetime BETWEEN :startDate and DATE_ADD(:endDate, INTERVAL 1 DAY) \n ) \n \n UNION \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175,4176.4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE ( o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded in (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n) as regimen \nwhere Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 AND obs_datetime < DATE_ADD(:endDate, INTERVAL 1 DAY)) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate, INTERVAL 1 DAY) \n and dead = 1 \n ) \n )as final\n','2019-01-29 21:03:46',4,'2019-03-29 07:50:08',4,0,NULL,NULL,NULL,'c8709121-d393-4861-b808-559fd29dfd7d'),(332,'clients given multi month ARVs 3mnths','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients given multi month ARVs 3mnths\n \n \n 2019-01-29 21:28:52 UTC\n \n 2019-03-29 07:53:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 332\n select distinct Id from \n(select id from \n ( \n ( \n select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n \n UNION \n \n ( \n select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n \n UNION \n \n ( \n select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n \n UNION \n \n ( \n select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n \n UNION \n \n ( \n select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n \n UNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n \nUNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n \nUNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n \nUNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n \nUNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n \nUNION \n \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(DATE_ADD(:endDate,INTERVAL 1 DAY), INTERVAL -28 DAY)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(DATE_ADD(:endDate,INTERVAL 1 DAY), INTERVAL -28 DAY)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in(4175,4146,4177,4245,4246,4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded IN (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n \n ) \n) as regimen \n \nwhere Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 AND obs_datetime < :endDate) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \n) \nas final\n','2019-01-29 21:28:52',4,'2019-03-29 07:53:17',4,0,NULL,NULL,NULL,'4cdbc901-cea1-4995-84b6-0b6d46c49e03'),(333,'Appointment NOT scheduled','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CodedObsCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Appointment NOT scheduled\n \n \n 2019-01-29 21:45:38 UTC\n \n \n onOrAfter\n \n java.util.Date\n true\n \n \n onOrBefore\n \n java.util.Date\n true\n \n \n locationList\n \n org.openmrs.Location\n java.util.List\n true\n \n \n ANY\n \n \n \n \n NOT_IN\n \n \n \n','2019-01-29 21:45:38',4,NULL,NULL,0,NULL,NULL,NULL,'b3da29d2-311a-4264-bef4-5b1b0629704e'),(334,'Clients who picked up ARVs on time','Clients who picked up ARVs on time','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients who picked up ARVs on time\n Clients who picked up ARVs on time\n \n 2019-01-29 21:46:50 UTC\n \n 2019-03-29 08:00:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 334\n Clients-given-2weeks-ARV OR clients-given-multi-month-ARVs-3mnths OR clients-given-multi-month-ARVs-2-or-3mnths AND Clients-with-scheduled-appointments-SQL\n \n \n Clients-given-2weeks-ARV\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n clients-given-multi-month-ARVs-3mnths\n \n \n \n \n \n \n clients-given-multi-month-ARVs-2-or-3mnths\n \n \n \n \n \n \n Clients-with-scheduled-appointments-SQL\n \n \n \n \n \n \n','2019-01-29 21:46:50',4,'2019-03-29 08:00:58',4,0,NULL,NULL,NULL,'937a56fd-e654-414a-b1bb-9499ba8d99e5'),(335,'clients not on appointement','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients not on appointement\n \n \n 2019-01-29 21:53:00 UTC\n \n 2019-01-29 21:54:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 335\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2019-01-29 21:53:00',4,'2019-01-29 21:54:40',4,0,NULL,NULL,NULL,'eb1bf76e-95e8-474d-b856-05c69ce9bcdd'),(336,'clients given 2 or 3mnths ARVs','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients given 2 or 3mnths ARVs\n \n \n 2019-01-29 21:55:47 UTC\n \n 2019-01-29 21:56:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 336\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-01-29 21:55:47',4,'2019-01-29 21:56:53',4,0,NULL,NULL,NULL,'3c92647f-a1dd-4218-b440-3272663aa92d'),(337,'clients given 3mnths ARVs ','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients given 3mnths ARVs \n \n \n 2019-01-29 21:57:48 UTC\n \n 2019-01-29 21:58:37 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 337\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-01-29 21:57:48',4,'2019-01-29 21:58:37',4,0,NULL,NULL,NULL,'a4a2ee04-3761-40c9-b9b9-962fa502780d'),(338,'Clients on appointment','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on appointment\n \n \n 2019-01-29 22:00:24 UTC\n \n 2019-01-29 22:01:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 338\n COUNT\n \n \n \n \n locationList\n ${location}\n \n \n onOrBefore\n ${endDate}\n \n \n onOrAfter\n ${startDate}\n \n \n \n','2019-01-29 22:00:24',4,'2019-01-29 22:01:08',4,0,NULL,NULL,NULL,'dc060565-40ef-4a71-b515-28cd018fb5d6'),(339,'Discordant couples SQL','Discordant couples','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Discordant couples SQL\n Discordant couples\n \n 2019-01-31 04:56:06 UTC\n \n 2019-01-31 05:06:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 339\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 4225 and o.value_coded = 2146\n','2019-01-31 04:56:06',4,'2019-01-31 05:06:40',4,0,NULL,NULL,NULL,'b3b772a7-7fc2-40d4-bbaa-8fe6e5eb9bd9'),(340,'ART Start date SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Start date SQL\n \n \n 2019-01-31 08:49:55 UTC\n \n 2019-05-09 08:30:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 340\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND MONTH(o.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(o.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND o.voided = 0 \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND MONTH(obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-01-31 08:49:55',4,'2019-05-09 08:30:16',4,0,NULL,NULL,NULL,'6f37715f-711c-48fa-8f56-e3360233d885'),(341,'ART restart date SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART restart date SQL\n \n \n 2019-01-31 09:40:55 UTC\n \n 2019-01-31 09:41:33 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 341\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3708 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-01-31 09:40:55',4,'2019-01-31 09:41:33',4,0,NULL,NULL,NULL,'f1a22112-f4e3-47eb-a3c8-beff0cc47bd4'),(342,'ART clients seen SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients seen SQL\n \n \n 2019-01-31 10:45:08 UTC\n \n 2019-05-09 08:22:24 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 342\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND MONTH(obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand patient.patient_id not in -- EXCLUDE CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n -- EXCLUDE TRANSFER OUT WHO CAME BACK \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n -- EXCLUDE DEAD \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \n \n \n','2019-01-31 10:45:08',4,'2019-05-09 08:22:24',4,0,NULL,NULL,NULL,'092398d1-86b9-4486-97ff-2864ef7871e9'),(343,'ART Clients transferred in SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Clients transferred in SQL\n \n \n 2019-01-31 10:53:28 UTC\n \n 2019-01-31 11:06:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 343\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2396 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-01-31 10:53:28',4,'2019-01-31 11:06:18',4,0,NULL,NULL,NULL,'08280ca8-e857-4730-8350-950ab55aee95'),(344,'ART Clients transferred out SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART Clients transferred out SQL\n \n \n 2019-01-31 11:08:01 UTC\n \n 2019-03-26 14:43:56 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 344\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand ( \no.concept_id = 4155 and o.value_coded = 2146 and obs_datetime < DATE_ADD(:endDate,interval 1 DAY)) \nand obs_datetime >= :startDate \nand obs_datetime <= :endDate\n','2019-01-31 11:08:01',4,'2019-03-26 14:43:56',4,0,NULL,NULL,NULL,'ab08b4d3-0971-427c-b3e9-8784299dbee7'),(345,'Tx Curr Previous months SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Tx Curr Previous months SQL\n \n \n 2019-01-31 11:21:16 UTC\n \n 2019-01-31 11:24:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 345\n clients-given-multi-month-ARVs-3mnths OR clients-given-multi-month-ARVs-2-or-3mnths\n \n \n clients-given-multi-month-ARVs-3mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n clients-given-multi-month-ARVs-2-or-3mnths\n \n \n \n \n \n \n','2019-01-31 11:21:16',4,'2019-01-31 11:24:10',4,0,NULL,NULL,NULL,'9563340e-e1d1-4725-bff2-e89edbf454e2'),(346,'Clients given CTX SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given CTX SQL\n \n \n 2019-01-31 19:15:31 UTC\n \n 2019-02-03 11:38:00 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 346\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3728 \nand o.value_numeric < 31 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n\n','2019-01-31 19:15:31',4,'2019-02-03 11:38:00',4,0,NULL,NULL,NULL,'e0ae8042-353d-41e9-a70f-4df0c6bcf58b'),(347,'Pre-ART Clients seen','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pre-ART Clients seen\n \n \n 2019-01-31 19:45:15 UTC\n \n 2019-01-31 20:04:38 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 347\n PreART-Clients-not-initiated-on-ART AND ART-clients-seen-SQL\n \n \n PreART-Clients-not-initiated-on-ART\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n \n \n \n ART-clients-seen-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-01-31 19:45:15',4,'2019-01-31 20:04:38',4,0,NULL,NULL,NULL,'66c8ee04-f791-4774-84f7-597e039a4f94'),(348,'Date Confirmed HIV positive SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date Confirmed HIV positive SQL\n \n \n 2019-01-31 20:09:36 UTC\n \n 2019-01-31 20:10:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 348\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2222 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-01-31 20:09:36',4,'2019-01-31 20:10:20',4,0,NULL,NULL,NULL,'209fc83a-9c42-44aa-afe2-583e6e19cb56'),(349,'Date enrolled in Pre-ART SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date enrolled in Pre-ART SQL\n \n \n 2019-01-31 20:24:03 UTC\n \n 2019-01-31 20:25:29 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 349\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2223 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-01-31 20:24:03',4,'2019-01-31 20:25:29',4,0,NULL,NULL,NULL,'f2c9e963-4199-471b-aac4-23627e6d0d71'),(350,'Date enrolled in Pre-ART','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Date enrolled in Pre-ART\n \n \n 2019-01-31 20:39:42 UTC\n \n 2019-01-31 20:40:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 350\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-01-31 20:39:42',4,'2019-01-31 20:40:34',4,0,NULL,NULL,NULL,'5356e185-cedb-417f-a685-7a84a0e828f8'),(351,'HIV Care clients screened for TB SQL','HIV Care clients screened for TB SQL','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Care clients screened for TB SQL\n HIV Care clients screened for TB SQL\n \n 2019-02-03 09:35:06 UTC\n \n 2019-02-03 09:45:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 351\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3710 \nand o.value_coded in (3709,1876,3639) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-02-03 09:35:06',4,'2019-02-03 09:45:13',4,0,NULL,NULL,NULL,'0494f7f1-1aad-4673-b341-507b34e995e0'),(352,'Presumptive tb HIV care SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Presumptive tb HIV care SQL\n \n \n 2019-02-03 09:48:54 UTC\n \n 2019-02-03 09:49:51 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 352\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3710 \nand o.value_coded in (1876) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-02-03 09:48:54',4,'2019-02-03 09:49:51',4,0,NULL,NULL,NULL,'f494b5e5-474b-4ef7-b987-77e6fbd1d5f9'),(353,'Diagnosed with TB and started treatment SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Diagnosed with TB and started treatment SQL\n \n \n 2019-02-03 09:53:12 UTC\n \n 2019-03-29 06:31:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 353\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id in (2237,2358) or (o.concept_id = 3789 and value_coded = 3790)) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2019-02-03 09:53:12',4,'2019-03-29 06:31:40',4,0,NULL,NULL,NULL,'e1467c7d-a287-43ab-ac11-8cc32e4a2723'),(354,'Clients with scheduled appointments SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with scheduled appointments SQL\n \n \n 2019-02-03 11:14:21 UTC\n \n 2019-03-29 07:43:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 354\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3751 \nand o.value_coded = 2146 \n\n','2019-02-03 11:14:21',4,'2019-03-29 07:43:21',4,0,NULL,NULL,NULL,'1231a6ce-dd01-49ef-b585-9dbff0c4f663'),(355,'Clients given CTX 2mnths SQL ','CTX > 60','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given CTX 2mnths SQL \n CTX > 60\n \n 2019-02-03 11:39:04 UTC\n \n 2019-02-03 11:46:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 355\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3728 \nand o.value_numeric > 31 \nand o.value_numeric < 62 \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \nand YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \nand o.voided = 0\n','2019-02-03 11:39:04',4,'2019-02-03 11:46:11',4,0,NULL,NULL,NULL,'23c9999f-939a-477e-8343-782a5e9ba2b2'),(356,'Clients given CTX 3mnths SQL ','CTX <100','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given CTX 3mnths SQL \n CTX <100\n \n 2019-02-03 11:47:00 UTC\n \n 2019-02-04 07:05:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 356\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 3728 \nand o.value_numeric <= 100 \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \nand YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \nand o.voided = 0;\n','2019-02-03 11:47:00',4,'2019-02-04 07:05:42',4,0,NULL,NULL,NULL,'9c8b100f-b3bf-469d-ae65-772cfc53c9ba'),(357,'Clients given curret and multi month CTX','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given curret and multi month CTX\n \n \n 2019-02-03 11:50:40 UTC\n \n 2019-02-03 11:53:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 357\n Clients-given-CTX-2mnths-SQL- OR Clients-given-CTX-3mnths-SQL- OR Clients-given-CTX-SQL\n \n \n Clients-given-CTX-2mnths-SQL-\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-CTX-3mnths-SQL-\n \n \n \n \n \n \n Clients-given-CTX-SQL\n \n \n \n \n \n \n','2019-02-03 11:50:40',4,'2019-02-03 11:53:12',4,0,NULL,NULL,NULL,'4a42a3bb-7340-496f-ab20-a29bb11953a7'),(358,'Newly enrolled in HIV Care,Started IPT SQL','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Newly enrolled in HIV Care,Started IPT SQL\n \n \n 2019-02-03 19:37:54 UTC\n \n 2019-02-03 20:31:26 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 358\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2227 \nand o.value_coded = 2146 \nand o.person_id in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2223 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n) \nand o.person_id not in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2249 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n) \nand o.obs_datetime >=:startDate \nand o.obs_datetime <=:endDate;\n','2019-02-03 19:37:54',4,'2019-02-03 20:31:26',4,0,NULL,NULL,NULL,'2b679b8c-165e-4dbe-8b9d-e7f685a6dae8'),(359,'Clients newly started on ART and IPT','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly started on ART and IPT\n \n \n 2019-02-03 19:59:50 UTC\n \n 2019-02-03 20:09:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 359\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2227 \nand o.value_coded = 2146 \nand o.person_id in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2249 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n) \nand o.obs_datetime >=:startDate \nand o.obs_datetime <=:endDate;\n','2019-02-03 19:59:50',4,'2019-02-03 20:09:02',4,0,NULL,NULL,NULL,'a10eb64a-10db-4cc9-a69a-e9659e634918'),(360,'pre art test new diagnosed','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n pre art test new diagnosed\n \n \n 2019-02-04 07:51:40 UTC\n \n 2019-02-04 07:56:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 360\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2222 \nand o.person_id in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2223 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n) \nand o.person_id not in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2249 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate \n) \nand o.obs_datetime >=:startDate \nand o.obs_datetime <=:endDate;\n','2019-02-04 07:51:40',4,'2019-02-04 07:56:11',4,0,NULL,NULL,NULL,'44860f5e-0ce8-466d-8c01-c2ff60737256'),(361,'pre art test newly enrolled','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n pre art test newly enrolled\n \n \n 2019-02-04 08:07:56 UTC\n \n 2019-02-04 08:14:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 361\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2223 \nand o.person_id not in \n( \nselect person_id \nfrom obs \nwhere concept_id = 2249 \n) \nand o.obs_datetime >=:startDate \nand o.obs_datetime <=:endDate;\n','2019-02-04 08:07:56',4,'2019-02-04 08:14:46',4,0,NULL,NULL,NULL,'1796e0e3-bf74-436b-8b98-4258885a7d1f'),(362,'Clients seen in previous 1 through 6 months SQL','All clients seen in previous 1 through 6 months given multi month supply','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen in previous 1 through 6 months SQL\n All clients seen in previous 1 through 6 months given multi month supply\n \n 2019-02-04 13:45:38 UTC\n \n 2019-05-09 08:18:36 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 362\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n and YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- EXCLUDE CLIENTS SEEN IN THE MONTH \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND MONTH(obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n -- EXCLUDE CLIENTS WHO TRANSFERRED OUT AND LATER CAME BACK \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n -- EXCLUDE DEAD CLIENTS \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n -- EXCLUDE MISSED APPOINTMENTS \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-04 13:45:38',4,'2019-05-09 08:18:36',4,0,NULL,NULL,NULL,'6f3593ef-a36c-4d2c-a10b-801b5bc8596b'),(363,'Clients with baseline CD4 counts 12mnths','Clients with baseline CD4 counts 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with baseline CD4 counts 12mnths\n Clients with baseline CD4 counts 12mnths\n \n 2019-02-05 08:52:36 UTC\n \n 2019-02-05 08:53:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 363\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 10:52:36',4,'2019-02-05 10:53:32',4,0,NULL,NULL,NULL,'fa2725bc-529d-43a8-8153-815da5e1cfca'),(364,'Clients with baseline CD4 counts 6mnths','Clients with baseline CD4 counts 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with baseline CD4 counts 6mnths\n Clients with baseline CD4 counts 6mnths\n \n 2019-02-05 08:54:13 UTC\n \n 2019-02-05 08:57:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 364\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 10:54:13',4,'2019-02-05 10:57:42',4,0,NULL,NULL,NULL,'f47faba9-8813-4593-8f6a-a6fe13d0e378'),(365,'Clients still on original firstline 6mnths','Clients still on original firstline 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients still on original firstline 6mnths\n Clients still on original firstline 6mnths\n \n 2019-02-05 08:59:32 UTC\n \n 2019-02-05 09:00:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 365\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 10:59:32',4,'2019-02-05 11:00:54',4,0,NULL,NULL,NULL,'8b0102ef-3c90-49f8-8d7c-f49f3af9d70e'),(366,'Clients still on original firstline 12mnths','Clients still on original firstline 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients still on original firstline 12mnths\n Clients still on original firstline 12mnths\n \n 2019-02-05 09:01:30 UTC\n \n 2019-02-05 09:02:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 366\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:01:30',4,'2019-02-05 11:02:20',4,0,NULL,NULL,NULL,'63f43e63-76e4-4d5a-b680-5e1fb48a419d'),(367,'Clients on alternative 1st line 6mnths','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on alternative 1st line 6mnths\n \n \n 2019-02-05 09:03:10 UTC\n \n 2019-02-05 09:05:30 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 367\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:03:10',4,'2019-02-05 11:05:30',4,0,NULL,NULL,NULL,'3512308a-d7a1-4695-bee3-fe760dd7da54'),(368,'Clients on alternative 1st line 12mnths','Clients on alternative 1st line 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on alternative 1st line 12mnths\n Clients on alternative 1st line 12mnths\n \n 2019-02-05 09:06:09 UTC\n \n 2019-02-05 09:06:51 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 368\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:06:09',4,'2019-02-05 11:06:51',4,0,NULL,NULL,NULL,'9ffbb2d4-8048-48bd-b851-b82557ca72d6'),(369,'Clients switched to 2nd line 6mnths','Clients switched to 2nd line 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients switched to 2nd line 6mnths\n Clients switched to 2nd line 6mnths\n \n 2019-02-05 09:08:12 UTC\n \n 2019-02-05 09:09:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 369\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:08:12',4,'2019-02-05 11:09:28',4,0,NULL,NULL,NULL,'b4c517ae-ed0c-4bf3-9f3e-8d94304b8659'),(370,'Clients switched to 2nd line 12mnths','Clients switched to 2nd line 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients switched to 2nd line 12mnths\n Clients switched to 2nd line 12mnths\n \n 2019-02-05 09:10:26 UTC\n \n 2019-02-05 09:11:30 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 370\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:10:26',4,'2019-02-05 11:11:30',4,0,NULL,NULL,NULL,'74e22b7b-d25f-4b23-864e-afd719a2ebc6'),(371,'Clients with follow up CD4 6mnths','Clients with follow up CD4 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with follow up CD4 6mnths\n Clients with follow up CD4 6mnths\n \n 2019-02-05 09:12:07 UTC\n \n 2019-02-05 09:15:04 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 371\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:12:07',4,'2019-02-05 11:15:04',4,0,NULL,NULL,NULL,'7b66107d-e6fb-48a3-ad99-d6a81b1269d9'),(372,'Clients with follow up CD4 12mnths','Clients with follow up CD4 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with follow up CD4 12mnths\n Clients with follow up CD4 12mnths\n \n 2019-02-05 09:15:54 UTC\n \n 2019-02-05 09:17:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 372\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:15:54',4,'2019-02-05 11:17:58',4,0,NULL,NULL,NULL,'e1ae9120-353f-4c65-85b9-184be1542760'),(373,'Clients with follow up Viral Load 6mnths','Clients with follow up Viral Load 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with follow up Viral Load 6mnths\n Clients with follow up Viral Load 6mnths\n \n 2019-02-05 09:19:41 UTC\n \n 2019-02-05 09:21:35 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 373\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:19:41',4,'2019-02-05 11:21:35',4,0,NULL,NULL,NULL,'5aa44431-8661-4c1e-92fe-8c117831f418'),(374,'Clients with follow up Viral Load 12mnths','Clients with follow up Viral Load 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with follow up Viral Load 12mnths\n Clients with follow up Viral Load 12mnths\n \n 2019-02-05 09:22:53 UTC\n \n 2019-02-05 09:25:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 374\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:22:53',4,'2019-02-05 11:25:34',4,0,NULL,NULL,NULL,'eb510470-5a6d-45a4-bdeb-6d905570bd0d'),(375,'Clients lost to follow up 6mnths','Clients lost to follow up 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients lost to follow up 6mnths\n Clients lost to follow up 6mnths\n \n 2019-02-05 09:26:21 UTC\n \n 2019-02-05 09:28:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 375\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:26:21',4,'2019-02-05 11:28:11',4,0,NULL,NULL,NULL,'3efb72d7-384b-4492-8ef5-1e158fecae2a'),(376,'Clients lost to follow up 12mnths','Clients lost to follow up 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients lost to follow up 12mnths\n Clients lost to follow up 12mnths\n \n 2019-02-05 09:28:53 UTC\n \n 2019-02-05 09:31:22 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 376\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:28:53',4,'2019-02-05 11:31:22',4,0,NULL,NULL,NULL,'3e0765e1-b5cc-43ca-bc89-4585f5e9e7fb'),(377,'Clients dead 6mnths','Clients dead 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients dead 6mnths\n Clients dead 6mnths\n \n 2019-02-05 09:32:07 UTC\n \n 2019-02-05 09:33:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 377\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:32:07',4,'2019-02-05 11:33:08',4,0,NULL,NULL,NULL,'1f29b6b1-21b8-4931-9a38-a1cefbc302d3'),(378,'Clients dead 12 mnths','Clients dead 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients dead 12 mnths\n Clients dead 12mnths\n \n 2019-02-05 09:33:37 UTC\n \n 2019-02-05 09:34:30 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 378\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:33:37',4,'2019-02-05 11:34:30',4,0,NULL,NULL,NULL,'991435d7-ccd5-4e80-882f-bb8e3bf4f8b8'),(379,'Clients stopped 6mnths','Clients stopped 6mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients stopped 6mnths\n Clients stopped 6mnths\n \n 2019-02-05 09:35:01 UTC\n \n 2019-02-05 09:36:07 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 379\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:35:01',4,'2019-02-05 11:36:07',4,0,NULL,NULL,NULL,'c72f56a8-b67f-43ad-a2e4-a10be338e482'),(380,'Clients stopped 12 mnths','Clients stopped 12mnths','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients stopped 12 mnths\n Clients stopped 12mnths\n \n 2019-02-05 09:36:39 UTC\n \n 2019-02-05 09:37:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 380\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-02-05 11:36:39',4,'2019-02-05 11:37:32',4,0,NULL,NULL,NULL,'8effc480-73a0-4806-9555-44ac56e09d6e'),(382,'Clients newly initiated 1c','1c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1c\n 1c\n \n 2019-02-06 15:02:44 UTC\n \n 2019-05-08 13:22:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 382\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2201 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:02:44',4,'2019-05-08 13:22:17',4,0,NULL,NULL,NULL,'eb143dfc-1a1c-4e1c-b2d9-243ca86dd111'),(383,'Clients newly initiated 1d ','1d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1d \n 1d\n \n 2019-02-06 15:13:24 UTC\n \n 2019-05-08 13:23:34 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 383\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2203 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:13:24',4,'2019-05-08 13:23:34',4,0,NULL,NULL,NULL,'3d4080ed-278a-4c48-a9a9-4d1c9359b3c5'),(384,'Clients newly initiated 1e','1e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1e\n 1e\n \n 2019-02-06 15:15:37 UTC\n \n 2019-05-08 13:24:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 384\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2205 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:15:37',4,'2019-05-08 13:24:53',4,0,NULL,NULL,NULL,'d1b27fb7-6798-4562-bbe2-7d2d71ccba59'),(385,'Clients newly initiated 1f','1f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1f\n 1f\n \n 2019-02-06 15:16:38 UTC\n \n 2019-05-09 08:56:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 385\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND MONTH(o.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(o.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2207 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND MONTH(os.obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:16:38',4,'2019-05-09 08:56:42',4,0,NULL,NULL,NULL,'ce0026fa-a5a0-4729-9442-76d4e651f94a'),(386,'Clients newly initiated 1g ','1g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1g \n 1g\n \n 2019-02-06 15:18:38 UTC\n \n 2019-05-08 13:26:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 386\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3672 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:18:38',4,'2019-05-08 13:26:32',4,0,NULL,NULL,NULL,'05918dc5-51c4-4556-be64-efa548ddc957'),(387,'Clients newly initiated 1h','1h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 1h\n 1h\n \n 2019-02-06 15:20:41 UTC\n \n 2019-05-08 13:27:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 387\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3673 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:20:41',4,'2019-05-08 13:27:19',4,0,NULL,NULL,NULL,'5147b850-5fee-42d3-b2bf-0c074c9eca96'),(388,'Clients newly initiated 2c','2c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2c\n 2c\n \n 2019-02-06 15:23:30 UTC\n \n 2019-05-08 13:31:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 388\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2210 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:23:30',4,'2019-05-08 13:31:46',4,0,NULL,NULL,NULL,'14d94e25-3c55-4434-b0ad-64e23f6a5404'),(389,'Clients newly initiated 2d','2d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2d\n 2d\n \n 2019-02-06 15:25:19 UTC\n \n 2019-05-08 13:32:38 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 389\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2209 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:25:19',4,'2019-05-08 13:32:38',4,0,NULL,NULL,NULL,'03f49548-9c17-4f5f-94d9-4e616d2758b8'),(390,'Clients newly initiated 2e','2e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2e\n 2e\n \n 2019-02-06 15:26:27 UTC\n \n 2019-05-08 13:34:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 390\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3674 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:26:27',4,'2019-05-08 13:34:31',4,0,NULL,NULL,NULL,'db68cb15-10f6-4f65-bee5-3c69d079c441'),(391,'Clients newly initiated 2f ','2f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2f \n 2f\n \n 2019-02-06 15:27:26 UTC\n \n 2019-05-08 13:35:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 391\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3675 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:27:26',4,'2019-05-08 13:35:21',4,0,NULL,NULL,NULL,'d3645a04-6157-4855-b645-d19c73b2827c'),(392,'Clients newly initiated 2g','2g','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2g\n 2g\n \n 2019-02-06 15:28:29 UTC\n \n 2019-05-08 13:36:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 392\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3676 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:28:29',4,'2019-05-08 13:36:02',4,0,NULL,NULL,NULL,'0d4335ea-74f0-4cca-8ed7-ca4fa033880e'),(393,'Clients newly initiated 2h','2h','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 2h\n 2h\n \n 2019-02-06 15:29:20 UTC\n \n 2019-05-08 13:36:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 393\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3677 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-06 15:29:20',4,'2019-05-08 13:36:39',4,0,NULL,NULL,NULL,'4d44a02b-fe31-450d-887a-c5e769a13cb1'),(394,'Clients newly initiated 3a','3a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 3a\n 3a\n \n 2019-02-07 08:20:56 UTC\n \n 2019-05-08 13:40:48 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 394\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3683 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 08:20:56',4,'2019-05-08 13:40:48',4,0,NULL,NULL,NULL,'995ebf26-1945-4e6a-b041-c401c06d4b90'),(395,'Clients newly initiated 3b','3b','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 3b\n 3b\n \n 2019-02-07 08:21:56 UTC\n \n 2019-05-08 13:44:16 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 395\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3684 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 08:21:56',4,'2019-05-08 13:44:16',4,0,NULL,NULL,NULL,'b447da00-0b30-4205-8027-ebe5951ed320'),(396,'Clients newly initiated 4c','AZT-3TC-NVP(paeds)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 4c\n AZT-3TC-NVP(paeds)\n \n 2019-02-07 09:54:16 UTC\n \n 2019-05-08 13:28:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 396\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 09:54:16',4,'2019-05-08 13:28:18',4,0,NULL,NULL,NULL,'b6d6b5bb-86ff-4197-b209-ae80c58dcc00'),(397,'Clients newly initiated 4d','AZT-3TC-EFV(paeds)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 4d\n AZT-3TC-EFV(paeds)\n \n 2019-02-07 10:07:11 UTC\n \n 2019-05-07 13:10:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 397\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 10:07:11',4,'2019-05-07 13:10:52',4,0,NULL,NULL,NULL,'d34d4207-bf41-4b95-962e-8feb144df83a'),(398,'Clients newly initiated 4e','ABC-3TC-NVP(paeds)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 4e\n ABC-3TC-NVP(paeds)\n \n 2019-02-07 10:09:48 UTC\n \n 2019-05-08 13:30:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 398\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 10:09:48',4,'2019-05-08 13:30:06',4,0,NULL,NULL,NULL,'9e9b9e5f-f996-4ef7-8bd9-0034fa45566f'),(399,'Clients newly initiated 4f','ABC-3TC-EFV(paeds)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 4f\n ABC-3TC-EFV(paeds)\n \n 2019-02-07 10:13:14 UTC\n \n 2019-05-07 13:12:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 399\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 10:13:14',4,'2019-05-07 13:12:32',4,0,NULL,NULL,NULL,'405a0c1d-1163-40c3-80c5-a509d2fa8bcb'),(400,'Clients seen 4c','4c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 4c\n 4c\n \n 2019-02-07 10:22:40 UTC\n \n 2019-05-08 09:05:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 400\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 10:22:40',4,'2019-05-08 09:05:39',4,0,NULL,NULL,NULL,'568c8c09-01b5-4a1c-8892-f558350b2abf'),(401,'Clients seen 4d','4d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 4d\n 4d\n \n 2019-02-07 10:24:59 UTC\n \n 2019-05-08 09:53:30 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 401\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 10:24:59',4,'2019-05-08 09:53:30',4,0,NULL,NULL,NULL,'df3b2c47-8c25-4a90-a9cf-4a98a52d87de'),(402,'Clients seen 4e','4e','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 4e\n 4e\n \n 2019-02-07 10:28:19 UTC\n \n 2019-05-08 09:54:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 402\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 10:28:19',4,'2019-05-08 09:54:32',4,0,NULL,NULL,NULL,'37ad57a6-6821-4f3b-bc29-05ab90bc774a'),(403,'Clients seen 4f','4f','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 4f\n 4f\n \n 2019-02-07 10:29:37 UTC\n \n 2019-05-08 09:55:25 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 403\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 10:29:37',4,'2019-05-08 09:55:25',4,0,NULL,NULL,NULL,'ad3ba0a3-3589-4b24-8645-ea12a81be5bf'),(404,'Clients seen 6a','6a RAL-EFV-LPV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 6a\n 6a RAL-EFV-LPV\n \n 2019-02-07 10:39:49 UTC\n \n 2019-05-08 10:48:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 404\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 10:39:49',4,'2019-05-08 10:48:52',4,0,NULL,NULL,NULL,'a20a7a05-5360-43b9-b48e-81294d4f06e9'),(405,'Clients newly initiated 6a','6a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 6a\n 6a\n \n 2019-02-07 10:46:15 UTC\n \n 2019-05-08 13:46:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 405\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 10:46:15',4,'2019-05-08 13:46:53',4,0,NULL,NULL,NULL,'03357062-6026-4b76-8a66-ce3f2b7f5641'),(406,'Clients newly initiated 3c','3c as 6a under dhis2 adults 3rd line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 3c\n 3c as 6a under dhis2 adults 3rd line\n \n 2019-02-07 11:02:00 UTC\n \n 2019-05-08 13:45:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 406\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 11:02:00',4,'2019-05-08 13:45:08',4,0,NULL,NULL,NULL,'354eee1a-35a6-473c-9029-4e4e66042646'),(407,'Clients seen 3c','3c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 3c\n 3c\n \n 2019-02-07 13:35:11 UTC\n \n 2019-05-08 10:38:50 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 407\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 13:35:11',4,'2019-05-08 10:38:50',4,0,NULL,NULL,NULL,'604a75e1-4aac-413b-be90-3c3f5f0e1506'),(408,'Clients multi month 3c','3c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 3c\n 3c\n \n 2019-02-07 13:57:32 UTC\n \n 2019-05-09 09:40:39 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 408\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3685 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 13:57:32',4,'2019-05-09 09:40:39',4,0,NULL,NULL,NULL,'30fa519d-6d87-453f-a68f-fbfe97d650b9'),(409,'Clients multi month 4c','4c','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 4c\n 4c\n \n 2019-02-07 14:01:00 UTC\n \n 2019-05-09 09:19:04 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 409\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2202 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:01:00',4,'2019-05-09 09:19:04',4,0,NULL,NULL,NULL,'537bfeb1-7f85-4387-81c1-79f35d6b8193'),(410,'Clients multi month 4d','4d','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 4d\n 4d\n \n 2019-02-07 14:02:06 UTC\n \n 2019-05-09 09:20:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 410\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 2204 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:02:06',4,'2019-05-09 09:20:44',4,0,NULL,NULL,NULL,'306b1f50-9652-42e5-9f9f-bacb1a1f3ed1'),(411,'Clients multi month 4e','4e ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 4e\n 4e \n \n 2019-02-07 14:05:31 UTC\n \n 2019-05-09 09:25:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 411\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3679 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:05:31',4,'2019-05-09 09:25:11',4,0,NULL,NULL,NULL,'7bd605b0-4f07-4730-b79e-ea885c4dc22a'),(412,'Clients multi month 4f','4f ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 4f\n 4f \n \n 2019-02-07 14:09:36 UTC\n \n 2019-05-09 09:26:29 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 412\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3680 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:09:36',4,'2019-05-09 09:26:29',4,0,NULL,NULL,NULL,'61c10574-82e0-409f-b573-2ed12e5234ef'),(413,'Clients multi month 5a','5a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 5a\n 5a\n \n 2019-02-07 14:14:11 UTC\n \n 2019-05-09 09:35:11 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 413\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:14:11',4,'2019-05-09 09:35:11',4,0,NULL,NULL,NULL,'35491dfa-1e7f-4a01-9c4c-3d741887d1fc'),(414,'Clients multi month 5b','5b','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 5b\n 5b\n \n 2019-02-07 14:16:20 UTC\n \n 2019-05-09 09:36:43 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 414\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 14:16:20',4,'2019-05-09 09:36:43',4,0,NULL,NULL,NULL,'b828f7ad-12f5-42fa-9217-e1deb46fb67b'),(415,'Clients seen 5a','5a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 5a\n 5a\n \n 2019-02-07 14:18:43 UTC\n \n 2019-05-08 10:18:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 415\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 14:18:43',4,'2019-05-08 10:18:10',4,0,NULL,NULL,NULL,'79aeb902-4831-4559-9766-1fcfe976732d'),(416,'Clients seen 5b','5b 2 or 3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients seen 5b\n 5b 2 or 3mnths\n \n 2019-02-07 14:19:37 UTC\n \n 2019-05-08 10:21:05 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 416\n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n inner join location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \nWHERE (o.location_id =:location or parent_location =:location) \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND obs_datetime between :startDate AND :endDate \n) \nand patient.patient_id not in -- CLIENTS NEWLY INITIATED ON ART \n (select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n and patient.patient_id not in( \n select distinct os.person_id from obs os \n where os.concept_id = 2396 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND :endDate) \n \n ) \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n (select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \n \nAND patient.patient_id not in \n ( \n select distinct person_id \n from person \n where death_date <= :endDate \n and dead = 1 \n ) \n \n \n','2019-02-07 14:19:37',4,'2019-05-08 10:21:05',4,0,NULL,NULL,NULL,'08e17546-29ca-41a6-8457-faa0da7126d1'),(417,'Clients given 3c current and multi month','3c 1-3months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 3c current and multi month\n 3c 1-3months\n \n 2019-02-07 14:22:10 UTC\n \n 2019-04-01 08:53:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 417\n arv-regimen-3c-SQL OR Clients-given-3mnths-3c-in-previous-2mnths OR Clients-given-2-or-3mnths-3c-in-previous-1mnth\n \n \n arv-regimen-3c-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-3c-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-3c-in-previous-1mnth\n \n \n \n \n \n \n','2019-02-07 14:22:10',4,'2019-04-01 08:53:18',4,0,NULL,NULL,NULL,'c90d4873-21fb-444f-94f3-0c29f7e1c723'),(418,'Clients given 4c current and multi month','4c 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4c current and multi month\n 4c 1-3mnths\n \n 2019-02-07 14:28:09 UTC\n \n 2019-02-07 14:32:33 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 418\n Clients-given-3mnths-4c-in-previous-2mnths OR ARV-Regimen-4c-SQL OR Clients-given-2-or-3mnths-4c-in-previous-1mnth\n \n \n Clients-given-3mnths-4c-in-previous-2mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ARV-Regimen-4c-SQL\n \n \n \n \n \n \n Clients-given-2-or-3mnths-4c-in-previous-1mnth\n \n \n \n \n \n \n','2019-02-07 14:28:09',4,'2019-02-07 14:32:33',4,0,NULL,NULL,NULL,'b734b3a4-c03d-4870-aee6-ae72d7cd09a3'),(419,'Clients given 4d current and multi month','4d 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4d current and multi month\n 4d 1-3mnths\n \n 2019-02-07 14:33:46 UTC\n \n 2019-02-07 14:47:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 419\n arv-regimen-4d-SQL OR Clients-given-3mnths-4d-in-previous-2mnths OR Clients-given-2-or-3mnths-4d-in-previous-1mnth\n \n \n arv-regimen-4d-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-4d-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-4d-in-previous-1mnth\n \n \n \n \n \n \n','2019-02-07 14:33:46',4,'2019-02-07 14:47:31',4,0,NULL,NULL,NULL,'6fd05fe9-d0f9-4df1-af32-f779445dfa47'),(420,'Clients given 4e current and multi month','4e 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4e current and multi month\n 4e 1-3mnths\n \n 2019-02-07 14:48:47 UTC\n \n 2019-02-07 14:52:55 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 420\n Clients-given-3mnths-4e-in-previous-2mnths OR ARV-regimen-4e-SQL OR Clients-given-2-or-3mnths-4e-in-previous-1mnth\n \n \n Clients-given-3mnths-4e-in-previous-2mnths\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ARV-regimen-4e-SQL\n \n \n \n \n \n \n Clients-given-2-or-3mnths-4e-in-previous-1mnth\n \n \n \n \n \n \n','2019-02-07 14:48:47',4,'2019-02-07 14:52:55',4,0,NULL,NULL,NULL,'4c813098-94b5-4e1d-8e8a-baeccd78bad2'),(421,'Clients given 4f current and multi month','4f 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4f current and multi month\n 4f 1-3mnths\n \n 2019-02-07 14:53:34 UTC\n \n 2019-02-07 14:59:42 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 421\n ARV-Regimen-4f-SQL OR Clients-given-3mnths-4f-in-previous-2mnths OR Clients-given-2-or-3mnths-4f-in-previous-1mnth\n \n \n ARV-Regimen-4f-SQL\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n Clients-given-3mnths-4f-in-previous-2mnths\n \n \n \n \n \n \n Clients-given-2-or-3mnths-4f-in-previous-1mnth\n \n \n \n \n \n \n','2019-02-07 14:53:34',4,'2019-02-07 14:59:42',4,0,NULL,NULL,NULL,'33d92626-132a-476e-8c20-0738c0517731'),(422,'Clients newly initiated 5a','5a AZT-3TC-LPV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 5a\n 5a AZT-3TC-LPV\n \n 2019-02-07 15:02:48 UTC\n \n 2019-05-08 13:37:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 422\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3681 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 15:02:48',4,'2019-05-08 13:37:28',4,0,NULL,NULL,NULL,'156bbd43-238b-4040-9b02-9f9ff5cd873b'),(423,'Clients newly initiated 5b','ABC-3TC-LPV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients newly initiated 5b\n ABC-3TC-LPV\n \n 2019-02-07 15:04:01 UTC\n \n 2019-05-08 13:38:43 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 423\n select distinct o.person_id \nfrom obs o \n inner join location l on o.location_id = l.location_id \n INNER JOIN person ON person.person_id = o.person_id \n \nwhere (o.location_id =:location or parent_location =:location) \n AND o.concept_id = 2249 \n AND o.value_datetime BETWEEN :startDate AND :endDate \n AND o.voided = 0 \n \nand o.person_id in( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3682 \n AND obs_datetime between :startDate AND :endDate \n) \n \nAND o.person_id not in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3634 AND os.value_coded = 2095 \n AND os.obs_datetime BETWEEN :startDate AND :endDate \n ) \nAND o.person_id not in \n ( \n select distinct person_id \n from person \n where death_date < :endDate \n and dead = 1 \n ) \nAND o.person_id not in \n ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime <= :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate \n ) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND person.voided = 0 \n; \n\n','2019-02-07 15:04:01',4,'2019-05-08 13:38:43',4,0,NULL,NULL,NULL,'d7833d79-8b04-4eac-88b8-0331a382d3b2'),(424,'Clients given 5a current and multi month','5a 1-3 mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5a current and multi month\n 5a 1-3 mnths\n \n 2019-02-07 15:09:01 UTC\n \n 2019-04-01 09:08:15 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 424\n Clients-given-2-or-3mnths-5a-in-previous-1mnth OR ARV-Regimen-5a\n \n \n Clients-given-2-or-3mnths-5a-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ARV-Regimen-5a\n \n \n \n \n \n \n Clients-given-3mnths-5a-in-previous-2mnths\n \n \n \n \n \n \n','2019-02-07 15:09:01',4,'2019-04-01 09:08:15',4,0,NULL,NULL,NULL,'e5755cdd-222c-4005-b535-2b7b2027a776'),(425,'Clients given 5a current and multi month','5a 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5a current and multi month\n 5a 1-3mnths\n \n 2019-02-07 15:16:38 UTC\n \n 2019-02-07 15:17:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 425\n select distinct o.person_id \nfrom obs o \ninner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 2250 \nand o.value_coded = 3681 \nand o.voided = 0 \nand obs_datetime between :startDate and :endDate;\n','2019-02-07 15:16:38',4,'2019-02-07 15:17:59',4,0,NULL,NULL,NULL,'f69352a8-954a-409e-9bcc-72c382522568'),(426,'Clients given 5b current and multi month','5b 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5b current and multi month\n 5b 1-3mnths\n \n 2019-02-07 15:20:08 UTC\n \n 2019-02-07 15:22:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 426\n Clients-given-2-or-3mnths-5b-in-previous-1mnth OR ARV-Regimen-5b OR Clients-given-3mnths-5b-in-previous-2mnths\n \n \n Clients-given-2-or-3mnths-5b-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n ARV-Regimen-5b\n \n \n \n \n \n \n Clients-given-3mnths-5b-in-previous-2mnths\n \n \n \n \n \n \n','2019-02-07 15:20:08',4,'2019-02-07 15:22:53',4,0,NULL,NULL,NULL,'776337cf-5614-4b95-9c43-b322b1a2bd3b'),(427,'Clients given 6a current and multi month','6a 1-3mnths','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6a current and multi month\n 6a 1-3mnths\n \n 2019-02-07 15:24:04 UTC\n \n 2019-04-01 09:10:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 427\n Clients-given-2-or-3mnths-6a-in-previous-1mnth OR arv-regimen-6a-SQL OR Clients-given-3mnths-6a-in-previous-2mnths\n \n \n Clients-given-2-or-3mnths-6a-in-previous-1mnth\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n arv-regimen-6a-SQL\n \n \n \n \n \n \n Clients-given-3mnths-6a-in-previous-2mnths\n \n \n \n \n \n \n','2019-02-07 15:24:04',4,'2019-04-01 09:10:52',4,0,NULL,NULL,NULL,'dba3de7f-67e9-4b23-b63e-7c58c308165d'),(428,'Clients multi month 6a','6a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients multi month 6a\n 6a\n \n 2019-02-07 15:28:03 UTC\n \n 2019-05-09 09:42:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 428\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176,4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177,4245,4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONTHS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245, 4246 ,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246,4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n ) \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4175)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4176)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n ) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4177)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n ) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4245)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \nAND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n ) \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4246)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n ) \n \n ) \n \n \n \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded in (4247)) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location )) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location ) \n AND o.person_id in ( \n select distinct person_id \n from obs \n -- All patients given 1F regimen during a particular period \n where concept_id = 2250 and value_coded = 3686 \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n ) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id =:location or parent_location =:location )) \nand Id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND :endDate) \n AND patient.voided = 0 AND o.voided = 0) \nAND Id not in ( \n \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < :endDate and person_id not in \n (select person_id from \n (select person_id who, max(value_datetime) latest \n from obs \n where concept_ID = 2266 \n and obs_datetime <= :endDate \n group by person_id) one, \n \n ( \n select person_id,obs_datetime \n from obs \n where concept_id = 3843 \n and obs_datetime <= :endDate) two \n \n where who = person_id \n and DATE(obs_datetime) > DATE(latest)) \n ) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate,interval 1 DAY) \n and dead = 1 \n ) \nAND Id not in( \n select distinct Id from \n (select distinct person_id as Id, max(value_datetime), datediff(CAST(:endDate AS DATE), max(value_datetime)) AS Num_Days \n FROM obs \n WHERE concept_id = 3752 \n group by person_id \n HAVING Num_Days >= 7) as finalised \n )\n','2019-02-07 15:28:03',4,'2019-05-09 09:42:46',4,0,NULL,NULL,NULL,'53316cf7-0a79-49e4-9dd4-5f00f847b3b1'),(429,'TESTING','ALL TESTS','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TESTING\n ALL TESTS\n \n 2019-02-12 09:23:54 UTC\n \n 2019-02-19 10:51:01 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 429\n select distinct person_id \nfrom obs \nwhere concept_id = 3843 \nand value_coded in (3841) \nAND (DATE(obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)); \n \n\n','2019-02-12 09:23:54',4,'2019-02-19 10:51:01',4,0,NULL,NULL,NULL,'0e162295-6055-46ea-8c17-5fca300d0054'),(430,'testing','n/a','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n testing\n n/a\n \n 2019-02-13 14:14:05 UTC\n \n 2019-02-13 14:18:58 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 430\n','2019-02-13 14:14:05',4,'2019-02-13 14:18:58',4,0,NULL,NULL,NULL,'dd019ae7-3549-4fd7-b3ee-b7ac841707f2'),(431,'lets see','N/A','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n lets see\n N/A\n \n 2019-02-15 10:05:49 UTC\n \n 2019-02-15 12:46:15 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 431\n SELECT DISTINCT Id \nFROM \n \n( \nselect distinct patient.patient_id AS Id \n \n from obs o \n \n \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n and YEAR(o.obs_datetime) = YEAR(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n AND patient.voided = 0 \n AND o.voided = 0 \n AND (o.concept_id = 4174 and (o.value_coded in (4176,4177,4245,4246,4247))) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \n \n \n \nUNION \n \nselect distinct patient.patient_id AS Id \n \n from obs o \n \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4175 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD('2019-01-31', INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 \n AND DATEDIFF(os.value_datetime, '2019-01-31') BETWEEN 0 AND 28 \n \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n \n \n \n) AS ARTCurrent_PrevMonths \n \nWHERE Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN '2019-01-01' AND addDate('2019-01-31', 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nWHERE patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \nINNER JOIN patient ON o.person_id = patient.patient_id \nAND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN '2019-01-01' AND addDate('2019-01-31', 1)) \nAND patient.voided = 0 AND o.voided = 0 \n \nAND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN '2019-01-01' AND addDate('2019-01-31', 1) \n \n ) \n ))\n','2019-02-15 10:05:49',4,'2019-02-15 12:46:15',4,0,NULL,NULL,NULL,'82d59123-ac4a-4c14-8218-0738d4ade605'),(432,'Clients given 4mnths 1f in previous 3mnths','1f 4mnths ago','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4mnths 1f in previous 3mnths\n 1f 4mnths ago\n \n 2019-02-19 09:39:58 UTC\n \n 2019-02-19 09:58:09 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 432\n select distinct o.person_id \nfrom obs o \ninner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 4174 and o.value_coded in (4245,4246) \n \nand o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2250 \n and os.value_coded = 2207 \n and MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n and YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n) \n \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \nand YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \nand o.voided = 0\n','2019-02-19 09:39:58',4,'2019-02-19 09:58:09',4,0,NULL,NULL,NULL,'c2adcb8a-c735-4860-a9d8-9509ac29d363'),(433,'Clients given 5mnths 1f in previous m4nths','1f 5mnths ago','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5mnths 1f in previous m4nths\n 1f 5mnths ago\n \n 2019-02-19 09:59:13 UTC\n \n 2019-02-19 10:02:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 433\n select distinct o.person_id \nfrom obs o \ninner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand o.concept_id = 4174 and o.value_coded in (4246) \n \nand o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2250 \n and os.value_coded = 2207 \n and MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n and YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n) \n \nand MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \nand YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \nand o.voided = 0\n','2019-02-19 09:59:13',4,'2019-02-19 10:02:40',4,0,NULL,NULL,NULL,'809ab22c-a795-46ba-b8af-1a21a51551e4'),(434,'Master HIVTC report','all sections from 1-12 of the DHIS 2 report','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Master HIVTC report\n all sections from 1-12 of the DHIS 2 report\n \n 2019-02-21 14:56:28 UTC\n \n 2019-02-21 14:56:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 434\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-02-21 14:56:28',4,'2019-02-21 14:56:31',4,0,NULL,NULL,NULL,'b9d1fa17-1211-4995-bcb6-92765303175d'),(435,'Master HIVTC report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Master HIVTC report Data Set\n \n 2019-02-21 14:56:31 UTC\n \n 2019-03-01 10:34:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 435\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n \n \n DM_Weight_Updated\n \n \n \n \n \n \n \n \n 1ST4c3.9F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 1st4c3.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 03to3.9kg\n \n \n \n \n \n 1st4c5.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 1st4c5.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 04to5.9kg\n \n \n \n \n \n 1st4d13.9F\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 1st4d13.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 10to13.9kg\n \n \n \n \n \n 1st4d19.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 1st4d19.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 14to19.9kg\n \n \n \n \n \n 1st4d24.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 1st4d24.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 20to24.9kg\n \n \n \n \n \n 1st4d25F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 1st4d25M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 25+kg\n \n \n \n \n \n 1st4d3.9F\n \n \n \n \n \n \n 1st4d3.9M\n \n \n \n \n \n \n 1st4d5.9F\n \n \n \n \n \n \n 1st4d5.9M\n \n \n \n \n \n \n 1st4d9.9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 1st4d9.9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Children 0to14\n \n \n DM_Weight_Updated\n 06to9.9kg\n \n \n \n \n \n 1stlineCF\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Adults\n \n \n \n \n \n 1stlineCM\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Adults\n \n \n \n \n \n 1stlineDF\n \n \n \n \n \n \n \n \n \n 1stlineDM\n \n \n \n \n \n \n 1stlineEF\n \n \n \n \n \n \n \n \n \n 1stlineEM\n \n \n \n \n \n \n 1stlineFF\n \n \n \n \n \n \n \n \n \n 1stlineFM\n \n \n \n \n \n \n 1stlineGF\n \n \n \n \n \n \n \n \n \n 1stlineGM\n \n \n \n \n \n \n 1stlineHF\n \n \n \n \n \n \n \n \n \n 1stlineHM\n \n \n \n \n \n \n','2019-02-21 14:56:31',4,'2019-03-01 10:34:21',4,0,NULL,NULL,NULL,'41857c4c-d7eb-4ab2-8266-3bb1cdb084f0'),(436,'clients seen 2months ago','2mnths+','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 2months ago\n 2mnths+\n \n 2019-02-27 10:29:03 UTC\n \n 2019-02-27 10:29:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 436\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 1 MONTH AND WAS GIVEN (2, 3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n and YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and (o.value_coded = 4176 or o.value_coded = 4177 or o.value_coded = 4245 or o.value_coded = 4246 or o.value_coded = 4247)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4175 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -1 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4176 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \n \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nand patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1) \n \n ) \n ) \n WHERE (o.location_id =:location or parent_location =:location) \n)\n','2019-02-27 10:29:03',4,'2019-02-27 10:29:19',4,0,NULL,NULL,NULL,'a5bf5837-dafc-404e-9eb8-77501187ac6f'),(437,'clients seen 3months ago','3mnths+','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 3months ago\n 3mnths+\n \n 2019-02-27 10:30:44 UTC\n \n 2019-02-27 10:34:49 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 437\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 2 MONTHS AND WAS GIVEN (3, 4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -2 MONTH)) \n AND patient.voided = 0 \n AND o.voided = 0 \n AND o.concept_id = 4174 \n and (o.value_coded = 4177 or o.value_coded = 4245 or o.value_coded = 4246 or o.value_coded = 4247) \n INNER JOIN person ON person.person_id = patient.patient_id \n AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4177 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nand patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1) \n \n ) \n ) \n WHERE (o.location_id =:location or parent_location =:location) \n)\n','2019-02-27 10:30:44',4,'2019-02-27 10:34:49',4,0,NULL,NULL,NULL,'21c776ca-7cbc-4388-a623-06e351469a20'),(438,'clients seen 4months ago','4mnths+','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 4months ago\n 4mnths+\n \n 2019-02-27 10:37:22 UTC\n \n 2019-02-27 10:37:36 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 438\n SELECT DISTINCT Id \nFROM \n( \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 3 MONTHS AND WAS GIVEN (4, 5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -3 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and (o.value_coded = 4245 or o.value_coded = 4246 or o.value_coded = 4247) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4245 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nand patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1) \n \n ) \n ) \n WHERE (o.location_id =:location or parent_location =:location) \n)\n','2019-02-27 10:37:22',4,'2019-02-27 10:37:36',4,0,NULL,NULL,NULL,'41a0d5e0-f46f-4cd7-a361-ea6ea3b5933e'),(439,'clients seen 5mnths ago','5mnths +','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 5mnths ago\n 5mnths +\n \n 2019-02-27 10:45:50 UTC\n \n 2019-02-27 10:47:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 439\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 4 MONTHS AND WAS GIVEN (5, 6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -4 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and (o.value_coded = 4246 or o.value_coded = 4247) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4246 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nand patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1) \n \n ) \n ) \n WHERE (o.location_id =:location or parent_location =:location) \n)\n','2019-02-27 10:45:50',4,'2019-02-27 10:47:06',4,0,NULL,NULL,NULL,'7cef2932-533c-42ca-96fa-90f10ea3badb'),(440,'clients seen 6months ago','6mnths +','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 6months ago\n 6mnths +\n \n 2019-02-27 10:49:11 UTC\n \n 2019-02-27 10:50:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 440\n SELECT DISTINCT Id \nFROM \n( \n \n(select distinct patient.patient_id AS Id \n \n from obs o \n -- CAME IN PREVIOUS 5 MONTHS AND WAS GIVEN (6 MONHTS SUPPLY OF DRUGS) \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -5 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \nUNION \n \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 4174 and o.value_coded = 4247 \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where \n MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -6 MONTH)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id =:location or parent_location =:location)) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n WHERE (o.location_id =:location or parent_location =:location) \n ) \n) AS ARTCurrent_PrevMonths \n \nWHERE ARTCurrent_PrevMonths.Id not in ( \n select distinct patient.patient_id \nfrom obs o \n-- CLIENTS SEEN FOR ART \n INNER JOIN location l on o.location_id = l.location_id \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 3843 AND o.value_coded = 3841 OR o.value_coded = 3842) \n AND (DATE(o.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id \n AND patient_identifier.identifier_type = 3 \nand patient.patient_id not in ( \n select distinct patient.patient_id AS Id \n from obs o \n -- CLIENTS NEWLY INITIATED ON ART \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND (o.concept_id = 2249 AND DATE(o.value_datetime) BETWEEN :startDate AND addDate(:endDate, 1)) \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id not in ( \n select distinct os.person_id from obs os \n where os.concept_id = 3634 \n AND os.value_coded = 2095 \n AND DATE(os.obs_datetime) BETWEEN :startDate AND addDate(:endDate, 1) \n \n ) \n ) \n WHERE (o.location_id =:location or parent_location =:location) \n)\n','2019-02-27 10:49:11',4,'2019-02-27 10:50:14',4,0,NULL,NULL,NULL,'5f4b2a04-8b0c-4add-b7c9-7b70515f603d'),(441,'clients seen 2 to 6mnths ago','composition','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n clients seen 2 to 6mnths ago\n composition\n \n 2019-02-27 10:59:28 UTC\n \n 2019-02-27 14:18:26 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 441\n clients-seen-3months-ago OR clients-seen-2months-ago\n \n \n clients-seen-3months-ago\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-02-27 10:59:28',4,'2019-02-27 14:18:26',4,0,NULL,NULL,NULL,'8f521b14-95ad-4e4c-b03d-10c0b7b3a0aa'),(442,'Clients on ARV who died','Clients on ARV who died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients on ARV who died\n Clients on ARV who died\n \n 2019-03-29 06:48:55 UTC\n \n 2019-03-29 06:55:51 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 442\n select person_id \nfrom person \nwhere death_date <= :endDate \nand dead = 1 \nand person_id in \n ( \n select person_id \n from obs \n where concept_id = 2249 \n )\n','2019-03-29 06:48:55',4,'2019-03-29 06:55:51',4,0,NULL,NULL,NULL,'914d4f42-66e2-4fce-b1da-d3fce7f95f15'),(443,'Clients given 2weeks ARV','Clients given 2weeks ARV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 2weeks ARV\n Clients given 2weeks ARV\n \n 2019-03-29 07:53:59 UTC\n \n 2019-03-29 07:57:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 443\n select distinct Id from( \nselect distinct Id from \n( \n (select distinct o.person_id AS Id \n from obs o \n inner join location l on o.location_id = l.location_id \n where (o.location_id = :location or parent_location = :location) \n and o.concept_id = 2250 \n and o.value_coded in (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n and o.person_id in ( \n select distinct o.person_id \n from obs o \n where (o.concept_id = 4174 and o.value_coded = 4243) \n and obs_datetime BETWEEN :startDate and DATE_ADD(:endDate, INTERVAL 1 DAY) \n ) \n \n and o.voided = 0 \n and obs_datetime BETWEEN :startDate and DATE_ADD(:endDate, INTERVAL 1 DAY) \n ) \n UNION \n(select distinct patient.patient_id AS Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN location l on o.location_id = l.location_id \n AND MONTH(o.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND YEAR(o.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND patient.voided = 0 AND o.voided = 0 \n AND (o.concept_id = 4174 and o.value_coded = 4243) \n AND o.person_id in ( \n select distinct os.person_id from obs os \n INNER JOIN patient ON os.person_id = patient.patient_id \n INNER JOIN location l on os.location_id = l.location_id \n where MONTH(os.obs_datetime) = MONTH(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND YEAR(os.obs_datetime) = YEAR(DATE_ADD(:endDate, INTERVAL -28 DAY)) \n AND os.concept_id = 3752 AND DATEDIFF(os.value_datetime, :endDate) BETWEEN 0 AND 28 \n AND (os.location_id = :location or parent_location = :location ) \n ) \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n WHERE (o.location_id = :location or parent_location = :location ) \n and o.person_id in( \n select distinct person_id from obs os \n where os.concept_id = 2250 \n and os.value_coded in (2201,2203,2205,2207,3672,3673,2210,2209,3674,3675,3676,3677,3683,3684,3685,2202,2204,3679,3680,3681,3682,3686,2143) \n ) \n ) \n) as regimen \nwhere Id not in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 4155 and os.value_coded = 2146 and obs_datetime < DATE_ADD(:endDate, INTERVAL 1 DAY)) \n ) \nAND Id not in ( \n select person_id \n from person \n where death_date < DATE_ADD(:endDate, INTERVAL 1 DAY) \n and dead = 1 \n ) \n )as final\n','2019-03-29 07:53:59',4,'2019-03-29 07:57:45',4,0,NULL,NULL,NULL,'d8bb0175-47c0-461b-b457-498c8ef3cf27'),(444,'Total 1F','TESTING','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Total 1F\n TESTING\n \n 2019-04-24 08:11:10 UTC\n \n 2019-04-24 08:11:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 444\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-04-24 08:11:10',4,'2019-04-24 08:11:13',4,0,NULL,NULL,NULL,'4ff0367d-dd6d-419c-ac9b-e590f2200614'),(445,'Total 1F Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Total 1F Data Set\n \n 2019-04-24 08:11:13 UTC\n \n 2019-04-24 08:14:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 445\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n 1Line1fF\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n \n \n \n 1stLine1FM\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n','2019-04-24 08:11:13',4,'2019-04-24 08:14:21',4,0,NULL,NULL,NULL,'9169293f-f54e-4905-a477-15f43395d28a'),(446,'SQL Version Total Clients Registered for ART','SQL Version Total Clients Registered for ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL Version Total Clients Registered for ART\n SQL Version Total Clients Registered for ART\n \n 2019-07-10 12:51:51 UTC\n \n 2019-07-14 09:11:43 UTC\n \n \n location\n \n org.openmrs.Location\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n startDate\n \n java.util.Date\n true\n \n \n 446\n SELECT DISTINCT p.person_id as id \nFROM visit v \n JOIN person p on p.person_id = v.patient_id \n JOIN patient_identifier pi on v.patient_id = pi.patient_id and pi.identifier_type=5 \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 \n JOIN obs o on o.encounter_id=en.encounter_id \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n and (l.location_id=:location or l.parent_location =:location) \nWHERE en.encounter_datetime <= :endDate and o.date_created <= :endDate \n \n\n','2019-07-10 14:51:51',4,'2019-07-14 11:11:43',4,0,NULL,NULL,NULL,'dabb33fe-f6f9-479c-82a0-d93c5a681b36'),(447,'SQL Version Total Registered ART Client with Intakes captured','SQL Version Total Registered ART Client with Intakes captured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL Version Total Registered ART Client with Intakes captured\n SQL Version Total Registered ART Client with Intakes captured\n \n 2019-07-11 01:08:18 UTC\n \n 2019-07-12 10:30:48 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 447\n SELECT DISTINCT p.person_id as id \nFROM visit v \n JOIN person p on p.person_id = v.patient_id \n JOIN patient_identifier pi on v.patient_id = pi.patient_id and pi.identifier_type=5 \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 \n JOIN obs o on o.encounter_id=en.encounter_id and o.concept_id=2249 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n and (l.location_id=:location or l.parent_location =:location) \nWHERE en.encounter_datetime <= :endDate and o.date_created <= :endDate \n \n\n','2019-07-11 03:08:18',4,'2019-07-12 12:30:48',4,0,NULL,NULL,NULL,'f7926250-cdd1-4446-9106-bfe81ce908f5'),(448,'CI36: Total Registered ART Clients','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI36: Total Registered ART Clients\n \n \n 2019-07-11 01:17:50 UTC\n \n 2019-07-11 01:21:53 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 448\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-07-11 03:17:50',4,'2019-07-11 03:21:53',4,0,NULL,NULL,NULL,'860c7123-a8a4-46d1-8c5e-2c33ac1a2632'),(449,'CI37: Total Registered ART Clients with Intakes Captured','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI37: Total Registered ART Clients with Intakes Captured\n \n \n 2019-07-11 01:19:42 UTC\n \n 2019-07-11 01:22:26 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 449\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-07-11 03:19:42',4,'2019-07-11 03:22:26',4,0,NULL,NULL,NULL,'817d04b5-b407-4ede-a59a-8eac041616cd'),(450,'PIR13: Registered ART Clients with Intakes Progress Report','Period Indicator report for all ART client registered who have their intake form captured in eRegister','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR13: Registered ART Clients with Intakes Progress Report\n Period Indicator report for all ART client registered who have their intake form captured in eRegister\n \n 2019-07-11 01:24:13 UTC\n \n 2019-07-11 02:03:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 450\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-07-11 03:24:13',4,'2019-07-11 04:03:08',4,0,NULL,NULL,NULL,'987a79c2-7ba9-47ff-8623-984851a6ae0e'),(451,'Total Registered ART Clients with Intakes Progress Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Total Registered ART Clients with Intakes Progress Report Data Set\n \n 2019-07-11 01:24:17 UTC\n \n 2019-07-11 01:26:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 451\n \n \n \n IntakesReg\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n Registered\n \n \n \n \n \n \n \n \n \n','2019-07-11 03:24:17',4,'2019-07-11 03:26:20',4,0,NULL,NULL,NULL,'78f64364-5e5a-4ddd-aba9-b27bda9fe14d'),(452,'SQL Version Total ART Clients with Registered Visits','SQL Version Total ART Clients with Registered Visits','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL Version Total ART Clients with Registered Visits\n SQL Version Total ART Clients with Registered Visits\n \n 2019-07-14 09:03:29 UTC\n \n 2019-07-14 09:37:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 452\n SELECT DISTINCT p.person_id \nFROM visit v \n JOIN person p on p.person_id = v.patient_id \n JOIN patient_identifier pi on v.patient_id = pi.patient_id and pi.identifier_type=5 \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type = 2 \n JOIN obs o on o.encounter_id=en.encounter_id \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n and (l.location_id=:location or l.parent_location =:location) \nWHERE en.encounter_datetime >= :startDate and en.encounter_datetime <= :endDate \n \n\n','2019-07-14 11:03:29',4,'2019-07-14 11:37:46',4,0,NULL,NULL,NULL,'0181b364-876e-4307-bd8c-e986ea00f614'),(453,'SQL Version Clients with Visits with Consultations','','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n SQL Version Clients with Visits with Consultations\n \n \n 2019-07-14 09:14:07 UTC\n \n 2019-07-14 09:18:02 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 453\n SELECT DISTINCT p.person_id as id \nFROM visit v \n JOIN person p on p.person_id = v.patient_id \n JOIN patient_identifier pi on v.patient_id = pi.patient_id and pi.identifier_type=5 \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type = 1 \n JOIN obs o on o.encounter_id=en.encounter_id and o.concept_id=3843 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n and (l.location_id=:location or l.parent_location =:location) \nWHERE en.encounter_datetime >= :startDate and en.encounter_datetime <= :endDate \n \n\n','2019-07-14 11:14:07',4,'2019-07-14 11:18:02',4,0,NULL,NULL,NULL,'08bfa6d5-d894-4fc1-8bb2-2db094829434'),(454,'CI38: Total ART Clients with Visits','Total ART Clients with Visits','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI38: Total ART Clients with Visits\n Total ART Clients with Visits\n \n 2019-07-14 09:25:12 UTC\n \n 2019-07-14 09:25:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 454\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-07-14 11:25:12',4,'2019-07-14 11:25:52',4,0,NULL,NULL,NULL,'9250be3a-1ae9-421e-9504-2bd10456a657'),(455,'CI39: Visiting ART Clients with Consultations','Visiting ART Clients with Consultations','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI39: Visiting ART Clients with Consultations\n Visiting ART Clients with Consultations\n \n 2019-07-14 09:26:59 UTC\n \n 2019-07-14 09:27:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 455\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2019-07-14 11:26:59',4,'2019-07-14 11:27:44',4,0,NULL,NULL,NULL,'4eccec5c-c7a8-436e-acec-88ed04f477cc'),(456,'PIR14: Total ART Clients with Consultations Process Report','Total ART Clients with Consultations Process Report','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR14: Total ART Clients with Consultations Process Report\n Total ART Clients with Consultations Process Report\n \n 2019-07-14 09:29:43 UTC\n \n 2019-07-14 09:29:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 456\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2019-07-14 11:29:43',4,'2019-07-14 11:29:46',4,0,NULL,NULL,NULL,'d45c4571-c987-4271-8012-ad3e6e693d3d'),(457,'PIR14: Total ART Clients with Consultations Process Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PIR14: Total ART Clients with Consultations Process Report Data Set\n \n 2019-07-14 09:29:46 UTC\n \n 2019-07-14 09:31:56 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 457\n \n \n \n ARTConsult\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n ARTVisits\n \n \n \n \n \n \n \n \n \n','2019-07-14 11:29:46',4,'2019-07-14 11:31:56',4,0,NULL,NULL,NULL,'80c015cc-fa7f-4423-ad3f-07e7838ed1cb'),(458,'PITC','PITC section of HTS form','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC\n PITC section of HTS form\n \n 2020-04-24 12:00:15 UTC\n \n 2020-04-24 12:00:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 458\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2020-04-24 12:00:15',4,'2020-04-24 12:00:18',4,0,NULL,NULL,NULL,'6bca981c-5d78-4a63-84e4-9185ea3356e9'),(459,'PITC Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC Data Set\n \n 2020-04-24 12:00:18 UTC\n \n 2020-04-26 12:57:36 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 459\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n PInewNe14F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n PInewNe14M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n PInewNe19F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n PInewNe19M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n PInewNe24F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n PInewNe24M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n PInewNe29F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n PInewNe29M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n PInewNe34F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n PInewNe34M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n PInewNe39M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n PInewNe44F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n PInewNe44M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n PInewNe49F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n PInewNe49M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n PInewNe50F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n PInewNe50M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n PInewNeg1F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n PInewNeg1M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n PInewNeg4F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n PInewNeg4M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n PInewNeg9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n PInewNeg9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n PInewPo14F\n \n \n \n \n \n \n \n \n \n PInewPo14M\n \n \n \n \n \n \n PInewPo19F\n \n \n \n \n \n \n PInewPo19M\n \n \n \n \n \n \n PInewPo24F\n \n \n \n \n \n \n PInewPo24M\n \n \n \n \n \n \n PInewPo29F\n \n \n \n \n \n \n PInewPo29M\n \n \n \n \n \n \n PInewPo34F\n \n \n \n \n \n \n PInewPo34M\n \n \n \n \n \n \n PInewPo39F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n PInewPo39M\n \n \n \n \n \n \n PInewPo44F\n \n \n \n \n \n \n PInewPo44M\n \n \n \n \n \n \n PInewPo49F\n \n \n \n \n \n \n PInewPo49M\n \n \n \n \n \n \n PInewPo50F\n \n \n \n \n \n \n PInewPo50M\n \n \n \n \n \n \n PInewPos1F\n \n \n \n \n \n \n PInewPos1M\n \n \n \n \n \n \n PInewPos4F\n \n \n \n \n \n \n PInewPos4M\n \n \n \n \n \n \n PInewPos9F\n \n \n \n \n \n \n PInewPos9M\n \n \n \n \n \n \n PIrepNe14F\n \n \n \n \n \n \n \n \n \n PIrepNe14M\n \n \n \n \n \n \n PIrepNe19F\n \n \n \n \n \n \n PIrepNe19M\n \n \n \n \n \n \n PIrepNe24F\n \n \n \n \n \n \n PIrepNe24M\n \n \n \n \n \n \n PIrepNe29F\n \n \n \n \n \n \n PIrepNe29M\n \n \n \n \n \n \n PIrepNe34F\n \n \n \n \n \n \n PIrepNe34M\n \n \n \n \n \n \n PIrepNe39F\n \n \n \n \n \n \n PIrepNe39M\n \n \n \n \n \n \n PIrepNe44F\n \n \n \n \n \n \n PIrepNe44M\n \n \n \n \n \n \n PIrepNe49F\n \n \n \n \n \n \n PIrepNe49M\n \n \n \n \n \n \n PIrepNe50F\n \n \n \n \n \n \n PIrepNe50M\n \n \n \n \n \n \n PIrepNeg1F\n \n \n \n \n \n \n PIrepNeg1M\n \n \n \n \n \n \n PIrepNeg4F\n \n \n \n \n \n \n PIrepNeg4M\n \n \n \n \n \n \n PIrepNeg9F\n \n \n \n \n \n \n PIrepNeg9M\n \n \n \n \n \n \n PIrepPo14F\n \n \n \n \n \n \n \n \n \n PIrepPo14M\n \n \n \n \n \n \n PIrepPo19F\n \n \n \n \n \n \n PIrepPo19M\n \n \n \n \n \n \n PIrepPo24F\n \n \n \n \n \n \n PIrepPo24M\n \n \n \n \n \n \n PIrepPo29F\n \n \n \n \n \n \n PIrepPo29M\n \n \n \n \n \n \n PIrepPo34F\n \n \n \n \n \n \n PIrepPo34M\n \n \n \n \n \n \n PIrepPo39F\n \n \n \n \n \n \n PIrepPo39M\n \n \n \n \n \n \n PIrepPo44F\n \n \n \n \n \n \n PIrepPo44M\n \n \n \n \n \n \n PIrepPo49F\n \n \n \n \n \n \n PIrepPo49M\n \n \n \n \n \n \n PIrepPo50F\n \n \n \n \n \n \n PIrepPo50M\n \n \n \n \n \n \n PIrepPos1F\n \n \n \n \n \n \n PIrepPos1M\n \n \n \n \n \n \n PIrepPos4F\n \n \n \n \n \n \n PIrepPos4M\n \n \n \n \n \n \n PIrepPos9F\n \n \n \n \n \n \n PIrepPos9M\n \n \n \n \n \n \n','2020-04-24 12:00:18',4,'2020-04-26 12:57:36',4,0,NULL,NULL,NULL,'d6f4d251-130b-4380-aba8-ddfeae303d42'),(460,'PITC_New_Negative','PITC_New_Negative clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC_New_Negative\n PITC_New_Negative clients\n \n 2020-04-24 12:18:19 UTC\n \n 2020-04-24 12:21:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 460\n SELECT Id \nFROM ((SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'PITC' AS 'HIV_Testing_Initiation' \n , 'New' AS 'Testing_History' , sort_order \nFROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4227 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- NEW TESTER, DOES NOT HAVE A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2147 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \nORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n) as hiv \nWHERE HIV_Status = 'Negative'\n','2020-04-24 12:18:19',4,'2020-04-24 12:21:06',4,0,NULL,NULL,NULL,'e9556cb4-8e7f-4de4-9384-0b1ebacad149'),(461,'PITC_New_Positive','new tested positive clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC_New_Positive\n new tested positive clients\n \n 2020-04-24 12:22:19 UTC\n \n 2020-04-24 12:22:59 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 461\n SELECT Id \nFROM ((SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'PITC' AS 'HIV_Testing_Initiation' \n , 'New' AS 'Testing_History' , sort_order \nFROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4227 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- NEW TESTER, DOES NOT HAVE A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2147 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \nORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n) as hiv \nWHERE HIV_Status = 'Positive'\n','2020-04-24 12:22:19',4,'2020-04-24 12:22:59',4,0,NULL,NULL,NULL,'1a4da7db-09d2-4d28-b38d-bed4cf703253'),(462,'PITC_Repeat_Negative','PITC repeat negative clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC_Repeat_Negative\n PITC repeat negative clients\n \n 2020-04-24 12:28:12 UTC\n \n 2020-04-24 12:29:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 462\n SELECT Id \nFROM((SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'PITC' AS 'HIV_Testing_Initiation' \n , 'Repeat' AS 'Testing_History' , sort_order \nFROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4227 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- REPEAT TESTER, HAS A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2146 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \nORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n) as hts \nwhere HIV_Status = 'Negative' \n \n\n','2020-04-24 12:28:12',4,'2020-04-24 12:29:12',4,0,NULL,NULL,NULL,'0750dd97-8565-4679-a1c2-052dc049f345'),(463,'PITC_Repeat_Positive','repeat positive clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC_Repeat_Positive\n repeat positive clients\n \n 2020-04-24 12:31:42 UTC\n \n 2020-04-24 12:32:50 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 463\n SELECT Id \nFROM((SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'PITC' AS 'HIV_Testing_Initiation' \n , 'Repeat' AS 'Testing_History' , sort_order \nFROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4227 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- REPEAT TESTER, HAS A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2146 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \nORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n) as hts \nwhere HIV_Status = 'Positive' \n \n\n','2020-04-24 12:31:42',4,'2020-04-24 12:32:50',4,0,NULL,NULL,NULL,'9bba9c3a-f886-477f-997f-a7325a668ee7'),(464,'PITC New Negative','PITC New Negative','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC New Negative\n PITC New Negative\n \n 2020-04-24 12:38:16 UTC\n \n 2020-04-24 12:39:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 464\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-24 12:38:16',4,'2020-04-24 12:39:14',4,0,NULL,NULL,NULL,'e4a53f3d-9351-4ba9-a039-c1f772b53b05'),(465,'PITC_New_Positive','new positives','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC_New_Positive\n new positives\n \n 2020-04-24 12:45:45 UTC\n \n 2020-04-24 12:46:35 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 465\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-24 12:45:45',4,'2020-04-24 12:46:35',4,0,NULL,NULL,NULL,'5038a34b-49da-411b-8bb9-bf7ea784fb7e'),(466,'PITC repeat negative','repeat clients who tested negative','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC repeat negative\n repeat clients who tested negative\n \n 2020-04-24 12:48:17 UTC\n \n 2020-04-24 12:49:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 466\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-24 12:48:17',4,'2020-04-24 12:49:08',4,0,NULL,NULL,NULL,'e951ced0-d54a-4614-ba74-27a78e8e18df'),(467,'PITC repeat positive','repeating clients who tested positive','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PITC repeat positive\n repeating clients who tested positive\n \n 2020-04-24 12:50:04 UTC\n \n 2020-04-24 12:50:52 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 467\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-24 12:50:04',4,'2020-04-24 12:50:52',4,0,NULL,NULL,NULL,'e359947f-9dd8-490f-a1c2-056afb801816'),(468,'CITC_Repeat_Positive','repeat clients tested positve','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC_Repeat_Positive\n repeat clients tested positve\n \n 2020-04-27 05:28:31 UTC\n \n 2020-04-27 05:28:47 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 468\n select Id \n from(SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'CITC' AS 'HIV_Testing_Initiation' \n , 'Repeat' AS 'Testing_History' , sort_order \n FROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4226 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- REPEAT TESTER, HAS A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2146 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \n ORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n as citc \n where HIV_Status = 'Positive'\n','2020-04-27 05:28:31',4,'2020-04-27 05:28:47',4,0,NULL,NULL,NULL,'3b0f9835-29a4-418d-aaa6-3f8f1d141ece'),(469,'CITC_Repeat_Negative','clients tested negative on repeat visit','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC_Repeat_Negative\n clients tested negative on repeat visit\n \n 2020-04-27 05:30:31 UTC\n \n 2020-04-27 05:31:10 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 469\n select Id \n from(SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'CITC' AS 'HIV_Testing_Initiation' \n , 'Repeat' AS 'Testing_History' , sort_order \n FROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4226 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- REPEAT TESTER, HAS A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2146 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \n ORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n as citc \n where HIV_Status = 'Negative'\n','2020-04-27 05:30:31',4,'2020-04-27 05:31:10',4,0,NULL,NULL,NULL,'a4daa5d2-8e61-44d1-bc37-1b6aba7a6d55'),(470,'CITC_New_Positive','new clients tested positive','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC_New_Positive\n new clients tested positive\n \n 2020-04-27 05:33:15 UTC\n \n 2020-04-27 05:35:43 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 470\n select Id \nfrom \n(SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'CITC' AS 'HIV_Testing_Initiation' \n , 'New' AS 'Testing_History' , sort_order \n FROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4226 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- NEW TESTER, DOES NOT HAVE A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2147 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \n ORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n as citc \n where HIV_Status = 'Positive'\n','2020-04-27 05:33:15',4,'2020-04-27 05:35:43',4,0,NULL,NULL,NULL,'9cd47068-2982-4ca1-a040-bc19ca313349'),(471,'CITC_New_Negative','clients tested negative','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC_New_Negative\n clients tested negative\n \n 2020-04-27 05:37:47 UTC\n \n 2020-04-27 05:38:13 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 471\n select Id \nfrom \n(SELECT Id, patientIdentifier AS "Patient Identifier", patientName AS "Patient Name", Age, Gender, age_group, HIV_Status, 'CITC' AS 'HIV_Testing_Initiation' \n , 'New' AS 'Testing_History' , sort_order \n FROM \n (select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n concat(person_name.given_name, ' ', person_name.family_name) AS patientName, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age, \n (select name from concept_name cn where cn.concept_id = o.value_coded and concept_name_type='FULLY_SPECIFIED') AS HIV_Status, \n person.gender AS Gender, \n observed_age_group.name AS age_group, \n observed_age_group.sort_order AS sort_order \n \n from obs o \n -- HTS CLIENTS WITH HIV STATUS BY SEX AND AGE \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.concept_id = 2165 \n AND patient.voided = 0 AND o.voided = 0 \n AND o.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n \n -- PROVIDER INITIATED TESTING AND COUNSELING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 4228 and os.value_coded = 4226 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n -- NEW TESTER, DOES NOT HAVE A HISTORY OF PREVIOUS TESTING \n AND o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2137 and os.value_coded = 2147 \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) \n \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n INNER JOIN person_name ON person.person_id = person_name.person_id \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 \n INNER JOIN reporting_age_group AS observed_age_group ON \n CAST(:endDate AS DATE) BETWEEN (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.min_years YEAR), INTERVAL observed_age_group.min_days DAY)) \n AND (DATE_ADD(DATE_ADD(person.birthdate, INTERVAL observed_age_group.max_years YEAR), INTERVAL observed_age_group.max_days DAY)) \n WHERE observed_age_group.report_group_name = 'Modified_Ages') AS HTSClients_HIV_Status \n ORDER BY HTSClients_HIV_Status.HIV_Status, HTSClients_HIV_Status.Age) \n as citc \n where HIV_Status = 'Negative'\n','2020-04-27 05:37:47',4,'2020-04-27 05:38:13',4,0,NULL,NULL,NULL,'ebf8843c-2e45-4156-8bbf-867273775513'),(472,'CITC New Positive','CITC New Positive','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC New Positive\n CITC New Positive\n \n 2020-04-27 05:39:50 UTC\n \n 2020-04-27 05:41:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 472\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-27 05:39:50',4,'2020-04-27 05:41:21',4,0,NULL,NULL,NULL,'512d2da0-391c-4ec8-b8cc-d9f3028bf456'),(473,'CITC New Negative','CITC New Negative','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC New Negative\n CITC New Negative\n \n 2020-04-27 05:42:28 UTC\n \n 2020-04-27 05:44:08 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 473\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-27 05:42:28',4,'2020-04-27 05:44:08',4,0,NULL,NULL,NULL,'2c87a371-a86c-4980-aade-4303463e95a5'),(474,'CITC Repeat Positive','CITC Repeat Positive','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC Repeat Positive\n CITC Repeat Positive\n \n 2020-04-27 05:46:33 UTC\n \n 2020-04-27 05:47:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 474\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-27 05:46:33',4,'2020-04-27 05:47:32',4,0,NULL,NULL,NULL,'71f59662-0e07-40f6-9c6c-0570bc3ef36f'),(475,'CITC Repeat Negative','CITC Repeat Negative','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC Repeat Negative\n CITC Repeat Negative\n \n 2020-04-27 05:50:11 UTC\n \n 2020-04-27 05:54:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 475\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-04-27 05:50:11',4,'2020-04-27 05:54:46',4,0,NULL,NULL,NULL,'e42b4a1d-bc07-4ab9-b60b-30896100d112'),(476,'CITC','Client Initiated Testing and Counseling section of HTS form','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC\n Client Initiated Testing and Counseling section of HTS form\n \n 2020-04-27 05:56:14 UTC\n \n 2020-04-27 05:56:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 476\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2020-04-27 05:56:14',4,'2020-04-27 05:56:21',4,0,NULL,NULL,NULL,'87d3cf9f-40bc-4516-960e-03c17a6b6a09'),(477,'CITC Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CITC Data Set\n \n 2020-04-27 05:56:21 UTC\n \n 2020-04-27 10:39:40 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 477\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n CInewNe14F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n CInewNe14M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n CInewNe19F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n CInewNe19M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n CInewNe24F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n CInewNe24M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n CInewNe29F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n CInewNe29M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n CInewNe34F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n CInewNe34M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n CInewNe39F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n CInewNe39M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n CInewNe44F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n CInewNe44M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n CInewNe49F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n CInewNe49M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n CInewNe50F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n CInewNe50M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n CInewNeg1F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n CInewNeg1M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n Under 1yr\n \n \n \n \n \n CInewNeg4F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n CInewNeg4M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 01to04yrs\n \n \n \n \n \n CInewNeg9F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n CInewNeg9M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 05to09yrs\n \n \n \n \n \n CInewPo14F\n \n \n \n \n \n \n \n \n \n CInewPo14M\n \n \n \n \n \n \n CInewPo19F\n \n \n \n \n \n \n CInewPo19M\n \n \n \n \n \n \n CInewPo24F\n \n \n \n \n \n \n CInewPo24M\n \n \n \n \n \n \n CInewPo29F\n \n \n \n \n \n \n CInewPo29M\n \n \n \n \n \n \n CInewPo34F\n \n \n \n \n \n \n CInewPo34M\n \n \n \n \n \n \n CInewPo39F\n \n \n \n \n \n \n CInewPo39M\n \n \n \n \n \n \n CInewPo44F\n \n \n \n \n \n \n CInewPo44M\n \n \n \n \n \n \n CInewPo49F\n \n \n \n \n \n \n CInewPo49M\n \n \n \n \n \n \n CInewPo50F\n \n \n \n \n \n \n CInewPo50M\n \n \n \n \n \n \n CInewPos1F\n \n \n \n \n \n \n CInewPos1M\n \n \n \n \n \n \n CInewPos4F\n \n \n \n \n \n \n CInewPos4M\n \n \n \n \n \n \n CInewPos9F\n \n \n \n \n \n \n CInewPos9M\n \n \n \n \n \n \n CIrepNe14F\n \n \n \n \n \n \n \n \n \n CIrepNe14M\n \n \n \n \n \n \n CIrepNe19F\n \n \n \n \n \n \n CIrepNe19M\n \n \n \n \n \n \n CIrepNe24F\n \n \n \n \n \n \n CIrepNe24M\n \n \n \n \n \n \n CIrepNe29F\n \n \n \n \n \n \n CIrepNe29M\n \n \n \n \n \n \n CIrepNe34F\n \n \n \n \n \n \n CIrepNe34M\n \n \n \n \n \n \n \n \n \n CIrepNe39F\n \n \n \n \n \n \n CIrepNe39M\n \n \n \n \n \n \n CIrepNe44F\n \n \n \n \n \n \n CIrepNe44M\n \n \n \n \n \n \n CIrepNe49F\n \n \n \n \n \n \n CIrepNe49M\n \n \n \n \n \n \n CIrepNe50F\n \n \n \n \n \n \n CIrepNe50M\n \n \n \n \n \n \n CIrepNeg1F\n \n \n \n \n \n \n CIrepNeg1M\n \n \n \n \n \n \n CIrepNeg4F\n \n \n \n \n \n \n CIrepNeg4M\n \n \n \n \n \n \n CIrepNeg9F\n \n \n \n \n \n \n CIrepNeg9M\n \n \n \n \n \n \n CIrepPo14F\n \n \n \n \n \n \n CIrepPo14M\n \n \n \n \n \n \n CIrepPo19F\n \n \n \n \n \n \n CIrepPo19M\n \n \n \n \n \n \n CIrepPo24F\n \n \n \n \n \n \n CIrepPo24M\n \n \n \n \n \n \n CIrepPo29F\n \n \n \n \n \n \n CIrepPo29M\n \n \n \n \n \n \n CIrepPo34F\n \n \n \n \n \n \n CIrepPo34M\n \n \n \n \n \n \n CIrepPo39F\n \n \n \n \n \n \n CIrepPo39M\n \n \n \n \n \n \n CIrepPo44F\n \n \n \n \n \n \n CIrepPo44M\n \n \n \n \n \n \n CIrepPo49F\n \n \n \n \n \n \n CIrepPo49M\n \n \n \n \n \n \n CIrepPo50F\n \n \n \n \n \n \n CIrepPo50M\n \n \n \n \n \n \n CIrepPos1F\n \n \n \n \n \n \n CIrepPos1M\n \n \n \n \n \n \n CIrepPos4F\n \n \n \n \n \n \n CIrepPos4M\n \n \n \n \n \n \n CIrepPos9F\n \n \n \n \n \n \n CIrepPos9M\n \n \n \n \n \n \n','2020-04-27 05:56:21',4,'2020-04-27 10:39:40',4,0,NULL,NULL,NULL,'3b4a124e-e541-4655-bce1-07595881f037'),(478,'HTS Indeterminate','total inderminate results','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Indeterminate\n total inderminate results\n \n 2020-05-03 10:54:09 UTC\n \n 2020-05-03 10:55:12 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 478\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 4223 and value_coded = 4220) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 10:54:09',4,'2020-05-03 10:55:12',4,0,NULL,NULL,NULL,'9d8d2a02-6b1b-4f6f-9897-7f2440d60bf5'),(479,'HTS Couple','couples','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Couple\n couples\n \n 2020-05-03 10:58:12 UTC\n \n 2020-05-03 10:59:17 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 479\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 2166 and value_coded = 2146) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 10:58:12',4,'2020-05-03 10:59:17',4,0,NULL,NULL,NULL,'361c4fa5-4375-42da-935b-00cf7a975167'),(480,'HTS Discordant','Discordant test results','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Discordant\n Discordant test results\n \n 2020-05-03 11:00:30 UTC\n \n 2020-05-03 11:27:21 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 480\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand concept_id = 2164 and value_coded = 2146 \nand person_id in (select person_id from obs where (concept_id = 4225 and value_coded = 2146) \n and obs_datetime >=:startDate \n and obs_datetime <=:endDate \n ) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:00:30',4,'2020-05-03 11:27:21',4,0,NULL,NULL,NULL,'49027ad5-be0a-45f5-af20-0926fb6adec9'),(481,'HTS Screened','Clients screened for TB','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Screened\n Clients screened for TB\n \n 2020-05-03 11:05:45 UTC\n \n 2020-05-03 11:06:26 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 481\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 2294 and value_coded = 2146) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:05:45',4,'2020-05-03 11:06:26',4,0,NULL,NULL,NULL,'3aadefe4-1302-4fff-a140-55a0a634f093'),(482,'HTS Male Condoms','Male condoms distributed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Male Condoms\n Male condoms distributed\n \n 2020-05-03 11:07:57 UTC\n \n 2020-05-03 11:12:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 482\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 4231 and value_coded = 4229) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:07:57',4,'2020-05-03 11:12:28',4,0,NULL,NULL,NULL,'9b9b6440-4e3a-4bc4-93eb-e52f32f36cc8'),(483,'HTS Female Condoms','Female condoms distributed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Female Condoms\n Female condoms distributed\n \n 2020-05-03 11:13:25 UTC\n \n 2020-05-03 11:14:03 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 483\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 4231 and value_coded = 4230) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:13:25',4,'2020-05-03 11:14:03',4,0,NULL,NULL,NULL,'18f0954d-4c76-4a30-92e8-306c93bb1b98'),(484,'HTS Confirmatory Negative','COnfirmatory test results negative','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Confirmatory Negative\n COnfirmatory test results negative\n \n 2020-05-03 11:18:07 UTC\n \n 2020-05-03 11:19:20 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 484\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 2161 and value_coded = 1016) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:18:07',4,'2020-05-03 11:19:20',4,0,NULL,NULL,NULL,'1ec73fb7-2046-4706-bb66-109eb6ec94c3'),(485,'HTS Confirmatory Positive','Confirmatory test results positive','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Confirmatory Positive\n Confirmatory test results positive\n \n 2020-05-03 11:21:28 UTC\n \n 2020-05-03 11:22:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 485\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 2161 and value_coded = 1738) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:21:28',4,'2020-05-03 11:22:06',4,0,NULL,NULL,NULL,'78a1c404-42d9-469d-9220-b873114308c2'),(486,'HTS SelfTest Kits','HIVST confirmed HIV positive','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS SelfTest Kits\n HIVST confirmed HIV positive\n \n 2020-05-03 11:23:54 UTC\n \n 2020-05-03 11:26:06 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 486\n select distinct o.person_id \nfrom obs o inner join location l on o.location_id = l.location_id \nwhere (o.location_id =:location or parent_location =:location) \nand (o.concept_id = 2161 and value_coded = 1738) \nand person_id in (select person_id \nfrom obs \nwhere concept_id = 4662 and value_coded = 4237 \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate) \nand obs_datetime >=:startDate \nand obs_datetime <=:endDate\n','2020-05-03 11:23:54',4,'2020-05-03 11:26:06',4,0,NULL,NULL,NULL,'1377634a-611f-45c3-b42b-0ff16dec16eb'),(487,'HTS Indeterminate','total indeterminate results','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Indeterminate\n total indeterminate results\n \n 2020-05-03 19:06:01 UTC\n \n 2020-05-03 19:07:14 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 487\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:06:01',4,'2020-05-03 19:07:14',4,0,NULL,NULL,NULL,'cbc0f41b-11d1-42c5-819d-2b256a192c7a'),(488,'HTS Couple','Couples only','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Couple\n Couples only\n \n 2020-05-03 19:09:15 UTC\n \n 2020-05-03 19:09:57 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 488\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:09:15',4,'2020-05-03 19:09:57',4,0,NULL,NULL,NULL,'4eae8f2e-2b61-4b25-91f4-027131d2a8e7'),(489,'HTS Discordant','Discordant test results','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Discordant\n Discordant test results\n \n 2020-05-03 19:12:07 UTC\n \n 2020-05-03 19:12:54 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 489\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:12:07',4,'2020-05-03 19:12:54',4,0,NULL,NULL,NULL,'42279637-8cd0-4097-8948-7ac931af776b'),(490,'HTS Screened','HTS clients screened for TB','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Screened\n HTS clients screened for TB\n \n 2020-05-03 19:13:57 UTC\n \n 2020-05-03 19:16:44 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 490\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:13:57',4,'2020-05-03 19:16:44',4,0,NULL,NULL,NULL,'80d07406-6d62-4289-8d32-887363807775'),(491,'HTS Female Condoms distributed','Condoms distributed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Female Condoms distributed\n Condoms distributed\n \n 2020-05-03 19:18:56 UTC\n \n 2020-05-03 19:21:45 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 491\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:18:56',4,'2020-05-03 19:21:45',4,0,NULL,NULL,NULL,'9c177ce6-5697-4b84-9093-8e30ac78e3e3'),(492,'HTS Male Condoms','Male condoms distributed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Male Condoms\n Male condoms distributed\n \n 2020-05-03 19:22:24 UTC\n \n 2020-05-03 19:23:18 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 492\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:22:24',4,'2020-05-03 19:23:18',4,0,NULL,NULL,NULL,'5c760a04-22f9-40aa-94a5-397340c8b638'),(493,'HTS Confirmatory Negative','Confirmatory Negative','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Confirmatory Negative\n Confirmatory Negative\n \n 2020-05-03 19:24:40 UTC\n \n 2020-05-03 19:25:28 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 493\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:24:40',4,'2020-05-03 19:25:28',4,0,NULL,NULL,NULL,'f1f06a0f-0afb-4aaa-8542-dd54ff94b6ce'),(494,'HTS Confirmatory Positive','Confirmatory Positive','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Confirmatory Positive\n Confirmatory Positive\n \n 2020-05-03 19:26:24 UTC\n \n 2020-05-03 19:27:46 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 494\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:26:24',4,'2020-05-03 19:27:46',4,0,NULL,NULL,NULL,'5fefbf51-d124-4c3d-a6bd-69bfb0b78f64'); +INSERT INTO `serialized_object` VALUES (495,'HTS Self Test Kits','Self Test Kits','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Self Test Kits\n Self Test Kits\n \n 2020-05-03 19:29:29 UTC\n \n 2020-05-03 19:30:19 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 495\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2020-05-03 19:29:29',4,'2020-05-03 19:30:19',4,0,NULL,NULL,NULL,'89fdd6f1-5744-4a2b-9d08-00ef77bb50d8'),(496,'HTS Period Indicator Report','indeterminate,couples,discordant couples,screened for TB,Condoms distribution and confirmatory test results','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Period Indicator Report\n indeterminate,couples,discordant couples,screened for TB,Condoms distribution and confirmatory test results\n \n 2020-05-03 19:38:28 UTC\n \n 2020-05-03 19:38:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 496\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2020-05-03 19:38:28',4,'2020-05-03 19:38:31',4,0,NULL,NULL,NULL,'dafef277-1393-484d-a947-936a507e03a1'),(497,'HTS Period Indicator Report Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Period Indicator Report Data Set\n \n 2020-05-03 19:38:31 UTC\n \n 2020-05-03 19:47:32 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 497\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n Confirm_N\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n \n \n Confirm_P\n \n \n \n \n \n \n \n \n \n Couples\n \n \n \n \n \n \n \n \n \n Discordant\n \n \n \n \n \n \n \n \n \n Indetermin\n \n \n \n \n \n \n \n \n \n Screened_F\n \n \n \n \n \n \n \n DM_Sex\n Females\n \n \n \n \n \n Screened_M\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n','2020-05-03 19:38:31',4,'2020-05-03 19:47:32',4,0,NULL,NULL,NULL,'f25de016-f5c5-4638-b08c-ee3a31c63121'),(498,'HTS Self Test Kits','HIVST clients tested HIV positive','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Self Test Kits\n HIVST clients tested HIV positive\n \n 2020-05-03 19:50:04 UTC\n \n 2020-05-03 19:50:07 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 498\n \n \n defaultDataSet\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n','2020-05-03 19:50:04',4,'2020-05-03 19:50:07',4,0,NULL,NULL,NULL,'92c28a1a-1d44-40b4-b11f-61a620cea4ea'),(499,'HTS Self Test Kits Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Self Test Kits Data Set\n \n 2020-05-03 19:50:07 UTC\n \n 2020-05-03 20:07:31 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 499\n \n \n DM_Sex\n \n \n \n \n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n Po10to14_F\n \n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n Po10to14_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 10to14yrs\n \n \n \n \n \n Po15to19_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n Po15to19_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 15to19yrs\n \n \n \n \n \n Po20to24_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n Po20to24_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 20to24yrs\n \n \n \n \n \n Po25to29_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n Po25to29_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 25to29yrs\n \n \n \n \n \n Po30to34_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n Po30to34_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 30to34yrs\n \n \n \n \n \n Po35to39_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n Po35to39_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 35to39yrs\n \n \n \n \n \n Po40to44_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n Po40to44_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 40to44yrs\n \n \n \n \n \n Po45to49_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n Po45to49_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 45to49yrs\n \n \n \n \n \n Po50_F\n \n \n \n \n DM_Sex\n Females\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n Po50_M\n \n \n \n \n DM_Sex\n Males\n \n \n DM_Age\n 50to100yrs\n \n \n \n \n \n','2020-05-03 19:50:07',4,'2020-05-03 20:07:31',4,0,NULL,NULL,NULL,'613de36b-b418-42b6-b2db-37cd706fc3fd'); +/*!40000 ALTER TABLE `serialized_object` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-05-08 8:01:11 diff --git a/scripts/symbolic_creation.sh b/scripts/symbolic_creation.sh new file mode 100644 index 0000000..782fa76 --- /dev/null +++ b/scripts/symbolic_creation.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Removing old sym links +sudo rm bahmni_config +sudo rm obscalculator +sudo rm encounterModifier +sudo rm elisFeedInterceptor +sudo rm ordertemplates +sudo rm patientMatchingAlgorithm + +# Creating new sysm link from bahmni config release + +sudo ln -s /development/bahmni_config_release/ /opt/openmrs/bahmni_config + +sudo ln -s /development/bahmni_config_release/openmrs/obscalculator/ /opt/openmrs/obscalculator + +sudo ln -s /development/bahmni_config_release/openmrs/encounterModifier/ /opt/openmrs/encounterModifier + +sudo ln -s /development/bahmni_config_release/openmrs/elisFeedInterceptor/ /opt/openmrs/elisFeedInterceptor +sudo ln -s /development/bahmni_config_release/openmrs/ordertemplates/ /opt/openmrs/ordertemplates +sudo ln -s /development/bahmni_config_release/openmrs/patientMatchingAlgorithm/ /opt/openmrs/patientMatchingAlgorithm diff --git a/scripts/visit_types.sql b/scripts/visit_types.sql new file mode 100644 index 0000000..a2370f6 --- /dev/null +++ b/scripts/visit_types.sql @@ -0,0 +1,68 @@ +-- MySQL dump 10.13 Distrib 5.6.40, for Linux (x86_64) +-- +-- Host: localhost Database: openmrs +-- ------------------------------------------------------ +-- Server version 5.6.40-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `visit_type` +-- + +DROP TABLE IF EXISTS `visit_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `visit_type` ( + `visit_type_id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `description` varchar(1024) DEFAULT NULL, + `creator` int(11) NOT NULL, + `date_created` datetime NOT NULL, + `changed_by` int(11) DEFAULT NULL, + `date_changed` datetime DEFAULT NULL, + `retired` tinyint(1) NOT NULL DEFAULT '0', + `retired_by` int(11) DEFAULT NULL, + `date_retired` datetime DEFAULT NULL, + `retire_reason` varchar(255) DEFAULT NULL, + `uuid` char(38) NOT NULL, + PRIMARY KEY (`visit_type_id`), + UNIQUE KEY `uuid` (`uuid`), + KEY `visit_type_creator` (`creator`), + KEY `visit_type_changed_by` (`changed_by`), + KEY `visit_type_retired_by` (`retired_by`), + CONSTRAINT `visit_type_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`), + CONSTRAINT `visit_type_creator` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), + CONSTRAINT `visit_type_retired_by` FOREIGN KEY (`retired_by`) REFERENCES `users` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `visit_type` +-- + +LOCK TABLES `visit_type` WRITE; +/*!40000 ALTER TABLE `visit_type` DISABLE KEYS */; +INSERT INTO `visit_type` VALUES (3,'IPD','Visit for patients being admitted',1,'2014-09-18 14:19:53',4,'2018-01-15 14:07:25',1,4,'2018-01-15 14:07:25','No needed as yet for Lesotho customization','c228eab1-3f10-11e4-adec-0800271c1b75'),(4,'OPD','Visit for patients coming for OPD',1,'2014-09-18 14:19:53',4,'2018-03-04 08:52:57',1,4,'2018-03-04 08:52:57','General OPD is currently within scope for the initial Lesotho implementation. Will be activated when needed','c22a5000-3f10-11e4-adec-0800271c1b75'),(5,'Special OPD','Visit for patients coming for Dental, Spine, Skin etc',1,'2014-09-18 14:19:53',4,'2018-01-15 14:07:39',1,4,'2018-01-15 14:07:39','No needed as yet for Lesotho customization','c23d6c9d-3f10-11e4-adec-0800271c1b75'),(6,'EMERGENCY','Emergency patient visit',1,'2014-09-18 14:19:53',4,'2018-01-15 14:07:45',1,4,'2018-01-15 14:07:45','No needed as yet for Lesotho customization','c2402997-3f10-11e4-adec-0800271c1b75'),(7,'PHARMACY VISIT','Visit for syncing sale orders from pharmacy',1,'2014-09-18 00:00:00',4,'2018-03-04 08:54:29',1,4,'2018-03-04 08:54:29','Pharmacy visits will currently be targeting ART patients, specifically ARV drug pick up visits. The ARV regimen drug pick up visit type currently covers this use case','b9cb32c9-3f12-11e4-adec-0800271c1b75'),(8,'LAB VISIT','Visits for lab visit by patient when the tests are not ordered through OpenMRS',1,'2014-09-18 00:00:00',4,'2018-01-15 14:07:57',1,4,'2018-01-15 14:07:57','No needed as yet for Lesotho customization','bef32e14-3f12-11e4-adec-0800271c1b75'),(9,'New or Pre-ART','HIV Care intake visit',4,'2018-01-13 05:57:40',4,'2018-03-04 09:19:31',0,NULL,NULL,NULL,'ea86054a-c93b-49b5-ad7b-04388ad9fc88'),(10,'ARV Drug Pickup','For ARV drug pick up visits',4,'2018-01-15 14:08:58',4,'2018-03-04 09:18:08',0,NULL,NULL,NULL,'33e15d3c-54b7-4e8e-9527-b828c1cb24d0'),(11,'Sick or Presumptive TB','Sick or Presumptive TB',1,'2018-02-28 15:32:45',4,'2018-05-08 09:59:57',0,NULL,NULL,NULL,'ece8bbe3-d648-43f0-99bd-f629e882f321'),(12,'High Viral Load Result','Visit type for ART clients with high viral load. Workflow will be customized accordingly for clients with VL > 1000',4,'2018-03-04 08:58:56',4,'2018-03-04 09:19:48',0,NULL,NULL,NULL,'798b308d-b0f7-4be6-bd3c-c50061691698'),(13,'TB Case','TB Case',4,'2018-05-08 11:26:27',NULL,NULL,0,NULL,NULL,NULL,'f310bccd-dde6-4ef5-8cbb-446625db2bde'),(14,'Transfer In','Visit type for transfer ins',4,'2018-06-08 11:10:31',NULL,NULL,0,NULL,NULL,NULL,'e1427d12-cfcb-48e5-bbab-fe47d91a5c62'),(15,'HTS Only','Visit type to use when a patient is due for testing according to the standard decision criteria i.e. Status unknown OR Negative and 3 months visit OR New Bukana',4,'2019-05-21 09:20:30',NULL,NULL,0,NULL,NULL,NULL,'57159542-718d-439d-8d3a-1ba6586c08f0'),(16,'ANC','ANC visit',4,'2019-10-26 12:52:12',4,'2019-10-26 12:52:54',0,NULL,NULL,NULL,'d9ea62e0-0079-4151-85ce-8e7443bf2fe6'),(17,'PNC','PNC visit',4,'2019-10-26 12:52:25',4,'2019-10-26 12:52:49',0,NULL,NULL,NULL,'949e99d7-f6be-4689-b507-33728f565b8c'),(18,'HEI','HIE visit',4,'2019-10-26 12:52:39',NULL,NULL,0,NULL,NULL,NULL,'00279a7c-9b5a-4ef9-b15a-32cd814be84f'); +/*!40000 ALTER TABLE `visit_type` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-05-11 15:54:53 diff --git a/site/404.html b/site/404.html index ecdf191..d65d474 100644 --- a/site/404.html +++ b/site/404.html @@ -1,6 +1,4 @@ - - @@ -11,40 +9,45 @@ - - - + + + - Lesotho Health Documentation + Lesotho Health SI Systems Documentation - - - - + + + + + + - + - - - + + + + + - + + @@ -52,8 +55,13 @@ - + + + + + + @@ -64,48 +72,58 @@ -
-