/** Verfy that the protocol has the given protocol action. */ @SuppressWarnings("unchecked") private void verifyProtocolAction(Protocol protocol, String actionTypeCode) { List<ProtocolAction> actions = (List) protocol.getProtocolActions(); for (ProtocolAction action : actions) { if (StringUtils.equals(actionTypeCode, action.getProtocolActionTypeCode())) { return; } } assertTrue(actionTypeCode + " not found", false); }
/** * @throws WorkflowException * @see * org.kuali.kra.irb.actions.notifycommittee.ProtocolNotifyCommitteeService#submitCommitteeNotification(org.kuali.kra.irb.Protocol, * org.kuali.kra.irb.actions.notifycommittee.ProtocolNotifyCommitteeBean) */ public void submitCommitteeNotification( Protocol protocol, ProtocolNotifyCommitteeBean notifyCommitteeBean) throws WorkflowException { // we do not create a new submission here unlike in notify IRB ProtocolAction protocolAction = new ProtocolAction(protocol, null, ProtocolActionType.NOTIFIED_COMMITTEE); protocolAction.setComments(notifyCommitteeBean.getComment()); protocolAction.setActionDate(new Timestamp(notifyCommitteeBean.getActionDate().getTime())); protocol.getProtocolActions().add(protocolAction); protocolActionService.updateProtocolStatus(protocolAction, protocol); documentService.saveDocument(protocol.getProtocolDocument()); }
@Test public void testProcessApproveCommitteeDecision() throws Exception { Protocol protocol = getProtocolAssignedToAgenda(); CommitteeDecision committeeDecision = getMockCommitteeDecisionBean(CommitteeDecisionMotionType.APPROVE); service.processCommitteeDecision(protocol, committeeDecision); ProtocolAction lastAction = protocol.getLastProtocolAction(); assertNotNull(lastAction); assertEquals( ProtocolActionType.RECORD_COMMITTEE_DECISION, lastAction.getProtocolActionTypeCode()); ProtocolSubmission submission = protocol.getProtocolSubmission(); assertNotNull(submission); assertEquals( CommitteeDecisionMotionType.APPROVE, submission.getCommitteeDecisionMotionTypeCode()); assertEquals(YES_COUNT, submission.getYesVoteCount()); assertEquals(NO_COUNT, submission.getNoVoteCount()); assertEquals(ABSTAIN_COUNT, submission.getAbstainerCount()); assertEquals(RECUSED_COUNT, submission.getRecusedCount()); assertEquals(VOTING_COMMENTS, submission.getVotingComments()); }
private boolean canPerform(ProtocolAction lastAction, ProtocolSubmission lastSubmission) { boolean canPerform = false; if (lastAction != null && lastSubmission != null) { boolean traditionalSubPerform = ProtocolActionType.RECORD_COMMITTEE_DECISION.equals( lastAction.getProtocolActionTypeCode()) && CommitteeDecisionMotionType.SPECIFIC_MINOR_REVISIONS.equals( lastSubmission.getCommitteeDecisionMotionTypeCode()); boolean exemptExpeditePerform = false; if (lastSubmission.getProtocolReviewType() != null) { exemptExpeditePerform = isExpeditedOrExempt(lastSubmission.getProtocolReviewType().getReviewTypeCode()) && ProtocolActionType.SUBMIT_TO_IRB.equals(lastAction.getProtocolActionTypeCode()); } canPerform = traditionalSubPerform || exemptExpeditePerform; } return canPerform; }
/** * This method is to set ProtocolActionType * * @param protocolSubmission * @param protocolSubmissionDetail */ private void setProtocolSubmissionAction( org.kuali.kra.irb.actions.submit.ProtocolSubmissionLite protocolSubmission, Protocol protocol, SubmissionDetails protocolSubmissionDetail) { ProtocolAction protcolAction = findProtocolActionForSubmission(protocolSubmission, protocol); if (protcolAction != null) { protcolAction.refreshNonUpdateableReferences(); ActionType actionTypeInfo = protocolSubmissionDetail.addNewActionType(); actionTypeInfo.setActionId(BigInteger.valueOf(protcolAction.getActionId())); if (protcolAction.getProtocolActionTypeCode() != null) { actionTypeInfo.setActionTypeCode(new BigInteger(protcolAction.getProtocolActionTypeCode())); actionTypeInfo.setActionTypeDescription( protcolAction.getProtocolActionType().getDescription()); } if (protcolAction.getActionDate() != null) { actionTypeInfo.setActionDate( getDateTimeService().getCalendar(protcolAction.getActionDate())); } actionTypeInfo.setActionComments(protcolAction.getComments()); } }