Changeset 1592


Ignore:
Timestamp:
Mar 27, 2012, 10:50:54 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #374: Store operation date on case items

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
3 edited

Legend:

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

    r1572 r1592  
    143143function step3IsValid()
    144144{
    145   var isValid = lateralityIsValid;
     145  var isValid = lateralityIsValid && samplingDateIsValid;
    146146  if (caseInfo.specimen && caseInfo.specimen.length > 0)
    147147  {
    148     isValid = isValid && samplingDateIsValid && rnaLaterDateIsValid;
     148    isValid = isValid && rnaLaterDateIsValid;
    149149  }
    150150  return isValid;
     
    622622    }
    623623   
    624     // Hide 'Sampling date' and 'RNA Later date' fields
    625     Main.hide('samplingDateSection');
     624    // Hide 'RNA Later date' field
    626625    Main.hide('rnaLaterDateSection');
    627626  }
     
    629628  frm.pad.value = thisCasePAD;
    630629  caseInfo.oldPad = thisCasePAD;
    631   //Main.showHide('padSection', !hasPAD || updateMode);
    632  
    633  
    634630 
    635631  if (updateMode && !hasSpecimen)
     
    10391035        <td class="input"><input type="text" name="pad"
    10401036          value="" size="18" maxlength="12"
    1041           onkeypress="focusOnEnter(event, caseInfo.specimen && caseInfo.specimen.length > 0 ? 'samplingDate' : 'reasonIfNoSpecimen')"
     1037          onkeypress="focusOnEnter(event, 'samplingDate')"
    10421038          onblur="padOnChange()"></td>
    10431039        <td class="status" id="pad.status"></td>
     
    10551051            onkeypress="focusOnEnter(event, 'samplingTime')" onblur="samplingDateTimeOnChange()">
    10561052          Time <input type="text" name="samplingTime" value="" size="6" maxlength="5"
    1057             onkeypress="focusOnEnter(event, 'rnaLaterDate')" onblur="samplingDateTimeOnChange()"></td>
     1053            onkeypress="focusOnEnter(event, caseInfo.specimen && caseInfo.specimen.length > 0 ? 'rnaLaterDate' : 'reasonIfNoSpecimen')" onblur="samplingDateTimeOnChange()"></td>
    10581054        <td class="status" id="samplingDate.status"></td>
    10591055        <td class="help"><span id="samplingDate.message" class="message" style="display: none;"></span>Date+time of surgical removal (YYYYMMDD, HHMM)</td>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r1571 r1592  
    219219        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.CASE, createIfMissing,
    220220            Reggie.ANNOTATION_CONSENT, Reggie.ANNOTATION_CONSENT_DATE,
    221             Reggie.ANNOTATION_LATERALITY,
     221            Reggie.ANNOTATION_LATERALITY, Reggie.ANNOTATION_SAMPLING_DATETIME,
    222222            Reggie.ANNOTATION_PAD_CASE, Reggie.ANNOTATION_REASON_IF_NO_SPECIMEN));
    223223       
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java

    r1572 r1592  
    335335        AnnotationSet caseAnnotations = theCase.getAnnotationSet();
    336336        JSONArray jsonSpecimen = (JSONArray)jsonCase.get("specimen");
     337        // PAD value
    337338        AnnotationType padCaseType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD_CASE, true);
    338339        String pad = Values.getStringOrNull((String)jsonCase.get("pad"));
    339340        if (pad != null) Reggie.appendAnnotationValueIfUnique(theCase, padCaseType, pad);
     341        // Sampling date
     342        AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);
     343        Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate"));
     344        if (samplingDate != null) Reggie.setAnnotationValue(theCase, samplingDateType, samplingDate);
     345       
    340346        if (jsonSpecimen != null && jsonSpecimen.size() > 0)
    341347        {
    342348          AnnotationType padType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD, true);
    343           AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);
    344349          AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true);
    345          
    346           Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate"));
    347350          Date rnaLaterDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate"));
    348351
     
    405408        if (oldPad != null) Reggie.removeAnnotationValue(theCase, padCaseType, oldPad);
    406409        if (pad != null) Reggie.appendAnnotationValueIfUnique(theCase, padCaseType, pad);
     410
     411        // Sampling date
     412        AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);
     413        Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate"));
     414        if (samplingDate != null) Reggie.setAnnotationValue(theCase, samplingDateType, samplingDate);
    407415       
    408416        jsonMessages.add("Case '" + originalCaseName + "' updated successfully.");
     
    412420        {
    413421          AnnotationType padType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_PAD, true);
    414           AnnotationType samplingDateType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_SAMPLING_DATETIME, true);
    415422          AnnotationType rnaLaterType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_RNALATER_DATETIME, true);
    416423         
    417           Date samplingDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("samplingDate"));
    418424          Date rnaLaterDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonCase.get("rnaLaterDate"));
    419425         
Note: See TracChangeset for help on using the changeset viewer.