Changeset 1428


Ignore:
Timestamp:
Oct 31, 2011, 8:47:45 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #335: Use item subtypes - step 1

New items are now created with a subtype.

Location:
extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie/dao/Patient.java

    r1424 r1428  
    102102    loadAnnotations(dc, "gender", Reggie.ANNOTATION_GENDER, null);
    103103    loadAnnotations(dc, "dateOfBirth", Reggie.ANNOTATION_DATE_OF_BIRTH, new DateToStringConverter(new SimpleDateFormat("yyyy-MM-dd")));
    104     /*
    105     // Date-of-birth need special handling for formatting
    106     AnnotationType dateOfBirthType = Reggie.findAnnotationType(dc, Item.BIOSOURCE, Reggie.ANNOTATION_DATE_OF_BIRTH, true);
    107     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    108     String dateOfBirth = df.format((Date)Reggie.getAnnotationValue(getBioSource(), dateOfBirthType));
    109     setAnnotation("dateOfBirth", dateOfBirth);
    110     */
    111 
    112104  }
    113105
  • extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie/servlet/ConsentFormServlet.java

    r1368 r1428  
    2626import net.sf.basedb.reggie.dao.Case;
    2727import net.sf.basedb.reggie.dao.SpecimenTube;
     28import net.sf.basedb.reggie.dao.Subtype;
    2829import net.sf.basedb.util.Values;
    2930import net.sf.basedb.util.error.ThrowableUtil;
     
    162163          String caseName = (String)jsonCase.get("name");
    163164          theCase = Sample.getNew(dc);
     165          theCase.setItemSubtype(Subtype.CASE.load(dc));
    164166          theCase.setName(caseName);
    165167          if ("Not asked".equals(consent))
  • extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie/servlet/PartitionRegistrationServlet.java

    r1424 r1428  
    2828import net.sf.basedb.reggie.Reggie;
    2929import net.sf.basedb.reggie.converter.StringToDateConverter;
    30 import net.sf.basedb.reggie.dao.Case;
    3130import net.sf.basedb.reggie.dao.SpecimenTube;
     31import net.sf.basedb.reggie.dao.Subtype;
    3232import net.sf.basedb.util.Values;
    3333import net.sf.basedb.util.error.ThrowableUtil;
     
    160160              {
    161161                Extract lysExtract = specimen.newExtract(apWeight);
     162                lysExtract.setItemSubtype(Subtype.LYSATE.load(dc));
    162163                lysExtract.setName(specimen.getName()+".l");
    163164                dc.saveItem(lysExtract);
     
    201202              {
    202203                hisSample = Sample.getNew(dc);
     204                hisSample.setItemSubtype(Subtype.HISTOLOGY.load(dc));
    203205                hisSample.setName(specimen.getName() + ".his");
    204206                dc.saveItem(hisSample);
  • extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java

    r1424 r1428  
    3636import net.sf.basedb.reggie.dao.Patient;
    3737import net.sf.basedb.reggie.dao.SpecimenTube;
     38import net.sf.basedb.reggie.dao.Subtype;
    3839import net.sf.basedb.util.MD5;
    3940import net.sf.basedb.util.Values;
     
    276277          // Create new patient
    277278          patient = BioSource.getNew(dc);
     279          patient.setItemSubtype(Subtype.PATIENT.load(dc));
    278280          patient.setName((String)jsonPat.get("name"));
    279281          String pnr = (String)jsonPat.get("personalNumber");
     
    329331          // Register a new case
    330332          theCase = Sample.getNew(dc);
     333          theCase.setItemSubtype(Subtype.CASE.load(dc));
    331334          theCase.setName(originalCaseName);
    332335          if (laterality != null)
  • extensions/net.sf.basedb.reggie/branches/2.0-dev/src/net/sf/basedb/reggie/servlet/SpecimenTubeServlet.java

    r1424 r1428  
    2929import net.sf.basedb.reggie.dao.Case;
    3030import net.sf.basedb.reggie.dao.SpecimenTube;
     31import net.sf.basedb.reggie.dao.Subtype;
    3132import net.sf.basedb.util.Values;
    3233import net.sf.basedb.util.error.ThrowableUtil;
     
    264265            JSONObject jsonSpec = (JSONObject)jsonSpecimen.get(i);
    265266            Sample specimen = Sample.getNew(dc);
     267            specimen.setItemSubtype(Subtype.SPECIMEN.load(dc));
    266268            specimen.setName((String)jsonSpec.get("name"));
    267269            dc.saveItem(specimen);
Note: See TracChangeset for help on using the changeset viewer.