Changeset 1526


Ignore:
Timestamp:
Jan 25, 2012, 11:30:27 AM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #353: The No and Not asked biosources should have their own Types

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Subtype.java

    r1518 r1526  
    2525  */
    2626  public static final Subtype PATIENT = new Subtype("Patient", Item.BIOSOURCE);
    27  
     27
     28  /**
     29    The definition of the "No" subtype (for virtual patient with consent=No).
     30    @since 2.2
     31  */
     32  public static final Subtype NO = new Subtype("No", Item.BIOSOURCE);
     33
     34  /**
     35    The definition of the "Not asked" subtype (for virtual patient with consent=Not asked).
     36    @since 2.2
     37  */
     38  public static final Subtype NOT_ASKED = new Subtype("Not asked", Item.BIOSOURCE);
     39
    2840  /**
    2941    The definition of the "Case" subtype.
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ConsentFormServlet.java

    r1524 r1526  
    223223            // Create virtual patient
    224224            BioSource vPat = BioSource.getNew(dc);
    225             vPat.setItemSubtype(Subtype.PATIENT.load(dc));
     225            Subtype virtualSubtype = "No".equals(consent) ? Subtype.NO : Subtype.NOT_ASKED;
     226            vPat.setItemSubtype(virtualSubtype.load(dc));
    226227            vPat.setName(Patient.generateNextName(dc, consent));
    227228            theCase.getCreationEvent().setSource(vPat);
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r1516 r1526  
    9999        // Subtype checks
    100100        jsonChecks.add(checkSubtype(dc, Subtype.PATIENT, createIfMissing));
     101        jsonChecks.add(checkSubtype(dc, Subtype.NO, createIfMissing));
     102        jsonChecks.add(checkSubtype(dc, Subtype.NOT_ASKED, createIfMissing));
    101103        jsonChecks.add(checkSubtype(dc, Subtype.CASE, createIfMissing, Subtype.PATIENT));
    102104        jsonChecks.add(checkSubtype(dc, Subtype.BLOOD, createIfMissing, Subtype.PATIENT));
Note: See TracChangeset for help on using the changeset viewer.