Opened 6 years ago

Closed 6 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 Changed 6 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 6 years ago by olle

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 Changed 6 years ago by olle

Design description.

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

  • Private method 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.
Last edited 6 years ago by olle (previous) (diff)

comment:4 Changed 6 years ago by olle

(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 Changed 6 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed since the described code has been refactored.

Note: See TracTickets for help on using tickets.