Changeset 5058


Ignore:
Timestamp:
Oct 29, 2018, 10:45:16 AM (4 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1070: The consent registration wizard doesn't check existing consent

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/personal/consentform.js

    r4929 r5058  
    103103      var moreCasesHtml = '';
    104104      var numMissing = 0;
     105      var notYesConsent = null;
    105106      if (patientInfo.allCases)
    106107      {
     
    118119            numMissing++;
    119120          }
    120          
     121          else if (c.consent != 'Yes')
     122          {
     123            notYesConsent = c.consent;
     124          }
    121125          if (c.name == caseName && c.consentDate)
    122126          {
     
    143147            numMissing++;
    144148          }
     149          else if (c.consent != 'Yes')
     150          {
     151            notYesConsent = c.consent;
     152          }
    145153          if (c.name.indexOf(caseName) == 0 && c.consentDate)
    146154          {
     
    152160        }
    153161      }
    154      
    155       consent.enableConsentOption('consent.yes', true);
    156       Doc.element('moreCases').innerHTML = moreCasesHtml;
    157       Doc.show('moreCasesSection');
    158 
    159       if (numMissing > 0)
    160       {
    161         Wizard.setInputStatus('consent', 'valid', 'This patient already exists and has at least one case or blood sample with missing consent.');
     162
     163      if (notYesConsent)
     164      {
     165        consent.enableConsentOption(consentToId[notYesConsent], true);
     166        Doc.element('moreCasesNo').innerHTML = moreCasesHtml;
     167        Doc.show('moreCasesSectionNo');
     168        Wizard.setInputStatus('consent', 'valid', '"' + notYesConsent + '" has already been registered for this case. It is not possible to change with this wizard.');
     169        Doc.show('gorestart');
     170        Wizard.setNoConfirm(true);
    162171      }
    163172      else
    164173      {
    165         Wizard.setInputStatus('consent', 'valid', '"Yes" has already been registered for all case and blood samples for this patient.');
    166       }
    167       Doc.show('morehelp.multiple', 'inline');
    168       Doc.show('morehelp.yesonly', 'inline');
    169       Doc.show('gocancel');
    170       Doc.show('goregister');
    171 
     174        consent.enableConsentOption('consent.yes', true);
     175        Doc.element('moreCases').innerHTML = moreCasesHtml;
     176        Doc.show('moreCasesSection');
     177        if (numMissing > 0)
     178        {
     179          Wizard.setInputStatus('consent', 'valid', 'This patient already exists and has at least one case or blood sample with missing consent.');
     180        }
     181        else
     182        {
     183          Wizard.setInputStatus('consent', 'valid', '"Yes" has already been registered for all case and blood samples for this patient.');
     184        }
     185        Doc.show('morehelp.multiple', 'inline');
     186        Doc.show('morehelp.yesonly', 'inline');
     187        Doc.show('gocancel');
     188        Doc.show('goregister');
     189      }
    172190    }
    173191    else if (caseInfo)
     
    178196      Wizard.setInputStatus('consent', '', '"' + caseInfo.consent + '" has already been registered for this case. It is not possible to change with this wizard.');
    179197      Doc.show('gorestart');
     198      Wizard.setNoConfirm(true);
    180199      if (caseInfo.consentDate)
    181200      {
  • extensions/net.sf.basedb.reggie/trunk/resources/personal/consentform.jsp

    r3976 r5058  
    8484            <input id="consent.no" type="radio" name="consent" value="No" disabled>
    8585            No</label><br>
     86          <div id="moreCasesSectionNo" style="display: none;">
     87            <table>
     88            <tr valign="baseline">
     89              <td><img src="../images/joinbottom.gif"></td>
     90              <td id="moreCasesNo"></td>
     91            </tr>
     92            </table>
     93          </div>
    8694          <label id="consent.yes.label" class="disabled">
    8795            <input id="consent.yes" type="radio" name="consent" value="Yes" disabled>
  • extensions/net.sf.basedb.reggie/trunk/resources/reggie-2.js

    r5019 r5058  
    490490  var forceConfirm = false;
    491491  var noConfirmOnFirstStep = true;
     492  var noConfirm = false;
    492493  var hasFatalError = false;
    493494  var progressTimer = null;
     
    908909  {
    909910    noConfirmOnFirstStep = cf;
     911  }
     912 
     913  wizard.setNoConfirm = function(nc)
     914  {
     915    noConfirm = nc;
    910916  }
    911917 
     
    15291535    if (!forceConfirm)
    15301536    {
    1531       if (currentStep == 1 && noConfirmOnFirstStep) return;
     1537      if (currentStep == 1 && noConfirmOnFirstStep || noConfirm) return;
    15321538      if (hasSentRegistration && numLiveAsyncRequests == 0) return;
    15331539    }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ConsentFormServlet.java

    r4902 r5058  
    7171          4. A real case or blood sample exists which connects to a patient --> List all cases + blood samples
    7272             for the patient with current consent status and allow Yes + date to be registered for those
    73              do not have a consent yet.
     73             do not have a consent yet. If the current consent is 'No' (could happen if a patient has
     74             retracted the consent but the retraction process has not been completed yet), no changes are allowed.
    7475        */
    7576        dc = sc.newDbControl();
Note: See TracChangeset for help on using the changeset viewer.