From e2868765d006e5e31ae6292a4f0478030f21b70a Mon Sep 17 00:00:00 2001 From: Spencer Stream Date: Sat, 4 May 2019 15:47:32 -0500 Subject: [PATCH] REPORT-823: Improved the preview pages of query definitions. * Cohort Queries * Previously, the preview page for cohort query definitions did not display enough information; only the size of the cohort was shown. * Now, the preview page for cohort query definitions shows a pageable list of patient IDs in the cohort. * Person Queries * Previously, the preview page for person query definitions displayed too much information; the table was often too long and required scrolling to see all of the entries. * Now, the preview page for person query definitions shows a pageable list of patient IDs. * The preview pages for both cohort and person query definitions now share the same style to create a consistent look among the two. --- .../module/reporting/web/taglib/FormatTag.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java index 8e1be720db..4a9358a335 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.lang.reflect.Method; import java.util.Collection; +import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -360,7 +361,7 @@ private void printCohortDimensionResult(StringBuilder sb, CohortDimensionResult * @param cohort */ private void printCohort(StringBuilder sb, Cohort cohort) { - sb.append(cohort.size() + " patients"); + printCollection(sb, cohort.getMemberIds()); } private void printObsValue(StringBuilder sb, Obs obsValue) { @@ -402,14 +403,14 @@ private void printMap(StringBuilder sb, Map m) { private void printCollection(StringBuilder sb, Collection c){ if(c != null){ - sb.append(""); - sb.append(""); + sb.append("
" + Context.getMessageSourceService().getMessage("reporting.ids") + "
"); + Collection tableData = new ArrayList(); for (Object item : c) { - sb.append(""); - printObject(sb, item); - sb.append(""); + Collection tableRow = new ArrayList(); + tableRow.add(item); + tableData.add(tableRow); } - sb.append(""); + sb.append(""); } } @@ -567,4 +568,4 @@ public void setDate(Date date) { this.date = date; } -} +} \ No newline at end of file