Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ public ReportDefinition constructReportDefinition() {
SqlCohortDefinition liveSqlCD = new SqlCohortDefinition();
String liveSql = getStringFromResource("org/openmrs/module/drcreports/sql/DRCLivePatients.sql");
liveSqlCD.setQuery(liveSql);
liveSqlCD.addParameter(new Parameter("onOrAfter", "On Or After", Date.class));
liveSqlCD.addParameter(new Parameter("onOrBefore", "On Or Before", Date.class));

// Not stopped ART in date range
SqlCohortDefinition notStoppedARTSqlCD = new SqlCohortDefinition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ INNER JOIN person pe ON p.patient_id = pe.person_id
WHERE pe.voided = 0
AND p.voided = 0
AND NOT EXISTS (
-- Check that patient does NOT have death date observation
-- Check that patient does NOT have death date observation in the date range
SELECT 1
FROM obs o
INNER JOIN concept c ON o.concept_id = c.concept_id
WHERE o.person_id = p.patient_id
AND o.voided = 0
AND c.uuid = '1543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
AND DATE(o.value_datetime) BETWEEN :onOrAfter AND :onOrBefore
)
ORDER BY p.patient_id;