Changeset 1736


Ignore:
Timestamp:
Nov 16, 2012, 2:30:26 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #429: Blood samples should store sampling date as creation date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/BloodRegistrationServlet.java

    r1623 r1736  
    1717import net.sf.basedb.core.AnnotationType;
    1818import net.sf.basedb.core.Application;
     19import net.sf.basedb.core.BioMaterialEvent;
    1920import net.sf.basedb.core.BioSource;
    2021import net.sf.basedb.core.DbControl;
     
    195196        blood.setItemSubtype(Subtype.BLOOD.load(dc));
    196197        blood.setName(bloodName);
    197         blood.getCreationEvent().setSource(patient);
     198        BioMaterialEvent creationEvent = blood.getCreationEvent();
     199        creationEvent.setSource(patient);
    198200        dc.saveItem(blood);
    199201
     
    203205        String bloodSample = Values.getStringOrNull((String)jsonBlood.get("bloodSample"));
    204206       
    205         if (samplingDate != null) Annotationtype.BLOOD_SAMPLING_DATETIME.setAnnotationValue(dc, blood, samplingDate);
    206         if (freezerDate != null) Annotationtype.BLOOD_FREEZER_DATETIME.setAnnotationValue(dc, blood, freezerDate);
     207        creationEvent.setEventDate(samplingDate);
     208        Annotationtype.BLOOD_SAMPLING_DATETIME.setAnnotationValue(dc, blood, samplingDate);
     209        Annotationtype.BLOOD_FREEZER_DATETIME.setAnnotationValue(dc, blood, freezerDate);
    207210        Annotationtype.BLOOD_SERUM.setAnnotationValue(dc, blood, jsonBlood.get("serum"));
    208211        Annotationtype.BLOOD_SAMPLE.setAnnotationValue(dc, blood, bloodSample);
     
    237240        String bloodSample = Values.getStringOrNull((String)jsonBlood.get("bloodSample"));
    238241       
    239         if (samplingDate != null) Annotationtype.BLOOD_SAMPLING_DATETIME.setAnnotationValue(dc, blood, samplingDate);
    240         if (freezerDate != null) Annotationtype.BLOOD_FREEZER_DATETIME.setAnnotationValue(dc, blood, freezerDate);
     242        blood.getCreationEvent().setEventDate(samplingDate);
     243       
     244        Annotationtype.BLOOD_SAMPLING_DATETIME.setAnnotationValue(dc, blood, samplingDate);
     245        Annotationtype.BLOOD_FREEZER_DATETIME.setAnnotationValue(dc, blood, freezerDate);
    241246        Annotationtype.BLOOD_SERUM.setAnnotationValue(dc, blood, jsonBlood.get("serum"));
    242247        Annotationtype.BLOOD_SAMPLE.setAnnotationValue(dc, blood, bloodSample);
Note: See TracChangeset for help on using the changeset viewer.