Ignore:
Timestamp:
Mar 16, 2012, 2:47:15 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #369: Update names for an existing patient

File:
1 edited

Legend:

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

    r1538 r1572  
    113113    }
    114114  }
     115  else // existing patient
     116  {
     117    if (frm.existingAllFirstNames.value == '')
     118    {
     119      setInputStatus('existingAllFirstNames', 'Missing', 'invalid');
     120      frm.existingAllFirstNames.focus();
     121      formOk = false;
     122    }
     123    else
     124    {
     125      setInputStatus('existingAllFirstNames', '', 'valid');
     126    }
     127   
     128    if (frm.existingFamilyName.value == '')
     129    {
     130      setInputStatus('existingFamilyName', 'Missing', 'invalid');
     131      frm.existingFamilyName.focus();
     132      formOk = false;
     133    }
     134    else
     135    {
     136      setInputStatus('existingFamilyName', '', 'valid');
     137    }
     138   
     139  }
    115140  return formOk;
    116141}
     
    480505    Main.show('existingPatientSection');
    481506    setInnerHTML('existing.patientCode', patientInfo.name);
    482     setInnerHTML('existing.familyName', patientInfo.familyName);
    483     setInnerHTML('existing.allFirstNames', patientInfo.allFirstNames);
     507    frm.existingFamilyName.value = patientInfo.familyName;
     508    frm.existingAllFirstNames.value = patientInfo.allFirstNames;
    484509    if (patientInfo.dateOfBirth) setInnerHTML('existing.dateOfBirth', patientInfo.dateOfBirth);
    485510    if (patientInfo.gender) setInnerHTML('existing.gender', patientInfo.gender);
    486     gotoStep3();
     511    frm.existingFamilyName.focus();
    487512  }
    488513}
     
    493518  var frm = document.forms['reggie'];
    494519 
    495   if (!patientInfo.id)
     520  if (!patientInfo.id) // new patient
    496521  {
    497522    frm.patientCode.disabled = true;
     
    500525    patientInfo.familyName = frm.familyName.value;
    501526    patientInfo.allFirstNames = frm.allFirstNames.value;
     527  }
     528  else // existing patient
     529  {
     530    frm.existingFamilyName.disabled = true;
     531    frm.existingAllFirstNames.disabled = true;
     532    patientInfo.familyName = frm.existingFamilyName.value;
     533    patientInfo.allFirstNames = frm.existingAllFirstNames.value;
    502534  }
    503535  currentStep = 3;
     
    791823
    792824  if (debug) Main.debug(JSON.stringify(submitInfo));
    793 
     825 
    794826  var request = Ajax.getXmlHttpRequest();
    795827  var url = 'PersonalRegistration.servlet?ID=<%=ID%>&cmd=';
     
    939971        <td class="help"></td>
    940972      </tr>
    941       <tr>
     973      <tr valign="top">
    942974        <td class="prompt">Family name</td>
    943         <td class="input" id="existing.familyName"></td>
    944         <td class="status"></td>
    945         <td class="help"></td>
    946       </tr>
    947       <tr>
     975        <td class="input"><input type="text" name="existingFamilyName"
     976          value="" size="35" maxlength="255"
     977          onkeypress="focusOnEnter(event, 'existingAllFirstNames')"></td>
     978        <td class="status" id="existingFamilyName.status"></td>
     979        <td class="help"><span id="existingFamilyName.message" class="message" style="display: none;"></span>Keep hyphens, keep åäö, replace all special accented letters [e.g. éèü etc] with standard alphabet character.</td>
     980      </tr>
     981      <tr valign="top">
    948982        <td class="prompt">All first names</td>
    949         <td class="input" id="existing.allFirstNames"></td>
    950         <td class="status"></td>
    951         <td class="help"></td>
     983        <td class="input"><input type="text" name="existingAllFirstNames"
     984          size="35" maxlength="255" onkeypress="doOnTabOrEnter(event, goNextAuto)"></td>
     985        <td class="status" id="existingAllFirstNames.status"></td>
     986        <td class="help"><span id="existingAllFirstNames.message" class="message" style="display: none;"></span>Type all names, see FamilyName comment on valid characters.</td>
    952987      </tr>
    953988      <tr>
Note: See TracChangeset for help on using the changeset viewer.