Changeset 1595


Ignore:
Timestamp:
Mar 27, 2012, 1:41:20 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #375: Personal registration wizard should set creation date on specimen tubes

File:
1 edited

Legend:

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

    r1592 r1595  
    1818import net.sf.basedb.core.AnnotationType;
    1919import net.sf.basedb.core.Application;
     20import net.sf.basedb.core.BioMaterialEvent;
    2021import net.sf.basedb.core.BioSource;
    2122import net.sf.basedb.core.DbControl;
     
    354355            JSONObject jsonSpec = (JSONObject)jsonSpecimen.get(i);
    355356            Sample specimen = Sample.getById(dc, ((Number)jsonSpec.get("id")).intValue());
    356             // Link the specimen with the case
    357             specimen.getCreationEvent().setSource(theCase);
     357            // Link the specimen with the case
     358            BioMaterialEvent creationEvent = specimen.getCreationEvent();
     359            creationEvent.setSource(theCase);
     360            // !IMPORTANT - The sampling date must be set here and as an 'SamplingDateTime' annotation
     361            creationEvent.setEventDate(samplingDate);
    358362           
    359363            // Update the specimen annotations
     
    428432            JSONObject jsonSpec = (JSONObject)jsonSpecimen.get(i);
    429433            Sample specimen = Sample.getById(dc, ((Number)jsonSpec.get("id")).intValue());
     434            // !IMPORTANT - The sampling date must be set here and as an 'SamplingDateTime' annotation
     435            specimen.getCreationEvent().setEventDate(samplingDate);
    430436           
    431437            // Update the specimen annotations
Note: See TracChangeset for help on using the changeset viewer.