Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#888 closed task (fixed)

INCA statistics

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

Description

Statistics should be calculated from the data obtained from INCA at regular intervals in the form of a tab-separated file. Entries with personal numbers are regarded as accrued to the SCAN-B project, while those without are regarded as not accrued. It should be possible to specify a start and end date defining a time interval for the data used for the statistics.

The following statistics should be reported:

  1. Percentage values of entries accrued with specimen, accrued without specimen, and not accrued.
  2. Percentage sets of all diagnoses, accrued, and accrued with specimen for:
    a. ER Status (% positive and negative).
    b. PgR Status (% positive and negative).
    c. HER2 Status (% positive and negative).
    d. Age (years) (% >70, 50-70, <50).
    e. NHG (% Grade 3, Grade 2, Grade 1).
    f. Tumor Size (mm) (% >20, 10-20, <10).

Change History (25)

comment:1 by olle, 9 years ago

Owner: changed from Nicklas Nordborg to olle

Ticket reassigned to "olle".

Last edited 9 years ago by olle (previous) (diff)

comment:2 by olle, 9 years ago

Status: newassigned

Ticket accepted.

comment:3 by olle, 9 years ago

Traceability note:

  • Creation of a csv file to be used when requesting information from the INCA database was introduced in Ticket #487 (Export information intended for INCA). The entries with personal numbers in the INCA csv file are defined in this file.
  • Import of an INCA csv file was introduced in Ticket #525 (Import data from INCA). This ticket contains information on the INCA csv file and its processing of interest to this ticket.

comment:4 by Nicklas Nordborg, 9 years ago

Milestone: Reggie v4.xReggie v4.5

comment:5 by olle, 9 years ago

Design note:

  • INCA file header columns to be used for filtering and statistics data, in addition to the columns used for INCA import:
Column contents Column header
Diagnose date (for time period filter) A030DiaDat
ER Status A100ER_Värde
PgR A100PR_Värde
HER2 Status A100HER2_Värde
Age (years) A000Alder
NHG A100NHG_Värde
Tumor Size (mm) A090HistoTumStl
Version 1, edited 9 years ago by olle (previous) (next) (diff)

comment:6 by olle, 9 years ago

Design discussion:

Much functionality needed for INCA statistics have already been implemented for INCA import, e.g. reading INCA *.csv files, checking input, mapping entries to SCAN-B database items, etc. (see Ticket #525 "Import data from INCA" for details), so it seems natural to expand the IncaServlet to cover INCA statistics too. However, in order to implement this, some existing methods need to be extended with new arguments and extra functionality, and methods used both for import and statistics might need to be renamed, so as not to refer specifically to "INCA import" unnecessarily.

comment:7 by olle, 9 years ago

(In [3949]) Refs #888. INCA servlet for INCA import refactored as preparation for use also with INCA statistics:

  1. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ refactored as preparation for use also with INCA statistics:
    a. Private inner class PotentialIncaImportLine renamed IncaEntryLine.
    b. Private method LineDatabaseMappingResult lineDatabaseMapping(DbControl dc, List<PotentialIncaImportLine> potentialIncaImportLines, ...) updated to take second argument List<IncaEntryLine> incaEntryLines.
    c. Private method InternalLateralityCheckResult internalLateralityCheck(List<PotentialIncaImportLine> potentialIncaImportLines) updated to take argument List<IncaEntryLine> incaEntryLines.
    d. Private method List<PotentialIncaImportLine> fetchPotentialIncaImportLines(int tempPatIdClmIndex, int personalNoClmIndex, int lateralityDescriptionClmIndex, List<String> lines) renamed fetchIncaEntryLines, is updated to return a List<IncaEntryLine>, and to take a new argument boolean accruedEntries, determining if entries with or without personal numbers should be returned.
    e. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "ImportInca" by making it compatible with the previous updates, without changing its functionality.

comment:8 by olle, 9 years ago

(In [3950]) Refs #888. INCA servlet for INCA import refactored in progress reporting as preparation for use also with INCA statistics:

  1. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ refactored in progress reporting as preparation for use also with INCA statistics:
    a. New private String constant IMPORT_PROGRESS_ID defined with value "inca-import-progress" used for progress tag in javascript file import-inca.js.
    b. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated by defining new String variable progressId, which is used as first argument when calling SessionControl method setSessionSetting(String name, Object value) with value being a SimpleProgressReporter object.
    c. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "ImportInca" by setting String variable progressId to new String constant IMPORT_PROGRESS_ID, before calling SessionControl method setSessionSetting(String name, Object value) with value being a SimpleProgressReporter object.

comment:9 by olle, 9 years ago

(In [3951]) Refs #888. INCA servlet for INCA import refactored regarding creation and download of report file as preparation for use also with INCA statistics:

  1. Javascript import-inca.js in resources/personal/ updated:
    a. Function checkForReportFile() updated by change of command name from "CheckForIncaImportReportFile" to "CheckForIncaReportFile" and addition of new parameter "reporttype" with value "import".
    b. Function downloadReportFile() updated by change of command name from "DownloadIncaImportReportFile" to "DownloadIncaReportFile" and addition of new parameter "reporttype" with value "import".
  2. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ refactored regarding creation and download of report file as preparation for use also with INCA statistics:
    a. New private String constant REPORT_TYPE_IMPORT defined with value "import".
    b. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated by change of command name "CheckForIncaImportReportFile" to "CheckForIncaReportFile" and use of value from new request parameter "reporttype" as argument when obtaining report file path from private method String fetchReportFilePath(String reportType).
    c. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated by change of command name "DownloadIncaImportReportFile" to "DownloadIncaReportFile" and use of value from new request parameter "reporttype" as argument when obtaining report file path from private method String fetchReportFilePath(String reportType) and report filename from new private method String fetchReportFileName(String reportType).
    d. Private method String fetchReportFilePath() updated with new argument String reportType , whose value is used as argument when obtaining report filename from new private method String fetchReportFileName(String reportType).
    e. New private method String fetchReportFileName(String reportType) added. If value of argument reportType equals String constant REPORT_TYPE_IMPORT, value of String constant INCA_IMPORT_REPORT_FILENAME is returned, else null.
    f. Private method void createIncaImportReportFile(JSONObject jsonIncaFilePropDetails, List<String> missingIncaHeadersList, String message) updated by obtaining report file path from private method String fetchReportFilePath(String reportType) with value of argument reportType set to value of String constant REPORT_TYPE_IMPORT.

comment:10 by olle, 9 years ago

(In [3952]) Refs #888. INCA servlet for INCA import updated by fixing typo in method java doc:

  1. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated by fix of typo in java doc for private method String fetchReportFileName(String reportType).

comment:11 by olle, 9 years ago

Design discussion:

  • As the details on entry selection and report layout for INCA statistics are not completely decided at the current time, these functions will at least initially be managed by separate methods for INCA import and statistics.
  • When collecting data for the statistics calculations, a number of entries falls in the category "N/A":
    a. Entries with an integer value corresponding to a measurement/inspection having been performed, but with inconclusive result.
    b. Entries with an integer value corresponding to no measurement/inspection having been performed.
    c. Blank entries for the variable of interest.
  • In the first version of the INCA statistics module, the number and percentage of "N/A" entries will be presented together with data corresponding to specific values, allowing the user to estimate the size of this "grey" group. However, in order to facilitate comparison with previously published data, where no "N/A" group is included, three numbers will normally be presented for each statistics entry:
    a. Percentage excluding "N/A" entries (enclosed in square brackets in report file, e.g. "[46.77%]").
    b. Percentage including "N/A" entries (e.g. "41.57%").
    c. Number of items (enclosed in parentheses, e.g. "(1376)").
Last edited 9 years ago by olle (previous) (diff)

comment:12 by olle, 9 years ago

(In [3963]) Refs #888. First (experimental) version of INCA statistics. It allows an INCA *.csv file in tab-separated format plus start and end date for the statistics calculation to be selected, after which a simple file check or a statistics calculation can be performed. Results are presented on the screen and in a created report file, which can be downloaded by clicking on a button in the web form.

  1. JSP file index.jsp in resources/ updated in section "Personal information wizards", sub-section "Export/import information to/from external registers", with new entry "INCA statistics" coupled to new JSP file inca-statistics.jsp in resources/personal/. It requires "PatientCurator" role to be used, since it needs access to an INCA file with sensitive data.
  2. New JSP file inca-statistics.jsp in resources/personal/ added. It is coupled to new javascript file inca-statistics.js in resources/personal/.
  3. New javascript file inca-statistics.js in resources/personal/ added. It allows an INCA *.csv file in tab-separated format plus start and end date for the statistics calculation to be selected, after which a simple file check or a statistics calculation can be performed. Results are presented on the screen and in a created report file, which can be downloaded by clicking on a button. Servlet requests are made to java servlet IncaServlet. Requests related to the report file are accompanied with parameter reporttype being set to value "statistics".
  4. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated with functionality for INCA statistics:
    a. New String constants REPORT_TYPE_STATISTICS, INCA_STATISTICS_REPORT_FILENAME, and STATISTICS_PROGRESS_ID defined. Constant REPORT_TYPE_STATISTICS is set to value "statistics".
    b. Private method String fetchReportFileName(String reportType) updated to return new String constant INCA_STATISTICS_REPORT_FILENAME for argument reportType having value REPORT_TYPE_STATISTICS.
    c. Private method JSONObject fetchKeyColumnIndexes(List<String> headerList, JSONObject jsonIncaFileProp) updated to return information on indexes for key columns of interest for INCA statistics.
    d. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated with new command "IncaStatistics". Much from command "ImportInca" is reused, but an initial entry date selection is performed using diagnose dates, after which INCA entry lines both with and without personal numbers are collected. Mapping of entry lines to database items is performed by new private method LineDatabaseMappingForStatisticsResult LineDatabaseMappingForStatistics(DbControl dc, List<IncaEntryLine> incaEntryLines, ...). A JSONObject jsonIncaStatistics with INCA statistics is obtained by calling new private method JSONObject incaStatistics(...). JSONObject jsonIncaStatistics is added to JSONObject jsonIncaFilePropDetails and to the returned JSONObject. The report file is obtained by calling new private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message).
    e. New private method List<String> filterIncaLinesByDate(int filterDateClmIndex, Date startDate, Date endDate, List<String> lines) added. It filters a list of INCA file lines by removing lines not within allowed time period.
    f. New private method LineDatabaseMappingForStatisticsResult lineDatabaseMappingForStatistics(DbControl dc, List<IncaEntryLine> incaEntryLines, ...) added. It performs database mapping and data value check on a list of INCA entry lines intended for INCA statistics. The result includes a list of lines of accrued entries with specimens.
    g. New private inner class LineDatabaseMappingForStatisticsResult added. It contains two private attributes with public accessor methods, LineDatabaseMappingResult lineDatabaseMappingResult and List<IncaEntryLine> accruedWithSpecimenEntryLineList.
    h. New private method JSONObject incaStatistics(List<IncaEntryLine> nonAccruedIncaEntryLines, List<IncaEntryLine> accruedIncaEntryLines, List<IncaEntryLine> accruedWithSpecimenEntryLines, JSONObject jsonIncaFileProp) added. It calculates INCA statistics and returns the results in a JSONObject.
    i. A number of private convenience methods supporting method incaStatistics(...) in performing the statistics calculation are added. They support statistics for variables having positive/negative status, grade selection, and selection of integer values in different groups depending on value.
    j. New private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message) added. It creates a report file with INCA statistics, corresponding to the data shown in the web form.

comment:13 by olle, 9 years ago

(In [3967]) Refs #888. Java servlet updated for INCA statistics in comments and variable names (fix of typos and clarification of variable content):

  1. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by correcting typos in variable names.
    b. Private method LineDatabaseMappingForStatisticsResult lineDatabaseMappingForStatistics(DbControl dc, List<IncaEntryLine> incaEntryLines, ...) updated in comments and variable names.

comment:14 by olle, 9 years ago

Functional specification update:

  • The user should be able to select what date variable will be used for the time period filter for the statistics calculation. Initially two choices should be available, diagnosis date and operation date.

Design update:

  1. JSP file inca-statistics.jsp in resources/personal/ updated:
    a. Step 1 is updated with a date variable selection menu.
    b. Step 2 is updated with two div tags for date variable description and date column header, respectively.
  2. Javascript file inca-statistics.js in resources/personal/ updated:
    a. Functions simpleCheckOfIncaFile() and calcStatistics() updated to retrieve value of the selected date variable, and submit the latter as value of parameter "statdatevar" when sending a POST request to java servlet IncaServlet with parameter "cmd" set to "IncaStatistics".
    b. Function initializeStep2(response) updated to retrieve the values of selected date variable and its column header from the response, and display the values (a more clear verbal description in case of the date variable) in new div tags under the name of the INCA file.
  3. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by retrieving value of selected date variable from parameter "statdatevar" and set the date column header accordingly. The values are added to the file property JSONObject, and the date column header is given as second argument to updated private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp). The returned date column index is used when filtering entry lines according to correct time period.
    b. Private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) updated with second argument String statDateClmKey, which is used when searching for the date column index.
    c. Private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message) updated to print the values of the selected date variable and its column header under the name of the INCA file.

comment:15 by olle, 9 years ago

(In [3968]) Refs #888. INCA statistics is updated by allowing the user to select what date variable will be used for the time period filter for the statistics calculation. Initially two choices are available, diagnosis date and operation date:

  1. JSP file inca-statistics.jsp in resources/personal/ updated:
    a. Step 1 is updated with a date variable selection menu.
    b. Step 2 is updated with two div tags for date variable description and date column header, respectively.
  2. Javascript file inca-statistics.js in resources/personal/ updated:
    a. Functions simpleCheckOfIncaFile() and calcStatistics() updated to retrieve value of the selected date variable, and submit the latter as value of parameter "statdatevar" when sending a POST request to java servlet IncaServlet with parameter "cmd" set to "IncaStatistics".
    b. Function initializeStep2(response) updated to retrieve the values of selected date variable and its column header from the response, and display the values (a more clear verbal description in case of the date variable) in new div tags under the name of the INCA file.
  3. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by retrieving value of selected date variable from parameter "statdatevar" and set the date column header accordingly. The values are added to the file property JSONObject, and the date column header is given as second argument to updated private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp). The returned date column index is used when filtering entry lines according to correct time period.
    b. Private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) updated with second argument String statDateClmKey, which is used when searching for the date column index.
    c. Private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message) updated to print the values of the selected date variable and its column header under the name of the INCA file.

comment:16 by olle, 9 years ago

(In [3969]) Refs #888. INCA statistics is updated by disabling date variable options in select menu after analysis has been started:

  1. Javascript file inca-statistics.js in resources/personal/ updated:
    a. Function initializeStep2(response) updated to call new function selectOptionsDisabled(id, value) with 'id' set to date variable select menu id and value set to true.
    b. New function selectOptionsDisabled(id, value) added. It sets attribute 'disabled' to the given value for all options in the select menu with given tag id.

comment:17 by olle, 9 years ago

(In [3970]) Refs #888. INCA statistics updated by adding table comments on how specific entry lines are counted in the statistics in current version:

  1. Javascript file inca-statistics.js in resources/personal/ updated in function initializeStep2(response) by adding table comments on how specific entry lines are counted in the statistics in current version of INCA statistics.

comment:18 by olle, 9 years ago

Functional specification update:

  • The user should be able to select a cancer type filter for the statistics calculation. Initially three choices should be available, "All" (default), "Invasive", and "In situ". Option "All" is equal to not applying a cancer type filter. Note that an entry may be labeled both "Invasive" and "In situ".

Design update:

  1. JSP file inca-statistics.jsp in resources/personal/ updated:
    a. Step 1 is updated with a cancer type selection menu.
    b. Step 2 is updated with a new div tag for cancer type description.
  2. Javascript file inca-statistics.js in resources/personal/ updated:
    a. Functions simpleCheckOfIncaFile() and calcStatistics() updated to retrieve value of the selected cancer type, and submit the latter as value of parameter "cancertype" when sending a POST request to java servlet IncaServlet with parameter "cmd" set to "IncaStatistics".
    b. Function initializeStep2(response) updated to retrieve the value of selected cancer type from the response, and display the value (a more clear verbal description) in new div tag under the name of the INCA file. The file property tables are updated with entries for the cancer type column index and number of data lines passing cancer type filter. The column indexes for statistics date and cancer type are included in the control of input file validity.
  3. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by retrieving value of selected cancer type from parameter "cancertype". The value is added to the file property JSONObject. The returned cancer type column index from private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) is used when filtering entry lines by calling new private method List<String> filterIncaLinesByCancerType(String cancerType, int cancerTypeClmIndex, List<String> lines).
    b. Private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) updated to search for the cancer type column index for header "A090InvCa_Värde".
    c. New private method List<String> filterIncaLinesByCancerType(String cancerType, int cancerTypeClmIndex, List<String> lines) added. It filters a list of INCA file lines by removing lines not having selected cancer type[s].
    d. Private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message) updated to print the value of the selected cancer type under the name of the INCA file, plus the cancer type column index and number of lines passing cancer type filter.

comment:19 by olle, 9 years ago

(In [3972]) Refs #888. INCA statistics updated by allowing the user to select a cancer type filter for the statistics calculation. Initially three choices are available, "All" (default), "Invasive", and "In situ". Option "All" is equal to not applying a cancer type filter. Note that an entry may be labeled both "Invasive" and "In situ".

  1. JSP file inca-statistics.jsp in resources/personal/ updated:
    a. Step 1 is updated with a cancer type selection menu.
    b. Step 2 is updated with a new div tag for cancer type description.
  2. Javascript file inca-statistics.js in resources/personal/ updated:
    a. Functions simpleCheckOfIncaFile() and calcStatistics() updated to retrieve value of the selected cancer type, and submit the latter as value of parameter "cancertype" when sending a POST request to java servlet IncaServlet with parameter "cmd" set to "IncaStatistics".
    b. Function initializeStep2(response) updated to retrieve the value of selected cancer type from the response, and display the value (a more clear verbal description) in new div tag under the name of the INCA file. The file property tables are updated with entries for the cancer type column index and number of data lines passing cancer type filter. The column indexes for statistics date and cancer type are included in the control of input file validity.
  3. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by retrieving value of selected cancer type from parameter "cancertype". The value is added to the file property JSONObject. The returned cancer type column index from private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) is used when filtering entry lines by calling new private method List<String> filterIncaLinesByCancerType(String cancerType, int cancerTypeClmIndex, List<String> lines).
    b. Private method JSONObject fetchKeyColumnIndexes(List<String> headerList, String statDateClmKey, JSONObject jsonIncaFileProp) updated to search for the cancer type column index for header "A090InvCa_Värde".
    c. New private method List<String> filterIncaLinesByCancerType(String cancerType, int cancerTypeClmIndex, List<String> lines) added. It filters a list of INCA file lines by removing lines not having selected cancer type[s].
    d. Private method void createIncaStatisticsReportFile(JSONObject jsonIncaFilePropDetails, String message) updated to print the value of the selected cancer type under the name of the INCA file, plus the cancer type column index and number of lines passing cancer type filter.

comment:20 by olle, 9 years ago

Note: INCA servlet was updated in change set [3975] as part of Ticket #890 (Remove calls to methods deprecated in BASE 3.9).

comment:21 by olle, 9 years ago

Functional specification update:

  • The results of an INCA statistics calculation should be stored in a *.csv text file in tab-separated format, in addition to the existing report file. The first version of this CSV file should contain the following columns:
Header Example
Property ER Status
Selection All Diagnoses
ValueName Positive (% excl. N/A)
ValueType Float
Value 86.131935

In general a row in the *.csv file corresponds to a single data value. When used to store information on e.g. statistics parameters or the used INCA file, some columns (normally the "Selection" column) might be empty.

comment:22 by olle, 9 years ago

(In [3980]) Refs #888. INCA statistics updated to store the results of an INCA statistics calculation in a *.csv text file in tab-separated format, in addition to the existing report file:

  1. JSP file inca-statistics.jsp in resources/personal/ updated by adding button for downloading CSV file.
  2. Javascript file inca-statistics.js in resources/personal/ updated:
    a. String constants REPORT_TYPE_STATISTICS and REPORT_TYPE_STATISTICS_CSV defined.
    b. Function initPage() updated by setting click handler for CSV file download button to new function downloadStatCsvFile(), and calling updated function checkForReportFile(reportType) with both argument REPORT_TYPE_STATISTICS and REPORT_TYPE_STATISTICS_CSV.
    c. Function calcStatistics() updated to disable new CSV file download button before calling servlet to perform statistics calculation.
    d. Function initializeStep2(response) updated to hide the CSV file download button if only a simple check has been performed (no updated of the CSV file is performed in this case), and to show and enable the button if a statistics calculation has been performed.
    e. Function checkForReportFile() updated with argument reportType, whose value is used for parameter reporttype, when sending a GET request to servlet IncaServlet with command "CheckForIncaReportFile".
    f. Function reportFileDownloadButtonDisplay(response) updated to obtain value of JSON key "reporttype" from response, and manage the corresponding file download button.
    g. Function downloadReportFile() updated to use new String constant REPORT_TYPE_STATISTICS as value for parameter "reporttype" when sending a GET request to servlet IncaServlet with command "DownloadIncaReportFile".
    h. New function downloadStatCsvFile() added. It sends a GET request to servlet IncaServlet with command "DownloadIncaReportFile" and value of parameter reporttype set to new String constant REPORT_TYPE_STATISTICS_CSV.
  3. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. String constants REPORT_TYPE_STATISTICS_CSV and INCA_STATISTICS_CSV_FILENAME defined.
    b. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated for command "CheckForIncaReportFile" by adding value of parameter reporttype to returned JSONObject with JSON key "reporttype".
    c. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by calling new private method void createIncaStatisticsCsvFile(JSONObject jsonIncaFilePropDetails) if a statistics calculation has been performed.
    d. Private method String fetchReportFileName(String reportType) updated to return value of new String constant INCA_STATISTICS_CSV_FILENAME if argument reportType equals value of new String constant REPORT_TYPE_STATISTICS_CSV.
    e. New private method void createIncaStatisticsCsvFile(JSONObject jsonIncaFilePropDetails) added. It retrieves statistics data from argument jsonIncaFilePropDetails and stores selected information in a *.csv file in tab-delimited format. The path of the CSV file is found by calling private method fetchReportFilePath(String reportType) with argument reportType set to value of new String constant REPORT_TYPE_STATISTICS_CSV.
    f. New private convenience methods added:
    i. String createCsvFilePosNegStatusStat(String property, String separator, DecimalFormat df, JSONObject jsonStat).
    ii. String createCsvFileGroupStat(String property, String separator, DecimalFormat df, JSONObject jsonStat).
    iii. String createCsvFileGradeStat(String property, String separator, DecimalFormat df, JSONObject jsonStat).
    iv. String createCsvFileVarStatTableRow(String property, String selection, String valueName, String separator, DecimalFormat df, JSONObject jsonSelection, String jsonExclPctKey, String jsonPctKey, String jsonNumKey).
    Currently the DecimalFormat argument is not used, as all float values are reported with original precision in the *.csv file.

comment:23 by olle, 8 years ago

(In [3981]) Refs #888. INCA statistics updated by commenting out debug output except for exceptions and found bad data:

  1. Java servlet class/file IncaServlet.java in src/net/sf/basedb/reggie/servlet/ updated:
    a. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for command "IncaStatistics" by commenting out debug output except for exceptions and found bad data.
    b. Private method LineDatabaseMappingForStatisticsResult lineDatabaseMappingForStatistics(DbControl dc, ...) updated by commenting out debug output except for exceptions and found bad data.
    c. Private convenience methods JSONObject incaStatPosNegNum(...), JSONObject incaStatGradeNum(...), and JSONObject incaStatGroupNum(...) updated by commenting out debug output.

comment:24 by olle, 8 years ago

Resolution: fixed
Status: assignedclosed

Ticket closed as first version of the INCA statistics have been implemented.

comment:25 by olle, 8 years ago

(In [3982]) Refs #888. INCA statistics user interface updated in step 1 by clarification of menu text for "Cancer type[s]" filter menu:

  1. JSP file inca-statistics.jsp in resources/personal/ updated in menu item text for "Cancer type[s]" filter menu, to clarify that selecting "Invasive" or "In situ" will also include entries labeled "Invasive and In situ".
Note: See TracTickets for help on using tickets.