Changeset 3515


Ignore:
Timestamp:
Sep 29, 2015, 2:14:51 PM (8 years ago)
Author:
olle
Message:

Refs #815. The "MeLuDI quarter/month report" in the "Sample processing statistics" wizard updated to allow an extract source filter, with the following choices:
a. None
b. MeLuDI specimen extract
c. Input extract (Pathology DNA/RNA)

  1. JSP file meludi_quarter_month_report_generator.jsp in resources/reports/ updated in step 2 with extract source filter menu with three choices, "None" (default), "MeLuDI specimen extract", and "Input extract (Pathology DNA/RNA)".
  2. Javascript file meludi_quarter_month_report_generator.js in resources/reports/ updated in function submit(event) to include selected extract source filter value in the data sent when calling command "meludiquartermonthreport" in servlet MeludiQuarterMonthReportServlet.
  3. Java servlet class/file MeludiQuarterMonthReportServlet.java in src/net/sf/basedb/meludi/servlet/ updated:
    a. New string constants for extract source choices defined.
    b. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated for command "meludiquartermonthreport" to obtain extract source filter string from request parameter (default is no filter).
    c. Private method JSONObject createMeludiQuarterMonthReport(DbControl dc, JSONObject json, Date startDate, Date endDate, String viewType, String chartVariant, String projectFocusFilter, Site site) updated with new argument String extractSourceFilter before String projectFocusFilter. The value of the extract source filter is used when finding the case related to an extract, as only parent items of correct subtype will be processed further.
    d. Private method JSONObject createJsonPlot(String chartVariant, Date startDate, Date endDate, String viewType, String projectFocusFilter, Site site) updated with new argument String extractSourceFilter before String projectFocusFilter.
    e. Private method String fetchChartHeaderTitle(String chartVariant, String viewType, String projectFocusFilter, Site site) updated with new argument String extractSourceFilter before String projectFocusFilter. New private method String fetchExtractSourceFilterName(String extractSourceFilter) is called to obtain an extract source filter name to use in the title, where the former is inserted after the project focus name.
    f. New private method String fetchExtractSourceFilterName(String extractSourceFilter) added. It returns an extract source title name for an extract source filter.
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  
    121121    url += '&tdate='+encodeURIComponent(frm.todate.value);
    122122    url += '&vtype='+encodeURIComponent(frm.viewtype.value);
     123    url += '&extractsourcefilter='+encodeURIComponent(frm.extractsourcefilter.value);
    123124    url += '&projectfocusfilter='+encodeURIComponent(frm.projectfocusfilter.value);
    124125    url += '&site='+encodeURIComponent(frm.sites.value);
  • extensions/net.sf.basedb.meludi/trunk/resources/reports/meludi_quarter_month_report_generator.jsp

    r3505 r3515  
    114114            </td>
    115115          </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>         
    116131          <tr id="projectfocus-filter">
    117132            <td class="prompt">Project focus filter</td>
  • extensions/net.sf.basedb.meludi/trunk/src/net/sf/basedb/meludi/servlet/MeludiQuarterMonthReportServlet.java

    r3514 r3515  
    6464  // Constants for view types not defined in ReportTableUtilServlet
    6565  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";
    6670  // Constants for chart variant choices
    6771  public static final String ALL_CHARTS = "allcharts";
     
    203207        }
    204208//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);
    205216        String projectFocusFilter = InstallServlet.PROJECTFOCUS_NONE;
    206217        String projectFocusFilterParameter = Values.getString(req.getParameter("projectfocusfilter"), null);
     
    217228//System.out.println(new Date() + " MeludiQuarterMonthReportServlet::doGet(): cmd = \"" + cmd + "\" startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " projectFocusFilter = " + projectFocusFilter + " sitePrefix = " + sitePrefix + " site = " + site + " chartVariant = " + chartVariant);
    218229
    219         json = createMeludiQuarterMonthReport(dc, json, startDate, endDate, viewType, chartVariant, projectFocusFilter, site);
     230        json = createMeludiQuarterMonthReport(dc, json, startDate, endDate, viewType, chartVariant, extractSourceFilter, projectFocusFilter, site);
    220231      }
    221232    }
     
    236247
    237248  @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)
    239250    throws ServletException, IOException
    240251  {
    241252/*
    242 System.out.println(new Date() + " MeludiQuarterMonthReportServlet::createMeludiQuarterMonthReport(): startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " projectFocusFilter = " + projectFocusFilter + " site = " + site + " chartVariant = " + chartVariant);
     253System.out.println(new Date() + " MeludiQuarterMonthReportServlet::createMeludiQuarterMonthReport(): startDate = " + startDate + " endDate = " + endDate + " viewType = " + viewType + " extractSourceFilter = " + extractSourceFilter + " projectFocusFilter = " + projectFocusFilter + " site = " + site + " chartVariant = " + chartVariant);
    243254    if (site != null)
    244255    {
     
    317328      {
    318329        Sample relatedCase = null;
    319         if (subtypeSpecimen.equals(parentSubtype))
     330        if ((extractSourceFilter.equals(EXTRACTSOURCE_NONE) || extractSourceFilter.equals(EXTRACTSOURCE_MELUDI_SPECIMEN_EXTRACT)) && subtypeSpecimen.equals(parentSubtype))
    320331        {
    321332          // Extract from specimen
     
    323334          relatedCase = (Sample)parentSpecimen.getParent();
    324335        }
    325         else if (subtypeCase.equals(parentSubtype))
     336        else if ((extractSourceFilter.equals(EXTRACTSOURCE_NONE) || extractSourceFilter.equals(EXTRACTSOURCE_INPUT_EXTRACT)) && subtypeCase.equals(parentSubtype))
    326337        {
    327338          // Extract source item
     
    425436      {
    426437        // 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);
    428439/*
    429440        plotJsonData = addExtraInfo(plotJsonData, cVariant);
     
    680691  }
    681692
    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)
    683694    throws ServletException, IOException
    684695  {
    685696    // Get JSON statistics data
    686     String chartHeaderTitle = fetchChartHeaderTitle(chartVariant, viewType, projectFocusFilter, site);
     697    String chartHeaderTitle = fetchChartHeaderTitle(chartVariant, viewType, extractSourceFilter, projectFocusFilter, site);
    687698    String chartTitle = fetchChartTitle(chartVariant);
    688699    String chartYAxisTitle = fetchChartYAxisTitle(chartVariant);
     
    11261137   *  @param chartVariant String The chart variant to get a plot title for.
    11271138   *  @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.
    11281140   *  @param projectFocusFilter String The project focus filter for the plot.
    11291141   *  @param site String The site used for the data selection for the plot.
    11301142   *  @return String A plot title for the given chart variant string.
    11311143   */
    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);
    11341148    // Get project focus filter for title
    11351149    String projectFocus = fetchProjectFocusFilterName(projectFocusFilter);
     
    11441158      if (chartVariant.equals(ORIGINAL_QUANTITY_DNA_CHART))
    11451159      {
    1146         title = "Total quantity DNA for " + projectFocus + "extracts by " + periodName;
     1160        title = "Total quantity DNA for " + projectFocus + extractSourceFocus + "extracts by " + periodName;
    11471161      }       
    11481162      else if (chartVariant.equals(ORIGINAL_QUANTITY_RNA_CHART))
    11491163      {
    1150         title = "Total quantity RNA for " + projectFocus + "extracts by " + periodName;
     1164        title = "Total quantity RNA for " + projectFocus + extractSourceFocus + "extracts by " + periodName;
    11511165      }       
    11521166      else if (chartVariant.equals(DELTA_CT_DNA_CHART))
    11531167      {
    1154         title = "DNA ΔCt value for " + projectFocus + "extracts by " + periodName;
     1168        title = "DNA ΔCt value for " + projectFocus + extractSourceFocus + "extracts by " + periodName;
    11551169      }       
    11561170      if (site != null)
     
    11611175    }
    11621176    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;
    11631201  }
    11641202
Note: See TracChangeset for help on using the changeset viewer.