Ignore:
Timestamp:
Nov 16, 2012, 4:19:51 PM (9 years ago)
Author:
olle
Message:

Fixes #428. Refs #420. Refs #426. Sample count report and consent count report updated to show a table column with latest item dates for each site.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp

    r1735 r1737  
    350350      headerText += latestDate.getDate();
    351351    }   
    352     headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+4)));
     352    headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+5)));
    353353   
    354354    // Sub headers
     
    356356    if (viewType != 'YEAR')
    357357    {
    358       subHeaderRowYear.appendChild(getTableCellElement('', 'reportsubheader', 2));
     358      subHeaderRowYear.appendChild(getTableCellElement('', 'reportsubheader', 3));
    359359      addYearSubHeaders(periodStartDate, endDate, subHeaderRowYear, viewType);     
    360360      subHeaderRowYear.appendChild(getTableCellElement('', 'reportsubheader', 2));
     
    364364    var siteHeader = getTableCellElement('Site', 'reportsubheader');     
    365365    var startDateHeader = getTableCellElement('Start date','reportsubheader');
     366    var latestDateHeader = getTableCellElement('Latest date','reportsubheader');
    366367    columnHeaderRow.appendChild(siteHeader);
    367368    columnHeaderRow.appendChild(startDateHeader);
     369    columnHeaderRow.appendChild(latestDateHeader); 
    368370   
    369371    if (viewType == 'MONTH') addMonthColumnHeaders(columnHeaderRow, periodStartDate);
     
    387389    var sitesCombinedRow = document.createElement('tr');
    388390    sitesCombinedRow.appendChild(getTableCellElement('Sites combined', 'colsummary'));
    389     sitesCombinedRow.appendChild(getTableCellElement('', 'colsummary'));
     391    sitesCombinedRow.appendChild(getTableCellElement('', 'colsummary', 2));
    390392    // Get combined numbers for all sites for each period
    391393    var statistics = report.statistics;
     
    452454    var numDecimals = 0;
    453455    var headerText = '# Consent forms of different types for cases and blood samples';
    454     headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+3)));
     456    headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+4)));
    455457   
    456458    // Subheader   
    457459    subHeaderRow.appendChild(getTableCellElement('', 'reportsubheader'));
    458     subHeaderRow.appendChild(getTableCellElement('', 'reportsubheader'));
     460    subHeaderRow.appendChild(getTableCellElement('', 'reportsubheader', 2));
    459461   
    460462    //subHeaderRow.appendChild(getTableCellElement('Yes', 'reportsubheader'));
     
    474476    var siteHeader = getTableCellElement('Site', 'reportsubheader');     
    475477    var startDateHeader = getTableCellElement('Start date','reportsubheader');
     478    var latestDateHeader = getTableCellElement('Latest date','reportsubheader');
    476479    columnHeaderRow.appendChild(siteHeader);
    477480    columnHeaderRow.appendChild(startDateHeader);
     481    columnHeaderRow.appendChild(latestDateHeader); 
    478482   
    479483    //columnHeaderRow.appendChild(getTableCellElement('Yes', 'reportsubheader'));
     
    501505    var sitesCombinedRow = document.createElement('tr');
    502506    sitesCombinedRow.appendChild(getTableCellElement('Sites combined', 'colsummary'));
    503     sitesCombinedRow.appendChild(getTableCellElement('', 'colsummary'));
     507    sitesCombinedRow.appendChild(getTableCellElement('', 'colsummary', 2));
    504508    // Get combined numbers for all sites for each period
    505509    var sumKey = 'sumKey';
     
    630634     
    631635      var siteData = statistics[namePrefix];     
     636      var siteLatestDate = siteData['latestDateKey'];
     637      var siteLatestDateYear = siteLatestDate.substr(0,4);
     638      var siteLatestDateMonth = siteLatestDate.substr(4,2);
     639      var siteLatestDateDate = siteLatestDate.substr(6,2);
     640      var siteLatestDateStr = siteLatestDateYear + '-' + siteLatestDateMonth + '-' + siteLatestDateDate;
    632641      var tableRow = document.createElement('tr');
    633642      var tableCol = getTableCellElement(siteName, 'rowtitle');
    634643      tableRow.appendChild(tableCol);
    635644      tableRow.appendChild(getTableCellElement(year+'-'+(month)+'-'+date, 'reportdata'));
     645      tableRow.appendChild(getTableCellElement(siteLatestDateStr, 'reportdata'));
    636646      //var currentDate = new Date(periodStartDate.getFullYear(), periodStartDate.getMonth(), periodStartDate.getDate());     
    637647      var sumKey = 'sumKey';
     
    899909      var siteStartDate = new Date(year, month-1, date);
    900910     
    901       var siteData = statistics[namePrefix];     
     911      var siteData = statistics[namePrefix];
     912      var siteLatestDate = siteData['latestDateKey'];
     913      var siteLatestDateYear = siteLatestDate.substr(0,4);
     914      var siteLatestDateMonth = siteLatestDate.substr(4,2);
     915      var siteLatestDateDate = siteLatestDate.substr(6,2);
     916      var siteLatestDateStr = siteLatestDateYear + '-' + siteLatestDateMonth + '-' + siteLatestDateDate;
    902917      var tableRow = document.createElement('tr');
    903918      var tableCol = getTableCellElement(siteName, 'rowtitle');
    904919      tableRow.appendChild(tableCol);
    905920      tableRow.appendChild(getTableCellElement(year+'-'+(month)+'-'+date, 'reportdata'));
     921      tableRow.appendChild(getTableCellElement(siteLatestDateStr, 'reportdata'));
    906922      var currentDate = new Date(periodStartDate.getFullYear(), periodStartDate.getMonth(), periodStartDate.getDate());     
    907923      var columnCounter = 0;
Note: See TracChangeset for help on using the changeset viewer.