Opened 11 years ago

Closed 11 years ago

#563 closed enhancement (fixed)

Report servlet code should be refactored for blood sample filter

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

Description

Report servlet code should be refactored for blood sample filter. As the filter is used in several reports, the servlet code should use a common method for the filter. Sample lists with use in more than one place, should also preferably be created by separate methods.

Change History (5)

comment:1 by olle, 11 years ago

Status: newassigned

Ticket accepted.

comment:2 by olle, 11 years ago

Traceability note:

  • The blood sample filter was introduced in Ticket #505 (Sample source reports should be updated to support follow-up blood samples), where it was added to the sample count, overview, and missing items reports.
  • The report generator was introduced in Ticket #339 (Report generator). It included a sample count report.
  • The overview report was introduced in Ticket #438 (Overview report).
  • The missing sample was introduced in Ticket #439 (Missing sample data report).

comment:3 by olle, 11 years ago

Design description.

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

  • JSONObject createMissingSampleDataReport(...) should be 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.
  • Private methods List<Sample> createSampleCountSampleList(...) and JSONObject createOverviewReport(...) should be updated to call new private method boolean passBloodSampleFilter(DbControl dc, SnapshotManager manager, String bloodSampleFilter, Sample s) to apply an optional blood sample filter.
Version 0, edited 11 years ago by olle (next)

comment:4 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.

comment:5 by olle, 11 years ago

Resolution: fixed
Status: assignedclosed

Ticket closed since the described code has been refactored.

Note: See TracTickets for help on using tickets.