Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPORT-823: Improved the preview pages query definitions. #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -402,14 +403,14 @@ private void printMap(StringBuilder sb, Map<?, ?> m) {

private void printCollection(StringBuilder sb, Collection<?> c){
if(c != null){
sb.append("<table cellspacing=\"0\" cellpadding=\"2\" border=\"1\">");
sb.append("<tr><th align=\"left\">" + Context.getMessageSourceService().getMessage("reporting.ids") + "</th></tr>");
sb.append("<table id=\"collectionTable\" cellspacing=\"0\" cellpadding=\"2\" border=\"1\"></table>");
Collection<Object> tableData = new ArrayList<Object>();
for (Object item : c) {
sb.append("<tr><td align=\"left\">");
printObject(sb, item);
sb.append("</td></tr>");
Collection<Object> tableRow = new ArrayList<Object>();
tableRow.add(item);
tableData.add(tableRow);
}
sb.append("</table>");
sb.append("<script>$j('#collectionTable').dataTable({\"aaData\":" + tableData + ", \"bPaginate\":true, \"bLengthChange\":false, \"bFilter\":false, \"bSort\":false, \"bInfo\":true, \"bAutoWidth\":false, \"aoColumns\":[{\"sTitle\": \"" + Context.getMessageSourceService().getMessage("reporting.ids") + "\"}]});</script>");
}
}

Expand Down Expand Up @@ -567,4 +568,4 @@ public void setDate(Date date) {
this.date = date;
}

}
}