Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#505 closed enhancement (fixed)

Sample source reports should be updated to support follow-up blood samples

Reported by: olle Owned by: olle
Priority: major Milestone: Reggie v2.13
Component: net.sf.basedb.reggie Keywords:
Cc:

Description (last modified by olle)

Sample source reports should be updated to support follow-up blood samples introduced in Ticket #449 (Add support for follow-up blood samples to the blood registration wizard). Follow-up blood samples obtained 6, 12, or 36 months after an operation differ from blood samples obtained in connection with the surgery in that the former are from (hopefully) recovered patients, and therefore normally do not contain much information about the removed tumor. One may therefore want to separate statistics on these samples from the other samples.

Reports containing information on blood samples should be updated with the possibility to filter data depending on specific blood samples types, i.e. standard, "PreNeo", "PreOp", "FollowUp06", "FollowUp12", and "FollowUp36". Additionally, some reports may be updated with extra tables or columns.

Change History (12)

comment:1 by olle, 11 years ago

Description: modified (diff)

comment:2 by olle, 11 years ago

Description: modified (diff)

comment:3 by olle, 11 years ago

Status: newassigned

Ticket accepted.

comment:4 by olle, 11 years ago

Description: modified (diff)

comment:5 by olle, 11 years ago

Traceability note:

  • The report generator was introduced in Ticket #339 (Report generator). It included a sample count report.
  • The sample count report was updated in Ticket #419 (Allow user to select resolution in sample count report), Ticket #420 (Sample count report should have two columns for summed data), and Ticket #421 (Sample count report does not always handle all views correctly).
  • The sample count report was updated in Ticket #434 (Sample count report should allow selection of specimen or blood sample).
  • The sample count report was updated in Ticket #458 (Sample count report should be refactored to use week codes with leading 0).
  • The overview report was introduced in Ticket #438 (Overview report).
  • The missing sample data report was introduced in Ticket #439 (Missing sample data report).
  • Registration of follow-up blood samples was introduced in Ticket #449 (Add support for follow-up blood samples to the blood registration wizard).
Last edited 11 years ago by olle (previous) (diff)

comment:6 by olle, 11 years ago

Description: modified (diff)
Summary: Sample source report should be updated to support follow-up blood samplesSample source reports should be updated to support follow-up blood samples

comment:7 by olle, 11 years ago

(In [2023]) Refs #449. Refs #505. First version of wizard for registration/update of data for follow-up blood samples.

comment:8 by olle, 11 years ago

Design discussion:

Sample count report:

  1. New pop-up menu "Table alternatives" with options:

    9 tables with different blood sample choices (default)
    1 table with optional blood sample filter

  2. New pop-up menu "Blood sample filter" with options:

    None (default)
    Follow-up
    Not follow-up
    unknown
    PreNeo
    PreOp
    FollowUp06
    FollowUp12
    FollowUp36

  3. The "Table alternatives" pop-up menu should be disabled unless sample type "Blood" has been selected.
  4. The "Blood sample filter" pop-up menu should be disabled unless sample type "Blood" and table alternative "1 table with optional blood sample filter" have been selected.
  5. If table alternative "9 tables with different blood sample choices" is selected, nine tables should be displayed corresponding to each of the nine options in the blood sample filter menu.
  6. If table alternative "1 table with optional blood sample filter" is selected, a single table should be displayed corresponding to the selected blood sample filter.
  7. The table generation for sample type "Specimen" and "No specimen" is not affected by the update.
Version 0, edited 11 years ago by olle (next)

comment:9 by olle, 11 years ago

Design implementation comments:

The affected files are JSP script samplereportgenerator.jsp in reggie/resources/reports/ and java servlet SampleReportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/.

Updates in JSP script samplereportgenerator.jsp in reggie/resources/reports/:

  • Two new pop-up menus for "Table alternatives" and "Blood sample filter" are added. Function gotoStep2() is updated to show both menus for the sample count report, and only the "Blood sample filter" menu for the overview and missing sample data reports. The added menus will be disabled at start for the sample count and missing sample data reports, but enabled for the overview report.
  • New function sampleTypeOnChange() is called when the sample type value changes, and enables the "Table alternatives" and "Blood sample filter" pop-up menus when the sample type is changed to "Blood" (which is not the default). For the sample count report, the "Blood sample filter" pop-up menu is only enabled if the "Table alternative" is "1 table with optional blood sample filter". If the sample type is changed to an option different from "Blood", the pop-up menus are reset and disabled again.
  • New function tableAlternativesOnChange() is called when the table alternatives value changes, and enables the "Blood sample filter" pop-up menu when the table alternatives is changed to "1 table with optional blood sample filter" (which is not the default). If the table alternatives is changed to an option different from "1 table with optional blood sample filter", the "Blood sample filter" pop-up menu is reset and disabled again.
  • function goCreate() is updated to add the values of pop-up menus "Table alternatives" and "Blood sample filter" to the Ajax servlet requests for the affected reports. The servlet copies the values to the returned JSON object, in order for them to be available to the script functions creating the tables.
  • Function goCreate() is updated to add 8 extra tables for the sample count report, if "Table alternatives" equals "9 tables with different blood sample choices". The extra tables are added analogously to the extra tables for the consent and overview reports. The extra reports are created by calling function createItemCountReport(report, reportType) with different report data for the first argument. In order to avoid a major rewrite of the latter function, JSON data for the new reports are added as child items to the original report object, with a name key identifying the type of report. As function createItemCountReport(report, reportType) calls function addDataRowsToTable(report, reportTable), which sets values of global variables unknownCreation and unknownSite from the report data given as argument to the former function, a side effect is that these two variables will have values for the last processed report data. To avoid this, the values are reset to that of the unfiltered data before creation of the summary section, where the values are reported.
  • Functions createItemCountReport(report, reportType), createOverviewReport(report), and createMissingSampleDataReport(report) are updated to display the value of a blood sample type filter in the table header text, if a filter is used.
  • Functions createOverviewReport(report) and addDataRowsToOverviewTable(report, reportTable) are updated to add a column for "Blood samples follow-up" data.

Updates in java servlet SampleReportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/:

  • Static string constants defined for options in "Table alternatives" and "Blood sample filter" menus.
  • Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated to retrieve the values of the new menus and transfer them as arguments to methods creating JSON objects of report data.
  • Private method JSONObject createSampleCountReport(...) updated with two new arguments String tableAlternatives and String bloodSampleFilter. The value of the latter is transferred as argument to methods creating sample lists and JSON objects of report data. If "Table alternatives" equals "9 tables with different blood sample choices", 8 extra calls are made to create JSON report data for the different blood sample type choices. The extra JSON report objects are added as child items to the original report object, with a name key identifying the type of report.
  • New private method JSONObject createSampleCountReport(List<Sample> sampleList, Date startDate, Date endDate, String viewType, String sampleType, String tableAlternatives, String bloodSampleFilter) added. It creates JSON report data from an input sample list.
  • New private method List<Sample> createSampleCountSampleList(DbControl dc, SnapshotManager manager, List<Sample> rawSampleList, String bloodSampleFilter) added. It creates a sample list from a raw list by applying an input blood sample filter.
  • Private method JSONObject createOverviewReport(...) updated with new argument String bloodSampleFilter. The code is updated to apply the filter when creating the JSON report. The method is also updated to collect data for a "Blood samples follow-up" column.
  • Private method JSONObject createMissingSampleDataReport(...) updated with new argument String bloodSampleFilter. The code is updated to apply the filter when creating the JSON report.
Last edited 11 years ago by olle (previous) (diff)

comment:10 by olle, 11 years ago

(In [2024]) Refs #505. Refs #449. Sample source reports updated to support follow-up blood samples.

comment:11 by olle, 11 years ago

Resolution: fixed
Status: assignedclosed

Ticket closed as the requested functionality has been added.

comment:12 by olle, 11 years ago

(In [2203]) Refs #563. Refs #505. Java servlet SampleReportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/ refactored:

  1. Private method JSONObject createMissingSampleDataReport(...) updated to call new private method List<Sample> createSampleListForMissingSampleDataReport(DbControl dc, String sampleType, String bloodSampleFilter) to create the sample list to use. The latter method calls new private method boolean passBloodSampleFilter(DbControl dc, SnapshotManager manager, String bloodSampleFilter, Sample s) to apply an optional blood sample filter.
  2. Private methods List<Sample> createSampleCountSampleList(...) and JSONObject createOverviewReport(...) updated to call new private method boolean passBloodSampleFilter(DbControl dc, SnapshotManager manager, String bloodSampleFilter, Sample s) to apply an optional blood sample filter.
  3. New private method List<Sample> createSampleListForMissingSampleDataReport(DbControl dc, String sampleType, String bloodSampleFilter) added. It creates a sample list to use in the missing sample data report, and calls new private method boolean passBloodSampleFilter(DbControl dc, SnapshotManager manager, String bloodSampleFilter, Sample s) to apply an optional blood sample filter.
  4. New private method boolean passBloodSampleFilter(DbControl dc, SnapshotManager manager, String bloodSampleFilter, Sample s) added. It applies an optional blood sample filter.

Note: See TracTickets for help on using tickets.