source: extensions/net.sf.basedb.reggie/trunk/resources/bloodform.jsp @ 1767

Last change on this file since 1767 was 1767, checked in by Nicklas Nordborg, 10 years ago

Fixes #442: Allow pathology and blood registration wizards to save patients without names

File size: 23.4 KB
Line 
1<%@ page
2  pageEncoding="UTF-8"
3  session="false"
4  import="net.sf.basedb.core.Application"
5  import="net.sf.basedb.core.User"
6  import="net.sf.basedb.core.DbControl"
7  import="net.sf.basedb.core.SessionControl"
8  import="net.sf.basedb.clients.web.Base"
9  import="net.sf.basedb.clients.web.util.HTML"
10  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
11  import="net.sf.basedb.util.Values"
12%>
13<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
14<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
15<%
16final SessionControl sc = Base.getExistingSessionControl(request, true);
17final String ID = sc.getId();
18final float scale = Base.getScale(sc);
19final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie");
20
21DbControl dc = null;
22try
23{
24  dc = sc.newDbControl();
25  final User user = User.getById(dc, sc.getLoggedInUserId());
26%>
27<base:page type="default" >
28<base:head scripts="ajax.js" styles="path.css">
29  <link rel="stylesheet" type="text/css" href="css/reggie.css">
30  <script language="JavaScript" src="reggie.js" type="text/javascript" charset="UTF-8"></script>
31 
32<script language="JavaScript">
33
34var debug = false;
35var currentStep = 1;
36var pnrIsValid = false;
37var pnrIsAcceptable = false;
38var caseIsValid = false;
39var samplingDateIsValid = true;
40var freezerDateIsValid = true;
41
42var patientInfo = null;
43var bloodInfo = null;
44var consentInfo = null;
45
46function init()
47{
48  var frm = document.forms['reggie'];
49  frm.caseName.focus();
50}
51
52function step1IsValid()
53{
54  return pnrIsValid && caseIsValid;
55}
56
57function step1IsAcceptable()
58{
59  return pnrIsAcceptable && caseIsValid;
60}
61
62function step2IsValid()
63{
64  var formOk = true;
65  var frm = document.forms['reggie'];
66
67  // New patient only
68  if (!patientInfo.id)
69  {
70    // Validate 'New patient' form
71    if (frm.allFirstNames.value == '')
72    {
73      setInputStatus('allFirstNames', 'Missing', 'warning');
74      formOk = false;
75    }
76    else
77    {
78      setInputStatus('allFirstNames', '', 'valid');
79    }
80   
81    if (frm.familyName.value == '')
82    {
83      setInputStatus('familyName', 'Missing', 'warning');
84      formOk = false;
85    }
86    else
87    {
88      setInputStatus('familyName', '', 'valid');
89    }
90
91    if (frm.patientCode.value == '')
92    {
93      setInputStatus('patientCode', 'Missing', 'invalid');
94      frm.patientCode.focus();
95      formOk = false;
96    }
97    else
98    {
99      setInputStatus('patientCode', '', 'valid');
100    }
101  }
102  return formOk;
103}
104
105function step2IsAcceptable()
106{
107  var formOk = true;
108  var frm = document.forms['reggie'];
109  // New patient only
110  if (!patientInfo.id)
111  {
112    formOk = frm.patientCode.value != '';
113  }
114  return formOk;
115}
116
117
118function step3IsValid()
119{
120  var isValid = samplingDateIsValid && freezerDateIsValid;
121  return isValid;
122}
123
124function goNextAuto()
125{
126  goNext(false);
127}
128
129function goNext(manual)
130{
131  var frm = document.forms['reggie'];
132  setInnerHTML('gonext.message', '');
133  if (currentStep == 1)
134  {
135    if (step1IsValid())
136    {
137      gotoStep2();
138    }
139    else if (step1IsAcceptable())
140    {
141      if (manual)
142      {
143        gotoStep2();
144      }
145      else
146      {
147        frm.personalNumber.focus();
148        setInnerHTML('gonext.message', 'Personal number is non-standard. Click \'Next\' to continue registration.');
149      }
150    }
151  }
152  else if (currentStep == 2)
153  {
154    if (step2IsValid())
155    {
156      gotoStep3();
157    }
158    else if (step2IsAcceptable())
159    {
160      if (manual)
161      {
162        gotoStep3();
163      }
164      else
165      {
166        setInnerHTML('gonext.message', 'Missing name(s). Click \'Next\' to continue registration.');
167      }
168    }
169  }
170}
171
172function caseNameOnChange()
173{
174  var frm = document.forms['reggie'];
175  var caseName = frm.caseName.value.toUpperCase();
176  caseIsValid = false;
177  if (caseName == '')
178  {
179    setInputStatus('case', 'Missing', 'invalid');
180    frm.caseName.focus();
181    return;
182  }
183  if (!isValidCaseName(caseName, true)) // Allow 'C' suffix to be used
184  {
185    setInputStatus('case', 'Only 7-digits name + optional \'C\' is allowed.', 'invalid');
186    frm.caseName.focus();
187    return;
188  }
189
190  frm.caseName.value = caseName;
191  setInputStatus('case', '', 'valid');
192  caseIsValid = true;
193 
194  getBloodInfo();
195}
196
197function personalNumberOnChange()
198{
199  var frm = document.forms['reggie'];
200  var pnr = frm.personalNumber.value;
201  pnrIsValid = false;
202  pnrIsAcceptable = true;
203 
204  var pnrLen = pnr.length;
205  if (pnrLen != 12 && pnrLen != 10)
206  {
207    setInputStatus('pnr', pnrLen < 12 ? 'Too short' : 'Too long', 'warning');
208    return;
209  }
210
211  if (!pnr.match(/^\d+$/))
212  {
213    setInputStatus('pnr', 'Non-standard personal number', 'warning');
214    return;
215  }
216 
217  var datePart = pnr.substring(0, pnrLen - 4); // Remove last four digits
218  var dateFormat = pnrLen == 10 ? 'yyMMdd' : 'yyyyMMdd';
219  var isValidDate = Dates.isDate(datePart, dateFormat);
220  if (!isValidDate)
221  {
222    var dayInMonth = parseInt(datePart.substring(-2), 10); // Last two characters
223    if (dayInMonth > 60)
224    {
225      // 'Samordningsnummer' has day-in-month + 60; check this
226      dayInMonth -= 60;
227      var tmpPnr = pnr.substring(0, pnrLen - 6); // First 4 or 6 digits is year+month
228      if (dayInMonth < 10) tmpPnr += '0';
229      tmpPnr += dayInMonth;
230      isValidDate = Dates.isDate(tmpPnr, dateFormat);
231    }
232  }
233  if (!isValidDate)
234  {
235    setInputStatus('pnr', 'Not a valid date', 'warning');
236    return;
237  }
238 
239  if (!personalNumberControlDigitCheck(pnr.substr(pnrLen == 10 ? 0 : 2)))
240  {
241    setInputStatus('pnr', 'Invalid control digit', 'warning');
242    return;
243  }
244 
245  setInputStatus('pnr', '', 'valid');
246  pnrIsValid = true;
247}
248
249function nameOnChange(event)
250{
251  var field = event.target;
252  if (field.value == '')
253  {
254    setInputStatus(field.name, 'Missing', 'warning');
255  }
256  else
257  {
258    setInputStatus(field.name, '', 'valid');
259  }
260}
261
262function samplingDateTimeOnChange()
263{
264  var frm = document.forms['reggie'];
265  samplingDateIsValid = false;
266  setInputStatus('samplingDate', '', '');
267 
268  var samplingDate = frm.samplingDate.value;
269  var samplingTime = frm.samplingTime.value;
270 
271  if (samplingDate != '' || samplingTime != '')
272  {
273    // Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits.
274    samplingDate = autoFillDate(samplingDate);
275    frm.samplingDate.value = samplingDate;
276
277    samplingTime = autoFillTime(samplingTime);
278    frm.samplingTime.value = samplingTime;
279   
280    if (!Dates.isDate(samplingDate, 'yyyyMMdd'))
281    {
282      setInputStatus('samplingDate', 'Not a valid date', 'invalid');
283      return;
284    }
285    if (frm.freezerDate.value == '') frm.freezerDate.value = samplingDate;
286   
287    if (!Dates.isDate(samplingDate + ' ' + samplingTime, 'yyyyMMdd HHmm'))
288    {
289      if (samplingDate != '') setInputStatus('samplingDate', 'Not a valid time', 'invalid');
290      return;
291    }
292    setInputStatus('samplingDate', '', 'valid');
293  }
294  samplingDateIsValid = true;
295}
296
297function freezerDateTimeOnChange()
298{
299  var frm = document.forms['reggie'];
300  freezerDateIsValid = false;
301  setInputStatus('freezerDate', '', '');
302 
303  var freezerDate = frm.freezerDate.value;
304  var freezerTime = frm.freezerTime.value;
305  var freezerTimestamp;
306 
307  if (freezerDate != '' || freezerTime != '')
308  {
309    // Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits.
310    freezerDate = autoFillDate(freezerDate);
311    frm.freezerDate.value = freezerDate;
312
313    freezerTime = autoFillTime(freezerTime);
314    frm.freezerTime.value = freezerTime;
315   
316    if (!Dates.isDate(freezerDate, 'yyyyMMdd'))
317    {
318      setInputStatus('freezerDate', 'Not a valid date', 'invalid');
319      return;
320    }
321    freezerTimestamp = Dates.parseString(freezerDate + ' ' + freezerTime, 'yyyyMMdd HHmm');
322    if (freezerTimestamp == null)
323    {
324      if (freezerDate != '') setInputStatus('freezerDate', 'Not a valid time', 'invalid');
325      return;
326    }
327    setInputStatus('freezerDate', '', 'valid');
328  }
329 
330  freezerDateIsValid = true;
331
332  if (samplingDateIsValid && freezerTimestamp)
333  {
334    var samplingTimestamp = Dates.parseString(frm.samplingDate.value + ' ' + frm.samplingTime.value, 'yyyyMMdd Hmm');
335    if (samplingTimestamp && freezerTimestamp.getDate() != freezerTimestamp.getDate())
336    {
337      setInputStatus('freezerDate', 'Sampling and freezer dates are different', 'warning');
338    }
339  }
340}
341
342function getBloodInfo()
343{
344  // Check entered case and pnr with AJAX
345  var frm = document.forms['reggie'];
346  var caseName = frm.caseName.value;
347  var request = Ajax.getXmlHttpRequest();
348  var url = 'BloodRegistration.servlet?ID=<%=ID%>&cmd=GetBloodInfo';
349  url += '&caseName=' + caseName;
350  request.open("GET", url, false);
351  request.send(null);
352 
353  if (debug) Main.debug(request.responseText);
354
355  var response = JSON.parse(request.responseText);
356  if (response.status != 'ok')
357  {
358    setFatalError(response.message);
359    return false;
360  }
361 
362  // Get biosource information from the AJAX response
363  bloodInfo = response.bloodInfo;
364  patientInfo = response.patientInfo;
365  consentInfo = response.consentInfo;
366 
367  if (patientInfo)
368  {
369    frm.personalNumber.value = patientInfo.personalNumber;
370    gotoStep2();
371  }
372 
373}
374
375function gotoStep2()
376{
377  // Check entered case and pnr with AJAX
378  var frm = document.forms['reggie'];
379  frm.caseName.disabled = true;
380  frm.personalNumber.disabled = true;
381  currentStep = 2;
382 
383  if (!patientInfo)
384  {
385    var pnr = frm.personalNumber.value;
386    if (pnr.length == 10 && pnrIsValid) 
387    {
388      var year = fullYear(parseInt(pnr.substr(0, 2), 10));
389      pnr = year + pnr.substr(2);
390    }
391    var request = Ajax.getXmlHttpRequest();
392    var url = 'PersonalRegistration.servlet?ID=<%=ID%>&cmd=GetPatientInfo';
393    url += '&personalNumber=' + pnr;
394    url += '&pnrIsValid=' + pnrIsValid;
395    request.open("GET", url, false);
396    request.send(null);
397   
398    if (debug) Main.debug(request.responseText);
399   
400    var response = JSON.parse(request.responseText);
401    if (response.status != 'ok')
402    {
403      setFatalError(response.message);
404      return false;
405    }
406   
407    // Get patient information from the AJAX response
408    patientInfo = response.patientInfo;
409  }
410
411  Main.show('gocancel');
412 
413  if (!patientInfo.id)
414  {
415    Main.show('newPatientSection');
416    frm.patientCode.value=patientInfo.name;
417    setInnerHTML('new.dateOfBirth', patientInfo.dateOfBirth ? patientInfo.dateOfBirth : "---");
418    setInnerHTML('new.gender', patientInfo.gender ? patientInfo.gender : "---");
419    frm.familyName.focus();
420    if (!pnrIsValid)
421    {
422      setInputStatus('gender', 'Gender and DateOfBirth can\'t be automatically generated for non-standard Personal number', 'warning');
423    }
424  }
425  else
426  {
427    Main.show('existingPatientSection');
428    setInnerHTML('existing.patientCode', patientInfo.name);
429    setInnerHTML('existing.familyName', patientInfo.familyName);
430    setInnerHTML('existing.allFirstNames', patientInfo.allFirstNames);
431    if (patientInfo.dateOfBirth) setInnerHTML('existing.dateOfBirth', patientInfo.dateOfBirth);
432    if (patientInfo.gender) setInnerHTML('existing.gender', patientInfo.gender);
433    gotoStep3();
434  }
435}
436
437function gotoStep3()
438{
439  // Check entered case and pnr with AJAX
440  var frm = document.forms['reggie'];
441 
442  if (!patientInfo.id)
443  {
444    frm.patientCode.disabled = true;
445    frm.familyName.disabled = true;
446    frm.allFirstNames.disabled = true;
447    patientInfo.familyName = frm.familyName.value;
448    patientInfo.allFirstNames = frm.allFirstNames.value;
449  }
450  currentStep = 3;
451 
452  var updateMode = bloodInfo.id;
453  Main.show('bloodSection');
454 
455  if (updateMode)
456  {
457    setInnerHTML('step3.title', 'Update blood \''+bloodInfo.name+'\'');
458    if (bloodInfo.samplingDate != null)
459    {
460      frm.samplingDate.value = bloodInfo.samplingDate.substring(0, 8);
461      frm.samplingTime.value = bloodInfo.samplingDate.substring(9, 13);
462      samplingDateTimeOnChange();
463    }
464    if (bloodInfo.freezerDate != null)
465    {
466      frm.freezerDate.value = bloodInfo.freezerDate.substring(0, 8);
467      frm.freezerTime.value = bloodInfo.freezerDate.substring(9, 13);
468      freezerDateTimeOnChange();
469    }
470    frm.serum.checked = bloodInfo.serum == 'Yes';
471    if (bloodInfo.bloodSample)
472    {
473      Forms.selectListOption(frm.bloodSample, bloodInfo.bloodSample);
474    }
475  }
476  else
477  {
478    // Select 'PreNeo' if case name has 'C' suffix
479    var caseName = frm.caseName.value;
480    if (caseName.length > 7 && caseName.substring(7, 8) == 'C')
481    {
482      Forms.selectListOption(frm.bloodSample, 'PreNeo');
483    }
484    if (consentInfo && consentInfo.consent)
485    {
486      frm.copyConsent.value = consentInfo.id;
487      var html = "From '" + consentInfo.name + "' (" + consentInfo.consent;
488      if (consentInfo.consentDate) html += '; ' + consentInfo.consentDate;
489      html += ')';
490      setInnerHTML('copyConsent.text', html);
491      Main.show("copyConsentSection");
492    }
493  }
494 
495  Main.hide('gonext');
496  if (updateMode)
497  {
498    Main.show('goupdate');
499  }
500  else
501  {
502    Main.show('gocreate');
503  }
504 
505  frm.samplingDate.focus();
506}
507
508function goCreate()
509{
510  if (!step3IsValid()) return;
511 
512  Main.hide('gocreate');
513  Main.hide('gocancel');
514  Main.hide('goupdate');
515  var frm = document.forms['reggie'];
516
517  bloodInfo.samplingDate = Main.trimString(frm.samplingDate.value + ' ' + frm.samplingTime.value);
518  bloodInfo.freezerDate = Main.trimString(frm.freezerDate.value + ' ' + frm.freezerTime.value);
519  bloodInfo.serum = frm.serum.checked ? "Yes" : "No";
520  bloodInfo.bloodSample = frm.bloodSample[frm.bloodSample.selectedIndex].value;
521  if (frm.copyConsent.checked && frm.copyConsent.value)
522  {
523    bloodInfo.copyConsent = parseInt(frm.copyConsent.value, 10);
524  }
525
526  frm.samplingDate.disabled = true;
527  frm.samplingTime.disabled = true;
528  frm.freezerDate.disabled = true;
529  frm.freezerTime.disabled = true;
530  frm.bloodSample.disabled = true;
531
532  var updateMode = bloodInfo.id;
533  var submitInfo = new Object();
534  submitInfo.patientInfo = patientInfo;
535  submitInfo.bloodInfo = bloodInfo;
536
537  if (debug) Main.debug(JSON.stringify(submitInfo));
538 
539  var request = Ajax.getXmlHttpRequest();
540  var url = 'BloodRegistration.servlet?ID=<%=ID%>&cmd=';
541  url += updateMode ? 'UpdateBlood' : 'CreateBlood';
542  request.open("POST", url, false);
543  request.setRequestHeader("Content-Type", "application/json");
544  request.send(JSON.stringify(submitInfo));
545
546  if (debug) Main.debug(request.responseText);
547
548  var response = JSON.parse(request.responseText);
549  if (response.status != 'ok')
550  {
551    setFatalError(response.message);
552    return false;
553  }
554 
555  var msg = '<ul>';
556  for (var i = 0; i < response.messages.length; i++)
557  {
558    msg += '<li>' + response.messages[i];
559  }
560  msg += '</ul>';
561  setInnerHTML('done', msg);
562  Main.show('done');
563  Main.show('gorestart');
564
565}
566</script>
567
568</base:head>
569<base:body onload="init()">
570
571  <p:path><p:pathelement 
572    title="Reggie" href="<%="index.jsp?ID="+ID%>" 
573    /><p:pathelement title="Blood referral form registration" 
574    /></p:path>
575
576  <div class="content">
577  <%
578  if (sc.getActiveProjectId() == 0)
579  {
580    %>
581    <div class="messagecontainer note" style="width: 950px; margin-left: 20px; margin-bottom: 20px; margin-right: 0px; font-weight: bold; color: #cc0000;">
582      No project has been selected. You may proceed with the registration but
583      created items will not be shared.
584    </div>
585    <%
586  }
587  %>
588
589  <form name="reggie" onsubmit="return false;">
590 
591  <!-- 1. Case + Personal number -->
592  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
593  <tr>
594    <td rowspan="3" class="stepno">1</td>
595    <td class="steptitle">Enter Case Name and Personal Number</td>
596  </tr>
597  <tr>
598    <td class="stepfields">
599      <table border="0" cellspacing="0" cellpadding="0" width="100%">
600      <tr valign="top">
601        <td class="prompt">Case name</td>
602        <td class="input"><input type="text" name="caseName" 
603          size="18" maxlength="12" onblur="caseNameOnChange()" onkeypress="focusOnEnter(event, 'personalNumber')"></td>
604        <td class="status" id="case.status"></td>
605        <td class="help"><span id="case.message" class="message" style="display: none;"></span>The case (barcode) associated with this patient.</td>
606      </tr>
607      <tr>
608        <td class="prompt">Personal number</td>
609        <td class="input"><input type="text" name="personalNumber" 
610          size="18" maxlength="12" onkeyup="personalNumberOnChange()" onkeypress="doOnTabOrEnter(event, goNextAuto)"></td>
611        <td class="status" id="pnr.status"></td>
612        <td class="help"><span id="pnr.message" class="message" style="display: none;"></span>([YY]YYMMDDZZZZ)</td>
613      </tr>
614      </table>
615    </td>
616  </tr>
617  </table>
618
619  <!-- 2. New patient registration -->
620  <div id="newPatientSection" style="display: none;">
621  <p>
622  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
623  <tr>
624    <td rowspan="2" class="stepno">2</td>
625    <td class="steptitle">New patient: Enter all names</td>
626  </tr>
627  <tr>
628    <td class="stepfields">
629      <table border="0" cellspacing="0" cellpadding="0" width="100%">
630      <tr>
631        <td class="prompt">Patient code</td>
632        <td class="input"><input type="text" name="patientCode" 
633          value="" size="18" maxlength="12" 
634          onkeypress="focusOnEnter(event, 'familyName')"></td>
635        <td class="status" id="patientCode.status"></td>
636        <td class="help"><span id="patientCode.message" class="message" style="display: none;"></span></td>
637      </tr>
638      <tr valign="top">
639        <td class="prompt">Family name</td>
640        <td class="input"><input type="text" name="familyName" 
641          value="" size="35" maxlength="255" onblur="nameOnChange(event)"
642          onkeypress="focusOnEnter(event, 'allFirstNames')"></td>
643        <td class="status" id="familyName.status"></td>
644        <td class="help"><span id="familyName.message" class="message" style="display: none;"></span>Keep hyphens, keep åäö, replace all special accented letters [e.g. éèü etc] with standard alphabet character.</td>
645      </tr>
646      <tr valign="top">
647        <td class="prompt">All first names</td>
648        <td class="input"><input type="text" name="allFirstNames" onblur="nameOnChange(event)"
649          size="35" maxlength="255" onkeypress="doOnTabOrEnter(event, goNextAuto)"></td>
650        <td class="status" id="allFirstNames.status"></td>
651        <td class="help"><span id="allFirstNames.message" class="message" style="display: none;"></span>Type all names, see FamilyName comment on valid characters.</td>
652      </tr>
653      <tr>
654        <td class="prompt">Gender</td>
655        <td class="input" id="new.gender"></td>
656        <td class="status" id="gender.status" rowspan="2"></td>
657        <td class="help" rowspan="2"><span id="gender.message" class="message" style="display:none;"></span></td>
658      </tr>
659      <tr>
660        <td class="prompt">Date of birth</td>
661        <td class="input" id="new.dateOfBirth"></td>
662      </tr>
663      </table>
664    </td>
665  </tr>
666  </table>
667  </div>
668 
669  <!-- 2b. Existing patient -->
670  <div id="existingPatientSection" style="display: none;">
671  <p>
672  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
673  <tr>
674    <td rowspan="2" class="stepno">2</td>
675    <td class="steptitle">Existing patient: Verify names</td>
676  </tr>
677  <tr>
678    <td class="stepfields">
679      <table border="0" cellspacing="0" cellpadding="0" width="100%">
680      <tr>
681        <td class="prompt">Patient code</td>
682        <td class="input" id="existing.patientCode"></td>
683        <td class="status"></td>
684        <td class="help"></td>
685      </tr>
686      <tr>
687        <td class="prompt">Family name</td>
688        <td class="input" id="existing.familyName"></td>
689        <td class="status"></td>
690        <td class="help"></td>
691      </tr>
692      <tr>
693        <td class="prompt">All first names</td>
694        <td class="input" id="existing.allFirstNames"></td>
695        <td class="status"></td>
696        <td class="help"></td>
697      </tr>
698      <tr>
699        <td class="prompt">Gender</td>
700        <td class="input" id="existing.gender"></td>
701        <td class="status"></td>
702        <td class="help"></td>
703      </tr>
704      <tr>
705        <td class="prompt">Date of birth</td>
706        <td class="input" id="existing.dateOfBirth"></td>
707        <td class="status"></td>
708        <td class="help"></td>
709      </tr>
710      </table>
711    </td>
712  </tr>
713  </table>
714  </div>
715
716
717  <!-- 3. Blood registration -->
718  <div id="bloodSection" style="display: none;">
719  <p>
720  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
721  <tr>
722    <td rowspan="2" class="stepno">3</td>
723    <td class="steptitle" id="step3.title">Create new blood</td>
724  </tr>
725  <tr>
726    <td class="stepfields">
727      <table border="0" cellspacing="0" cellpadding="0" width="100%">
728      <tr id="samplingDateSection" valign="top">
729        <td class="subprompt">Blood sampling date</td>
730        <td class="input"><input type="text" name="samplingDate" value="" size="12" maxlength="10" 
731            onkeypress="focusOnEnter(event, 'samplingTime')" onblur="samplingDateTimeOnChange()">
732          Time <input type="text" name="samplingTime" value="" size="6" maxlength="5" 
733            onkeypress="focusOnEnter(event, 'freezerDate')" onblur="samplingDateTimeOnChange()"></td>
734        <td class="status" id="samplingDate.status"></td>
735        <td class="help"><span id="samplingDate.message" class="message" style="display: none;"></span>Date+time of blood sampling (YYYYMMDD, HHMM)</td>
736      </tr>
737      <tr id="freezerDateSection" valign="top">
738        <td class="subprompt">Freezer date</td>
739        <td class="input"><input type="text" name="freezerDate" value="" size="12" maxlength="10"
740            onkeypress="focusOnEnter(event, 'freezerTime')" onblur="freezerDateTimeOnChange()">
741          Time <input type="text" name="freezerTime" value="" size="6" maxlength="5"
742            onblur="freezerDateTimeOnChange()"></td>
743        <td class="status" id="freezerDate.status"></td>
744        <td class="help"><span id="freezerDate.message" class="message" style="display: none;"></span>Date+time when put in freezer (YYYYMMDD, HHMM)</td>
745      </tr>
746      <tr id="serumSection" valign="top">
747        <td class="subprompt">Plasma/serum</td>
748        <td class="input">
749          <input type="checkbox" name="serum" id="serum" value="1"><label for="serum">Yes</label>
750        <td class="status" id="serum.status"></td>
751        <td class="help">Mark the check box if serum/plasma is available.</td>
752      </tr>
753      <tr>
754        <td class="prompt" id="bloodSample.prompt">Blood sample</td>
755        <td class="input" id="bloodSample.input">
756          <select name="bloodSample">
757            <option selected value="">unknown
758            <option value="PreNeo">PreNeo
759            <option value="PreOp">PreOp
760          </select>
761        </td>
762        <td class="status" id="bloodSample.status"></td>
763        <td class="help"><span id="bloodSample.message" class="message" style="display: none;"></span></td>
764      </tr>
765      <tr id="copyConsentSection" style="display: none;">
766        <td class="prompt">Copy consent?</td>
767        <td class="input">
768          <input type="checkbox" name="copyConsent" id="copyConsent" value="" checked>
769          <label for="copyConsent"><span id="copyConsent.text"></span></label>
770        </td>
771        <td class="status" id="copyConsent.status"></td>
772        <td class="help"></td>
773      </tr>
774      </table>
775    </td>
776  </tr>
777  </table>
778  </div>
779
780  <div class="messagecontainer error" id="errorMessage" style="display: none; width: 950px; margin-left: 20px; margin-bottom: 0px;"></div>
781
782  <div id="done" class="success" style="display: none; width: 950px; margin-left: 20px; margin-top: 20px;"></div>
783
784  <table style="margin-left: 20px; margin-top: 10px;" class="navigation">
785  <tr>
786    <td><base:button id="gocancel" title="Cancel" onclick="goRestart(false)" style="display: none;"/></td>
787    <td><base:button id="gonext" title="Next" image="<%=home+"/images/gonext.png"%>" onclick="goNext(true)"/></td>
788    <td><base:button id="gocreate" title="Create" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" style="display: none;"/></td>
789    <td><base:button id="goupdate" title="Update" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" style="display: none;"/></td>
790    <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" onclick="goRestart(true)" style="display: none;"/></td>
791    <td id="gonext.message" class="message"></td>
792  </tr>
793  </table>
794  </form>
795  </div>
796 
797</base:body>
798</base:page>
799<%
800}
801finally
802{
803  if (dc != null) dc.close();
804}
805%>
Note: See TracBrowser for help on using the repository browser.