Changeset 1741


Ignore:
Timestamp:
Nov 22, 2012, 9:13:19 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #432: The monthly operation list should include column headers

Including the headers what easy. Forrmatting the preview so that is looked nice requried a bit more work since columns do not align with the headers. Now using a <table> approach instead.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 edited

Legend:

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

    r1740 r1741  
    7373    {
    7474      var allLines = request.responseText.split('\n');
    75       var numLines = allLines.length - 1;
    76      
     75      var numCases = allLines.length - 2; // First line is a header line
     76     
     77      var html = '<tr><th>'+allLines[0].replace(/\t/g, '</th><th>')+'</th></tr>';
    7778      // Check last column for the 'Consent' value. All should be 'YES' for the export to be ok.
    7879      var numNoConsent = 0;
    7980      var numMissingConsent = 0;
    80       for (var i = 0 ; i < numLines; i++)
     81      for (var i = 1 ; i <= numCases; i++)
    8182      {
    8283        var line = allLines[i];
    83         var lastColIdx = line.lastIndexOf('\t');
    84         var lastCol = line.substr(lastColIdx+1);
    85        
    86         if (lastCol != 'YES')
     84        var cols = line.split(/\t/);
     85        var consent = cols[cols.length-1];
     86        var rowClass = '';
     87        if (consent != 'YES')
    8788        {
    88           if (lastCol == 'MISSING')
     89          rowClass = 'consent-warning';
     90          if (consent == 'MISSING')
    8991          {
    9092            numMissingConsent++;
     
    9496            numNoConsent++;
    9597          }
    96           allLines[i] = '<span class="consent-warning">'+line+'</span>';
    9798        }
     99        html += '<tr class="'+rowClass+'"><td>'+cols.join('</td><td>')+'</td></tr>';
    98100      }
    99101     
     
    106108      }
    107109     
    108       previewTitle.innerHTML = 'Operation dates - ' + frm.time[frm.time.selectedIndex].text + ' (' + numLines + ')';
    109       previewList.innerHTML = allLines.join('\n');
     110      previewTitle.innerHTML = 'Operation dates - ' + frm.time[frm.time.selectedIndex].text + ' (' + numCases + ')';
     111      previewList.innerHTML = '<table>'+html+'</table>';
    110112      Main.show('previewWrapper');
    111113    }
     
    156158}
    157159
     160#previewList th
     161{
     162  border-bottom: 1px dotted #A0A0A0;
     163}
     164
     165#previewList td, #previewList th
     166{
     167  text-align: left;
     168  padding-right: 2em;
     169  vertical-align: bottom;
     170}
     171
    158172.consent-warning
    159173{
    160   font-weight: bold;
    161174  color: #A00000;
    162175  background-color: #F8F8E8;
    163176}
    164177
    165 .consent-warning:after
    166 {
    167   content: url('images/warning_small.png');
    168   vertical-align: middle;
     178.consent-warning td:last-child
     179{
     180  background-image: url('images/warning_small.png');
     181  background-position: 95% 50%;
     182  background-repeat: no-repeat;
    169183}
    170184
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ExportServlet.java

    r1740 r1741  
    157157        resp.setCharacterEncoding("UTF-8");
    158158        PrintWriter os = resp.getWriter();
     159        os.write("PersonalNr\tScanBId\tOpDate\tLaterality\tSite");
     160        if (exportSubtype) os.write("\tSpecimen");
     161        if (exportPatientId) os.write("\tPatientId");
     162        os.write("\tConsent\n");
     163
    159164        for (PersonalOpDate pop : opDates)
    160165        {
Note: See TracChangeset for help on using the changeset viewer.