Changeset 1341 for extensions
- Timestamp:
- Apr 11, 2011, 2:57:42 PM (12 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r1335 r1341 132 132 <% 133 133 } 134 if (isPatientCurator || isAdmin) 135 { 136 %> 137 <dt> 138 <table border="0" cellspacing="0" cellpadding="0"> 139 <tr> 140 <td><base:icon image="file.gif" style="padding-right: 4px;"/></td> 141 <td><a href="consentform.jsp?ID=<%=ID%>">Consent form registration wizard</a></td> 142 </tr> 143 </table> 144 </dt> 145 <dd> 146 <ul> 147 <li>Register consent forms. 148 </ul> 149 </dd> 150 <% 151 } 134 152 %> 135 153 </dl> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java
r1340 r1341 104 104 public static final String ANNOTATION_RNALATER_DATETIME = "RNALaterDateTime"; 105 105 106 107 /** 108 The name of the "Consent" annotation type, used 109 for samples (Case). It is an enumerated string annotation 110 type with three options: Yes, No and Not asked 111 */ 112 public static final String ANNOTATION_CONSENT = "Consent"; 113 106 114 /** 107 115 The name of the "PatientCurator" group. Members of this group -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Case.java
r1335 r1341 12 12 import net.sf.basedb.core.Item; 13 13 import net.sf.basedb.core.ItemQuery; 14 import net.sf.basedb.core.PermissionDeniedException; 14 15 import net.sf.basedb.core.Sample; 15 16 import net.sf.basedb.core.Type; … … 195 196 } 196 197 198 /** 199 Verify that the patient has given their permission to participate in the 200 study. Due to the order that things get registered, a non-existing "Consent" 201 annotation is accepted. If the annotation exists the answer must be "Yes", 202 or an exception is thrown. 203 */ 204 public void verifyConsent(DbControl dc, AnnotationType consentType) 205 { 206 if (consentType == null) 207 { 208 consentType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_CONSENT, true); 209 } 210 String consent = (String)Reggie.getAnnotationValue(getItem(), consentType); 211 if (consent != null && !consent.equals("Yes")) 212 { 213 throw new PermissionDeniedException("The case (" + getOriginalName() + 214 ") has not agreed to participate in the study."); 215 } 216 217 } 197 218 198 219 } -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r1325 r1341 100 100 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_ALL_FIRST_NAMES, Item.BIOSOURCE, Type.STRING, 1, 101 101 null, sharedToPatientCurator, createIfMissing)); 102 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_CONSENT, Item.SAMPLE, Type.STRING, 1, 103 new EnumerationOptions("Yes", "No", "Not asked"), sharedToPatientCurator, createIfMissing)); 102 104 103 105 // -- the second batch need only be shared to the active project or to the PatientCurator group -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java
r1333 r1341 87 87 if (theCase != null) 88 88 { 89 theCase.verifyConsent(dc, null); 90 89 91 // Load the patient associated with the case 90 92 Patient patient = Patient.findByCase(dc, theCase); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ReferralFormServlet.java
r1336 r1341 12 12 import org.json.simple.JSONObject; 13 13 14 import net.sf.basedb.core.AnnotationType; 14 15 import net.sf.basedb.core.AnyToAny; 15 16 import net.sf.basedb.core.Application; … … 28 29 import net.sf.basedb.core.query.Restriction; 29 30 import net.sf.basedb.core.query.Restrictions; 31 import net.sf.basedb.reggie.Reggie; 30 32 import net.sf.basedb.reggie.dao.Case; 31 33 import net.sf.basedb.util.Values; … … 71 73 int directoryId = Values.getInt(req.getParameter("directoryId")); 72 74 String pattern = Values.getString(req.getParameter("pattern")); 75 76 AnnotationType consentType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_CONSENT, true); 73 77 74 78 Directory dir = Directory.getById(dc, directoryId); … … 132 136 jsonFile.put("message", "No case found"); 133 137 } 138 else 139 { 140 // Found a case -- verify that consent is given 141 theCase.verifyConsent(dc, consentType); 142 } 134 143 } 135 144 } … … 137 146 { 138 147 jsonFile.put("message", ex.getMessage()); 148 theCase = null; 139 149 } 140 150
Note: See TracChangeset
for help on using the changeset viewer.