Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#569 closed enhancement (fixed)

Sample list export for missing consent data

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

Description

It should be possible to export a sample list for missing consent data. A new entry "Export missing consent data sample list" should be added under Reggie section "Export/import information to/from external registers". Like other export pages, it should contain a "Preview" and a "Download" button. Clicking the "Export" button should create a sample list, that can be downloaded or opened by a viewer program. Initially no extra parameters are defined.

The export list should have the following properties:

  1. The list should consist of tab-separated columns.
  2. The export list should include all samples of sample types Case and Blood, that misses a consent, or where the consent date is missing.
  3. The export list should include the following columns:
    a. Sample name
    b. Subtype
    c. Personal number
    d. All first names
    e. Family name
    f. Consent date
    g. Consent ('Yes', 'No', 'Not asked', or null if missing)
  4. The preview should report the total number of samples with missing consent data, the number with missing consent date (total + number of 'Yes', 'No', and 'Not asked'), and the number of samples with missing consents.

Change History (10)

comment:1 by olle, 10 years ago

Status: newassigned

Ticket accepted.

comment:2 by olle, 10 years ago

Traceability note:

  • The consent count report was introduced in Ticket #426 (Consent count report generator).
  • The monthly operation list export was introduced in Ticket #385 (Export information needed by the tumor registry).
  • INCA export was introduced in Ticket #487 (Export information intended for INCA).
  • Sample list export for missing sample data was introduced in Ticket #565 (Missing sample data report should support sample list export).

comment:3 by olle, 10 years ago

(In [2212]) Refs #569. First version of sample list export for missing consent data added:

  1. JSP script index.jsp in reggie/resources/ updated with new entry "Export missing consent data sample list" under Reggie section "Export/import information to/from external registers", with link to new JSP script export_missing_consent_data_sample_list.jsp in reggie/resources/personal/.
  2. New JSP script export_missing_consent_data_sample_list.jsp in reggie/resources/personal/ added. It is based on JSP script export_inca.jsp, but has initially no options. It calls java servlet ExportServlet.java with command ExportMissingConsentDataSampleList and the selected menu option.
  3. Java servlet ExportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated for command "ExportMissingConsentDataSampleList" to call new private method Set<MissingConsentDataExportData> createMissingConsentDataExport(DbControl dc) to create a missing consent data sample list for export.
    b. New private method Set<MissingConsentDataExportData> createMissingConsentDataExport(DbControl dc) calls new private method List<Sample> createSampleListForMissingConsentDataReport(DbControl dc) to obtain a list of samples. This list is processed to obtain a list, that only contains samples with missing consent data. The missing consent data sample list is used to create a list of MissingConsentDataExportData objects, that will be returned.
    c. New private method List<Sample> createSampleListForMissingConsentDataReport(DbControl dc) performs a database query for samples of type CASE and BLOOD, and creates a sample list for the missing consent data report. The list will both include samples with and without missing consent data, and has to be processed afterwards to obtain a list, that only contains samples with missing consent data.
    d. New inner class MissingConsentDataExportData added. Its public method String toString() will a return a tab-separated line with data for the missing consent data export list.

comment:4 by olle, 10 years ago

(In [2213]) Refs #569. Java servlet ExportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/ updated i Javadoc description for private method List<Sample> createSampleListForMissingConsentDataReport(DbControl dc), in order to clarify the method's function.

comment:5 by olle, 10 years ago

Resolution: fixed
Status: assignedclosed

Ticket closed since the requested functionality has been added.

comment:6 by olle, 10 years ago

Resolution: fixed
Status: closedreopened

Ticket reopened to fix bug when obtaining personal data for Case items.

comment:7 by olle, 10 years ago

Problem description:

  • Because of a bug in private method List<Sample> createSampleListForMissingConsentDataReport(DbControl dc) in java servlet ExportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/, patient items were never found for Case items, and therefore no personal information was reported for the latter, even when it existed. The bug resulted from reuse of code from other methods, where samples of type Blood, Specimen, and No Specimen were used, while for the missing consent data report only samples of type Blood and Case are used, where the patient is the parent item.
Last edited 10 years ago by olle (previous) (diff)

comment:8 by olle, 10 years ago

(In [2219]) Refs #569. Bug fixed in sample list export for missing consent data, that prevented personal information to be reported for Case items, even when the former existed:

  1. Java servlet ExportServlet.java in reggie/src/net/sf/basedb/reggie/servlet/ updated in private method List<Sample> createSampleListForMissingConsentDataReport(DbControl dc) by fix of bug preventing patient items to be found for Case items, and therefore no personal information was reported for the latter, even when it existed. The bug resulted from reuse of code from other methods, where samples of type Blood, Specimen, and No Specimen were used, while for the missing consent data report only samples of type Blood and Case are used, where the patient is the parent item.

comment:9 by olle, 10 years ago

Resolution: fixed
Status: reopenedclosed

Ticket closed again since bug preventing personal data to be reported for Case items has been fixed.

comment:10 by olle, 10 years ago

(In [2223]) Refs #574. Refs #565. Refs #569. Consent and missing sample data report wizards updated to support missing data sample list export for users with PatientCurator role:

Java servlet SampleReportServlet in reggie/src/net/sf/basedb/reggie/servlet/ update:

  1. Private method JSONObject createConsentCountReport(DbControl dc, JSONObject json, Date startDate, Date endDate) updated to check if the user does not have permission to read patient names, and transfer the result in the returned JSON object in variable with key "permissionDeniedForPatientName". The same flag is already returned by private method JSONObject createMissingSampleDataReport(DbControl dc, JSONObject json, Date startDate, Date endDate, String sampleType, String bloodSampleFilter).

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

  1. Function goCreate() updated with argument exportOpt:
    a. If the value of argument exportOpt is "preview" or "export", the consent count and missing sample data report wizards directs the Ajax request to servlet ExportServlet.java to obtain data for corresponding the missing data sample list.
    b. If the value of argument exportOpt is "preview", a preview is shown created by the one of the new functions createMissingConsentDataSampleListPreview(allLines, previewTitle, previewList) or createMissingDataSampleListPreview(allLines, sampleTypes, previewTitle, previewList), that corresponds to the used report wizard.
    c. If the value of argument exportOpt is "export", the output from the Export servlet request is redirected to be downloaded or opened with a program of the user's choice.
  2. Function goCreate(exportOpt) updated for the consent and missing sample data reports to check if the user has permission to read patient names, and if so, add two new buttons to the right of the "Restart" button at the end, "Export preview" and "Export", coupled to calling function goCreate(exportOpt) with argument exportOpt having values "preview" and "export", respectively.
  3. New function createMissingConsentDataSampleListPreview(allLines, previewTitle, previewList) added. It creates a sample list preview like the one created by JSP script export_missing_consent_data_sample_list.jsp in reggie/resources/personal/, as described in Ticket #569 (Sample list export for missing consent data).
  4. New function createMissingDataSampleListPreview(allLines, sampleTypes, previewTitle, previewList) added. It creates a sample list preview like the one created by JSP script export_missing_data_sample_list.jsp in reggie/resources/personal/, as described in Ticket #565 (Missing sample data report should support sample list export).
  5. HTML part updated with new style section for the sample list preview, button definitions for the "Export preview" and "Export" buttons, and new div tags for the optional export preview.
Note: See TracTickets for help on using tickets.