Changeset 3515
- Timestamp:
- Sep 29, 2015, 2:14:51 PM (8 years ago)
- Location:
- extensions/net.sf.basedb.meludi/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.meludi/trunk/resources/reports/meludi_quarter_month_report_generator.js
r3505 r3515 121 121 url += '&tdate='+encodeURIComponent(frm.todate.value); 122 122 url += '&vtype='+encodeURIComponent(frm.viewtype.value); 123 url += '&extractsourcefilter='+encodeURIComponent(frm.extractsourcefilter.value); 123 124 url += '&projectfocusfilter='+encodeURIComponent(frm.projectfocusfilter.value); 124 125 url += '&site='+encodeURIComponent(frm.sites.value); -
extensions/net.sf.basedb.meludi/trunk/resources/reports/meludi_quarter_month_report_generator.jsp
r3505 r3515 114 114 </td> 115 115 </tr> 116 <tr id="extractsource-filter"> 117 <td class="prompt">Extract source filter</td> 118 <td class="input"> 119 <select name="extractsourcefilter" id="extractsourcefilter"> 120 <option value="none" selected="yes">None</option> 121 <option value="meludi_specimen_extract">MeLuDI specimen extract</option> 122 <option value="input_extract">Input extract (Pathology DNA/RNA)</option> 123 </select> 124 </td> 125 <td class="status" id="extractsourcefilter.status"></td> 126 <td class="help"> 127 <span id="extractsourcefilter.message" class="message"></span> 128 Select extract source filter for report. 129 </td> 130 </tr> 116 131 <tr id="projectfocus-filter"> 117 132 <td class="prompt">Project focus filter</td> -
extensions/net.sf.basedb.meludi/trunk/src/net/sf/basedb/meludi/servlet/MeludiQuarterMonthReportServlet.java
r3514 r3515 64 64 // Constants for view types not defined in ReportTableUtilServlet 65 65 public static final String quarterMonthView = "QUARTERMONTH"; 66 // Constants for extract source filter choices 67 public static final String EXTRACTSOURCE_NONE = "none"; 68 public static final String EXTRACTSOURCE_MELUDI_SPECIMEN_EXTRACT = "meludi_specimen_extract"; 69 public static final String EXTRACTSOURCE_INPUT_EXTRACT = "input_extract"; 66 70 // Constants for chart variant choices 67 71 public static final String ALL_CHARTS = "allcharts"; … … 203 207 } 204 208 //System.out.println(new Date() + " MeludiQuarterMonthReportServlet::doGet(): cmd = \"" + cmd + "\" startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType); 209 String extractSourceFilter = EXTRACTSOURCE_NONE; 210 String extractSourceFilterParameter = Values.getString(req.getParameter("extractsourcefilter"), null); 211 if (extractSourceFilterParameter != null) 212 { 213 extractSourceFilter = extractSourceFilterParameter; 214 } 215 //System.out.println(new Date() + " MeludiQuarterMonthReportServlet::doGet(): cmd = \"" + cmd + "\" startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " extractSourceFilter = " + extractSourceFilter); 205 216 String projectFocusFilter = InstallServlet.PROJECTFOCUS_NONE; 206 217 String projectFocusFilterParameter = Values.getString(req.getParameter("projectfocusfilter"), null); … … 217 228 //System.out.println(new Date() + " MeludiQuarterMonthReportServlet::doGet(): cmd = \"" + cmd + "\" startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " projectFocusFilter = " + projectFocusFilter + " sitePrefix = " + sitePrefix + " site = " + site + " chartVariant = " + chartVariant); 218 229 219 json = createMeludiQuarterMonthReport(dc, json, startDate, endDate, viewType, chartVariant, projectFocusFilter, site);230 json = createMeludiQuarterMonthReport(dc, json, startDate, endDate, viewType, chartVariant, extractSourceFilter, projectFocusFilter, site); 220 231 } 221 232 } … … 236 247 237 248 @SuppressWarnings("unchecked") 238 private JSONObject createMeludiQuarterMonthReport(DbControl dc, JSONObject json, Date startDate, Date endDate, String viewType, String chartVariant, String projectFocusFilter, Site site)249 private JSONObject createMeludiQuarterMonthReport(DbControl dc, JSONObject json, Date startDate, Date endDate, String viewType, String chartVariant, String extractSourceFilter, String projectFocusFilter, Site site) 239 250 throws ServletException, IOException 240 251 { 241 252 /* 242 System.out.println(new Date() + " MeludiQuarterMonthReportServlet::createMeludiQuarterMonthReport(): startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " projectFocusFilter = " + projectFocusFilter + " site = " + site + " chartVariant = " + chartVariant);253 System.out.println(new Date() + " MeludiQuarterMonthReportServlet::createMeludiQuarterMonthReport(): startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " extractSourceFilter = " + extractSourceFilter + " projectFocusFilter = " + projectFocusFilter + " site = " + site + " chartVariant = " + chartVariant); 243 254 if (site != null) 244 255 { … … 317 328 { 318 329 Sample relatedCase = null; 319 if ( subtypeSpecimen.equals(parentSubtype))330 if ((extractSourceFilter.equals(EXTRACTSOURCE_NONE) || extractSourceFilter.equals(EXTRACTSOURCE_MELUDI_SPECIMEN_EXTRACT)) && subtypeSpecimen.equals(parentSubtype)) 320 331 { 321 332 // Extract from specimen … … 323 334 relatedCase = (Sample)parentSpecimen.getParent(); 324 335 } 325 else if ( subtypeCase.equals(parentSubtype))336 else if ((extractSourceFilter.equals(EXTRACTSOURCE_NONE) || extractSourceFilter.equals(EXTRACTSOURCE_INPUT_EXTRACT)) && subtypeCase.equals(parentSubtype)) 326 337 { 327 338 // Extract source item … … 425 436 { 426 437 // Get JSON statistics data 427 JSONObject plotJsonData = createJsonPlot(cVariant, startDate, endDate, vType, projectFocusFilter, site);438 JSONObject plotJsonData = createJsonPlot(cVariant, startDate, endDate, vType, extractSourceFilter, projectFocusFilter, site); 428 439 /* 429 440 plotJsonData = addExtraInfo(plotJsonData, cVariant); … … 680 691 } 681 692 682 private JSONObject createJsonPlot(String chartVariant, Date startDate, Date endDate, String viewType, String projectFocusFilter, Site site)693 private JSONObject createJsonPlot(String chartVariant, Date startDate, Date endDate, String viewType, String extractSourceFilter, String projectFocusFilter, Site site) 683 694 throws ServletException, IOException 684 695 { 685 696 // Get JSON statistics data 686 String chartHeaderTitle = fetchChartHeaderTitle(chartVariant, viewType, projectFocusFilter, site);697 String chartHeaderTitle = fetchChartHeaderTitle(chartVariant, viewType, extractSourceFilter, projectFocusFilter, site); 687 698 String chartTitle = fetchChartTitle(chartVariant); 688 699 String chartYAxisTitle = fetchChartYAxisTitle(chartVariant); … … 1126 1137 * @param chartVariant String The chart variant to get a plot title for. 1127 1138 * @param viewType String The view type used for the period selection for the plot. 1139 * @param extractSourceFilter String The extract source filter for the plot. 1128 1140 * @param projectFocusFilter String The project focus filter for the plot. 1129 1141 * @param site String The site used for the data selection for the plot. 1130 1142 * @return String A plot title for the given chart variant string. 1131 1143 */ 1132 private String fetchChartHeaderTitle(String chartVariant, String viewType, String projectFocusFilter, Site site) 1133 { 1144 private String fetchChartHeaderTitle(String chartVariant, String viewType, String extractSourceFilter, String projectFocusFilter, Site site) 1145 { 1146 // Get extract source filter for title 1147 String extractSourceFocus = fetchExtractSourceFilterName(extractSourceFilter); 1134 1148 // Get project focus filter for title 1135 1149 String projectFocus = fetchProjectFocusFilterName(projectFocusFilter); … … 1144 1158 if (chartVariant.equals(ORIGINAL_QUANTITY_DNA_CHART)) 1145 1159 { 1146 title = "Total quantity DNA for " + projectFocus + "extracts by " + periodName;1160 title = "Total quantity DNA for " + projectFocus + extractSourceFocus + "extracts by " + periodName; 1147 1161 } 1148 1162 else if (chartVariant.equals(ORIGINAL_QUANTITY_RNA_CHART)) 1149 1163 { 1150 title = "Total quantity RNA for " + projectFocus + "extracts by " + periodName;1164 title = "Total quantity RNA for " + projectFocus + extractSourceFocus + "extracts by " + periodName; 1151 1165 } 1152 1166 else if (chartVariant.equals(DELTA_CT_DNA_CHART)) 1153 1167 { 1154 title = "DNA ΔCt value for " + projectFocus + "extracts by " + periodName;1168 title = "DNA ΔCt value for " + projectFocus + extractSourceFocus + "extracts by " + periodName; 1155 1169 } 1156 1170 if (site != null) … … 1161 1175 } 1162 1176 return title; 1177 } 1178 1179 /** 1180 * Returns the extract source title name for an extract source filter string. 1181 * 1182 * @param extractSourceFilter String The extract source filter used. 1183 * @return String The extract source title name. 1184 */ 1185 private String fetchExtractSourceFilterName(String extractSourceFilter) 1186 { 1187 // Get extract source title name 1188 String extractSourceTitleName = ""; 1189 if (extractSourceFilter != null) 1190 { 1191 if (extractSourceFilter.equals(EXTRACTSOURCE_MELUDI_SPECIMEN_EXTRACT)) 1192 { 1193 extractSourceTitleName = "MeLuDI specimen "; 1194 } 1195 else if (extractSourceFilter.equals(EXTRACTSOURCE_INPUT_EXTRACT)) 1196 { 1197 extractSourceTitleName = "input "; 1198 } 1199 } 1200 return extractSourceTitleName; 1163 1201 } 1164 1202
Note: See TracChangeset
for help on using the changeset viewer.