private void addInstitutionalProposalSpecialReview( InstitutionalProposal institutionalProposal, String protocolNumber, Date applicationDate, Date approvalDate, Date expirationDate, List<String> exemptionTypeCodes) { if (institutionalProposal != null) { Integer specialReviewNumber = institutionalProposal .getInstitutionalProposalDocument() .getDocumentNextValue(Constants.SPECIAL_REVIEW_NUMBER); InstitutionalProposalSpecialReview specialReview = new InstitutionalProposalSpecialReview(); 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) { InstitutionalProposalSpecialReviewExemption specialReviewExemption = new InstitutionalProposalSpecialReviewExemption(); specialReviewExemption.setInstitutionalProposalSpecialReview(specialReview); specialReviewExemption.setExemptionTypeCode(exemptionTypeCode); specialReview.getSpecialReviewExemptions().add(specialReviewExemption); } specialReview.setComments(NEW_SPECIAL_REVIEW_COMMENT); institutionalProposal.getSpecialReviews().add(specialReview); getBusinessObjectService().save(institutionalProposal); } }
/** Create the mock services and insert them into the protocol auth service. */ @Before public void setUp() throws Exception { fundingSponsorSourceType = new FundingSourceType(); fundingSponsorSourceType.setFundingSourceTypeCode(FundingSourceType.SPONSOR); fundingSponsorSourceType.setFundingSourceTypeFlag(true); fundingSponsorSourceType.setDescription("Sponsor"); fundingUnitSourceType = new FundingSourceType(); fundingUnitSourceType.setFundingSourceTypeCode(FundingSourceType.UNIT); fundingUnitSourceType.setFundingSourceTypeFlag(true); fundingUnitSourceType.setDescription("Unit"); fundingOtherSourceType = new FundingSourceType(); fundingOtherSourceType.setFundingSourceTypeCode(FundingSourceType.OTHER); fundingOtherSourceType.setFundingSourceTypeFlag(true); fundingOtherSourceType.setDescription("Other"); fundingDevProposalSourceType = new FundingSourceType(); fundingDevProposalSourceType.setFundingSourceTypeCode(FundingSourceType.PROPOSAL_DEVELOPMENT); fundingDevProposalSourceType.setFundingSourceTypeFlag(true); fundingDevProposalSourceType.setDescription("Proposal Development"); fundingInstProposalSourceType = new FundingSourceType(); fundingInstProposalSourceType.setFundingSourceTypeCode( FundingSourceType.INSTITUTIONAL_PROPOSAL); fundingInstProposalSourceType.setFundingSourceTypeFlag(true); fundingInstProposalSourceType.setDescription("Institutional Proposal"); fundingAwardSourceType = new FundingSourceType(); fundingAwardSourceType.setFundingSourceTypeCode(FundingSourceType.AWARD); fundingAwardSourceType.setFundingSourceTypeFlag(true); fundingAwardSourceType.setDescription("Award"); // sponsorGood = new Sponsor(); // sponsorGood.setSponsorName(sponsorNameAirForce); // sponsorGood.setSponsorCode(SPONSOR_NUMBER_AIR_FORCE); sponsorGood = KcServiceLocator.getService(SponsorService.class).getSponsor(SPONSOR_NUMBER_AIR_FORCE); sponsorNameAirForce = sponsorGood.getSponsorName(); devProposalGood = new DevelopmentProposal(); devProposalGood.setTitle(DEV_PROPOSAL_TITLE_GOOD); devProposalGood.setSponsorCode(sponsorGood.getSponsorCode()); instProposalGood = new InstitutionalProposal(); instProposalGood.setTitle(INST_PROPOSAL_TITLE_GOOD); instProposalGood.setSponsorCode(sponsorGood.getSponsorCode()); awardGood = new Award(); awardGood.setTitle(AWARD_TITLE_GOOD); awardGood.setSponsorCode(sponsorGood.getSponsorCode()); }
@Override protected void loadDocument(KualiDocumentFormBase kualiDocumentFormBase) throws WorkflowException { super.loadDocument(kualiDocumentFormBase); InstitutionalProposal proposal = ((InstitutionalProposalForm) kualiDocumentFormBase) .getInstitutionalProposalDocument() .getInstitutionalProposal(); proposal.setSponsorNihMultiplePi( getSponsorHierarchyService().isSponsorNihMultiplePi(proposal.getSponsorCode())); // work around to make sure project person reference to inst prop is to the same instance as the // document has // without this the references were different causing issues when the sponsor was changed. if (!proposal.getProjectPersons().isEmpty()) { proposal.getProjectPersons().get(0); } }
/** * {@inheritDoc} * * @see * org.kuali.kra.common.specialreview.service.SpecialReviewService#isLinkedToSpecialReview(java.lang.String, * java.lang.String, java.lang.String) */ public boolean isLinkedToSpecialReview( String fundingSourceNumber, String fundingSourceTypeCode, String protocolNumber) { boolean isLinkedToSpecialReview = false; if (StringUtils.equals(FundingSourceType.AWARD, fundingSourceTypeCode)) { Award award = getAward(fundingSourceNumber); if (award != null) { isLinkedToSpecialReview = isLinkedToSpecialReviews(award.getSpecialReviews(), protocolNumber); } } else if (StringUtils.equals( FundingSourceType.INSTITUTIONAL_PROPOSAL, fundingSourceTypeCode)) { InstitutionalProposal institutionalProposal = getInstitutionalProposal(fundingSourceNumber); if (institutionalProposal != null) { isLinkedToSpecialReview = isLinkedToSpecialReviews(institutionalProposal.getSpecialReviews(), protocolNumber); } } return isLinkedToSpecialReview; }
@Override public void updateSponsorProposalNumber( Long institutionalProposalId, String sponsorProposalNumber) { if (institutionalProposalId == null) { throw new IllegalArgumentException("institutionalProposalId is null"); } if (StringUtils.isBlank(sponsorProposalNumber)) { throw new IllegalArgumentException("sponsorProposalNumber is blank"); } final InstitutionalProposal ip = businessObjectService.findByPrimaryKey( InstitutionalProposal.class, Collections.singletonMap("proposalId", institutionalProposalId)); if (ip != null) { if (StringUtils.isBlank(ip.getSponsorProposalNumber())) { ip.setSponsorProposalNumber(sponsorProposalNumber); businessObjectService.save(ip); } } }
private void deleteInstitutionalProposalSpecialReview( InstitutionalProposal institutionalProposal, String protocolNumber) { if (institutionalProposal != null) { List<InstitutionalProposalSpecialReview> deletedSpecialReviews = new ArrayList<InstitutionalProposalSpecialReview>(); for (InstitutionalProposalSpecialReview specialReview : institutionalProposal.getSpecialReviews()) { if (StringUtils.equals(specialReview.getProtocolNumber(), protocolNumber)) { deletedSpecialReviews.add(specialReview); } } getBusinessObjectService().delete(deletedSpecialReviews); } }
boolean checkForDuplicatePerson( InstitutionalProposal institutionalProposal, InstitutionalProposalUnitContact newUnitContact) { boolean valid = true; for (InstitutionalProposalUnitContact unitContact : institutionalProposal.getInstitutionalProposalUnitContacts()) { // equal, but not both are null valid = !(StringUtils.equals(unitContact.getPersonId(), newUnitContact.getPersonId()) && StringUtils.equals( unitContact.getUnitAdministratorTypeCode(), newUnitContact.getUnitAdministratorTypeCode())); if (!valid) { registerError(newUnitContact); break; } } return valid; }