Changeset 1600
- Timestamp:
- Apr 16, 2012, 11:18:48 AM (11 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/persinfo.jsp
r1597 r1600 345 345 346 346 var samplingDate = frm.samplingDate.value; 347 var samplingTime = frm.samplingTime. value;347 var samplingTime = frm.samplingTime.disabled ? null : frm.samplingTime.value; 348 348 349 349 if (samplingDate != '' || samplingTime != '') … … 353 353 frm.samplingDate.value = samplingDate; 354 354 355 samplingTime = autoFillTime(samplingTime); 356 frm.samplingTime.value = samplingTime; 355 if (!frm.samplingTime.disabled) 356 { 357 samplingTime = autoFillTime(samplingTime); 358 frm.samplingTime.value = samplingTime; 359 } 357 360 358 361 if (!Dates.isDate(samplingDate, 'yyyyMMdd')) … … 363 366 if (frm.rnaLaterDate.value == '') frm.rnaLaterDate.value = samplingDate; 364 367 365 if (!Dates.isDate(samplingDate + ' ' + samplingTime, 'yyyyMMdd HHmm')) 366 { 367 if (samplingDate != '') setInputStatus('samplingDate', 'Not a valid time', 'invalid'); 368 return; 368 if (!frm.samplingTime.disabled) 369 { 370 if (!Dates.isDate(samplingDate + ' ' + samplingTime, 'yyyyMMdd HHmm')) 371 { 372 if (samplingDate != '') setInputStatus('samplingDate', 'Not a valid time', 'invalid'); 373 return; 374 } 369 375 } 370 376 setInputStatus('samplingDate', '', 'valid'); … … 408 414 rnaLaterDateIsValid = true; 409 415 410 if (samplingDateIsValid && rnaLaterTimestamp )416 if (samplingDateIsValid && rnaLaterTimestamp && !frm.samplingTime.disabled) 411 417 { 412 418 var samplingTimestamp = Dates.parseString(frm.samplingDate.value + ' ' + frm.samplingTime.value, 'yyyyMMdd Hmm'); … … 623 629 } 624 630 631 // Hide & disable 'Sampling time' field 632 Main.hide('samplingTimeField'); 633 frm.samplingTime.disabled = true; 625 634 626 635 // Hide 'RNA Later date' field … … 632 641 { 633 642 frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); 634 frm.samplingTime.value = thisCaseSamplingDate.substring(9, 13); 643 if (!frm.samplingTime.disabled) 644 { 645 frm.samplingTime.value = thisCaseSamplingDate.substring(9, 13); 646 } 635 647 samplingDateTimeOnChange(); 636 648 } … … 812 824 caseInfo.reasonIfNoSpecimen = frm.reasonIfNoSpecimen.value; 813 825 caseInfo.pad = frm.pad.value; 814 caseInfo.samplingDate = Main.trimString(frm.samplingDate.value + ' ' + frm.samplingTime.value); 826 if (frm.samplingTime.disabled) 827 { 828 // No time part if no specimen has been received 829 caseInfo.samplingDate = Main.trimString(frm.samplingDate.value); 830 } 831 else 832 { 833 caseInfo.samplingDate = Main.trimString(frm.samplingDate.value + ' ' + frm.samplingTime.value); 834 } 815 835 caseInfo.rnaLaterDate = Main.trimString(frm.rnaLaterDate.value + ' ' + frm.rnaLaterTime.value); 816 836 if (frm.copyConsent.checked && frm.copyConsent.value) … … 1067 1087 <td class="subprompt">Sampling date</td> 1068 1088 <td class="input"><input type="text" name="samplingDate" value="" size="12" maxlength="10" 1069 onkeypress="focusOnEnter(event, 'samplingTime')" onblur="samplingDateTimeOnChange()"> 1070 Time <input type="text" name="samplingTime" value="" size="6" maxlength="5" 1071 onkeypress="focusOnEnter(event, caseInfo.specimen && caseInfo.specimen.length > 0 ? 'rnaLaterDate' : 'reasonIfNoSpecimen')" onblur="samplingDateTimeOnChange()"></td> 1089 onkeypress="focusOnEnter(event, caseInfo.specimen && caseInfo.specimen.length > 0 ? 'samplingTime' : 'reasonIfNoSpecimen')" onblur="samplingDateTimeOnChange()"> 1090 <span id="samplingTimeField">Time <input type="text" name="samplingTime" value="" size="6" maxlength="5" 1091 onkeypress="focusOnEnter(event, caseInfo.specimen && caseInfo.specimen.length > 0 ? 'rnaLaterDate' : 'reasonIfNoSpecimen')" onblur="samplingDateTimeOnChange()"></span> 1092 </td> 1072 1093 <td class="status" id="samplingDate.status"></td> 1073 <td class="help"><span id="samplingDate.message" class="message" style="display: none;"></span>Date +timeof surgical removal (YYYYMMDD, HHMM)</td>1094 <td class="help"><span id="samplingDate.message" class="message" style="display: none;"></span>Date (+time) of surgical removal (YYYYMMDD, HHMM)</td> 1074 1095 </tr> 1075 1096 <tr id="rnaLaterDateSection" valign="top"> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java
r1598 r1600 114 114 115 115 /** 116 The name of the "SamplingDateTimeCase" annotation type, used 117 for samples (Case). It is a multi-valued timestamp annotation. 118 @since 2.4 119 */ 120 public static final String ANNOTATION_SAMPLING_DATETIME_CASE = "SamplingDateTimeCase"; 121 116 The name of the "SamplingDateCase" annotation type, used 117 for samples (Case). The value is basically a copy of the 118 date part of the {@link #ANNOTATION_SAMPLING_DATETIME} 119 annotation, but also allow registration of a date when 120 no specimen has been received. It is a multi-valued date annotation. 121 @since 2.4 122 */ 123 public static final String ANNOTATION_SAMPLING_DATE_CASE = "SamplingDateCase"; 122 124 123 125 /** -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r1597 r1600 173 173 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_SAMPLING_DATETIME, Item.SAMPLE, Type.TIMESTAMP, 1, 174 174 null, effectiveOptions, createIfMissing)); 175 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_SAMPLING_DATE TIME_CASE, Item.SAMPLE, Type.TIMESTAMP, 0,175 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_SAMPLING_DATE_CASE, Item.SAMPLE, Type.DATE, 0, 176 176 null, effectiveOptions, createIfMissing)); 177 177 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_RNALATER_DATETIME, Item.SAMPLE, Type.TIMESTAMP, 1, … … 221 221 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.CASE, createIfMissing, 222 222 Reggie.ANNOTATION_CONSENT, Reggie.ANNOTATION_CONSENT_DATE, 223 Reggie.ANNOTATION_LATERALITY, Reggie.ANNOTATION_SAMPLING_DATE TIME_CASE,223 Reggie.ANNOTATION_LATERALITY, Reggie.ANNOTATION_SAMPLING_DATE_CASE, 224 224 Reggie.ANNOTATION_PAD_CASE, Reggie.ANNOTATION_REASON_IF_NO_SPECIMEN)); 225 225 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java
r1597 r1600 100 100 theCase.loadAnnotations(dc, "laterality", Reggie.ANNOTATION_LATERALITY, null); 101 101 theCase.loadAnnotations(dc, "pad", Reggie.ANNOTATION_PAD_CASE, null); 102 theCase.loadAnnotations(dc, "samplingDate", Reggie.ANNOTATION_SAMPLING_DATE TIME_CASE, Reggie.CONVERTER_DATETIME_TO_STRING);102 theCase.loadAnnotations(dc, "samplingDate", Reggie.ANNOTATION_SAMPLING_DATE_CASE, Reggie.CONVERTER_DATE_TO_STRING); 103 103 theCase.loadAnnotations(dc, "reasonIfNoSpecimen", Reggie.ANNOTATION_REASON_IF_NO_SPECIMEN, null); 104 104 … … 343 343 344 344 // Sampling date on Case 345 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATE TIME_CASE, true);346 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATE TIME.convert((String)jsonCase.get("samplingDate"));345 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATE_CASE, true); 346 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonCase.get("samplingDate")); 347 347 if (samplingDate != null) 348 348 { … … 353 353 { 354 354 AnnotationType padType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD, true); 355 AnnotationType samplingDateT ype = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);355 AnnotationType samplingDateTimeType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true); 356 356 AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true); 357 Date rnaLaterDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate")); 357 Date samplingDateTime = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate")); 358 Date rnaLaterDateTime = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate")); 358 359 359 360 for (int i = 0; i < jsonSpecimen.size(); ++i) … … 370 371 if (laterality != null) Reggie.setAnnotationValue(specimen, lateralityType, laterality); 371 372 Reggie.setAnnotationValue(specimen, padType, pad); 372 if (samplingDate != null) Reggie.setAnnotationValue(specimen, samplingDateType, samplingDate);373 if (rnaLaterDate != null) Reggie.setAnnotationValue(specimen, rnaLaterType, rnaLaterDate);373 if (samplingDateTime != null) Reggie.setAnnotationValue(specimen, samplingDateTimeType, samplingDateTime); 374 if (rnaLaterDateTime != null) Reggie.setAnnotationValue(specimen, rnaLaterType, rnaLaterDateTime); 374 375 375 376 } … … 420 421 421 422 // Sampling date on Case 422 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATE TIME_CASE, true);423 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATE TIME.convert((String)jsonCase.get("samplingDate"));424 Date oldSamplingDate = Reggie.CONVERTER_STRING_TO_DATE TIME.convert((String)jsonCase.get("oldSamplingDate"));423 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATE_CASE, true); 424 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonCase.get("samplingDate")); 425 Date oldSamplingDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonCase.get("oldSamplingDate")); 425 426 if (oldSamplingDate != null) 426 427 { … … 441 442 AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true); 442 443 443 Date rnaLaterDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate")); 444 Date samplingDateTime = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate")); 445 Date rnaLaterDateTime = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate")); 444 446 445 447 for (int i = 0; i < jsonSpecimen.size(); ++i) … … 453 455 if (updateLaterality) Reggie.setAnnotationValue(specimen, lateralityType, laterality); 454 456 Reggie.setAnnotationValue(specimen, padType, pad); 455 if (samplingDate != null) Reggie.setAnnotationValue(specimen, samplingDateType, samplingDate);456 if (rnaLaterDate != null) Reggie.setAnnotationValue(specimen, rnaLaterType, rnaLaterDate);457 if (samplingDateTime != null) Reggie.setAnnotationValue(specimen, samplingDateType, samplingDateTime); 458 if (rnaLaterDateTime != null) Reggie.setAnnotationValue(specimen, rnaLaterType, rnaLaterDateTime); 457 459 458 460 }
Note: See TracChangeset
for help on using the changeset viewer.