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