Changeset 1784
- Timestamp:
- Dec 13, 2012, 9:53:56 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp
r1772 r1784 33 33 var numCols; 34 34 var unknownSite = 0; 35 var unknownCreation; 35 var unknownCreation = 0; 36 var numMissing = 0; 36 37 var numPatientsNoSamples = 0; 37 38 … … 337 338 summaryList.appendChild(getListElement(unknownSite + ' consents registered to unknown sites.')); 338 339 summaryList.appendChild(getListElement(unknownCreation + ' consents without known date. These are included in the \'Total\' column.')); 340 summaryList.appendChild(getListElement(numMissing + ' missing consents for cases and blood samples. These are NOT included in the \'Total\' column.')); 339 341 summaryList.appendChild(getListElement(numDuplicates + ' duplicates ignored.')); 340 342 … … 637 639 var numCols = 4; 638 640 var numDecimals = 0; 639 var headerText = '# Consent forms of different types for cases and blood samples , unknown consent date';641 var headerText = '# Consent forms of different types for cases and blood samples with unknown consent date, as well as items with missing consents'; 640 642 headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+5))); 641 643 … … 677 679 sitesCombinedRow.appendChild(getTableCellElement('', 'colsummary', 2)); 678 680 // Get combined numbers for all sites 681 var noDateOrMissingKey = 'noDateOrMissing'; 679 682 var sumKey = 'sumKey'; 680 683 var statistics = report.statistics; … … 682 685 if (sitesCombined != null) 683 686 { 684 data = getJSONDataWithPercent(sitesCombined, 'yesNoDate', sumKey, numDecimals);685 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 686 data = getJSONDataWithPercent(sitesCombined, 'noNoDate', sumKey, numDecimals);687 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 688 data = getJSONDataWithPercent(sitesCombined, 'notAskedNoDate', sumKey, numDecimals);689 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 690 data = getJSONDataWithPercent(sitesCombined, 'missing', sumKey, numDecimals);691 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 692 }693 // Add entry with total number of consents with chosen restrictions694 var noDateKey = 'noDate';695 data = getJSONData(sitesCombined, noDateKey, 0);696 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary'));697 // Add entry with total number of consents, regardless of restrictions698 var totalKey = 'totalKey';699 data = getJSONData(sitesCombined, totalKey, 0);700 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary'));687 data = getJSONDataWithPercent(sitesCombined, 'yesNoDate', noDateOrMissingKey, numDecimals); 688 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 689 data = getJSONDataWithPercent(sitesCombined, 'noNoDate', noDateOrMissingKey, numDecimals); 690 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 691 data = getJSONDataWithPercent(sitesCombined, 'notAskedNoDate', noDateOrMissingKey, numDecimals); 692 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 693 data = getJSONDataWithPercent(sitesCombined, 'missing', noDateOrMissingKey, numDecimals); 694 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 695 // Add entry with total number of consents with chosen restrictions 696 var noDateOrMissingKey = 'noDateOrMissing'; 697 data = getJSONData(sitesCombined, noDateOrMissingKey, 0); 698 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 699 // Add entry with total number of consents, regardless of restrictions 700 var totalKey = 'totalKey'; 701 data = getJSONData(sitesCombined, totalKey, 0); 702 sitesCombinedRow.appendChild(getTableCellElement(data, 'colsummary')); 703 } 701 704 reportTable.appendChild(sitesCombinedRow); 702 705 … … 1198 1201 unknownCreation = statistics.noDate; 1199 1202 unknownSite = statistics.unknownSite; 1203 numMissing = statistics.missing; 1200 1204 var siteOrderList = report.siteOrderListKey; 1201 1205 for (var siteOrderIndex in siteOrderList) … … 1216 1220 tableRow.appendChild(getTableCellElement(siteStartDateStr, 'reportdata')); 1217 1221 tableRow.appendChild(getTableCellElement(siteLatestDateStr, 'reportdata')); 1218 var noDate Key = 'noDate';1222 var noDateOrMissingKey = 'noDateOrMissing'; 1219 1223 var sumKey = 'sumKey'; 1220 1224 var totalKey = 'totalKey'; 1221 1225 if (siteData != null) 1222 1226 { 1223 data = getJSONDataWithPercent(siteData, 'yesNoDate', sumKey, numDecimals);1224 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1225 data = getJSONDataWithPercent(siteData, 'noNoDate', sumKey, numDecimals);1226 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1227 data = getJSONDataWithPercent(siteData, 'notAskedNoDate', sumKey, numDecimals);1228 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1229 data = getJSONDataWithPercent(siteData, 'missing', sumKey, numDecimals);1227 data = getJSONDataWithPercent(siteData, 'yesNoDate', noDateOrMissingKey, numDecimals); 1228 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1229 data = getJSONDataWithPercent(siteData, 'noNoDate', noDateOrMissingKey, numDecimals); 1230 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1231 data = getJSONDataWithPercent(siteData, 'notAskedNoDate', noDateOrMissingKey, numDecimals); 1232 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1233 data = getJSONDataWithPercent(siteData, 'missing', noDateOrMissingKey, numDecimals); 1230 1234 tableRow.appendChild(getTableCellElement(data, 'reportdata')); 1231 1235 // Add column with summed values for site 1232 var siteSum = getJSONData(siteData, noDate Key, 0);1236 var siteSum = getJSONData(siteData, noDateOrMissingKey, 0); 1233 1237 tableRow.appendChild(getTableCellElement(siteSum, 'rowsummary')); 1234 1238 } -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SampleReportServlet.java
r1772 r1784 488 488 String latestDateKey = "latestDateKey"; 489 489 String noDateKey = "noDate"; 490 String noDateOrMissingKey = "noDateOrMissing"; 490 491 String duplicateKey = "duplicateKey"; 491 492 jsonStatistics.put(sitesCombinedKey, jsonSitesCombined); … … 502 503 jsonStatistics = initializeJSONSiteData(jsonStatistics, missingKey); 503 504 jsonStatistics = initializeJSONSiteData(jsonStatistics, noDateKey); 505 jsonStatistics = initializeJSONSiteData(jsonStatistics, noDateOrMissingKey); 504 506 jsonStatistics = initializeJSONSiteData(jsonStatistics, sumKey); 505 507 jsonStatistics = initializeJSONSiteData(jsonStatistics, totalKey); … … 516 518 jsonSitesCombined.put(missingKey, 0); 517 519 jsonSitesCombined.put(noDateKey, 0); 520 jsonSitesCombined.put(noDateOrMissingKey, 0); 518 521 jsonSitesCombined.put(sumKey, 0); 519 522 jsonSitesCombined.put(totalKey, 0); 520 523 // Initialize other data to 0 for different keys 521 524 jsonStatistics.put(noDateKey, 0); 525 jsonStatistics.put(missingKey, 0); 522 526 jsonStatistics.put(duplicateKey, 0); 523 527 Date latestDate = null; … … 651 655 // Update consent counters 652 656 jsonSite = updateJSONObjectCounter(jsonSite, key); 653 jsonSite = updateJSONObjectCounter(jsonSite, sumKey);654 657 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, key); 655 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, sumKey); 658 // Include all consents except missing in summed count 659 if (consent != null) 660 { 661 jsonSite = updateJSONObjectCounter(jsonSite, sumKey); 662 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, sumKey); 663 } 656 664 } 657 665 if (consentDate == null) 658 666 { 659 // Include consents with unknown date 660 jsonSite = updateJSONObjectCounter(jsonSite, noDateKey); 661 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, noDateKey); 662 jsonStatistics = updateJSONObjectCounter(jsonStatistics, noDateKey); 663 } 664 // Increase the counter for total consents for the site, regardless of creation date 665 jsonSite = updateJSONObjectCounter(jsonSite, totalKey); 666 667 // Increase the counter for total consents for all sites 668 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, totalKey); 667 // Include consents with unknown date for site, but not missing consents 668 if (consent != null) 669 { 670 jsonSite = updateJSONObjectCounter(jsonSite, noDateKey); 671 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, noDateKey); 672 jsonStatistics = updateJSONObjectCounter(jsonStatistics, noDateKey); 673 } 674 else 675 { 676 jsonStatistics = updateJSONObjectCounter(jsonStatistics, missingKey); 677 } 678 jsonSite = updateJSONObjectCounter(jsonSite, noDateOrMissingKey); 679 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, noDateOrMissingKey); 680 jsonStatistics = updateJSONObjectCounter(jsonStatistics, noDateOrMissingKey); 681 } 682 // Include all consents except missing in total count 683 if (consent != null) 684 { 685 // Increase the counter for total consents for the site, regardless of creation date 686 jsonSite = updateJSONObjectCounter(jsonSite, totalKey); 687 688 // Increase the counter for total consents for all sites 689 jsonSitesCombined = updateJSONObjectCounter(jsonSitesCombined, totalKey); 690 } 669 691 } 670 692 else
Note: See TracChangeset
for help on using the changeset viewer.