Changeset 1597
- Timestamp:
- Mar 30, 2012, 11:23:23 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
r1592 r1597 596 596 thisCaseLaterality = null; 597 597 } 598 599 // Show and populate 'Sampling date' and 'RNA Later date' fields 598 600 599 Main.show('samplingDateSection'); 601 600 Main.show('rnaLaterDateSection'); 602 if (thisCaseSamplingDate != null) 603 { 604 frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); 605 frm.samplingTime.value = thisCaseSamplingDate.substring(9, 13); 606 samplingDateTimeOnChange(); 607 } 608 if (thisCaseRNALaterDate != null) 609 { 610 frm.rnaLaterDate.value = thisCaseRNALaterDate.substring(0, 8); 611 frm.rnaLaterTime.value = thisCaseRNALaterDate.substring(9, 13); 612 rnaLaterDateTimeOnChange(); 613 } 601 614 602 } 615 603 else … … 621 609 thisCasePAD = caseInfo.pad[0]; 622 610 } 611 if (caseInfo.samplingDate) 612 { 613 if (caseInfo.samplingDate.length == 1) 614 { 615 thisCaseSamplingDate = caseInfo.samplingDate[0]; 616 } 617 else 618 { 619 frm.samplingDate.disabled = true; 620 frm.samplingTime.disabled = true; 621 setInputStatus('samplingDate', 'Multiple dates have already been registered for this case.', 'warning'); 622 } 623 } 624 623 625 624 626 // Hide 'RNA Later date' field … … 626 628 } 627 629 630 // Populate 'Sampling date' and 'RNA Later date' fields 631 if (thisCaseSamplingDate != null) 632 { 633 frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); 634 frm.samplingTime.value = thisCaseSamplingDate.substring(9, 13); 635 samplingDateTimeOnChange(); 636 } 637 if (thisCaseRNALaterDate != null) 638 { 639 frm.rnaLaterDate.value = thisCaseRNALaterDate.substring(0, 8); 640 frm.rnaLaterTime.value = thisCaseRNALaterDate.substring(9, 13); 641 rnaLaterDateTimeOnChange(); 642 } 643 644 628 645 frm.pad.value = thisCasePAD; 629 646 caseInfo.oldPad = thisCasePAD; 647 caseInfo.oldSamplingDate = thisCaseSamplingDate; 630 648 631 649 if (updateMode && !hasSpecimen) -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java
r1593 r1597 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 122 123 /** 116 124 The name of the "RNALaterDateTime" annotation type, used 117 125 for samples (Specimen tube). It is a timestamp annotation. -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r1592 r1597 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_DATETIME_CASE, Item.SAMPLE, Type.TIMESTAMP, 0, 176 null, effectiveOptions, createIfMissing)); 175 177 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_RNALATER_DATETIME, Item.SAMPLE, Type.TIMESTAMP, 1, 176 178 null, effectiveOptions, createIfMissing)); … … 219 221 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.CASE, createIfMissing, 220 222 Reggie.ANNOTATION_CONSENT, Reggie.ANNOTATION_CONSENT_DATE, 221 Reggie.ANNOTATION_LATERALITY, Reggie.ANNOTATION_SAMPLING_DATETIME ,223 Reggie.ANNOTATION_LATERALITY, Reggie.ANNOTATION_SAMPLING_DATETIME_CASE, 222 224 Reggie.ANNOTATION_PAD_CASE, Reggie.ANNOTATION_REASON_IF_NO_SPECIMEN)); 223 225 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java
r1595 r1597 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_DATETIME_CASE, Reggie.CONVERTER_DATETIME_TO_STRING); 102 103 theCase.loadAnnotations(dc, "reasonIfNoSpecimen", Reggie.ANNOTATION_REASON_IF_NO_SPECIMEN, null); 103 104 … … 340 341 String pad = Values.getStringOrNull((String)jsonCase.get("pad")); 341 342 if (pad != null) Reggie.appendAnnotationValueIfUnique(theCase, padCaseType, pad); 342 // Sampling date 343 AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true); 343 344 // Sampling date on Case 345 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME_CASE, true); 344 346 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate")); 345 if (samplingDate != null) Reggie.setAnnotationValue(theCase, samplingDateType, samplingDate); 347 if (samplingDate != null) 348 { 349 Reggie.appendAnnotationValueIfUnique(theCase, samplingDateCaseType, samplingDate); 350 } 346 351 347 352 if (jsonSpecimen != null && jsonSpecimen.size() > 0) 348 353 { 349 354 AnnotationType padType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD, true); 355 AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true); 350 356 AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true); 351 357 Date rnaLaterDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate")); … … 413 419 if (pad != null) Reggie.appendAnnotationValueIfUnique(theCase, padCaseType, pad); 414 420 415 // Sampling date 416 AnnotationType samplingDate Type = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);421 // Sampling date on Case 422 AnnotationType samplingDateCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME_CASE, true); 417 423 Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate")); 418 if (samplingDate != null) Reggie.setAnnotationValue(theCase, samplingDateType, samplingDate); 424 Date oldSamplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("oldSamplingDate")); 425 if (oldSamplingDate != null) 426 { 427 Reggie.removeAnnotationValue(theCase, samplingDateCaseType, oldSamplingDate); 428 } 429 if (samplingDate != null) 430 { 431 Reggie.appendAnnotationValueIfUnique(theCase, samplingDateCaseType, samplingDate); 432 } 419 433 420 434 jsonMessages.add("Case '" + originalCaseName + "' updated successfully."); … … 424 438 { 425 439 AnnotationType padType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD, true); 440 AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true); 426 441 AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true); 427 442
Note: See TracChangeset
for help on using the changeset viewer.