From 87e15bbdfdeb3343881b03dc9d495cc0fd15abc9 Mon Sep 17 00:00:00 2001 From: Masupha Date: Mon, 18 Sep 2023 08:39:51 +0200 Subject: [PATCH] automated_weekly_report --- Serialized_Object.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Serialized_Object.sql b/Serialized_Object.sql index 97a091a..d353ed0 100644 --- a/Serialized_Object.sql +++ b/Serialized_Object.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.6.41, for Linux (x86_64) +-- MySQL dump 10.13 Distrib 5.7.30, for Linux (x86_64) -- -- Host: localhost Database: openmrs -- ------------------------------------------------------ --- Server version 5.6.41 +-- Server version 5.7.30 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -47,7 +47,7 @@ CREATE TABLE `serialized_object` ( 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=2187 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2248 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -68,7 +68,7 @@ INSERT INTO `serialized_object` VALUES (1308,'CITC_HTS_Outreach Data Set',NULL,' INSERT INTO `serialized_object` VALUES (1436,'Clients given 4L weighing 14-19.9kg','Clients given 4L weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 14-19.9kg\n Clients given 4L weighing 14-19.9kg\n \n 2022-06-30 09:44:49 UTC\n \n 2022-06-30 09:45: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 1436\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4L \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4688)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:44:49',4,'2022-06-30 11:45:12',4,0,NULL,NULL,NULL,'c0c8885b-814c-4cb2-8c23-c10871a2b76d'),(1437,'Clients given 4L weighing 20-24.9kg','Clients given 4L weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 20-24.9kg\n Clients given 4L weighing 20-24.9kg\n \n 2022-06-30 09:45:58 UTC\n \n 2022-06-30 09:46: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 1437\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4L \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4688)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:45:58',4,'2022-06-30 11:46:30',4,0,NULL,NULL,NULL,'889cb817-6500-4ae1-9f84-e1ec42b46c00'),(1438,'Clients given 4L weighing 25-34.9kg','Clients given 4L weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 25-34.9kg\n Clients given 4L weighing 25-34.9kg\n \n 2022-06-30 09:47:36 UTC\n \n 2022-06-30 09:48: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 1438\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4L \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4688)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:47:36',4,'2022-06-30 11:48:00',4,0,NULL,NULL,NULL,'51076831-4759-4f7d-8d57-47fb8862e61c'),(1439,'Clients given 4L weighing >=35','Clients given 4L weighing >=35','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing >=35\n Clients given 4L weighing >=35\n \n 2022-06-30 09:48:54 UTC\n \n 2022-06-30 09:49: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 1439\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4L \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4688)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:48:54',4,'2022-06-30 11:49:14',4,0,NULL,NULL,NULL,'3ba57d29-931d-454e-916c-9e0c0e90d805'),(1440,'Clients given 4C weighing 6-9.9kg','Clients given 4C weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 6-9.9kg\n Clients given 4C weighing 6-9.9kg\n \n 2022-06-30 09:49:04 UTC\n \n 2022-06-30 09:49: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 1440\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:49:04',4,'2022-06-30 11:49:40',4,0,NULL,NULL,NULL,'d3d16a07-4319-4d63-82a2-4f47f7928a00'),(1441,'Clients given 4C weighing 10-13.9kg','Clients given 4C weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 10-13.9kg\n Clients given 4C weighing 10-13.9kg\n \n 2022-06-30 09:50:51 UTC\n \n 2022-06-30 09:51: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 1441\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:50:51',4,'2022-06-30 11:51:29',4,0,NULL,NULL,NULL,'09622f4b-49d5-4214-9eb4-7de4cae57a9d'),(1442,'Clients given 4K weighing 0-3.9kg','Clients given 4K weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 0-3.9kg\n Clients given 4K weighing 0-3.9kg\n \n 2022-06-30 09:52:14 UTC\n \n 2022-06-30 09:52: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 1442\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:52:14',4,'2022-06-30 11:52:32',4,0,NULL,NULL,NULL,'0f76ed94-e4f8-4f94-9bc4-4adbba1c66c1'),(1443,'Clients given 4C weighing 14-19.9kg','Clients given 4C weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 14-19.9kg\n Clients given 4C weighing 14-19.9kg\n \n 2022-06-30 09:53:51 UTC\n \n 2022-06-30 09:54: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 1443\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:53:51',4,'2022-06-30 11:54:49',4,0,NULL,NULL,NULL,'034244be-ee9b-4c5f-9c05-b69eefad3051'),(1444,'Clients given 4K weighing 4-5.9kg','Clients given 4K weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 4-5.9kg\n Clients given 4K weighing 4-5.9kg\n \n 2022-06-30 09:53:56 UTC\n \n 2022-06-30 09:54: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 1444\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:53:56',4,'2022-06-30 11:54:44',4,0,NULL,NULL,NULL,'fe700a2f-6c6b-4ab5-8692-4171cb0dc27c'),(1445,'Clients given 4K weighing 6-9.9kg','Clients given 4K weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 6-9.9kg\n Clients given 4K weighing 6-9.9kg\n \n 2022-06-30 09:55:49 UTC\n \n 2022-06-30 09:56: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 1445\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:55:49',4,'2022-06-30 11:56:03',4,0,NULL,NULL,NULL,'db5d6766-3a33-43c4-9732-a4d83ce9b1ea'),(1446,'Clients given 4K weighing 10-13.9kg','Clients given 4K weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 10-13.9kg\n Clients given 4K weighing 10-13.9kg\n \n 2022-06-30 09:56:49 UTC\n \n 2022-06-30 09:57: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 1446\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:56:49',4,'2022-06-30 11:57:09',4,0,NULL,NULL,NULL,'494aa500-1c2d-45b2-b6ba-aa987b52622a'),(1447,'Clients given 4K weighing 14-19.9kg','Clients given 4K weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 14-19.9kg\n Clients given 4K weighing 14-19.9kg\n \n 2022-06-30 09:58:26 UTC\n \n 2022-06-30 09: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 1447\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:58:26',4,'2022-06-30 11:58:41',4,0,NULL,NULL,NULL,'480ac769-5b88-4485-8885-03322fa49fc8'),(1448,'Clients given 4K weighing 20-24.9kg','Clients given 4K weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 20-24.9kg\n Clients given 4K weighing 20-24.9kg\n \n 2022-06-30 09:59:23 UTC\n \n 2022-06-30 09:59: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 1448\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 11:59:23',4,'2022-06-30 11:59:37',4,0,NULL,NULL,NULL,'3bd2b9e5-01e8-43ac-a17a-3912a89d7ff1'),(1449,'Clients given 4K weighing 25-34.9kg','Clients given 4K weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 25-34.9kg\n Clients given 4K weighing 25-34.9kg\n \n 2022-06-30 10:01:21 UTC\n \n 2022-06-30 10:01: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 1449\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:01:21',4,'2022-06-30 12:01:35',4,0,NULL,NULL,NULL,'921f9499-c27b-4b41-95e0-b85292fa2f92'),(1450,'Clients given 4K weighing >=35kg','Clients given 4K weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing >=35kg\n Clients given 4K weighing >=35kg\n \n 2022-06-30 10:02:42 UTC\n \n 2022-06-30 10:02: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 1450\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4K \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:02:42',4,'2022-06-30 12:02:56',4,0,NULL,NULL,NULL,'3229cff2-e047-4073-90c1-e06e867b402b'),(1451,'Clients given 4C weighing 20-24.9kg','Clients given 4C weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 20-24.9kg\n Clients given 4C weighing 20-24.9kg\n \n 2022-06-30 10:02:57 UTC\n \n 2022-06-30 10:03: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 1451\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:02:57',4,'2022-06-30 12:03:46',4,0,NULL,NULL,NULL,'9e67fab4-3382-49c7-bc4a-8e6f95ecd7ff'),(1452,'Clients given 4C weighing 25-34.9kg','Clients given 4C weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 25-34.9kg\n Clients given 4C weighing 25-34.9kg\n \n 2022-06-30 10:04:55 UTC\n \n 2022-06-30 10: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 1452\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:04:55',4,'2022-06-30 12:05:30',4,0,NULL,NULL,NULL,'1e41db8d-aca6-471d-af67-bddf792eb12e'),(1453,'Clients given 4C weighing >=35kg','Clients given 4C weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing >=35kg\n Clients given 4C weighing >=35kg\n \n 2022-06-30 10:06:32 UTC\n \n 2022-06-30 10:07: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 1453\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2202)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:06:32',4,'2022-06-30 12:07:15',4,0,NULL,NULL,NULL,'9bb26987-59cb-48b8-8235-502a3d2f52b4'),(1454,'Clients given 4J weighing 0-3.9kg','Clients given 4J weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 0-3.9kg\n Clients given 4J weighing 0-3.9kg\n \n 2022-06-30 10:07:54 UTC\n \n 2022-06-30 10:32: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 1454\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:07:54',4,'2022-06-30 12:32:11',4,0,NULL,NULL,NULL,'b4265cc6-ac60-4aeb-ba91-ef213a6d949e'),(1455,'Clients given 4D weighing 0-3.9kg','Clients given 4D weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 0-3.9kg\n Clients given 4D weighing 0-3.9kg\n \n 2022-06-30 10:08:47 UTC\n \n 2022-06-30 10:10:06 UTC\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 endDate\n \n java.util.Date\n true\n \n \n 1455\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:08:47',4,'2022-06-30 12:10:06',4,0,NULL,NULL,NULL,'d998e2f6-840d-473b-b176-e0550de42412'),(1456,'Clients given 4D weighing 4-5.9kg','Clients given 4D weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 4-5.9kg\n Clients given 4D weighing 4-5.9kg\n \n 2022-06-30 10:13:16 UTC\n \n 2022-06-30 10:13: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 1456\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:13:16',4,'2022-06-30 12:13:46',4,0,NULL,NULL,NULL,'6a8a13fc-28a2-4778-840f-e45fb90009b6'),(1457,'Clients given 4D weighing 6-9.9kg','Clients given 4D weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 6-9.9kg\n Clients given 4D weighing 6-9.9kg\n \n 2022-06-30 10:15:03 UTC\n \n 2022-06-30 10:15: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 1457\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:15:03',4,'2022-06-30 12:15:34',4,0,NULL,NULL,NULL,'5d76364b-1150-4bd7-b456-7844b2f28312'),(1458,'Clients given 4J weighing 4-5.9kg','Clients given 4J weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 4-5.9kg\n Clients given 4J weighing 4-5.9kg\n \n 2022-06-30 10:15:44 UTC\n \n 2022-06-30 10:37: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 1458\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:15:44',4,'2022-06-30 12:37:45',4,0,NULL,NULL,NULL,'8a4200ea-3da7-406f-9961-272c3898fe6c'),(1459,'Clients given 4D weighing 10-13.9kg','Clients given 4D weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 10-13.9kg\n Clients given 4D weighing 10-13.9kg\n \n 2022-06-30 10:18:04 UTC\n \n 2022-06-30 10:18: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 1459\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:18:04',4,'2022-06-30 12:18:39',4,0,NULL,NULL,NULL,'8a6e7ee5-2a61-4944-bfb4-bb47a5698f6c'),(1460,'Clients given 4D weighing 14-19.9kg','Clients given 4D weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 14-19.9kg\n Clients given 4D weighing 14-19.9kg\n \n 2022-06-30 10:19:54 UTC\n \n 2022-06-30 10:20: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 1460\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:19:54',4,'2022-06-30 12:20:26',4,0,NULL,NULL,NULL,'45092d9a-31f7-4734-bad7-6afa4af47c8c'),(1461,'Clients given 4J weighing 6-9.9kg','Clients given 4J weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 6-9.9kg\n Clients given 4J weighing 6-9.9kg\n \n 2022-06-30 10:21:51 UTC\n \n 2022-06-30 10:38: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 1461\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:21:51',4,'2022-06-30 12:38:14',4,0,NULL,NULL,NULL,'5f5b772e-63e5-4b96-b211-629491f33c0d'),(1462,'Clients given 4D weighing 20-24.9kg','Clients given 4D weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 20-24.9kg\n Clients given 4D weighing 20-24.9kg\n \n 2022-06-30 10:22:05 UTC\n \n 2022-06-30 10:22: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 1462\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:22:05',4,'2022-06-30 12:22:46',4,0,NULL,NULL,NULL,'a0d8e3b8-722d-491c-bd0f-fa90956f51db'),(1463,'Clients given 4J weighing 10-13.9kg','Clients given 4J weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 10-13.9kg\n Clients given 4J weighing 10-13.9kg\n \n 2022-06-30 10:22:53 UTC\n \n 2022-06-30 10:23: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 1463\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight >=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:22:53',4,'2022-06-30 12:23:31',4,0,NULL,NULL,NULL,'790715b6-630c-4294-8577-6f4815e44797'),(1464,'Clients given 4J weighing 14-19.9kg','Clients given 4J weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 14-19.9kg\n Clients given 4J weighing 14-19.9kg\n \n 2022-06-30 10:24:03 UTC\n \n 2022-06-30 10:42: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 1464\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:24:03',4,'2022-06-30 12:42:31',4,0,NULL,NULL,NULL,'08528ef7-fb50-42e0-b520-afb3ecedbad2'),(1465,'Clients given 4D weighing 25-34.9kg','Clients given 4D weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 25-34.9kg\n Clients given 4D weighing 25-34.9kg\n \n 2022-06-30 10:24:49 UTC\n \n 2022-06-30 10:25: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 1465\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:24:49',4,'2022-06-30 12:25:21',4,0,NULL,NULL,NULL,'527ab6b7-03a7-4ad5-86ae-2c494b0b3cb0'),(1466,'Clients given 4J weighing 20-24.9kg','Clients given 4J weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 20-24.9kg\n Clients given 4J weighing 20-24.9kg\n \n 2022-06-30 10:24:52 UTC\n \n 2022-06-30 10: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 1466\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:24:52',4,'2022-06-30 12:35:11',4,0,NULL,NULL,NULL,'65757623-b703-423a-a092-06e04ed87180'),(1467,'Clients given 4D weighing >= 35kg','Clients given 4D weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing >= 35kg\n Clients given 4D weighing >= 35kg\n \n 2022-06-30 10:27:51 UTC\n \n 2022-06-30 10:28: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 1467\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 2204)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:27:51',4,'2022-06-30 12:28:22',4,0,NULL,NULL,NULL,'242cded5-b463-489d-a941-901a590d1d47'),(1468,'Clients given 4J weighing 25-34.9kg','Clients given 4J weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 25-34.9kg\n Clients given 4J weighing 25-34.9kg\n \n 2022-06-30 10:28:09 UTC\n \n 2022-06-30 10:35: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 1468\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:28:09',4,'2022-06-30 12:35:35',4,0,NULL,NULL,NULL,'83bc989a-e2b7-4bed-a628-fc59a59c1ba6'),(1469,'Clients given 4J weighing >=35kg','Clients given 4J weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing >=35kg\n Clients given 4J weighing >=35kg\n \n 2022-06-30 10:28:53 UTC\n \n 2022-06-30 10:29: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 1469\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4J \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:28:53',4,'2022-06-30 12:29:33',4,0,NULL,NULL,NULL,'72f98838-eb15-4cb6-a914-0852726e5647'),(1470,'Clients given 4E weighing 0-3.9kg','Clients given 4E weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 0-3.9kg\n Clients given 4E weighing 0-3.9kg\n \n 2022-06-30 10:29:43 UTC\n \n 2022-06-30 10:30: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 1470\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:29:43',4,'2022-06-30 12:30:41',4,0,NULL,NULL,NULL,'0ab11624-0249-40a0-971b-e3e8bb23ea70'),(1471,'Clients given 4E weighing 4-5.9kg','Clients given 4E weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 4-5.9kg\n Clients given 4E weighing 4-5.9kg\n \n 2022-06-30 10:33:36 UTC\n \n 2022-06-30 10:34: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 1471\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:33:36',4,'2022-06-30 12:34:17',4,0,NULL,NULL,NULL,'8519fd1c-bd73-43d6-8c51-e76191131ca3'),(1472,'Clients given 4E weighing 6-9.9kg','Clients given 4E weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 6-9.9kg\n Clients given 4E weighing 6-9.9kg\n \n 2022-06-30 10:35:26 UTC\n \n 2022-06-30 10:35: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 1472\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:35:26',4,'2022-06-30 12:35:58',4,0,NULL,NULL,NULL,'c165720f-b024-49dc-8775-49de3830ea6f'),(1473,'Clients given 4E weighing 10-13.9kg','Clients given 4E weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 10-13.9kg\n Clients given 4E weighing 10-13.9kg\n \n 2022-06-30 10:36:35 UTC\n \n 2022-06-30 10:37: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 java.lang.String\n true\n \n \n 1473\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:36:35',4,'2022-06-30 12:37:06',4,0,NULL,NULL,NULL,'c14db25f-8596-4fae-ab12-430a740aa487'),(1474,'Clients given 4E weighing 14-19.9kg','Clients given 4E weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 14-19.9kg\n Clients given 4E weighing 14-19.9kg\n \n 2022-06-30 10:38:12 UTC\n \n 2022-06-30 10:38: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 1474\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:38:12',4,'2022-06-30 12:38:40',4,0,NULL,NULL,NULL,'bc5dc540-6696-47aa-a512-1cb7a78d7377'),(1475,'Clients given 4E weighing 20-24.9kg','Clients given 4E weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 20-24.9kg\n Clients given 4E weighing 20-24.9kg\n \n 2022-06-30 10:40:04 UTC\n \n 2022-06-30 10:40: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 1475\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:40:04',4,'2022-06-30 12:40:46',4,0,NULL,NULL,NULL,'221244d7-0042-432a-a711-d9cccd4358ab'),(1476,'Clients given 4E weighing 25-34.9kg','Clients given 4E weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 25-34.9kg\n Clients given 4E weighing 25-34.9kg\n \n 2022-06-30 10:41:40 UTC\n \n 2022-06-30 10:42: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 1476\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:41:40',4,'2022-06-30 12:42:07',4,0,NULL,NULL,NULL,'9490638d-1289-4114-bbbc-724006e38d93'),(1477,'Clients given 4E weighing >= 35kg','Clients given 4E weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing >= 35kg\n Clients given 4E weighing >= 35kg\n \n 2022-06-30 10:43:04 UTC\n \n 2022-06-30 10:43: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 1477\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3679)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:43:04',4,'2022-06-30 12:43:31',4,0,NULL,NULL,NULL,'2bf8b315-8095-4176-ab7c-34d32e5302bb'),(1478,'Clients given 4F weighing 0-3.9kg','Clients given 4F weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 0-3.9kg\n Clients given 4F weighing 0-3.9kg\n \n 2022-06-30 10:44:22 UTC\n \n 2022-06-30 10:45: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 1478\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:44:22',4,'2022-06-30 12:45:07',4,0,NULL,NULL,NULL,'42b80ebc-ab48-48ca-a4f4-a20229c3e624'),(1479,'Clients given 4H weighing 0-3.9kg','Clients given 4H weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 0-3.9kg\n Clients given 4H weighing 0-3.9kg\n \n 2022-06-30 10:44:56 UTC\n \n 2022-06-30 10:45: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 1479\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:44:56',4,'2022-06-30 12:45:16',4,0,NULL,NULL,NULL,'4d8d584e-acb2-4935-b2ba-b1b175d8f7d5'),(1480,'Clients given 4H weighing 4-5.9kg','Clients given 4H weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 4-5.9kg\n Clients given 4H weighing 4-5.9kg\n \n 2022-06-30 10:46:13 UTC\n \n 2022-06-30 10:46: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 1480\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:46:13',4,'2022-06-30 12:46:36',4,0,NULL,NULL,NULL,'26f845a2-246d-468b-817a-9c60bdd078b9'),(1481,'Clients given 4F weighing 4-5.9kg','Clients given 4F weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 4-5.9kg\n Clients given 4F weighing 4-5.9kg\n \n 2022-06-30 10:46:29 UTC\n \n 2022-06-30 10:47: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 1481\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:46:29',4,'2022-06-30 12:47:02',4,0,NULL,NULL,NULL,'72862b43-6e4e-4a10-822f-ac5648433215'),(1482,'Clients given 4H weighing 6-9.9kg','Clients given 4H weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 6-9.9kg\n Clients given 4H weighing 6-9.9kg\n \n 2022-06-30 10:46:57 UTC\n \n 2022-06-30 10:47: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 1482\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:46:57',4,'2022-06-30 12:47:17',4,0,NULL,NULL,NULL,'01c48121-50df-46cb-8a3b-35623d584ebf'),(1483,'Clients given 4H weighing 10-13.9kg','Clients given 4H weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 10-13.9kg\n Clients given 4H weighing 10-13.9kg\n \n 2022-06-30 10:47:36 UTC\n \n 2022-06-30 10:48: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 1483\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:47:36',4,'2022-06-30 12:48:24',4,0,NULL,NULL,NULL,'d02359fe-619b-4a9c-871b-ae3aa3a98aa2'),(1484,'Clients given 4F weighing 6-9.9kg','Clients given 4F weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 6-9.9kg\n Clients given 4F weighing 6-9.9kg\n \n 2022-06-30 10:47:39 UTC\n \n 2022-06-30 10:48: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 1484\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:47:39',4,'2022-06-30 12:48:17',4,0,NULL,NULL,NULL,'b67ded87-6d0d-4d6a-8d86-01fffedfca86'),(1485,'Clients given 4F weighing 10-13.9kg','Clients given 4F weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 10-13.9kg\n Clients given 4F weighing 10-13.9kg\n \n 2022-06-30 10:48:47 UTC\n \n 2022-06-30 10:49: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 1485\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:48:47',4,'2022-06-30 12:49:12',4,0,NULL,NULL,NULL,'9ff30aca-0d8d-4fca-a3a9-13c0f28c48ac'),(1486,'Clients given 4H weighing 14-19.9kg','Clients given 4H weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 14-19.9kg\n Clients given 4H weighing 14-19.9kg\n \n 2022-06-30 10:48:50 UTC\n \n 2022-06-30 10:49: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 1486\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:48:50',4,'2022-06-30 12:49:09',4,0,NULL,NULL,NULL,'4477b341-8fb3-4d94-bc1a-cec68c45d5e8'),(1487,'Clients given 4F weighing 14-19.9kg','Clients given 4F weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 14-19.9kg\n Clients given 4F weighing 14-19.9kg\n \n 2022-06-30 10:49:43 UTC\n \n 2022-06-30 10: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 1487\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:49:43',4,'2022-06-30 12:50:08',4,0,NULL,NULL,NULL,'bc68c0e3-f9af-458a-9c48-e498e27e55cf'),(1488,'Clients given 4H weighing 20-24.9kg','Clients given 4H weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 20-24.9kg\n Clients given 4H weighing 20-24.9kg\n \n 2022-06-30 10:49:44 UTC\n \n 2022-06-30 10: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 1488\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:49:44',4,'2022-06-30 12:50:08',4,0,NULL,NULL,NULL,'db7df0b0-048e-4292-8047-aede481f516a'),(1489,'Clients given 4H weighing 25-34.9kg','Clients given 4H weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 25-34.9kg\n Clients given 4H weighing 25-34.9kg\n \n 2022-06-30 10:50:30 UTC\n \n 2022-06-30 10:50: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 1489\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:50:30',4,'2022-06-30 12:50:49',4,0,NULL,NULL,NULL,'8a0ffc3a-6f13-41d4-9012-80f7df387328'),(1490,'Clients given 4F weighing 20-24.9kg','Clients given 4F weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 20-24.9kg\n Clients given 4F weighing 20-24.9kg\n \n 2022-06-30 10:50:41 UTC\n \n 2022-06-30 10:51: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 1490\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:50:41',4,'2022-06-30 12:51:06',4,0,NULL,NULL,NULL,'acf07216-1652-4e83-9d65-6823c59981a8'),(1491,'Clients given 4H weighing >=35kg','Clients given 4H weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing >=35kg\n Clients given 4H weighing >=35kg\n \n 2022-06-30 10:51:17 UTC\n \n 2022-06-30 10:51: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 1491\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4685)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:51:17',4,'2022-06-30 12:51:51',4,0,NULL,NULL,NULL,'831a76ea-3a0d-4c8c-b68f-fcb26f67f6d8'),(1492,'Clients given 4F weighing 25-34.9kg','Clients given 4F weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 25-34.9kg\n Clients given 4F weighing 25-34.9kg\n \n 2022-06-30 10:51:46 UTC\n \n 2022-06-30 10:52:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1492\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:51:46',4,'2022-06-30 12:52:23',4,0,NULL,NULL,NULL,'3da33639-d791-4633-8e15-b41313cb55f1'),(1493,'Clients given 4F weighing >= 35kg','Clients given 4F weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing >= 35kg\n Clients given 4F weighing >= 35kg\n \n 2022-06-30 10:53:56 UTC\n \n 2022-06-30 10:54:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1493\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3680)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:53:56',4,'2022-06-30 12:54:23',4,0,NULL,NULL,NULL,'c7599281-45dd-4b73-8ab0-ea8e524b98d1'),(1494,'Clients given 4G weighing 0-3.9kg','Clients given 4G weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 0-3.9kg\n Clients given 4G weighing 0-3.9kg\n \n 2022-06-30 10:54:05 UTC\n \n 2022-06-30 10:54: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 1494\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:54:05',4,'2022-06-30 12:54:41',4,0,NULL,NULL,NULL,'2475b103-3fa8-4b29-bb87-fab00aa27257'),(1495,'Clients given 4G weighing 4-5.9kg','Clients given 4G weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 4-5.9kg\n Clients given 4G weighing 4-5.9kg\n \n 2022-06-30 10:55:47 UTC\n \n 2022-06-30 10:56: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 1495\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:55:47',4,'2022-06-30 12:56:15',4,0,NULL,NULL,NULL,'b7fef4f2-1d0c-4942-88e3-45c9535ef4bc'),(1496,'Clients given 4G weighing 6-9.9kg','Clients given 4G weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 6-9.9kg\n Clients given 4G weighing 6-9.9kg\n \n 2022-06-30 10:56:50 UTC\n \n 2022-06-30 10:57: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 1496\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:56:50',4,'2022-06-30 12:57:08',4,0,NULL,NULL,NULL,'2539084a-3b56-4fd2-b7b7-1d75b7403e4c'),(1497,'Clients given 4G weighing 10-13.9kg','Clients given 4G weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 10-13.9kg\n Clients given 4G weighing 10-13.9kg\n \n 2022-06-30 10:57:46 UTC\n \n 2022-06-30 10:58: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 1497\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:57:46',4,'2022-06-30 12:58:04',4,0,NULL,NULL,NULL,'f7e13045-87fd-45c5-9e4c-818fbcb84888'),(1498,'Clients given 5A weighing 0-3.9kg','Clients given 5A weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 0-3.9kg\n Clients given 5A weighing 0-3.9kg\n \n 2022-06-30 10:58:03 UTC\n \n 2022-06-30 10:59: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 1498\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:58:03',4,'2022-06-30 12:59:09',4,0,NULL,NULL,NULL,'87a82695-8e84-4f45-9b37-6fcfbdd68b9b'),(1499,'Clients given 4G weighing 14-19.9kg','Clients given 4G weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 14-19.9kg\n Clients given 4G weighing 14-19.9kg\n \n 2022-06-30 10:58:40 UTC\n \n 2022-06-30 10:58: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 1499\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:58:40',4,'2022-06-30 12:58:58',4,0,NULL,NULL,NULL,'91726710-94cf-4118-9c47-766cb5f11ae8'),(1500,'Clients given 4G weighing 20-24.9kg','Clients given 4G weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 20-24.9kg\n Clients given 4G weighing 20-24.9kg\n \n 2022-06-30 10:59:29 UTC\n \n 2022-06-30 10:59: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 1500\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 12:59:29',4,'2022-06-30 12:59:48',4,0,NULL,NULL,NULL,'e1070366-40ee-4f52-ae16-34a5de911a65'),(1501,'Clients given 4G weighing 25-34.9kg','Clients given 4G weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 25-34.9kg\n Clients given 4G weighing 25-34.9kg\n \n 2022-06-30 11:00:09 UTC\n \n 2022-06-30 13:47: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 1501\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:00:09',4,'2022-06-30 15:47:39',4,0,NULL,NULL,NULL,'d95d19d8-05d8-49d2-8b48-e0e179a7d99f'),(1502,'Clients given 5A weighing 4-5.9kg','Clients given 5A weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 4-5.9kg\n Clients given 5A weighing 4-5.9kg\n \n 2022-06-30 11:00:22 UTC\n \n 2022-06-30 11:01: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 1502\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:00:22',4,'2022-06-30 13:01:04',4,0,NULL,NULL,NULL,'5b216507-efb0-46a6-a948-08f4bc7a2bf2'),(1503,'Clients given 4G weighing >=35kg','Clients given 4G weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing >=35kg\n Clients given 4G weighing >=35kg\n \n 2022-06-30 11:00:59 UTC\n \n 2022-06-30 11: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 1503\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 4G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4684)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:00:59',4,'2022-06-30 13:01:21',4,0,NULL,NULL,NULL,'0aa0cdb4-feed-4504-ad23-50fdfbb94347'),(1504,'Clients given 5A weighing 6-9.9kg','Clients given 5A weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 6-9.9kg\n Clients given 5A weighing 6-9.9kg\n \n 2022-06-30 11:01:39 UTC\n \n 2022-06-30 11:02: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 1504\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:01:39',4,'2022-06-30 13:02:04',4,0,NULL,NULL,NULL,'8c1a3939-af3e-4859-bc97-cfb2a9d2e712'),(1505,'Clients given 5A weighing 10-13.9kg','Clients given 5A weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 10-13.9kg\n Clients given 5A weighing 10-13.9kg\n \n 2022-06-30 11:02:41 UTC\n \n 2022-06-30 11:03: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 1505\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:02:41',4,'2022-06-30 13:03:09',4,0,NULL,NULL,NULL,'3f90eaa0-49f7-4c6b-8ef4-9d75b1e83139'),(1506,'Clients given 5A weighing 14-19.9kg','Clients given 5A weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 14-19.9kg\n Clients given 5A weighing 14-19.9kg\n \n 2022-06-30 11:04:00 UTC\n \n 2022-06-30 11:04: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 1506\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:04:00',4,'2022-06-30 13:04:19',4,0,NULL,NULL,NULL,'f1b1f749-bfcc-4a13-b348-64c59866cc59'),(1507,'Clients given 5A weighing 20-24.9kg','Clients given 5A weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 20-24.9kg\n Clients given 5A weighing 20-24.9kg\n \n 2022-06-30 11:04:47 UTC\n \n 2022-06-30 11:05: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 1507\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:04:47',4,'2022-06-30 13:05:14',4,0,NULL,NULL,NULL,'abad239c-e77e-4577-9ce7-dec2f8fec968'),(1508,'Clients given 5H weighing 0-3.9kg','Clients given 5H weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 0-3.9kg\n Clients given 5H weighing 0-3.9kg\n \n 2022-06-30 11:05:16 UTC\n \n 2022-06-30 11:05: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 1508\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:05:16',4,'2022-06-30 13:05:45',4,0,NULL,NULL,NULL,'6197805b-306c-4d08-8146-fa728c86cad0'),(1509,'Clients given 5A weighing 25-34.9kg','Clients given 5A weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 25-34.9kg\n Clients given 5A weighing 25-34.9kg\n \n 2022-06-30 11:05:57 UTC\n \n 2022-06-30 11:06: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 1509\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:05:57',4,'2022-06-30 13:06:25',4,0,NULL,NULL,NULL,'56bc1e3d-3e39-4a2a-be29-f923f3403a9f'),(1510,'Clients given 5H weighing 4-5.9kg','Clients given 5H weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 4-5.9kg\n Clients given 5H weighing 4-5.9kg\n \n 2022-06-30 11:06:12 UTC\n \n 2022-06-30 11:06: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 1510\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:06:12',4,'2022-06-30 13:06:36',4,0,NULL,NULL,NULL,'f46b6d84-55a7-4fd0-af6d-da58bdfdadbc'),(1511,'Clients given 5A weighing >= 35kg','Clients given 5A weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing >= 35kg\n Clients given 5A weighing >= 35kg\n \n 2022-06-30 11:07:03 UTC\n \n 2022-06-30 11:07: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 1511\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3681)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:07:03',4,'2022-06-30 13:07:39',4,0,NULL,NULL,NULL,'7313b979-6116-4b8c-8d45-159dce135628'),(1512,'Clients given 5H weighing 6-9.9kg','Clients given 5H weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 6-9.9kg\n Clients given 5H weighing 6-9.9kg\n \n 2022-06-30 11:07:30 UTC\n \n 2022-06-30 11:07: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 1512\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:07:30',4,'2022-06-30 13:07:53',4,0,NULL,NULL,NULL,'b302e353-da5b-495a-92bf-ac972aa7f94e'),(1513,'Clients given 5B weighing 0-3.9kg','Clients given 5B weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 0-3.9kg\n Clients given 5B weighing 0-3.9kg\n \n 2022-06-30 11:08:51 UTC\n \n 2022-06-30 11: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 1513\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:08:51',4,'2022-06-30 13:09:51',4,0,NULL,NULL,NULL,'01fe5f00-9f8a-44c2-ba40-160f9d05d725'),(1514,'Clients given 5H weighing 10-13.9kg','Clients given 5H weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 10-13.9kg\n Clients given 5H weighing 10-13.9kg\n \n 2022-06-30 11:08:53 UTC\n \n 2022-06-30 11:09: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 1514\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:08:53',4,'2022-06-30 13:09:15',4,0,NULL,NULL,NULL,'fb13cd05-3a8a-4559-9bf2-8f2f4e2df601'),(1515,'Clients given 5H weighing 14-19.9kg','Clients given 5H weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 14-19.9kg\n Clients given 5H weighing 14-19.9kg\n \n 2022-06-30 11:09:36 UTC\n \n 2022-06-30 11:09: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 1515\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:09:36',4,'2022-06-30 13:09:52',4,0,NULL,NULL,NULL,'b99e2ade-ec65-4904-a6ca-e333b39322b6'),(1516,'Clients given 5H weighing 20-24.9kg','Clients given 5H weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 20-24.9kg\n Clients given 5H weighing 20-24.9kg\n \n 2022-06-30 11:10:25 UTC\n \n 2022-06-30 11:10: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 1516\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:10:25',4,'2022-06-30 13:10:43',4,0,NULL,NULL,NULL,'66408707-e4ad-4d2b-973c-77cd0220240c'),(1517,'Clients given 5B weighing 4-5.9kg','Clients given 5B weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 4-5.9kg\n Clients given 5B weighing 4-5.9kg\n \n 2022-06-30 11:10:36 UTC\n \n 2022-06-30 11:11: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 1517\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:10:36',4,'2022-06-30 13:11:24',4,0,NULL,NULL,NULL,'ad0df8d9-d10d-4991-aa03-f7a96d902f69'),(1518,'Clients given 5H weighing 25-34.9kg','Clients given 5H weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 25-34.9kg\n Clients given 5H weighing 25-34.9kg\n \n 2022-06-30 11:11:12 UTC\n \n 2022-06-30 11:11: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 1518\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:11:12',4,'2022-06-30 13:11:36',4,0,NULL,NULL,NULL,'67f0bd48-1cbf-4d6b-b037-1789f1b9f734'),(1519,'Clients given 5B weighing 6-9.9kg','Clients given 5B weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 6-9.9kg\n Clients given 5B weighing 6-9.9kg\n \n 2022-06-30 11:11:51 UTC\n \n 2022-06-30 11:12: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 1519\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:11:51',4,'2022-06-30 13:12:15',4,0,NULL,NULL,NULL,'fcd13eef-bda1-46af-993f-ad29378c624a'),(1520,'Clients given 5H weighing >=35kg','Clients given 5H weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing >=35kg\n Clients given 5H weighing >=35kg\n \n 2022-06-30 11:12:13 UTC\n \n 2022-06-30 11:12: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 1520\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5H \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4701)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:12:13',4,'2022-06-30 13:12:39',4,0,NULL,NULL,NULL,'837029cf-0489-433f-b1f4-93207eb1bae5'),(1521,'Clients given 5B weighing 10-13.9kg','Clients given 5B weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 10-13.9kg\n Clients given 5B weighing 10-13.9kg\n \n 2022-06-30 11:13:00 UTC\n \n 2022-06-30 11:13: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 1521\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:13:00',4,'2022-06-30 13:13:25',4,0,NULL,NULL,NULL,'f90822d7-8137-44bf-9b66-0022b61e1ece'),(1522,'Clients given 5B weighing 14-19.9kg','Clients given 5B weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 14-19.9kg\n Clients given 5B weighing 14-19.9kg\n \n 2022-06-30 11:13:55 UTC\n \n 2022-06-30 11:14: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 1522\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:13:55',4,'2022-06-30 13:14:25',4,0,NULL,NULL,NULL,'247d8f89-0b72-4010-9328-a87600bd22d9'),(1523,'Clients given 5B weighing 20-24.9kg','Clients given 5B weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 20-24.9kg\n Clients given 5B weighing 20-24.9kg\n \n 2022-06-30 11:14:57 UTC\n \n 2022-06-30 11:15: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 1523\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:14:57',4,'2022-06-30 13:15:40',4,0,NULL,NULL,NULL,'b9f0c6b6-a9f7-4ec3-9563-92a43def2068'),(1524,'Clients given 5G weighing 0-3.9kg','Clients given 5G weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 0-3.9kg\n Clients given 5G weighing 0-3.9kg\n \n 2022-06-30 11:15:26 UTC\n \n 2022-06-30 11:15: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 1524\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <= 3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:15:26',4,'2022-06-30 13:15:45',4,0,NULL,NULL,NULL,'d6899230-0f9b-4682-8822-478bfa1ad941'),(1525,'Clients given 5G weighing 4-5.9kg','Clients given 5G weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 4-5.9kg\n Clients given 5G weighing 4-5.9kg\n \n 2022-06-30 11:16:09 UTC\n \n 2022-06-30 11:16: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 1525\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <= 5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:16:09',4,'2022-06-30 13:16:28',4,0,NULL,NULL,NULL,'e0607707-f27c-434f-a5cd-44ed04531b3d'),(1526,'Clients given 5B weighing 25-34.9kg','Clients given 5B weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 25-34.9kg\n Clients given 5B weighing 25-34.9kg\n \n 2022-06-30 11:16:20 UTC\n \n 2022-06-30 11:16: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 1526\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:16:20',4,'2022-06-30 13:16:49',4,0,NULL,NULL,NULL,'bd44e473-7f7a-4848-beb6-414f3c87ada1'),(1527,'Clients given 5G weighing 6-9.9kg','Clients given 5G weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 6-9.9kg\n Clients given 5G weighing 6-9.9kg\n \n 2022-06-30 11:17:00 UTC\n \n 2022-06-30 11:17: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 1527\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <= 9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:17:00',4,'2022-06-30 13:17:45',4,0,NULL,NULL,NULL,'2fa35676-ccce-4bde-a76f-65b9de55fd54'),(1528,'Clients given 5B weighing >= 35kg','Clients given 5B weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing >= 35kg\n Clients given 5B weighing >= 35kg\n \n 2022-06-30 11:17:28 UTC\n \n 2022-06-30 11: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 1528\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3682)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:17:28',4,'2022-06-30 13:17:58',4,0,NULL,NULL,NULL,'25a796fe-9437-4e38-9c95-6ef6bb295e8e'),(1529,'Clients given 5G weighing 10-13.9kg','Clients given 5G weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 10-13.9kg\n Clients given 5G weighing 10-13.9kg\n \n 2022-06-30 11:18:10 UTC\n \n 2022-06-30 11:18: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 1529\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:18:10',4,'2022-06-30 13:18:29',4,0,NULL,NULL,NULL,'00ae6c3c-d1c6-44b8-ae77-0b0dadd15e1f'),(1530,'Clients given 5C weighing 0-3.9kg','Clients given 5C weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 0-3.9kg\n Clients given 5C weighing 0-3.9kg\n \n 2022-06-30 11:19:00 UTC\n \n 2022-06-30 11:20: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 1530\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:19:00',4,'2022-06-30 13:20:11',4,0,NULL,NULL,NULL,'1e058b14-9ac4-4412-96ab-33fd04c575b0'),(1531,'Clients given 5G weighing 14-19.9kg','Clients given 5G weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 14-19.9kg\n Clients given 5G weighing 14-19.9kg\n \n 2022-06-30 11:19:16 UTC\n \n 2022-06-30 11:19: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 1531\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:19:16',4,'2022-06-30 13:19:29',4,0,NULL,NULL,NULL,'2d4f2764-5ad4-4259-88bc-d6cfe29e5365'),(1532,'Clients given 5G weighing 20-24.9kg','Clients given 5G weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 20-24.9kg\n Clients given 5G weighing 20-24.9kg\n \n 2022-06-30 11:19:50 UTC\n \n 2022-06-30 11:20: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 1532\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:19:50',4,'2022-06-30 13:20:09',4,0,NULL,NULL,NULL,'5869ce40-ff99-4614-b3f5-e058345f91a8'),(1533,'Clients given 5G weighing 25 -34.9kg','Clients given 5G weighing 25 -34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 25 -34.9kg\n Clients given 5G weighing 25 -34.9kg\n \n 2022-06-30 11:20:43 UTC\n \n 2022-06-30 11:21: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 1533\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:20:43',4,'2022-06-30 13:21:01',4,0,NULL,NULL,NULL,'3134cfcd-283c-43a2-bb15-8ae6356ebbdd'),(1534,'Clients given 5C weighing 4-5.9kg','Clients given 5C weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 4-5.9kg\n Clients given 5C weighing 4-5.9kg\n \n 2022-06-30 11:21:08 UTC\n \n 2022-06-30 11: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 1534\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:21:08',4,'2022-06-30 13:21:53',4,0,NULL,NULL,NULL,'b6a6e9f5-36ec-414e-95ec-b4a4bb1e7f77'),(1535,'Clients given 5G weighing >=35kg','Clients given 5G weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing >=35kg\n Clients given 5G weighing >=35kg\n \n 2022-06-30 11:21:23 UTC\n \n 2022-06-30 11: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 1535\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5G \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4700)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:21:23',4,'2022-06-30 13:21:44',4,0,NULL,NULL,NULL,'cb219c31-fab1-4f82-a202-48a4a8744a6e'),(1536,'Clients given 5C weighing 6-9.9kg','Clients given 5C weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 6-9.9kg\n Clients given 5C weighing 6-9.9kg\n \n 2022-06-30 11:22:17 UTC\n \n 2022-06-30 11:22: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 1536\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:22:17',4,'2022-06-30 13:22:40',4,0,NULL,NULL,NULL,'e96a3e05-ee48-46f8-ad52-7ea11c785404'),(1537,'Clients given 5F weighing 0-3.9kg','Clients given 5F weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 0-3.9kg\n Clients given 5F weighing 0-3.9kg\n \n 2022-06-30 11:22:53 UTC\n \n 2022-06-30 11:23: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 1537\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight > 0 and _weight <= 3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:22:53',4,'2022-06-30 13:23:59',4,0,NULL,NULL,NULL,'3ed934cc-c2f7-4f9c-ab10-1794412389f1'),(1538,'Clients given 5C weighing 10-13.9kg','Clients given 5C weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 10-13.9kg\n Clients given 5C weighing 10-13.9kg\n \n 2022-06-30 11:23:09 UTC\n \n 2022-06-30 11:23: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 1538\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:23:09',4,'2022-06-30 13:23:30',4,0,NULL,NULL,NULL,'35aa87a9-9aec-42c6-a80d-1f71d2be1ef8'),(1539,'Clients given 5C weighing 14-19.9kg','Clients given 5C weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 14-19.9kg\n Clients given 5C weighing 14-19.9kg\n \n 2022-06-30 11:23:56 UTC\n \n 2022-06-30 11: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 1539\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:23:56',4,'2022-06-30 13:24:22',4,0,NULL,NULL,NULL,'8827cdb6-b0b0-4dad-84d7-d06aae03ac3b'),(1540,'Clients given 5C weighing 20-24.9kg','Clients given 5C weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 20-24.9kg\n Clients given 5C weighing 20-24.9kg\n \n 2022-06-30 11:24:56 UTC\n \n 2022-06-30 11: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 1540\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:24:56',4,'2022-06-30 13:25:34',4,0,NULL,NULL,NULL,'7cc30e9c-763c-454b-b961-d19c47d2da6a'),(1541,'Clients given 5F weighing 4-5.9kg','Clients given 5F weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 4-5.9kg\n Clients given 5F weighing 4-5.9kg\n \n 2022-06-30 11:24:57 UTC\n \n 2022-06-30 11:26:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1541\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <= 5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:24:57',4,'2022-06-30 13:26:23',4,0,NULL,NULL,NULL,'86aec40b-a4e3-49f5-8c61-1b4395bddd75'),(1542,'Clients given 5F weighing 6-9.9kg','Clients given 5F weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 6-9.9kg\n Clients given 5F weighing 6-9.9kg\n \n 2022-06-30 11:25:26 UTC\n \n 2022-06-30 11: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 1542\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <= 9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:25:26',4,'2022-06-30 13:25:52',4,0,NULL,NULL,NULL,'74ddbe48-ab4a-40e2-be97-c0ecfca4ec3d'),(1543,'Clients given 5C weighing 25-34.9kg','Clients given 5C weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 25-34.9kg\n Clients given 5C weighing 25-34.9kg\n \n 2022-06-30 11:26:03 UTC\n \n 2022-06-30 11:26: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 1543\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:26:03',4,'2022-06-30 13:26:35',4,0,NULL,NULL,NULL,'62831d13-bff3-4d96-b097-03c7f656489c'),(1544,'Clients given 5F weighing 10-13.9kg','Clients given 5F weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 10-13.9kg\n Clients given 5F weighing 10-13.9kg\n \n 2022-06-30 11:26:51 UTC\n \n 2022-06-30 11:27: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 1544\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:26:51',4,'2022-06-30 13:27:08',4,0,NULL,NULL,NULL,'32b14f2b-ab48-4905-a130-7cc98fadc7a3'),(1545,'Clients given 5C weighing >= 35kg','Clients given 5C weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing >= 35kg\n Clients given 5C weighing >= 35kg\n \n 2022-06-30 11:27:06 UTC\n \n 2022-06-30 11:27: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 1545\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4696)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:27:06',4,'2022-06-30 13:27:33',4,0,NULL,NULL,NULL,'2253da71-2fae-4683-87c0-4e876e27b5d9'),(1546,'Clients given 5F weighing 14-19.9kg','Clients given 5F weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 14-19.9kg\n Clients given 5F weighing 14-19.9kg\n \n 2022-06-30 11:27:37 UTC\n \n 2022-06-30 11: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 1546\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:27:37',4,'2022-06-30 13:27:52',4,0,NULL,NULL,NULL,'ce94925c-9501-475d-8ab6-9a34881d6c9a'),(1547,'Clients given 5F weighing 20-24.9kg','Clients given 5F weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 20-24.9kg\n Clients given 5F weighing 20-24.9kg\n \n 2022-06-30 11:28:13 UTC\n \n 2022-06-30 11:28: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 1547\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:28:13',4,'2022-06-30 13:28:32',4,0,NULL,NULL,NULL,'4e2fdf19-88d3-404b-8467-adbaba647c6c'),(1548,'Clients given 5D weighing 0-3.9kg','Clients given 5D weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 0-3.9kg\n Clients given 5D weighing 0-3.9kg\n \n 2022-06-30 11:28:24 UTC\n \n 2022-06-30 11:29: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 1548\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:28:24',4,'2022-06-30 13:29:14',4,0,NULL,NULL,NULL,'9b7dc1a8-9c16-4ece-bf35-c13c45e27fd9'),(1549,'Clients given 5F weighing 25-34.9kg','Clients given 5F weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 25-34.9kg\n Clients given 5F weighing 25-34.9kg\n \n 2022-06-30 11:28:59 UTC\n \n 2022-06-30 11:29: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 1549\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:28:59',4,'2022-06-30 13:29:15',4,0,NULL,NULL,NULL,'8a336065-e783-4b0b-bfba-d49c0507171c'),(1550,'Clients given 5D weighing 4-5.9kg','Clients given 5D weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 4-5.9kg\n Clients given 5D weighing 4-5.9kg\n \n 2022-06-30 11:29:51 UTC\n \n 2022-06-30 11:30: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 1550\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:29:51',4,'2022-06-30 13:30:26',4,0,NULL,NULL,NULL,'19fcd7c2-7d0e-4f89-8893-b7e56a90f565'),(1551,'Clients given 5F weighing >=35kg','Clients given 5F weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing >=35kg\n Clients given 5F weighing >=35kg\n \n 2022-06-30 11:30:09 UTC\n \n 2022-06-30 11:30: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 1551\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4699)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:30:09',4,'2022-06-30 13:30:21',4,0,NULL,NULL,NULL,'8d926451-29fe-44cb-9898-a0aed10c3786'),(1552,'Clients given 5D weighing 6-9.9kg','Clients given 5D weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 6-9.9kg\n Clients given 5D weighing 6-9.9kg\n \n 2022-06-30 11:30:53 UTC\n \n 2022-06-30 11:31: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 1552\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:30:53',4,'2022-06-30 13:31:29',4,0,NULL,NULL,NULL,'c4e2b4a6-62d3-4828-9088-05f88efd29d0'),(1553,'Clients given 5D weighing 10-13.9kg','Clients given 5D weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 10-13.9kg\n Clients given 5D weighing 10-13.9kg\n \n 2022-06-30 11:32:07 UTC\n \n 2022-06-30 11:32: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 1553\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:32:07',4,'2022-06-30 13:32:56',4,0,NULL,NULL,NULL,'af887c72-8ee7-4273-abe0-8755f691eeb7'),(1554,'Clients given 5E weighing 0-3.9kg','Clients given 5E weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 0-3.9kg\n Clients given 5E weighing 0-3.9kg\n \n 2022-06-30 11:33:14 UTC\n \n 2022-06-30 11:33: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 1554\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 0 and _weight <= 3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:33:14',4,'2022-06-30 13:33:27',4,0,NULL,NULL,NULL,'e79351a3-8b87-48de-879e-7f531c97ae16'),(1555,'Clients given 5D weighing 14-19.9kg','Clients given 5D weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 14-19.9kg\n Clients given 5D weighing 14-19.9kg\n \n 2022-06-30 11:33:21 UTC\n \n 2022-06-30 11:33: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 1555\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:33:21',4,'2022-06-30 13:33:49',4,0,NULL,NULL,NULL,'412170be-ff0c-4690-bc21-2fe362faafb1'),(1556,'Clients given 5E weighing 4-5.9kg','Clients given 5E weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 4-5.9kg\n Clients given 5E weighing 4-5.9kg\n \n 2022-06-30 11:34:03 UTC\n \n 2022-06-30 11: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 1556\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <= 5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:34:03',4,'2022-06-30 13:34:21',4,0,NULL,NULL,NULL,'a6067fc6-8c70-4691-aa23-3e5a7973d4e4'),(1557,'Clients given 5D weighing 20-24.9kg','Clients given 5D weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 20-24.9kg\n Clients given 5D weighing 20-24.9kg\n \n 2022-06-30 11:34:31 UTC\n \n 2022-06-30 11:34: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 1557\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:34:31',4,'2022-06-30 13:34:56',4,0,NULL,NULL,NULL,'b12b32c4-ae91-44c1-bb7a-f2a4f0f74dcc'),(1558,'Clients given 5E weighing 6-9.9kg','Clients given 5E weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 6-9.9kg\n Clients given 5E weighing 6-9.9kg\n \n 2022-06-30 11:34:43 UTC\n \n 2022-06-30 11:35: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 1558\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <= 9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:34:43',4,'2022-06-30 13:35:02',4,0,NULL,NULL,NULL,'ddbb6383-120a-4cfc-b376-eb9ec22e891b'); INSERT INTO `serialized_object` VALUES (1559,'Clients given 5E weighing 10-13.9kg','Clients given 5E weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 10-13.9kg\n Clients given 5E weighing 10-13.9kg\n \n 2022-06-30 11:35:22 UTC\n \n 2022-06-30 11:35: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 1559\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:35:22',4,'2022-06-30 13:35:39',4,0,NULL,NULL,NULL,'9334b5ec-d46f-465b-91f5-aba7e4f590a0'),(1560,'Clients given 5D weighing 25-34.9kg','Clients given 5D weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 25-34.9kg\n Clients given 5D weighing 25-34.9kg\n \n 2022-06-30 11:35:31 UTC\n \n 2022-06-30 11:35: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 1560\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:35:31',4,'2022-06-30 13:35:55',4,0,NULL,NULL,NULL,'88ff4abe-3367-4de0-be20-eaa6991568ce'),(1561,'Clients given 5E weighing 14-19.9kg','Clients given 5E weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 14-19.9kg\n Clients given 5E weighing 14-19.9kg\n \n 2022-06-30 11:36:01 UTC\n \n 2022-06-30 11:36: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 1561\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:36:01',4,'2022-06-30 13:36:19',4,0,NULL,NULL,NULL,'1514aaa6-288c-423b-96e6-ae5ee9074647'),(1562,'Clients given 5E weighing 20-24.9kg','Clients given 5E weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 20-24.9kg\n Clients given 5E weighing 20-24.9kg\n \n 2022-06-30 11:36:43 UTC\n \n 2022-06-30 11:37: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 1562\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:36:43',4,'2022-06-30 13:37:37',4,0,NULL,NULL,NULL,'28e98d97-dc6d-412f-89cb-3f19cd4d38b9'),(1563,'Clients given 5D weighing >= 35kg','Clients given 5D weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing >= 35kg\n Clients given 5D weighing >= 35kg\n \n 2022-06-30 11:36:48 UTC\n \n 2022-06-30 11:37: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 1563\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4697)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:36:48',4,'2022-06-30 13:37:33',4,0,NULL,NULL,NULL,'b4d8909f-2edb-4730-bf71-446d2fd8867c'),(1564,'Clients given 5E weighing 25-34.9kg','Clients given 5E weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 25-34.9kg\n Clients given 5E weighing 25-34.9kg\n \n 2022-06-30 11:37:59 UTC\n \n 2022-06-30 11:38: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 1564\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:37:59',4,'2022-06-30 13:38:17',4,0,NULL,NULL,NULL,'decbe846-1d21-400e-93c7-d535d80c75c2'),(1565,'Clients given 6A weighing 0-3.9kg','Clients given 6A weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 0-3.9kg\n Clients given 6A weighing 0-3.9kg\n \n 2022-06-30 11:38:28 UTC\n \n 2022-06-30 11:40: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 1565\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:38:28',4,'2022-06-30 13:40:45',4,0,NULL,NULL,NULL,'9612971e-a174-4a5f-8fbd-59eec5a601b2'),(1566,'Clients given 5E weighing >=35kg','Clients given 5E weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing >=35kg\n Clients given 5E weighing >=35kg\n \n 2022-06-30 11:38:46 UTC\n \n 2022-06-30 11:39: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 1566\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 5E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4698)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:38:46',4,'2022-06-30 13:39:07',4,0,NULL,NULL,NULL,'8e471ec5-2e65-4ade-9508-52eabac321a3'),(1567,'Clients given 6F weighing 0-3.9kg','Clients given 6F weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 0-3.9kg\n Clients given 6F weighing 0-3.9kg\n \n 2022-06-30 11:41:42 UTC\n \n 2022-06-30 11:42: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 1567\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:41:42',4,'2022-06-30 13:42:21',4,0,NULL,NULL,NULL,'21f2534a-381c-427b-85d0-2e8a156f55cc'),(1568,'Clients given 6A weighing 4-5.9kg','Clients given 6A weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 4-5.9kg\n Clients given 6A weighing 4-5.9kg\n \n 2022-06-30 11:42:04 UTC\n \n 2022-06-30 11:42: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 1568\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:42:04',4,'2022-06-30 13:42:28',4,0,NULL,NULL,NULL,'349f5e74-fd1f-46ca-b279-089ec17daa3c'),(1569,'Clients given 6F weighing 4-5.9kg','Clients given 6F weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 4-5.9kg\n Clients given 6F weighing 4-5.9kg\n \n 2022-06-30 11:42:52 UTC\n \n 2022-06-30 11:43: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 1569\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:42:52',4,'2022-06-30 13:43:10',4,0,NULL,NULL,NULL,'6d6fd933-e915-4eb2-aa0a-5f9a3fc39c9e'),(1570,'Clients given 6A weighing 6-9.9kg','Clients given 6A weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 6-9.9kg\n Clients given 6A weighing 6-9.9kg\n \n 2022-06-30 11:42:56 UTC\n \n 2022-06-30 11:43: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 1570\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:42:56',4,'2022-06-30 13:43:18',4,0,NULL,NULL,NULL,'d6cf3e57-fba8-4961-83e9-e0c69b152e91'),(1571,'Clients given 6F weighing 6-9.9kg','Clients given 6F weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 6-9.9kg\n Clients given 6F weighing 6-9.9kg\n \n 2022-06-30 11:43:28 UTC\n \n 2022-06-30 11:43: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 1571\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:43:28',4,'2022-06-30 13:43:45',4,0,NULL,NULL,NULL,'07ebdb1b-42fd-4338-9880-b53a0e857d14'),(1572,'Clients given 6A weighing 10-13.9kg','Clients given 6A weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 10-13.9kg\n Clients given 6A weighing 10-13.9kg\n \n 2022-06-30 11:43:45 UTC\n \n 2022-06-30 11:44: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 1572\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:43:45',4,'2022-06-30 13:44:11',4,0,NULL,NULL,NULL,'de6af126-f558-4acf-b061-982dbfac0025'),(1573,'Clients given 6F weighing 10-13.9kg','Clients given 6F weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 10-13.9kg\n Clients given 6F weighing 10-13.9kg\n \n 2022-06-30 11:44:06 UTC\n \n 2022-06-30 11:44: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 1573\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:44:06',4,'2022-06-30 13:44:31',4,0,NULL,NULL,NULL,'e77aeb5b-70e2-46a1-9451-be37911a5dc0'),(1574,'Clients given 6A weighing 14-19.9kg','Clients given 6A weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 14-19.9kg\n Clients given 6A weighing 14-19.9kg\n \n 2022-06-30 11:44:40 UTC\n \n 2022-06-30 11: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 1574\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:44:40',4,'2022-06-30 13:45:08',4,0,NULL,NULL,NULL,'6850d21e-415b-4941-aa12-ddcf45ebf1cf'),(1575,'Clients given 6F weighing 14-19.9kg','Clients given 6F weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 14-19.9kg\n Clients given 6F weighing 14-19.9kg\n \n 2022-06-30 11:44:51 UTC\n \n 2022-06-30 11:45: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 1575\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:44:51',4,'2022-06-30 13:45:07',4,0,NULL,NULL,NULL,'bffbdb83-5c53-4429-baca-46ef480cbbdd'),(1576,'Clients given 6A weighing 20-24.9kg','Clients given 6A weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 20-24.9kg\n Clients given 6A weighing 20-24.9kg\n \n 2022-06-30 11:45:34 UTC\n \n 2022-06-30 11:46: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 1576\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:45:34',4,'2022-06-30 13:46:03',4,0,NULL,NULL,NULL,'00c9ee8c-dd26-4de8-8d76-65235331fc58'),(1577,'Clients given 6F weighing 20-24.9kg','Clients given 6F weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 20-24.9kg\n Clients given 6F weighing 20-24.9kg\n \n 2022-06-30 11:45:40 UTC\n \n 2022-06-30 11:46: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 1577\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:45:40',4,'2022-06-30 13:46:04',4,0,NULL,NULL,NULL,'1907619e-e315-4136-b63d-ebb12d9a8fc1'),(1578,'Clients given 6F weighing 25-34.9kg','Clients given 6F weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 25-34.9kg\n Clients given 6F weighing 25-34.9kg\n \n 2022-06-30 11:46:30 UTC\n \n 2022-06-30 11:46: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 1578\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:46:30',4,'2022-06-30 13:46:55',4,0,NULL,NULL,NULL,'67151923-545c-44f9-955c-705bd4b86bd8'),(1579,'Clients given 6A weighing 25-34.9kg','Clients given 6A weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 25-34.9kg\n Clients given 6A weighing 25-34.9kg\n \n 2022-06-30 11:46:33 UTC\n \n 2022-06-30 11:46: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 1579\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:46:33',4,'2022-06-30 13:46:56',4,0,NULL,NULL,NULL,'c4410a3f-a272-4f5a-8b68-c293b482c8f2'),(1580,'Clients given 6F weighing >=35kg','Clients given 6F weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing >=35kg\n Clients given 6F weighing >=35kg\n \n 2022-06-30 11:47:14 UTC\n \n 2022-06-30 11:47: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 1580\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6F \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4705)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:47:14',4,'2022-06-30 13:47:34',4,0,NULL,NULL,NULL,'88e71ca5-8e27-438a-ad22-12007acc675a'),(1581,'Clients given 6A weighing >= 35kg','Clients given 6A weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing >= 35kg\n Clients given 6A weighing >= 35kg\n \n 2022-06-30 11:47:26 UTC\n \n 2022-06-30 11:48: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 1581\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6A \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3686)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:47:26',4,'2022-06-30 13:48:10',4,0,NULL,NULL,NULL,'120fc355-ea4b-4d74-9df3-713f396ad4d5'),(1582,'Clients given 6B weighing 0-3.9kg','Clients given 6B weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 0-3.9kg\n Clients given 6B weighing 0-3.9kg\n \n 2022-06-30 11:49:06 UTC\n \n 2022-06-30 11:49: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 1582\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:49:06',4,'2022-06-30 13:49:59',4,0,NULL,NULL,NULL,'c94b83be-7708-46c9-803c-369d803ce612'),(1583,'Clients given 6E weighing 0-3.9kg','Clients given 6E weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 0-3.9kg\n Clients given 6E weighing 0-3.9kg\n \n 2022-06-30 11:49:10 UTC\n \n 2022-06-30 11:49: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 1583\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:49:10',4,'2022-06-30 13:49:41',4,0,NULL,NULL,NULL,'79f4464f-be3a-4f76-b911-1324264edb34'),(1584,'Clients given 6E weighing 4-5.9kg','Clients given 6E weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 4-5.9kg\n Clients given 6E weighing 4-5.9kg\n \n 2022-06-30 11:50:19 UTC\n \n 2022-06-30 11:50: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 1584\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:50:19',4,'2022-06-30 13:50:39',4,0,NULL,NULL,NULL,'c940a6d2-b183-4f3d-99c3-757c98c1d95d'),(1585,'Clients given 6B weighing 4-5.9kg','Clients given 6B weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 4-5.9kg\n Clients given 6B weighing 4-5.9kg\n \n 2022-06-30 11:50:41 UTC\n \n 2022-06-30 11:51: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 1585\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:50:41',4,'2022-06-30 13:51:04',4,0,NULL,NULL,NULL,'b03e49d3-e03b-4a31-b0c9-dc33942ca80b'),(1586,'Clients given 6E weighing 6-9.9kg','Clients given 6E weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 6-9.9kg\n Clients given 6E weighing 6-9.9kg\n \n 2022-06-30 11:51:01 UTC\n \n 2022-06-30 11:51: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 1586\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:51:01',4,'2022-06-30 13:51:18',4,0,NULL,NULL,NULL,'b0f0ed35-fe90-4552-83a7-e10c1b509fdb'),(1587,'Clients given 6B weighing 6-9.9kg','Clients given 6B weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 6-9.9kg\n Clients given 6B weighing 6-9.9kg\n \n 2022-06-30 11:51:24 UTC\n \n 2022-06-30 11:51: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 1587\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:51:24',4,'2022-06-30 13:51:51',4,0,NULL,NULL,NULL,'9b75e9b1-6086-4d10-aa5d-f574d58c2f9b'),(1588,'Clients given 6E weighing 10-13.9kg','Clients given 6E weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 10-13.9kg\n Clients given 6E weighing 10-13.9kg\n \n 2022-06-30 11:51:37 UTC\n \n 2022-06-30 11:52: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 1588\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:51:37',4,'2022-06-30 13:52:05',4,0,NULL,NULL,NULL,'4ab54017-730b-443b-b1a4-c7fb57c16069'),(1589,'Clients given 6B weighing 10-13.9kg','Clients given 6B weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 10-13.9kg\n Clients given 6B weighing 10-13.9kg\n \n 2022-06-30 11:52:19 UTC\n \n 2022-06-30 11:53: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 1589\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:52:19',4,'2022-06-30 13:53:07',4,0,NULL,NULL,NULL,'439b52c1-c9d5-4366-9819-994f121bf0fa'),(1590,'Clients given 6E weighing 14-19.9kg','Clients given 6E weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 14-19.9kg\n Clients given 6E weighing 14-19.9kg\n \n 2022-06-30 11:52:28 UTC\n \n 2022-06-30 11:52: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 1590\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:52:28',4,'2022-06-30 13:52:45',4,0,NULL,NULL,NULL,'4a2873d6-97bb-42b9-8e4f-4786bf854462'),(1591,'Clients given 6E weighing 20-24.9kg','Clients given 6E weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 20-24.9kg\n Clients given 6E weighing 20-24.9kg\n \n 2022-06-30 11:53:12 UTC\n \n 2022-06-30 11: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 1591\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:53:12',4,'2022-06-30 13:53:30',4,0,NULL,NULL,NULL,'e129484c-9b6b-4ed5-a0b8-da691370e459'),(1592,'Clients given 6B weighing 14-19.9kg','Clients given 6B weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 14-19.9kg\n Clients given 6B weighing 14-19.9kg\n \n 2022-06-30 11:53:32 UTC\n \n 2022-06-30 11:54: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 1592\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:53:32',4,'2022-06-30 13:54:03',4,0,NULL,NULL,NULL,'af7d5255-1e37-4def-b26d-dcded87c1ded'),(1593,'Clients given 6E weighing 25-34.9kg','Clients given 6E weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 25-34.9kg\n Clients given 6E weighing 25-34.9kg\n \n 2022-06-30 11:54:08 UTC\n \n 2022-06-30 11:54:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1593\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:54:08',4,'2022-06-30 13:54:23',4,0,NULL,NULL,NULL,'5c8f4cdd-6c22-4df0-8d12-801a66ccff55'),(1594,'Clients given 6B weighing 20-24.9kg','Clients given 6B weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 20-24.9kg\n Clients given 6B weighing 20-24.9kg\n \n 2022-06-30 11:54:35 UTC\n \n 2022-06-30 11:55: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 1594\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:54:35',4,'2022-06-30 13:55:03',4,0,NULL,NULL,NULL,'3d5ca230-bb1a-40ad-9a13-ae3d4a7868c1'),(1595,'Clients given 6E weighing >=35kg','Clients given 6E weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing >=35kg\n Clients given 6E weighing >=35kg\n \n 2022-06-30 11:54:50 UTC\n \n 2022-06-30 11:55: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 1595\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6E \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4704)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:54:50',4,'2022-06-30 13:55:11',4,0,NULL,NULL,NULL,'0ed30402-06d4-4a91-ab30-8aa4cb05f973'),(1596,'Clients given 6B weighing 25-34.9kg','Clients given 6B weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 25-34.9kg\n Clients given 6B weighing 25-34.9kg\n \n 2022-06-30 11:55:30 UTC\n \n 2022-06-30 11:56: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 1596\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:55:30',4,'2022-06-30 13:56:09',4,0,NULL,NULL,NULL,'760b7d9e-5a7e-4a13-9517-59f18a299d60'),(1597,'Clients given 6B weighing >= 35kg','Clients given 6B weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing >= 35kg\n Clients given 6B weighing >= 35kg\n \n 2022-06-30 11:56:44 UTC\n \n 2022-06-30 11:57: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 1597\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6B \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 3687)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:56:44',4,'2022-06-30 13:57:03',4,0,NULL,NULL,NULL,'89e94627-eb6a-4b05-8b5c-7c06482c67da'),(1598,'Clients given 6D weighing 0-3.9kg','Clients given 6D weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 0-3.9kg\n Clients given 6D weighing 0-3.9kg\n \n 2022-06-30 11:57:07 UTC\n \n 2022-06-30 11:57: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 1598\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 0 and _weight <= 3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:57:07',4,'2022-06-30 13:57:20',4,0,NULL,NULL,NULL,'c5ecfc78-4201-495c-9c7d-042b046d6c3d'),(1599,'Clients given 6D weighing 4-5.9kg','Clients given 6D weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 4-5.9kg\n Clients given 6D weighing 4-5.9kg\n \n 2022-06-30 11:57:58 UTC\n \n 2022-06-30 11:58:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1599\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 4 and _weight <= 5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:57:58',4,'2022-06-30 13:58:23',4,0,NULL,NULL,NULL,'25950d8e-2a7a-484f-8674-e94ba2fc9071'),(1600,'Clients given 6C weighing 0-3.9kg','Clients given 6C weighing 0-3.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 0-3.9kg\n Clients given 6C weighing 0-3.9kg\n \n 2022-06-30 11:58:17 UTC\n \n 2022-06-30 11:59: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 1600\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=0 and _weight <=3.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:58:17',4,'2022-06-30 13:59:19',4,0,NULL,NULL,NULL,'6eff51d3-2d07-44db-a617-ff288d027867'),(1601,'Clients given 6D weighing 6-9.9kg','Clients given 6D weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 6-9.9kg\n Clients given 6D weighing 6-9.9kg\n \n 2022-06-30 11:58:42 UTC\n \n 2022-06-30 11:59: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 1601\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 6 and _weight <= 9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:58:42',4,'2022-06-30 13:59:05',4,0,NULL,NULL,NULL,'0b2e111f-f266-4a34-ba0b-4080607ca595'),(1602,'Clients given 6D weighing 10-13.9kg','Clients given 6D weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 10-13.9kg\n Clients given 6D weighing 10-13.9kg\n \n 2022-06-30 11:59:37 UTC\n \n 2022-06-30 11:59: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 1602\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 10 and _weight <= 13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 13:59:37',4,'2022-06-30 13:59:58',4,0,NULL,NULL,NULL,'d13d961e-4f19-4d97-88f5-f0795b285859'),(1603,'Clients given 6D weighing 14-19.9kg','Clients given 6D weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 14-19.9kg\n Clients given 6D weighing 14-19.9kg\n \n 2022-06-30 12:00:32 UTC\n \n 2022-06-30 12: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 1603\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 14 and _weight <= 19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:00:32',4,'2022-06-30 14:00:54',4,0,NULL,NULL,NULL,'ba0967aa-34e7-4df6-a75b-cbe7c8b52cea'),(1604,'Clients given 6C weighing 4-5.9kg','Clients given 6C weighing 4-5.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 4-5.9kg\n Clients given 6C weighing 4-5.9kg\n \n 2022-06-30 12:00:54 UTC\n \n 2022-06-30 12:01: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 1604\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=4 and _weight <=5.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:00:54',4,'2022-06-30 14:01:46',4,0,NULL,NULL,NULL,'9538730a-29f7-45cc-a6e5-4b20a1b80f2f'),(1605,'Clients given 6D weighing 20-24.9kg','Clients given 6D weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 20-24.9kg\n Clients given 6D weighing 20-24.9kg\n \n 2022-06-30 12:01:12 UTC\n \n 2022-06-30 12:01: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 1605\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 20 and _weight <= 24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:01:12',4,'2022-06-30 14:01:31',4,0,NULL,NULL,NULL,'87b14d09-b20e-47d1-b20e-c38bc338df15'),(1606,'Clients given 6D weighing 25-34.9kg','Clients given 6D weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 25-34.9kg\n Clients given 6D weighing 25-34.9kg\n \n 2022-06-30 12:01:59 UTC\n \n 2022-06-30 12:02: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 1606\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 25 and _weight <= 34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:01:59',4,'2022-06-30 14:02:21',4,0,NULL,NULL,NULL,'9b8508f6-6c59-4408-90d1-4366ad9f3df7'),(1607,'Clients given 6C weighing 6-9.9kg','Clients given 6C weighing 6-9.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 6-9.9kg\n Clients given 6C weighing 6-9.9kg\n \n 2022-06-30 12:02:20 UTC\n \n 2022-06-30 12:02: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 1607\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=6 and _weight <=9.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:02:20',4,'2022-06-30 14:02:44',4,0,NULL,NULL,NULL,'021aecf8-4314-4feb-921d-dbab609bce88'),(1608,'Clients given 6D weighing >=35kg','Clients given 6D weighing >=35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing >=35kg\n Clients given 6D weighing >=35kg\n \n 2022-06-30 12:02:42 UTC\n \n 2022-06-30 12:03: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 1608\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6D \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4703)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight >= 35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:02:42',4,'2022-06-30 14:03:09',4,0,NULL,NULL,NULL,'6b8cf9ee-1659-46da-8aab-1580ccd82fe7'),(1609,'Clients given 6C weighing 10-13.9kg','Clients given 6C weighing 10-13.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 10-13.9kg\n Clients given 6C weighing 10-13.9kg\n \n 2022-06-30 12:03:07 UTC\n \n 2022-06-30 12:03: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 1609\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=10 and _weight <=13.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:03:07',4,'2022-06-30 14:03:31',4,0,NULL,NULL,NULL,'e43ddc56-97c9-4c2b-9dd1-4439ab2d154e'),(1610,'Clients given 6C weighing 14-19.9kg','Clients given 6C weighing 14-19.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 14-19.9kg\n Clients given 6C weighing 14-19.9kg\n \n 2022-06-30 12:03:52 UTC\n \n 2022-06-30 12:04: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 1610\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=14 and _weight <=19.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:03:52',4,'2022-06-30 14:04:35',4,0,NULL,NULL,NULL,'7cc34bd7-01dc-4e10-97b4-3aabce82e0d2'),(1611,'Clients given 6C weighing 20-24.9kg','Clients given 6C weighing 20-24.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 20-24.9kg\n Clients given 6C weighing 20-24.9kg\n \n 2022-06-30 12:05:08 UTC\n \n 2022-06-30 12:05: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 1611\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=20 and _weight <=24.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:05:08',4,'2022-06-30 14:05:48',4,0,NULL,NULL,NULL,'eb9fff17-d2d9-4c0a-a4ff-919fe86f2cfe'),(1612,'Clients given 6C weighing 25-34.9kg','Clients given 6C weighing 25-34.9kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 25-34.9kg\n Clients given 6C weighing 25-34.9kg\n \n 2022-06-30 12:06:35 UTC\n \n 2022-06-30 12:07: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 1612\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=25 and _weight <=34.9)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:06:35',4,'2022-06-30 14:07:04',4,0,NULL,NULL,NULL,'95004055-2dd1-4b3c-9536-877974c6fc23'),(1613,'Clients given 6C weighing >= 35kg','Clients given 6C weighing >= 35kg','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing >= 35kg\n Clients given 6C weighing >= 35kg\n \n 2022-06-30 12:07:48 UTC\n \n 2022-06-30 12:09: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 1613\n \nselect 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.person_id in \n(SELECT distinct Active_Patients.Id \nFROM \n(( \n -- 6C \n(SELECT Id \n FROM \n (select distinct patient.patient_id AS Id \n \n from obs o \n -- Picking Followup Date from Latest Followup Form \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND o.person_id in ( \n \n select active_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS latest_follow_up \n from obs B \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 3753 \n and obs_datetime <= cast(:endDate as date) \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n where concept_id = 3752 \n and A.observation_id = B.obs_group_id \n ) as active_clients \n where active_clients.latest_follow_up >= cast(:endDate as date) \n \n and active_clients.person_id not in ( \n select distinct os.person_id \n from obs os \n where concept_id = 2249 \n AND MONTH(os.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and active_clients.person_id not in ( \n select distinct(o.person_id) \n from obs o \n where o.person_id in ( \n -- FOLLOW UPS \n select firstquery.person_id \n from \n ( \n select oss.person_id, SUBSTRING(MAX(CONCAT(oss.value_datetime, oss.obs_id)), 20) AS observation_id, CAST(max(oss.value_datetime) AS DATE) as latest_followup_obs \n from obs oss \n where oss.voided=0 \n and oss.concept_id=3752 \n and CAST(oss.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and CAST(oss.obs_datetime AS DATE) >= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -13 MONTH) \n group by oss.person_id) firstquery \n inner join ( \n select os.person_id,datediff(CAST(max(os.value_datetime) AS DATE), CAST(:endDate AS DATE)) as last_ap \n from obs os \n where concept_id = 3752 \n and CAST(os.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n group by os.person_id \n having last_ap < 0 \n ) secondquery \n on firstquery.person_id = secondquery.person_id \n ) and o.person_id in ( \n -- TOUTS \n select distinct(person_id) \n from \n ( \n select os.person_id, CAST(max(os.value_datetime) AS DATE) as latest_transferout \n from obs os \n where os.concept_id=2266 \n group by os.person_id \n having latest_transferout <= CAST(:endDate AS DATE) \n ) as TOUTS \n ) \n ) \n \n \n and active_clients.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 \n ) \n ) \n \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n \n ) AS Seen_Previous_ART_Clients \n) \n \n)Active_Patients \n \nINNER JOIN \n \n(SELECT regimen.Id as Id \nFROM \n( SELECT currentreg.person_id as Id,COALESCE(switch_regimen,substitute_regimen,current_regimen) ARV_regimen \n FROM( \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS current_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2250 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as currentreg \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS substitute_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 4284 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as substitutereg \n ON substitutereg.person_id = currentreg.person_id \n \n LEFT OUTER JOIN \n \n \n (select distinct o.person_id, max(o.obs_datetime) as maxdate, SUBSTRING(MAX(CONCAT(o.obs_datetime, o.value_coded)), 20) AS switch_regimen \n from obs o \n INNER JOIN patient_identifier ON patient_identifier.patient_id = o.person_id AND patient_identifier.preferred=1 \n where o.concept_id = 2268 \n AND o.voided = 0 \n and o.obs_datetime <= cast(:endDate as date) \n group by person_id) as switchreg \n ON switchreg.person_id = currentreg.person_id \n ) \n \n )as regimen \n where regimen.ARV_regimen = 4702)Current_Reg \nON Active_Patients.Id = Current_Reg.Id \n \nINNER JOIN \n \n (SELECT weight_.Id, _weight \n from \n (select oss.person_id as Id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_numeric)), 20) as _weight \n from obs oss \n where oss.concept_id = 119 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as date) \n group by oss.person_id)AS weight_ \n where _weight>=35)peads_weight \n ON Active_Patients.Id = peads_weight.Id \n \n)) \n \n\n','2022-06-30 14:07:48',4,'2022-06-30 14:09:19',4,0,NULL,NULL,NULL,'a5659098-23a4-41c0-8bbd-12dd4c9bca64'),(1614,'Clients given 4C weighing 0-3.9kg','Clients given 4C weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.SqlIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 0-3.9kg\n Clients given 4C weighing 0-3.9kg\n \n 2022-06-30 12:15:27 UTC\n \n','2022-06-30 14:15:27',4,NULL,NULL,0,NULL,NULL,NULL,'46894193-4656-4941-9050-4498338da679'),(1615,'Clients given 4C weighing 0-3.9kg','Clients given 4C weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 0-3.9kg\n Clients given 4C weighing 0-3.9kg\n \n 2022-06-30 12:16:38 UTC\n \n 2022-06-30 12:20: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 1615\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','2022-06-30 14:16:38',4,'2022-06-30 14:20:27',4,0,NULL,NULL,NULL,'4a2b667a-930c-4d98-9073-18aa9e6104ec'),(1616,'Clients given 4C weighing 4-5.9kg','Clients given 4C weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 4-5.9kg\n Clients given 4C weighing 4-5.9kg\n \n 2022-06-30 12:21:22 UTC\n \n 2022-06-30 12:23: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 1616\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','2022-06-30 14:21:22',4,'2022-06-30 14:23:05',4,0,NULL,NULL,NULL,'aa294dde-6440-4b72-ab4a-d5b782cec371'),(1617,'Clients given 4C weighing 6-9.9kg','Clients given 4C weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 6-9.9kg\n Clients given 4C weighing 6-9.9kg\n \n 2022-06-30 12:23:45 UTC\n \n 2022-06-30 12: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 1617\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','2022-06-30 14:23:45',4,'2022-06-30 14:24:45',4,0,NULL,NULL,NULL,'5a98d199-a896-47ec-830e-56cd2fef0351'),(1618,'Clients given 4C weighing 10-13.9kg','Clients given 4C weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 10-13.9kg\n Clients given 4C weighing 10-13.9kg\n \n 2022-06-30 12:25:23 UTC\n \n 2022-06-30 12:26: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 1618\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','2022-06-30 14:25:23',4,'2022-06-30 14:26:36',4,0,NULL,NULL,NULL,'bc8cd79c-b1fd-4956-8f87-596d56a8b0b9'),(1619,'Clients given 4C weighing 14-19.9kg','Clients given 4C weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 14-19.9kg\n Clients given 4C weighing 14-19.9kg\n \n 2022-06-30 12:27:19 UTC\n \n 2022-06-30 12:28: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 1619\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','2022-06-30 14:27:19',4,'2022-06-30 14:28:17',4,0,NULL,NULL,NULL,'220abe15-cbb2-464a-bb57-fb1e75ad56c6'),(1620,'Clients given 4C weighing 20-24.9kg','Clients given 4C weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 20-24.9kg\n Clients given 4C weighing 20-24.9kg\n \n 2022-06-30 12:28:52 UTC\n \n 2022-06-30 12:29: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 1620\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','2022-06-30 14:28:52',4,'2022-06-30 14:29:51',4,0,NULL,NULL,NULL,'0e4c3cca-5e54-4f77-a359-6c5a47141593'),(1621,'Clients given 4C weighing 25-34.9kg','Clients given 4C weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing 25-34.9kg\n Clients given 4C weighing 25-34.9kg\n \n 2022-06-30 12:30:29 UTC\n \n 2022-06-30 12: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 1621\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','2022-06-30 14:30:29',4,'2022-06-30 14:31:26',4,0,NULL,NULL,NULL,'d1810771-902c-44c5-b1a9-988f037cf87d'),(1622,'Clients given 4C weighing >= 35kg','Clients given 4C weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4C weighing >= 35kg\n Clients given 4C weighing >= 35kg\n \n 2022-06-30 12:32:03 UTC\n \n 2022-06-30 12:33: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 1622\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','2022-06-30 14:32:03',4,'2022-06-30 14:33:13',4,0,NULL,NULL,NULL,'1d840c5f-240c-4159-8a72-6b0db642b53f'),(1623,'Clients given 4D weighing 0-3.9kg','Clients given 4D weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 0-3.9kg\n Clients given 4D weighing 0-3.9kg\n \n 2022-06-30 12:33:59 UTC\n \n 2022-06-30 12:36: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 1623\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','2022-06-30 14:33:59',4,'2022-06-30 14:36:06',4,0,NULL,NULL,NULL,'0746d03a-e518-473c-809e-f764e275f42a'),(1624,'Clients given 4D weighing 4-5.9kg','Clients given 4D weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 4-5.9kg\n Clients given 4D weighing 4-5.9kg\n \n 2022-06-30 12:36:44 UTC\n \n 2022-06-30 12:38: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 1624\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','2022-06-30 14:36:44',4,'2022-06-30 14:38:51',4,0,NULL,NULL,NULL,'fdaff2b0-2a93-4eed-8a21-37b4493a93d8'),(1625,'Clients given 4D weighing 6-9.9kg','Clients given 4D weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 6-9.9kg\n Clients given 4D weighing 6-9.9kg\n \n 2022-06-30 12:37:11 UTC\n \n 2022-06-30 12:39: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 1625\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','2022-06-30 14:37:11',4,'2022-06-30 14:39:41',4,0,NULL,NULL,NULL,'f7342534-15b0-4b7f-abf7-4689c7510e5d'),(1626,'Clients given 4D weighing 10-13.9kg','Clients given 4D weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 10-13.9kg\n Clients given 4D weighing 10-13.9kg\n \n 2022-06-30 12:40:08 UTC\n \n 2022-06-30 12:40: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 1626\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','2022-06-30 14:40:08',4,'2022-06-30 14:40:58',4,0,NULL,NULL,NULL,'f70b046a-7684-4087-85ac-b8e890c99a7d'),(1627,'Clients given 4D weighing 14-19.9kg','Clients given 4D weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 14-19.9kg\n Clients given 4D weighing 14-19.9kg\n \n 2022-06-30 12:41:22 UTC\n \n 2022-06-30 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 1627\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','2022-06-30 14:41:22',4,'2022-06-30 14:46:15',4,0,NULL,NULL,NULL,'a78b89dd-1172-4ae3-9db1-252697c46714'),(1628,'Children ARV Regimen_1stLine_2022','Children ARV Regimen_1stLine','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_1stLine_2022\n Children ARV Regimen_1stLine\n \n 2022-06-30 12:44:42 UTC\n \n 2022-06-30 12:44: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 1628\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','2022-06-30 14:44:42',4,'2022-06-30 14:44:52',4,0,NULL,NULL,NULL,'6d96f107-4e14-48ff-b6d7-c845d87e37e1'),(1629,'Children ARV Regimen_1stLine_2022 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_1stLine_2022 Data Set\n \n 2022-06-30 12:44:52 UTC\n \n 2022-06-30 19:13: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 1629\n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n 4C0to3.9\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\n Children 0to14\n \n \n \n \n \n 4C10to13.9\n \n \n \n \n \n \n \n \n \n 4C14to19.9\n \n \n \n \n \n \n \n \n \n 4C20to24.9\n \n \n \n \n \n \n \n \n \n 4C25to34.9\n \n \n \n \n \n \n \n \n \n 4C35plus\n \n \n \n \n \n \n \n \n \n 4C4to5.9\n \n \n \n \n \n \n \n \n \n 4C6to9.9\n \n \n \n \n \n \n \n \n \n 4D0to3.9\n \n \n \n \n \n \n \n \n \n 4D10to13.9\n \n \n \n \n \n \n \n \n \n 4D14to19.9\n \n \n \n \n \n \n \n \n \n 4D20to24.9\n \n \n \n \n \n \n \n \n \n 4D25to34.9\n \n \n \n \n \n \n \n \n \n 4D35plus\n \n \n \n \n \n \n \n \n \n 4D4to5.9\n \n \n \n \n \n \n \n \n \n 4D6to9.9\n \n \n \n \n \n \n \n \n \n 4E0to3.9\n \n \n \n \n \n \n \n \n \n 4E10to13.9\n \n \n \n \n \n \n \n \n \n 4E14to19.9\n \n \n \n \n \n \n \n \n \n 4E20to24.9\n \n \n \n \n \n \n \n \n \n 4E25to34.9\n \n \n \n \n \n \n \n \n \n 4E35plus\n \n \n \n \n \n \n \n \n \n 4E4to5.9\n \n \n \n \n \n \n \n \n \n 4E6to9.9\n \n \n \n \n \n \n \n \n \n 4F0to3.9\n \n \n \n \n \n \n \n \n \n 4F10to13.9\n \n \n \n \n \n \n \n \n \n 4F14to19.9\n \n \n \n \n \n \n \n \n \n 4F20to24.9\n \n \n \n \n \n \n \n \n \n 4F25to34.9\n \n \n \n \n \n \n \n \n \n 4F35plus\n \n \n \n \n \n \n \n \n \n 4F4to5.9\n \n \n \n \n \n \n \n \n \n 4F6to9.9\n \n \n \n \n \n \n \n \n \n 4G0to3.9\n \n \n \n \n \n \n \n \n \n 4G10to13.9\n \n \n \n \n \n \n \n \n \n 4G14to19.9\n \n \n \n \n \n \n \n \n \n 4G20to24.9\n \n \n \n \n \n \n \n \n \n 4G25to34.9\n \n \n \n \n \n \n \n \n \n 4G35plus\n \n \n \n \n \n \n \n \n \n 4G4to5.9\n \n \n \n \n \n \n \n \n \n 4G6to9.9\n \n \n \n \n \n \n \n \n \n 4H0to3.9\n \n \n \n \n \n \n \n \n \n 4H10to13.9\n \n \n \n \n \n \n \n \n \n 4H14to19.9\n \n \n \n \n \n \n \n \n \n 4H20to24.9\n \n \n \n \n \n \n \n \n \n 4H25to34.9\n \n \n \n \n \n \n \n \n \n 4H35plus\n \n \n \n \n \n \n \n \n \n 4H4to5.9\n \n \n \n \n \n \n \n \n \n 4H6to9.9\n \n \n \n \n \n \n \n \n \n 4J0to3.9\n \n \n \n \n \n \n \n \n \n 4J10to13.9\n \n \n \n \n \n \n \n \n \n 4J14to19.9\n \n \n \n \n \n \n \n \n \n 4J20to24.9\n \n \n \n \n \n \n \n \n \n 4J25to34.9\n \n \n \n \n \n \n \n \n \n 4J35plus\n \n \n \n \n \n \n \n \n \n 4J4to5.9\n \n \n \n \n \n \n \n \n \n 4J6to9.9\n \n \n \n \n \n \n \n \n \n 4K0to3.9\n \n \n \n \n \n \n \n \n \n 4K10to13.9\n \n \n \n \n \n \n \n \n \n 4K14to19.9\n \n \n \n \n \n \n \n \n \n 4K20to24.9\n \n \n \n \n \n \n \n \n \n 4K25to34.9\n \n \n \n \n \n \n \n \n \n 4K35plus\n \n \n \n \n \n \n \n \n \n 4K4to5.9\n \n \n \n \n \n \n \n \n \n 4K6to9.9\n \n \n \n \n \n \n \n \n \n 4L0to3.9\n \n \n \n \n \n \n \n \n \n 4L10to13.9\n \n \n \n \n \n \n \n \n \n 4L14to19.9\n \n \n \n \n \n \n \n \n \n 4L20to24.9\n \n \n \n \n \n \n \n \n \n 4L25to34.9\n \n \n \n \n \n \n \n \n \n 4L35plus\n \n \n \n \n \n \n \n \n \n 4L4to5.9\n \n \n \n \n \n \n \n \n \n 4L6to9.9\n \n \n \n \n \n \n \n \n \n','2022-06-30 12:44:52',4,'2022-06-30 19:13:55',4,0,NULL,NULL,NULL,'72dc6096-f429-4c40-93bf-fbf45c22d970'),(1630,'Clients given 4D weighing 20-24.9kg','Clients given 4D weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 20-24.9kg\n Clients given 4D weighing 20-24.9kg\n \n 2022-06-30 12:46:40 UTC\n \n 2022-06-30 12:47: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 1630\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','2022-06-30 14:46:40',4,'2022-06-30 14:47:39',4,0,NULL,NULL,NULL,'6c0b4f36-cc2c-4d85-a2ad-c5b5bf36b66b'),(1631,'Clients given 4D weighing 25-34.9kg','Clients given 4D weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing 25-34.9kg\n Clients given 4D weighing 25-34.9kg\n \n 2022-06-30 12:48:05 UTC\n \n 2022-06-30 12:49: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 1631\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','2022-06-30 14:48:05',4,'2022-06-30 14:49:27',4,0,NULL,NULL,NULL,'1c5157a7-08d8-4eb5-99df-f2ca1825baaa'),(1632,'Clients given 4D weighing >= 35kg','Clients given 4D weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4D weighing >= 35kg\n Clients given 4D weighing >= 35kg\n \n 2022-06-30 12:48:59 UTC\n \n 2022-06-30 12:50: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 1632\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','2022-06-30 14:48:59',4,'2022-06-30 14:50:46',4,0,NULL,NULL,NULL,'5cbfb29b-e0b1-42b0-b7f5-a1b561ae3bb5'),(1633,'Clients given 4E weighing 0-3.9kg','Clients given 4E weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 0-3.9kg\n Clients given 4E weighing 0-3.9kg\n \n 2022-06-30 12:50:28 UTC\n \n 2022-06-30 12: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 1633\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','2022-06-30 14:50:28',4,'2022-06-30 14:54:40',4,0,NULL,NULL,NULL,'36f7fe8c-f369-4152-a361-bc941ca32f35'),(1634,'Clients given 4E weighing 4-5.9kg','Clients given 4E weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 4-5.9kg\n Clients given 4E weighing 4-5.9kg\n \n 2022-06-30 12:54:09 UTC\n \n 2022-06-30 12: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 1634\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','2022-06-30 14:54:09',4,'2022-06-30 14:55:44',4,0,NULL,NULL,NULL,'d6c46caf-e87c-4654-963f-91039f99e100'),(1635,'Clients given 4E weighing 6-9.9kg','Clients given 4E weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 6-9.9kg\n Clients given 4E weighing 6-9.9kg\n \n 2022-06-30 12:57:00 UTC\n \n 2022-06-30 13:15: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 1635\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','2022-06-30 14:57:00',4,'2022-06-30 15:15:29',4,0,NULL,NULL,NULL,'2c954752-aaeb-427b-8cef-714be116f8d5'),(1636,'Clients given 4E weighing 10-13.9kg','Clients given 4E weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 10-13.9kg\n Clients given 4E weighing 10-13.9kg\n \n 2022-06-30 13:16:23 UTC\n \n 2022-06-30 13:20: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 1636\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','2022-06-30 15:16:23',4,'2022-06-30 15:20:47',4,0,NULL,NULL,NULL,'92eb0675-5667-4202-ae12-91e31e89bc0a'),(1637,'Clients given 4K weighing 0-3.9kg','Clients given 4K weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 0-3.9kg\n Clients given 4K weighing 0-3.9kg\n \n 2022-06-30 13:21:01 UTC\n \n 2022-06-30 13:22: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 1637\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','2022-06-30 15:21:01',4,'2022-06-30 15:22:04',4,0,NULL,NULL,NULL,'5166d416-8394-41a8-a7bf-cddf0f4573f9'),(1638,'Clients given 4E weighing 14-19.9kg','Clients given 4E weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 14-19.9kg\n Clients given 4E weighing 14-19.9kg\n \n 2022-06-30 13:21:21 UTC\n \n 2022-06-30 13:23: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 1638\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','2022-06-30 15:21:21',4,'2022-06-30 15:23:24',4,0,NULL,NULL,NULL,'7c801f27-0d0e-4f8e-8d16-c9abbbc1d70f'),(1639,'Clients given 4K weighing 4-5.9kg','Clients given 4K weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 4-5.9kg\n Clients given 4K weighing 4-5.9kg\n \n 2022-06-30 13:22:30 UTC\n \n 2022-06-30 13:23: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 1639\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','2022-06-30 15:22:30',4,'2022-06-30 15:23:19',4,0,NULL,NULL,NULL,'c3840473-881e-4c28-8b70-08ee65d51205'),(1640,'Clients given 4E weighing 20-24.9kg','Clients given 4E weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 20-24.9kg\n Clients given 4E weighing 20-24.9kg\n \n 2022-06-30 13:22:54 UTC\n \n 2022-06-30 13:24:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1640\n COUNT\n \n \n \n \n endDate\n ${startDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2022-06-30 15:22:54',4,'2022-06-30 15:24:23',4,0,NULL,NULL,NULL,'7171def2-3caa-415e-8d0c-ae70c50ee52a'),(1641,'Clients given 4K weighing 6-9.9kg','Clients given 4K weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 6-9.9kg\n Clients given 4K weighing 6-9.9kg\n \n 2022-06-30 13:23:54 UTC\n \n 2022-06-30 13: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 1641\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','2022-06-30 15:23:54',4,'2022-06-30 15:24:45',4,0,NULL,NULL,NULL,'2dc1198d-9268-4a29-b96d-7ac8921d3551'),(1642,'Clients given 4E weighing 25-34.9kg','Clients given 4E weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing 25-34.9kg\n Clients given 4E weighing 25-34.9kg\n \n 2022-06-30 13:24:00 UTC\n \n 2022-06-30 13:25: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 1642\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','2022-06-30 15:24:00',4,'2022-06-30 15:25:27',4,0,NULL,NULL,NULL,'40ac2a8b-12d5-4b3d-bea2-b63e3d969db9'),(1643,'Clients given 4E weighing >= 35kg','Clients given 4E weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4E weighing >= 35kg\n Clients given 4E weighing >= 35kg\n \n 2022-06-30 13:25:02 UTC\n \n 2022-06-30 13:26: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 1643\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','2022-06-30 15:25:02',4,'2022-06-30 15:26:56',4,0,NULL,NULL,NULL,'9f104324-88d3-4be9-8a9e-2535e4368371'),(1644,'Clients given 4K weighing 10-13.9kg','Clients given 4K weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 10-13.9kg\n Clients given 4K weighing 10-13.9kg\n \n 2022-06-30 13:25:05 UTC\n \n 2022-06-30 13:26: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 1644\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','2022-06-30 15:25:05',4,'2022-06-30 15:26:01',4,0,NULL,NULL,NULL,'38fbaae4-791a-4bba-85ea-d149625c3d79'),(1645,'Clients given 4K weighing 14-19.9kg','Clients given 4K weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 14-19.9kg\n Clients given 4K weighing 14-19.9kg\n \n 2022-06-30 13:26:26 UTC\n \n 2022-06-30 13:27: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 1645\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','2022-06-30 15:26:26',4,'2022-06-30 15:27:37',4,0,NULL,NULL,NULL,'c0be7036-edcf-4337-97d7-2bb22bc6ef54'),(1646,'Clients given 4F weighing 0-3.9kg','Clients given 4F weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 0-3.9kg\n Clients given 4F weighing 0-3.9kg\n \n 2022-06-30 13:26:29 UTC\n \n 2022-06-30 13:28: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 1646\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','2022-06-30 15:26:29',4,'2022-06-30 15:28:31',4,0,NULL,NULL,NULL,'3df707cf-c633-4a85-ab9a-affe8619ca0e'),(1647,'Clients given 4K weighing 20-24.9kg','Clients given 4K weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 20-24.9kg\n Clients given 4K weighing 20-24.9kg\n \n 2022-06-30 13:26:52 UTC\n \n 2022-06-30 13:27: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 1647\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','2022-06-30 15:26:52',4,'2022-06-30 15:27:51',4,0,NULL,NULL,NULL,'f1be8c70-bd5f-4b25-8703-ebc91a56a354'),(1648,'Clients given 4F weighing 4-5.9kg','Clients given 4F weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 4-5.9kg\n Clients given 4F weighing 4-5.9kg\n \n 2022-06-30 13:27:32 UTC\n \n 2022-06-30 13: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 1648\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','2022-06-30 15:27:32',4,'2022-06-30 15:28:56',4,0,NULL,NULL,NULL,'651b9843-2f38-4e58-a87b-8d01b1e1b736'),(1649,'Clients given 4K weighing 25-34.9kg','Clients given 4K weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing 25-34.9kg\n Clients given 4K weighing 25-34.9kg\n \n 2022-06-30 13:28:20 UTC\n \n 2022-06-30 13:29: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 1649\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','2022-06-30 15:28:20',4,'2022-06-30 15:29:38',4,0,NULL,NULL,NULL,'4a021424-b101-4001-8078-cd6e93935845'),(1650,'Clients given 4K weighing >=35kg','Clients given 4K weighing >=35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4K weighing >=35kg\n Clients given 4K weighing >=35kg\n \n 2022-06-30 13:28:45 UTC\n \n 2022-06-30 13:29: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 1650\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','2022-06-30 15:28:45',4,'2022-06-30 15:29:54',4,0,NULL,NULL,NULL,'86cffb6f-3533-48b5-a568-425a6d32e7e6'),(1651,'Clients given 4F weighing 6-9.9kg','Clients given 4F weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 6-9.9kg\n Clients given 4F weighing 6-9.9kg\n \n 2022-06-30 13:29:29 UTC\n \n 2022-06-30 13:33: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 1651\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','2022-06-30 15:29:29',4,'2022-06-30 15:33:15',4,0,NULL,NULL,NULL,'0d1c19ab-8761-43c9-b362-a733800ce420'),(1652,'Clients given 4F weighing 10-13.9kg','Clients given 4F weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 10-13.9kg\n Clients given 4F weighing 10-13.9kg\n \n 2022-06-30 13:29:53 UTC\n \n 2022-06-30 13:31: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 1652\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','2022-06-30 15:29:53',4,'2022-06-30 15:31:09',4,0,NULL,NULL,NULL,'0be49339-dac1-4872-9c6c-50fee86542d0'),(1653,'Clients given 4F weighing 14-19.9kg','Clients given 4F weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 14-19.9kg\n Clients given 4F weighing 14-19.9kg\n \n 2022-06-30 13:32:50 UTC\n \n 2022-06-30 13:34: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 1653\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','2022-06-30 15:32:50',4,'2022-06-30 15:34:42',4,0,NULL,NULL,NULL,'10f82a49-a80e-4feb-8a54-5011945608bc'),(1654,'Clients given 4F weighing 20-24.9kg','Clients given 4F weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 20-24.9kg\n Clients given 4F weighing 20-24.9kg\n \n 2022-06-30 13:33:57 UTC\n \n 2022-06-30 13:35: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 1654\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','2022-06-30 15:33:57',4,'2022-06-30 15:35:34',4,0,NULL,NULL,NULL,'1b492993-7168-4cee-aeae-ed3cb3136ef4'),(1655,'Clients given 4F weighing 25-34.9kg','Clients given 4F weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing 25-34.9kg\n Clients given 4F weighing 25-34.9kg\n \n 2022-06-30 13:35:56 UTC\n \n 2022-06-30 13:37: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 1655\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','2022-06-30 15:35:56',4,'2022-06-30 15:37:26',4,0,NULL,NULL,NULL,'fd363f21-64f5-4465-8f1c-94a10ec790bc'),(1656,'Clients given 4F weighing >= 35kg','Clients given 4F weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4F weighing >= 35kg\n Clients given 4F weighing >= 35kg\n \n 2022-06-30 13:36:27 UTC\n \n 2022-06-30 13: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 1656\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','2022-06-30 15:36:27',4,'2022-06-30 15:37:46',4,0,NULL,NULL,NULL,'2ca64d93-82d9-40b9-ae24-669a1d529641'),(1657,'Clients given 4G weighing 0-3.9kg','Clients given 4G weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 0-3.9kg\n Clients given 4G weighing 0-3.9kg\n \n 2022-06-30 13:38:33 UTC\n \n 2022-06-30 13:39: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 1657\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','2022-06-30 15:38:33',4,'2022-06-30 15:39:42',4,0,NULL,NULL,NULL,'e2b136d9-95a4-49fa-8069-476f5b7e1bc2'),(1658,'Clients given 4G weighing 4-5.9kg','Clients given 4G weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 4-5.9kg\n Clients given 4G weighing 4-5.9kg\n \n 2022-06-30 13:38:58 UTC\n \n 2022-06-30 13:40: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 1658\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','2022-06-30 15:38:58',4,'2022-06-30 15:40:05',4,0,NULL,NULL,NULL,'dc8af817-8512-4a0a-b692-331377842479'),(1659,'Clients given 4G weighing 6-9.9kg','Clients given 4G weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 6-9.9kg\n Clients given 4G weighing 6-9.9kg\n \n 2022-06-30 13:40:27 UTC\n \n 2022-06-30 13:41: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 1659\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','2022-06-30 15:40:27',4,'2022-06-30 15:41:40',4,0,NULL,NULL,NULL,'97f6acaa-3818-4efc-b6e0-8d8ecd3255b5'),(1660,'Clients given 4G weighing 10-13.9kg','Clients given 4G weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 10-13.9kg\n Clients given 4G weighing 10-13.9kg\n \n 2022-06-30 13:40:47 UTC\n \n 2022-06-30 13:43: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 1660\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','2022-06-30 15:40:47',4,'2022-06-30 15:43:02',4,0,NULL,NULL,NULL,'ebcfa3fc-dea8-4a53-99f7-a16dc23a026c'),(1661,'Clients given 4G weighing 14-19.9kg','Clients given 4G weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 14-19.9kg\n Clients given 4G weighing 14-19.9kg\n \n 2022-06-30 13:42:19 UTC\n \n 2022-06-30 13:43: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 1661\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','2022-06-30 15:42:19',4,'2022-06-30 15:43:59',4,0,NULL,NULL,NULL,'793e78bb-284c-47fa-8967-3fa124d3e9c7'),(1662,'Clients given 4G weighing 20-24.9kg','Clients given 4G weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 20-24.9kg\n Clients given 4G weighing 20-24.9kg\n \n 2022-06-30 13:43:37 UTC\n \n 2022-06-30 13:44: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 1662\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','2022-06-30 15:43:37',4,'2022-06-30 15:44:44',4,0,NULL,NULL,NULL,'2bffd86c-c304-4fe5-bea0-dcba1ddacd30'),(1663,'Clients given 4G weighing 25-34.9kg','Clients given 4G weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing 25-34.9kg\n Clients given 4G weighing 25-34.9kg\n \n 2022-06-30 13:44:57 UTC\n \n 2022-06-30 13:48: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 1663\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','2022-06-30 15:44:57',4,'2022-06-30 15:48:30',4,0,NULL,NULL,NULL,'dff299fd-70e4-42b6-821b-24bbfca5d130'),(1664,'Clients given 4G weighing >= 35kg','Clients given 4G weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4G weighing >= 35kg\n Clients given 4G weighing >= 35kg\n \n 2022-06-30 13:45:24 UTC\n \n 2022-06-30 13:47: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 1664\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','2022-06-30 15:45:24',4,'2022-06-30 15:47:50',4,0,NULL,NULL,NULL,'250554d7-b11e-4572-9fe8-191077c91497'),(1665,'Clients given 4H weighing 0-3.9kg','Clients given 4H weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 0-3.9kg\n Clients given 4H weighing 0-3.9kg\n \n 2022-06-30 13:49:48 UTC\n \n 2022-06-30 13:51: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 1665\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','2022-06-30 15:49:48',4,'2022-06-30 15:51:33',4,0,NULL,NULL,NULL,'0681f349-aa2a-4030-8932-08fe50d977b7'),(1666,'Clients given 4H weighing 4-5.9kg','Clients given 4H weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 4-5.9kg\n Clients given 4H weighing 4-5.9kg\n \n 2022-06-30 13:50:26 UTC\n \n 2022-06-30 13:52: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 1666\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','2022-06-30 15:50:26',4,'2022-06-30 15:52:13',4,0,NULL,NULL,NULL,'7d0948bd-e302-428d-be3e-c15ad93d5002'),(1667,'Clients given 4H weighing 6-9.9kg','Clients given 4H weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 6-9.9kg\n Clients given 4H weighing 6-9.9kg\n \n 2022-06-30 13:52:32 UTC\n \n 2022-06-30 13:53: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 1667\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','2022-06-30 15:52:32',4,'2022-06-30 15:53:36',4,0,NULL,NULL,NULL,'ec54533d-f75a-4314-b085-4016edf73ccc'),(1668,'Clients given 4H weighing 10-13.9kg','Clients given 4H weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 10-13.9kg\n Clients given 4H weighing 10-13.9kg\n \n 2022-06-30 13:52:54 UTC\n \n 2022-06-30 13: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 1668\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','2022-06-30 15:52:54',4,'2022-06-30 15:53:58',4,0,NULL,NULL,NULL,'306fc3f9-604f-4088-84fc-565bd360942d'),(1669,'Clients given 4H weighing 14-19.9kg','Clients given 4H weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 14-19.9kg\n Clients given 4H weighing 14-19.9kg\n \n 2022-06-30 13:54:20 UTC\n \n 2022-06-30 13:55: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 1669\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','2022-06-30 15:54:20',4,'2022-06-30 15:55:40',4,0,NULL,NULL,NULL,'afa2260d-2d12-4922-8214-7321d1a7a0b2'),(1670,'Clients given 4H weighing 20-24.9kg','Clients given 4H weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 20-24.9kg\n Clients given 4H weighing 20-24.9kg\n \n 2022-06-30 13:54:47 UTC\n \n 2022-06-30 13:56: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 1670\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','2022-06-30 15:54:47',4,'2022-06-30 15:56:07',4,0,NULL,NULL,NULL,'b12d0c96-1d85-4c87-8224-fcdcca3684ad'),(1671,'Clients given 4H weighing 25-34.9kg','Clients given 4H weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing 25-34.9kg\n Clients given 4H weighing 25-34.9kg\n \n 2022-06-30 13:56:49 UTC\n \n 2022-06-30 13:59: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 1671\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','2022-06-30 15:56:49',4,'2022-06-30 15:59:24',4,0,NULL,NULL,NULL,'c03a3023-e223-4974-82d2-f9884b64fd94'),(1672,'Clients given 4H weighing >= 35kg','Clients given 4H weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4H weighing >= 35kg\n Clients given 4H weighing >= 35kg\n \n 2022-06-30 13:57:18 UTC\n \n 2022-06-30 13:59: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 1672\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','2022-06-30 15:57:18',4,'2022-06-30 15:59:06',4,0,NULL,NULL,NULL,'021ba7c8-9dde-4912-850e-7e1f90746b9c'),(1673,'Clients given 4J weighing 0-3.9kg','Clients given 4J weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 0-3.9kg\n Clients given 4J weighing 0-3.9kg\n \n 2022-06-30 14:00:30 UTC\n \n 2022-06-30 14:01: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 1673\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','2022-06-30 16:00:30',4,'2022-06-30 16:01:59',4,0,NULL,NULL,NULL,'21e22f99-3f2f-4e4a-ac19-ea6a1fe4030a'),(1674,'Clients given 4J weighing 4-5.9kg','Clients given 4J weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 4-5.9kg\n Clients given 4J weighing 4-5.9kg\n \n 2022-06-30 14:00:54 UTC\n \n 2022-06-30 14: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 1674\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','2022-06-30 16:00:54',4,'2022-06-30 16:02:01',4,0,NULL,NULL,NULL,'14f446ec-5d3e-43b6-ad36-6153fe3ee3e9'),(1675,'Clients given 4J weighing 6-9.9kg','Clients given 4J weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 6-9.9kg\n Clients given 4J weighing 6-9.9kg\n \n 2022-06-30 14:03:04 UTC\n \n 2022-06-30 14:04: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 1675\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','2022-06-30 16:03:04',4,'2022-06-30 16:04:17',4,0,NULL,NULL,NULL,'cc3db8f2-7644-426f-9c03-2a1d48ebd7d7'),(1676,'Clients given 4J weighing 10-13.9kg','Clients given 4J weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 10-13.9kg\n Clients given 4J weighing 10-13.9kg\n \n 2022-06-30 14:03:25 UTC\n \n 2022-06-30 14:04: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 1676\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','2022-06-30 16:03:25',4,'2022-06-30 16:04:39',4,0,NULL,NULL,NULL,'adc9fdd3-0019-4213-998f-ab2d235aae80'),(1677,'Clients given 4J weighing 14-19.9kg','Clients given 4J weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 14-19.9kg\n Clients given 4J weighing 14-19.9kg\n \n 2022-06-30 14:05:01 UTC\n \n 2022-06-30 14:06: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 1677\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','2022-06-30 16:05:01',4,'2022-06-30 16:06:13',4,0,NULL,NULL,NULL,'4fc6749f-c47b-4021-8dbf-26732df08880'),(1678,'Clients given 4J weighing 20-24.9kg','Clients given 4J weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 20-24.9kg\n Clients given 4J weighing 20-24.9kg\n \n 2022-06-30 14:05:23 UTC\n \n 2022-06-30 14:06: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 1678\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','2022-06-30 16:05:23',4,'2022-06-30 16:06:34',4,0,NULL,NULL,NULL,'669e5746-1eee-4811-94dd-e4c6dd949131'),(1679,'Clients given 4J weighing 25-34.9kg','Clients given 4J weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing 25-34.9kg\n Clients given 4J weighing 25-34.9kg\n \n 2022-06-30 14:06:56 UTC\n \n 2022-06-30 14:08: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 1679\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','2022-06-30 16:06:56',4,'2022-06-30 16:08:42',4,0,NULL,NULL,NULL,'78cbb142-b205-4059-89fa-70bd488a0513'),(1680,'Clients given 4J weighing >= 35kg','Clients given 4J weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4J weighing >= 35kg\n Clients given 4J weighing >= 35kg\n \n 2022-06-30 14:07:26 UTC\n \n 2022-06-30 14:09: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 1680\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','2022-06-30 16:07:26',4,'2022-06-30 16:09:04',4,0,NULL,NULL,NULL,'ec90ccaa-999c-4b18-956b-50bee7c36868'),(1681,'Clients given 4L weighing 0-3.9kg','Clients given 4L weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 0-3.9kg\n Clients given 4L weighing 0-3.9kg\n \n 2022-06-30 14:09:37 UTC\n \n 2022-06-30 14:10: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 1681\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','2022-06-30 16:09:37',4,'2022-06-30 16:10:48',4,0,NULL,NULL,NULL,'0e228ccb-1909-4a98-8334-89bf36d6e810'),(1682,'Clients given 4L weighing 4-5.9kg','Clients given 4L weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 4-5.9kg\n Clients given 4L weighing 4-5.9kg\n \n 2022-06-30 14:10:06 UTC\n \n 2022-06-30 14:11: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 1682\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','2022-06-30 16:10:06',4,'2022-06-30 16:11:40',4,0,NULL,NULL,NULL,'d962f501-7157-4c19-9c7b-1a2a22053674'),(1683,'Clients given 4L weighing 6-9.9kg','Clients given 4L weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 6-9.9kg\n Clients given 4L weighing 6-9.9kg\n \n 2022-06-30 14:11:24 UTC\n \n 2022-06-30 14:13: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 1683\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','2022-06-30 16:11:24',4,'2022-06-30 16:13:32',4,0,NULL,NULL,NULL,'16bb43f6-91a5-4e02-9627-9921460d5c68'),(1684,'Clients given 4L weighing 10-13.9kg','Clients given 4L weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 10-13.9kg\n Clients given 4L weighing 10-13.9kg\n \n 2022-06-30 14:12:51 UTC\n \n 2022-06-30 14:14: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 1684\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','2022-06-30 16:12:51',4,'2022-06-30 16:14:24',4,0,NULL,NULL,NULL,'52d68e65-aa63-4c88-820e-e00bf66061ea'),(1685,'Clients given 4L weighing 14-19.9kg','Clients given 4L weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 14-19.9kg\n Clients given 4L weighing 14-19.9kg\n \n 2022-06-30 14:14:11 UTC\n \n 2022-06-30 14:15: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 1685\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','2022-06-30 16:14:11',4,'2022-06-30 16:15:56',4,0,NULL,NULL,NULL,'1eb7fbd6-fa49-4ada-af7e-19424fb5a7e8'),(1686,'Clients given 4L weighing 20-24.9kg','Clients given 4L weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 20-24.9kg\n Clients given 4L weighing 20-24.9kg\n \n 2022-06-30 14:15:00 UTC\n \n 2022-06-30 14:16: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 1686\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','2022-06-30 16:15:00',4,'2022-06-30 16:16:18',4,0,NULL,NULL,NULL,'d889b33a-5324-4655-965f-1fb6fdb8864d'),(1687,'Clients given 4L weighing 25-34.9kg','Clients given 4L weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing 25-34.9kg\n Clients given 4L weighing 25-34.9kg\n \n 2022-06-30 14:16:41 UTC\n \n 2022-06-30 14:18: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 1687\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','2022-06-30 16:16:41',4,'2022-06-30 16:18:03',4,0,NULL,NULL,NULL,'f8853175-2a1a-4d34-9a40-2d9ae44b5367'),(1688,'Clients given 4L weighing >= 35kg','Clients given 4L weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 4L weighing >= 35kg\n Clients given 4L weighing >= 35kg\n \n 2022-06-30 14:17:04 UTC\n \n 2022-06-30 14:18: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 1688\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','2022-06-30 16:17:04',4,'2022-06-30 16:18:34',4,0,NULL,NULL,NULL,'6cf112ca-592d-4638-8919-561aeb0e1b2e'),(1689,'Clients given 5A weighing 0-3.9kg','Clients given 5A weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 0-3.9kg\n Clients given 5A weighing 0-3.9kg\n \n 2022-07-04 07:51:16 UTC\n \n 2022-07-04 07:59: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 1689\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','2022-07-04 13:21:16',4,'2022-07-04 13:29:19',4,0,NULL,NULL,NULL,'1e8f892d-f7dd-4c03-bae2-2b6af9a96063'),(1690,'Clients given 5A weighing 4-5.9kg','Clients given 5A weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 4-5.9kg\n Clients given 5A weighing 4-5.9kg\n \n 2022-07-04 08:01:43 UTC\n \n 2022-07-04 08:08: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 1690\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','2022-07-04 13:31:43',4,'2022-07-04 13:38:34',4,0,NULL,NULL,NULL,'caef996e-3278-49a5-a46b-264db7abba88'),(1691,'Clients given 5A weighing 6-9.9kg','Clients given 5A weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 6-9.9kg\n Clients given 5A weighing 6-9.9kg\n \n 2022-07-04 08:10:17 UTC\n \n 2022-07-04 08:27: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 1691\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','2022-07-04 13:40:17',4,'2022-07-04 13:57:38',4,0,NULL,NULL,NULL,'e035adc0-696d-46e6-8075-9ea647aea054'),(1692,'Clients given 5A weighing 10-13.9kg','Clients given 5A weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 10-13.9kg\n Clients given 5A weighing 10-13.9kg\n \n 2022-07-04 08:12:41 UTC\n \n 2022-07-04 08:29: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 1692\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','2022-07-04 13:42:41',4,'2022-07-04 13:59:01',4,0,NULL,NULL,NULL,'ee8edb07-58b9-4884-8044-948e6bdef0a8'),(1693,'Clients given 5A weighing 14-19.9kg','Clients given 5A weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 14-19.9kg\n Clients given 5A weighing 14-19.9kg\n \n 2022-07-04 08:15:22 UTC\n \n 2022-07-04 08:30: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 1693\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','2022-07-04 13:45:22',4,'2022-07-04 14:00:32',4,0,NULL,NULL,NULL,'91a9fa6e-69dc-4980-bb69-ff2399a6e30e'),(1694,'Clients given 5A weighing 25-34.9kg','Clients given 5A weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 25-34.9kg\n Clients given 5A weighing 25-34.9kg\n \n 2022-07-04 08:17:38 UTC\n \n 2022-07-04 08:33: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 1694\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','2022-07-04 13:47:38',4,'2022-07-04 14:03:14',4,0,NULL,NULL,NULL,'671c4577-cc93-464c-b822-cdbee99fce15'),(1695,'Clients given 5A weighing 20-24.9kg','Clients given 5A weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing 20-24.9kg\n Clients given 5A weighing 20-24.9kg\n \n 2022-07-04 08:21:33 UTC\n \n 2022-07-04 08:32: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 1695\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','2022-07-04 13:51:33',4,'2022-07-04 14:02:01',4,0,NULL,NULL,NULL,'33f3931b-17d8-445a-8275-abe1c9c62e60'),(1696,'Clients given 5A weighing >= 35kg','Clients given 5A weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5A weighing >= 35kg\n Clients given 5A weighing >= 35kg\n \n 2022-07-04 08:22:19 UTC\n \n 2022-07-04 08:25: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 1696\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','2022-07-04 13:52:19',4,'2022-07-04 13:55:33',4,0,NULL,NULL,NULL,'4174b385-1353-40e8-8771-820e7b8cc439'),(1697,'Clients given 5B weighing 0-3.9kg','Clients given 5B weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 0-3.9kg\n Clients given 5B weighing 0-3.9kg\n \n 2022-07-04 08:35:49 UTC\n \n 2022-07-04 08:39: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 1697\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','2022-07-04 14:05:49',4,'2022-07-04 14:09:51',4,0,NULL,NULL,NULL,'8ccf814e-72c3-40b9-8dae-53c47231713a'),(1698,'Clients given 5B weighing 4-5.9kg','Clients given 5B weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 4-5.9kg\n Clients given 5B weighing 4-5.9kg\n \n 2022-07-04 09:11:19 UTC\n \n 2022-07-04 09:12: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 1698\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','2022-07-04 14:41:19',4,'2022-07-04 14:42:47',4,0,NULL,NULL,NULL,'da9d3384-9203-4c29-9bb3-0064275b0bbf'),(1699,'Clients given 5B weighing 6-9.9kg','Clients given 5B weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 6-9.9kg\n Clients given 5B weighing 6-9.9kg\n \n 2022-07-04 09:12:11 UTC\n \n 2022-07-04 09:14: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 1699\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','2022-07-04 14:42:11',4,'2022-07-04 14:44:17',4,0,NULL,NULL,NULL,'9b461cbe-5394-43f1-a3a8-5cab077d880b'),(1700,'Clients given 5B weighing 10-13.9kg','Clients given 5B weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 10-13.9kg\n Clients given 5B weighing 10-13.9kg\n \n 2022-07-04 09:13:47 UTC\n \n 2022-07-04 09:15: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 1700\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','2022-07-04 14:43:47',4,'2022-07-04 14:45:39',4,0,NULL,NULL,NULL,'e757de08-36b9-48aa-ae1c-6e8b67f41517'),(1701,'Clients given 5B weighing 14-19.9kg','Clients given 5B weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 14-19.9kg\n Clients given 5B weighing 14-19.9kg\n \n 2022-07-04 09:17:29 UTC\n \n 2022-07-04 09:33: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 1701\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','2022-07-04 14:47:29',4,'2022-07-04 15:03:16',4,0,NULL,NULL,NULL,'b1164742-ca14-4264-979a-53f89a268f3a'),(1702,'Clients given 5B weighing 20-24.9kg','Clients given 5B weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 20-24.9kg\n Clients given 5B weighing 20-24.9kg\n \n 2022-07-04 09:18:14 UTC\n \n 2022-07-04 09:33: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 1702\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','2022-07-04 14:48:14',4,'2022-07-04 15:03:55',4,0,NULL,NULL,NULL,'37598126-d94c-4da8-bbac-1e0b9020ef33'),(1703,'Clients given 5B weighing 25-34.9kg','Clients given 5B weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing 25-34.9kg\n Clients given 5B weighing 25-34.9kg\n \n 2022-07-04 09:38:26 UTC\n \n 2022-07-04 09:39: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 1703\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','2022-07-04 15:08:26',4,'2022-07-04 15:09:35',4,0,NULL,NULL,NULL,'578575b5-5eaf-4487-85b6-e81f72e577e7'),(1704,'Clients given 5C weighing 0-3.9kg','Clients given 5C weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 0-3.9kg\n Clients given 5C weighing 0-3.9kg\n \n 2022-07-04 09:40:50 UTC\n \n 2022-07-04 09:46: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 1704\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','2022-07-04 15:10:50',4,'2022-07-04 15:16:13',4,0,NULL,NULL,NULL,'183f7dbc-af84-4166-802d-fc168517be56'),(1705,'Clients given 5B weighing >= 35kg','Clients given 5B weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5B weighing >= 35kg\n Clients given 5B weighing >= 35kg\n \n 2022-07-04 09:41:33 UTC\n \n 2022-07-04 09:45: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 1705\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','2022-07-04 15:11:33',4,'2022-07-04 15:15:51',4,0,NULL,NULL,NULL,'bcad7f66-5905-4cb4-820c-20b76c185df0'),(1706,'Clients given 5C weighing 4-5.9kg','Clients given 5C weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 4-5.9kg\n Clients given 5C weighing 4-5.9kg\n \n 2022-07-04 09:46:54 UTC\n \n 2022-07-04 09:48: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 1706\n COUNT\n \n \n \n \n endDate\n ${startDate}\n \n \n location\n ${location}\n \n \n startDate\n ${startDate}\n \n \n \n','2022-07-04 15:16:54',4,'2022-07-04 15:18:55',4,0,NULL,NULL,NULL,'646d055c-d02e-46d9-8af4-e8edd67a053a'),(1707,'Clients given 5C weighing 6-9.9kg','Clients given 5C weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 6-9.9kg\n Clients given 5C weighing 6-9.9kg\n \n 2022-07-04 09:47:34 UTC\n \n 2022-07-04 09:49: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 1707\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','2022-07-04 15:17:34',4,'2022-07-04 15:19:45',4,0,NULL,NULL,NULL,'bff00fe0-ccdd-4e59-8a04-5daae78f609f'),(1708,'Clients given 5C weighing 6-9.9kg','Clients given 5C weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 6-9.9kg\n Clients given 5C weighing 6-9.9kg\n \n 2022-07-04 09:50:21 UTC\n \n 2022-07-04 09:52: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 1708\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','2022-07-04 15:20:21',4,'2022-07-04 15:22:53',4,0,NULL,NULL,NULL,'a12b3ec6-868f-49da-9993-65fcea6139ce'),(1709,'Clients given 5C weighing 10-13.9kg','Clients given 5C weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 10-13.9kg\n Clients given 5C weighing 10-13.9kg\n \n 2022-07-04 09:51:17 UTC\n \n 2022-07-04 09:54: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 1709\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','2022-07-04 15:21:17',4,'2022-07-04 15:24:31',4,0,NULL,NULL,NULL,'11fd5caf-00b2-4c9b-89d3-dbe43460e1b4'),(1710,'Clients given 5C weighing 14-19.9kg','Clients given 5C weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 14-19.9kg\n Clients given 5C weighing 14-19.9kg\n \n 2022-07-04 09:54:02 UTC\n \n 2022-07-04 10:19: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 1710\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','2022-07-04 15:24:02',4,'2022-07-04 15:49:24',4,0,NULL,NULL,NULL,'35c1a303-9f1d-41a4-a7b2-a63222c0c0f8'),(1711,'Clients given 5C weighing 20-24.9kg','Clients given 5C weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 20-24.9kg\n Clients given 5C weighing 20-24.9kg\n \n 2022-07-04 10:20:29 UTC\n \n 2022-07-04 10:24: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 1711\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','2022-07-04 15:50:29',4,'2022-07-04 15:54:33',4,0,NULL,NULL,NULL,'300ad93a-8a96-42ee-b027-15e6ea66150c'),(1712,'Clients given 5C weighing 25-34.9kg','Clients given 5C weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing 25-34.9kg\n Clients given 5C weighing 25-34.9kg\n \n 2022-07-04 10:20:49 UTC\n \n 2022-07-04 10:23: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 1712\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','2022-07-04 15:50:49',4,'2022-07-04 15:53:58',4,0,NULL,NULL,NULL,'2fb0cc71-47ac-4408-bb68-608d33609d53'),(1713,'Clients given 5C weighing >= 35kg','Clients given 5C weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5C weighing >= 35kg\n Clients given 5C weighing >= 35kg\n \n 2022-07-04 10:26:20 UTC\n \n 2022-07-04 10:29: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 1713\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','2022-07-04 15:56:20',4,'2022-07-04 15:59:43',4,0,NULL,NULL,NULL,'731fc698-2509-4d99-9163-e08624e75417'),(1714,'Clients given 5D weighing 0-3.9kg','Clients given 5D weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 0-3.9kg\n Clients given 5D weighing 0-3.9kg\n \n 2022-07-04 10:31:02 UTC\n \n 2022-07-04 10:34: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 1714\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','2022-07-04 16:01:02',4,'2022-07-04 16:04:29',4,0,NULL,NULL,NULL,'b285d939-9f51-47bd-8a6d-7f4e5d321058'),(1715,'Clients given 5D weighing 4-5.9kg','Clients given 5D weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 4-5.9kg\n Clients given 5D weighing 4-5.9kg\n \n 2022-07-04 10:36:13 UTC\n \n 2022-07-04 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 1715\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','2022-07-04 16:06:13',4,'2022-07-04 16:08:50',4,0,NULL,NULL,NULL,'8c7b5eac-d68a-4dbe-b341-3417d6c7cb50'),(1716,'Clients given 5D weighing 6-9.9kg','Clients given 5D weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 6-9.9kg\n Clients given 5D weighing 6-9.9kg\n \n 2022-07-04 10:36:38 UTC\n \n 2022-07-04 10:38: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 1716\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','2022-07-04 16:06:38',4,'2022-07-04 16:08:25',4,0,NULL,NULL,NULL,'f1dbcf85-e7e2-406e-ab4f-5b29a0f2dfb3'),(1717,'Clients given 5D weighing 10-13.9kg','Clients given 5D weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 10-13.9kg\n Clients given 5D weighing 10-13.9kg\n \n 2022-07-04 10:39:56 UTC\n \n 2022-07-04 10:42: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 1717\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','2022-07-04 16:09:56',4,'2022-07-04 16:12:05',4,0,NULL,NULL,NULL,'cc9e92c9-53f2-46a4-be46-ca904d385286'),(1718,'Clients given 5D weighing 14-19.9kg','Clients given 5D weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 14-19.9kg\n Clients given 5D weighing 14-19.9kg\n \n 2022-07-04 10:40:24 UTC\n \n 2022-07-04 10:42: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 1718\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','2022-07-04 16:10:24',4,'2022-07-04 16:12:36',4,0,NULL,NULL,NULL,'ea3aa469-cc4f-499c-b20f-a163afa5c116'),(1719,'Clients given 5D weighing 20-24.9kg','Clients given 5D weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 20-24.9kg\n Clients given 5D weighing 20-24.9kg\n \n 2022-07-04 10:43:39 UTC\n \n 2022-07-04 10:45: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 1719\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','2022-07-04 16:13:39',4,'2022-07-04 16:15:07',4,0,NULL,NULL,NULL,'51201bc9-2e68-47b2-a264-dfe852767cbb'),(1720,'Clients given 5D weighing 25-34.9kg','Clients given 5D weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing 25-34.9kg\n Clients given 5D weighing 25-34.9kg\n \n 2022-07-04 10:44:10 UTC\n \n 2022-07-04 10:46: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 1720\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','2022-07-04 16:14:10',4,'2022-07-04 16:16:49',4,0,NULL,NULL,NULL,'99779a0a-4228-4d21-bc53-a4724c950f64'),(1721,'Clients given 5D weighing >= 35kg','Clients given 5D weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5D weighing >= 35kg\n Clients given 5D weighing >= 35kg\n \n 2022-07-04 10:46:20 UTC\n \n 2022-07-04 10:49: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 1721\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','2022-07-04 16:16:20',4,'2022-07-04 16:19:12',4,0,NULL,NULL,NULL,'a9db689b-55c9-49a6-bf7b-f841503b81d4'),(1722,'Clients given 5E weighing 0-3.9kg','Clients given 5E weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 0-3.9kg\n Clients given 5E weighing 0-3.9kg\n \n 2022-07-04 10:49:03 UTC\n \n 2022-07-04 10:54: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 1722\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','2022-07-04 16:19:03',4,'2022-07-04 16:24:57',4,0,NULL,NULL,NULL,'98825a71-acf0-4a06-b318-1dfbc4bc85e8'),(1723,'Clients given 5E weighing 4-5.9kg','Clients given 5E weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 4-5.9kg\n Clients given 5E weighing 4-5.9kg\n \n 2022-07-04 10:50:24 UTC\n \n 2022-07-04 10:53: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 1723\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','2022-07-04 16:20:24',4,'2022-07-04 16:23:38',4,0,NULL,NULL,NULL,'09876d38-7d00-460f-a95d-f1d084f84cb0'),(1724,'Clients given 5E weighing 6-9.9kg','Clients given 5E weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 6-9.9kg\n Clients given 5E weighing 6-9.9kg\n \n 2022-07-04 10:55:45 UTC\n \n 2022-07-04 10:59: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 1724\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','2022-07-04 16:25:45',4,'2022-07-04 16:29:01',4,0,NULL,NULL,NULL,'d95839a2-da76-4d9f-9dde-6ef33f9d3c7d'),(1725,'Clients given 5E weighing 10-13.9kg','Clients given 5E weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 10-13.9kg\n Clients given 5E weighing 10-13.9kg\n \n 2022-07-04 10:56:27 UTC\n \n 2022-07-04 11:04: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 1725\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','2022-07-04 16:26:27',4,'2022-07-04 16:34:36',4,0,NULL,NULL,NULL,'c0a9a74f-b14c-42fb-87bc-710bd652916c'),(1726,'Clients given 5E weighing 14-19.9kg','Clients given 5E weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 14-19.9kg\n Clients given 5E weighing 14-19.9kg\n \n 2022-07-04 11:00:36 UTC\n \n 2022-07-04 11:07: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 1726\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','2022-07-04 16:30:36',4,'2022-07-04 16:37:08',4,0,NULL,NULL,NULL,'29478b1e-23c8-4fa0-a17e-9f3c11e801af'),(1727,'Clients given 5E weighing 20-24.9kg','Clients given 5E weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 20-24.9kg\n Clients given 5E weighing 20-24.9kg\n \n 2022-07-04 11:06:35 UTC\n \n 2022-07-04 11:08: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 1727\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','2022-07-04 16:36:35',4,'2022-07-04 16:38:57',4,0,NULL,NULL,NULL,'0a71c7f2-39c8-4d46-bdb3-847b616997b6'),(1728,'Clients given 5E weighing 25-34.9kg','Clients given 5E weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing 25-34.9kg\n Clients given 5E weighing 25-34.9kg\n \n 2022-07-04 11:09:38 UTC\n \n 2022-07-04 11:12: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 1728\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','2022-07-04 16:39:38',4,'2022-07-04 16:42:02',4,0,NULL,NULL,NULL,'f20e7d1a-0f66-4fb8-a254-11720f9fcdb4'),(1729,'Clients given 5E weighing >= 35kg','Clients given 5E weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5E weighing >= 35kg\n Clients given 5E weighing >= 35kg\n \n 2022-07-04 11:10:10 UTC\n \n 2022-07-04 11:11: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 1729\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','2022-07-04 16:40:10',4,'2022-07-04 16:41:28',4,0,NULL,NULL,NULL,'6c8300f9-3327-46f5-b538-5926daf7f3e9'),(1730,'Clients given 5F weighing 0-3.9kg','Clients given 5F weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 0-3.9kg\n Clients given 5F weighing 0-3.9kg\n \n 2022-07-04 11:12:43 UTC\n \n 2022-07-04 11:16: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 1730\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','2022-07-04 16:42:43',4,'2022-07-04 16:46:11',4,0,NULL,NULL,NULL,'cc140697-6404-4bfa-927a-1e331e05a771'),(1731,'Clients given 5F weighing 4-5.9kg','Clients given 5F weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 4-5.9kg\n Clients given 5F weighing 4-5.9kg\n \n 2022-07-04 11:15:42 UTC\n \n 2022-07-04 11:17: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 1731\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','2022-07-04 16:45:42',4,'2022-07-04 16:47:37',4,0,NULL,NULL,NULL,'feee080e-df6e-4d55-a631-a5b8e6561be8'),(1732,'Clients given 5F weighing 6-9.9kg','Clients given 5F weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 6-9.9kg\n Clients given 5F weighing 6-9.9kg\n \n 2022-07-04 11:16:51 UTC\n \n 2022-07-04 11:20: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 1732\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','2022-07-04 16:46:51',4,'2022-07-04 16:50:54',4,0,NULL,NULL,NULL,'fefc7c1d-f181-415a-b896-9ef303b4ce6a'),(1733,'Clients given 5F weighing 10-13.9kg','Clients given 5F weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 10-13.9kg\n Clients given 5F weighing 10-13.9kg\n \n 2022-07-04 11:19:35 UTC\n \n 2022-07-04 11:21: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 1733\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','2022-07-04 16:49:35',4,'2022-07-04 16:51:36',4,0,NULL,NULL,NULL,'cc52bd93-49e7-488c-9706-669f6401eb7a'),(1734,'Clients given 5F weighing 14-19.9kg','Clients given 5F weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 14-19.9kg\n Clients given 5F weighing 14-19.9kg\n \n 2022-07-04 11:27:47 UTC\n \n 2022-07-04 11:30: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 1734\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','2022-07-04 16:57:47',4,'2022-07-04 17:00:51',4,0,NULL,NULL,NULL,'a1b3f036-8f11-463c-906f-0907c8bb3168'),(1735,'Clients given 5F weighing 20-24.9kg','Clients given 5F weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 20-24.9kg\n Clients given 5F weighing 20-24.9kg\n \n 2022-07-04 11:28:06 UTC\n \n 2022-07-04 11: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 1735\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','2022-07-04 16:58:06',4,'2022-07-04 17:01:26',4,0,NULL,NULL,NULL,'545d0307-0065-48ef-b35d-db0b97d6f0a4'),(1736,'Clients given 5F weighing 25-34.9kg','Clients given 5F weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing 25-34.9kg\n Clients given 5F weighing 25-34.9kg\n \n 2022-07-04 11:32:18 UTC\n \n 2022-07-04 11: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 1736\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','2022-07-04 17:02:18',4,'2022-07-04 17:04:20',4,0,NULL,NULL,NULL,'a3cc0250-e3f5-4b02-a569-d5737c7c2ca2'),(1737,'Clients given 5F weighing >= 35kg','Clients given 5F weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5F weighing >= 35kg\n Clients given 5F weighing >= 35kg\n \n 2022-07-04 11:32:59 UTC\n \n 2022-07-04 11: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 1737\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','2022-07-04 17:02:59',4,'2022-07-04 17:04:45',4,0,NULL,NULL,NULL,'ff867f63-d45f-4ffc-8378-22a72111492b'),(1738,'Clients given 5G weighing 0-3.9kg','Clients given 5G weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 0-3.9kg\n Clients given 5G weighing 0-3.9kg\n \n 2022-07-04 11:37:11 UTC\n \n 2022-07-04 11:39: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 1738\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','2022-07-04 17:07:11',4,'2022-07-04 17:09:08',4,0,NULL,NULL,NULL,'b5725eac-2a7a-4f4b-be0b-670c5edae46f'),(1739,'Clients given 5G weighing 4-5.9kg','Clients given 5G weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 4-5.9kg\n Clients given 5G weighing 4-5.9kg\n \n 2022-07-04 11:38:21 UTC\n \n 2022-07-04 11:40: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 1739\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','2022-07-04 17:08:21',4,'2022-07-04 17:10:28',4,0,NULL,NULL,NULL,'01b5a831-a97a-473d-9cab-171aed11937a'),(1740,'Clients given 5G weighing 6-9.9kg','Clients given 5G weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 6-9.9kg\n Clients given 5G weighing 6-9.9kg\n \n 2022-07-04 11:40:56 UTC\n \n 2022-07-04 11:42: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 1740\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','2022-07-04 17:10:56',4,'2022-07-04 17:12:46',4,0,NULL,NULL,NULL,'b35556af-d5de-4740-8d7d-ee2c7415f2aa'),(1741,'Clients given 5G weighing 10-13.9kg','Clients given 5G weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 10-13.9kg\n Clients given 5G weighing 10-13.9kg\n \n 2022-07-04 11:41:26 UTC\n \n 2022-07-04 11:43: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 1741\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','2022-07-04 17:11:26',4,'2022-07-04 17:13:31',4,0,NULL,NULL,NULL,'fecb7060-8111-4db9-aa13-9355bfe19034'),(1742,'Clients given 5G weighing 14-19.9kg','Clients given 5G weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 14-19.9kg\n Clients given 5G weighing 14-19.9kg\n \n 2022-07-04 11:44:52 UTC\n \n 2022-07-04 11: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 1742\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','2022-07-04 17:14:52',4,'2022-07-04 17:17:38',4,0,NULL,NULL,NULL,'edcea1e9-f4fe-459c-a9a5-99dc5b454f6b'),(1743,'Clients given 5G weighing 20-24.9kg','Clients given 5G weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 20-24.9kg\n Clients given 5G weighing 20-24.9kg\n \n 2022-07-04 11:45:28 UTC\n \n 2022-07-04 11:47:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1743\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','2022-07-04 17:15:28',4,'2022-07-04 17:17:23',4,0,NULL,NULL,NULL,'d624256f-ee53-49de-b806-e54f0f885165'),(1744,'Clients given 5G weighing 25-34.9kg','Clients given 5G weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 25-34.9kg\n Clients given 5G weighing 25-34.9kg\n \n 2022-07-04 11:48:46 UTC\n \n 2022-07-06 09:16:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1744\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','2022-07-04 11:48:46',4,'2022-07-06 09:16:23',4,0,NULL,NULL,NULL,'2fdbe8de-90ef-4198-8960-6d195608e255'),(1745,'Clients given 5G weighing >= 35kg','Clients given 5G weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing >= 35kg\n Clients given 5G weighing >= 35kg\n \n 2022-07-04 11:49:49 UTC\n \n 2022-07-04 11:51: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 1745\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','2022-07-04 17:19:49',4,'2022-07-04 17:21:52',4,0,NULL,NULL,NULL,'477dc5ab-12a7-4553-b65d-57ced1093ae7'),(1746,'Clients given 5G weighing 0-3.9kg','Clients given 5G weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 0-3.9kg\n Clients given 5G weighing 0-3.9kg\n \n 2022-07-04 11:52:26 UTC\n \n 2022-07-04 11:55: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 1746\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','2022-07-04 17:22:26',4,'2022-07-04 17:25:43',4,0,NULL,NULL,NULL,'b30dd237-ce5e-4eb4-8c3e-e4522f1fc695'),(1747,'Clients given 5G weighing 4-5.9kg','Clients given 5G weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 4-5.9kg\n Clients given 5G weighing 4-5.9kg\n \n 2022-07-04 11:53:47 UTC\n \n 2022-07-04 11:56: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 1747\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','2022-07-04 17:23:47',4,'2022-07-04 17:26:37',4,0,NULL,NULL,NULL,'8e235e40-e811-4db9-82c2-ab1b5d2965f9'),(1748,'Clients given 5G weighing 6-9.9kg','Clients given 5G weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 6-9.9kg\n Clients given 5G weighing 6-9.9kg\n \n 2022-07-04 11:57:59 UTC\n \n 2022-07-04 12:00: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 1748\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','2022-07-04 17:27:59',4,'2022-07-04 17:30:12',4,0,NULL,NULL,NULL,'b0a0a091-97ba-49d0-9845-f10070dd4ea3'),(1749,'Clients given 5G weighing 10-13.9kg','Clients given 5G weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 10-13.9kg\n Clients given 5G weighing 10-13.9kg\n \n 2022-07-04 11:58:53 UTC\n \n 2022-07-04 12:00: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 1749\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','2022-07-04 17:28:53',4,'2022-07-04 17:30:48',4,0,NULL,NULL,NULL,'3d826ce1-96c8-4e57-892d-c097e4ac9ac5'),(1750,'Clients given 5G weighing 14-19.9kg','Clients given 5G weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 14-19.9kg\n Clients given 5G weighing 14-19.9kg\n \n 2022-07-04 12:03:51 UTC\n \n 2022-07-04 12:08:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1750\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','2022-07-04 17:33:51',4,'2022-07-04 17:38:23',4,0,NULL,NULL,NULL,'79890495-f468-4d64-b519-756630352b5d'),(1751,'Clients given 5G weighing 20-24.9kg','Clients given 5G weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 20-24.9kg\n Clients given 5G weighing 20-24.9kg\n \n 2022-07-04 12:04:50 UTC\n \n 2022-07-04 18:39: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 1751\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','2022-07-04 17:34:50',4,'2022-07-05 00:09:28',4,0,NULL,NULL,NULL,'d06ae952-edbf-4c3e-b3a8-1c4ee70886fc'),(1752,' Clients given 5G weighing 25-29.9kg',' Clients given 5G weighing 25-29.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing 25-29.9kg\n Clients given 5G weighing 25-29.9kg\n \n 2022-07-04 18:44:18 UTC\n \n 2022-07-04 18:47: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 1752\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','2022-07-05 00:14:18',4,'2022-07-05 00:17:20',4,0,NULL,NULL,NULL,'ad3c3764-3438-43a7-ade5-98458af16de5'),(1753,' Clients given 5G weighing >= 35kg',' Clients given 5G weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5G weighing >= 35kg\n Clients given 5G weighing >= 35kg\n \n 2022-07-04 18:47:57 UTC\n \n 2022-07-04 18:49: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 1753\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','2022-07-05 00:17:57',4,'2022-07-05 00:19:45',4,0,NULL,NULL,NULL,'5c731dbc-ddd2-4a58-9e69-c112f74d40a7'),(1754,' Clients given 5H weighing 0-3.9kg',' Clients given 5H weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 0-3.9kg\n Clients given 5H weighing 0-3.9kg\n \n 2022-07-04 18:49:18 UTC\n \n 2022-07-04 18:53: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 1754\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','2022-07-05 00:19:18',4,'2022-07-05 00:23:27',4,0,NULL,NULL,NULL,'76ca732d-65f9-4ec3-8c5c-41d7503ed512'),(1755,' Clients given 5H weighing 4-5.9kg',' Clients given 5H weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 4-5.9kg\n Clients given 5H weighing 4-5.9kg\n \n 2022-07-04 18:54:29 UTC\n \n 2022-07-04 18:55: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 1755\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','2022-07-05 00:24:29',4,'2022-07-05 00:25:53',4,0,NULL,NULL,NULL,'75354bc7-40ec-489e-a13a-5b0de9d609cd'),(1756,' Clients given 5H weighing 6-9.9kg',' Clients given 5H weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 6-9.9kg\n Clients given 5H weighing 6-9.9kg\n \n 2022-07-04 18:55:07 UTC\n \n 2022-07-04 18:58: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 1756\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','2022-07-05 00:25:07',4,'2022-07-05 00:28:07',4,0,NULL,NULL,NULL,'4c27c57e-78ec-4934-837f-d52f59a8e263'),(1757,' Clients given 5H weighing 10-13.9kg',' Clients given 5H weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 10-13.9kg\n Clients given 5H weighing 10-13.9kg\n \n 2022-07-04 18:57:10 UTC\n \n 2022-07-04 19:05: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 1757\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','2022-07-05 00:27:10',4,'2022-07-05 00:35:15',4,0,NULL,NULL,NULL,'10ee2cc4-a8c0-46c7-8b26-2c69eafd6aed'),(1758,' Clients given 5H weighing 14-19.9kg',' Clients given 5H weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 14-19.9kg\n Clients given 5H weighing 14-19.9kg\n \n 2022-07-04 18:58:51 UTC\n \n 2022-07-04 19:01: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 1758\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','2022-07-05 00:28:51',4,'2022-07-05 00:31:57',4,0,NULL,NULL,NULL,'bfd4191f-c556-41df-8f09-970ece8eb883'),(1759,' Clients given 5H weighing 20-24.9kg',' Clients given 5H weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 20-24.9kg\n Clients given 5H weighing 20-24.9kg\n \n 2022-07-04 19:02:44 UTC\n \n 2022-07-04 19:03: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 1759\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','2022-07-05 00:32:44',4,'2022-07-05 00:33:54',4,0,NULL,NULL,NULL,'3118f852-4fd1-4807-abfc-6f4d8a4b34e3'),(1760,' Clients given 5H weighing 25-34.9kg',' Clients given 5H weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing 25-34.9kg\n Clients given 5H weighing 25-34.9kg\n \n 2022-07-04 19:04:45 UTC\n \n 2022-07-04 19:07: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 1760\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','2022-07-05 00:34:45',4,'2022-07-05 00:37:04',4,0,NULL,NULL,NULL,'443efbd3-a0a9-473a-8408-e57b58477156'),(1761,' Clients given 5H weighing >= 35kg',' Clients given 5H weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 5H weighing >= 35kg\n Clients given 5H weighing >= 35kg\n \n 2022-07-04 19:06:06 UTC\n \n 2022-07-04 19:07: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 1761\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','2022-07-05 00:36:06',4,'2022-07-05 00:37:27',4,0,NULL,NULL,NULL,'89320a1f-49b4-464e-8a37-21748419ed81'),(1762,' Clients given 6A weighing 0-3.9kg',' Clients given 6A weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 0-3.9kg\n Clients given 6A weighing 0-3.9kg\n \n 2022-07-04 19:08:02 UTC\n \n 2022-07-04 19:09: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 1762\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','2022-07-05 00:38:02',4,'2022-07-05 00:39:31',4,0,NULL,NULL,NULL,'f0cdda8e-9894-4125-b1c0-014ccc6ad7ea'),(1763,' Clients given 6A weighing 4-5.9kg',' Clients given 6A weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 4-5.9kg\n Clients given 6A weighing 4-5.9kg\n \n 2022-07-04 19:08:26 UTC\n \n 2022-07-04 19:09: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 1763\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','2022-07-05 00:38:26',4,'2022-07-05 00:39:50',4,0,NULL,NULL,NULL,'5701682a-a88c-46a8-957a-3322894a6e43'),(1764,' Clients given 6A weighing 6-9.9kg',' Clients given 6A weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 6-9.9kg\n Clients given 6A weighing 6-9.9kg\n \n 2022-07-04 19:10:14 UTC\n \n 2022-07-04 19: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 1764\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','2022-07-05 00:40:14',4,'2022-07-05 00:41:50',4,0,NULL,NULL,NULL,'92f27e6f-6178-4e65-b055-798f3dd1e1ae'),(1765,' Clients given 6A weighing 10-13.9kg',' Clients given 6A weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 10-13.9kg\n Clients given 6A weighing 10-13.9kg\n \n 2022-07-04 19:10:49 UTC\n \n 2022-07-04 19:12: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 1765\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','2022-07-05 00:40:49',4,'2022-07-05 00:42:19',4,0,NULL,NULL,NULL,'a74e222c-96c6-45f8-83e7-3ce0d50cc83c'),(1766,' Clients given 6A weighing 14-19.9kg',' Clients given 6A weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 14-19.9kg\n Clients given 6A weighing 14-19.9kg\n \n 2022-07-04 19:12:45 UTC\n \n 2022-07-04 19: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 1766\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','2022-07-05 00:42:45',4,'2022-07-05 00:44:57',4,0,NULL,NULL,NULL,'79e9b5db-636c-4afb-8291-cb558667ebd5'),(1767,' Clients given 6A weighing 20-24.9kg',' Clients given 6A weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 20-24.9kg\n Clients given 6A weighing 20-24.9kg\n \n 2022-07-04 19:13:20 UTC\n \n 2022-07-04 19:15: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 1767\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','2022-07-05 00:43:20',4,'2022-07-05 00:45:14',4,0,NULL,NULL,NULL,'11eeec05-8a04-4f44-bc0c-dddb88b8270d'),(1768,' Clients given 6A weighing 25-34.9kg',' Clients given 6A weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing 25-34.9kg\n Clients given 6A weighing 25-34.9kg\n \n 2022-07-04 19:13:46 UTC\n \n 2022-07-04 19:15: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 1768\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','2022-07-05 00:43:46',4,'2022-07-05 00:45:35',4,0,NULL,NULL,NULL,'23c30258-a527-4c1e-92b8-c3d7310c7c49'),(1769,' Clients given 6A weighing >= 35kg',' Clients given 6A weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6A weighing >= 35kg\n Clients given 6A weighing >= 35kg\n \n 2022-07-04 19:16:05 UTC\n \n 2022-07-04 19:18: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 1769\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','2022-07-05 00:46:05',4,'2022-07-05 00:48:21',4,0,NULL,NULL,NULL,'eac739c5-ff7a-4169-a6c2-faba753958df'),(1770,' Clients given 6B weighing 0-3.9kg',' Clients given 6B weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 0-3.9kg\n Clients given 6B weighing 0-3.9kg\n \n 2022-07-04 19:16:33 UTC\n \n 2022-07-04 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 1770\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','2022-07-05 00:46:33',4,'2022-07-05 00:48:05',4,0,NULL,NULL,NULL,'6e8cb9ab-5663-4da1-9c67-9188bf5ce4c6'),(1771,' Clients given 6B weighing 4-5.9kg',' Clients given 6B weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 4-5.9kg\n Clients given 6B weighing 4-5.9kg\n \n 2022-07-04 19:16:56 UTC\n \n 2022-07-04 19:18: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 1771\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','2022-07-05 00:46:56',4,'2022-07-05 00:48:41',4,0,NULL,NULL,NULL,'6e7f8b89-d2bb-42a4-8b0d-687950bfd3a8'),(1772,' Clients given 6B weighing 6-9.9kg',' Clients given 6B weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 6-9.9kg\n Clients given 6B weighing 6-9.9kg\n \n 2022-07-04 19:19:08 UTC\n \n 2022-07-04 19:22: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 1772\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','2022-07-05 00:49:08',4,'2022-07-05 00:52:03',4,0,NULL,NULL,NULL,'4ccea0f3-80d7-4b3f-850f-93985538cfeb'),(1773,' Clients given 6B weighing 10-13.9kg',' Clients given 6B weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 10-13.9kg\n Clients given 6B weighing 10-13.9kg\n \n 2022-07-04 19:19:37 UTC\n \n 2022-07-04 19:22: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 1773\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','2022-07-05 00:49:37',4,'2022-07-05 00:52:18',4,0,NULL,NULL,NULL,'3c303fcf-f9db-4e5f-8e9e-33df86616930'),(1774,' Clients given 6B weighing 14-19.9kg',' Clients given 6B weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 14-19.9kg\n Clients given 6B weighing 14-19.9kg\n \n 2022-07-04 19:20:09 UTC\n \n 2022-07-04 19:24: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 1774\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','2022-07-05 00:50:09',4,'2022-07-05 00:54:44',4,0,NULL,NULL,NULL,'551ea342-168d-4089-834b-dab745648722'),(1775,' Clients given 6B weighing 20-24.9kg',' Clients given 6B weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 20-24.9kg\n Clients given 6B weighing 20-24.9kg\n \n 2022-07-04 19:20:32 UTC\n \n 2022-07-04 19:23: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 1775\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','2022-07-05 00:50:32',4,'2022-07-05 00:53:03',4,0,NULL,NULL,NULL,'42e304a1-3961-4344-ae32-2348b7a5b81a'),(1776,' Clients given 6B weighing 25-34.9kg',' Clients given 6B weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing 25-34.9kg\n Clients given 6B weighing 25-34.9kg\n \n 2022-07-04 19:23:47 UTC\n \n 2022-07-04 19:27: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 1776\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','2022-07-05 00:53:47',4,'2022-07-05 00:57:17',4,0,NULL,NULL,NULL,'70621294-d632-4b66-8f10-0343433b8267'),(1777,' Clients given 6B weighing >= 35kg',' Clients given 6B weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6B weighing >= 35kg\n Clients given 6B weighing >= 35kg\n \n 2022-07-04 19:24:19 UTC\n \n 2022-07-04 19:27: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 1777\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','2022-07-05 00:54:19',4,'2022-07-05 00:57:33',4,0,NULL,NULL,NULL,'ed32ff5b-41ed-4933-a39e-bc4fb685b9eb'),(1778,'Clients given 6C weighing 0-3.9kg','Clients given 6C weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 0-3.9kg\n Clients given 6C weighing 0-3.9kg\n \n 2022-07-05 06:03:11 UTC\n \n 2022-07-05 06:05: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 1778\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','2022-07-05 11:33:11',4,'2022-07-05 11:35:26',4,0,NULL,NULL,NULL,'7708c697-6d7d-42e7-aba6-613e36081fab'),(1779,'Clients given 6C weighing 4-5.9kg','Clients given 6C weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 4-5.9kg\n Clients given 6C weighing 6-9.9kg\n \n 2022-07-05 06:03:33 UTC\n \n 2022-07-05 06:09: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 1779\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','2022-07-05 11:33:33',4,'2022-07-05 11:39:04',4,0,NULL,NULL,NULL,'95504660-becd-4eff-a280-5aa869762885'),(1780,'Clients given 6C weighing 6-9.9kg','Clients given 6C weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 6-9.9kg\n Clients given 6C weighing 6-9.9kg\n \n 2022-07-05 06:03:55 UTC\n \n 2022-07-05 06:07: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 1780\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','2022-07-05 11:33:55',4,'2022-07-05 11:37:47',4,0,NULL,NULL,NULL,'d3ba1e90-03ce-4af3-8b68-9e4bb86a2fda'),(1781,'Clients given 6C weighing 10-13.9kg','Clients given 6C weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 10-13.9kg\n Clients given 6C weighing 10-13.9kg\n \n 2022-07-05 06:09:31 UTC\n \n 2022-07-05 06:12:33 UTC\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 endDate\n \n java.util.Date\n true\n \n \n 1781\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','2022-07-05 11:39:31',4,'2022-07-05 11:42:33',4,0,NULL,NULL,NULL,'bd61f262-344c-4834-846b-dbfd4b8f8454'),(1782,'Clients given 6C weighing 14-19.9kg','Clients given 6C weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 14-19.9kg\n Clients given 6C weighing 14-19.9kg\n \n 2022-07-05 06:11:03 UTC\n \n 2022-07-05 06:14: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 1782\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','2022-07-05 11:41:03',4,'2022-07-05 11:44:18',4,0,NULL,NULL,NULL,'ef452600-16ec-4d05-bf02-a2f5da8c503d'),(1783,'Clients given 6C weighing 20-24.9kg','Clients given 6C weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 20-24.9kg\n Clients given 6C weighing 20-24.9kg\n \n 2022-07-05 06:12:09 UTC\n \n 2022-07-05 06:14: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 1783\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','2022-07-05 11:42:09',4,'2022-07-05 11:44:44',4,0,NULL,NULL,NULL,'84b7e946-ef4b-498c-aa99-a7469d841d89'),(1784,'Clients given 6C weighing 25-34.9kg','Clients given 6C weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing 25-34.9kg\n Clients given 6C weighing 25-34.9kg\n \n 2022-07-05 06:13:57 UTC\n \n 2022-07-05 06:17: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 1784\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','2022-07-05 11:43:57',4,'2022-07-05 11:47:03',4,0,NULL,NULL,NULL,'d0662ec5-9909-46a1-8d42-4f13c5e08f54'),(1785,'Clients given 6C weighing >= 35kg','Clients given 6C weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6C weighing >= 35kg\n Clients given 6C weighing >= 35kg\n \n 2022-07-05 06:17:43 UTC\n \n 2022-07-05 06:20: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 1785\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','2022-07-05 11:47:43',4,'2022-07-05 11:50:43',4,0,NULL,NULL,NULL,'e469295b-caa7-4154-b5ac-e2d0a7042d5b'),(1786,'Clients given 6D weighing 0-3.9kg','Clients given 6D weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 0-3.9kg\n Clients given 6D weighing 0-3.9kg\n \n 2022-07-05 06:18:16 UTC\n \n 2022-07-05 06:19: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 1786\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','2022-07-05 11:48:16',4,'2022-07-05 11:49:53',4,0,NULL,NULL,NULL,'a6985c5b-86f8-4647-86ea-ddd69097681e'),(1787,'Clients given 6D weighing 4-5.9kg','Clients given 6D weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 4-5.9kg\n Clients given 6D weighing 4-5.9kg\n \n 2022-07-05 06:18:43 UTC\n \n 2022-07-05 06:20: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 1787\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','2022-07-05 11:48:43',4,'2022-07-05 11:50:24',4,0,NULL,NULL,NULL,'3eec1d07-6d91-43dd-a942-24d23e4a0f9c'),(1788,'Clients given 6D weighing 6-9.9kg','Clients given 6D weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 6-9.9kg\n Clients given 6D weighing 6-9.9kg\n \n 2022-07-05 06:21:17 UTC\n \n 2022-07-05 06:22: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 1788\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','2022-07-05 11:51:17',4,'2022-07-05 11:52:45',4,0,NULL,NULL,NULL,'37509f55-cbd9-4096-8522-1e7918b1a48c'),(1789,'Clients given 6D weighing 10-13.9kg','Clients given 6D weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 10-13.9kg\n Clients given 6D weighing 10-13.9kg\n \n 2022-07-05 06:21:34 UTC\n \n 2022-07-05 06:23: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 1789\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','2022-07-05 11:51:34',4,'2022-07-05 11:53:04',4,0,NULL,NULL,NULL,'477311cf-0367-47e1-9717-4732fc0752f0'),(1790,'Clients given 6D weighing 14-19.9kg','Clients given 6D weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 14-19.9kg\n Clients given 6D weighing 14-19.9kg\n \n 2022-07-05 06:21:55 UTC\n \n 2022-07-05 06:23: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 1790\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','2022-07-05 11:51:55',4,'2022-07-05 11:53:21',4,0,NULL,NULL,NULL,'62232334-aa48-4e29-92fc-c4f931bcfb01'),(1791,'Clients given 6D weighing 20-24.9kg','Clients given 6D weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 20-24.9kg\n Clients given 6D weighing 20-24.9kg\n \n 2022-07-05 06:23:43 UTC\n \n 2022-07-05 06:25: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 1791\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','2022-07-05 11:53:43',4,'2022-07-05 11:55:33',4,0,NULL,NULL,NULL,'8b171cf1-4052-49f3-9b28-76161872f1ac'),(1792,'Clients given 6D weighing 25-34.9kg','Clients given 6D weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing 25-34.9kg\n Clients given 6D weighing 25-34.9kg\n \n 2022-07-05 06:24:03 UTC\n \n 2022-07-05 06:25: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 1792\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','2022-07-05 11:54:03',4,'2022-07-05 11:55:47',4,0,NULL,NULL,NULL,'20d6a8c0-12ee-420c-a3f6-22d2e7a829bd'),(1793,'Clients given 6D weighing >= 35kg','Clients given 6D weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6D weighing >= 35kg\n Clients given 6D weighing >= 35kg\n \n 2022-07-05 06:24:35 UTC\n \n 2022-07-05 06:26: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 1793\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','2022-07-05 11:54:35',4,'2022-07-05 11:56:11',4,0,NULL,NULL,NULL,'41d104fe-8277-4caa-b55e-07ea346801a7'),(1794,'Clients given 6E weighing 0-3.9 kg','Clients given 6E weighing 0-3.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 0-3.9 kg\n Clients given 6E weighing 0-3.9 kg\n \n 2022-07-05 06:27:58 UTC\n \n 2022-07-05 06:30: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 1794\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','2022-07-05 11:57:58',4,'2022-07-05 12:00:43',4,0,NULL,NULL,NULL,'ddcdfef8-c5fd-4bd2-9963-4d5d48702f57'),(1795,'Clients given 6E weighing 4-5.9 kg','Clients given 6E weighing 4-5.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 4-5.9 kg\n Clients given 6E weighing 4-5.9 kg\n \n 2022-07-05 06:28:17 UTC\n \n 2022-07-05 06:32: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 1795\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','2022-07-05 11:58:17',4,'2022-07-05 12:02:01',4,0,NULL,NULL,NULL,'52757686-f3a7-4d53-84bb-76aea347f4d3'),(1796,'Clients given 6E weighing 6-9.9 kg','Clients given 6E weighing 6-9.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 6-9.9 kg\n Clients given 6E weighing 6-9.9 kg\n \n 2022-07-05 06:30:03 UTC\n \n 2022-07-05 06:31: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 1796\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2022-07-05 12:00:03',4,'2022-07-05 12:01:15',4,0,NULL,NULL,NULL,'d0682189-7d23-4c17-9648-ae39ea0f6916'),(1797,'Clients given 6E weighing 10-13.9 kg','Clients given 6E weighing 10-13.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 10-13.9 kg\n Clients given 6E weighing 10-13.9 kg\n \n 2022-07-05 06:32:34 UTC\n \n 2022-07-05 06: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 1797\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','2022-07-05 12:02:34',4,'2022-07-05 12:04:30',4,0,NULL,NULL,NULL,'ad8a6b3c-88dd-4328-b042-076242f1ce54'),(1798,'Clients given 6E weighing 14-19.9 kg','Clients given 6E weighing 14-19.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 14-19.9 kg\n Clients given 6E weighing 14-19.9 kg\n \n 2022-07-05 06:33:01 UTC\n \n 2022-07-05 06:34: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 1798\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','2022-07-05 12:03:01',4,'2022-07-05 12:04:51',4,0,NULL,NULL,NULL,'d58c1b55-d21c-497a-b201-c1f544c8264c'),(1799,'Clients given 6E weighing 20-24.9 kg','Clients given 6E weighing 20-24.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 20-24.9 kg\n Clients given 6E weighing 20-24.9 kg\n \n 2022-07-05 06:33:24 UTC\n \n 2022-07-05 06:35: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 1799\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','2022-07-05 12:03:24',4,'2022-07-05 12:05:10',4,0,NULL,NULL,NULL,'e38de12c-6c72-4188-a8b7-b6d912e7baf2'),(1800,'Clients given 6E weighing 25-34.9 kg','Clients given 6E weighing 25-34.9 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing 25-34.9 kg\n Clients given 6E weighing 25-34.9 kg\n \n 2022-07-05 06:35:31 UTC\n \n 2022-07-05 06:37: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 1800\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','2022-07-05 12:05:31',4,'2022-07-05 12:07:03',4,0,NULL,NULL,NULL,'24def27b-738c-424e-b397-689a9fc28dd0'),(1801,'Clients given 6E weighing >= 35 kg','Clients given 6E weighing >= 35 kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6E weighing >= 35 kg\n Clients given 6E weighing >= 35 kg\n \n 2022-07-05 06:35:59 UTC\n \n 2022-07-05 06:37: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 1801\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','2022-07-05 12:05:59',4,'2022-07-05 12:07:19',4,0,NULL,NULL,NULL,'bc732e0d-7aa7-412d-855c-76442487b9c9'),(1802,'Clients given 6F weighing 4-5.9kg','Clients given 6F weighing 4-5.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 4-5.9kg\n Clients given 6F weighing 4-5.9kg\n \n 2022-07-05 06:38:03 UTC\n \n 2022-07-05 06:42: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 1802\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','2022-07-05 12:08:03',4,'2022-07-05 12:12:09',4,0,NULL,NULL,NULL,'31aaf13e-0c70-472d-9d6f-8d288c6545d7'),(1803,'Clients given 6F weighing 0-3.9kg','Clients given 6F weighing 0-3.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 0-3.9kg\n Clients given 6F weighing 0-3.9kg\n \n 2022-07-05 06:38:38 UTC\n \n 2022-07-05 06:43: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 1803\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','2022-07-05 12:08:38',4,'2022-07-05 12:13:27',4,0,NULL,NULL,NULL,'ec58cc67-3866-4031-a385-d5f40bf5fa80'),(1804,'Clients given 6F weighing 6-9.9kg','Clients given 6F weighing 6-9.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 6-9.9kg\n Clients given 6F weighing 6-9.9kg\n \n 2022-07-05 06:40:34 UTC\n \n 2022-07-05 06:42: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 1804\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2022-07-05 12:10:34',4,'2022-07-05 12:12:24',4,0,NULL,NULL,NULL,'ece7781b-8125-44f0-8189-6f4f66258b2c'),(1805,'Clients given 6F weighing 10-13.9kg','Clients given 6F weighing 10-13.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 10-13.9kg\n Clients given 6F weighing 10-13.9kg\n \n 2022-07-05 06:44:04 UTC\n \n 2022-07-05 06:47: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 1805\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','2022-07-05 12:14:04',4,'2022-07-05 12:17:25',4,0,NULL,NULL,NULL,'6cd6003e-fd2a-4acd-acbf-8025ed274332'),(1806,'Clients given 6F weighing 14-19.9kg','Clients given 6F weighing 14-19.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 14-19.9kg\n Clients given 6F weighing 14-19.9kg\n \n 2022-07-05 06:44:30 UTC\n \n 2022-07-05 06:50: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 1806\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','2022-07-05 12:14:30',4,'2022-07-05 12:20:01',4,0,NULL,NULL,NULL,'c465345e-8ab1-45d7-972a-d39b87dd1ade'),(1807,'Clients given 6F weighing 20-24.9kg','Clients given 6F weighing 20-24.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 20-24.9kg\n Clients given 6F weighing 20-24.9kg\n \n 2022-07-05 06:44:51 UTC\n \n 2022-07-05 06:46: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 1807\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','2022-07-05 12:14:51',4,'2022-07-05 12:16:42',4,0,NULL,NULL,NULL,'383ecc01-a8e6-42b4-83f3-eb9c2e48386b'),(1808,'Clients given 6F weighing 25-34.9kg','Clients given 6F weighing 25-34.9kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing 25-34.9kg\n Clients given 6F weighing 25-34.9kg\n \n 2022-07-05 06:49:35 UTC\n \n 2022-07-05 06:54: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 1808\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','2022-07-05 12:19:35',4,'2022-07-05 12:24:29',4,0,NULL,NULL,NULL,'bacab6c2-b1d6-4a10-9f0d-ffb24844bae5'),(1809,'Clients given 6F weighing >= 35kg','Clients given 6F weighing >= 35kg','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients given 6F weighing >= 35kg\n Clients given 6F weighing >= 35kg\n \n 2022-07-05 06:53:17 UTC\n \n 2022-07-05 06:56: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 1809\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','2022-07-05 12:23:17',4,'2022-07-05 12:26:41',4,0,NULL,NULL,NULL,'2614b81d-6441-4ee3-b4a7-a15f3ba36ace'),(1810,'Children ARV Regimen_2ndLine_2022','Children ARV Regimen_2ndLine','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_2ndLine_2022\n Children ARV Regimen_2ndLine\n \n 2022-07-06 07:16:05 UTC\n \n 2022-07-06 10: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 1810\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','2022-07-06 07:16:05',4,'2022-07-06 10:13:16',4,0,NULL,NULL,NULL,'dffce2c4-7adc-497e-8216-fa138d0201b1'),(1811,'Children ARV Regimen_2ndLine Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_2ndLine Data Set\n \n 2022-07-06 07:16:44 UTC\n \n 2022-07-06 10:11: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 1811\n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n 5A0to3.9\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\n Children 0to14\n \n \n \n \n \n 5A10to13.9\n \n \n \n \n \n \n \n \n \n 5A14to19.9\n \n \n \n \n \n \n \n \n \n 5A20to24.9\n \n \n \n \n \n \n \n \n \n 5A25to34.9\n \n \n \n \n \n \n \n \n \n 5A35plus\n \n \n \n \n \n \n \n \n \n 5A4to5.9\n \n \n \n \n \n \n \n \n \n 5A6to9.9\n \n \n \n \n \n \n \n \n \n 5B0to3.9\n \n \n \n \n \n \n \n \n \n 5B10to13.9\n \n \n \n \n \n \n \n \n \n 5B14to19.9\n \n \n \n \n \n \n \n \n \n 5B20to24.9\n \n \n \n \n \n \n \n \n \n 5B25to34.9\n \n \n \n \n \n \n \n \n \n 5B35plus\n \n \n \n \n \n \n \n \n \n 5B4to5.9\n \n \n \n \n \n \n \n \n \n 5B6to9.9\n \n \n \n \n \n \n \n \n \n 5C0to3.9\n \n \n \n \n \n \n \n \n \n 5C10to13.9\n \n \n \n \n \n \n \n \n \n 5C14to19.9\n \n \n \n \n \n \n \n \n \n 5C20to24.9\n \n \n \n \n \n \n \n \n \n 5C25to34.9\n \n \n \n \n \n \n \n \n \n 5C35plus\n \n \n \n \n \n \n \n \n \n 5C4to5.9\n \n \n \n \n \n \n \n \n \n 5C6to9.9\n \n \n \n \n \n \n \n \n \n 5D0to3.9\n \n \n \n \n \n \n \n \n \n 5D10to13.9\n \n \n \n \n \n \n \n \n \n 5D14to19.9\n \n \n \n \n \n \n \n \n \n 5D20to24.9\n \n \n \n \n \n \n \n \n \n 5D25to34.9\n \n \n \n \n \n \n \n \n \n 5D35plus\n \n \n \n \n \n \n \n \n \n 5D4to5.9\n \n \n \n \n \n \n \n \n \n 5D6to9.9\n \n \n \n \n \n \n \n \n \n 5E0to3.9\n \n \n \n \n \n \n \n \n \n 5E10to13.9\n \n \n \n \n \n \n \n \n \n 5E14to19.9\n \n \n \n \n \n \n \n \n \n 5E20to24.9\n \n \n \n \n \n \n \n \n \n 5E25to34.9\n \n \n \n \n \n \n \n \n \n 5E35plus\n \n \n \n \n \n \n \n \n \n 5E4to5.9\n \n \n \n \n \n \n \n \n \n 5E6to9.9\n \n \n \n \n \n \n \n \n \n 5F0to3.9\n \n \n \n \n \n \n \n \n \n 5F10to13.9\n \n \n \n \n \n \n \n \n \n 5F14to19.9\n \n \n \n \n \n \n 5F20to24.9\n \n \n \n \n \n \n \n \n \n 5F25to34.9\n \n \n \n \n \n \n \n \n \n 5F35plus\n \n \n \n \n \n \n \n \n \n 5F4to5.9\n \n \n \n \n \n \n \n \n \n 5F6to9.9\n \n \n \n \n \n \n \n \n \n 5G0to3.9\n \n \n \n \n \n \n \n \n \n 5G10to13.9\n \n \n \n \n \n \n \n \n \n 5G14to19.9\n \n \n \n \n \n \n \n \n \n 5G20to24.9\n \n \n \n \n \n \n \n \n \n 5G25to34.9\n \n \n \n \n \n \n \n \n \n 5G35plus\n \n \n \n \n \n \n \n \n \n 5G4to5.9\n \n \n \n \n \n \n \n \n \n 5G6to9.9\n \n \n \n \n \n \n \n \n \n 5H0to3.9\n \n \n \n \n \n \n \n \n \n 5H10to13.9\n \n \n \n \n \n \n \n \n \n 5H14to19.9\n \n \n \n \n \n \n \n \n \n 5H20to24.9\n \n \n \n \n \n \n \n \n \n 5H25to34.9\n \n \n \n \n \n \n \n \n \n 5H35plus\n \n \n \n \n \n \n \n \n \n 5H4to5.9\n \n \n \n \n \n \n \n \n \n 5H6to9.9\n \n \n \n \n \n \n \n \n \n','2022-07-06 07:16:44',4,'2022-07-06 10:11:25',4,0,NULL,NULL,NULL,'437a2414-1894-4eb5-8c13-356a8e2aa747'),(1812,'Children ARV Regimen_3rdLine_2022','Children ARV Regimen_3rdLine','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_3rdLine_2022\n Children ARV Regimen_3rdLine\n \n 2022-07-06 10:16:11 UTC\n \n 2022-07-06 10:16:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1812\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','2022-07-06 10:16:11',4,'2022-07-06 10:16:23',4,0,NULL,NULL,NULL,'b6b0cf68-1305-49a2-8f43-30f3f175958d'); INSERT INTO `serialized_object` VALUES (1813,'Children ARV Regimen_3rdLine_2022 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Children ARV Regimen_3rdLine_2022 Data Set\n \n 2022-07-06 10:16:23 UTC\n \n 2022-07-06 14:44: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 1813\n \n \n DM_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n 6A0to3.9\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\n Children 0to14\n \n \n \n \n \n 6A10to13.9\n \n \n \n \n \n \n \n \n \n 6A14to19.9\n \n \n \n \n \n \n \n \n \n 6A20to24.9\n \n \n \n \n \n \n \n \n \n 6A25to34.9\n \n \n \n \n \n \n \n \n \n 6A35plus\n \n \n \n \n \n \n \n \n \n 6A4to5.9\n \n \n \n \n \n \n \n \n \n 6A6to9.9\n \n \n \n \n \n \n \n \n \n 6B0to3.9\n \n \n \n \n \n \n \n \n \n 6B10to13.9\n \n \n \n \n \n \n \n \n \n 6B14to19.9\n \n \n \n \n \n \n \n \n \n 6B20to24.9\n \n \n \n \n \n \n \n \n \n 6B25to34.9\n \n \n \n \n \n \n \n \n \n 6B35plus\n \n \n \n \n \n \n \n \n \n 6B4to5.9\n \n \n \n \n \n \n \n \n \n 6B6to9.9\n \n \n \n \n \n \n \n \n \n 6C0to3.9\n \n \n \n \n \n \n \n \n \n 6C10to13.9\n \n \n \n \n \n \n \n \n \n 6C14to19.9\n \n \n \n \n \n \n \n \n \n 6C20to24.9\n \n \n \n \n \n \n \n \n \n 6C25to34.9\n \n \n \n \n \n \n \n \n \n 6C35plus\n \n \n \n \n \n \n \n \n \n 6C4to5.9\n \n \n \n \n \n \n \n \n \n 6C6to9.9\n \n \n \n \n \n \n \n \n \n 6D0to3.9\n \n \n \n \n \n \n \n \n \n 6D10to13.9\n \n \n \n \n \n \n \n \n \n 6D14to19.9\n \n \n \n \n \n \n \n \n \n 6D20to24.9\n \n \n \n \n \n \n \n \n \n 6D25to34.9\n \n \n \n \n \n \n \n \n \n 6D35plus\n \n \n \n \n \n \n \n \n \n 6D4to5.9\n \n \n \n \n \n \n \n \n \n 6D6to9.9\n \n \n \n \n \n \n \n \n \n 6E0to3.9\n \n \n \n \n \n \n \n \n \n 6E10to13.9\n \n \n \n \n \n \n \n \n \n 6E14to19.9\n \n \n \n \n \n \n \n \n \n 6E20to24.9\n \n \n \n \n \n \n \n \n \n 6E25to34.9\n \n \n \n \n \n \n \n \n \n 6E35plus\n \n \n \n \n \n \n \n \n \n 6E4to5.9\n \n \n \n \n \n \n \n \n \n 6E6to9.9\n \n \n \n \n \n \n \n \n \n 6F0to3.9\n \n \n \n \n \n \n \n \n \n 6F10to13.9\n \n \n \n \n \n \n \n \n \n 6F14to19.9\n \n \n \n \n \n \n \n \n \n 6F20to24.9\n \n \n \n \n \n \n \n \n \n 6F25to34.9\n \n \n \n \n \n \n \n \n \n 6F35plus\n \n \n \n \n \n \n \n \n \n 6F4to5.9\n \n \n \n \n \n \n \n \n \n 6F6to9.9\n \n \n \n \n \n \n \n \n \n','2022-07-06 10:16:23',4,'2022-07-06 14:44:30',4,0,NULL,NULL,NULL,'3fa2b422-d556-4710-bfd7-bc8a5b0c9c0b'),(1814,'TX_ML-06 Clients who are current on ART at reporting period and experienced IIT_3-5 months','TX_ML-06 Clients who are current on ART at reporting period and experienced IIT_3-5 months','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TX_ML-06 Clients who are current on ART at reporting period and experienced IIT_3-5 months\n TX_ML-06 Clients who are current on ART at reporting period and experienced IIT_3-5 months\n \n 2022-08-10 11:03:51 UTC\n \n 2022-08-10 11:08: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 1814\n select obs_ml_clients.person_id \nfrom obs os \ninner join location l on os.location_id = l.location_id \ninner join \n( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND patient.voided = 0 AND o.voided = 0 \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having datediff(CAST(DATE_ADD(CAST(:startDate AS DATE), INTERVAL -1 DAY) AS DATE), latest_follow_up) < 29) as On_ART_Beginning_Quarter \n ) \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as DATE) \n group by p.person_id \n having datediff(CAST(:endDate AS DATE), latest_follow_up) > 28) as Missed_Greater_Than_28Days \n ) \n INNER JOIN patient_identifier ON patient_identifier.patient_id = patient.patient_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n group by patient.patient_id \n UNION \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n AND patient.voided = 0 AND o.voided = 0 \n AND o.concept_id = 2249 and cast(o.value_datetime as date) >= cast(:startDate as DATE) and cast(o.value_datetime as date) <= cast(:endDate as DATE) \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime <= cast(:endDate as DATE) \n group by p.person_id \n having datediff(CAST(:endDate AS DATE), latest_follow_up) > 28) as Missed_Greater_Than_28Days \n ) \n INNER JOIN patient_identifier ON patient_identifier.patient_id = patient.patient_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n group by patient.patient_id \n) as obs_ml_clients on os.person_id = obs_ml_clients.person_id \nINNER JOIN person ON person.person_id = obs_ml_clients.person_id AND person.voided = 0 \nINNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \nWHERE os.location_id =:location or parent_location =:location \n -- INITIATED ON ART BETWEEN 3 AND 5 MONTHS AGO \n AND obs_ml_clients.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 2249 \n AND datediff(CAST(:endDate AS DATE), os.value_datetime) BETWEEN 89 AND 180 \n ) \n -- NOT Transfered Out to Another Site \n AND obs_ml_clients.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 \n AND os.obs_datetime <= CAST(:endDate AS DATE) \n ) \n -- NOT DEAD \n AND obs_ml_clients.person_id not in ( \n select person_id \n from person \n where death_date <= CAST(:endDate AS DATE) \n and dead = 1 \n )\n','2022-08-10 11:03:51',4,'2022-08-10 11:08:17',4,0,NULL,NULL,NULL,'e2a2e29e-040a-45b1-902d-fa25074d52a1'),(1815,'CI63:TxML IIT3-5','TxML IIT3-5','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI63:TxML IIT3-5\n TxML IIT3-5\n \n 2022-08-10 11:07:17 UTC\n \n 2022-08-10 11:08: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 1815\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','2022-08-10 11:07:17',4,'2022-08-10 11:08:59',4,0,NULL,NULL,NULL,'781f34cd-9cce-41ef-acbe-b89b0e1257e4'),(1816,'TX_RTT-02 Clients with IIT for < 3 months in previous period who restarted ARV\'s during current period','TX_RTT-02 Clients with IIT for < 3 months in previous period who restarted ARV\'s during current period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TX_RTT-02 Clients with IIT for < 3 months in previous period who restarted ARV's during current period\n TX_RTT-02 Clients with IIT for < 3 months in previous period who restarted ARV's during current period\n \n 2022-08-23 16:34:31 UTC\n \n 2022-08-23 16:37: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 1816\n select distinct o.person_id \nfrom obs o \n-- PATIENTS WITH NO CLINICAL CONTACT OR ARV PICK-UP FOR GREATER THAN 28 DAYS \n-- SINCE THEIR LAST EXPECTED CONTACT WHO RESTARTED ARVs WITHIN THE REPORTING PERIOD \ninner join location l on o.location_id = l.location_id \nINNER JOIN patient ON o.person_id = patient.patient_id \nAND patient.voided = 0 AND o.voided = 0 \nAND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having datediff(CAST(DATE_ADD(CAST(:startDate AS DATE), INTERVAL -1 DAY) AS DATE), latest_follow_up) BETWEEN 29 and 90) as Missed_Greater_Than_28Days \n ) \n \n -- Client Seen: As either patient OR Treatment Buddy \n AND ( \n o.person_id in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 3843 AND os.value_coded = 3841 OR os.value_coded = 3842) \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n \n -- Client Seen and Date Restarted picked \n OR o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3708 AND os.value_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n ) \n -- Still on treatment at the end of the reporting period \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime >= cast(:startDate as DATE) and oss.obs_datetime <= cast(:endDate as DATE) \n group by p.person_id \n having datediff(CAST(:endDate AS DATE), latest_follow_up) <= 28) as Still_On_Treatment_End_Period \n ) \n \n -- Transfered Out to Another Site during their latest encounter before the start date \n AND o.person_id not in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) AS last_obs_tout \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 4155 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having last_obs_tout = 2146) as Transfered_Out_In_Last_Encounter \n ) \n \n-- NOT Transfered In from another Site \n AND o.person_id not in ( \n select os.person_id \n from obs os \n where (os.concept_id = 2253 AND DATE(os.value_datetime) BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE)) \n AND os.voided = 0 \n ) \n \n AND o.person_id not in ( \n select person_id \n from person \n where death_date <= CAST(:endDate AS DATE) \n and dead = 1 \n ) \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \nWHERE (o.location_id =:location or parent_location =:location)\n','2022-08-23 16:34:31',4,'2022-08-23 16:37:18',4,0,NULL,NULL,NULL,'505841df-fa38-436c-8463-8a437f536b69'),(1817,'TX_RTT-03 Clients with IIT for 3-5 months in previous period who restarted ARV\'s during current period','TX_RTT-03 Clients with IIT for 3-5 months in previous period who restarted ARV\'s during current period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TX_RTT-03 Clients with IIT for 3-5 months in previous period who restarted ARV's during current period\n TX_RTT-03 Clients with IIT for 3-5 months in previous period who restarted ARV's during current period\n \n 2022-08-23 16:42:57 UTC\n \n 2022-08-23 16:50: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 1817\n select distinct o.person_id \nfrom obs o \n-- PATIENTS WITH NO CLINICAL CONTACT OR ARV PICK-UP FOR GREATER THAN 28 DAYS \n-- SINCE THEIR LAST EXPECTED CONTACT WHO RESTARTED ARVs WITHIN THE REPORTING PERIOD \ninner join location l on o.location_id = l.location_id \nINNER JOIN patient ON o.person_id = patient.patient_id \nAND patient.voided = 0 AND o.voided = 0 \nAND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having datediff(CAST(DATE_ADD(CAST(:startDate AS DATE), INTERVAL -1 DAY) AS DATE), latest_follow_up) BETWEEN 89 and 180) as Missed_Between_89_and_180Days \n ) \n \n -- Client Seen: As either patient OR Treatment Buddy \n AND ( \n o.person_id in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 3843 AND os.value_coded = 3841 OR os.value_coded = 3842) \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n \n -- Client Seen and Date Restarted picked \n OR o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3708 AND os.value_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n ) \n -- Still on treatment at the end of the reporting period \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime >= cast(:startDate as DATE) and oss.obs_datetime <= cast(:endDate as DATE) \n group by p.person_id \n having datediff(CAST(:endDate AS DATE), latest_follow_up) <= 28) as Still_On_Treatment_End_Period \n ) \n \n -- Transfered Out to Another Site during their latest encounter before the start date \n AND o.person_id not in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) AS last_obs_tout \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 4155 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having last_obs_tout = 2146) as Transfered_Out_In_Last_Encounter \n ) \n \n-- NOT Transfered In from another Site \n AND o.person_id not in ( \n select os.person_id \n from obs os \n where (os.concept_id = 2253 AND DATE(os.value_datetime) BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE)) \n AND os.voided = 0 \n ) \n \n AND o.person_id not in ( \n select person_id \n from person \n where death_date <= CAST(:endDate AS DATE) \n and dead = 1 \n ) \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \nWHERE (o.location_id =:location or parent_location =:location)\n','2022-08-23 16:42:57',4,'2022-08-23 16:50:04',4,0,NULL,NULL,NULL,'129f5049-8d6d-4cd9-8922-7cf72b623ab3'),(1818,' TX_RTT-04 Clients with IIT for >6 months in previous period who restarted ARV\'s during current period',' TX_RTT-04 Clients with IIT for >6 months in previous period who restarted ARV\'s during current period','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TX_RTT-04 Clients with IIT for >6 months in previous period who restarted ARV's during current period\n TX_RTT-04 Clients with IIT for >6 months in previous period who restarted ARV's during current period\n \n 2022-08-23 16:45:46 UTC\n \n 2022-08-23 16:48: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 1818\n select distinct o.person_id \nfrom obs o \n-- PATIENTS WITH NO CLINICAL CONTACT OR ARV PICK-UP FOR GREATER THAN 28 DAYS \n-- SINCE THEIR LAST EXPECTED CONTACT WHO RESTARTED ARVs WITHIN THE REPORTING PERIOD \ninner join location l on o.location_id = l.location_id \nINNER JOIN patient ON o.person_id = patient.patient_id \nAND patient.voided = 0 AND o.voided = 0 \nAND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having datediff(CAST(DATE_ADD(CAST(:startDate AS DATE), INTERVAL -1 DAY) AS DATE), latest_follow_up) >=180) as Missed_Greater_Than_180Days \n ) \n \n -- Client Seen: As either patient OR Treatment Buddy \n AND ( \n o.person_id in ( \n select distinct os.person_id \n from obs os \n where (os.concept_id = 3843 AND os.value_coded = 3841 OR os.value_coded = 3842) \n AND os.obs_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n \n -- Client Seen and Date Restarted picked \n OR o.person_id in ( \n select distinct os.person_id \n from obs os \n where os.concept_id = 3708 AND os.value_datetime BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE) \n ) \n ) \n -- Still on treatment at the end of the reporting period \n AND o.person_id in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_datetime)), 20) AS latest_follow_up \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 3752 and oss.voided=0 \n and oss.obs_datetime >= cast(:startDate as DATE) and oss.obs_datetime <= cast(:endDate as DATE) \n group by p.person_id \n having datediff(CAST(:endDate AS DATE), latest_follow_up) <= 28) as Still_On_Treatment_End_Period \n ) \n \n -- Transfered Out to Another Site during their latest encounter before the start date \n AND o.person_id not in ( \n select person_id \n from \n (select oss.person_id, MAX(oss.obs_datetime) as max_observation, SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) AS last_obs_tout \n from obs oss \n inner join person p on oss.person_id=p.person_id and oss.concept_id = 4155 and oss.voided=0 \n and oss.obs_datetime < cast(:startDate as DATE) \n group by p.person_id \n having last_obs_tout = 2146) as Transfered_Out_In_Last_Encounter \n ) \n \n-- NOT Transfered In from another Site \n AND o.person_id not in ( \n select os.person_id \n from obs os \n where (os.concept_id = 2253 AND DATE(os.value_datetime) BETWEEN CAST(:startDate AS DATE) AND CAST(:endDate AS DATE)) \n AND os.voided = 0 \n ) \n \n AND o.person_id not in ( \n select person_id \n from person \n where death_date <= CAST(:endDate AS DATE) \n and dead = 1 \n ) \n \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 AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \nWHERE (o.location_id =:location or parent_location =:location)\n','2022-08-23 16:45:46',4,'2022-08-23 16:48:48',4,0,NULL,NULL,NULL,'afc2a5d5-53e4-427a-9491-b3b1609bbe69'),(1819,'CI64:TxRTT IIT<3months','CI64:TxRTT IIT<3months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI64:TxRTT IIT<3months\n CI64:TxRTT IIT<3months\n \n 2022-08-24 07:46:14 UTC\n \n 2022-08-24 07:47: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 1819\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','2022-08-24 07:46:14',4,'2022-08-24 07:47:14',4,0,NULL,NULL,NULL,'6c4e2daf-e83f-4899-98f5-203f33ee4827'),(1820,'CI65:TxRTT IIT_3-5months','CI65:TxRTT IIT_3-5months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI65:TxRTT IIT_3-5months\n CI65:TxRTT IIT_3-5months\n \n 2022-08-24 07:47:56 UTC\n \n 2022-08-24 07:48: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 1820\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','2022-08-24 07:47:56',4,'2022-08-24 07:48:48',4,0,NULL,NULL,NULL,'714af509-9ade-48b5-b6f0-10d7499a6f15'),(1821,'CI66:TxRTT IIT_6+months','CI66:TxRTT IIT_6+months','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n CI66:TxRTT IIT_6+months\n CI66:TxRTT IIT_6+months\n \n 2022-08-24 07:49:18 UTC\n \n 2022-08-24 07:49: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 1821\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','2022-08-24 07:49:18',4,'2022-08-24 07:49:56',4,0,NULL,NULL,NULL,'271261f4-75c6-4c64-a6f0-7be2d40c33c3'),(1822,'Pulmonary Bacteriologically Confirmed New','New Pulmonary Bacteriologically Confirmed clients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed New\n New Pulmonary Bacteriologically Confirmed clients\n \n 2023-03-27 10:50:04 UTC\n \n 2023-06-06 11:48: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 1822\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1034 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-27 10:50:04',4,'2023-06-06 11:48:58',4,0,NULL,NULL,NULL,'5ab3fc4d-0d1e-4a30-b0c7-d35c68f7f19a'),(1823,'NewRelapse_Tb_Treatment_History','Tb Treatment History - New and Relapse Patients','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NewRelapse_Tb_Treatment_History\n Tb Treatment History - New and Relapse Patients\n \n 2023-03-27 11:51:48 UTC\n \n 2023-06-07 09: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 1823\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New and Relapse Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (1034, 1084) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 11:51:48',4,'2023-06-07 09:50:57',4,0,NULL,NULL,NULL,'7f8a23bd-eec0-40a6-8181-cda3d0aab0bd'),(1824,'Pulmonary Bacteriologically Confirmed Relapse','Pulmonary Bacteriologically Confirmed Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed Relapse\n Pulmonary Bacteriologically Confirmed Relapse\n \n 2023-03-27 12:10:01 UTC\n \n 2023-06-06 11:56: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 1824\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Relapse Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1084 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-27 12:10:01',4,'2023-06-06 11:56:00',4,0,NULL,NULL,NULL,'e495a330-c538-4fa2-9279-e0c03ec69b51'),(1825,'Pulmonary Bacteriologically Confirmed Excluding Relapse','Pulmonary Bacteriologically Confirmed Excluding Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed Excluding Relapse\n Pulmonary Bacteriologically Confirmed Excluding Relapse\n \n 2023-03-27 17:01:52 UTC\n \n 2023-06-06 13:43: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 1825\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Retreatment clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786,1037) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-27 17:01:52',4,'2023-06-06 13:43:48',4,0,NULL,NULL,NULL,'23ba6606-91b7-4f7c-9142-73d6a43769a3'),(1826,'Documented HIV Status - New and Relapse','New and Relapse patients with documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - New and Relapse\n New and Relapse patients with documented HIV Status\n \n 2023-03-27 19:38:11 UTC\n \n 2023-06-08 09:06: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 1826\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- New and Relapse Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (1034, 1084) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 19:38:11',4,'2023-06-08 09:06:45',4,0,NULL,NULL,NULL,'ee4e2170-5dd7-423e-bc84-f0c13c3a9b4f'),(1827,'Documented HIV status - Retreatment','Retreatment Excl. Relapse client with documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV status - Retreatment\n Retreatment Excl. Relapse client with documented HIV Status\n \n 2023-03-27 19:50:19 UTC\n \n 2023-06-08 09:10: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 1827\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- Retreatment Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786, 1037) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 19:50:19',4,'2023-06-08 09:10:14',4,0,NULL,NULL,NULL,'17edcc8f-3d38-49dd-a6f4-a5384cdb7245'),(1828,'Documented HIV Status - Children < 15','Children (0 - 14) with documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Children < 15\n Children (0 - 14) with documented HIV Status\n \n 2023-03-27 20:10:47 UTC\n \n 2023-06-08 09:47: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 1828\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- Children < 15 \n select person_id \n from \n (select distinct person.person_id, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age \n from obs o \n INNER JOIN person ON o.person_id = person.person_id \n AND o.concept_id = 4666 \n AND o.voided = 0 \n AND o.obs_datetime >= CAST(:startDate AS DATE) \n AND o.obs_datetime <= CAST(:endDate AS DATE) \n having Age < 15)Children_Ages \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 20:10:47',4,'2023-06-08 09:47:07',4,0,NULL,NULL,NULL,'ca5b1d37-8229-474d-8125-2486520685fd'),(1829,'Pulmonary Clinically Diagnosed New','Pulmonary Clinically Diagnosed New','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed New\n Pulmonary Clinically Diagnosed New\n \n 2023-03-27 20:39:34 UTC\n \n 2023-06-06 13:58: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 1829\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1034 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Clinically Diagnosed,XRay \n where o.concept_id = 4673 and o.value_coded = 4171 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-27 20:39:34',4,'2023-06-06 13:58:49',4,0,NULL,NULL,NULL,'34bcf70d-0178-4dcc-ab38-9046e4bcedd1'),(1830,'Documented HIV Status - Miners','High risk population of miners with documented HIV','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Miners\n High risk population of miners with documented HIV\n \n 2023-03-27 20:45:17 UTC\n \n 2023-06-08 08:37: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 1830\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 \n and ob.voided = 0 \n and ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3667 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 20:45:17',4,'2023-06-08 08:37:43',4,0,NULL,NULL,NULL,'001d7c51-fa6b-45d5-9690-cc6dce14a608'),(1831,'Documented HIV Status - Ex-Miners','High risk population of Ex Miners with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Ex-Miners\n High risk population of Ex Miners with Documented HIV Status\n \n 2023-03-27 20:47:57 UTC\n \n 2023-06-08 09:53: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 1831\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Ex-Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3668 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 20:47:57',4,'2023-06-08 09:53:53',4,0,NULL,NULL,NULL,'10248e4b-2f29-447e-814a-6d5b10398656'),(1832,'Documented HIV Status - Factory Workers','High risk population of Factory Workers with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Factory Workers\n High risk population of Factory Workers with Documented HIV Status\n \n 2023-03-27 20:54:48 UTC\n \n 2023-06-08 09:59: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 1832\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Factory Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3669 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 20:54:48',4,'2023-06-08 09:59:09',4,0,NULL,NULL,NULL,'bb934645-58c2-4c19-bbd7-0ebf35fa3f7a'),(1833,'Documented HIV Status - Public transport operators','High risk population of Public transport operators with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Public transport operators\n High risk population of Public transport operators with Documented HIV Status\n \n 2023-03-27 20:58:19 UTC\n \n 2023-06-08 10:02: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 1833\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Public Transport Operators \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 4654 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 20:58:19',4,'2023-06-08 10:02:05',4,0,NULL,NULL,NULL,'0c91b258-01ae-4928-be76-91201cadad93'),(1834,'Documented HIV Status - Health workers','High risk population of Health workers with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Health workers\n High risk population of Health workers with Documented HIV Status\n \n 2023-03-27 21:04:15 UTC\n \n 2023-06-08 10:02: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 1834\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Health Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3670 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 21:04:15',4,'2023-06-08 10:02:50',4,0,NULL,NULL,NULL,'7736630e-9da2-4ec0-b131-fe9e2ef01e00'),(1835,'Documented HIV Status - Correctional Staff and inmates','High risk population of Correctional Staff and inmates with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with Documented HIV Status\n \n 2023-03-27 21:06:32 UTC\n \n 2023-06-08 10:03: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 1835\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Correctional Staff and Inmates \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded in (3671,3779) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 21:06:32',4,'2023-06-08 10:03:58',4,0,NULL,NULL,NULL,'58ac8a09-0a12-4ab0-acb4-1fe8d1d81b77'),(1836,'RetreatmentExRelapse_Tb_Treatment_History','Retreatment Exclusive Relapse Tb Treatment History','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n RetreatmentExRelapse_Tb_Treatment_History\n Retreatment Exclusive Relapse Tb Treatment History\n \n 2023-03-27 21:07:51 UTC\n \n 2023-06-07 09: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 1836\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Retreatment Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786, 1037) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-27 21:07:51',4,'2023-06-07 09:53:54',4,0,NULL,NULL,NULL,'7263505b-34d2-4167-9d3f-4cdae66218f8'),(1837,'NewRelapse_Tb_Treatment_History','NewRelapse_Tb_Treatment_History','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n NewRelapse_Tb_Treatment_History\n NewRelapse_Tb_Treatment_History\n \n 2023-03-27 21:17:20 UTC\n \n 2023-03-27 21:20: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 1837\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','2023-03-28 02:47:20',4,'2023-03-28 02:50:31',4,0,NULL,NULL,NULL,'20879b46-ecbd-4ff9-818a-3c761bcf5ebd'),(1838,'Positive HIV Status - New and Relapse','New and Relapse with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - New and Relapse\n New and Relapse with Positive HIV Status\n \n 2023-03-27 21:20:17 UTC\n \n 2023-06-13 09:50: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 1838\n \nselect 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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- New and Relapse Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (1034, 1084) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n\n','2023-03-27 21:20:17',4,'2023-06-13 09:50:43',4,0,NULL,NULL,NULL,'02c505a1-b724-422b-8c31-69440e233a0d'),(1839,'RetreatmentExRelapse_Tb_Treatment_History','Retreatment Exclusive Relapse - Tb Treatment History','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n RetreatmentExRelapse_Tb_Treatment_History\n Retreatment Exclusive Relapse - Tb Treatment History\n \n 2023-03-27 21:25:15 UTC\n \n 2023-03-27 21:26: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 1839\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','2023-03-28 02:55:15',4,'2023-03-28 02:56:10',4,0,NULL,NULL,NULL,'f901b38b-95e7-4bcc-ace1-ce86030ba88e'),(1840,'TB Notification - Block 2','TB Notification - Block 2','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 2\n TB Notification - Block 2\n \n 2023-03-27 21:45:01 UTC\n \n 2023-03-27 21:45: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 1840\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','2023-03-28 03:15:01',4,'2023-03-28 03:15:21',4,0,NULL,NULL,NULL,'8ab1160e-aca4-4d59-bd02-0269e8a3889a'),(1841,'TB Notification - Block 2 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 2 Data Set\n \n 2023-03-27 21:45:21 UTC\n \n 2023-04-04 21: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 1841\n \n \n DM_Sex\n \n \n \n \n \n \n DM_TB_Age\n \n \n \n \n endDate\n ${endDate}\n \n \n \n \n \n \n \n NwRlpsF1-4\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_TB_Age\n 01-04yrs\n \n \n \n \n \n NwRlpsF5-9\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 05-09yrs\n \n \n \n \n \n NwRlpsM1-4\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 01-04yrs\n \n \n \n \n \n NwRlpsM5-9\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 05-09yrs\n \n \n \n \n \n NwRlpseF<1\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n Under1yr\n \n \n \n \n \n NwRlpseM<1\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n Under1yr\n \n \n \n \n \n NwRsF10-14\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 10-14yrs\n \n \n \n \n \n NwRsF15-19\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 15-19yrs\n \n \n \n \n \n NwRsF20-24\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 20-24yrs\n \n \n \n \n \n NwRsF25-34\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 25-34yrs\n \n \n \n \n \n NwRsF35-44\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 35-44yrs\n \n \n \n \n \n NwRsF45-49\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 45-49yrs\n \n \n \n \n \n NwRsF50-54\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 50-54yrs\n \n \n \n \n \n NwRsF55-64\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 55-64yrs\n \n \n \n \n \n NwRsF65+\n \n \n \n \n DM_Sex\n Females\n \n \n DM_TB_Age\n 65Plus\n \n \n \n \n \n NwRsM10-14\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 10-14yrs\n \n \n \n \n \n NwRsM15-19\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 15-19yrs\n \n \n \n \n \n NwRsM20-24\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 20-24yrs\n \n \n \n \n \n NwRsM25-34\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 25-34yrs\n \n \n \n \n \n NwRsM35-44\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 35-44yrs\n \n \n \n \n \n NwRsM45-49\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 45-49yrs\n \n \n \n \n \n NwRsM50-54\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 50-54yrs\n \n \n \n \n \n NwRsM55-64\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 55-64yrs\n \n \n \n \n \n NwRsM65+\n \n \n \n \n DM_Sex\n Males\n \n \n DM_TB_Age\n 65Plus\n \n \n \n \n \n RetreatF<1\n \n \n \n \n \n \n \n \n \n RetreatM<1\n \n \n \n \n \n \n RetrtF1-4\n \n \n \n \n \n \n RetrtF5-9\n \n \n \n \n \n \n RetrtM1-4\n \n \n \n \n \n \n RetrtM5-9\n \n \n \n \n \n \n RtrtF10-14\n \n \n \n \n \n \n RtrtF15-19\n \n \n \n \n \n \n RtrtF20-24\n \n \n \n \n \n \n RtrtF25-34\n \n \n \n \n \n \n RtrtF35-44\n \n \n \n \n \n \n RtrtF45-49\n \n \n \n \n \n \n RtrtF50-54\n \n \n \n \n \n \n RtrtF55-64\n \n \n \n \n \n \n RtrtF65+\n \n \n \n \n \n \n RtrtM10-14\n \n \n \n \n \n \n RtrtM15-19\n \n \n \n \n \n \n RtrtM20-24\n \n \n \n \n \n \n RtrtM25-34\n \n \n \n \n \n \n RtrtM35-44\n \n \n \n \n \n \n RtrtM45-49\n \n \n \n \n \n \n RtrtM50-54\n \n \n \n \n \n \n RtrtM55-64\n \n \n \n \n \n \n RtrtM65+\n \n \n \n \n \n \n','2023-03-28 03:15:21',4,'2023-04-05 03:19:58',4,0,NULL,NULL,NULL,'68f0aaca-a6a0-4cb5-aebb-e57d5ce5b2cd'),(1844,'Positive HIV status - Retreatment','Retreatment Excl. Relapse with Positive HIV status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV status - Retreatment\n Retreatment Excl. Relapse with Positive HIV status\n \n 2023-03-28 08:28:56 UTC\n \n 2023-06-13 09:55: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 1844\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- Retreatment Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786, 1037) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 08:28:56',4,'2023-06-13 09:55:03',4,0,NULL,NULL,NULL,'d48e3545-1e4d-4d7a-a812-5fb7111cbf72'),(1845,'Pulmonary Clinically Diagnosed Relapse','Pulmonary Clinically Diagnosed Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed Relapse\n Pulmonary Clinically Diagnosed Relapse\n \n 2023-03-28 08:30:26 UTC\n \n 2023-06-06 14:02: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 1845\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1084 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Clinically Diagnosed,XRay \n where o.concept_id = 4673 and o.value_coded = 4171 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 08:30:26',4,'2023-06-06 14:02:41',4,0,NULL,NULL,NULL,'5d45f128-1037-42d6-939d-3ae6929bfd6c'),(1846,'DM_TB_Age','DM_TB_Age','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n DM_TB_Age\n DM_TB_Age\n \n 2023-03-28 08:34:09 UTC\n \n 2023-03-28 09:12:59 UTC\n \n \n endDate\n \n java.util.Date\n true\n \n \n 1846\n \n \n 01-04yrs\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 05-09yrs\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 10-14yrs\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-19yrs\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 20-24yrs\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 25-34yrs\n \n \n \n \n maxAge\n 34\n \n \n minAge\n 25\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 35-44yrs\n \n \n \n \n maxAge\n 44\n \n \n minAge\n 35\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 45-49yrs\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-54yrs\n \n \n \n \n maxAge\n 54\n \n \n minAge\n 50\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 55-64yrs\n \n \n \n \n maxAge\n 64\n \n \n minAge\n 55\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n 65Plus\n \n \n \n \n maxAge\n 120\n \n \n minAge\n 65\n \n \n effectiveDate\n ${endDate}\n \n \n \n \n \n Under1yr\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','2023-03-28 14:04:09',4,'2023-03-28 14:42:59',4,0,NULL,NULL,NULL,'68d03856-4b9b-4d8d-ba8f-bc698222c9f2'),(1847,'Positive HIV Status - Children < 15','High risk population for Children < 15 with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Children < 15\n High risk population for Children < 15 with Positive HIV Status\n \n 2023-03-28 08:43:51 UTC\n \n 2023-06-13 09:48: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 1847\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_Coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- Children < 15 \n select person_id \n from \n (select distinct person.person_id, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age \n from obs o \n INNER JOIN person ON o.person_id = person.person_id \n AND o.concept_id = 4666 \n AND o.voided = 0 \n AND o.obs_datetime >= CAST(:startDate AS DATE) \n AND o.obs_datetime <= CAST(:endDate AS DATE) \n having Age < 15)Children_Ages \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n\n','2023-03-28 08:43:51',4,'2023-06-13 09:48:54',4,0,NULL,NULL,NULL,'63b6abab-6261-4d20-9601-74454ea10cd6'),(1848,'Positive HIV Status - Miners','High risk population of miners with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Miners\n High risk population of miners with Positive HIV Status\n \n 2023-03-28 08:58:19 UTC\n \n 2023-06-13 09: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 1848\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3667 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n )\n','2023-03-28 08:58:19',4,'2023-06-13 09:40:18',4,0,NULL,NULL,NULL,'d4d85343-09fc-473b-a650-50f444deee3e'),(1849,'Positive HIV Status - Ex-Miners',' High risk population of Ex Miners with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Ex-Miners\n High risk population of Ex Miners with Positive HIV Status\n \n 2023-03-28 09:10:47 UTC\n \n 2023-06-13 09:29: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 1849\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- X-Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3668 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n\n','2023-03-28 09:10:47',4,'2023-06-13 09:29:50',4,0,NULL,NULL,NULL,'33fa2a02-6cb8-4850-8d80-18d86f0516a8'),(1850,'Pulmonary Clinically Diagnosed Excluding Relapse','Pulmonary Clinically Diagnosed Excluding Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed Excluding Relapse\n Pulmonary Clinically Diagnosed Excluding Relapse\n \n 2023-03-28 09:16:40 UTC\n \n 2023-06-06 13:55: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 1850\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Retreatment clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786,1037) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Clinically Diagnosed,XRay \n where o.concept_id = 4673 and o.value_coded = 4171 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n and o.person_id in ( \n select ob.person_id \n FROM obs ob \n -- Pulmonary TB \n where ob.concept_id = 3788 and ob.value_coded = 1018 \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n ) \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 09:16:40',4,'2023-06-06 13:55:55',4,0,NULL,NULL,NULL,'8a1f3d92-c5ec-4892-920b-5bae45020424'),(1851,'Positive HIV Status - Factory Workers','High risk population of Factory Workers with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Factory Workers\n High risk population of Factory Workers with Positive HIV Status\n \n 2023-03-28 09:22:07 UTC\n \n 2023-06-13 09: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 1851\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Factory Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3669 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n \n\n','2023-03-28 09:22:07',4,'2023-06-13 09:56:31',4,0,NULL,NULL,NULL,'e7f0599c-bb8c-4d2d-94a7-4b99e0f1f7af'),(1852,'Positive HIV Status - Public transport','High risk population of Public transport operators with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Public transport\n High risk population of Public transport operators with Positive HIV Status\n \n 2023-03-28 09:26:12 UTC\n \n 2023-06-13 09:43: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 1852\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Public Transport Operators \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 4654 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n \n\n','2023-03-28 09:26:12',4,'2023-06-13 09:43:25',4,0,NULL,NULL,NULL,'17f9486c-aefe-4a21-b3ad-d5c685280640'),(1853,'Positive HIV Status - Health workers',' High risk population of Health workers with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Health workers\n High risk population of Health workers with Positive HIV Status\n \n 2023-03-28 09:31:54 UTC\n \n 2023-06-13 09:34: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 1853\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Health Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3670 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n \n\n','2023-03-28 09:31:54',4,'2023-06-13 09:34:33',4,0,NULL,NULL,NULL,'e071852e-15c9-4eb6-92a9-c1c8157db41d'),(1854,'Positive HIV Status - Correctional Staff and inmates','High risk population of Correctional Staff and inmates with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with Positive HIV Status\n \n 2023-03-28 09:35:03 UTC\n \n 2023-06-13 09:28: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 1854\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Correctional staff and inmates \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded in (3779,3671) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n )\n','2023-03-28 09:35:03',4,'2023-06-13 09:28:36',4,0,NULL,NULL,NULL,'d6df7665-4e94-4ae6-886e-c1fb05a4a0b1'),(1855,'Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New','Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New\n \n 2023-03-28 10:05:40 UTC\n \n 2023-06-06 14:10: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 1855\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1034 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Extra Pulmonary \n where o.concept_id = 3788 and o.value_coded = 2233 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 10:05:40',4,'2023-06-06 14:10:35',4,0,NULL,NULL,NULL,'155d4939-e304-4aa0-a2d4-efc18644affa'),(1856,'Documented HIV Status - HHCM','High risk population of HHCM with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - HHCM\n High risk population of HHCM with Documented HIV Status\n \n 2023-03-28 10:39:40 UTC\n \n 2023-06-08 09:57: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 1856\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Household Member of Current Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3777 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 10:39:40',4,'2023-06-08 09:57:18',4,0,NULL,NULL,NULL,'6584ebef-9d17-4b53-80ba-7396b170919f'),(1857,'Documented HIV Status - HHXM','High risk population of HHXM with Documented HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - HHXM\n High risk population of HHXM with Documented HIV Status\n \n 2023-03-28 10:46:20 UTC\n \n 2023-06-08 09:57: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 1857\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 -- HIV Status \n and ob.voided = 0 \n and ob.person_id in ( \n -- Household Member of Ex-Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3778 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 10:46:20',4,'2023-06-08 09:57:50',4,0,NULL,NULL,NULL,'f06272eb-e3f7-4d7e-82d1-1e3a391a8b9e'),(1858,'Positive HIV Status - HHCM','High risk population of HHCM with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - HHCM\n High risk population of HHCM with Positive HIV Status\n \n 2023-03-28 10:54:07 UTC\n \n 2023-06-13 09:37: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 1858\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Household Member of Current Miner (HHCM) \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3777 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n \n\n','2023-03-28 10:54:07',4,'2023-06-13 09:37:21',4,0,NULL,NULL,NULL,'2b06bd4f-a633-48d8-9a9a-12ae5f84001b'),(1859,'Positive HIV Status - HHXM','High risk population of HHXM with Positive HIV Status','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - HHXM\n High risk population of HHXM with Positive HIV Status\n \n 2023-03-28 11:03:32 UTC\n \n 2023-06-13 09:41: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 1859\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and ob.person_id in ( \n -- Household Member of Ex Miner (HHXM) \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3778 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n \n \n\n','2023-03-28 11:03:32',4,'2023-06-13 09:41:45',4,0,NULL,NULL,NULL,'46bd9d48-49d2-4fd5-b433-f1123f217588'),(1860,'Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse','Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse\n \n 2023-03-28 11:42:29 UTC\n \n 2023-06-06 14:11: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 1860\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Relapse clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1084 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Extra Pulmonary \n where o.concept_id = 3788 and o.value_coded = 2233 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 11:42:29',4,'2023-06-06 14:11:57',4,0,NULL,NULL,NULL,'b2905cf9-63d5-4b7b-9a72-0f76caf70da3'),(1861,'HIV Positive on CPT/Dapzone - HHXM','High risk population of HHXM with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - HHXM\n High risk population of HHXM with HIV Positive on CPT/Dapzone\n \n 2023-03-28 13:51:41 UTC\n \n 2023-06-14 09:16: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 1861\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Household Members of Ex-Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3778 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 13:51:41',4,'2023-06-14 09:16:20',4,0,NULL,NULL,NULL,'0133ee85-0abd-494a-86b7-6818670bd37b'),(1862,'Extra-pulmonary (bacteriologically confirmed or clinically diagnosed) - Exlude relapse','Extra-pulmonary (bacteriologically confirmed or clinically diagnosed) - Exclude relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra-pulmonary (bacteriologically confirmed or clinically diagnosed) - Exlude relapse\n Extra-pulmonary (bacteriologically confirmed or clinically diagnosed) - Exclude relapse\n \n 2023-03-28 14:29:38 UTC\n \n 2023-06-06 14:13: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 1862\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Relapse clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786,1037) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Extra Pulmonary \n where o.concept_id = 3788 and o.value_coded = 2233 \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 14:29:38',4,'2023-06-06 14:13:07',4,0,NULL,NULL,NULL,'5023a0c3-15b8-4d16-ac54-09a77d01648d'),(1863,'HIV Positive on CPT/Dapzone - HHCM','High risk population of HHCM with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - HHCM\n High risk population of HHCM with HIV Positive on CPT/Dapzone\n \n 2023-03-28 15:05:16 UTC\n \n 2023-06-13 12:38: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 1863\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Household Members of Current Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3777 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 15:05:16',4,'2023-06-13 12:38:54',4,0,NULL,NULL,NULL,'6365d73a-6fde-4e27-a75b-b5010023ddea'),(1864,'HIV Positive on CPT/Dapzone - New and Relapse','High risk population of New and Relapse with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - New and Relapse\n High risk population of New and Relapse with HIV Positive on CPT/Dapzone\n \n 2023-03-28 15:14:37 UTC\n \n 2023-06-13 10:12: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 1864\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n -- HIV Positive \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- New and Relapse Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (1034, 1084) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 15:14:37',4,'2023-06-13 10:12:33',4,0,NULL,NULL,NULL,'14343630-0c58-4f34-8bb5-1744e1618c31'),(1865,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New\n \n 2023-03-28 15:16:26 UTC\n \n 2023-06-06 14:26: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 1865\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- New Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1034 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Not started on treatment \n where o.concept_id = 3789 and o.value_coded in (3791,2302) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n \n\n','2023-03-28 15:16:26',4,'2023-06-06 14:26:13',4,0,NULL,NULL,NULL,'273f38fa-7a41-4323-ac9d-24fd27c0c4cf'),(1866,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse\n \n 2023-03-28 15:21:59 UTC\n \n 2023-06-06 14:28: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 1866\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Relapse Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded = 1084 \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Not started on treatment \n where o.concept_id = 3789 and o.value_coded in (3791,2302) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 15:21:59',4,'2023-06-06 14:28:29',4,0,NULL,NULL,NULL,'300b2de6-1987-4ae2-a742-c2907f6bc2b7'),(1867,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse\n \n 2023-03-28 15:25:40 UTC\n \n 2023-06-06 14:29: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 1867\n select distinct o.person_id \n from obs o \ninner join location l on o.location_id = l.location_id \nWHERE (o.location_id =:location or parent_location =:location) \n AND o.person_id in \n ( \n select distinct o.person_id \n FROM obs o \n -- Bacteriologically confirmed Genotypic test results and Phenotypic test results \n where o.concept_id in (3814, 3815) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Retreatment Clients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786,1037) \n and cast(obs_datetime as date) >= cast(:startDate as date) \n and cast(obs_datetime as date) <= cast(:endDate as date) \n ) \n ) \n \n \n AND o.person_id in ( \n select distinct o.person_id \n FROM obs o \n -- Not started on treatment \n where o.concept_id = 3789 and o.value_coded in (3791,2302) \n and o.obs_datetime >= CAST(:startDate AS DATE) \n and o.obs_datetime <= CAST(:endDate AS DATE) \n and o.voided = 0 \n ) \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 15:25:40',4,'2023-06-06 14:29:49',4,0,NULL,NULL,NULL,'fc1f07c9-e4d5-4d2f-97fb-98b26e6f66d0'),(1868,'HIV Positive on CPT/Dapzone - Retreatment','Retreatment Excl. Relapse with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Retreatment\n Retreatment Excl. Relapse with HIV Positive on CPT/Dapzone\n \n 2023-03-28 15:28:13 UTC\n \n 2023-06-13 10:16: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 1868\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Retreatment Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786, 1037) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 15:28:13',4,'2023-06-13 10:16:55',4,0,NULL,NULL,NULL,'fc64e900-ad46-45b3-9514-3d9aaefbd2cf'),(1869,'HIV Positive on CPT/Dapzone - Children < 15','Children < 15 with Positive HIV on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Children < 15\n Children < 15 with Positive HIV on CPT/Dapzone\n \n 2023-03-28 15:51:27 UTC\n \n 2023-06-13 10:06: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 1869\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_Coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Children < 15 \n select person_id \n from \n (select distinct person.person_id, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age \n from obs o \n INNER JOIN person ON o.person_id = person.person_id \n AND o.concept_id = 4666 \n AND o.voided = 0 \n AND o.obs_datetime >= CAST(:startDate AS DATE) \n AND o.obs_datetime <= CAST(:endDate AS DATE) \n having Age < 15)Children_Ages \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n )\n','2023-03-28 15:51:27',4,'2023-06-13 10:06:32',4,0,NULL,NULL,NULL,'36fe954a-f05e-431b-9037-4772a4b28383'),(1870,'HIV Positive on CPT/Dapzone - Miners','High risk population Miners with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Miners\n High risk population Miners with HIV Positive on CPT/Dapzone\n \n 2023-03-28 15:55:23 UTC\n \n 2023-06-13 12:42: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 1870\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3667 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 15:55:23',4,'2023-06-13 12:42:24',4,0,NULL,NULL,NULL,'354da83b-27c3-4124-9198-d1902fefb417'),(1871,'HIV Positive on CPT/Dapzone - Ex Miner',' High risk population of Ex Miner with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Ex Miner\n High risk population of Ex Miner with HIV Positive on CPT/Dapzone\n \n 2023-03-28 16:02:40 UTC\n \n 2023-06-14 09:14: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 1871\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Ex-Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3668 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 16:02:40',4,'2023-06-14 09:14:00',4,0,NULL,NULL,NULL,'ff703f75-36cc-4487-afab-65df0ccbff68'),(1872,'HIV Positive on CPT/Dapzone - Factory Workers','High risk population of Factory Workers with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Factory Workers\n High risk population of Factory Workers with HIV Positive on CPT/Dapzone\n \n 2023-03-28 16:08:16 UTC\n \n 2023-06-13 12:35: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 1872\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Factory Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3669 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 16:08:16',4,'2023-06-13 12:35:49',4,0,NULL,NULL,NULL,'ff030c28-e12b-45ed-80b0-330e353fdd29'),(1873,'HIV Positive on CPT/Dapzone - Public transport operators','High risk population of Public transport operators with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Public transport operators\n High risk population of Public transport operators with HIV Positive on CPT/Dapzone\n \n 2023-03-28 16:14:01 UTC\n \n 2023-06-13 12: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 1873\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Public Transport Operators \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 4654 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 16:14:01',4,'2023-06-13 12:44:08',4,0,NULL,NULL,NULL,'b116d4a0-174f-49a7-be0f-3d5f79581b05'),(1874,'HIV Positive on CPT/Dapzone - Health workers',' High risk population of Health workers with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Health workers\n High risk population of Health workers with HIV Positive on CPT/Dapzone\n \n 2023-03-28 16:16:21 UTC\n \n 2023-06-13 12:37: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 1874\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Health Workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3670 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 16:16:21',4,'2023-06-13 12:37:05',4,0,NULL,NULL,NULL,'4c4aa324-1728-4001-a94e-e857574126b1'),(1875,'HIV Positive on CPT/Dapzone - Correctional Staff and inmates','High risk population of Correctional Staff and inmates with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with HIV Positive on CPT/Dapzone\n \n 2023-03-28 16:20:31 UTC\n \n 2023-06-13 12:32: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 1875\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On CPT/Dapsone \n select distinct o.person_id \n from obs o \n where o.concept_id = 5415 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Correctional staff and inmates \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded in (3779,3671) \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 16:20:31',4,'2023-06-13 12:32:57',4,0,NULL,NULL,NULL,'423a7240-f359-41a2-929d-7b1cd7010807'),(1876,'TB among Miners','TB among Key Population Group Miners','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Miners\n TB among Key Population Group Miners\n \n 2023-03-28 17:11:27 UTC\n \n 2023-06-07 10:19: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 1876\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3667 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 17:11:27',4,'2023-06-07 10:19:30',4,0,NULL,NULL,NULL,'273e3515-f928-4164-be82-fc5235d66188'),(1877,'TB among Exminers','TB among Key Population Group Exminers','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Exminers\n TB among Key Population Group Exminers\n \n 2023-03-28 17:40:01 UTC\n \n 2023-06-07 10:21: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 1877\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3668 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 17:40:01',4,'2023-06-07 10:21:49',4,0,NULL,NULL,NULL,'ecb47cb2-6af4-4932-8fee-076ba40afa87'),(1878,'TB among HHCM','TB among Key Population Group HHCM','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among HHCM\n TB among Key Population Group HHCM\n \n 2023-03-28 19:19:59 UTC\n \n 2023-06-07 10:22: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 1878\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3777 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:19:59',4,'2023-06-07 10:22:39',4,0,NULL,NULL,NULL,'0da939c1-ae87-45c8-80ed-e56b82e5a62e'),(1879,'HIV Positive on ART - Correctional Staff and inmates','High risk population of Correctional Staff and inmates on HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates on HIV Positive on ART\n \n 2023-03-28 19:25:59 UTC\n \n 2023-06-14 09:47: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 1879\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Correctional staff and inmates \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded in (3779,3671) \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 19:25:59',4,'2023-06-14 09:47:13',4,0,NULL,NULL,NULL,'a6ebd7a8-631b-4e0e-bdfb-8be1b9fb9eec'),(1880,'HIV Positive on ART - New and Relapse','High risk population of New and Relapse with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - New and Relapse\n High risk population of New and Relapse with HIV Positive on ART\n \n 2023-03-28 19:29:52 UTC\n \n 2023-06-14 10: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 1880\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n -- HIV Positive \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- New and Relapse Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (1034, 1084) \n and cast(obs_datetime as date) >= CAST(:startDate AS DATE) \n and cast(obs_datetime as date) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:29:52',4,'2023-06-14 10:05:39',4,0,NULL,NULL,NULL,'8067c849-4c81-475a-a26e-68a2e58b8067'),(1882,'HIV Positive on ART - Retreatment','High risk population of Retreatment Excl. Relapse HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Retreatment\n High risk population of Retreatment Excl. Relapse HIV Positive on ART\n \n 2023-03-28 19:34:51 UTC\n \n 2023-06-14 10:08: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 1882\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Retreatment Patients \n select distinct person_id \n from obs \n where concept_id = 3785 and value_coded in (3786, 1037) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:34:51',4,'2023-06-14 10:08:53',4,0,NULL,NULL,NULL,'fe4f73c9-4b24-4458-9ae1-9d3fcad9f9cb'),(1883,'TB among HHXM','TB among Key Population Group HHXM','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among HHXM\n TB among Key Population Group HHXM\n \n 2023-03-28 19:35:03 UTC\n \n 2023-06-07 10:23: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 1883\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3778 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:35:03',4,'2023-06-07 10:23:12',4,0,NULL,NULL,NULL,'4715bb07-7b64-4001-b5cb-ea555b425a07'),(1884,'TB among Factory Workers','TB among Key Population Group Factory Workers','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Factory Workers\n TB among Key Population Group Factory Workers\n \n 2023-03-28 19:43:14 UTC\n \n 2023-06-07 10:24:15 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 1884\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3669 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:43:14',4,'2023-06-07 10:24:15',4,0,NULL,NULL,NULL,'6bed2c03-ba40-477b-9a9a-67f3fcd50ea3'),(1885,'TB among Correctional Staff & Inmates','TB among Key Population Group Correctional Staff & Inmates','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Correctional Staff & Inmates\n TB among Key Population Group Correctional Staff & Inmates\n \n 2023-03-28 19:47:06 UTC\n \n 2023-06-07 10:25: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 1885\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded in (3671,3779) \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:47:06',4,'2023-06-07 10:25:47',4,0,NULL,NULL,NULL,'9016d0ef-4556-49e7-99bd-2bf2e7f5188f'),(1886,'HIV Positive on ART - Children < 15','High risk population for Children < 15 with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Children < 15\n High risk population for Children < 15 with HIV Positive on ART\n \n 2023-03-28 19:47:46 UTC\n \n 2023-06-14 10:02: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 1886\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_Coded in (4323,4664) -- HIV Positive \n and ob.obs_datetime >= CAST(:startDate AS DATE) \n and ob.obs_datetime <= CAST(:endDate AS DATE) \n and ob.voided = 0 \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Children < 15 \n select person_id \n from \n (select distinct person.person_id, \n floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) AS Age \n from obs o \n INNER JOIN person ON o.person_id = person.person_id \n AND o.concept_id = 4666 \n AND o.voided = 0 \n AND o.obs_datetime >= CAST(:startDate AS DATE) \n AND o.obs_datetime <= CAST(:endDate AS DATE) \n having Age < 15)Children_Ages \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n )\n','2023-03-28 19:47:46',4,'2023-06-14 10:02:32',4,0,NULL,NULL,NULL,'e724e30e-b9e1-4a19-afa9-d19aa8dc42f4'),(1887,'TB among Public Transport Operators ','TB among Key Population Group Public Transport Operators','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Public Transport Operators \n TB among Key Population Group Public Transport Operators\n \n 2023-03-28 19:51:36 UTC\n \n 2023-06-07 10: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 1887\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 4654 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:51:36',4,'2023-06-07 10:26:25',4,0,NULL,NULL,NULL,'4aac5017-e28a-4f36-8805-0812476a9d7b'),(1888,'HIV Positive on ART - Miners','High risk population of Miners with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Miners\n High risk population of Miners with HIV Positive on ART\n \n 2023-03-28 19:55:27 UTC\n \n 2023-06-14 09:58: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 1888\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3667 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:55:27',4,'2023-06-14 09:58:40',4,0,NULL,NULL,NULL,'a37a95b7-1365-4d73-8d21-28dd2e77196e'),(1889,'TB among Health Workers','TB among Key Population Group Health Workers','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Health Workers\n TB among Key Population Group Health Workers\n \n 2023-03-28 19:55:49 UTC\n \n 2023-06-07 10:27: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 1889\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.person_id in ( \n -- Miners \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3670 \n and obs_datetime >= CAST(:startDate AS DATE) \n and obs_datetime <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 19:55:49',4,'2023-06-07 10:27:01',4,0,NULL,NULL,NULL,'04590a3f-4e59-45fe-a5c3-f5ae76ef805b'),(1890,'HIV Positive on ART - Ex Miner','High risk population of Ex Miner with with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Ex Miner\n High risk population of Ex Miner with with HIV Positive on ART\n \n 2023-03-28 19:58:00 UTC\n \n 2023-06-14 09:49: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 1890\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Ex-Miner \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3668 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 19:58:00',4,'2023-06-14 09:49:53',4,0,NULL,NULL,NULL,'1edf0f21-2fad-48c7-a24a-e21367f334c1'),(1891,'HIV Positive on ART - HHCM','High risk population of HHCM with with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - HHCM\n High risk population of HHCM with with HIV Positive on ART\n \n 2023-03-28 20:00:28 UTC\n \n 2023-06-14 09:55: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 1891\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- HHCM \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3777 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 20:00:28',4,'2023-06-14 09:55:54',4,0,NULL,NULL,NULL,'14b8879f-49ef-492c-aeb0-fdd62fde084a'),(1892,'TB among Miners','TB among Key Population Group Miners','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Miners\n TB among Key Population Group Miners\n \n 2023-03-28 20:05:03 UTC\n \n 2023-03-28 20:12: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 1892\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','2023-03-29 01:35:03',4,'2023-03-29 01:42:22',4,0,NULL,NULL,NULL,'526100b3-2b2a-4f15-862e-4be06d73bdb3'),(1893,'HIV Positive on ART - HHXM','High risk population of HHXM with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - HHXM\n High risk population of HHXM with HIV Positive on ART\n \n 2023-03-28 20:05:19 UTC\n \n 2023-06-14 09:57: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 1893\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- HHXM \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3778 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 20:05:19',4,'2023-06-14 09:57:29',4,0,NULL,NULL,NULL,'0d7e9652-b8fa-4264-859b-0b681452c462'),(1894,'HIV Positive on ART - Factory Workers','High risk population of Factory Workers with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Factory Workers\n High risk population of Factory Workers with HIV Positive on ART\n \n 2023-03-28 20:09:30 UTC\n \n 2023-06-14 09:52: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 1894\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Factory workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3669 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 20:09:30',4,'2023-06-14 09:52:25',4,0,NULL,NULL,NULL,'67233a82-27bf-4615-948b-28fad7ad6322'),(1895,'HIV Positive on ART - Public transport operators','High risk population of Public transport operators with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Public transport operators\n High risk population of Public transport operators with HIV Positive on ART\n \n 2023-03-28 20:12:15 UTC\n \n 2023-06-14 09:48: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 1895\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Public Transport Operators \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 4654 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n \n\n','2023-03-28 20:12:15',4,'2023-06-14 09:48:07',4,0,NULL,NULL,NULL,'63418340-29fe-4106-83ad-a09538397f5f'),(1896,'TB among Exminers','TB among Key Population Group Ex Miners','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Exminers\n TB among Key Population Group Ex Miners\n \n 2023-03-28 20:13:33 UTC\n \n 2023-03-28 20:18: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 1896\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','2023-03-29 01:43:33',4,'2023-03-29 01:48:09',4,0,NULL,NULL,NULL,'2dcbfff3-70b6-4ed5-b727-a51fea71b8aa'),(1897,'HIV Positive on ART - Health workers','High risk population of Health workers with HIV Positive on ART','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Health workers\n High risk population of Health workers with HIV Positive on ART\n \n 2023-03-28 20:18:06 UTC\n \n 2023-06-14 09:54: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 1897\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) \n AND o.person_id in \n ( \n select tb_clients.person_id \n from \n (select B.person_id, B.obs_group_id, B.value_datetime AS tb_start_date \n from obs B \n -- Start Date Picked from TB Intake form \n inner join \n (select person_id, max(obs_datetime), SUBSTRING(MAX(CONCAT(obs_datetime, obs_id)), 20) AS observation_id \n from obs where concept_id = 4153 \n and cast(obs_datetime as date)<= cast(:endDate as date) \n and voided = 0 \n group by person_id) as A \n on A.observation_id = B.obs_group_id \n -- TB Start Date \n where concept_id = 2237 \n and A.observation_id = B.obs_group_id \n and voided = 0 \n group by B.person_id \n ) as tb_clients \n where tb_clients.tb_start_date >= cast(:startDate as date) \n and tb_clients.tb_start_date <= cast(:endDate as date) \n ) \n AND o.person_id in \n ( \n select distinct ob.person_id \n from obs ob \n where ob.concept_id = 4666 and ob.value_coded in (4323,4664)-- HIV Positive \n and ob.voided = 0 \n and CAST(ob.obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(ob.obs_datetime as DATE) <= CAST(:endDate AS DATE) \n and ob.person_id in ( \n -- On ART \n select distinct o.person_id \n from obs o \n where o.concept_id = 4667 \n AND cast(o.obs_datetime as date) >= cast(:startDate as date) \n AND cast(o.obs_datetime as date) <= cast(:endDate as date) \n AND o.voided = 0 \n ) \n and ob.person_id in ( \n -- Health workers \n select distinct person_id \n from obs \n where concept_id = 3776 and value_coded = 3670 \n and CAST(obs_datetime as DATE) >= CAST(:startDate AS DATE) \n and CAST(obs_datetime as DATE) <= CAST(:endDate AS DATE) \n ) \n ) \n \n \n AND o.person_id not in ( \n select distinct os.person_id \n from obs os \n -- Patient must not be a tranfer in \n where os.concept_id = 3772 and os.value_coded =2095 \n AND cast(os.obs_datetime as date) >= cast(:startDate as date) \n AND cast(os.obs_datetime as date) <= cast(:endDate as date) \n AND os.voided = 0 \n ) \n\n','2023-03-28 20:18:06',4,'2023-06-14 09:54:04',4,0,NULL,NULL,NULL,'1340548d-896a-4473-ae26-4c8960dec630'),(1898,'TB among HHCM','TB among Key Population Group HHCM','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among HHCM\n TB among Key Population Group HHCM\n \n 2023-03-28 20:19:17 UTC\n \n 2023-03-28 20:20: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 1898\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','2023-03-29 01:49:17',4,'2023-03-29 01:50:21',4,0,NULL,NULL,NULL,'dd0ada55-f903-426e-a60e-f83ceeb15cab'),(1899,'TB among HHXM','TB among Key Population Group HHXM','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among HHXM\n TB among Key Population Group HHXM\n \n 2023-03-28 20:21:08 UTC\n \n 2023-03-28 20:23: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 1899\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','2023-03-29 01:51:08',4,'2023-03-29 01:53:24',4,0,NULL,NULL,NULL,'9558eb96-47f5-4cdd-ad4f-d07257529259'),(1900,'Pulmonary Bacteriologically Confirmed - Exlude Relapse','Pulmonary Bacteriologically Confirmed - Exclude Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed - Exlude Relapse\n Pulmonary Bacteriologically Confirmed - Exclude Relapse\n \n 2023-03-29 03:39:55 UTC\n \n 2023-06-06 13:40: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 1900\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','2023-03-29 03:39:55',4,'2023-06-06 13:40:21',4,0,NULL,NULL,NULL,'8315a536-5b6e-4da8-bcf7-860b6b6bd8aa'),(1902,'Pulmonary Bacteriologically Confirmed New','Pulmonary Bacteriologically Confirmed New','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed New\n Pulmonary Bacteriologically Confirmed New\n \n 2023-03-29 04:12:11 UTC\n \n 2023-03-29 05: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 1902\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','2023-03-29 09:42:11',4,'2023-03-29 11:07:28',4,0,NULL,NULL,NULL,'15e06979-0f27-4aba-87fb-bc5a6dc28da4'),(1903,'Pulmonary Clinically Diagnosed Excluding Relapse','Pulmonary Clinically Diagnosed Excluding Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed Excluding Relapse\n Pulmonary Clinically Diagnosed Excluding Relapse\n \n 2023-03-29 06:06:35 UTC\n \n 2023-03-29 08: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 1903\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','2023-03-29 11:36:35',4,'2023-03-29 13:42:28',4,0,NULL,NULL,NULL,'b0ff3ba5-25df-46e4-8eae-bfca7d86b9dd'),(1904,'Pulmonary Bacteriologically Confirmed Relapse','Pulmonary Bacteriologically Confirmed Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Bacteriologically Confirmed Relapse\n Pulmonary Bacteriologically Confirmed Relapse\n \n 2023-03-29 06:08:27 UTC\n \n 2023-03-29 08:11: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 1904\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','2023-03-29 11:38:27',4,'2023-03-29 13:41:19',4,0,NULL,NULL,NULL,'f6797c59-e7e3-4492-ad5f-a67bf5e683bc'),(1905,'Pulmonary Clinically Diagnosed New','Pulmonary Clinically Diagnosed New','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed New\n Pulmonary Clinically Diagnosed New\n \n 2023-03-29 08:14:51 UTC\n \n 2023-03-29 08:17: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 1905\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','2023-03-29 13:44:51',4,'2023-03-29 13:47:31',4,0,NULL,NULL,NULL,'63333694-f766-4047-830b-087496f8e5a8'),(1906,'Pulmonary Clinically Diagnosed Relapse','Pulmonary Clinically Diagnosed Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Pulmonary Clinically Diagnosed Relapse\n Pulmonary Clinically Diagnosed Relapse\n \n 2023-03-29 08:15:08 UTC\n \n 2023-03-29 08:18: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 1906\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','2023-03-29 13:45:08',4,'2023-03-29 13:48:31',4,0,NULL,NULL,NULL,'2ff007c1-993d-48fc-8df6-9ed7c66b42d3'),(1907,'Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New','Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - New\n \n 2023-03-29 08:25:10 UTC\n \n 2023-03-29 08:49: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 1907\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','2023-03-29 13:55:10',4,'2023-03-29 14:19:47',4,0,NULL,NULL,NULL,'d1ce1a2c-338a-4926-a1d4-f7f79ac2b875'),(1908,'TB among Factory Workers','TB among Key Population Group Factory Workers','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Factory Workers\n TB among Key Population Group Factory Workers\n \n 2023-03-29 08:26:00 UTC\n \n 2023-03-29 08:52: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 1908\n COUNT\n \n \n \n \n endDate\n ${startDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2023-03-29 13:56:00',4,'2023-03-29 14:22:40',4,0,NULL,NULL,NULL,'071a7d7a-f944-4965-978c-bfe740051b9a'),(1909,'Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse','Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Relapse\n \n 2023-03-29 08:52:39 UTC\n \n 2023-03-29 08:54: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 1909\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','2023-03-29 14:22:39',4,'2023-03-29 14:24:28',4,0,NULL,NULL,NULL,'20c9a6fc-f845-4569-b018-b5f59c39948c'),(1910,'Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Excluging Relapse','Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Excluging Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Excluging Relapse\n Extra Pulmonary : (bacteriologically confirmed or clinically diagnosed) - Excluging Relapse\n \n 2023-03-29 08:53:19 UTC\n \n 2023-03-29 08:54: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 1910\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','2023-03-29 14:23:19',4,'2023-03-29 14:24:54',4,0,NULL,NULL,NULL,'422afe85-5763-4700-8a8b-bf17328901a8'),(1911,'TB among Correctional Staff & Inmates','TB among Key Population Group Correctional Staff & Inmates','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Correctional Staff & Inmates\n TB among Key Population Group Correctional Staff & Inmates\n \n 2023-03-29 08:53:58 UTC\n \n 2023-03-29 08:56: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 1911\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','2023-03-29 14:23:58',4,'2023-03-29 14:26:06',4,0,NULL,NULL,NULL,'8ac11f64-421a-4f48-9ac3-048ee6912eda'),(1912,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Excluding Relapse\n \n 2023-03-29 08:55:36 UTC\n \n 2023-03-29 09:04:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1912\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','2023-03-29 14:25:36',4,'2023-03-29 14:34:23',4,0,NULL,NULL,NULL,'83125cb9-0324-4e21-8f4d-b9fd51049909'),(1913,'TB among Public Transport Operators ','TB among Key Population Group Public Transport Operators','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Public Transport Operators \n TB among Key Population Group Public Transport Operators\n \n 2023-03-29 08:57:05 UTC\n \n 2023-03-29 08:59: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 1913\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','2023-03-29 14:27:05',4,'2023-03-29 14:29:07',4,0,NULL,NULL,NULL,'f3aabc74-880c-4502-94af-ff9fd0b95906'),(1914,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : New\n \n 2023-03-29 08:59:37 UTC\n \n 2023-03-29 09:04: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 1914\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','2023-03-29 14:29:37',4,'2023-03-29 14:34:54',4,0,NULL,NULL,NULL,'c5e34544-e98f-42ce-82d1-3708ce5e5b80'),(1915,'TB among Health Workers','TB among Key Population Group Health Workers','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB among Health Workers\n TB among Key Population Group Health Workers\n \n 2023-03-29 09:02:15 UTC\n \n 2023-03-29 09:04: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 1915\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','2023-03-29 14:32:15',4,'2023-03-29 14:34:59',4,0,NULL,NULL,NULL,'76adf56b-486f-4a4c-b309-5c43372d94eb'),(1916,'TB Notification - Block 3','TB Notification - Block 3','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 3\n TB Notification - Block 3\n \n 2023-03-29 09:08:01 UTC\n \n 2023-03-29 09:08: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 1916\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','2023-03-29 14:38:01',4,'2023-03-29 14:38:31',4,0,NULL,NULL,NULL,'5a51f412-3b6f-4808-ae32-ed90141bb7e2'),(1917,'TB Notification - Block 3 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 3 Data Set\n \n 2023-03-29 09:08:31 UTC\n \n 2023-03-29 10:08: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 1917\n \n \n \n TB-HHCM\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 TB-HHXM\n \n \n \n \n \n \n \n \n \n TBExMiners\n \n \n \n \n \n \n \n \n \n TBFactoryW\n \n \n \n \n \n \n \n \n \n TBHealthW\n \n \n \n \n \n \n \n \n \n TBInmates\n \n \n \n \n \n \n \n \n \n TBMiners\n \n \n \n \n \n \n \n \n \n TBTrans\n \n \n \n \n \n \n \n \n \n','2023-03-29 14:38:31',4,'2023-03-29 15:38:22',4,0,NULL,NULL,NULL,'4e91ef91-ad5f-4717-b782-9ac61d52dc40'),(1919,'Block 1: All TB Patients diagnosed with TB during the current quarter, by history of treatment and anatomic site of disease Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Block 1: All TB Patients diagnosed with TB during the current quarter, by history of treatment and anatomic site of disease Data Set\n \n 2023-03-29 09:46:48 UTC\n \n 2023-03-29 15:30: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 1919\n \n \n \n died1\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 died2\n \n \n \n \n \n \n \n \n \n died3\n \n \n \n \n \n \n \n \n \n extra1\n \n \n \n \n \n \n \n \n \n extra2\n \n \n \n \n \n \n \n \n \n extra3\n \n \n \n \n \n \n \n \n \n pul_ExPulm\n \n \n \n \n \n \n \n \n \n pul_clin1\n \n \n \n \n \n \n \n \n \n pul_diag2\n \n \n \n \n \n \n \n \n \n pul_new \n \n \n \n \n \n \n \n \n \n pul_newex\n \n \n \n \n \n \n \n \n \n pul_relaps\n \n \n \n \n \n \n \n \n \n','2023-03-29 11:46:48',4,'2023-03-29 17:30:32',4,0,NULL,NULL,NULL,'b7c3203a-888a-4139-9c3f-e9a8939bc811'),(1920,'Documented HIV Status - New and Relapse','','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - New and Relapse\n \n \n 2023-03-29 14:22:45 UTC\n \n 2023-06-13 13: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 1920\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','2023-03-29 14:22:45',4,'2023-06-13 13:50:10',4,0,NULL,NULL,NULL,'18152a92-ded2-4f5a-af93-5dd01b51c839'),(1921,'Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse','Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse\n Bacteriologically confirmed not started on treatment (m) ticked Died before treatment or Lost to follow up : Relapse\n \n 2023-03-29 15:26:50 UTC\n \n 2023-03-29 15: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 1921\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','2023-03-29 17:26:50',4,'2023-03-29 17:28:11',4,0,NULL,NULL,NULL,'61cb2cc7-ee32-4da9-9c82-7bbc85f3e43c'),(1922,'TB Notification - Block 1 ','TB Notification - Block 1 ','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 1 \n TB Notification - Block 1 \n \n 2023-03-29 17:06:10 UTC\n \n 2023-03-29 17:06: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 1922\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','2023-03-29 19:06:10',4,'2023-03-29 19:06:58',4,0,NULL,NULL,NULL,'c7604f80-13cf-4773-abf5-b95f35fa1c92'),(1923,'TB Notification - Block 1 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 1 Data Set\n \n 2023-03-29 17:06:58 UTC\n \n 2023-05-31 08:36: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 1923\n \n \n \n LTFBaCoNew\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 LTFBaCoRel\n \n \n \n \n \n \n \n \n \n LTFBaCoXRe\n \n \n \n \n \n \n \n \n \n PulBaCoNw\n \n \n \n \n \n \n \n \n \n PulBaCoRel\n \n \n \n \n \n \n \n \n \n PulBaCoXRe\n \n \n \n \n \n \n \n \n \n PulClDiNw\n \n \n \n \n \n \n \n \n \n PulClDiRel\n \n \n \n \n \n \n \n \n \n PulClDiXRe\n \n \n \n \n \n \n \n \n \n XPulBaCoNw\n \n \n \n \n \n \n \n \n \n XPulBaCoRe\n \n \n \n \n \n \n \n \n \n XPulBaCoXR\n \n \n \n \n \n \n \n \n \n','2023-03-29 19:06:58',4,'2023-05-31 10:36:30',4,0,NULL,NULL,NULL,'d74aa49a-aa20-49e1-939a-5f1fb0c78d81'),(1924,'Documented HIV Status - Children < 15','Children (0 - 14) with documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Children < 15\n Children (0 - 14) with documented HIV Status\n \n 2023-03-29 17:07:40 UTC\n \n 2023-06-08 10: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 1924\n COUNT\n \n \n \n \n endDate\n ${startDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2023-03-29 17:07:40',4,'2023-06-08 10:16:14',4,0,NULL,NULL,NULL,'777854f8-1e75-4b4c-9eb5-2b2a23acd1fd'),(1925,'Documented HIV Status - Correctional Staff and inmates','High risk population of Correctional Staff and inmates with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with Documented HIV Status\n \n 2023-03-29 17:11:52 UTC\n \n 2023-06-08 10:20: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 1925\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','2023-03-29 17:11:52',4,'2023-06-08 10:20:32',4,0,NULL,NULL,NULL,'8e2ae589-9a13-4aa5-bf9d-3cf376a59bf6'),(1926,'Documented HIV Status - Ex-Miners','High risk population of Ex Miners with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Ex-Miners\n High risk population of Ex Miners with Documented HIV Status\n \n 2023-03-29 17:20:28 UTC\n \n 2023-06-08 10:20: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 1926\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','2023-03-29 17:20:28',4,'2023-06-08 10:20:48',4,0,NULL,NULL,NULL,'b2541e20-b6b8-4985-bd4a-9a980ee5ebf8'),(1927,'Documented HIV Status - Factory Workers','High risk population of Factory Workers with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Factory Workers\n High risk population of Factory Workers with Documented HIV Status\n \n 2023-03-29 17:25:11 UTC\n \n 2023-06-08 10: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 1927\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','2023-03-29 17:25:11',4,'2023-06-08 10:21:06',4,0,NULL,NULL,NULL,'e95e9d48-01d5-4826-ab2c-82dbd2dfce44'),(1928,'Documented HIV Status - Health workers','High risk population of Health workers with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Health workers\n High risk population of Health workers with Documented HIV Status\n \n 2023-03-29 17:31:28 UTC\n \n 2023-06-08 10:21: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 1928\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','2023-03-29 17:31:28',4,'2023-06-08 10:21:24',4,0,NULL,NULL,NULL,'38dd8693-21f8-40c2-ba3a-9f5d1a63959c'),(1929,'Documented HIV Status - HHCM','High risk population of HHCM with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - HHCM\n High risk population of HHCM with Documented HIV Status\n \n 2023-03-29 17:34:59 UTC\n \n 2023-06-08 10:24: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 1929\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','2023-03-29 17:34:59',4,'2023-06-08 10:24:38',4,0,NULL,NULL,NULL,'12a86c02-9e39-4d69-8082-ecff9269d106'),(1930,'Documented HIV Status - Miners','High risk population of miners with documented HIV','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Miners\n High risk population of miners with documented HIV\n \n 2023-03-29 17:39:04 UTC\n \n 2023-06-08 10: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 1930\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','2023-03-29 17:39:04',4,'2023-06-08 10:12:32',4,0,NULL,NULL,NULL,'625cc3fd-4dc5-4aee-9fba-2559b31470c8'),(1931,'Documented HIV Status - Public transport operators','High risk population of Public transport operators with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - Public transport operators\n High risk population of Public transport operators with Documented HIV Status\n \n 2023-03-29 19:32:07 UTC\n \n 2023-06-08 10:25: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 1931\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','2023-03-29 19:32:07',4,'2023-06-08 10:25:10',4,0,NULL,NULL,NULL,'9e48b5ef-99df-44e7-8946-2728727e08a1'),(1932,'Documented HIV status - Retreatment ','Retreatment Excl. Relapse client with documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV status - Retreatment \n Retreatment Excl. Relapse client with documented HIV Status\n \n 2023-03-29 19:35:36 UTC\n \n 2023-06-08 10:25: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 1932\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','2023-03-29 19:35:36',4,'2023-06-08 10:25:35',4,0,NULL,NULL,NULL,'5cc834ec-7c90-4063-b684-2c9da8ddc83e'),(1933,'Positive HIV Status - Children < 15','High risk population for Children < 15 with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Children < 15\n High risk population for Children < 15 with Positive HIV Status\n \n 2023-03-29 19:40:57 UTC\n \n 2023-06-13 13:08: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 1933\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','2023-03-29 19:40:57',4,'2023-06-13 13:08:13',4,0,NULL,NULL,NULL,'9ceb1ec0-0b28-49d8-a6ba-90297cae2968'),(1934,'Positive HIV Status - Correctional Staff and inmates',' High risk population of Correctional Staff and inmates with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with Positive HIV Status\n \n 2023-03-29 19:44:28 UTC\n \n 2023-06-13 13:14: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 1934\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','2023-03-29 19:44:28',4,'2023-06-13 13:14:42',4,0,NULL,NULL,NULL,'c9be5185-942d-41ae-8e15-c3ddea7bb22f'),(1935,'Positive HIV Status - Ex-Miners','High risk population of Ex Miners with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Ex-Miners\n High risk population of Ex Miners with Positive HIV Status\n \n 2023-03-29 19:47:14 UTC\n \n 2023-06-13 13:30: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 1935\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','2023-03-29 19:47:14',4,'2023-06-13 13:30:00',4,0,NULL,NULL,NULL,'51933c5f-9020-417a-91fe-77cb0412d9ee'),(1936,'Positive HIV Status - Factory Workers','High risk population of Factory Workers with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Factory Workers\n High risk population of Factory Workers with Positive HIV Status\n \n 2023-03-29 19:52:48 UTC\n \n 2023-06-13 13:17: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 1936\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','2023-03-29 19:52:48',4,'2023-06-13 13:17:03',4,0,NULL,NULL,NULL,'a72725b5-eac8-4f97-b285-3a9db174ab39'),(1937,'Positive HIV Status - Health workers',' High risk population of Health workers with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Health workers\n High risk population of Health workers with Positive HIV Status\n \n 2023-03-29 19:59:20 UTC\n \n 2023-06-13 13:28: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 1937\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','2023-03-29 19:59:20',4,'2023-06-13 13:28:31',4,0,NULL,NULL,NULL,'317c0cce-c0d7-44da-9272-62cc9279a76c'),(1938,'Positive HIV Status - HHCM',' High risk population of HHCM with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - HHCM\n High risk population of HHCM with Positive HIV Status\n \n 2023-03-29 20:05:19 UTC\n \n 2023-06-13 13:21: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 1938\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','2023-03-29 20:05:19',4,'2023-06-13 13:21:57',4,0,NULL,NULL,NULL,'7a7dee7e-a318-4819-96e9-a1c8fe3e0a4f'),(1939,'Positive HIV Status - HHXM','High risk population of HHXM with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - HHXM\n High risk population of HHXM with Positive HIV Status\n \n 2023-03-29 20:10:54 UTC\n \n 2023-06-13 13:25: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 1939\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','2023-03-29 20:10:54',4,'2023-06-13 13:25:57',4,0,NULL,NULL,NULL,'4a4bc063-3233-4b3f-9776-8949a2a3104c'),(1940,'Positive HIV Status - Miners','High risk population of miners with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Miners\n High risk population of miners with Positive HIV Status\n \n 2023-03-29 20:13:09 UTC\n \n 2023-06-13 13:31: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 1940\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','2023-03-29 20:13:09',4,'2023-06-13 13:31:39',4,0,NULL,NULL,NULL,'a555cd0b-41bf-4ba0-bc0a-bb84952305d7'),(1941,'Positive HIV Status - New and Relapse','New and Relapse with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - New and Relapse\n New and Relapse with Positive HIV Status\n \n 2023-03-29 20:17:12 UTC\n \n 2023-06-13 13:35: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 1941\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','2023-03-29 20:17:12',4,'2023-06-13 13:35:06',4,0,NULL,NULL,NULL,'5212b24d-abdf-416a-812e-72b4f64b342d'),(1942,'Positive HIV Status - Public transport','High risk population of Public transport operators with Positive HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV Status - Public transport\n High risk population of Public transport operators with Positive HIV Status\n \n 2023-03-29 20:38:50 UTC\n \n 2023-06-13 13:39: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 1942\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','2023-03-29 20:38:50',4,'2023-06-13 13:39:35',4,0,NULL,NULL,NULL,'3ada2309-e8f6-4301-ae89-63837fb6f36b'),(1943,'Positive HIV status - Retreatment','Retreatment Excl. Relapse with Positive HIV status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Positive HIV status - Retreatment\n Retreatment Excl. Relapse with Positive HIV status\n \n 2023-03-29 20:41:12 UTC\n \n 2023-06-13 13:36: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 1943\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','2023-03-29 20:41:12',4,'2023-06-13 13:36:18',4,0,NULL,NULL,NULL,'ee1b5901-9777-44c1-affd-37e3aba4746a'),(1944,'HIV Positive on ART - Children < 15','High risk population for Children < 15 with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Children < 15\n High risk population for Children < 15 with HIV Positive on ART\n \n 2023-03-29 20:43:47 UTC\n \n 2023-06-13 13:11: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 1944\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','2023-03-29 20:43:47',4,'2023-06-13 13:11:18',4,0,NULL,NULL,NULL,'f636be9d-0527-4054-9822-6ab005267560'),(1945,'HIV Positive on ART - Correctional Staff and inmates','High risk population of Correctional Staff and inmates on HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates on HIV Positive on ART\n \n 2023-03-29 20:56:54 UTC\n \n 2023-06-13 13:13: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 1945\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','2023-03-29 20:56:54',4,'2023-06-13 13:13:19',4,0,NULL,NULL,NULL,'2c07cd7e-cc23-4974-9964-602e576ef80d'),(1946,'HIV Positive on ART - Ex Miner','High risk population of Ex Miner with with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Ex Miner\n High risk population of Ex Miner with with HIV Positive on ART\n \n 2023-03-29 21:01:08 UTC\n \n 2023-06-13 13:42: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 1946\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','2023-03-29 21:01:08',4,'2023-06-13 13:42:35',4,0,NULL,NULL,NULL,'8df71093-9cb8-4d1d-9885-fb4415f8c1b2'),(1947,'HIV Positive on ART - Factory Workers','High risk population of Factory Workers with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Factory Workers\n High risk population of Factory Workers with HIV Positive on ART\n \n 2023-03-29 21:07:39 UTC\n \n 2023-06-13 13:15: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 1947\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','2023-03-29 21:07:39',4,'2023-06-13 13:15:58',4,0,NULL,NULL,NULL,'6d1a75ee-e860-483d-ad80-4308d1009c22'),(1948,'HIV Positive on ART - Health workers',' High risk population of Health workers with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Health workers\n High risk population of Health workers with HIV Positive on ART\n \n 2023-03-29 21:13:26 UTC\n \n 2023-06-13 13:27: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 1948\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','2023-03-29 21:13:26',4,'2023-06-13 13:27:33',4,0,NULL,NULL,NULL,'b3813228-7114-4e37-b997-6acebccd724a'),(1949,'HIV Positive on ART - HHCM','High risk population of HHCM with with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - HHCM\n High risk population of HHCM with with HIV Positive on ART\n \n 2023-03-29 21:18:20 UTC\n \n 2023-06-13 13:21: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 1949\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','2023-03-29 21:18:20',4,'2023-06-13 13:21:22',4,0,NULL,NULL,NULL,'360494e1-ccad-4e72-bf80-c564f2cfe18b'),(1950,'HIV Positive on ART - HHXM','High risk population of HHXM with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - HHXM\n High risk population of HHXM with HIV Positive on ART\n \n 2023-03-29 21:20:51 UTC\n \n 2023-06-13 13:26: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 1950\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','2023-03-29 21:20:51',4,'2023-06-13 13:26:33',4,0,NULL,NULL,NULL,'ce4eaae7-7985-4e89-ab65-3b0c1686f80e'),(1951,'HIV Positive on ART - Miners','High risk population of Miners with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Miners\n High risk population of Miners with HIV Positive on ART\n \n 2023-03-29 21:27:27 UTC\n \n 2023-06-13 13:30: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 1951\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','2023-03-29 21:27:27',4,'2023-06-13 13:30:33',4,0,NULL,NULL,NULL,'19d13a38-7625-4136-b870-a7facc92ecb3'),(1952,'HIV Positive on ART - New and Relapse','High risk population of New and Relapse with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - New and Relapse\n High risk population of New and Relapse with HIV Positive on ART\n \n 2023-03-29 21:33:41 UTC\n \n 2023-06-13 13:33: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 1952\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','2023-03-29 21:33:41',4,'2023-06-13 13:33:55',4,0,NULL,NULL,NULL,'86db5b09-049a-4be4-a35f-f02f9de644f6'),(1953,'HIV Positive on ART - Public transport operators','High risk population of Public transport operators with HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Public transport operators\n High risk population of Public transport operators with HIV Positive on ART\n \n 2023-03-29 21:37:07 UTC\n \n 2023-06-13 13:38: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 1953\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','2023-03-29 21:37:07',4,'2023-06-13 13:38:26',4,0,NULL,NULL,NULL,'ebbb00b2-3779-47b8-8265-c8afea8a5ac1'),(1954,'HIV Positive on ART - Retreatment','High risk population of Retreatment Excl. Relapse HIV Positive on ART','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on ART - Retreatment\n High risk population of Retreatment Excl. Relapse HIV Positive on ART\n \n 2023-03-29 21:39:16 UTC\n \n 2023-06-13 13:36: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 1954\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','2023-03-29 21:39:16',4,'2023-06-13 13:36:50',4,0,NULL,NULL,NULL,'2ffdb12c-d02b-4e9a-a1dc-6e4974093b5a'),(1955,'HIV Positive on CPT/Dapzone - Children < 15','Children < 15 with Positive HIV on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Children < 15\n Children < 15 with Positive HIV on CPT/Dapzone\n \n 2023-03-29 21:44:42 UTC\n \n 2023-06-13 13:09: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 1955\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','2023-03-29 21:44:42',4,'2023-06-13 13:09:14',4,0,NULL,NULL,NULL,'78313782-541c-4568-956c-9fb7bf92c08b'),(1956,'HIV Positive on CPT/Dapzone - Correctional Staff and inmates','High risk population of Correctional Staff and inmates with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Correctional Staff and inmates\n High risk population of Correctional Staff and inmates with HIV Positive on CPT/Dapzone\n \n 2023-03-29 21:54:08 UTC\n \n 2023-06-13 13:13: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 1956\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','2023-03-29 21:54:08',4,'2023-06-13 13:13:56',4,0,NULL,NULL,NULL,'46e76f2a-4fc0-40cf-be9d-61565edbe566'),(1957,'HIV Positive on CPT/Dapzone - Ex Miner','High risk population of Ex Miner with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Ex Miner\n High risk population of Ex Miner with HIV Positive on CPT/Dapzone\n \n 2023-03-29 21:58:20 UTC\n \n 2023-06-13 13:48: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 1957\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','2023-03-29 21:58:20',4,'2023-06-13 13:48:33',4,0,NULL,NULL,NULL,'348df991-95e1-4724-8df6-e4d905d67b11'),(1958,'HIV Positive on CPT/Dapzone - Factory Workers','High risk population of Factory Workers with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Factory Workers\n High risk population of Factory Workers with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:00:58 UTC\n \n 2023-06-13 13:16: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 1958\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','2023-03-29 22:00:58',4,'2023-06-13 13:16:31',4,0,NULL,NULL,NULL,'5ce50877-ee92-48de-bfa7-a863b735975e'),(1959,'HIV Positive on CPT/Dapzone - Health workers','High risk population of Health workers with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Health workers\n High risk population of Health workers with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:03:33 UTC\n \n 2023-06-13 13:28: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 1959\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','2023-03-29 22:03:33',4,'2023-06-13 13:28:01',4,0,NULL,NULL,NULL,'e47447de-6a64-422f-abe3-c281d2b4431c'),(1960,'HIV Positive on CPT/Dapzone - HHCM','High risk population of HHCM with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - HHCM\n High risk population of HHCM with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:08:00 UTC\n \n 2023-06-13 13:22: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 1960\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','2023-03-29 22:08:00',4,'2023-06-13 13:22:32',4,0,NULL,NULL,NULL,'02d9a185-dc0e-4852-8176-c4da69705d5d'),(1961,'HIV Positive on CPT/Dapzone - HHXM','High risk population of HHXM with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - HHXM\n High risk population of HHXM with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:10:38 UTC\n \n 2023-06-13 13:25: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 1961\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','2023-03-29 22:10:38',4,'2023-06-13 13:25:27',4,0,NULL,NULL,NULL,'c86cc664-d513-4afe-97b9-8163b4bb39d1'),(1962,'HIV Positive on CPT/Dapzone - Miners','High risk population Miners with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Miners\n High risk population Miners with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:13:17 UTC\n \n 2023-06-13 13:31: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 1962\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','2023-03-29 22:13:17',4,'2023-06-13 13:31:04',4,0,NULL,NULL,NULL,'7751e110-9e34-453e-bd9f-792272cbd895'),(1963,'HIV Positive on CPT/Dapzone - New and Relapse','High risk population of New and Relapse with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - New and Relapse\n High risk population of New and Relapse with HIV Positive on CPT/Dapzone\n \n 2023-03-29 22:16:42 UTC\n \n 2023-06-13 13:34: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 1963\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','2023-03-29 22:16:42',4,'2023-06-13 13:34:26',4,0,NULL,NULL,NULL,'2ebc8503-89e4-41f4-bdaf-e9e1d041a147'),(1964,'HIV Positive on CPT/Dapzone - Public transport operators','High risk population of Public transport operators with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Public transport operators\n High risk population of Public transport operators with HIV Positive on CPT/Dapzone\n \n 2023-03-30 08:39:11 UTC\n \n 2023-06-13 13:38: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 1964\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','2023-03-30 08:39:11',4,'2023-06-13 13:38:59',4,0,NULL,NULL,NULL,'575068b5-f0ca-4d5b-8181-663b5feded65'),(1965,'HIV Positive on CPT/Dapzone - Retreatment','Retreatment Excl. Relapse with HIV Positive on CPT/Dapzone','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HIV Positive on CPT/Dapzone - Retreatment\n Retreatment Excl. Relapse with HIV Positive on CPT/Dapzone\n \n 2023-03-30 08:41:45 UTC\n \n 2023-06-13 13:37: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 1965\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','2023-03-30 08:41:45',4,'2023-06-13 13:37:25',4,0,NULL,NULL,NULL,'22dbd0dd-a4ca-42a5-986e-6c0012eb55b1'),(1966,'Documented HIV Status - HHXM','High risk population of HHXM with Documented HIV Status','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Documented HIV Status - HHXM\n High risk population of HHXM with Documented HIV Status\n \n 2023-03-30 09:03:54 UTC\n \n 2023-06-08 10:24: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 1966\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','2023-03-30 09:03:54',4,'2023-06-08 10:24:52',4,0,NULL,NULL,NULL,'e5de47f6-aa7a-4b2d-bd72-83e5458977d6'),(1967,'TB Notification - Block 4','TB Notification - Block 4','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Notification - Block 4\n TB Notification - Block 4\n \n 2023-03-30 09:18:19 UTC\n \n 2023-03-30 20: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 1967\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','2023-03-30 11:18:19',4,'2023-03-30 22:54:40',4,0,NULL,NULL,NULL,'0b9affca-ad93-42fb-bd49-57380f721a08'),(1968,'TBNotification - Block 4 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TBNotification - Block 4 Data Set\n \n 2023-03-30 09:18:47 UTC\n \n 2023-06-08 11:15: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 1968\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n ARTChild_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 ARTChild_M\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n ARTCo&In_F\n \n \n \n \n \n \n \n \n \n ARTCo&In_M\n \n \n \n \n \n \n ARTFacW_F\n \n \n \n \n \n \n \n \n \n ARTFacW_M\n \n \n \n \n \n \n ARTHHCM_F\n \n \n \n \n \n \n \n \n \n ARTHHCM_M\n \n \n \n \n \n \n ARTHHXM_F\n \n \n \n \n \n \n \n \n \n ARTHHXM_M\n \n \n \n \n \n \n ARTHeaW_F\n \n \n \n \n \n \n \n \n \n ARTHeaW_M\n \n \n \n \n \n \n ARTMiner_F\n \n \n \n \n \n \n \n \n \n ARTMiner_M\n \n \n \n \n \n \n ARTNw&Rl_F\n \n \n \n \n \n \n \n \n \n ARTNw&Rl_M\n \n \n \n \n \n \n ARTRetr_F\n \n \n \n \n \n \n \n \n \n ARTRetr_M\n \n \n \n \n \n \n ARTTrans_F\n \n \n \n \n \n \n \n \n \n ARTTrans_M\n \n \n \n \n \n \n ARTXMine_F\n \n \n \n \n \n \n \n \n \n ARTXMine_M\n \n \n \n \n \n \n DapChild_F\n \n \n \n \n \n \n \n \n \n DapChild_M\n \n \n \n \n \n \n DapCo&In_F\n \n \n \n \n \n \n \n \n \n DapCo&In_M\n \n \n \n \n \n \n DapFacW_F\n \n \n \n \n \n \n \n \n \n DapFacW_M\n \n \n \n \n \n \n DapHHCM_F\n \n \n \n \n \n \n \n \n \n DapHHCM_M\n \n \n \n \n \n \n DapHHXM_F\n \n \n \n \n \n \n \n \n \n DapHHXM_M\n \n \n \n \n \n \n DapHeaW_F\n \n \n \n \n \n \n \n \n \n DapHeaW_M\n \n \n \n \n \n \n DapMiner_F\n \n \n \n \n \n \n \n \n \n DapMiner_M\n \n \n \n \n \n \n DapNw&Rl_F\n \n \n \n \n \n \n \n \n \n DapNw&Rl_M\n \n \n \n \n \n \n DapRetre_F\n \n \n \n \n \n \n \n \n \n DapRetre_M\n \n \n \n \n \n \n DapTrans_F\n \n \n \n \n \n \n \n \n \n DapTrans_M\n \n \n \n \n \n \n DapXMine_F\n \n \n \n \n \n \n \n \n \n DapXMine_M\n \n \n \n \n \n \n DocS_F<15\n \n \n \n \n \n \n \n \n \n DocS_M<15\n \n \n \n \n \n \n DocSCorreF\n \n \n \n \n \n \n \n \n \n DocSCorreM\n \n \n \n \n \n \n DocSFactWF\n \n \n \n \n \n \n \n \n \n DocSFactWM\n \n \n \n \n \n \n DocSHHCM_F\n \n \n \n \n \n \n \n \n \n DocSHHCM_M\n \n \n \n \n \n \n DocSHHXM_F\n \n \n \n \n \n \n \n \n \n DocSHHXM_M\n \n \n \n \n \n \n DocSHealWF\n \n \n \n \n \n \n \n \n \n DocSHealWM\n \n \n \n \n \n \n DocSMinerF\n \n \n \n \n \n \n \n \n \n DocSMinerM\n \n \n \n \n \n \n DocSNewF\n \n \n \n \n \n \n \n \n \n DocSNewM\n \n \n \n \n \n \n DocSPubT_F\n \n \n \n \n \n \n \n \n \n DocSPubT_M\n \n \n \n \n \n \n DocSRetrF\n \n \n \n \n \n \n \n \n \n DocSRetrM\n \n \n \n \n \n \n DocSXMineF\n \n \n \n \n \n \n \n \n \n DocSXMineM\n \n \n \n \n \n \n PosChild_F\n \n \n \n \n \n \n \n \n \n PosChild_M\n \n \n \n \n \n \n PosCo&In_F\n \n \n \n \n \n \n \n \n \n PosCo&In_M\n \n \n \n \n \n \n PosFacW_F\n \n \n \n \n \n \n \n \n \n PosFacW_M\n \n \n \n \n \n \n PosHHCM_F\n \n \n \n \n \n \n \n \n \n PosHHCM_M\n \n \n \n \n \n \n PosHHXM_F\n \n \n \n \n \n \n \n \n \n PosHHXM_M\n \n \n \n \n \n \n PosHeaW_F\n \n \n \n \n \n \n \n \n \n PosHeaW_M\n \n \n \n \n \n \n PosMiner_F\n \n \n \n \n \n \n \n \n \n PosMiner_M\n \n \n \n \n \n \n PosNw&Rs_F\n \n \n \n \n \n \n \n \n \n PosNw&Rs_M\n \n \n \n \n \n \n PosRetr_F\n \n \n \n \n \n \n \n \n \n PosRetr_M\n \n \n \n \n \n \n PosTrans_F\n \n \n \n \n \n \n \n \n \n PosTrans_M\n \n \n \n \n \n \n PosXMine_F\n \n \n \n \n \n \n \n \n \n PosXMine_M\n \n \n \n \n \n \n','2023-03-30 09:18:47',4,'2023-06-08 11:15:09',4,0,NULL,NULL,NULL,'e08d273c-ba6d-4085-bf72-b7f6737396bf'),(1969,'TB_OUTCOMES','TB Outcomes','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB_OUTCOMES\n TB Outcomes\n \n 2023-03-30 13:48:45 UTC\n \n 2023-03-30 14:06: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 1969\n \n \n Competed\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','2023-03-30 15:48:45',4,'2023-03-30 16:06:44',4,0,NULL,NULL,NULL,'2244b6f7-5dd0-4c8a-8a9e-67bac3fe7d9b'),(1970,'test','test','org.openmrs.module.reporting.indicator.dimension.Dimension','org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension','org.openmrs.module.reporting.serializer.ReportingSerializer','\n test\n test\n \n 2023-03-30 14:06:01 UTC\n \n \n','2023-03-30 16:06:01',4,NULL,NULL,0,NULL,NULL,NULL,'a572d104-f644-42bb-ae58-7c83ac0747ad'),(1971,'TB New and Relapse Completed','TB New and Relapse Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Completed\n TB New and Relapse Completed\n \n 2023-03-30 14:58:43 UTC\n \n 2023-03-30 14:59: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 1971\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 16:58:43',4,'2023-03-30 16:59:47',4,0,NULL,NULL,NULL,'1540870d-551a-4e11-baad-70ed9b13289a'),(1972,'TB New and Relapse Cured','TB New and Relapse Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Cured\n TB New and Relapse Cured\n \n 2023-03-30 15:04:42 UTC\n \n 2023-03-30 15:06: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 1972\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:04:42',4,'2023-03-30 17:06:17',4,0,NULL,NULL,NULL,'22e1906b-16cd-4109-b529-a043e43ff3d4'),(1973,'TB New and Relapse Died','TB New and Relapse Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Died\n TB New and Relapse Died\n \n 2023-03-30 15:08:32 UTC\n \n 2023-03-30 15:09: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 1973\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:08:32',4,'2023-03-30 17:09:15',4,0,NULL,NULL,NULL,'19636929-afd0-4ba0-acfa-bbe325e1f002'),(1974,'TB New and Relapse Lost to Follow-up','TB New and Relapse 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 TB New and Relapse Lost to Follow-up\n TB New and Relapse Lost to Follow-up\n \n 2023-03-30 15:10:23 UTC\n \n 2023-03-30 15:10: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 1974\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:10:23',4,'2023-03-30 17:10:58',4,0,NULL,NULL,NULL,'87260731-779f-4244-9480-f75169dd2fbf'),(1975,'TB New and Relapse Failed (Susceptible)','TB New and Relapse Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Failed (Susceptible)\n TB New and Relapse Failed (Susceptible)\n \n 2023-03-30 15:11:55 UTC\n \n 2023-03-30 15:31: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 1975\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:11:55',4,'2023-03-30 17:31:39',4,0,NULL,NULL,NULL,'53aec520-fab0-4871-b46f-209c32b921c1'),(1976,'TB New and Relapse Not Evaluated','TB New and Relapse Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Not Evaluated\n TB New and Relapse Not Evaluated\n \n 2023-03-30 15:13:29 UTC\n \n 2023-03-30 16:05: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 1976\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:13:29',4,'2023-03-30 18:05:12',4,0,NULL,NULL,NULL,'0af163fd-0d3c-4b6a-a84e-1648cd9bb042'),(1977,'exMiner_cured','Ex miner cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_cured\n Ex miner cured\n \n 2023-03-30 15:21:40 UTC\n \n 2023-03-30 15:47:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 1977\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 1068 \n and b.voided = 0 \n ) \n\n','2023-03-30 17:21:40',4,'2023-03-30 17:47:23',4,0,NULL,NULL,NULL,'4c2c88ec-ee4e-4bad-962d-229983982f12'),(1978,'exMiner_completed','Ex miner completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_completed\n Ex miner completed\n \n 2023-03-30 15:24:54 UTC\n \n 2023-03-30 15:45: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 1978\n select distinct o.person_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 CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 2242 \n and b.voided = 0 \n ) \n\n','2023-03-30 17:24:54',4,'2023-03-30 17:45:56',4,0,NULL,NULL,NULL,'37afe774-0ef1-4152-8ab9-fe702f175f36'),(1979,'exMiner_died','Ex Miner died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_died\n Ex Miner died\n \n 2023-03-30 15:28:17 UTC\n \n 2023-04-03 07:35: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 1979\n select distinct o.person_id \n \n \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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 3650 and b.voided = 0 \n ) \n\n','2023-03-30 17:28:17',4,'2023-04-03 09:35:05',4,0,NULL,NULL,NULL,'d08b3fb0-d1c2-455d-89a6-f3c9a1469a3e'),(1980,'TB New and Relapse Completed Moved to second line treatment','TB New and Relapse Completed Moved to second line treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Completed Moved to second line treatment\n TB New and Relapse Completed Moved to second line treatment\n \n 2023-03-30 15:33:00 UTC\n \n 2023-03-30 15:33: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 1980\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(New AND Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (1034,1084) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:33:00',4,'2023-03-30 17:33:47',4,0,NULL,NULL,NULL,'d2ff18e1-1cf3-4bff-9796-e35aaf019b40'),(1981,'exMiner_failedSusceptive','Ex miner failed suceptive','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_failedSusceptive\n Ex miner failed suceptive\n \n 2023-03-30 15:40:13 UTC\n \n 2023-04-03 10:56: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 1981\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 3793 \n and b.voided = 0 \n ) \n\n','2023-03-30 17:40:13',4,'2023-04-03 12:56:48',4,0,NULL,NULL,NULL,'8c7c6720-c1aa-492a-be1b-47edc57cfd55'),(1982,'exMiner_lost','Ex miner lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_lost\n Ex miner lost\n \n 2023-03-30 15:42:32 UTC\n \n 2023-03-30 15:49: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 1982\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 2302 \n and b.voided = 0 \n ) \n\n','2023-03-30 17:42:32',4,'2023-03-30 17:49:29',4,0,NULL,NULL,NULL,'cb57dd5b-22ae-42d9-a86a-6927e9aae9cb'),(1983,'TB Retreatment excluding Relapse and Completed','TB Retreatment excluding Relapse and Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Retreatment excluding Relapse and Completed\n TB Retreatment excluding Relapse and Completed\n \n 2023-03-30 15:43:38 UTC\n \n 2023-03-30 15:44: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 1983\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:43:38',4,'2023-03-30 17:44:32',4,0,NULL,NULL,NULL,'93eefc43-0eba-4a27-8d7e-72958dc0b2f1'),(1984,'exMiner_movedSecondLIne','Ex miner moved to second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_movedSecondLIne\n Ex miner moved to second line\n \n 2023-03-30 15:44:13 UTC\n \n 2023-03-30 15:44: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 1984\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded = 3794 \n and b.voided = 0 \n ) \n\n','2023-03-30 17:44:13',4,'2023-03-30 17:44:34',4,0,NULL,NULL,NULL,'846e0252-747b-4457-b0f4-6f23ed244706'),(1985,'TB Retreatment excluding Relapse and Cured','TB Retreatment excluding Relapse and Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Retreatment excluding Relapse and Cured\n TB Retreatment excluding Relapse and Cured\n \n 2023-03-30 15:45:00 UTC\n \n 2023-03-30 15:45: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 1985\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:45:00',4,'2023-03-30 17:45:29',4,0,NULL,NULL,NULL,'1cd8596a-21ba-4a7b-b3c6-c82fb756bf8f'),(1986,'TB Retreatment excluding Relapse and Died','TB Retreatment excluding Relapse and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Retreatment excluding Relapse and Died\n TB Retreatment excluding Relapse and Died\n \n 2023-03-30 15:45:57 UTC\n \n 2023-03-30 15:46: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 1986\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:45:57',4,'2023-03-30 17:46:22',4,0,NULL,NULL,NULL,'50001a13-545a-4de2-9617-86c8b262eb9d'),(1987,'TB Retreatment excluding Relapse and Lost to Follow up','TB Retreatment excluding Relapse and 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 TB Retreatment excluding Relapse and Lost to Follow up\n TB Retreatment excluding Relapse and Lost to Follow up\n \n 2023-03-30 15:47:18 UTC\n \n 2023-03-30 15:47: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 1987\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:47:18',4,'2023-03-30 17:47:57',4,0,NULL,NULL,NULL,'46fbbe80-0f0e-4cf5-8f4d-04444b70d3bc'),(1988,'TB Retreatment excluding Relapse and Failed (Susceptible)','TB Retreatment excluding Relapse and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Retreatment excluding Relapse and Failed (Susceptible)\n TB Retreatment excluding Relapse and Failed (Susceptible)\n \n 2023-03-30 15:49:14 UTC\n \n 2023-03-30 15:49: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 1988\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:49:14',4,'2023-03-30 17:49:46',4,0,NULL,NULL,NULL,'0b97c9a2-f4f0-460c-9a6a-943f0d0b9bac'),(1989,'TB Retreatment excluding Relapse and Not Evaluated','TB Retreatment excluding Relapse and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Retreatment excluding Relapse and Not Evaluated\n TB Retreatment excluding Relapse and Not Evaluated\n \n 2023-03-30 15:51:27 UTC\n \n 2023-03-30 16:03: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 1989\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- TB History of previous treatment(Retreatment Excluding Relapse) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 17:51:27',4,'2023-03-30 18:03:56',4,0,NULL,NULL,NULL,'36e8a6f3-f70c-4d36-ab76-87fba12b426b'),(1990,'exMiner_notEvaluated','Ex miner not evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n exMiner_notEvaluated\n Ex miner not evaluated\n \n 2023-03-30 15:53:42 UTC\n \n 2023-03-30 16:13: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 1990\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3668 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 17:53:42',4,'2023-03-30 18:13:01',4,0,NULL,NULL,NULL,'af666d60-a3d1-4f0f-8ac2-1ea8fddbf8cd'),(1991,'FactoryWorker_notEvaluated','Factory worker not evaluated ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_notEvaluated\n Factory worker not evaluated \n \n 2023-03-30 16:17:17 UTC\n \n 2023-03-30 16: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 1991\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:17:17',4,'2023-03-30 18:18:05',4,0,NULL,NULL,NULL,'83566c8a-550c-447e-9745-0df04c89de07'),(1992,'FactoryWorker_curred','Factory worker curred','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_curred\n Factory worker curred\n \n 2023-03-30 16:18:46 UTC\n \n 2023-03-30 16:19: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 1992\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:18:46',4,'2023-03-30 18:19:13',4,0,NULL,NULL,NULL,'40dd9f46-8d30-4426-bffd-0eb772046374'),(1993,'All TB HIV Pos and Completed ','All TB HIV Pos and Completed ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Completed \n All TB HIV Pos and Completed \n \n 2023-03-30 16:19:51 UTC\n \n 2023-03-30 16:20: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 1993\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:19:51',4,'2023-03-30 18:20:08',4,0,NULL,NULL,NULL,'6b7c8fdf-00e6-4f52-b0fe-fab2cd9cc15e'),(1994,'FactoryWorker_completed','Factory worker copleted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_completed\n Factory worker copleted\n \n 2023-03-30 16:19:51 UTC\n \n 2023-03-30 16:20: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 1994\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:19:51',4,'2023-03-30 18:20:13',4,0,NULL,NULL,NULL,'4fb972d7-5378-4413-8faf-e9dfc9454cd6'),(1995,'All TB HIV Pos and Cured','All TB HIV Pos and Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Cured\n All TB HIV Pos and Cured\n \n 2023-03-30 16:20:26 UTC\n \n 2023-03-30 16:20: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 1995\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:20:26',4,'2023-03-30 18:20:55',4,0,NULL,NULL,NULL,'5bd61f52-4224-4de9-82cd-2c6334f665b1'),(1996,'FactoryWorker_died','Factory worker died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_died\n Factory worker died\n \n 2023-03-30 16:21:09 UTC\n \n 2023-03-30 16:21: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 1996\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:21:09',4,'2023-03-30 18:21:24',4,0,NULL,NULL,NULL,'f4cf99eb-4bb4-45c0-a403-086fd4b51c44'),(1997,'All TB HIV Pos and Died','All TB HIV Pos and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Died\n All TB HIV Pos and Died\n \n 2023-03-30 16:21:20 UTC\n \n 2023-03-30 16:21: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 1997\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:21:20',4,'2023-03-30 18:21:50',4,0,NULL,NULL,NULL,'b41362c1-57e7-48a0-99ed-a6241cd9fb3d'),(1998,'FactoryWorker_lost','Factort worker 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 FactoryWorker_lost\n Factort worker lost to follow up\n \n 2023-03-30 16:22:18 UTC\n \n 2023-03-30 16:22: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 1998\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:22:18',4,'2023-03-30 18:22:39',4,0,NULL,NULL,NULL,'f915f74e-1e06-4639-9070-6d1fa301b432'),(1999,'All TB HIV Pos and Lost to Follow up','All TB HIV Pos and 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 All TB HIV Pos and Lost to Follow up\n All TB HIV Pos and Lost to Follow up\n \n 2023-03-30 16:22:31 UTC\n \n 2023-03-30 16:22: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 1999\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:22:31',4,'2023-03-30 18:22:58',4,0,NULL,NULL,NULL,'16efd94d-da75-4a5c-8ca9-6364f2fc8396'),(2000,'All TB HIV Pos and Failed (Susceptible)','All TB HIV Pos and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Failed (Susceptible)\n All TB HIV Pos and Failed (Susceptible)\n \n 2023-03-30 16:23:33 UTC\n \n 2023-03-30 16:24: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 2000\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:23:33',4,'2023-03-30 18:24:00',4,0,NULL,NULL,NULL,'4dc42500-c285-4548-92ff-842d1b357342'),(2001,'prison_worker_lost','Prison worker lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_lost\n Prison worker lost\n \n 2023-03-30 16:24:03 UTC\n \n 2023-03-30 16:24: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 2001\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3779 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:24:03',4,'2023-03-30 18:24:36',4,0,NULL,NULL,NULL,'624478ae-cc98-4b93-b138-4e619755b41a'),(2002,'All TB HIV Pos and Not Evaluated','All TB HIV Pos and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Not Evaluated\n All TB HIV Pos and Not Evaluated\n \n 2023-03-30 16:24:48 UTC\n \n 2023-03-30 16:26: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 2002\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:24:48',4,'2023-03-30 18:26:26',4,0,NULL,NULL,NULL,'4fe00951-413a-468e-ac7e-016dcf41bed6'),(2003,'FactoryWorker_moved','Facotory worker moved to second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_moved\n Facotory worker moved to second line\n \n 2023-03-30 16:26:31 UTC\n \n 2023-03-30 16:34: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 2003\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:26:31',4,'2023-03-30 18:34:39',4,0,NULL,NULL,NULL,'1a7a972b-4113-414d-8810-46c8df8137e7'),(2004,'All TB HIV Pos and Moved to Secondline','All TB HIV Pos and Moved to Secondline','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Pos and Moved to Secondline\n All TB HIV Pos and Moved to Secondline\n \n 2023-03-30 16:27:16 UTC\n \n 2023-03-30 16:27: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 2004\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Positives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4323,4664) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:27:16',4,'2023-03-30 18:27:43',4,0,NULL,NULL,NULL,'57ddf49d-b53d-48ce-a67d-3ce6398f3e2c'),(2005,'All TB HIV Neg and Completed','All TB HIV Neg and Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Completed\n All TB HIV Neg and Completed\n \n 2023-03-30 16:29:02 UTC\n \n 2023-03-30 16:30: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 2005\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:29:02',4,'2023-03-30 18:30:27',4,0,NULL,NULL,NULL,'63a92814-2f34-4018-b7d0-47659892369d'),(2006,'All TB HIV Neg and Cured','All TB HIV Neg and Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Cured\n All TB HIV Neg and Cured\n \n 2023-03-30 16:30:51 UTC\n \n 2023-03-30 16:31: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 2006\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:30:51',4,'2023-03-30 18:31:17',4,0,NULL,NULL,NULL,'8e552272-4654-43bb-b1af-20affab2de14'),(2007,'All TB HIV Neg and Died','All TB HIV Neg and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Died\n All TB HIV Neg and Died\n \n 2023-03-30 16:31:44 UTC\n \n 2023-03-30 16:32: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 2007\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:31:44',4,'2023-03-30 18:32:11',4,0,NULL,NULL,NULL,'3463adc8-19aa-4cc0-9daf-32ea09e0c1f0'),(2008,'All TB HIV Neg and Lost to Follow up','All TB HIV Neg and 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 All TB HIV Neg and Lost to Follow up\n All TB HIV Neg and Lost to Follow up\n \n 2023-03-30 16:32:59 UTC\n \n 2023-03-30 16:33: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 2008\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:32:59',4,'2023-03-30 18:33:27',4,0,NULL,NULL,NULL,'06a5ff53-1949-444e-80b5-f4c99b38d5b1'),(2009,'All TB HIV Neg and Failed (Susceptible)','All TB HIV Neg and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Failed (Susceptible)\n All TB HIV Neg and Failed (Susceptible)\n \n 2023-03-30 16:34:17 UTC\n \n 2023-03-30 16:35: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 2009\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:34:17',4,'2023-03-30 18:35:01',4,0,NULL,NULL,NULL,'2ac7e18e-061b-4b34-bb63-63a2ec622a2b'),(2010,'All TB HIV Neg and Not Evaluated','All TB HIV Neg and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Not Evaluated\n All TB HIV Neg and Not Evaluated\n \n 2023-03-30 16:35:36 UTC\n \n 2023-03-30 16:37: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 2010\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:35:36',4,'2023-03-30 18:37:02',4,0,NULL,NULL,NULL,'c78c5a10-a320-43ce-b943-f9286e22ad1e'),(2011,'prison_worker_moved','Prison worker moved to second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_moved\n Prison worker moved to second line\n \n 2023-03-30 16:35:49 UTC\n \n 2023-03-30 16:36: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 2011\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3779 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:35:49',4,'2023-03-30 18:36:29',4,0,NULL,NULL,NULL,'76d5be40-a7e3-4f4f-968a-0346d0bd6513'),(2012,'prison_worker_died','Prison worker died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_died\n Prison worker died\n \n 2023-03-30 16:37:07 UTC\n \n 2023-03-30 16:37: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 2012\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3776 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:37:07',4,'2023-03-30 18:37:38',4,0,NULL,NULL,NULL,'c9a54e7c-34d1-4a1b-9214-0b9fa6eb6976'),(2013,'All TB HIV Neg and Moved to Secondline Treatment','All TB HIV Neg and Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Neg and Moved to Secondline Treatment\n All TB HIV Neg and Moved to Secondline Treatment\n \n 2023-03-30 16:37:41 UTC\n \n 2023-03-30 16:38: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 2013\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All HIV Negatives \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 4666 and o.value_coded in (4324,4665) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:37:41',4,'2023-03-30 18:38:53',4,0,NULL,NULL,NULL,'2de9ce1c-6a79-43fe-ab19-1b9c9d2865d4'),(2014,'prison_worker_completed','Prison worker completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_completed\n Prison worker completed\n \n 2023-03-30 16:38:29 UTC\n \n 2023-03-30 16:38: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 2014\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3776 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:38:29',4,'2023-03-30 18:38:53',4,0,NULL,NULL,NULL,'9e174142-2794-43fc-95dd-9f3f92e4b379'),(2015,'prison_worker_curred','Prion worker curred','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_curred\n Prion worker curred\n \n 2023-03-30 16:40:22 UTC\n \n 2023-03-30 16:43:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2015\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3776 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:40:22',4,'2023-03-30 18:43:23',4,0,NULL,NULL,NULL,'91f85b53-7dca-4730-a391-5198293d1cf9'),(2016,'All Childred and Completed','All Childred and Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Completed\n All Childred and Completed\n \n 2023-03-30 16:43:19 UTC\n \n 2023-03-30 16:46: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 2016\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:43:19',4,'2023-03-30 18:46:26',4,0,NULL,NULL,NULL,'f300ef4e-70b5-4c81-b993-7d45d23f299e'),(2017,'prison_worker_notEvaluated','Prison worker not evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_notEvaluated\n Prison worker not evaluated\n \n 2023-03-30 16:46:21 UTC\n \n 2023-03-30 16:46: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 2017\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3776 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:46:21',4,'2023-03-30 18:46:41',4,0,NULL,NULL,NULL,'1c0c7eab-e438-4787-982a-bfb448fe7455'),(2018,'All Childred and Cured','All Childred and Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Cured\n All Childred and Cured\n \n 2023-03-30 16:46:51 UTC\n \n 2023-03-30 16:47: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 2018\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:46:51',4,'2023-03-30 18:47:08',4,0,NULL,NULL,NULL,'1f8f36b9-85d6-4e32-b078-6c7e098974b1'),(2019,'All Childred and Died','All Childred and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Died\n All Childred and Died\n \n 2023-03-30 16:47:31 UTC\n \n 2023-03-30 16:48: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 2019\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:47:31',4,'2023-03-30 18:48:00',4,0,NULL,NULL,NULL,'dd4822a7-86eb-4579-acda-bf0ff242eef5'),(2020,'health_worker_notEvaluated','Health worker not evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_notEvaluated\n Health worker not evaluated\n \n 2023-03-30 16:47:35 UTC\n \n 2023-03-30 16:48: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 2020\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:47:35',4,'2023-03-30 18:48:03',4,0,NULL,NULL,NULL,'5d8bdedf-fc1e-46f8-b417-908519f3e645'),(2021,'All Childred and Lost to Follow up','All Childred and 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 All Childred and Lost to Follow up\n All Childred and Lost to Follow up\n \n 2023-03-30 16:48:38 UTC\n \n 2023-03-30 16:49: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 2021\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:48:38',4,'2023-03-30 18:49:04',4,0,NULL,NULL,NULL,'2665ef1b-edbd-4c9d-b9f6-3d2d2cc3b0ad'),(2022,'health_worker_curred','Health worker curred','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_curred\n Health worker curred\n \n 2023-03-30 16:48:53 UTC\n \n 2023-03-30 16:49: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 2022\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:48:53',4,'2023-03-30 18:49:19',4,0,NULL,NULL,NULL,'63064b04-2cce-4944-b53d-ddb2cdce8a2d'),(2023,'All Childred and Failed (Susceptible)','All Childred and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Failed (Susceptible)\n All Childred and Failed (Susceptible)\n \n 2023-03-30 16:49:34 UTC\n \n 2023-03-30 16:50: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 2023\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:49:34',4,'2023-03-30 18:50:01',4,0,NULL,NULL,NULL,'1b710ad4-75b5-4b64-b916-1806dca0013d'),(2024,'health_worker_completed','Health worker completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_completed\n Health worker completed\n \n 2023-03-30 16:49:56 UTC\n \n 2023-04-03 20:37: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 2024\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:49:56',4,'2023-04-03 22:37:45',4,0,NULL,NULL,NULL,'6555808c-1103-4a6d-b13f-fd0fad7ff09f'),(2025,'All Childred and Not evaluated','All Childred and Not evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Not evaluated\n All Childred and Not evaluated\n \n 2023-03-30 16:50:30 UTC\n \n 2023-03-30 16:51: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 2025\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3794,3793) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:50:30',4,'2023-03-30 18:51:54',4,0,NULL,NULL,NULL,'1b9b16cf-f254-43b5-b952-4d54f431ae49'),(2026,'health_worker_died','Healh worker died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_died\n Healh worker died\n \n 2023-03-30 16:50:46 UTC\n \n 2023-03-30 16:51: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 2026\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:50:46',4,'2023-03-30 18:51:00',4,0,NULL,NULL,NULL,'e9c9f85f-123c-4b2f-9951-7b8c2be340af'),(2027,'health_worker_lost','Health worker lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_lost\n Health worker lost\n \n 2023-03-30 16:51:39 UTC\n \n 2023-03-30 16:51: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 2027\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:51:39',4,'2023-03-30 18:51:55',4,0,NULL,NULL,NULL,'8b70ced1-8219-4206-b7ec-10c0242808c4'),(2028,'All Childred and Moved to Secondline Treatment','All Childred and Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All Childred and Moved to Secondline Treatment\n All Childred and Moved to Secondline Treatment\n \n 2023-03-30 16:52:27 UTC\n \n 2023-03-30 16:53: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 2028\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Children \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 15 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:52:27',4,'2023-03-30 18:53:11',4,0,NULL,NULL,NULL,'143c95e1-ae28-460c-92c2-3807e30dc704'),(2029,'health_worker_moved','Health worker moved to second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_moved\n Health worker moved to second line\n \n 2023-03-30 16:52:49 UTC\n \n 2023-03-30 16:55: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 2029\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3667 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:52:49',4,'2023-03-30 18:55:13',4,0,NULL,NULL,NULL,'3a04d202-b320-463e-a233-40887022bfea'),(2030,'All TB Adolescent (10-19 yrs) and Completed ','All TB Adolescent (10-19 yrs) and Completed ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Completed \n All TB Adolescent (10-19 yrs) and Completed \n \n 2023-03-30 16:55:50 UTC\n \n 2023-03-30 16:56: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 2030\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:55:50',4,'2023-03-30 18:56:27',4,0,NULL,NULL,NULL,'788061f8-b372-4d67-b493-c20b96b948bf'),(2031,'public_transport_Moved','Public Transport move to second line','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_Moved\n Public Transport move to second line\n \n 2023-03-30 16:55:50 UTC\n \n 2023-03-30 16:56: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 2031\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:55:50',4,'2023-03-30 18:56:22',4,0,NULL,NULL,NULL,'c2e7a54e-80e6-4535-a09f-32d93e8ce902'),(2032,'All TB Adolescent (10-19 yrs) and cured','All TB Adolescent (10-19 yrs) and cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and cured\n All TB Adolescent (10-19 yrs) and cured\n \n 2023-03-30 16:56:54 UTC\n \n 2023-03-30 16:57: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 2032\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:56:54',4,'2023-03-30 18:57:31',4,0,NULL,NULL,NULL,'e620cd1b-bbe2-4c3d-93bb-fcbdc8b34d84'),(2033,'public_transport_lost','Public transport Lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_lost\n Public transport Lost\n \n 2023-03-30 16:57:13 UTC\n \n 2023-03-30 16:57: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 2033\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:57:13',4,'2023-03-30 18:57:37',4,0,NULL,NULL,NULL,'0cc2e2d8-4cab-45c7-9b04-67c8bfd1bbfa'),(2034,'All TB Adolescent (10-19 yrs) and Died','All TB Adolescent (10-19 yrs) and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Died\n All TB Adolescent (10-19 yrs) and Died\n \n 2023-03-30 16:57:52 UTC\n \n 2023-03-30 16:58: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 2034\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:57:52',4,'2023-03-30 18:58:21',4,0,NULL,NULL,NULL,'53ef1628-fe11-4b21-bab5-897e27196e04'),(2035,'public_transport_died','Public transport died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_died\n Public transport died\n \n 2023-03-30 16:58:17 UTC\n \n 2023-03-30 16:58: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 2035\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:58:17',4,'2023-03-30 18:58:34',4,0,NULL,NULL,NULL,'bbc25dd6-f8ff-4c55-84e8-efd76d0ac281'),(2036,'All TB Adolescent (10-19 yrs) and Lost to Follow up','All TB Adolescent (10-19 yrs) and 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 All TB Adolescent (10-19 yrs) and Lost to Follow up\n All TB Adolescent (10-19 yrs) and Lost to Follow up\n \n 2023-03-30 16:58:49 UTC\n \n 2023-03-30 16:59: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 2036\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:58:49',4,'2023-03-30 18:59:12',4,0,NULL,NULL,NULL,'509944d6-5988-405c-8aee-8a9329e1e141'),(2037,'public_transport_completed','Public transport completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_completed\n Public transport completed\n \n 2023-03-30 16:59:27 UTC\n \n 2023-03-30 17:00: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 2037\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 18:59:27',4,'2023-03-30 19:00:28',4,0,NULL,NULL,NULL,'d9a7884a-eabd-43cc-9757-64ae74a3cb9c'),(2038,'All TB Adolescent (10-19 yrs) and Failed (Susceptible)','All TB Adolescent (10-19 yrs) and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Failed (Susceptible)\n All TB Adolescent (10-19 yrs) and Failed (Susceptible)\n \n 2023-03-30 16:59:52 UTC\n \n 2023-03-30 17:00: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 2038\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 18:59:52',4,'2023-03-30 19:00:27',4,0,NULL,NULL,NULL,'dd3ac915-529a-44c4-b086-fe9e21bc7553'),(2039,'All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n \n 2023-03-30 17:01:19 UTC\n \n 2023-03-30 17:01: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 2039\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:01:19',4,'2023-03-30 19:01:41',4,0,NULL,NULL,NULL,'216e1e3c-eed7-4802-96bb-fe3256161a08'),(2040,'public_transport_curred','Public transport curred','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_curred\n Public transport curred\n \n 2023-03-30 17:01:20 UTC\n \n 2023-03-30 17:01: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 2040\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:01:20',4,'2023-03-30 19:01:41',4,0,NULL,NULL,NULL,'faf660cd-1ef3-48a9-86d5-805f14b23465'),(2041,'All TB Adolescent (10-19 yrs) and Not Evaluated','All TB Adolescent (10-19 yrs) and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Not Evaluated\n All TB Adolescent (10-19 yrs) and Not Evaluated\n \n 2023-03-30 17:02:10 UTC\n \n 2023-03-30 17:03: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 2041\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- All Adolescent (10-19 yrs) \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) < 20 \n and floor(datediff(CAST(:endDate AS DATE), person.birthdate)/365) > 9 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3794,3793) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:02:10',4,'2023-03-30 19:03:44',4,0,NULL,NULL,NULL,'8fcd3cec-a879-4240-888f-42575228b47d'),(2042,'public_transport_notEvaluated','Public transport note evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_notEvaluated\n Public transport note evaluated\n \n 2023-03-30 17:02:53 UTC\n \n 2023-03-30 17: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 2042\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:02:53',4,'2023-03-30 19:03:45',4,0,NULL,NULL,NULL,'7037beac-7eba-4b7f-a3b7-6636d1d435bd'),(2043,'TB Females and Completed','TB Females and Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Completed\n TB Females and Completed\n \n 2023-03-30 17:07:55 UTC\n \n 2023-03-30 17:08: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 2043\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:07:55',4,'2023-03-30 19:08:14',4,0,NULL,NULL,NULL,'82abec75-7c2a-4607-b3b1-b3ef5c6c4361'),(2044,'TB Females and Cured','TB Females and Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Cured\n TB Females and Cured\n \n 2023-03-30 17:08:50 UTC\n \n 2023-03-30 17:09: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 2044\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:08:50',4,'2023-03-30 19:09:12',4,0,NULL,NULL,NULL,'f746ec4b-a949-4b53-86c8-4e1a71843d72'),(2045,'HHCM_notEvaluated','HHCM Note Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_notEvaluated\n HHCM Note Evaluated\n \n 2023-03-30 17:09:07 UTC\n \n 2023-03-30 17:09: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 2045\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:09:07',4,'2023-03-30 19:09:44',4,0,NULL,NULL,NULL,'d8caa7dd-326a-46f7-97ee-f7205689bfda'),(2046,'HHCM_curred','HHCM Curred','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_curred\n HHCM Curred\n \n 2023-03-30 17:10:16 UTC\n \n 2023-03-30 17:10: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 2046\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:10:16',4,'2023-03-30 19:10:39',4,0,NULL,NULL,NULL,'ea1cc81f-9ccc-4401-80e9-57a84da98f58'); -INSERT INTO `serialized_object` VALUES (2047,'TB Females and Died','TB Females and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Died\n TB Females and Died\n \n 2023-03-30 17:11:17 UTC\n \n 2023-03-30 17:11: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 2047\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:11:17',4,'2023-03-30 19:11:45',4,0,NULL,NULL,NULL,'f55690e5-8b8d-43ce-b797-f0f8707d1222'),(2048,'HHCM_completed','HHCM Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_completed\n HHCM Completed\n \n 2023-03-30 17:12:02 UTC\n \n 2023-03-30 17:12: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 2048\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:12:02',4,'2023-03-30 19:12:21',4,0,NULL,NULL,NULL,'7dbf3689-913d-4883-ae4b-5be2aee4ba37'),(2049,'TB Females and Lost to Follow up','TB Females and 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 TB Females and Lost to Follow up\n TB Females and Lost to Follow up\n \n 2023-03-30 17:12:17 UTC\n \n 2023-03-30 17:13: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 2049\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:12:17',4,'2023-03-30 19:13:14',4,0,NULL,NULL,NULL,'71a12f10-af92-4eba-88f2-176a2cb3ae14'),(2050,'HHCM_died','HHCM Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_died\n HHCM Died\n \n 2023-03-30 17:12:43 UTC\n \n 2023-03-30 17: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 2050\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:12:43',4,'2023-03-30 19:13:08',4,0,NULL,NULL,NULL,'87c6de2e-d87a-430b-a15e-d5de45e36410'),(2051,'HHCM_lost','HHCM Lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_lost\n HHCM Lost\n \n 2023-03-30 17:13:35 UTC\n \n 2023-03-30 17:14: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 2051\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:13:35',4,'2023-03-30 19:14:00',4,0,NULL,NULL,NULL,'543f25df-61ec-4cec-847f-816fec3268ec'),(2052,'TB Females and Failed (Susceptible)','TB Females and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Failed (Susceptible)\n TB Females and Failed (Susceptible)\n \n 2023-03-30 17:14:08 UTC\n \n 2023-03-30 17:14: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 2052\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:14:08',4,'2023-03-30 19:14:24',4,0,NULL,NULL,NULL,'d1085653-8aca-440b-ae5c-d899217ef3b5'),(2053,'HHCM_moved','HHCM Moved','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_moved\n HHCM Moved\n \n 2023-03-30 17:14:34 UTC\n \n 2023-03-30 17:14: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 2053\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:14:34',4,'2023-03-30 19:14:52',4,0,NULL,NULL,NULL,'43bc5260-c525-4968-a427-01e7febdfef1'),(2054,'TB Females and Moved to SecondLine','TB Females and Moved to SecondLine','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Moved to SecondLine\n TB Females and Moved to SecondLine\n \n 2023-03-30 17:14:53 UTC\n \n 2023-03-30 17:15: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 2054\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:14:53',4,'2023-03-30 19:15:09',4,0,NULL,NULL,NULL,'56836385-8ef8-49a4-bdc7-e7ac24baadb9'),(2055,'TB Females and Not Evaluated','TB Females and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Not Evaluated\n TB Females and Not Evaluated\n \n 2023-03-30 17:15:40 UTC\n \n 2023-03-30 17:16: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 2055\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:15:40',4,'2023-03-30 19:16:46',4,0,NULL,NULL,NULL,'d1ccfc19-7910-4d71-8ba4-1b31cfbc17b7'),(2056,'FactoryWorker_failed','Factory worker failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_failed\n Factory worker failed\n \n 2023-04-03 07:36:11 UTC\n \n 2023-04-03 07:53: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 2056\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:36:11',4,'2023-04-03 09:53:38',4,0,NULL,NULL,NULL,'43e35844-a8eb-4cc5-a3cd-445a052316c2'),(2057,'prison_worker_failed','Prison worker failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_failed\n Prison worker failed\n \n 2023-04-03 07:55:07 UTC\n \n 2023-04-03 07:56: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 2057\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3779 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:55:07',4,'2023-04-03 09:56:27',4,0,NULL,NULL,NULL,'a4dd9267-3676-4a8b-b56b-65b8683f1ba6'),(2058,'health_worker_failed','Health Worker Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_failed\n Health Worker Failed\n \n 2023-04-03 07:57:33 UTC\n \n 2023-04-03 07:58: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 2058\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3670 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:57:33',4,'2023-04-03 09:58:07',4,0,NULL,NULL,NULL,'da9db0e3-0d78-489c-bd35-eb7c68e345d0'),(2059,'public_transport_failed','Public Transport Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_failed\n Public Transport Failed\n \n 2023-04-03 07:58:45 UTC\n \n 2023-04-03 07:59: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 2059\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:58:45',4,'2023-04-03 09:59:38',4,0,NULL,NULL,NULL,'33f5b01b-0001-4fbd-8d76-43b6616c4824'),(2060,'HHCM_failed','HHCM Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_failed\n HHCM Failed\n \n 2023-04-03 09:18:29 UTC\n \n 2023-04-03 09:19: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 2060\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:18:29',4,'2023-04-03 11:19:51',4,0,NULL,NULL,NULL,'60d6cef7-079a-4825-b6e1-cb4eb655b864'),(2061,'Mine Workers Cured','Mine Workers Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Cured\n Mine Workers Cured\n \n 2023-04-03 09:18:52 UTC\n \n 2023-04-04 12:32: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 2061\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:18:52',4,'2023-04-04 14:32:36',4,0,NULL,NULL,NULL,'9fffbcb9-e2f8-43d2-b6ae-b257c80ff52c'),(2062,'Mine Workers Completed','Mine Workers Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Completed\n Mine Workers Completed\n \n 2023-04-03 09:20:24 UTC\n \n 2023-04-04 12: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 2062\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:20:24',4,'2023-04-04 14:31:40',4,0,NULL,NULL,NULL,'22a95602-7db7-453f-8af1-d3314651365b'),(2063,'HHXM_completed','HHXM Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_completed\n HHXM Completed\n \n 2023-04-03 09:20:26 UTC\n \n 2023-04-03 09: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 2063\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:20:26',4,'2023-04-03 11:21:05',4,0,NULL,NULL,NULL,'bc440ff8-a03c-42b4-b082-393873e19cc5'),(2064,'HHXM_failed','HHXM Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_failed\n HHXM Failed\n \n 2023-04-03 09:21:50 UTC\n \n 2023-04-03 22:08: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 2064\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:21:50',4,'2023-04-04 00:08:02',4,0,NULL,NULL,NULL,'168f05ac-dc2e-4c53-a38b-0d1ac6bc3f4c'),(2065,'Mine Workers Died','Mine Workers Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Died\n Mine Workers Died\n \n 2023-04-03 09:22:05 UTC\n \n 2023-04-04 12:33: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 2065\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:22:05',4,'2023-04-04 14:33:00',4,0,NULL,NULL,NULL,'75e3ca1f-9e04-4d1c-91ae-f79f18f650ee'),(2066,'HHXM_cured','HHXM Curred\r\n','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_cured\n HHXM Curred \n\n \n 2023-04-03 09:22:14 UTC\n \n 2023-04-03 09:22: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 2066\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:22:14',4,'2023-04-03 11:22:50',4,0,NULL,NULL,NULL,'1895c8dd-bf2c-4bd3-a48f-08770e349ffe'),(2067,'HHXM_moved','HHXM Moved','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_moved\n HHXM Moved\n \n 2023-04-03 09:24:40 UTC\n \n 2023-04-03 09: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 2067\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:24:40',4,'2023-04-03 11:27:22',4,0,NULL,NULL,NULL,'458408ac-2fc6-45e2-a884-8b8a75cf1d94'),(2068,'HHXM_lost','HHXM Lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_lost\n HHXM Lost\n \n 2023-04-03 09:26:54 UTC\n \n 2023-04-03 09:27: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 2068\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:26:54',4,'2023-04-03 11:27:10',4,0,NULL,NULL,NULL,'20694047-0786-4ce8-922b-df3b23f39c56'),(2069,'Mine Workers Lost to Follow up','Mine Workers 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 Mine Workers Lost to Follow up\n Mine Workers Lost to Follow up\n \n 2023-04-03 09:26:54 UTC\n \n 2023-04-04 12:33: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 2069\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:26:54',4,'2023-04-04 14:33:39',4,0,NULL,NULL,NULL,'9406df9e-8673-48f0-81eb-21b60a5ded97'),(2070,'hhxm_notEvaluated','HHXm Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n hhxm_notEvaluated\n HHXm Not Evaluated\n \n 2023-04-03 09:28:30 UTC\n \n 2023-04-03 09:29: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 2070\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:28:30',4,'2023-04-03 11:29:51',4,0,NULL,NULL,NULL,'0bd16759-6ff9-4cbf-a0b0-8e9fd1efd1be'),(2071,'Mine Workers Failed (Susceptible)','Mine Workers Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Failed (Susceptible)\n Mine Workers Failed (Susceptible)\n \n 2023-04-03 09:33:26 UTC\n \n 2023-04-04 12:33: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 2071\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:33:26',4,'2023-04-04 14:33:18',4,0,NULL,NULL,NULL,'4bba1fe8-13ad-4c18-b549-f0aff1e6bc3f'),(2072,'hhxm_died','HHXM Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n hhxm_died\n HHXM Died\n \n 2023-04-03 09:34:30 UTC\n \n 2023-04-03 10:13: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 2072\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:34:30',4,'2023-04-03 12:13:34',4,0,NULL,NULL,NULL,'173bca27-99d3-497c-b83f-902bd3502875'),(2073,'Mine Workers Moved to Secondline Treatment','Mine Workers Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Moved to Secondline Treatment\n Mine Workers Moved to Secondline Treatment\n \n 2023-04-03 09:36:03 UTC\n \n 2023-04-04 12:29: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 2073\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:36:03',4,'2023-04-04 14:29:57',4,0,NULL,NULL,NULL,'7f349b74-1609-4786-a666-6f26b3e0934c'),(2074,'Mine Workers Not Evaluated','Mine Workers Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Not Evaluated\n Mine Workers Not Evaluated\n \n 2023-04-03 09:39:03 UTC\n \n 2023-04-03 09:39: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 2074\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2302,3650,3793,2242,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:39:03',4,'2023-04-03 11:39:38',4,0,NULL,NULL,NULL,'3f20bdd4-03b5-48eb-be2e-3e7d96d9608f'),(2075,'New and Relapse Completed','New and Relapse Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New and Relapse Completed\n New and Relapse Completed\n \n 2023-04-03 09:46:12 UTC\n \n 2023-04-03 09:50: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 2075\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','2023-04-03 11:46:12',4,'2023-04-03 11:50:04',4,0,NULL,NULL,NULL,'bf8fffec-423b-4d4f-9082-a61937680e08'),(2076,'TB New and Relapse Cured','TB New and Relapse Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Cured\n TB New and Relapse Cured\n \n 2023-04-03 09:54:54 UTC\n \n 2023-04-03 10:09: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 2076\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','2023-04-03 11:54:54',4,'2023-04-03 12:09:07',4,0,NULL,NULL,NULL,'cc3e6b66-c906-4723-bf8b-f1e3bd9a4f48'),(2077,'TB New and Relapse Died','TB New and Relapse Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Died\n TB New and Relapse Died\n \n 2023-04-03 10:09:39 UTC\n \n 2023-04-03 10:26: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 2077\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','2023-04-03 12:09:39',4,'2023-04-03 12:26:07',4,0,NULL,NULL,NULL,'cdd51d3f-4922-459d-a23e-a62718354d0f'),(2078,'TB New and Relapse Lost to Follow-up','TB New and Relapse Lost to Follow-up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Lost to Follow-up\n TB New and Relapse Lost to Follow-up\n \n 2023-04-03 10:13:30 UTC\n \n 2023-04-03 10:22: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 2078\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','2023-04-03 12:13:30',4,'2023-04-03 12:22:25',4,0,NULL,NULL,NULL,'e63623be-d56c-4e8a-9fb8-fcbfd651b326'),(2079,'Ex Miner - Died','Ex Miner Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Died\n Ex Miner Died\n \n 2023-04-03 10:15:01 UTC\n \n 2023-04-03 10:18: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 2079\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','2023-04-03 12:15:01',4,'2023-04-03 12:18:31',4,0,NULL,NULL,NULL,'4c0567b3-bc02-4b62-be5b-4e348a8a17d5'),(2080,'Ex Miner - Lost','Ex Miner Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Lost\n Ex Miner Lost\n \n 2023-04-03 10:15:38 UTC\n \n 2023-04-03 10: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 2080\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','2023-04-03 12:15:38',4,'2023-04-03 12:20:44',4,0,NULL,NULL,NULL,'1001e669-922a-43ba-be6c-4e909e4d7f30'),(2081,'Ex Miner - Not Evaluated','Ex Miner Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Not Evaluated\n Ex Miner Not Evaluated\n \n 2023-04-03 10:16:26 UTC\n \n 2023-04-03 10:25: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 2081\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','2023-04-03 12:16:26',4,'2023-04-03 12:25:22',4,0,NULL,NULL,NULL,'95297d99-247c-4cb1-8454-8cde32e41699'),(2082,'Ex Miner - Completed','Ex Miner - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Completed\n Ex Miner - Completed\n \n 2023-04-03 10:21:16 UTC\n \n 2023-04-03 10:53: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 2082\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','2023-04-03 12:21:16',4,'2023-04-03 12:53:45',4,0,NULL,NULL,NULL,'6512f126-9e67-46ba-aaab-e783a36a4efa'),(2083,'Ex Miner - Moved Second Line','Ex Miner moved second line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Moved Second Line\n Ex Miner moved second line\n \n 2023-04-03 10:22:16 UTC\n \n 2023-04-03 10:24: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 2083\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','2023-04-03 12:22:16',4,'2023-04-03 12:24:44',4,0,NULL,NULL,NULL,'7de4354e-95cb-4f66-8d40-0bd243779ee4'),(2084,'TB New and Relapse Failed (Susceptible)','TB New and Relapse Failed (Susceptible)','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Failed (Susceptible)\n TB New and Relapse Failed (Susceptible)\n \n 2023-04-03 10:26:32 UTC\n \n 2023-04-03 11:24: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 2084\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','2023-04-03 12:26:32',4,'2023-04-03 13:24:51',4,0,NULL,NULL,NULL,'e3218a64-d243-48aa-9b9a-bbcda0104ae7'),(2085,'Ex Miner - Failed','Ex Miner - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Failed\n Ex Miner - Failed\n \n 2023-04-03 10:27:35 UTC\n \n 2023-04-03 11:24: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 2085\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','2023-04-03 12:27:35',4,'2023-04-03 13:24:34',4,0,NULL,NULL,NULL,'aa17ed03-51ed-4fde-8ad9-164f975ded80'),(2086,'TB New and Relapse Moved to second line treatment','TB New and Relapse Moved to second line treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Moved to second line treatment\n TB New and Relapse Moved to second line treatment\n \n 2023-04-03 10:27:42 UTC\n \n 2023-04-03 10:29: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 2086\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','2023-04-03 12:27:42',4,'2023-04-03 12:29:11',4,0,NULL,NULL,NULL,'687406cb-8ffe-4b7a-a806-583e78f04e48'),(2087,'Ex Miner - Cured','Ex Miner - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Cured\n Ex Miner - Cured\n \n 2023-04-03 10:28:42 UTC\n \n 2023-04-04 09:25: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 2087\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','2023-04-03 12:28:42',4,'2023-04-04 11:25:16',4,0,NULL,NULL,NULL,'6210a6de-cdbc-411c-b9fc-e6a6bf2f42bc'),(2088,'Factory Worker - Complete','Factory Worker - Complete','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Complete\n Factory Worker - Complete\n \n 2023-04-03 11:31:19 UTC\n \n 2023-04-03 11:33: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 2088\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','2023-04-03 13:31:19',4,'2023-04-03 13:33:02',4,0,NULL,NULL,NULL,'d1ce4f4f-9869-4fdd-afa5-da1899ae3815'),(2089,'Factory Worker - Cured','Factory Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Cured\n Factory Worker - Cured\n \n 2023-04-03 11:35:29 UTC\n \n 2023-04-03 11:37: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 2089\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','2023-04-03 13:35:29',4,'2023-04-03 13:37:51',4,0,NULL,NULL,NULL,'b92fab4d-1381-445b-abb1-1ba06b0957d4'),(2090,'Factory Worker - Died','Factory Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Died\n Factory Worker - Died\n \n 2023-04-03 11:37:01 UTC\n \n 2023-04-03 11:39: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 2090\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','2023-04-03 13:37:01',4,'2023-04-03 13:39:08',4,0,NULL,NULL,NULL,'ef65034d-ed9d-452d-af2f-ababeecfa6ad'),(2091,'Factory Worker - Lost','Factory Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Lost\n Factory Worker - Lost\n \n 2023-04-03 11:38:56 UTC\n \n 2023-04-03 11:58: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 2091\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','2023-04-03 13:38:56',4,'2023-04-03 13:58:59',4,0,NULL,NULL,NULL,'a9e56df4-43a7-4387-828d-10c9dfb89245'),(2092,'Factory Worker - Not Evaluated','Factory Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Not Evaluated\n Factory Worker - Not Evaluated\n \n 2023-04-03 11:43:52 UTC\n \n 2023-04-03 11:59: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 2092\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','2023-04-03 13:43:52',4,'2023-04-03 13:59:10',4,0,NULL,NULL,NULL,'77cd1821-951d-42ed-a866-5f08fd800a9c'),(2093,'TB New and Relapse Not Evaluated','TB New and Relapse Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Not Evaluated\n TB New and Relapse Not Evaluated\n \n 2023-04-03 11:45:15 UTC\n \n 2023-04-03 11:52: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 2093\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','2023-04-03 13:45:15',4,'2023-04-03 13:52:49',4,0,NULL,NULL,NULL,'8c3908aa-5ac3-4dc9-9261-cdd7fc07e365'),(2094,'Retreatment excluding Relapse Completed','Retreatment excluding Relapse Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Completed\n Retreatment excluding Relapse Completed\n \n 2023-04-03 19:27:03 UTC\n \n 2023-04-04 12:39: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 2094\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','2023-04-03 21:27:03',4,'2023-04-04 14:39:55',4,0,NULL,NULL,NULL,'f3df3cc6-11ba-4ef1-9b6b-eba700de0818'),(2095,'Factory Worker - Moved to 2nd line','Factory Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Moved to 2nd line\n Factory Worker - Moved to 2nd line\n \n 2023-04-03 19:33:19 UTC\n \n 2023-04-03 19:35: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 2095\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','2023-04-03 21:33:19',4,'2023-04-03 21:35:06',4,0,NULL,NULL,NULL,'9ac7ec7c-6fa1-4771-8cb3-bcfca51f5e4b'),(2096,'Retreatment excluding Relapse Cured','Retreatment excluding Relapse Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Cured\n Retreatment excluding Relapse Cured\n \n 2023-04-03 19:37:22 UTC\n \n 2023-04-03 19:42: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 2096\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','2023-04-03 21:37:22',4,'2023-04-03 21:42:14',4,0,NULL,NULL,NULL,'af4ccd45-738a-452f-ab0e-aa7588ecd131'),(2097,'Factory Worker - Failed','Factory Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Failed\n Factory Worker - Failed\n \n 2023-04-03 19:44:52 UTC\n \n 2023-04-03 19:49: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 2097\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','2023-04-03 21:44:52',4,'2023-04-03 21:49:24',4,0,NULL,NULL,NULL,'f353300f-5673-4742-9115-c5b0b7e398e8'),(2098,'Retreatment excluding Relapse Died','Retreatment excluding Relapse Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Died\n Retreatment excluding Relapse Died\n \n 2023-04-03 19:48:30 UTC\n \n 2023-04-03 19:51: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 2098\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','2023-04-03 21:48:30',4,'2023-04-03 21:51:58',4,0,NULL,NULL,NULL,'ae6d7e28-203a-4141-b338-0a2faadc3662'),(2099,'Prison Worker - Died','Prison Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Died\n Prison Worker - Died\n \n 2023-04-03 19:50:39 UTC\n \n 2023-04-03 19:53: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 2099\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','2023-04-03 21:50:39',4,'2023-04-03 21:53:44',4,0,NULL,NULL,NULL,'93b06207-6e95-4711-aa58-31c3a88ef1c0'),(2100,'Prison Worker - Cured','Prison Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Cured\n Prison Worker - Cured\n \n 2023-04-03 19:53:11 UTC\n \n 2023-04-03 19:54: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 2100\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','2023-04-03 21:53:11',4,'2023-04-03 21:54:43',4,0,NULL,NULL,NULL,'2f32e1d7-b41d-4bb7-89a3-80c3243e4948'),(2101,'Retreatment excluding Relapse Lost to follow up','Retreatment excluding Relapse Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Lost to follow up\n Retreatment excluding Relapse Lost to follow up\n \n 2023-04-03 19:53:33 UTC\n \n 2023-04-03 19:55: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 2101\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','2023-04-03 21:53:33',4,'2023-04-03 21:55:20',4,0,NULL,NULL,NULL,'e5c0a844-b04b-40b4-99a4-32232d7a740e'),(2102,'Prison Worker - Completed','Prison Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Completed\n Prison Worker - Completed\n \n 2023-04-03 19:55:01 UTC\n \n 2023-04-03 20:00: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 2102\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','2023-04-03 21:55:01',4,'2023-04-03 22:00:15',4,0,NULL,NULL,NULL,'a4e75f76-e839-46af-bdc6-8218f3df823c'),(2103,'Retreatment excluding Relapse Failed','Retreatment excluding Relapse Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Failed\n Retreatment excluding Relapse Failed\n \n 2023-04-03 19:57:02 UTC\n \n 2023-04-03 20:01: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 2103\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','2023-04-03 21:57:02',4,'2023-04-03 22:01:44',4,0,NULL,NULL,NULL,'abea75a9-417c-4570-a63e-5739c02c765e'),(2104,'Prison Worker - Not Evaluated','Prison Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Not Evaluated\n Prison Worker - Not Evaluated\n \n 2023-04-03 19:59:02 UTC\n \n 2023-04-03 20:00: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 2104\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','2023-04-03 21:59:02',4,'2023-04-03 22:00:31',4,0,NULL,NULL,NULL,'5f8c563b-7314-4359-8bb4-4f9d51fe2257'),(2105,'TB Treatment Outcome - Block 2','Block 2: TB/HIV Activities','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 2\n Block 2: TB/HIV Activities\n \n 2023-04-03 20:01:22 UTC\n \n 2023-04-03 20:01: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 2105\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','2023-04-03 22:01:22',4,'2023-04-03 22:01:46',4,0,NULL,NULL,NULL,'e24dad06-5de1-4215-b021-85b95585a56b'),(2106,'TB Treatment Outcome - Block 2 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 2 Data Set\n \n 2023-04-03 20:01:46 UTC\n \n 2023-04-03 20:33: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 2106\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n ARTNw&Rl_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 ARTNw&Rl_M\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n ARTRetr_F\n \n \n \n \n \n \n \n \n \n ARTRetr_M\n \n \n \n \n \n \n DapNw&Rl_F\n \n \n \n \n \n \n \n \n \n DapNw&Rl_M\n \n \n \n \n \n \n DapRetre_F\n \n \n \n \n \n \n \n \n \n DapRetre_M\n \n \n \n \n \n \n PosNw&Rs_F\n \n \n \n \n \n \n \n \n \n PosNw&Rs_M\n \n \n \n \n \n \n PosRetr_F\n \n \n \n \n \n \n \n \n \n PosRetr_M\n \n \n \n \n \n \n StsNw&Rs_F\n \n \n \n \n \n \n \n \n \n StsNw&Rs_M\n \n \n \n \n \n \n StsRetre_F\n \n \n \n \n \n \n StsRetre_M\n \n \n \n \n \n \n','2023-04-03 22:01:46',4,'2023-04-03 22:33:35',4,0,NULL,NULL,NULL,'5730236a-dfc3-4bf5-8f18-3769e49f4519'),(2107,'Prison Worker - Failed','Prison Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Failed\n Prison Worker - Failed\n \n 2023-04-03 20:01:47 UTC\n \n 2023-04-03 20:07: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 2107\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','2023-04-03 22:01:47',4,'2023-04-03 22:07:43',4,0,NULL,NULL,NULL,'832801ab-b41b-4695-b0df-ada7c5c34ff7'),(2108,'Retreatment excluding Relapse Not Evaluated','Retreatment excluding Relapse Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Not Evaluated\n Retreatment excluding Relapse Not Evaluated\n \n 2023-04-03 20:02:36 UTC\n \n 2023-04-03 20:05: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 2108\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','2023-04-03 22:02:36',4,'2023-04-03 22:05:10',4,0,NULL,NULL,NULL,'9c3205c9-eb03-46c1-b7e8-a0e9fa4b4738'),(2109,'Prison Worker - Moved to 2nd line','Prison Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Moved to 2nd line\n Prison Worker - Moved to 2nd line\n \n 2023-04-03 20:02:41 UTC\n \n 2023-04-03 20:05: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 2109\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','2023-04-03 22:02:41',4,'2023-04-03 22:05:28',4,0,NULL,NULL,NULL,'cee1771f-3491-455f-9b0a-a35e99f25454'),(2110,'Retreatment excluding Relapse Moved to Secondline Treatment','Retreatment excluding Relapse Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Moved to Secondline Treatment\n Retreatment excluding Relapse Moved to Secondline Treatment\n \n 2023-04-03 20:06:37 UTC\n \n 2023-04-03 20:20: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 2110\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','2023-04-03 22:06:37',4,'2023-04-03 22:20:31',4,0,NULL,NULL,NULL,'ee732817-3760-4a2d-9d61-f7009cd0b256'),(2111,'Prison Worker - Lost','Prison Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Lost\n Prison Worker - Lost\n \n 2023-04-03 20:07:00 UTC\n \n 2023-04-03 20:10: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 2111\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','2023-04-03 22:07:00',4,'2023-04-03 22:10:16',4,0,NULL,NULL,NULL,'bfa5d083-f2ca-4c04-a6d3-193176de6d61'),(2112,'RetreatRetreatment excluding Relapse Moved to Secondline Treatment','RetreatRetreatment excluding Relapse Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n RetreatRetreatment excluding Relapse Moved to Secondline Treatment\n RetreatRetreatment excluding Relapse Moved to Secondline Treatment\n \n 2023-04-03 20:13:03 UTC\n \n 2023-04-03 20:14: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 2112\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Retreatment excluding Relapse \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 22:13:03',4,'2023-04-03 22:14:36',4,0,NULL,NULL,NULL,'2573846a-4c51-4427-bcba-7ed91d2c0835'),(2113,'Health Worker - Died','Health Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Died\n Health Worker - Died\n \n 2023-04-03 20:14:38 UTC\n \n 2023-04-03 20: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 2113\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','2023-04-03 22:14:38',4,'2023-04-03 22:16:57',4,0,NULL,NULL,NULL,'15cca65b-c4f6-4e32-8b7d-18cb047f999a'),(2114,'Health Worker - Cured','Health Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Cured\n Health Worker - Cured\n \n 2023-04-03 20:16:23 UTC\n \n 2023-04-03 20:18: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 2114\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','2023-04-03 22:16:23',4,'2023-04-03 22:18:17',4,0,NULL,NULL,NULL,'efe0083b-cc7c-4394-bf4d-e4129ee2d998'),(2115,'Prison Worker - Completed','Prison Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Completed\n Prison Worker - Completed\n \n 2023-04-03 20:18:34 UTC\n \n 2023-04-03 20:22: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 2115\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','2023-04-03 22:18:34',4,'2023-04-03 22:22:51',4,0,NULL,NULL,NULL,'685d03a5-0f34-426e-aa83-e12e209284b4'),(2116,'Prison Worker - Failed','Prison Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Failed\n Prison Worker - Failed\n \n 2023-04-03 20:20:00 UTC\n \n 2023-04-03 20:22: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 2116\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','2023-04-03 22:20:00',4,'2023-04-03 22:22:29',4,0,NULL,NULL,NULL,'792e1555-e40d-4ebf-8b96-ebbaa769f859'),(2117,'All TB HIV positive Completed','All TB HIV positive Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive Completed\n All TB HIV positive Completed\n \n 2023-04-03 20:21:28 UTC\n \n 2023-04-03 20:31: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 2117\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','2023-04-03 22:21:28',4,'2023-04-03 22:31:15',4,0,NULL,NULL,NULL,'18f345bc-6ed0-42d6-893a-05ba98b38e16'),(2118,'All TB HIV positive Cured','All TB HIV positive Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive Cured\n All TB HIV positive Cured\n \n 2023-04-03 20:25:37 UTC\n \n 2023-04-03 20:32: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 2118\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','2023-04-03 22:25:37',4,'2023-04-03 22:32:16',4,0,NULL,NULL,NULL,'4b6e2cd9-29b6-4f7b-8af7-0ab18e2af838'),(2119,'Health Worker - Completed','Health Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Completed\n Health Worker - Completed\n \n 2023-04-03 20:32:38 UTC\n \n 2023-04-03 20:39: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 2119\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','2023-04-03 22:32:38',4,'2023-04-03 22:39:58',4,0,NULL,NULL,NULL,'b38f490e-8d26-411a-9073-2a7e5d17e235'),(2120,'All TB HIV positive and Died','All TB HIV positive and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Died\n All TB HIV positive and Died\n \n 2023-04-03 20:32:43 UTC\n \n 2023-04-03 20:35: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 2120\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','2023-04-03 22:32:43',4,'2023-04-03 22:35:39',4,0,NULL,NULL,NULL,'f0b13ce3-b836-4a27-a7a4-d1b83c1eb900'),(2121,'Health Worker - Not Evaluated','Health Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Not Evaluated\n Health Worker - Not Evaluated\n \n 2023-04-03 20:32:56 UTC\n \n 2023-04-03 20: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 2121\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','2023-04-03 22:32:56',4,'2023-04-03 22:35:43',4,0,NULL,NULL,NULL,'9f750645-0dc4-488d-8a94-05e31d6b4838'),(2122,'All TB HIV positive and Lost to Follow Up','All TB HIV positive and Lost to Follow Up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Lost to Follow Up\n All TB HIV positive and Lost to Follow Up\n \n 2023-04-03 20:33:45 UTC\n \n 2023-04-03 20:36: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 2122\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','2023-04-03 22:33:45',4,'2023-04-03 22:36:08',4,0,NULL,NULL,NULL,'21738598-0974-4f31-9925-1c9606d66410'),(2123,'All TB HIV positive and Failed','All TB HIV positive and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Failed\n All TB HIV positive and Failed\n \n 2023-04-03 20:36:30 UTC\n \n 2023-04-03 20: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 2123\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','2023-04-03 22:36:30',4,'2023-04-03 22:40:18',4,0,NULL,NULL,NULL,'2a7766be-418e-4a5a-a204-c5fa91e6b672'),(2124,'All TB HIV positive and Not Evaluated','All TB HIV positive and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Not Evaluated\n All TB HIV positive and Not Evaluated\n \n 2023-04-03 20:37:09 UTC\n \n 2023-04-03 20:39: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 2124\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','2023-04-03 22:37:09',4,'2023-04-03 22:39:20',4,0,NULL,NULL,NULL,'04c0074a-fd87-44da-8d96-68d533e488ea'),(2125,'Health Worker - Lost','Health Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Lost\n Health Worker - Lost\n \n 2023-04-03 20:40:25 UTC\n \n 2023-04-03 20: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 2125\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','2023-04-03 22:40:25',4,'2023-04-03 22:44:16',4,0,NULL,NULL,NULL,'925a50ba-435b-4213-a03b-6272a468cd01'),(2126,'All TB HIV positive and Moved to Secondline Treatment','All TB HIV positive and Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Moved to Secondline Treatment\n All TB HIV positive and Moved to Secondline Treatment\n \n 2023-04-03 20:40:57 UTC\n \n 2023-04-03 20:42: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 2126\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','2023-04-03 22:40:57',4,'2023-04-03 22:42:27',4,0,NULL,NULL,NULL,'6ed079c9-5ad9-4852-9523-95fddcbc9959'),(2127,'Health Worker - Failed','Health Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Failed\n Health Worker - Failed\n \n 2023-04-03 20:42:41 UTC\n \n 2023-04-03 20:52: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 2127\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','2023-04-03 22:42:41',4,'2023-04-03 22:52:06',4,0,NULL,NULL,NULL,'4ec08d1c-6427-44e0-b604-b960e585b190'),(2128,'All TB HIV Negative and Completed','All TB HIV Negative and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Completed\n All TB HIV Negative and Completed\n \n 2023-04-03 20:43:07 UTC\n \n 2023-04-03 20:53: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 2128\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','2023-04-03 22:43:07',4,'2023-04-03 22:53:20',4,0,NULL,NULL,NULL,'d5786c86-ca76-43b1-b0a6-1bd90817af65'),(2129,'All TB HIV Negative and Cured','All TB HIV Negative and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Cured\n All TB HIV Negative and Cured\n \n 2023-04-03 20:44:07 UTC\n \n 2023-04-03 20:49: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 2129\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','2023-04-03 22:44:07',4,'2023-04-03 22:49:20',4,0,NULL,NULL,NULL,'a564539f-267c-452a-99d2-0f61f7c88c4f'),(2130,'Health Worker - Moved to 2nd line','Health Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Moved to 2nd line\n Health Worker - Moved to 2nd line\n \n 2023-04-03 20:48:45 UTC\n \n 2023-04-03 20:55: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 2130\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','2023-04-03 22:48:45',4,'2023-04-03 22:55:46',4,0,NULL,NULL,NULL,'c0d08cc2-25dc-48f6-a9bc-db0d9b376d17'),(2131,'All TB HIV Negative and Died','All TB HIV Negative and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Died\n All TB HIV Negative and Died\n \n 2023-04-03 20:51:50 UTC\n \n 2023-04-03 20:55: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 2131\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','2023-04-03 22:51:50',4,'2023-04-03 22:55:29',4,0,NULL,NULL,NULL,'b375d3b0-9817-419c-ad36-5513383a0191'),(2132,'Public Transport - Died','Public Transport - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Died\n Public Transport - Died\n \n 2023-04-03 20:55:26 UTC\n \n 2023-04-03 20:57: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 2132\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','2023-04-03 22:55:26',4,'2023-04-03 22:57:21',4,0,NULL,NULL,NULL,'09f945ef-6ced-4c7c-924b-d83368e5b544'),(2133,'All TB HIV Negative and Failed','All TB HIV Negative and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Failed\n All TB HIV Negative and Failed\n \n 2023-04-03 20:56:21 UTC\n \n 2023-04-03 21:00: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 2133\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','2023-04-03 22:56:21',4,'2023-04-03 23:00:30',4,0,NULL,NULL,NULL,'bce54b53-dea6-4664-bc35-b436a74551f0'),(2134,'All TB HIV Negative and Lost to Follow Up','All TB HIV Negative and Lost to Follow Up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Lost to Follow Up\n All TB HIV Negative and Lost to Follow Up\n \n 2023-04-03 20:56:44 UTC\n \n 2023-04-03 21:00: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 2134\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','2023-04-03 22:56:44',4,'2023-04-03 23:00:04',4,0,NULL,NULL,NULL,'7b40659a-ca9a-4034-832f-5fddb0421d26'),(2135,'Public Transport - Not Evaluated','Public Transport - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Not Evaluated\n Public Transport - Not Evaluated\n \n 2023-04-03 20:56:54 UTC\n \n 2023-04-03 20:59: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 2135\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','2023-04-03 22:56:54',4,'2023-04-03 22:59:03',4,0,NULL,NULL,NULL,'0b001306-febd-4630-acb7-03fedc1eca0d'),(2136,'Public Transport - Completed','Public Transport - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Completed\n Public Transport - Completed\n \n 2023-04-03 20:58:25 UTC\n \n 2023-04-03 21:00: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 2136\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','2023-04-03 22:58:25',4,'2023-04-03 23:00:42',4,0,NULL,NULL,NULL,'cb8baffc-6e41-4464-91b4-478da43820ad'),(2137,'Public Transport - Lost','Public Transport - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Lost\n Public Transport - Lost\n \n 2023-04-03 21:00:25 UTC\n \n 2023-04-03 21:04: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 2137\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','2023-04-03 23:00:25',4,'2023-04-03 23:04:00',4,0,NULL,NULL,NULL,'68abf753-d909-4d9d-866b-d707b637b5f6'),(2138,'All TB HIV Negative and Not Evaluated','All TB HIV Negative and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Not Evaluated\n All TB HIV Negative and Not Evaluated\n \n 2023-04-03 21:00:53 UTC\n \n 2023-04-03 21:02: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 2138\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','2023-04-03 23:00:53',4,'2023-04-03 23:02:35',4,0,NULL,NULL,NULL,'56fc35af-e96c-4268-b7b4-0d63610a2d06'),(2139,'All TB HIV Negative and Moved to Secondline Treatment','All TB HIV Negative and Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Moved to Secondline Treatment\n All TB HIV Negative and Moved to Secondline Treatment\n \n 2023-04-03 21:01:36 UTC\n \n 2023-04-03 21:02: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 2139\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','2023-04-03 23:01:36',4,'2023-04-03 23:02:58',4,0,NULL,NULL,NULL,'bdf99672-96f9-4eda-ad34-a82f5b59ffbc'),(2140,'Public Transport - Cured','Public Transport - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Cured\n Public Transport - Cured\n \n 2023-04-03 21:02:12 UTC\n \n 2023-04-03 21:06: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 2140\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','2023-04-03 23:02:12',4,'2023-04-03 23:06:24',4,0,NULL,NULL,NULL,'185b4be8-a666-4211-b22d-56dc426cbbcd'),(2141,'All TB Children (0-14 yrs) and Completed','All TB Children (0-14 yrs) and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Completed\n All TB Children (0-14 yrs) and Completed\n \n 2023-04-03 21:03:41 UTC\n \n 2023-04-03 21:05: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 2141\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','2023-04-03 23:03:41',4,'2023-04-03 23:05:56',4,0,NULL,NULL,NULL,'eb242fe9-dde6-4baa-b92f-7a7084920dd7'),(2142,'All TB Children (0-14 yrs) and Cured','All TB Children (0-14 yrs) and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Cured\n All TB Children (0-14 yrs) and Cured\n \n 2023-04-03 21:04:01 UTC\n \n 2023-04-03 21:06: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 2142\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','2023-04-03 23:04:01',4,'2023-04-03 23:06:20',4,0,NULL,NULL,NULL,'88c4f217-bf94-4e84-9d4b-15f6747276ae'),(2143,'Public Transport - Moved to 2nd line','Public Transport - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Moved to 2nd line\n Public Transport - Moved to 2nd line\n \n 2023-04-03 21:05:57 UTC\n \n 2023-04-03 21:10:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2143\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','2023-04-03 23:05:57',4,'2023-04-03 23:10:23',4,0,NULL,NULL,NULL,'3d87ffb3-cfb1-4ac5-bf47-dcb3193e133b'),(2144,'All TB Children (0-14 yrs) and Died','All TB Children (0-14 yrs) and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Died\n All TB Children (0-14 yrs) and Died\n \n 2023-04-03 21:06:48 UTC\n \n 2023-04-03 21:08: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 2144\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','2023-04-03 23:06:48',4,'2023-04-03 23:08:55',4,0,NULL,NULL,NULL,'30a341a8-2bf8-4e91-a9ee-41b6826e2cef'),(2145,'Public Transport - Failed','Public Transport - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Failed\n Public Transport - Failed\n \n 2023-04-03 21:07:43 UTC\n \n 2023-04-03 21:09: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 2145\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','2023-04-03 23:07:43',4,'2023-04-03 23:09:40',4,0,NULL,NULL,NULL,'e9843f95-15c2-4d15-bd2c-bdfc19bc4767'),(2146,'All TB Children (0-14 yrs) and Lost to follow up','All TB Children (0-14 yrs) and Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Lost to follow up\n All TB Children (0-14 yrs) and Lost to follow up\n \n 2023-04-03 21:08:17 UTC\n \n 2023-04-03 21:16: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 2146\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','2023-04-03 23:08:17',4,'2023-04-03 23:16:59',4,0,NULL,NULL,NULL,'33f4111b-438c-4da8-bc56-0c588f408444'),(2147,'All TB Children (0-14 yrs) and failed','All TB Children (0-14 yrs) and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and failed\n All TB Children (0-14 yrs) and failed\n \n 2023-04-03 21:09:49 UTC\n \n 2023-04-03 21: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 2147\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','2023-04-03 23:09:49',4,'2023-04-03 23:17:30',4,0,NULL,NULL,NULL,'af568cf8-77aa-4d45-ab4f-ca39418ba77d'),(2148,'HHCM - Completed','HHCM - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Completed\n HHCM - Completed\n \n 2023-04-03 21:11:12 UTC\n \n 2023-04-03 21:13: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 2148\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','2023-04-03 23:11:12',4,'2023-04-03 23:13:17',4,0,NULL,NULL,NULL,'23d932aa-9c33-4aff-89ec-9028c25a03ef'),(2149,'All TB Children (0-14 yrs) and not evaluated','All TB Children (0-14 yrs) and not evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and not evaluated\n All TB Children (0-14 yrs) and not evaluated\n \n 2023-04-03 21:12:28 UTC\n \n 2023-04-03 21:15: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 2149\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','2023-04-03 23:12:28',4,'2023-04-03 23:15:26',4,0,NULL,NULL,NULL,'12a47e2e-735f-4b72-9e0c-f9fc792f3fc8'),(2150,'HHCM - Failed','HHCM - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Failed\n HHCM - Failed\n \n 2023-04-03 21:13:03 UTC\n \n 2023-04-03 21:35: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 2150\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','2023-04-03 23:13:03',4,'2023-04-03 23:35:08',4,0,NULL,NULL,NULL,'ce1c1a8e-9760-4a56-a885-4bc25de4f892'),(2151,'HHCM - Lost','HHCM - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Lost\n HHCM - Lost\n \n 2023-04-03 21:14:35 UTC\n \n 2023-04-03 21:36: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 2151\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','2023-04-03 23:14:35',4,'2023-04-03 23:36:26',4,0,NULL,NULL,NULL,'b9ee3b47-b5d7-42ed-9a47-4f61f77b6eeb'),(2152,'All TB Children (0-14 yrs) and moved to secondline treatment','All TB Children (0-14 yrs) and moved to secondline treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and moved to secondline treatment\n All TB Children (0-14 yrs) and moved to secondline treatment\n \n 2023-04-03 21:18:05 UTC\n \n 2023-04-03 21:30: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 2152\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','2023-04-03 23:18:05',4,'2023-04-03 23:30:14',4,0,NULL,NULL,NULL,'692b0f3e-9c3e-4a71-bba3-b6ae50963679'),(2153,'All TB Adolescent (10-19 yrs) and Completed','All TB Adolescent (10-19 yrs) and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Completed\n All TB Adolescent (10-19 yrs) and Completed\n \n 2023-04-03 21:27:45 UTC\n \n 2023-04-03 21:29: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 2153\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','2023-04-03 23:27:45',4,'2023-04-03 23:29:16',4,0,NULL,NULL,NULL,'ad3dbe97-3718-4885-a76d-36982b68f507'),(2154,'All TB Adolescent (10-19 yrs) and Cured','All TB Adolescent (10-19 yrs) and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Cured\n All TB Adolescent (10-19 yrs) and Cured\n \n 2023-04-03 21:28:37 UTC\n \n 2023-04-03 21:30: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 2154\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','2023-04-03 23:28:37',4,'2023-04-03 23:30:39',4,0,NULL,NULL,NULL,'ee2cd03a-51b0-4f81-81cc-40ab687629a8'),(2155,'All TB Adolescent (10-19 yrs) and Died','All TB Adolescent (10-19 yrs) and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Died\n All TB Adolescent (10-19 yrs) and Died\n \n 2023-04-03 21:30:59 UTC\n \n 2023-04-03 21:33: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 2155\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','2023-04-03 23:30:59',4,'2023-04-03 23:33:07',4,0,NULL,NULL,NULL,'f27e06d5-38ff-443b-8ce0-3cebb07f2eec'),(2156,'All TB Adolescent (10-19 yrs) and Lost to follow up','All TB Adolescent (10-19 yrs) and Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Lost to follow up\n All TB Adolescent (10-19 yrs) and Lost to follow up\n \n 2023-04-03 21:31:24 UTC\n \n 2023-04-03 21:33: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 2156\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','2023-04-03 23:31:24',4,'2023-04-03 23:33:27',4,0,NULL,NULL,NULL,'b7f7dbd4-f089-4ac4-9bc5-4c750a016a6c'),(2157,'All TB Adolescent (10-19 yrs) and failed','All TB Adolescent (10-19 yrs) and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and failed\n All TB Adolescent (10-19 yrs) and failed\n \n 2023-04-03 21:31:48 UTC\n \n 2023-04-03 21:38: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 2157\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','2023-04-03 23:31:48',4,'2023-04-03 23:38:15',4,0,NULL,NULL,NULL,'6ab5cc07-88e8-4b34-9cb6-8d451336945a'),(2158,'All TB Adolescent (10-19 yrs) and Not Evaluated','All TB Adolescent (10-19 yrs) and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Not Evaluated\n All TB Adolescent (10-19 yrs) and Not Evaluated\n \n 2023-04-03 21:34:28 UTC\n \n 2023-04-03 21:36: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 2158\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','2023-04-03 23:34:28',4,'2023-04-03 23:36:44',4,0,NULL,NULL,NULL,'4465b2b0-282f-4b7a-8acc-ba9018cf82ca'),(2159,'All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n \n 2023-04-03 21:34:49 UTC\n \n 2023-04-03 21:37: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 2159\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','2023-04-03 23:34:49',4,'2023-04-03 23:37:16',4,0,NULL,NULL,NULL,'fc47f473-d8f7-4b44-b969-4aee12de4036'),(2160,'HHCM - Not Evaluated','HHCM - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Not Evaluated\n HHCM - Not Evaluated\n \n 2023-04-03 21:37:03 UTC\n \n 2023-04-03 21: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 2160\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','2023-04-03 23:37:03',4,'2023-04-03 23:42:22',4,0,NULL,NULL,NULL,'f801b15a-b96f-491f-a8b5-1fbee8ba9c83'),(2161,'Female and Completed','Female and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Female and Completed\n Female and Completed\n \n 2023-04-03 21:37:55 UTC\n \n 2023-04-03 21:44: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 2161\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','2023-04-03 23:37:55',4,'2023-04-03 23:44:21',4,0,NULL,NULL,NULL,'615ab43e-7d60-462d-bab7-3ea00babd032'),(2162,'Female and Cured','Female and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Female and Cured\n Female and Cured\n \n 2023-04-03 21:38:38 UTC\n \n 2023-04-03 21:46: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 2162\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','2023-04-03 23:38:38',4,'2023-04-03 23:46:42',4,0,NULL,NULL,NULL,'807438e3-b735-4310-9e68-24f15521e66d'),(2163,'HHCM - Cured','HHCM - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Cured\n HHCM - Cured\n \n 2023-04-03 21:38:56 UTC\n \n 2023-04-03 21:42: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 2163\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','2023-04-03 23:38:56',4,'2023-04-03 23:42:00',4,0,NULL,NULL,NULL,'352d4e3a-8ea5-4848-a515-ea4a3a091d8f'),(2164,'TB Female and Died','TB Female and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Died\n TB Female and Died\n \n 2023-04-03 21:39:57 UTC\n \n 2023-04-03 21:47: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 2164\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','2023-04-03 23:39:57',4,'2023-04-03 23:47:30',4,0,NULL,NULL,NULL,'ab84625a-199b-4a80-99b9-9b89c8c02ba4'),(2165,'HHCM - Died','HHCM - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Died\n HHCM - Died\n \n 2023-04-03 21:43:38 UTC\n \n 2023-04-03 21:46: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 2165\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','2023-04-03 23:43:38',4,'2023-04-03 23:46:59',4,0,NULL,NULL,NULL,'144c7351-4092-442d-ab8d-91cf1d13698c'),(2166,'HHCM - Moved to 2nd line','HHCM - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Moved to 2nd line\n HHCM - Moved to 2nd line\n \n 2023-04-03 21:44:32 UTC\n \n 2023-04-03 21:48: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 2166\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','2023-04-03 23:44:32',4,'2023-04-03 23:48:15',4,0,NULL,NULL,NULL,'a7391f1f-e1b2-415c-bde5-52d06b5616ad'),(2167,'TB Female and Lost to Follow up','TB Female and Lost to Follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Lost to Follow up\n TB Female and Lost to Follow up\n \n 2023-04-03 21:46:14 UTC\n \n 2023-04-03 21:48: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 2167\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','2023-04-03 23:46:14',4,'2023-04-03 23:48:16',4,0,NULL,NULL,NULL,'6ad8a1fc-9753-4d52-b40a-68c6c9089141'),(2168,'TB Female and Failed','TB Female and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Failed\n TB Female and Failed\n \n 2023-04-03 21:47:53 UTC\n \n 2023-04-03 21:49: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 2168\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','2023-04-03 23:47:53',4,'2023-04-03 23:49:44',4,0,NULL,NULL,NULL,'676800f0-5583-436b-b7ab-815f7d884f96'),(2169,'TB Female and Not Evaluated','TB Female and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Not Evaluated\n TB Female and Not Evaluated\n \n 2023-04-03 21:48:58 UTC\n \n 2023-04-03 21: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 2169\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','2023-04-03 23:48:58',4,'2023-04-03 23:53:30',4,0,NULL,NULL,NULL,'67a2aa65-3b21-45f8-bdba-fe284d683360'),(2170,'TB Female and moved to secondline','TB Female and moved to secondline','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and moved to secondline\n TB Female and moved to secondline\n \n 2023-04-03 21:49:27 UTC\n \n 2023-04-03 21:51: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 2170\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','2023-04-03 23:49:27',4,'2023-04-03 23:51:19',4,0,NULL,NULL,NULL,'eac53c81-f295-41ae-989d-26f66888caae'),(2171,'HHXM - Completed','HHXM - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Completed\n HHXM - Completed\n \n 2023-04-03 21:51:36 UTC\n \n 2023-04-03 21:56: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 2171\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','2023-04-03 23:51:36',4,'2023-04-03 23:56:49',4,0,NULL,NULL,NULL,'558ce9d9-35d7-4d49-8b41-f4c8cc979bdf'),(2172,'HHXM - Cured','HHXM - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Cured\n HHXM - Cured\n \n 2023-04-03 21:51:55 UTC\n \n 2023-04-03 21:57: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 2172\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','2023-04-03 23:51:55',4,'2023-04-03 23:57:44',4,0,NULL,NULL,NULL,'56f5154b-cb21-456b-8e13-508a0dc032ff'),(2173,'TB Mine Workers and completed','TB Mine Workers and completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and completed\n TB Mine Workers and completed\n \n 2023-04-03 21:53:08 UTC\n \n 2023-04-03 21:56: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 2173\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','2023-04-03 23:53:08',4,'2023-04-03 23:56:07',4,0,NULL,NULL,NULL,'a54130b0-7643-4865-9a0e-6c70215d3046'),(2174,'TB Mine Workers and cured','TB Mine Workers and cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and cured\n TB Mine Workers and cured\n \n 2023-04-03 21:53:49 UTC\n \n 2023-04-03 21: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 2174\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','2023-04-03 23:53:49',4,'2023-04-03 23:57:45',4,0,NULL,NULL,NULL,'f5957799-79ad-4f08-9a68-c359c4b69ce3'),(2175,'TB Mine Workers and died','TB Mine Workers and died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and died\n TB Mine Workers and died\n \n 2023-04-03 21:55:02 UTC\n \n 2023-04-03 21:57:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2175\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','2023-04-03 23:55:02',4,'2023-04-03 23:57:23',4,0,NULL,NULL,NULL,'fc3c4c67-738d-403a-9584-bd4a17942c24'),(2176,'HHXM - Died','HHXM - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Died\n HHXM - Died\n \n 2023-04-03 21:56:35 UTC\n \n 2023-04-03 21:59: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 2176\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','2023-04-03 23:56:35',4,'2023-04-03 23:59:44',4,0,NULL,NULL,NULL,'2aaeab53-7906-480f-a51b-ebc9077a28ac'),(2177,'TB Mine Workers and lost to follow up','TB Mine Workers and lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and lost to follow up\n TB Mine Workers and lost to follow up\n \n 2023-04-03 21:58:16 UTC\n \n 2023-04-03 22: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 2177\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','2023-04-03 23:58:16',4,'2023-04-04 00:05:17',4,0,NULL,NULL,NULL,'2d37e108-26d4-4c69-aa41-dbcb4298d209'),(2178,'HHXM - Not Evaluated','HHXM - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Not Evaluated\n HHXM - Not Evaluated\n \n 2023-04-03 21:58:28 UTC\n \n 2023-04-03 22:01: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 2178\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','2023-04-03 23:58:28',4,'2023-04-04 00:01:46',4,0,NULL,NULL,NULL,'ffa409cc-0ce1-4ca0-9971-e339c3d29f8c'),(2179,'TB Mine Workers and failed','TB Mine Workers and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and failed\n TB Mine Workers and failed\n \n 2023-04-03 21:58:31 UTC\n \n 2023-04-03 22: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 2179\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','2023-04-03 23:58:31',4,'2023-04-04 00:00:58',4,0,NULL,NULL,NULL,'f866bee9-323a-4a71-8e35-94cceaa3550d'),(2180,'TB Mine Workers and not evaluated','TB Mine Workers and not evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and not evaluated\n TB Mine Workers and not evaluated\n \n 2023-04-03 21:58:52 UTC\n \n 2023-04-03 22:04: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 2180\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','2023-04-03 23:58:52',4,'2023-04-04 00:04:47',4,0,NULL,NULL,NULL,'b2a2038e-f629-45ee-8033-f797caa6ac39'),(2181,'HHXM - Lost','HHXM - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Lost\n HHXM - Lost\n \n 2023-04-03 22:00:45 UTC\n \n 2023-04-03 22:04: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 2181\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','2023-04-04 00:00:45',4,'2023-04-04 00:04:15',4,0,NULL,NULL,NULL,'11bcf608-b1dd-492d-ba8a-cd3c9e19748f'),(2182,'HHXM - Failed','HHXM - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Failed\n HHXM - Failed\n \n 2023-04-03 22:01:29 UTC\n \n 2023-04-03 22:11: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 2182\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','2023-04-04 00:01:29',4,'2023-04-04 00:11:06',4,0,NULL,NULL,NULL,'a10dc54c-654e-4f57-9df8-be1b14c50a14'),(2183,'TB Mine Workers and moved to secondline ','TB Mine Workers and moved to secondline ','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and moved to secondline \n TB Mine Workers and moved to secondline \n \n 2023-04-03 22:02:20 UTC\n \n 2023-04-03 22:11: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 2183\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2023-04-04 00:02:20',4,'2023-04-04 00:11:10',4,0,NULL,NULL,NULL,'e07ad771-1ec2-4d4a-a085-5433cc94b7de'),(2184,'HHXM - Moved to 2nd Line','HHXM - Moved to 2nd Line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Moved to 2nd Line\n HHXM - Moved to 2nd Line\n \n 2023-04-03 22:03:46 UTC\n \n 2023-04-03 22:08: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 2184\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','2023-04-04 00:03:46',4,'2023-04-04 00:08:51',4,0,NULL,NULL,NULL,'b12d1160-3ba1-4b39-92b9-e765d0d9fe55'),(2185,'TB Treatment Outcome - Block 1','TB Treatment Outcome - Block 1','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 1\n TB Treatment Outcome - Block 1\n \n 2023-04-03 22:07:23 UTC\n \n 2023-04-03 22:07: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 2185\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','2023-04-04 00:07:23',4,'2023-04-04 00:07:54',4,0,NULL,NULL,NULL,'a7cfcef1-57f5-4fbc-8a24-77fac2b219bf'),(2186,'TB Treatment Outcome - Block 1 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 1 Data Set\n \n 2023-04-03 22:07:54 UTC\n \n 2023-04-04 12:21: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 2186\n \n \n \n Fmale2nd\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 FmaleComp\n \n \n \n \n \n \n \n \n \n FmaleCured\n \n \n \n \n \n \n \n \n \n FmaleDied\n \n \n \n \n \n \n \n \n \n FmaleFaile\n \n \n \n \n \n \n \n \n \n FmaleLost\n \n \n \n \n \n \n \n \n \n FmaleNtEv\n \n \n \n \n \n \n \n \n \n Miner2nd\n \n \n \n \n \n \n \n \n \n MinerComp\n \n \n \n \n \n \n \n \n \n MinerCured\n \n \n \n \n \n \n \n \n \n MinerDied\n \n \n \n \n \n \n \n \n \n MinerFail\n \n \n \n \n \n \n \n \n \n MinerLost\n \n \n \n \n \n \n \n \n \n MinerNtEv\n \n \n \n \n \n \n \n \n \n NwRlps2nd\n \n \n \n \n \n \n \n \n \n NwRlpsComp\n \n \n \n \n \n \n \n \n \n NwRlpsCure\n \n \n \n \n \n \n \n \n \n NwRlpsDied\n \n \n \n \n \n \n \n \n \n NwRlpsLost\n \n \n \n \n \n \n \n \n \n NwRlpsNtEv\n \n \n \n \n \n \n \n \n \n NwRlpsfail\n \n \n \n \n \n \n \n \n \n RtrtEx2nd\n \n \n \n \n \n \n \n \n \n RtrtExComp\n \n \n \n \n \n \n \n \n \n RtrtExCure\n \n \n \n \n \n \n \n \n \n RtrtExDied\n \n \n \n \n \n \n \n \n \n RtrtExFail\n \n \n \n \n \n \n \n \n \n RtrtExLost\n \n \n \n \n \n \n \n \n \n RtrtExNtEv\n \n \n \n \n \n \n \n \n \n TBAdol2nd\n \n \n \n \n \n \n \n \n \n TBAdolComp\n \n \n \n \n \n \n \n \n \n TBAdolCure\n \n \n \n \n \n \n \n \n \n TBAdolDied\n \n \n \n \n \n \n \n \n \n TBAdolFail\n \n \n \n \n \n \n \n \n \n TBAdolLost\n \n \n \n \n \n \n \n \n \n TBAdolNtEv\n \n \n \n \n \n \n \n \n \n TBChld2nd\n \n \n \n \n \n \n \n \n \n TBChldCure\n \n \n \n \n \n \n \n \n \n TBChldDied\n \n \n \n \n \n \n \n \n \n TBChldFail\n \n \n \n \n \n \n \n \n \n TBChldLost\n \n \n \n \n \n \n \n \n \n TBChldNtEv\n \n \n \n \n \n \n \n \n \n TBNeg2nd\n \n \n \n \n \n \n \n \n \n TBNegCompl\n \n \n \n \n \n \n \n \n \n TBNegCured\n \n \n \n \n \n \n \n \n \n TBNegDied\n \n \n \n \n \n \n \n \n \n TBNegFaile\n \n \n \n \n \n \n \n \n \n TBNegLost\n \n \n \n \n \n \n \n \n \n TBNegNtEv\n \n \n \n \n \n \n \n \n \n TBPos2nd\n \n \n \n \n \n \n \n \n \n TBPosCompl\n \n \n \n \n \n \n \n \n \n TBPosCured\n \n \n \n \n \n \n \n \n \n TBPosDied\n \n \n \n \n \n \n \n \n \n TBPosFaile\n \n \n \n \n \n \n \n \n \n TBPosLost\n \n \n \n \n \n \n \n \n \n TBPosNtEv\n \n \n \n \n \n \n \n \n \n TbChldComp\n \n \n \n \n \n \n \n \n \n exM_comple\n \n \n \n \n \n \n \n \n \n exM_cured\n \n \n \n \n \n \n \n \n \n exM_died\n \n \n \n \n \n \n \n \n \n exM_failed\n \n \n \n \n \n \n \n \n \n exM_lost\n \n \n \n \n \n \n \n \n \n exM_moved\n \n \n \n \n \n \n \n \n \n exM_noteEv\n \n \n \n \n \n \n \n \n \n fact_Died\n \n \n \n \n \n \n \n \n \n fact_compl\n \n \n \n \n \n \n \n \n \n fact_cured\n \n \n \n \n \n \n fact_fail\n \n \n \n \n \n \n \n \n \n fact_lost\n \n \n \n \n \n \n \n \n \n fact_moved\n \n \n \n \n \n \n \n \n \n fact_notEv\n \n \n \n \n \n \n \n \n \n hcw_comple\n \n \n \n \n \n \n \n \n \n hcw_cured\n \n \n \n \n \n \n \n \n \n hcw_died\n \n \n \n \n \n \n \n \n \n hcw_failed\n \n \n \n \n \n \n \n \n \n hcw_lost\n \n \n \n \n \n \n \n \n \n hcw_moved\n \n \n \n \n \n \n \n \n \n hcw_notEva\n \n \n \n \n \n \n \n \n \n hhcm_compl\n \n \n \n \n \n \n \n \n \n hhcm_cured\n \n \n \n \n \n \n \n \n \n hhcm_died\n \n \n \n \n \n \n \n \n \n hhcm_evalu\n \n \n \n \n \n \n \n \n \n hhcm_faile\n \n \n \n \n \n \n \n \n \n hhcm_lost\n \n \n \n \n \n \n \n \n \n hhcm_moved\n \n \n \n \n \n \n \n \n \n hhx_comple\n \n \n \n \n \n \n \n \n \n hhxm_cured\n \n \n \n \n \n \n \n \n \n hhxm_died\n \n \n \n \n \n \n \n \n \n hhxm_faile\n \n \n \n \n \n \n \n \n \n hhxm_lost\n \n \n \n \n \n \n \n \n \n hhxm_moved\n \n \n \n \n \n \n \n \n \n hhxm_notEv\n \n \n \n \n \n \n \n \n \n ptran_comp\n \n \n \n \n \n \n \n \n \n ptran_cure\n \n \n \n \n \n \n \n \n \n ptran_died\n \n \n \n \n \n \n \n \n \n ptran_eval\n \n \n \n \n \n \n \n \n \n ptran_fail\n \n \n \n \n \n \n \n \n \n ptran_lost\n \n \n \n \n \n \n \n \n \n ptran_move\n \n \n \n \n \n \n \n \n \n','2023-04-04 00:07:54',4,'2023-04-04 14:21:10',4,0,NULL,NULL,NULL,'71fbb539-96d9-420c-9b3c-1edeab07e722'); +INSERT INTO `serialized_object` VALUES (2047,'TB Females and Died','TB Females and Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Died\n TB Females and Died\n \n 2023-03-30 17:11:17 UTC\n \n 2023-03-30 17:11: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 2047\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:11:17',4,'2023-03-30 19:11:45',4,0,NULL,NULL,NULL,'f55690e5-8b8d-43ce-b797-f0f8707d1222'),(2048,'HHCM_completed','HHCM Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_completed\n HHCM Completed\n \n 2023-03-30 17:12:02 UTC\n \n 2023-03-30 17:12: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 2048\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:12:02',4,'2023-03-30 19:12:21',4,0,NULL,NULL,NULL,'7dbf3689-913d-4883-ae4b-5be2aee4ba37'),(2049,'TB Females and Lost to Follow up','TB Females and 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 TB Females and Lost to Follow up\n TB Females and Lost to Follow up\n \n 2023-03-30 17:12:17 UTC\n \n 2023-03-30 17:13: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 2049\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:12:17',4,'2023-03-30 19:13:14',4,0,NULL,NULL,NULL,'71a12f10-af92-4eba-88f2-176a2cb3ae14'),(2050,'HHCM_died','HHCM Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_died\n HHCM Died\n \n 2023-03-30 17:12:43 UTC\n \n 2023-03-30 17: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 2050\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:12:43',4,'2023-03-30 19:13:08',4,0,NULL,NULL,NULL,'87c6de2e-d87a-430b-a15e-d5de45e36410'),(2051,'HHCM_lost','HHCM Lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_lost\n HHCM Lost\n \n 2023-03-30 17:13:35 UTC\n \n 2023-03-30 17:14: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 2051\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:13:35',4,'2023-03-30 19:14:00',4,0,NULL,NULL,NULL,'543f25df-61ec-4cec-847f-816fec3268ec'),(2052,'TB Females and Failed (Susceptible)','TB Females and Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Failed (Susceptible)\n TB Females and Failed (Susceptible)\n \n 2023-03-30 17:14:08 UTC\n \n 2023-03-30 17:14: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 2052\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:14:08',4,'2023-03-30 19:14:24',4,0,NULL,NULL,NULL,'d1085653-8aca-440b-ae5c-d899217ef3b5'),(2053,'HHCM_moved','HHCM Moved','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_moved\n HHCM Moved\n \n 2023-03-30 17:14:34 UTC\n \n 2023-03-30 17:14: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 2053\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-03-30 19:14:34',4,'2023-03-30 19:14:52',4,0,NULL,NULL,NULL,'43bc5260-c525-4968-a427-01e7febdfef1'),(2054,'TB Females and Moved to SecondLine','TB Females and Moved to SecondLine','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Moved to SecondLine\n TB Females and Moved to SecondLine\n \n 2023-03-30 17:14:53 UTC\n \n 2023-03-30 17:15: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 2054\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:14:53',4,'2023-03-30 19:15:09',4,0,NULL,NULL,NULL,'56836385-8ef8-49a4-bdc7-e7ac24baadb9'),(2055,'TB Females and Not Evaluated','TB Females and Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Females and Not Evaluated\n TB Females and Not Evaluated\n \n 2023-03-30 17:15:40 UTC\n \n 2023-03-30 17:16: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 2055\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Female \n and o.person_id in ( \n select o.person_id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n INNER JOIN person ON person.person_id = patient.patient_id AND person.voided = 0 \n where person.gender = 'F' \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2242,3650,2302,3793,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-03-30 19:15:40',4,'2023-03-30 19:16:46',4,0,NULL,NULL,NULL,'d1ccfc19-7910-4d71-8ba4-1b31cfbc17b7'),(2056,'FactoryWorker_failed','Factory worker failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n FactoryWorker_failed\n Factory worker failed\n \n 2023-04-03 07:36:11 UTC\n \n 2023-04-03 07:53: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 2056\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3669 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:36:11',4,'2023-04-03 09:53:38',4,0,NULL,NULL,NULL,'43e35844-a8eb-4cc5-a3cd-445a052316c2'),(2057,'prison_worker_failed','Prison worker failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n prison_worker_failed\n Prison worker failed\n \n 2023-04-03 07:55:07 UTC\n \n 2023-04-03 07:56: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 2057\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3779 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:55:07',4,'2023-04-03 09:56:27',4,0,NULL,NULL,NULL,'a4dd9267-3676-4a8b-b56b-65b8683f1ba6'),(2058,'health_worker_failed','Health Worker Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n health_worker_failed\n Health Worker Failed\n \n 2023-04-03 07:57:33 UTC\n \n 2023-04-03 07:58: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 2058\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3670 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:57:33',4,'2023-04-03 09:58:07',4,0,NULL,NULL,NULL,'da9db0e3-0d78-489c-bd35-eb7c68e345d0'),(2059,'public_transport_failed','Public Transport Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n public_transport_failed\n Public Transport Failed\n \n 2023-04-03 07:58:45 UTC\n \n 2023-04-03 07:59: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 2059\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 4654 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 09:58:45',4,'2023-04-03 09:59:38',4,0,NULL,NULL,NULL,'33f5b01b-0001-4fbd-8d76-43b6616c4824'),(2060,'HHCM_failed','HHCM Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM_failed\n HHCM Failed\n \n 2023-04-03 09:18:29 UTC\n \n 2023-04-03 09:19: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 2060\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3777 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:18:29',4,'2023-04-03 11:19:51',4,0,NULL,NULL,NULL,'60d6cef7-079a-4825-b6e1-cb4eb655b864'),(2061,'Mine Workers Cured','Mine Workers Cured','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Cured\n Mine Workers Cured\n \n 2023-04-03 09:18:52 UTC\n \n 2023-04-04 12:32: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 2061\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 1068 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:18:52',4,'2023-04-04 14:32:36',4,0,NULL,NULL,NULL,'9fffbcb9-e2f8-43d2-b6ae-b257c80ff52c'),(2062,'Mine Workers Completed','Mine Workers Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Completed\n Mine Workers Completed\n \n 2023-04-03 09:20:24 UTC\n \n 2023-04-04 12: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 2062\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2242 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:20:24',4,'2023-04-04 14:31:40',4,0,NULL,NULL,NULL,'22a95602-7db7-453f-8af1-d3314651365b'),(2063,'HHXM_completed','HHXM Completed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_completed\n HHXM Completed\n \n 2023-04-03 09:20:26 UTC\n \n 2023-04-03 09: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 2063\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2242) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:20:26',4,'2023-04-03 11:21:05',4,0,NULL,NULL,NULL,'bc440ff8-a03c-42b4-b082-393873e19cc5'),(2064,'HHXM_failed','HHXM Failed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_failed\n HHXM Failed\n \n 2023-04-03 09:21:50 UTC\n \n 2023-04-03 22:08: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 2064\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3793) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:21:50',4,'2023-04-04 00:08:02',4,0,NULL,NULL,NULL,'168f05ac-dc2e-4c53-a38b-0d1ac6bc3f4c'),(2065,'Mine Workers Died','Mine Workers Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Died\n Mine Workers Died\n \n 2023-04-03 09:22:05 UTC\n \n 2023-04-04 12:33: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 2065\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3650 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:22:05',4,'2023-04-04 14:33:00',4,0,NULL,NULL,NULL,'75e3ca1f-9e04-4d1c-91ae-f79f18f650ee'),(2066,'HHXM_cured','HHXM Curred\r\n','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_cured\n HHXM Curred \n\n \n 2023-04-03 09:22:14 UTC\n \n 2023-04-03 09:22: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 2066\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (1068) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:22:14',4,'2023-04-03 11:22:50',4,0,NULL,NULL,NULL,'1895c8dd-bf2c-4bd3-a48f-08770e349ffe'),(2067,'HHXM_moved','HHXM Moved','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_moved\n HHXM Moved\n \n 2023-04-03 09:24:40 UTC\n \n 2023-04-03 09: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 2067\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3794) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:24:40',4,'2023-04-03 11:27:22',4,0,NULL,NULL,NULL,'458408ac-2fc6-45e2-a884-8b8a75cf1d94'),(2068,'HHXM_lost','HHXM Lost','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM_lost\n HHXM Lost\n \n 2023-04-03 09:26:54 UTC\n \n 2023-04-03 09:27: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 2068\n \nselect distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:26:54',4,'2023-04-03 11:27:10',4,0,NULL,NULL,NULL,'20694047-0786-4ce8-922b-df3b23f39c56'),(2069,'Mine Workers Lost to Follow up','Mine Workers 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 Mine Workers Lost to Follow up\n Mine Workers Lost to Follow up\n \n 2023-04-03 09:26:54 UTC\n \n 2023-04-04 12:33: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 2069\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 2302 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:26:54',4,'2023-04-04 14:33:39',4,0,NULL,NULL,NULL,'9406df9e-8673-48f0-81eb-21b60a5ded97'),(2070,'hhxm_notEvaluated','HHXm Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n hhxm_notEvaluated\n HHXm Not Evaluated\n \n 2023-04-03 09:28:30 UTC\n \n 2023-04-03 09:29: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 2070\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (2302,1068,2242,3650,3793,3794) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:28:30',4,'2023-04-03 11:29:51',4,0,NULL,NULL,NULL,'0bd16759-6ff9-4cbf-a0b0-8e9fd1efd1be'),(2071,'Mine Workers Failed (Susceptible)','Mine Workers Failed (Susceptible)','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Failed (Susceptible)\n Mine Workers Failed (Susceptible)\n \n 2023-04-03 09:33:26 UTC\n \n 2023-04-04 12:33: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 2071\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3793 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:33:26',4,'2023-04-04 14:33:18',4,0,NULL,NULL,NULL,'4bba1fe8-13ad-4c18-b549-f0aff1e6bc3f'),(2072,'hhxm_died','HHXM Died','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n hhxm_died\n HHXM Died\n \n 2023-04-03 09:34:30 UTC\n \n 2023-04-03 10:13: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 2072\n select distinct o.person_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 in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 \n and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n and o.person_id in ( \n select ob.person_id \n from obs ob \n where ob.concept_id = 3776 \n and ob.value_coded = 3778 \n and ob.voided = 0 \n ) \n and o.person_id not in ( \n select b.person_id \n from obs b \n where b.concept_id = 3792 \n and b.value_coded in (3650) \n and b.voided = 0 \n ) \n\n','2023-04-03 11:34:30',4,'2023-04-03 12:13:34',4,0,NULL,NULL,NULL,'173bca27-99d3-497c-b83f-902bd3502875'),(2073,'Mine Workers Moved to Secondline Treatment','Mine Workers Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Moved to Secondline Treatment\n Mine Workers Moved to Secondline Treatment\n \n 2023-04-03 09:36:03 UTC\n \n 2023-04-04 12:29: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 2073\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:36:03',4,'2023-04-04 14:29:57',4,0,NULL,NULL,NULL,'7f349b74-1609-4786-a666-6f26b3e0934c'),(2074,'Mine Workers Not Evaluated','Mine Workers Not Evaluated','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Mine Workers Not Evaluated\n Mine Workers Not Evaluated\n \n 2023-04-03 09:39:03 UTC\n \n 2023-04-03 09:39: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 2074\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Mine Worker \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3776 and o.value_coded = 3667 \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id not in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded in (1068,2302,3650,3793,2242,3794) \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 11:39:03',4,'2023-04-03 11:39:38',4,0,NULL,NULL,NULL,'3f20bdd4-03b5-48eb-be2e-3e7d96d9608f'),(2075,'New and Relapse Completed','New and Relapse Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n New and Relapse Completed\n New and Relapse Completed\n \n 2023-04-03 09:46:12 UTC\n \n 2023-04-03 09:50: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 2075\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','2023-04-03 11:46:12',4,'2023-04-03 11:50:04',4,0,NULL,NULL,NULL,'bf8fffec-423b-4d4f-9082-a61937680e08'),(2076,'TB New and Relapse Cured','TB New and Relapse Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Cured\n TB New and Relapse Cured\n \n 2023-04-03 09:54:54 UTC\n \n 2023-04-03 10:09: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 2076\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','2023-04-03 11:54:54',4,'2023-04-03 12:09:07',4,0,NULL,NULL,NULL,'cc3e6b66-c906-4723-bf8b-f1e3bd9a4f48'),(2077,'TB New and Relapse Died','TB New and Relapse Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Died\n TB New and Relapse Died\n \n 2023-04-03 10:09:39 UTC\n \n 2023-04-03 10:26: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 2077\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','2023-04-03 12:09:39',4,'2023-04-03 12:26:07',4,0,NULL,NULL,NULL,'cdd51d3f-4922-459d-a23e-a62718354d0f'),(2078,'TB New and Relapse Lost to Follow-up','TB New and Relapse Lost to Follow-up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Lost to Follow-up\n TB New and Relapse Lost to Follow-up\n \n 2023-04-03 10:13:30 UTC\n \n 2023-04-03 10:22: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 2078\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','2023-04-03 12:13:30',4,'2023-04-03 12:22:25',4,0,NULL,NULL,NULL,'e63623be-d56c-4e8a-9fb8-fcbfd651b326'),(2079,'Ex Miner - Died','Ex Miner Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Died\n Ex Miner Died\n \n 2023-04-03 10:15:01 UTC\n \n 2023-04-03 10:18: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 2079\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','2023-04-03 12:15:01',4,'2023-04-03 12:18:31',4,0,NULL,NULL,NULL,'4c0567b3-bc02-4b62-be5b-4e348a8a17d5'),(2080,'Ex Miner - Lost','Ex Miner Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Lost\n Ex Miner Lost\n \n 2023-04-03 10:15:38 UTC\n \n 2023-04-03 10: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 2080\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','2023-04-03 12:15:38',4,'2023-04-03 12:20:44',4,0,NULL,NULL,NULL,'1001e669-922a-43ba-be6c-4e909e4d7f30'),(2081,'Ex Miner - Not Evaluated','Ex Miner Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Not Evaluated\n Ex Miner Not Evaluated\n \n 2023-04-03 10:16:26 UTC\n \n 2023-04-03 10:25: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 2081\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','2023-04-03 12:16:26',4,'2023-04-03 12:25:22',4,0,NULL,NULL,NULL,'95297d99-247c-4cb1-8454-8cde32e41699'),(2082,'Ex Miner - Completed','Ex Miner - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Completed\n Ex Miner - Completed\n \n 2023-04-03 10:21:16 UTC\n \n 2023-04-03 10:53: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 2082\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','2023-04-03 12:21:16',4,'2023-04-03 12:53:45',4,0,NULL,NULL,NULL,'6512f126-9e67-46ba-aaab-e783a36a4efa'),(2083,'Ex Miner - Moved Second Line','Ex Miner moved second line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Moved Second Line\n Ex Miner moved second line\n \n 2023-04-03 10:22:16 UTC\n \n 2023-04-03 10:24: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 2083\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','2023-04-03 12:22:16',4,'2023-04-03 12:24:44',4,0,NULL,NULL,NULL,'7de4354e-95cb-4f66-8d40-0bd243779ee4'),(2084,'TB New and Relapse Failed (Susceptible)','TB New and Relapse Failed (Susceptible)','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Failed (Susceptible)\n TB New and Relapse Failed (Susceptible)\n \n 2023-04-03 10:26:32 UTC\n \n 2023-04-03 11:24: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 2084\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','2023-04-03 12:26:32',4,'2023-04-03 13:24:51',4,0,NULL,NULL,NULL,'e3218a64-d243-48aa-9b9a-bbcda0104ae7'),(2085,'Ex Miner - Failed','Ex Miner - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Failed\n Ex Miner - Failed\n \n 2023-04-03 10:27:35 UTC\n \n 2023-04-03 11:24: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 2085\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','2023-04-03 12:27:35',4,'2023-04-03 13:24:34',4,0,NULL,NULL,NULL,'aa17ed03-51ed-4fde-8ad9-164f975ded80'),(2086,'TB New and Relapse Moved to second line treatment','TB New and Relapse Moved to second line treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Moved to second line treatment\n TB New and Relapse Moved to second line treatment\n \n 2023-04-03 10:27:42 UTC\n \n 2023-04-03 10:29: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 2086\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','2023-04-03 12:27:42',4,'2023-04-03 12:29:11',4,0,NULL,NULL,NULL,'687406cb-8ffe-4b7a-a806-583e78f04e48'),(2087,'Ex Miner - Cured','Ex Miner - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Ex Miner - Cured\n Ex Miner - Cured\n \n 2023-04-03 10:28:42 UTC\n \n 2023-04-04 09:25: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 2087\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','2023-04-03 12:28:42',4,'2023-04-04 11:25:16',4,0,NULL,NULL,NULL,'6210a6de-cdbc-411c-b9fc-e6a6bf2f42bc'),(2088,'Factory Worker - Complete','Factory Worker - Complete','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Complete\n Factory Worker - Complete\n \n 2023-04-03 11:31:19 UTC\n \n 2023-04-03 11:33: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 2088\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','2023-04-03 13:31:19',4,'2023-04-03 13:33:02',4,0,NULL,NULL,NULL,'d1ce4f4f-9869-4fdd-afa5-da1899ae3815'),(2089,'Factory Worker - Cured','Factory Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Cured\n Factory Worker - Cured\n \n 2023-04-03 11:35:29 UTC\n \n 2023-04-03 11:37: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 2089\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','2023-04-03 13:35:29',4,'2023-04-03 13:37:51',4,0,NULL,NULL,NULL,'b92fab4d-1381-445b-abb1-1ba06b0957d4'),(2090,'Factory Worker - Died','Factory Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Died\n Factory Worker - Died\n \n 2023-04-03 11:37:01 UTC\n \n 2023-04-03 11:39: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 2090\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','2023-04-03 13:37:01',4,'2023-04-03 13:39:08',4,0,NULL,NULL,NULL,'ef65034d-ed9d-452d-af2f-ababeecfa6ad'),(2091,'Factory Worker - Lost','Factory Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Lost\n Factory Worker - Lost\n \n 2023-04-03 11:38:56 UTC\n \n 2023-04-03 11:58: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 2091\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','2023-04-03 13:38:56',4,'2023-04-03 13:58:59',4,0,NULL,NULL,NULL,'a9e56df4-43a7-4387-828d-10c9dfb89245'),(2092,'Factory Worker - Not Evaluated','Factory Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Not Evaluated\n Factory Worker - Not Evaluated\n \n 2023-04-03 11:43:52 UTC\n \n 2023-04-03 11:59: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 2092\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','2023-04-03 13:43:52',4,'2023-04-03 13:59:10',4,0,NULL,NULL,NULL,'77cd1821-951d-42ed-a866-5f08fd800a9c'),(2093,'TB New and Relapse Not Evaluated','TB New and Relapse Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB New and Relapse Not Evaluated\n TB New and Relapse Not Evaluated\n \n 2023-04-03 11:45:15 UTC\n \n 2023-04-03 11:52: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 2093\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','2023-04-03 13:45:15',4,'2023-04-03 13:52:49',4,0,NULL,NULL,NULL,'8c3908aa-5ac3-4dc9-9261-cdd7fc07e365'),(2094,'Retreatment excluding Relapse Completed','Retreatment excluding Relapse Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Completed\n Retreatment excluding Relapse Completed\n \n 2023-04-03 19:27:03 UTC\n \n 2023-04-04 12:39: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 2094\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','2023-04-03 21:27:03',4,'2023-04-04 14:39:55',4,0,NULL,NULL,NULL,'f3df3cc6-11ba-4ef1-9b6b-eba700de0818'),(2095,'Factory Worker - Moved to 2nd line','Factory Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Moved to 2nd line\n Factory Worker - Moved to 2nd line\n \n 2023-04-03 19:33:19 UTC\n \n 2023-04-03 19:35: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 2095\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','2023-04-03 21:33:19',4,'2023-04-03 21:35:06',4,0,NULL,NULL,NULL,'9ac7ec7c-6fa1-4771-8cb3-bcfca51f5e4b'),(2096,'Retreatment excluding Relapse Cured','Retreatment excluding Relapse Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Cured\n Retreatment excluding Relapse Cured\n \n 2023-04-03 19:37:22 UTC\n \n 2023-04-03 19:42: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 2096\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','2023-04-03 21:37:22',4,'2023-04-03 21:42:14',4,0,NULL,NULL,NULL,'af4ccd45-738a-452f-ab0e-aa7588ecd131'),(2097,'Factory Worker - Failed','Factory Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Factory Worker - Failed\n Factory Worker - Failed\n \n 2023-04-03 19:44:52 UTC\n \n 2023-04-03 19:49: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 2097\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','2023-04-03 21:44:52',4,'2023-04-03 21:49:24',4,0,NULL,NULL,NULL,'f353300f-5673-4742-9115-c5b0b7e398e8'),(2098,'Retreatment excluding Relapse Died','Retreatment excluding Relapse Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Died\n Retreatment excluding Relapse Died\n \n 2023-04-03 19:48:30 UTC\n \n 2023-04-03 19:51: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 2098\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','2023-04-03 21:48:30',4,'2023-04-03 21:51:58',4,0,NULL,NULL,NULL,'ae6d7e28-203a-4141-b338-0a2faadc3662'),(2099,'Prison Worker - Died','Prison Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Died\n Prison Worker - Died\n \n 2023-04-03 19:50:39 UTC\n \n 2023-04-03 19:53: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 2099\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','2023-04-03 21:50:39',4,'2023-04-03 21:53:44',4,0,NULL,NULL,NULL,'93b06207-6e95-4711-aa58-31c3a88ef1c0'),(2100,'Prison Worker - Cured','Prison Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Cured\n Prison Worker - Cured\n \n 2023-04-03 19:53:11 UTC\n \n 2023-04-03 19:54: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 2100\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','2023-04-03 21:53:11',4,'2023-04-03 21:54:43',4,0,NULL,NULL,NULL,'2f32e1d7-b41d-4bb7-89a3-80c3243e4948'),(2101,'Retreatment excluding Relapse Lost to follow up','Retreatment excluding Relapse Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Lost to follow up\n Retreatment excluding Relapse Lost to follow up\n \n 2023-04-03 19:53:33 UTC\n \n 2023-04-03 19:55: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 2101\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','2023-04-03 21:53:33',4,'2023-04-03 21:55:20',4,0,NULL,NULL,NULL,'e5c0a844-b04b-40b4-99a4-32232d7a740e'),(2102,'Prison Worker - Completed','Prison Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Completed\n Prison Worker - Completed\n \n 2023-04-03 19:55:01 UTC\n \n 2023-04-03 20:00: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 2102\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','2023-04-03 21:55:01',4,'2023-04-03 22:00:15',4,0,NULL,NULL,NULL,'a4e75f76-e839-46af-bdc6-8218f3df823c'),(2103,'Retreatment excluding Relapse Failed','Retreatment excluding Relapse Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Failed\n Retreatment excluding Relapse Failed\n \n 2023-04-03 19:57:02 UTC\n \n 2023-04-03 20:01: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 2103\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','2023-04-03 21:57:02',4,'2023-04-03 22:01:44',4,0,NULL,NULL,NULL,'abea75a9-417c-4570-a63e-5739c02c765e'),(2104,'Prison Worker - Not Evaluated','Prison Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Not Evaluated\n Prison Worker - Not Evaluated\n \n 2023-04-03 19:59:02 UTC\n \n 2023-04-03 20:00: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 2104\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','2023-04-03 21:59:02',4,'2023-04-03 22:00:31',4,0,NULL,NULL,NULL,'5f8c563b-7314-4359-8bb4-4f9d51fe2257'),(2105,'TB Treatment Outcome - Block 2','Block 2: TB/HIV Activities','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 2\n Block 2: TB/HIV Activities\n \n 2023-04-03 20:01:22 UTC\n \n 2023-04-03 20:01: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 2105\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','2023-04-03 22:01:22',4,'2023-04-03 22:01:46',4,0,NULL,NULL,NULL,'e24dad06-5de1-4215-b021-85b95585a56b'),(2106,'TB Treatment Outcome - Block 2 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 2 Data Set\n \n 2023-04-03 20:01:46 UTC\n \n 2023-04-03 20:33: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 2106\n \n \n DM_Sex\n \n \n \n \n \n \n \n \n ARTNw&Rl_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 ARTNw&Rl_M\n \n \n \n \n DM_Sex\n Males\n \n \n \n \n \n ARTRetr_F\n \n \n \n \n \n \n \n \n \n ARTRetr_M\n \n \n \n \n \n \n DapNw&Rl_F\n \n \n \n \n \n \n \n \n \n DapNw&Rl_M\n \n \n \n \n \n \n DapRetre_F\n \n \n \n \n \n \n \n \n \n DapRetre_M\n \n \n \n \n \n \n PosNw&Rs_F\n \n \n \n \n \n \n \n \n \n PosNw&Rs_M\n \n \n \n \n \n \n PosRetr_F\n \n \n \n \n \n \n \n \n \n PosRetr_M\n \n \n \n \n \n \n StsNw&Rs_F\n \n \n \n \n \n \n \n \n \n StsNw&Rs_M\n \n \n \n \n \n \n StsRetre_F\n \n \n \n \n \n \n StsRetre_M\n \n \n \n \n \n \n','2023-04-03 22:01:46',4,'2023-04-03 22:33:35',4,0,NULL,NULL,NULL,'5730236a-dfc3-4bf5-8f18-3769e49f4519'),(2107,'Prison Worker - Failed','Prison Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Failed\n Prison Worker - Failed\n \n 2023-04-03 20:01:47 UTC\n \n 2023-04-03 20:07: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 2107\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','2023-04-03 22:01:47',4,'2023-04-03 22:07:43',4,0,NULL,NULL,NULL,'832801ab-b41b-4695-b0df-ada7c5c34ff7'),(2108,'Retreatment excluding Relapse Not Evaluated','Retreatment excluding Relapse Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Not Evaluated\n Retreatment excluding Relapse Not Evaluated\n \n 2023-04-03 20:02:36 UTC\n \n 2023-04-03 20:05: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 2108\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','2023-04-03 22:02:36',4,'2023-04-03 22:05:10',4,0,NULL,NULL,NULL,'9c3205c9-eb03-46c1-b7e8-a0e9fa4b4738'),(2109,'Prison Worker - Moved to 2nd line','Prison Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Moved to 2nd line\n Prison Worker - Moved to 2nd line\n \n 2023-04-03 20:02:41 UTC\n \n 2023-04-03 20:05: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 2109\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','2023-04-03 22:02:41',4,'2023-04-03 22:05:28',4,0,NULL,NULL,NULL,'cee1771f-3491-455f-9b0a-a35e99f25454'),(2110,'Retreatment excluding Relapse Moved to Secondline Treatment','Retreatment excluding Relapse Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Retreatment excluding Relapse Moved to Secondline Treatment\n Retreatment excluding Relapse Moved to Secondline Treatment\n \n 2023-04-03 20:06:37 UTC\n \n 2023-04-03 20:20: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 2110\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','2023-04-03 22:06:37',4,'2023-04-03 22:20:31',4,0,NULL,NULL,NULL,'ee732817-3760-4a2d-9d61-f7009cd0b256'),(2111,'Prison Worker - Lost','Prison Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Lost\n Prison Worker - Lost\n \n 2023-04-03 20:07:00 UTC\n \n 2023-04-03 20:10: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 2111\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','2023-04-03 22:07:00',4,'2023-04-03 22:10:16',4,0,NULL,NULL,NULL,'bfa5d083-f2ca-4c04-a6d3-193176de6d61'),(2112,'RetreatRetreatment excluding Relapse Moved to Secondline Treatment','RetreatRetreatment excluding Relapse Moved to Secondline Treatment','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n RetreatRetreatment excluding Relapse Moved to Secondline Treatment\n RetreatRetreatment excluding Relapse Moved to Secondline Treatment\n \n 2023-04-03 20:13:03 UTC\n \n 2023-04-03 20:14: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 2112\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.person_id in(Select distinct Id \n From( \n select distinct patient.patient_id AS Id, \n patient_identifier.identifier AS patientIdentifier, \n pi2.identifier AS TB_Number, \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 observed_age_group.name AS age_group, \n person.gender AS Gender, \n observed_age_group.sort_order AS sort_order \n from obs o \n -- TB Clients \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n LEFT JOIN patient_identifier pi2 ON pi2.patient_id = o.person_id AND pi2.identifier_type in (7) \n AND o.voided=0 \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' \n AND o.concept_id in (4153, 1158) \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 2237 and o.voided = 0 \n and o.value_datetime >= DATE_ADD(CAST(:startDate AS DATE), INTERVAL -12 MONTH) \n and o.value_datetime <= DATE_ADD(CAST(:endDate AS DATE), INTERVAL -12 MONTH) \n group by o.person_id \n ) \n -- Retreatment excluding Relapse \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3785 and o.value_coded in (3786,1037) \n and o.voided = 0 \n ) \n -- TB Treatment Outcome \n and o.person_id in ( \n select o.person_id \n from obs o \n where o.concept_id = 3792 and o.value_coded = 3794 \n and o.voided = 0 \n ) \n \n Group by o.person_id) AS TB_TESTING \n) \n\n','2023-04-03 22:13:03',4,'2023-04-03 22:14:36',4,0,NULL,NULL,NULL,'2573846a-4c51-4427-bcba-7ed91d2c0835'),(2113,'Health Worker - Died','Health Worker - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Died\n Health Worker - Died\n \n 2023-04-03 20:14:38 UTC\n \n 2023-04-03 20: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 2113\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','2023-04-03 22:14:38',4,'2023-04-03 22:16:57',4,0,NULL,NULL,NULL,'15cca65b-c4f6-4e32-8b7d-18cb047f999a'),(2114,'Health Worker - Cured','Health Worker - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Cured\n Health Worker - Cured\n \n 2023-04-03 20:16:23 UTC\n \n 2023-04-03 20:18: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 2114\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','2023-04-03 22:16:23',4,'2023-04-03 22:18:17',4,0,NULL,NULL,NULL,'efe0083b-cc7c-4394-bf4d-e4129ee2d998'),(2115,'Prison Worker - Completed','Prison Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Completed\n Prison Worker - Completed\n \n 2023-04-03 20:18:34 UTC\n \n 2023-04-03 20:22: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 2115\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','2023-04-03 22:18:34',4,'2023-04-03 22:22:51',4,0,NULL,NULL,NULL,'685d03a5-0f34-426e-aa83-e12e209284b4'),(2116,'Prison Worker - Failed','Prison Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Prison Worker - Failed\n Prison Worker - Failed\n \n 2023-04-03 20:20:00 UTC\n \n 2023-04-03 20:22: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 2116\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','2023-04-03 22:20:00',4,'2023-04-03 22:22:29',4,0,NULL,NULL,NULL,'792e1555-e40d-4ebf-8b96-ebbaa769f859'),(2117,'All TB HIV positive Completed','All TB HIV positive Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive Completed\n All TB HIV positive Completed\n \n 2023-04-03 20:21:28 UTC\n \n 2023-04-03 20:31: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 2117\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','2023-04-03 22:21:28',4,'2023-04-03 22:31:15',4,0,NULL,NULL,NULL,'18f345bc-6ed0-42d6-893a-05ba98b38e16'),(2118,'All TB HIV positive Cured','All TB HIV positive Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive Cured\n All TB HIV positive Cured\n \n 2023-04-03 20:25:37 UTC\n \n 2023-04-03 20:32: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 2118\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','2023-04-03 22:25:37',4,'2023-04-03 22:32:16',4,0,NULL,NULL,NULL,'4b6e2cd9-29b6-4f7b-8af7-0ab18e2af838'),(2119,'Health Worker - Completed','Health Worker - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Completed\n Health Worker - Completed\n \n 2023-04-03 20:32:38 UTC\n \n 2023-04-03 20:39: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 2119\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','2023-04-03 22:32:38',4,'2023-04-03 22:39:58',4,0,NULL,NULL,NULL,'b38f490e-8d26-411a-9073-2a7e5d17e235'),(2120,'All TB HIV positive and Died','All TB HIV positive and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Died\n All TB HIV positive and Died\n \n 2023-04-03 20:32:43 UTC\n \n 2023-04-03 20:35: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 2120\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','2023-04-03 22:32:43',4,'2023-04-03 22:35:39',4,0,NULL,NULL,NULL,'f0b13ce3-b836-4a27-a7a4-d1b83c1eb900'),(2121,'Health Worker - Not Evaluated','Health Worker - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Not Evaluated\n Health Worker - Not Evaluated\n \n 2023-04-03 20:32:56 UTC\n \n 2023-04-03 20: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 2121\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','2023-04-03 22:32:56',4,'2023-04-03 22:35:43',4,0,NULL,NULL,NULL,'9f750645-0dc4-488d-8a94-05e31d6b4838'),(2122,'All TB HIV positive and Lost to Follow Up','All TB HIV positive and Lost to Follow Up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Lost to Follow Up\n All TB HIV positive and Lost to Follow Up\n \n 2023-04-03 20:33:45 UTC\n \n 2023-04-03 20:36: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 2122\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','2023-04-03 22:33:45',4,'2023-04-03 22:36:08',4,0,NULL,NULL,NULL,'21738598-0974-4f31-9925-1c9606d66410'),(2123,'All TB HIV positive and Failed','All TB HIV positive and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Failed\n All TB HIV positive and Failed\n \n 2023-04-03 20:36:30 UTC\n \n 2023-04-03 20: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 2123\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','2023-04-03 22:36:30',4,'2023-04-03 22:40:18',4,0,NULL,NULL,NULL,'2a7766be-418e-4a5a-a204-c5fa91e6b672'),(2124,'All TB HIV positive and Not Evaluated','All TB HIV positive and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Not Evaluated\n All TB HIV positive and Not Evaluated\n \n 2023-04-03 20:37:09 UTC\n \n 2023-04-03 20:39: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 2124\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','2023-04-03 22:37:09',4,'2023-04-03 22:39:20',4,0,NULL,NULL,NULL,'04c0074a-fd87-44da-8d96-68d533e488ea'),(2125,'Health Worker - Lost','Health Worker - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Lost\n Health Worker - Lost\n \n 2023-04-03 20:40:25 UTC\n \n 2023-04-03 20: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 2125\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','2023-04-03 22:40:25',4,'2023-04-03 22:44:16',4,0,NULL,NULL,NULL,'925a50ba-435b-4213-a03b-6272a468cd01'),(2126,'All TB HIV positive and Moved to Secondline Treatment','All TB HIV positive and Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV positive and Moved to Secondline Treatment\n All TB HIV positive and Moved to Secondline Treatment\n \n 2023-04-03 20:40:57 UTC\n \n 2023-04-03 20:42: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 2126\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','2023-04-03 22:40:57',4,'2023-04-03 22:42:27',4,0,NULL,NULL,NULL,'6ed079c9-5ad9-4852-9523-95fddcbc9959'),(2127,'Health Worker - Failed','Health Worker - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Failed\n Health Worker - Failed\n \n 2023-04-03 20:42:41 UTC\n \n 2023-04-03 20:52: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 2127\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','2023-04-03 22:42:41',4,'2023-04-03 22:52:06',4,0,NULL,NULL,NULL,'4ec08d1c-6427-44e0-b604-b960e585b190'),(2128,'All TB HIV Negative and Completed','All TB HIV Negative and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Completed\n All TB HIV Negative and Completed\n \n 2023-04-03 20:43:07 UTC\n \n 2023-04-03 20:53: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 2128\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','2023-04-03 22:43:07',4,'2023-04-03 22:53:20',4,0,NULL,NULL,NULL,'d5786c86-ca76-43b1-b0a6-1bd90817af65'),(2129,'All TB HIV Negative and Cured','All TB HIV Negative and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Cured\n All TB HIV Negative and Cured\n \n 2023-04-03 20:44:07 UTC\n \n 2023-04-03 20:49: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 2129\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','2023-04-03 22:44:07',4,'2023-04-03 22:49:20',4,0,NULL,NULL,NULL,'a564539f-267c-452a-99d2-0f61f7c88c4f'),(2130,'Health Worker - Moved to 2nd line','Health Worker - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Health Worker - Moved to 2nd line\n Health Worker - Moved to 2nd line\n \n 2023-04-03 20:48:45 UTC\n \n 2023-04-03 20:55: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 2130\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','2023-04-03 22:48:45',4,'2023-04-03 22:55:46',4,0,NULL,NULL,NULL,'c0d08cc2-25dc-48f6-a9bc-db0d9b376d17'),(2131,'All TB HIV Negative and Died','All TB HIV Negative and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Died\n All TB HIV Negative and Died\n \n 2023-04-03 20:51:50 UTC\n \n 2023-04-03 20:55: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 2131\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','2023-04-03 22:51:50',4,'2023-04-03 22:55:29',4,0,NULL,NULL,NULL,'b375d3b0-9817-419c-ad36-5513383a0191'),(2132,'Public Transport - Died','Public Transport - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Died\n Public Transport - Died\n \n 2023-04-03 20:55:26 UTC\n \n 2023-04-03 20:57: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 2132\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','2023-04-03 22:55:26',4,'2023-04-03 22:57:21',4,0,NULL,NULL,NULL,'09f945ef-6ced-4c7c-924b-d83368e5b544'),(2133,'All TB HIV Negative and Failed','All TB HIV Negative and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Failed\n All TB HIV Negative and Failed\n \n 2023-04-03 20:56:21 UTC\n \n 2023-04-03 21:00: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 2133\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','2023-04-03 22:56:21',4,'2023-04-03 23:00:30',4,0,NULL,NULL,NULL,'bce54b53-dea6-4664-bc35-b436a74551f0'),(2134,'All TB HIV Negative and Lost to Follow Up','All TB HIV Negative and Lost to Follow Up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Lost to Follow Up\n All TB HIV Negative and Lost to Follow Up\n \n 2023-04-03 20:56:44 UTC\n \n 2023-04-03 21:00: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 2134\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','2023-04-03 22:56:44',4,'2023-04-03 23:00:04',4,0,NULL,NULL,NULL,'7b40659a-ca9a-4034-832f-5fddb0421d26'),(2135,'Public Transport - Not Evaluated','Public Transport - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Not Evaluated\n Public Transport - Not Evaluated\n \n 2023-04-03 20:56:54 UTC\n \n 2023-04-03 20:59: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 2135\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','2023-04-03 22:56:54',4,'2023-04-03 22:59:03',4,0,NULL,NULL,NULL,'0b001306-febd-4630-acb7-03fedc1eca0d'),(2136,'Public Transport - Completed','Public Transport - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Completed\n Public Transport - Completed\n \n 2023-04-03 20:58:25 UTC\n \n 2023-04-03 21:00: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 2136\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','2023-04-03 22:58:25',4,'2023-04-03 23:00:42',4,0,NULL,NULL,NULL,'cb8baffc-6e41-4464-91b4-478da43820ad'),(2137,'Public Transport - Lost','Public Transport - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Lost\n Public Transport - Lost\n \n 2023-04-03 21:00:25 UTC\n \n 2023-04-03 21:04: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 2137\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','2023-04-03 23:00:25',4,'2023-04-03 23:04:00',4,0,NULL,NULL,NULL,'68abf753-d909-4d9d-866b-d707b637b5f6'),(2138,'All TB HIV Negative and Not Evaluated','All TB HIV Negative and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Not Evaluated\n All TB HIV Negative and Not Evaluated\n \n 2023-04-03 21:00:53 UTC\n \n 2023-04-03 21:02: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 2138\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','2023-04-03 23:00:53',4,'2023-04-03 23:02:35',4,0,NULL,NULL,NULL,'56fc35af-e96c-4268-b7b4-0d63610a2d06'),(2139,'All TB HIV Negative and Moved to Secondline Treatment','All TB HIV Negative and Moved to Secondline Treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB HIV Negative and Moved to Secondline Treatment\n All TB HIV Negative and Moved to Secondline Treatment\n \n 2023-04-03 21:01:36 UTC\n \n 2023-04-03 21:02: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 2139\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','2023-04-03 23:01:36',4,'2023-04-03 23:02:58',4,0,NULL,NULL,NULL,'bdf99672-96f9-4eda-ad34-a82f5b59ffbc'),(2140,'Public Transport - Cured','Public Transport - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Cured\n Public Transport - Cured\n \n 2023-04-03 21:02:12 UTC\n \n 2023-04-03 21:06: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 2140\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','2023-04-03 23:02:12',4,'2023-04-03 23:06:24',4,0,NULL,NULL,NULL,'185b4be8-a666-4211-b22d-56dc426cbbcd'),(2141,'All TB Children (0-14 yrs) and Completed','All TB Children (0-14 yrs) and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Completed\n All TB Children (0-14 yrs) and Completed\n \n 2023-04-03 21:03:41 UTC\n \n 2023-04-03 21:05: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 2141\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','2023-04-03 23:03:41',4,'2023-04-03 23:05:56',4,0,NULL,NULL,NULL,'eb242fe9-dde6-4baa-b92f-7a7084920dd7'),(2142,'All TB Children (0-14 yrs) and Cured','All TB Children (0-14 yrs) and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Cured\n All TB Children (0-14 yrs) and Cured\n \n 2023-04-03 21:04:01 UTC\n \n 2023-04-03 21:06: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 2142\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','2023-04-03 23:04:01',4,'2023-04-03 23:06:20',4,0,NULL,NULL,NULL,'88c4f217-bf94-4e84-9d4b-15f6747276ae'),(2143,'Public Transport - Moved to 2nd line','Public Transport - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Moved to 2nd line\n Public Transport - Moved to 2nd line\n \n 2023-04-03 21:05:57 UTC\n \n 2023-04-03 21:10:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2143\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','2023-04-03 23:05:57',4,'2023-04-03 23:10:23',4,0,NULL,NULL,NULL,'3d87ffb3-cfb1-4ac5-bf47-dcb3193e133b'),(2144,'All TB Children (0-14 yrs) and Died','All TB Children (0-14 yrs) and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Died\n All TB Children (0-14 yrs) and Died\n \n 2023-04-03 21:06:48 UTC\n \n 2023-04-03 21:08: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 2144\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','2023-04-03 23:06:48',4,'2023-04-03 23:08:55',4,0,NULL,NULL,NULL,'30a341a8-2bf8-4e91-a9ee-41b6826e2cef'),(2145,'Public Transport - Failed','Public Transport - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Public Transport - Failed\n Public Transport - Failed\n \n 2023-04-03 21:07:43 UTC\n \n 2023-04-03 21:09: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 2145\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','2023-04-03 23:07:43',4,'2023-04-03 23:09:40',4,0,NULL,NULL,NULL,'e9843f95-15c2-4d15-bd2c-bdfc19bc4767'),(2146,'All TB Children (0-14 yrs) and Lost to follow up','All TB Children (0-14 yrs) and Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and Lost to follow up\n All TB Children (0-14 yrs) and Lost to follow up\n \n 2023-04-03 21:08:17 UTC\n \n 2023-04-03 21:16: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 2146\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','2023-04-03 23:08:17',4,'2023-04-03 23:16:59',4,0,NULL,NULL,NULL,'33f4111b-438c-4da8-bc56-0c588f408444'),(2147,'All TB Children (0-14 yrs) and failed','All TB Children (0-14 yrs) and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and failed\n All TB Children (0-14 yrs) and failed\n \n 2023-04-03 21:09:49 UTC\n \n 2023-04-03 21: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 2147\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','2023-04-03 23:09:49',4,'2023-04-03 23:17:30',4,0,NULL,NULL,NULL,'af568cf8-77aa-4d45-ab4f-ca39418ba77d'),(2148,'HHCM - Completed','HHCM - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Completed\n HHCM - Completed\n \n 2023-04-03 21:11:12 UTC\n \n 2023-04-03 21:13: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 2148\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','2023-04-03 23:11:12',4,'2023-04-03 23:13:17',4,0,NULL,NULL,NULL,'23d932aa-9c33-4aff-89ec-9028c25a03ef'),(2149,'All TB Children (0-14 yrs) and not evaluated','All TB Children (0-14 yrs) and not evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and not evaluated\n All TB Children (0-14 yrs) and not evaluated\n \n 2023-04-03 21:12:28 UTC\n \n 2023-04-03 21:15: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 2149\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','2023-04-03 23:12:28',4,'2023-04-03 23:15:26',4,0,NULL,NULL,NULL,'12a47e2e-735f-4b72-9e0c-f9fc792f3fc8'),(2150,'HHCM - Failed','HHCM - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Failed\n HHCM - Failed\n \n 2023-04-03 21:13:03 UTC\n \n 2023-04-03 21:35: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 2150\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','2023-04-03 23:13:03',4,'2023-04-03 23:35:08',4,0,NULL,NULL,NULL,'ce1c1a8e-9760-4a56-a885-4bc25de4f892'),(2151,'HHCM - Lost','HHCM - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Lost\n HHCM - Lost\n \n 2023-04-03 21:14:35 UTC\n \n 2023-04-03 21:36: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 2151\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','2023-04-03 23:14:35',4,'2023-04-03 23:36:26',4,0,NULL,NULL,NULL,'b9ee3b47-b5d7-42ed-9a47-4f61f77b6eeb'),(2152,'All TB Children (0-14 yrs) and moved to secondline treatment','All TB Children (0-14 yrs) and moved to secondline treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Children (0-14 yrs) and moved to secondline treatment\n All TB Children (0-14 yrs) and moved to secondline treatment\n \n 2023-04-03 21:18:05 UTC\n \n 2023-04-03 21:30: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 2152\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','2023-04-03 23:18:05',4,'2023-04-03 23:30:14',4,0,NULL,NULL,NULL,'692b0f3e-9c3e-4a71-bba3-b6ae50963679'),(2153,'All TB Adolescent (10-19 yrs) and Completed','All TB Adolescent (10-19 yrs) and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Completed\n All TB Adolescent (10-19 yrs) and Completed\n \n 2023-04-03 21:27:45 UTC\n \n 2023-04-03 21:29: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 2153\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','2023-04-03 23:27:45',4,'2023-04-03 23:29:16',4,0,NULL,NULL,NULL,'ad3dbe97-3718-4885-a76d-36982b68f507'),(2154,'All TB Adolescent (10-19 yrs) and Cured','All TB Adolescent (10-19 yrs) and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Cured\n All TB Adolescent (10-19 yrs) and Cured\n \n 2023-04-03 21:28:37 UTC\n \n 2023-04-03 21:30: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 2154\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','2023-04-03 23:28:37',4,'2023-04-03 23:30:39',4,0,NULL,NULL,NULL,'ee2cd03a-51b0-4f81-81cc-40ab687629a8'),(2155,'All TB Adolescent (10-19 yrs) and Died','All TB Adolescent (10-19 yrs) and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Died\n All TB Adolescent (10-19 yrs) and Died\n \n 2023-04-03 21:30:59 UTC\n \n 2023-04-03 21:33: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 2155\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','2023-04-03 23:30:59',4,'2023-04-03 23:33:07',4,0,NULL,NULL,NULL,'f27e06d5-38ff-443b-8ce0-3cebb07f2eec'),(2156,'All TB Adolescent (10-19 yrs) and Lost to follow up','All TB Adolescent (10-19 yrs) and Lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Lost to follow up\n All TB Adolescent (10-19 yrs) and Lost to follow up\n \n 2023-04-03 21:31:24 UTC\n \n 2023-04-03 21:33: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 2156\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','2023-04-03 23:31:24',4,'2023-04-03 23:33:27',4,0,NULL,NULL,NULL,'b7f7dbd4-f089-4ac4-9bc5-4c750a016a6c'),(2157,'All TB Adolescent (10-19 yrs) and failed','All TB Adolescent (10-19 yrs) and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and failed\n All TB Adolescent (10-19 yrs) and failed\n \n 2023-04-03 21:31:48 UTC\n \n 2023-04-03 21:38: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 2157\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','2023-04-03 23:31:48',4,'2023-04-03 23:38:15',4,0,NULL,NULL,NULL,'6ab5cc07-88e8-4b34-9cb6-8d451336945a'),(2158,'All TB Adolescent (10-19 yrs) and Not Evaluated','All TB Adolescent (10-19 yrs) and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Not Evaluated\n All TB Adolescent (10-19 yrs) and Not Evaluated\n \n 2023-04-03 21:34:28 UTC\n \n 2023-04-03 21:36: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 2158\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','2023-04-03 23:34:28',4,'2023-04-03 23:36:44',4,0,NULL,NULL,NULL,'4465b2b0-282f-4b7a-8acc-ba9018cf82ca'),(2159,'All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','All TB Adolescent (10-19 yrs) and Moved to Secondline treatment','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n All TB Adolescent (10-19 yrs) and Moved to Secondline treatment\n \n 2023-04-03 21:34:49 UTC\n \n 2023-04-03 21:37: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 2159\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','2023-04-03 23:34:49',4,'2023-04-03 23:37:16',4,0,NULL,NULL,NULL,'fc47f473-d8f7-4b44-b969-4aee12de4036'),(2160,'HHCM - Not Evaluated','HHCM - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Not Evaluated\n HHCM - Not Evaluated\n \n 2023-04-03 21:37:03 UTC\n \n 2023-04-03 21: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 2160\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','2023-04-03 23:37:03',4,'2023-04-03 23:42:22',4,0,NULL,NULL,NULL,'f801b15a-b96f-491f-a8b5-1fbee8ba9c83'),(2161,'Female and Completed','Female and Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Female and Completed\n Female and Completed\n \n 2023-04-03 21:37:55 UTC\n \n 2023-04-03 21:44: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 2161\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','2023-04-03 23:37:55',4,'2023-04-03 23:44:21',4,0,NULL,NULL,NULL,'615ab43e-7d60-462d-bab7-3ea00babd032'),(2162,'Female and Cured','Female and Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Female and Cured\n Female and Cured\n \n 2023-04-03 21:38:38 UTC\n \n 2023-04-03 21:46: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 2162\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','2023-04-03 23:38:38',4,'2023-04-03 23:46:42',4,0,NULL,NULL,NULL,'807438e3-b735-4310-9e68-24f15521e66d'),(2163,'HHCM - Cured','HHCM - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Cured\n HHCM - Cured\n \n 2023-04-03 21:38:56 UTC\n \n 2023-04-03 21:42: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 2163\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','2023-04-03 23:38:56',4,'2023-04-03 23:42:00',4,0,NULL,NULL,NULL,'352d4e3a-8ea5-4848-a515-ea4a3a091d8f'),(2164,'TB Female and Died','TB Female and Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Died\n TB Female and Died\n \n 2023-04-03 21:39:57 UTC\n \n 2023-04-03 21:47: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 2164\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','2023-04-03 23:39:57',4,'2023-04-03 23:47:30',4,0,NULL,NULL,NULL,'ab84625a-199b-4a80-99b9-9b89c8c02ba4'),(2165,'HHCM - Died','HHCM - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Died\n HHCM - Died\n \n 2023-04-03 21:43:38 UTC\n \n 2023-04-03 21:46: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 2165\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','2023-04-03 23:43:38',4,'2023-04-03 23:46:59',4,0,NULL,NULL,NULL,'144c7351-4092-442d-ab8d-91cf1d13698c'),(2166,'HHCM - Moved to 2nd line','HHCM - Moved to 2nd line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHCM - Moved to 2nd line\n HHCM - Moved to 2nd line\n \n 2023-04-03 21:44:32 UTC\n \n 2023-04-03 21:48: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 2166\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','2023-04-03 23:44:32',4,'2023-04-03 23:48:15',4,0,NULL,NULL,NULL,'a7391f1f-e1b2-415c-bde5-52d06b5616ad'),(2167,'TB Female and Lost to Follow up','TB Female and Lost to Follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Lost to Follow up\n TB Female and Lost to Follow up\n \n 2023-04-03 21:46:14 UTC\n \n 2023-04-03 21:48: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 2167\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','2023-04-03 23:46:14',4,'2023-04-03 23:48:16',4,0,NULL,NULL,NULL,'6ad8a1fc-9753-4d52-b40a-68c6c9089141'),(2168,'TB Female and Failed','TB Female and Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Failed\n TB Female and Failed\n \n 2023-04-03 21:47:53 UTC\n \n 2023-04-03 21:49: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 2168\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','2023-04-03 23:47:53',4,'2023-04-03 23:49:44',4,0,NULL,NULL,NULL,'676800f0-5583-436b-b7ab-815f7d884f96'),(2169,'TB Female and Not Evaluated','TB Female and Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and Not Evaluated\n TB Female and Not Evaluated\n \n 2023-04-03 21:48:58 UTC\n \n 2023-04-03 21: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 2169\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','2023-04-03 23:48:58',4,'2023-04-03 23:53:30',4,0,NULL,NULL,NULL,'67a2aa65-3b21-45f8-bdba-fe284d683360'),(2170,'TB Female and moved to secondline','TB Female and moved to secondline','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Female and moved to secondline\n TB Female and moved to secondline\n \n 2023-04-03 21:49:27 UTC\n \n 2023-04-03 21:51: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 2170\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','2023-04-03 23:49:27',4,'2023-04-03 23:51:19',4,0,NULL,NULL,NULL,'eac53c81-f295-41ae-989d-26f66888caae'),(2171,'HHXM - Completed','HHXM - Completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Completed\n HHXM - Completed\n \n 2023-04-03 21:51:36 UTC\n \n 2023-04-03 21:56: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 2171\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','2023-04-03 23:51:36',4,'2023-04-03 23:56:49',4,0,NULL,NULL,NULL,'558ce9d9-35d7-4d49-8b41-f4c8cc979bdf'),(2172,'HHXM - Cured','HHXM - Cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Cured\n HHXM - Cured\n \n 2023-04-03 21:51:55 UTC\n \n 2023-04-03 21:57: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 2172\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','2023-04-03 23:51:55',4,'2023-04-03 23:57:44',4,0,NULL,NULL,NULL,'56f5154b-cb21-456b-8e13-508a0dc032ff'),(2173,'TB Mine Workers and completed','TB Mine Workers and completed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and completed\n TB Mine Workers and completed\n \n 2023-04-03 21:53:08 UTC\n \n 2023-04-03 21:56: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 2173\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','2023-04-03 23:53:08',4,'2023-04-03 23:56:07',4,0,NULL,NULL,NULL,'a54130b0-7643-4865-9a0e-6c70215d3046'),(2174,'TB Mine Workers and cured','TB Mine Workers and cured','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and cured\n TB Mine Workers and cured\n \n 2023-04-03 21:53:49 UTC\n \n 2023-04-03 21: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 2174\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','2023-04-03 23:53:49',4,'2023-04-03 23:57:45',4,0,NULL,NULL,NULL,'f5957799-79ad-4f08-9a68-c359c4b69ce3'),(2175,'TB Mine Workers and died','TB Mine Workers and died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and died\n TB Mine Workers and died\n \n 2023-04-03 21:55:02 UTC\n \n 2023-04-03 21:57:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2175\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','2023-04-03 23:55:02',4,'2023-04-03 23:57:23',4,0,NULL,NULL,NULL,'fc3c4c67-738d-403a-9584-bd4a17942c24'),(2176,'HHXM - Died','HHXM - Died','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Died\n HHXM - Died\n \n 2023-04-03 21:56:35 UTC\n \n 2023-04-03 21:59: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 2176\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','2023-04-03 23:56:35',4,'2023-04-03 23:59:44',4,0,NULL,NULL,NULL,'2aaeab53-7906-480f-a51b-ebc9077a28ac'),(2177,'TB Mine Workers and lost to follow up','TB Mine Workers and lost to follow up','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and lost to follow up\n TB Mine Workers and lost to follow up\n \n 2023-04-03 21:58:16 UTC\n \n 2023-04-03 22: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 2177\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','2023-04-03 23:58:16',4,'2023-04-04 00:05:17',4,0,NULL,NULL,NULL,'2d37e108-26d4-4c69-aa41-dbcb4298d209'),(2178,'HHXM - Not Evaluated','HHXM - Not Evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Not Evaluated\n HHXM - Not Evaluated\n \n 2023-04-03 21:58:28 UTC\n \n 2023-04-03 22:01: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 2178\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','2023-04-03 23:58:28',4,'2023-04-04 00:01:46',4,0,NULL,NULL,NULL,'ffa409cc-0ce1-4ca0-9971-e339c3d29f8c'),(2179,'TB Mine Workers and failed','TB Mine Workers and failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and failed\n TB Mine Workers and failed\n \n 2023-04-03 21:58:31 UTC\n \n 2023-04-03 22: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 2179\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','2023-04-03 23:58:31',4,'2023-04-04 00:00:58',4,0,NULL,NULL,NULL,'f866bee9-323a-4a71-8e35-94cceaa3550d'),(2180,'TB Mine Workers and not evaluated','TB Mine Workers and not evaluated','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and not evaluated\n TB Mine Workers and not evaluated\n \n 2023-04-03 21:58:52 UTC\n \n 2023-04-03 22:04: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 2180\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','2023-04-03 23:58:52',4,'2023-04-04 00:04:47',4,0,NULL,NULL,NULL,'b2a2038e-f629-45ee-8033-f797caa6ac39'),(2181,'HHXM - Lost','HHXM - Lost','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Lost\n HHXM - Lost\n \n 2023-04-03 22:00:45 UTC\n \n 2023-04-03 22:04: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 2181\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','2023-04-04 00:00:45',4,'2023-04-04 00:04:15',4,0,NULL,NULL,NULL,'11bcf608-b1dd-492d-ba8a-cd3c9e19748f'),(2182,'HHXM - Failed','HHXM - Failed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Failed\n HHXM - Failed\n \n 2023-04-03 22:01:29 UTC\n \n 2023-04-03 22:11: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 2182\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','2023-04-04 00:01:29',4,'2023-04-04 00:11:06',4,0,NULL,NULL,NULL,'a10dc54c-654e-4f57-9df8-be1b14c50a14'),(2183,'TB Mine Workers and moved to secondline ','TB Mine Workers and moved to secondline ','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Mine Workers and moved to secondline \n TB Mine Workers and moved to secondline \n \n 2023-04-03 22:02:20 UTC\n \n 2023-04-03 22:11: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 2183\n COUNT\n \n \n \n \n endDate\n ${endDate}\n \n \n location\n ${location}\n \n \n startDate\n ${endDate}\n \n \n \n','2023-04-04 00:02:20',4,'2023-04-04 00:11:10',4,0,NULL,NULL,NULL,'e07ad771-1ec2-4d4a-a085-5433cc94b7de'),(2184,'HHXM - Moved to 2nd Line','HHXM - Moved to 2nd Line','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HHXM - Moved to 2nd Line\n HHXM - Moved to 2nd Line\n \n 2023-04-03 22:03:46 UTC\n \n 2023-04-03 22:08: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 2184\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','2023-04-04 00:03:46',4,'2023-04-04 00:08:51',4,0,NULL,NULL,NULL,'b12d1160-3ba1-4b39-92b9-e765d0d9fe55'),(2185,'TB Treatment Outcome - Block 1','TB Treatment Outcome - Block 1','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 1\n TB Treatment Outcome - Block 1\n \n 2023-04-03 22:07:23 UTC\n \n 2023-04-03 22:07: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 2185\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','2023-04-04 00:07:23',4,'2023-04-04 00:07:54',4,0,NULL,NULL,NULL,'a7cfcef1-57f5-4fbc-8a24-77fac2b219bf'),(2186,'TB Treatment Outcome - Block 1 Data Set',NULL,'org.openmrs.module.reporting.dataset.definition.DataSetDefinition','org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB Treatment Outcome - Block 1 Data Set\n \n 2023-04-03 22:07:54 UTC\n \n 2023-04-04 12:21: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 2186\n \n \n \n Fmale2nd\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 FmaleComp\n \n \n \n \n \n \n \n \n \n FmaleCured\n \n \n \n \n \n \n \n \n \n FmaleDied\n \n \n \n \n \n \n \n \n \n FmaleFaile\n \n \n \n \n \n \n \n \n \n FmaleLost\n \n \n \n \n \n \n \n \n \n FmaleNtEv\n \n \n \n \n \n \n \n \n \n Miner2nd\n \n \n \n \n \n \n \n \n \n MinerComp\n \n \n \n \n \n \n \n \n \n MinerCured\n \n \n \n \n \n \n \n \n \n MinerDied\n \n \n \n \n \n \n \n \n \n MinerFail\n \n \n \n \n \n \n \n \n \n MinerLost\n \n \n \n \n \n \n \n \n \n MinerNtEv\n \n \n \n \n \n \n \n \n \n NwRlps2nd\n \n \n \n \n \n \n \n \n \n NwRlpsComp\n \n \n \n \n \n \n \n \n \n NwRlpsCure\n \n \n \n \n \n \n \n \n \n NwRlpsDied\n \n \n \n \n \n \n \n \n \n NwRlpsLost\n \n \n \n \n \n \n \n \n \n NwRlpsNtEv\n \n \n \n \n \n \n \n \n \n NwRlpsfail\n \n \n \n \n \n \n \n \n \n RtrtEx2nd\n \n \n \n \n \n \n \n \n \n RtrtExComp\n \n \n \n \n \n \n \n \n \n RtrtExCure\n \n \n \n \n \n \n \n \n \n RtrtExDied\n \n \n \n \n \n \n \n \n \n RtrtExFail\n \n \n \n \n \n \n \n \n \n RtrtExLost\n \n \n \n \n \n \n \n \n \n RtrtExNtEv\n \n \n \n \n \n \n \n \n \n TBAdol2nd\n \n \n \n \n \n \n \n \n \n TBAdolComp\n \n \n \n \n \n \n \n \n \n TBAdolCure\n \n \n \n \n \n \n \n \n \n TBAdolDied\n \n \n \n \n \n \n \n \n \n TBAdolFail\n \n \n \n \n \n \n \n \n \n TBAdolLost\n \n \n \n \n \n \n \n \n \n TBAdolNtEv\n \n \n \n \n \n \n \n \n \n TBChld2nd\n \n \n \n \n \n \n \n \n \n TBChldCure\n \n \n \n \n \n \n \n \n \n TBChldDied\n \n \n \n \n \n \n \n \n \n TBChldFail\n \n \n \n \n \n \n \n \n \n TBChldLost\n \n \n \n \n \n \n \n \n \n TBChldNtEv\n \n \n \n \n \n \n \n \n \n TBNeg2nd\n \n \n \n \n \n \n \n \n \n TBNegCompl\n \n \n \n \n \n \n \n \n \n TBNegCured\n \n \n \n \n \n \n \n \n \n TBNegDied\n \n \n \n \n \n \n \n \n \n TBNegFaile\n \n \n \n \n \n \n \n \n \n TBNegLost\n \n \n \n \n \n \n \n \n \n TBNegNtEv\n \n \n \n \n \n \n \n \n \n TBPos2nd\n \n \n \n \n \n \n \n \n \n TBPosCompl\n \n \n \n \n \n \n \n \n \n TBPosCured\n \n \n \n \n \n \n \n \n \n TBPosDied\n \n \n \n \n \n \n \n \n \n TBPosFaile\n \n \n \n \n \n \n \n \n \n TBPosLost\n \n \n \n \n \n \n \n \n \n TBPosNtEv\n \n \n \n \n \n \n \n \n \n TbChldComp\n \n \n \n \n \n \n \n \n \n exM_comple\n \n \n \n \n \n \n \n \n \n exM_cured\n \n \n \n \n \n \n \n \n \n exM_died\n \n \n \n \n \n \n \n \n \n exM_failed\n \n \n \n \n \n \n \n \n \n exM_lost\n \n \n \n \n \n \n \n \n \n exM_moved\n \n \n \n \n \n \n \n \n \n exM_noteEv\n \n \n \n \n \n \n \n \n \n fact_Died\n \n \n \n \n \n \n \n \n \n fact_compl\n \n \n \n \n \n \n \n \n \n fact_cured\n \n \n \n \n \n \n fact_fail\n \n \n \n \n \n \n \n \n \n fact_lost\n \n \n \n \n \n \n \n \n \n fact_moved\n \n \n \n \n \n \n \n \n \n fact_notEv\n \n \n \n \n \n \n \n \n \n hcw_comple\n \n \n \n \n \n \n \n \n \n hcw_cured\n \n \n \n \n \n \n \n \n \n hcw_died\n \n \n \n \n \n \n \n \n \n hcw_failed\n \n \n \n \n \n \n \n \n \n hcw_lost\n \n \n \n \n \n \n \n \n \n hcw_moved\n \n \n \n \n \n \n \n \n \n hcw_notEva\n \n \n \n \n \n \n \n \n \n hhcm_compl\n \n \n \n \n \n \n \n \n \n hhcm_cured\n \n \n \n \n \n \n \n \n \n hhcm_died\n \n \n \n \n \n \n \n \n \n hhcm_evalu\n \n \n \n \n \n \n \n \n \n hhcm_faile\n \n \n \n \n \n \n \n \n \n hhcm_lost\n \n \n \n \n \n \n \n \n \n hhcm_moved\n \n \n \n \n \n \n \n \n \n hhx_comple\n \n \n \n \n \n \n \n \n \n hhxm_cured\n \n \n \n \n \n \n \n \n \n hhxm_died\n \n \n \n \n \n \n \n \n \n hhxm_faile\n \n \n \n \n \n \n \n \n \n hhxm_lost\n \n \n \n \n \n \n \n \n \n hhxm_moved\n \n \n \n \n \n \n \n \n \n hhxm_notEv\n \n \n \n \n \n \n \n \n \n ptran_comp\n \n \n \n \n \n \n \n \n \n ptran_cure\n \n \n \n \n \n \n \n \n \n ptran_died\n \n \n \n \n \n \n \n \n \n ptran_eval\n \n \n \n \n \n \n \n \n \n ptran_fail\n \n \n \n \n \n \n \n \n \n ptran_lost\n \n \n \n \n \n \n \n \n \n ptran_move\n \n \n \n \n \n \n \n \n \n','2023-04-04 00:07:54',4,'2023-04-04 14:21:10',4,0,NULL,NULL,NULL,'71fbb539-96d9-420c-9b3c-1edeab07e722'),(2187,'ART clients with visits started','ART clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients with visits started\n ART clients with visits started\n \n 2023-09-12 06:56:00 UTC\n \n 2023-09-12 12:37: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 2187\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n LEFT JOIN patient_identifier pi ON v.patient_id = pi.patient_id AND pi.identifier_type in (5,12) \n JOIN patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1, 2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id and vt.visit_type_id in (10,19) \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 08:56:00',4,'2023-09-12 14:37:33',4,0,NULL,NULL,NULL,'c2a66624-e139-45f7-8c90-f91fe006bf28'),(2188,'ART clients with visits consulted','ART clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients with visits consulted\n ART clients with visits consulted\n \n 2023-09-12 07:24:59 UTC\n \n 2023-09-12 12:36: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 2188\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n LEFT JOIN patient_identifier pi ON v.patient_id = pi.patient_id AND pi.identifier_type in (5,12) \n JOIN patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id and vt.visit_type_id in (10,19) \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id in (3843, 4276) and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 09:24:59',4,'2023-09-12 14:36:15',4,0,NULL,NULL,NULL,'b8a0cecd-d90d-464e-b3ad-2f81fe25fd6a'),(2189,'ART clients with visits started','ART clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients with visits started\n ART clients with visits started\n \n 2023-09-12 07:32:18 UTC\n \n 2023-09-12 07:33: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 2189\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','2023-09-12 09:32:18',4,'2023-09-12 09:33:15',4,0,NULL,NULL,NULL,'0c0aa602-b876-48f8-b7ff-50c86a8f0426'),(2190,'ART clients with visits consulted','ART clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ART clients with visits consulted\n ART clients with visits consulted\n \n 2023-09-12 07:33:45 UTC\n \n 2023-09-12 07:34: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 2190\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','2023-09-12 09:33:45',4,'2023-09-12 09:34:51',4,0,NULL,NULL,NULL,'fe38b105-3e09-4ba6-a2be-d4972c76732d'),(2191,'eRegister Weekly Report','eRegister Weekly Report','org.openmrs.module.reporting.report.definition.ReportDefinition','org.openmrs.module.reporting.report.definition.PeriodIndicatorReportDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n eRegister Weekly Report\n eRegister Weekly Report\n \n 2023-09-12 07:36:34 UTC\n \n 2023-09-12 07:36: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 2191\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','2023-09-12 09:36:34',4,'2023-09-12 09:36:46',4,0,NULL,NULL,NULL,'332a3e45-5a4b-4745-83af-1fcef7714fef'),(2192,'eRegister Weekly 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 eRegister Weekly Report Data Set\n \n 2023-09-12 07:36:46 UTC\n \n 2023-09-15 08:37: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 2192\n \n \n \n ANC_Consul\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 ANC_Seen\n \n \n \n \n \n \n \n \n \n ANC_Visits\n \n \n \n \n \n \n \n \n \n ART_Consul\n \n \n \n \n \n \n \n \n \n ART_Visits\n \n \n \n \n \n \n \n \n \n Cerv_Consu\n \n \n \n \n \n \n \n \n \n Cerv_Scree\n \n \n \n \n \n \n \n \n \n Cerv_Visit\n \n \n \n \n \n \n \n \n \n FP_Consult\n \n \n \n \n \n \n \n \n \n FP_Seen\n \n \n \n \n \n \n \n \n \n FP_Visits\n \n \n \n \n \n \n \n \n \n HEI_Consul\n \n \n \n \n \n \n \n \n \n HEI_Seen\n \n \n \n \n \n \n \n \n \n HEI_Visits\n \n \n \n \n \n \n \n \n \n HTS_Consul\n \n \n \n \n \n \n \n \n \n HTS_Seen\n \n \n \n \n \n \n \n \n \n HTS_Visits\n \n \n \n \n \n \n \n \n \n LTest_Sent\n \n \n \n \n \n \n \n \n \n LTests_Rev\n \n \n \n \n \n \n \n \n \n PNC_Attend\n \n \n \n \n \n \n \n \n \n PNC_Consul\n \n \n \n \n \n \n \n \n \n PNC_Visits\n \n \n \n \n \n \n \n \n \n Self_tes_D\n \n \n \n \n \n \n \n \n \n TB_Consult\n \n \n \n \n \n \n \n \n \n TB_Visits\n \n \n \n \n \n \n \n \n \n Tx_New\n \n \n \n \n \n \n \n \n \n Under5_Con\n \n \n \n \n \n \n \n \n \n Under5_See\n \n \n \n \n \n \n \n \n \n Under5_Vis\n \n \n \n \n \n \n \n \n \n','2023-09-12 09:36:46',4,'2023-09-15 10:37:03',4,0,NULL,NULL,NULL,'ad789e29-0db0-40df-b439-644f5c4a5d8b'),(2193,'HTS clients with visits started','HTS clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS clients with visits started\n HTS clients with visits started\n \n 2023-09-12 10:53:23 UTC\n \n 2023-09-12 12: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 2193\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 15 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 12:53:23',4,'2023-09-12 14:12:55',4,0,NULL,NULL,NULL,'76dec84d-5ba5-4633-8410-cfcb953c9021'),(2194,'HTS clients with visits consulted','HTS clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS clients with visits consulted\n HTS clients with visits consulted\n \n 2023-09-12 11:01:17 UTC\n \n 2023-09-12 12: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 2194\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4238 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 15 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 13:01:17',4,'2023-09-12 14:14:21',4,0,NULL,NULL,NULL,'bc11e223-4783-4ac2-b878-9ab17c557f12'),(2195,'HTS clients with visits started','HTS clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS clients with visits started\n HTS clients with visits started\n \n 2023-09-12 11:03:06 UTC\n \n 2023-09-12 11: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 2195\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','2023-09-12 13:03:06',4,'2023-09-12 13:03:45',4,0,NULL,NULL,NULL,'64c83bb0-1470-4b9c-a881-7ae18d01d571'),(2196,'HTS clients with visits consulted','HTS clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS clients with visits consulted\n HTS clients with visits consulted\n \n 2023-09-12 11:04:08 UTC\n \n 2023-09-12 11:04: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 2196\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','2023-09-12 13:04:08',4,'2023-09-12 13:04:54',4,0,NULL,NULL,NULL,'cc415fbf-689b-4603-9853-9029f62e403a'),(2197,'TB clients with visits started','TB clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB clients with visits started\n TB clients with visits started\n \n 2023-09-12 12:39:33 UTC\n \n 2023-09-12 12:40: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 2197\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 13 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 14:39:33',4,'2023-09-12 14:40:12',4,0,NULL,NULL,NULL,'c45876bc-c8dd-4cda-9ec0-755763c0416d'),(2198,'TB clients with visits consulted','TB clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB clients with visits consulted\n TB clients with visits consulted\n \n 2023-09-12 12:45:38 UTC\n \n 2023-09-14 07:29: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 2198\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id in (4153,1158) and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 13 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 14:45:38',4,'2023-09-14 09:29:18',4,0,NULL,NULL,NULL,'5bb95c0c-ccd8-45da-bf6b-e908d103a91c'),(2199,'PNC clients with visits started','PNC clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PNC clients with visits started\n PNC clients with visits started\n \n 2023-09-12 13:30:44 UTC\n \n 2023-09-12 13:30: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 2199\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 17 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:30:44',4,'2023-09-12 15:30:59',4,0,NULL,NULL,NULL,'76f941d9-7e65-4235-bff1-4c0293a151dc'),(2200,'PNC clients with visits consulted','PNC clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PNC clients with visits consulted\n PNC clients with visits consulted\n \n 2023-09-12 13:33:43 UTC\n \n 2023-09-12 13:33: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 2200\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4386 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 17 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:33:43',4,'2023-09-12 15:33:59',4,0,NULL,NULL,NULL,'933a9b56-bccd-41e0-9f3d-7ccfc1f46ccb'),(2201,'ANC clients with visits started','ANC clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC clients with visits started\n ANC clients with visits started\n \n 2023-09-12 13:34:57 UTC\n \n 2023-09-12 13:35: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 2201\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 16 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:34:57',4,'2023-09-12 15:35:45',4,0,NULL,NULL,NULL,'d7753521-1348-447a-8a11-9386f61cb45a'),(2202,'ANC clients with visits consulted','ANC clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC clients with visits consulted\n ANC clients with visits consulted\n \n 2023-09-12 13:36:36 UTC\n \n 2023-09-12 13:37: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 2202\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4663 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 16 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:36:36',4,'2023-09-12 15:37:47',4,0,NULL,NULL,NULL,'4f74cd1f-d5c7-4ffe-9437-1ef70853b211'),(2203,'Under 5 clients with visits started','Under 5 clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under 5 clients with visits started\n Under 5 clients with visits started\n \n 2023-09-12 13:40:35 UTC\n \n 2023-09-12 13:42: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 2203\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 20 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:40:35',4,'2023-09-12 15:42:13',4,0,NULL,NULL,NULL,'6aef5acf-d21f-4dc6-b136-d40cd7e32437'),(2204,'Under 5 clients with visits consulted','Under 5 clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under 5 clients with visits consulted\n Under 5 clients with visits consulted\n \n 2023-09-12 13:44:17 UTC\n \n 2023-09-12 13:44: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 2204\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4285 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 20 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:44:17',4,'2023-09-12 15:44:32',4,0,NULL,NULL,NULL,'0ab08cfc-7d8f-46ad-864f-8559473e8f1e'),(2205,'Cervical Cancer Screening clients with visits started','Cervical Cancer Screening clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients with visits started\n Cervical Cancer Screening clients with visits started\n \n 2023-09-12 13:46:19 UTC\n \n 2023-09-12 13:47: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 2205\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 21 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:46:19',4,'2023-09-12 15:47:17',4,0,NULL,NULL,NULL,'7c4c714a-b336-46e3-a0c6-5059095f81ee'),(2206,'Cervical Cancer Screening clients with visits consulted','Cervical Cancer Screening clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients with visits consulted\n Cervical Cancer Screening clients with visits consulted\n \n 2023-09-12 13:48:08 UTC\n \n 2023-09-12 13: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 2206\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4511 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 21 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:48:08',4,'2023-09-12 15:48:52',4,0,NULL,NULL,NULL,'73de810b-e4ef-4478-8615-18e37b6c876a'),(2207,'HEI clients with visits started','HEI clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI clients with visits started\n HEI clients with visits started\n \n 2023-09-12 13:50:19 UTC\n \n 2023-09-12 13:50: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 2207\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 18 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:50:19',4,'2023-09-12 15:50:34',4,0,NULL,NULL,NULL,'c1723ac0-86c2-48c4-97f9-8b22fc7640b3'),(2208,'HEI clients with visits consulted','HEI clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI clients with visits consulted\n HEI clients with visits consulted\n \n 2023-09-12 13:51:20 UTC\n \n 2023-09-12 13:52: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 2208\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id in (4558, 4186) and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 18 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:51:20',4,'2023-09-12 15:52:50',4,0,NULL,NULL,NULL,'20714da4-09b6-4291-a411-82eb08f66306'),(2209,'Family Planning clients with visits started','Family Planning clients with visits started','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning clients with visits started\n Family Planning clients with visits started\n \n 2023-09-12 13:54:49 UTC\n \n 2023-09-12 13:55: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 2209\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \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 WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 22 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:54:49',4,'2023-09-12 15:55:02',4,0,NULL,NULL,NULL,'0263856e-7605-45b5-b1e0-7518cacf48aa'),(2210,'Family Planning clients with visits consulted','Family Planning clients with visits consulted','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning clients with visits consulted\n Family Planning clients with visits consulted\n \n 2023-09-12 13:55:48 UTC\n \n 2023-09-12 13:56: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 2210\n select distinct o.person_id \nfrom obs o \nwhere o.person_id in \n ( \n SELECT DISTINCT p.person_id as id \n FROM visit v \n JOIN person_name pn on v.patient_id = pn.person_id and pn.voided=0 \n JOIN person p on p.person_id = v.patient_id \n JOIN encounter en on en.visit_id = v.visit_id and en.voided=0 and en.encounter_type in (1,2) \n JOIN visit_type vt on vt.visit_type_id = vt.visit_type_id \n JOIN obs o on o.encounter_id=en.encounter_id \n and o.concept_id = 4557 and o.voided =0 \n JOIN location l on v.location_id = l.location_id and l.retired=0 \n WHERE CAST(en.encounter_datetime AS DATE) >= CAST(:startDate AS DATE) and CAST(en.encounter_datetime AS DATE)<= CAST(:endDate AS DATE) \n and v.visit_type_id = 22 \n and (v.location_id = :location or parent_location = :location) \n \n )\n','2023-09-12 15:55:48',4,'2023-09-12 15:56:50',4,0,NULL,NULL,NULL,'d64428a3-2b04-4f7a-bd7c-8c320ec89352'),(2211,'Clients with LAB tests sent','Clients with LAB tests sent','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with LAB tests sent\n Clients with LAB tests sent\n \n 2023-09-12 14:17:55 UTC\n \n 2023-09-12 14:19: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 2211\n select distinct patient.patient_id AS Id \n from orders o \n INNER JOIN patient ON o.patient_id = patient.patient_id \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 AND patient_identifier.preferred=1 \n AND o.concept_id = 5484 \n AND CAST(o.date_created AS DATE)>= CAST(:startDate AS DATE) \n AND CAST(o.date_created AS DATE) <= CAST(:endDate AS DATE) \n LEFT OUTER JOIN patient_identifier p ON p.patient_id = person.person_id AND p.identifier_type = 5\n','2023-09-12 16:17:55',4,'2023-09-12 16:19:03',4,0,NULL,NULL,NULL,'26c9b2c4-212d-425a-9184-0fabc7335738'),(2212,'Clients with LAB tests received','Clients with LAB tests received','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with LAB tests received\n Clients with LAB tests received\n \n 2023-09-12 14:22:22 UTC\n \n 2023-09-12 14:22: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 2212\n select o.person_id \nfrom obs o \ninner join \n ( \n select oss.person_id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.obs_id)), 20) as observation_id \n from obs oss \n where oss.concept_id = 5486 and oss.voided=0 \n and cast(oss.obs_datetime as date) >= cast('#startDate#' as date) \n and cast(oss.obs_datetime as date) <= cast('#endDate#' as date) \n group by oss.person_id \n )latest \n on latest.person_id = o.person_id \n where o.concept_id = 5486 \n and o.obs_datetime = max_observation\n','2023-09-12 16:22:22',4,'2023-09-12 16:22:52',4,0,NULL,NULL,NULL,'384afee1-9300-4da9-aff1-3de2123311a0'),(2213,'TB clients with visits started','TB clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB clients with visits started\n TB clients with visits started\n \n 2023-09-12 14:44:46 UTC\n \n 2023-09-12 14:47: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 2213\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','2023-09-12 16:44:46',4,'2023-09-12 16:47:10',4,0,NULL,NULL,NULL,'88c9888a-c42b-4e31-8f16-f0a707319029'),(2214,'TB clients with visits consulted','TB clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n TB clients with visits consulted\n TB clients with visits consulted\n \n 2023-09-12 14:48:10 UTC\n \n 2023-09-12 14: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 2214\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','2023-09-12 16:48:10',4,'2023-09-12 16:48:52',4,0,NULL,NULL,NULL,'13b27045-3621-4e06-b51e-ff82ee43222b'),(2215,'PNC clients with visits started','PNC clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PNC clients with visits started\n PNC clients with visits started\n \n 2023-09-12 14:49:27 UTC\n \n 2023-09-12 14: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 2215\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','2023-09-12 16:49:27',4,'2023-09-12 16:50:07',4,0,NULL,NULL,NULL,'3b519d56-9703-4e07-927e-d8cb3c94db7e'),(2216,'PNC clients with visits consulted','PNC clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n PNC clients with visits consulted\n PNC clients with visits consulted\n \n 2023-09-12 14:50:37 UTC\n \n 2023-09-12 14:51: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 2216\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','2023-09-12 16:50:37',4,'2023-09-12 16:51:18',4,0,NULL,NULL,NULL,'16cec973-0372-4877-98e3-be05cd2109ed'),(2217,'ANC clients with visits started','ANC clients with visits starte','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC clients with visits started\n ANC clients with visits starte\n \n 2023-09-12 14:51:48 UTC\n \n 2023-09-12 14:52:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2217\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','2023-09-12 16:51:48',4,'2023-09-12 16:52:23',4,0,NULL,NULL,NULL,'78f5d682-1cf9-4389-80c5-d0be0f945c2f'),(2218,'ANC clients with visits consulted','ANC clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC clients with visits consulted\n ANC clients with visits consulted\n \n 2023-09-12 14:52:59 UTC\n \n 2023-09-12 14:53: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 2218\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','2023-09-12 16:52:59',4,'2023-09-12 16:53:37',4,0,NULL,NULL,NULL,'5e3a103a-98f6-4e0c-80bd-95dcb87e6798'),(2219,'Under 5 clients with visits started','Under 5 clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under 5 clients with visits started\n Under 5 clients with visits started\n \n 2023-09-12 14:55:14 UTC\n \n 2023-09-12 14:55: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 2219\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','2023-09-12 16:55:14',4,'2023-09-12 16:55:48',4,0,NULL,NULL,NULL,'40c8e1a0-e396-421f-baea-746b2e9e209b'),(2220,'Under 5 clients with visits consulted','Under 5 clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under 5 clients with visits consulted\n Under 5 clients with visits consulted\n \n 2023-09-12 14:56:21 UTC\n \n 2023-09-12 14:56: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 2220\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','2023-09-12 16:56:21',4,'2023-09-12 16:56:57',4,0,NULL,NULL,NULL,'fbc213f1-75b0-40df-ba5c-72d3c50950d8'),(2221,'Cervical Cancer Screening clients with visits started','Cervical Cancer Screening clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients with visits started\n Cervical Cancer Screening clients with visits started\n \n 2023-09-14 06:41:35 UTC\n \n 2023-09-14 06:42: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 2221\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','2023-09-14 08:41:35',4,'2023-09-14 08:42:26',4,0,NULL,NULL,NULL,'4b964ce4-a35d-46f2-858d-4bc86d831518'),(2222,'Cervical Cancer Screening clients with visits consulted','Cervical Cancer Screening clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients with visits consulted\n Cervical Cancer Screening clients with visits consulted\n \n 2023-09-14 06:43:09 UTC\n \n 2023-09-14 06:44: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 2222\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','2023-09-14 08:43:09',4,'2023-09-14 08:44:17',4,0,NULL,NULL,NULL,'853c7464-f7a9-4c79-a45e-df82fffc5f64'),(2223,'HEI clients with visits started','HEI clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI clients with visits started\n HEI clients with visits started\n \n 2023-09-14 06:45:04 UTC\n \n 2023-09-14 06:45: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 2223\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','2023-09-14 08:45:04',4,'2023-09-14 08:45:44',4,0,NULL,NULL,NULL,'f13a88b4-8d75-49f8-add3-2e696c45d782'),(2224,'Clients with LAB tests sent','Clients with LAB tests sent','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with LAB tests sent\n Clients with LAB tests sent\n \n 2023-09-14 06:47:05 UTC\n \n 2023-09-14 06:49: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 2224\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','2023-09-14 08:47:05',4,'2023-09-14 08:49:02',4,0,NULL,NULL,NULL,'598136ca-6ab4-4bf4-9c89-462c98aae1b8'),(2225,'Clients with LAB tests received','Clients with LAB tests received','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients with LAB tests received\n Clients with LAB tests received\n \n 2023-09-14 06:49:53 UTC\n \n 2023-09-14 06:50: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 2225\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','2023-09-14 08:49:53',4,'2023-09-14 08:50:37',4,0,NULL,NULL,NULL,'7ee4d573-3368-4f38-9bf1-a7c866ba9745'),(2226,'Family Planning clients with visits started','Family Planning clients with visits started','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning clients with visits started\n Family Planning clients with visits started\n \n 2023-09-14 06:51:15 UTC\n \n 2023-09-14 06:52: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 2226\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','2023-09-14 08:51:15',4,'2023-09-14 08:52:05',4,0,NULL,NULL,NULL,'9d21c392-a8cb-4084-ba76-bd52fcd4cfb4'),(2227,'Family Planning clients with visits consulted','Family Planning clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning clients with visits consulted\n Family Planning clients with visits consulted\n \n 2023-09-14 06:52:36 UTC\n \n 2023-09-14 06:53: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 2227\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','2023-09-14 08:52:36',4,'2023-09-14 08:53:11',4,0,NULL,NULL,NULL,'04026cdd-fb90-417b-95ee-f3f8d6fcab82'),(2228,'HEI clients with visits consulted','HEI clients with visits consulted','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI clients with visits consulted\n HEI clients with visits consulted\n \n 2023-09-14 07:12:31 UTC\n \n 2023-09-14 07:13: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 2228\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','2023-09-14 09:12:31',4,'2023-09-14 09:13:36',4,0,NULL,NULL,NULL,'76084af9-f1f1-4817-b04a-e58d415cf7fe'),(2229,'Clients initiated on ART this month','Clients initiated on ART this month','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients initiated on ART this month\n Clients initiated on ART this month\n \n 2023-09-15 07:56:56 UTC\n \n 2023-09-15 07:58: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 2229\n select distinct patient.patient_id AS Id \n \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 \n \n AND MONTH(o.value_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(o.value_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \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 os.voided = 0 \n AND MONTH(os.obs_datetime) = MONTH(CAST(:endDate AS DATE)) \n AND YEAR(os.obs_datetime) = YEAR(CAST(:endDate AS DATE)) \n ) \n \n and o.person_id not in ( \n select person_id \n from person \n where death_date <= cast(:endDate as date) \n and dead = 1 and 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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \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'\n','2023-09-15 09:56:56',4,'2023-09-15 09:58:25',4,0,NULL,NULL,NULL,'1e3e1f7b-fabb-481c-bc34-b4cf94e458a1'),(2230,'HTS Clients Seen','HTS Clients Seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Clients Seen\n HTS Clients Seen\n \n 2023-09-15 07:59:57 UTC\n \n 2023-09-15 08:00: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 2230\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.person_id in( \nSELECT Id \nFROM ( \n select distinct o.person_id as Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n where o.concept_id = 4845 and o.value_coded = 4847 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) as A \n)\n','2023-09-15 09:59:57',4,'2023-09-15 10:00:21',4,0,NULL,NULL,NULL,'fabd6e8c-2164-49aa-8516-5c0404e300b6'),(2231,'ANC Clients Seen','ANC Clients Seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC Clients Seen\n ANC Clients Seen\n \n 2023-09-15 08:06:37 UTC\n \n 2023-09-15 08:08:23 UTC\n \n \n startDate\n \n java.util.Date\n true\n \n \n endDate\n \n java.util.Date\n true\n \n \n location\n \n org.openmrs.Location\n true\n \n \n 2231\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.person_id in( \nSELECT Id \nFROM ( \n select distinct o.person_id as Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n where o.concept_id = 4663 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) as A \n)\n','2023-09-15 10:06:37',4,'2023-09-15 10:08:23',4,0,NULL,NULL,NULL,'6c895f86-6ab1-4b33-8636-df9d9eb6a207'),(2232,'HEI Clients Seen','HEI Clients Seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI Clients Seen\n HEI Clients Seen\n \n 2023-09-15 08:10:47 UTC\n \n 2023-09-15 08:11: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 2232\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.person_id in( \nSELECT Id \nFROM ( \n select distinct o.person_id as Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n where o.concept_id = 4558 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) as A \n)\n','2023-09-15 10:10:47',4,'2023-09-15 10:11:01',4,0,NULL,NULL,NULL,'fdae6049-6171-40e5-bdc8-d384782d5cb7'),(2233,'Self test Kits distributed','Self test Kits distributed','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Self test Kits distributed\n Self test Kits distributed\n \n 2023-09-15 08:10:50 UTC\n \n 2023-09-15 08:12: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 2233\n (select patient.patient_id AS Id \n from obs o \n -- HTS SELF TEST STRATEGY \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n AND o.concept_id = 4833 and o.value_coded = 4834 \n AND patient.voided = 0 AND o.voided = 0 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \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' \n ) \n \nUNION ALL \n(select patient.patient_id AS Id \n from obs o \n -- HTS SELF TEST STRATEGY \n INNER JOIN patient ON o.person_id = patient.patient_id \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 AND person_name.preferred = 1 \n INNER JOIN patient_identifier ON patient_identifier.patient_id = person.person_id AND patient_identifier.identifier_type = 3 AND patient_identifier.preferred=1 \n AND o.concept_id = 4836 and o.value_coded in (4837, 4838, 4839) \n AND patient.voided = 0 AND o.voided = 0 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \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' \n )\n','2023-09-15 10:10:50',4,'2023-09-15 10:12:45',4,0,NULL,NULL,NULL,'bc300b53-1378-49e2-9117-f078e42477ae'),(2234,'Under5 Clients Seen','Under5 Clients Seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under5 Clients Seen\n Under5 Clients Seen\n \n 2023-09-15 08:11:53 UTC\n \n 2023-09-15 08:15: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 2234\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.person_id in( \nSELECT Id \nFROM ( \n select distinct o.person_id as Id \n from obs o \n INNER JOIN patient ON o.person_id = patient.patient_id \n where o.concept_id = 4285 \n AND CAST(o.obs_datetime AS DATE) >= CAST(:startDate AS DATE) \n AND CAST(o.obs_datetime AS DATE) <= CAST(:endDate AS DATE) \n AND patient.voided = 0 AND o.voided = 0 \n ) as A \n)\n','2023-09-15 10:11:53',4,'2023-09-15 10:15:34',4,0,NULL,NULL,NULL,'9847a9fb-5681-4fb1-8708-03a7cc2dd037'),(2235,'1st Postnatal (PNC) Attendance ','1st Postnatal (PNC) Attendance ','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n 1st Postnatal (PNC) Attendance \n 1st Postnatal (PNC) Attendance \n \n 2023-09-15 08:13:26 UTC\n \n 2023-09-15 08: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 2235\n select \n o.person_id \nfrom obs o \ninner join \n ( \n select oss.person_id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) as examination_timing \n from obs oss \n where oss.concept_id = 4393 and oss.voided=0 \n and cast(oss.obs_datetime as date) >= cast(:startDate as date) \n and cast(oss.obs_datetime as date) <= cast(:endDate as date) \n group by oss.person_id \n )latest \n on latest.person_id = o.person_id \n where concept_id = 4393 \n and o.obs_datetime = max_observation\n','2023-09-15 10:13:26',4,'2023-09-15 10:14:19',4,0,NULL,NULL,NULL,'32f31af1-96cb-40cc-af82-444eca3f815b'),(2236,'HTS Clients Seen','HTS Clients Seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Clients Seen\n HTS Clients Seen\n \n 2023-09-15 08:14:00 UTC\n \n COUNT\n','2023-09-15 10:14:00',4,NULL,NULL,0,NULL,NULL,NULL,'b25fa795-b18a-46f7-9a07-bb67b3f2717b'),(2237,'Family Planning Clients seen','Family Planning Clients seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning Clients seen\n Family Planning Clients seen\n \n 2023-09-15 08:16:18 UTC\n \n 2023-09-15 08:16: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 2237\n select \n o.person_id \nfrom obs o \ninner join \n ( \n select oss.person_id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) as examination_timing \n from obs oss \n where oss.concept_id = 4557 and oss.voided=0 \n and cast(oss.obs_datetime as date) >= cast(:startDate as date) \n and cast(oss.obs_datetime as date) <= cast(:endDate as date) \n group by oss.person_id \n )latest \n on latest.person_id = o.person_id \n where concept_id = 4557 \n and o.obs_datetime = max_observation\n','2023-09-15 10:16:18',4,'2023-09-15 10:16:32',4,0,NULL,NULL,NULL,'9797d33d-a0ae-4ceb-bc08-6566421dbd5f'),(2238,'Cervical Cancer Screening clients seen','Cervical Cancer Screening clients seen','org.openmrs.module.reporting.cohort.definition.CohortDefinition','org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients seen\n Cervical Cancer Screening clients seen\n \n 2023-09-15 08:17:49 UTC\n \n 2023-09-15 08:18: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 2238\n select \n o.person_id \nfrom obs o \ninner join \n ( \n select oss.person_id, MAX(oss.obs_datetime) as max_observation, \n SUBSTRING(MAX(CONCAT(oss.obs_datetime, oss.value_coded)), 20) as examination_timing \n from obs oss \n where oss.concept_id = 4557 and oss.voided=0 \n and cast(oss.obs_datetime as date) >= cast(:startDate as date) \n and cast(oss.obs_datetime as date) <= cast(:endDate as date) \n group by oss.person_id \n )latest \n on latest.person_id = o.person_id \n where concept_id = 4557 \n and o.obs_datetime = max_observation\n','2023-09-15 10:17:49',4,'2023-09-15 10:18:01',4,0,NULL,NULL,NULL,'520865e6-f8cb-48b4-b5af-34fcea15b6fd'),(2239,'HTS Clients Seen','HTS Clients Seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HTS Clients Seen\n HTS Clients Seen\n \n 2023-09-15 08:18:02 UTC\n \n 2023-09-15 08:19: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 2239\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','2023-09-15 10:18:02',4,'2023-09-15 10:19:17',4,0,NULL,NULL,NULL,'e1b18004-d53a-41e1-bb02-28977a5a0947'),(2240,'ANC Clients Seen','ANC Clients Seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n ANC Clients Seen\n ANC Clients Seen\n \n 2023-09-15 08:18:55 UTC\n \n 2023-09-15 08:20: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 2240\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','2023-09-15 10:18:55',4,'2023-09-15 10:20:59',4,0,NULL,NULL,NULL,'ebb54411-f9b4-4269-99cd-cf5516b73a32'),(2241,'Clients initiated on ART this month','Clients initiated on ART this month','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Clients initiated on ART this month\n Clients initiated on ART this month\n \n 2023-09-15 08:19:41 UTC\n \n 2023-09-15 08:20: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 2241\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','2023-09-15 10:19:41',4,'2023-09-15 10:20:45',4,0,NULL,NULL,NULL,'d6b350cd-9d04-4a6d-9c3c-b64e5c3af88d'),(2242,'HEI Clients Seen','HEI Clients Seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n HEI Clients Seen\n HEI Clients Seen\n \n 2023-09-15 08:20:25 UTC\n \n 2023-09-15 08:21: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 2242\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','2023-09-15 10:20:25',4,'2023-09-15 10:21:42',4,0,NULL,NULL,NULL,'15245071-fe74-4041-8eb0-9b89dc1101c3'),(2243,'Self test Kits distributed','Self test Kits distributed','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Self test Kits distributed\n Self test Kits distributed\n \n 2023-09-15 08:21:20 UTC\n \n 2023-09-15 08:22: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 2243\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','2023-09-15 10:21:20',4,'2023-09-15 10:22:35',4,0,NULL,NULL,NULL,'658bacca-15e3-4009-9b05-175d3a02f57a'),(2244,'Under5 Clients Seen','Under5 Clients Seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Under5 Clients Seen\n Under5 Clients Seen\n \n 2023-09-15 08:22:10 UTC\n \n 2023-09-15 08:22: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 2244\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','2023-09-15 10:22:10',4,'2023-09-15 10:22:48',4,0,NULL,NULL,NULL,'29b63c6f-8f03-4fb8-8432-44e9558faff5'),(2245,'1st Postnatal (PNC) Attendance ','1st Postnatal (PNC) Attendance ','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n 1st Postnatal (PNC) Attendance \n 1st Postnatal (PNC) Attendance \n \n 2023-09-15 08:22:57 UTC\n \n 2023-09-15 08:23: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 2245\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','2023-09-15 10:22:57',4,'2023-09-15 10:23:35',4,0,NULL,NULL,NULL,'302a292b-5904-49f0-9aea-f11f81228b41'),(2246,'Family Planning Clients seen','Family Planning Clients seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Family Planning Clients seen\n Family Planning Clients seen\n \n 2023-09-15 08:24:18 UTC\n \n 2023-09-15 08:24: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 2246\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','2023-09-15 10:24:18',4,'2023-09-15 10:24:50',4,0,NULL,NULL,NULL,'04067d6e-e564-4bfd-98da-69fa535a3682'),(2247,'Cervical Cancer Screening clients seen','Cervical Cancer Screening clients seen','org.openmrs.module.reporting.indicator.Indicator','org.openmrs.module.reporting.indicator.CohortIndicator','org.openmrs.module.reporting.serializer.ReportingSerializer','\n Cervical Cancer Screening clients seen\n Cervical Cancer Screening clients seen\n \n 2023-09-15 08:25:21 UTC\n \n 2023-09-15 08:25: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 2247\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','2023-09-15 10:25:21',4,'2023-09-15 10:25:53',4,0,NULL,NULL,NULL,'723bfdea-d424-4382-b055-d078dd733aba'); /*!40000 ALTER TABLE `serialized_object` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -81,4 +81,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2023-07-19 10:02:18 +-- Dump completed on 2023-09-15 10:37:46