private void addAwardSpecialReview( Award award, String protocolNumber, Date applicationDate, Date approvalDate, Date expirationDate, List<String> exemptionTypeCodes) { if (award != null) { Integer specialReviewNumber = award.getAwardDocument().getDocumentNextValue(Constants.SPECIAL_REVIEW_NUMBER); AwardSpecialReview specialReview = new AwardSpecialReview(); specialReview.setSpecialReviewNumber(specialReviewNumber); specialReview.setSpecialReviewTypeCode(SpecialReviewType.HUMAN_SUBJECTS); specialReview.setApprovalTypeCode(SpecialReviewApprovalType.LINK_TO_IRB); specialReview.setProtocolNumber(protocolNumber); specialReview.setApplicationDate(applicationDate); specialReview.setApprovalDate(approvalDate); specialReview.setExpirationDate(expirationDate); for (String exemptionTypeCode : exemptionTypeCodes) { AwardSpecialReviewExemption specialReviewExemption = new AwardSpecialReviewExemption(); specialReviewExemption.setAwardSpecialReview(specialReview); specialReviewExemption.setExemptionTypeCode(exemptionTypeCode); specialReview.getSpecialReviewExemptions().add(specialReviewExemption); } specialReview.setComments(NEW_SPECIAL_REVIEW_COMMENT); award.getSpecialReviews().add(specialReview); getBusinessObjectService().save(award); } }
private void deleteAwardSpecialReview(Award award, String protocolNumber) { if (award != null) { List<AwardSpecialReview> deletedSpecialReviews = new ArrayList<AwardSpecialReview>(); for (AwardSpecialReview specialReview : award.getSpecialReviews()) { if (StringUtils.equals(specialReview.getProtocolNumber(), protocolNumber)) { deletedSpecialReviews.add(specialReview); } } getBusinessObjectService().delete(deletedSpecialReviews); } }