@Override public ModuleQuestionnaireBean getModuleQnBean() { String baseProtocolNumber = protocol.getProtocolNumber(); baseProtocolNumber = baseProtocolNumber.replaceAll("[A-Z]+", ""); return new ProtocolModuleQuestionnaireBean( getModuleCode(), baseProtocolNumber, CoeusSubModule.PROTOCOL_SUBMISSION, StringUtils.isNotBlank(submissionNumber) ? submissionNumber : actionTypeCode, StringUtils.isNotBlank(submissionNumber) || protocol.getProtocolNumber().endsWith(SUFFIX_T) || readOnlyView); }
@Override public List<CommitteeMembershipBase> getAvailableCommitteeMembersForCurrentSubmission( ProtocolBase protocol) { List<CommitteeMembershipBase> results = new ArrayList<CommitteeMembershipBase>(); ProtocolSubmissionBase submission = protocol.getProtocolSubmission(); submission.refreshReferenceObject("protocolOnlineReviews"); if (LOG.isDebugEnabled()) { LOG.debug( String.format( "Fetching available committee members for protocol %s, submission %s", protocol.getProtocolNumber(), submission.getSubmissionNumber())); } List<ProtocolOnlineReviewBase> currentReviews = submission.getProtocolOnlineReviews(); List<CommitteeMembershipBase> committeeMembers = getCommitteeService() .getAvailableMembers(submission.getCommitteeId(), submission.getScheduleId()); // TODO: Make this better. for (CommitteeMembershipBase member : committeeMembers) { boolean found = false; for (ProtocolOnlineReviewBase review : currentReviews) { if (review.getProtocolReviewer().isProtocolReviewerFromCommitteeMembership(member) && review.isActive()) { found = true; break; } } if (!found && !isProtocolPersonnel(protocol, member)) { results.add(member); } } return results; }
protected void buildAndAttachProtocolCorrespondence( ProtocolBase protocol, byte[] data, String correspTypeCode) { ProtocolCorrespondence protocolCorrespondence = getNewProtocolCorrespondenceHook(); protocolCorrespondence.setProtocol(protocol); protocolCorrespondence.setProtocolId(protocol.getProtocolId()); protocolCorrespondence.setProtocolNumber(protocol.getProtocolNumber()); protocolCorrespondence.setSequenceNumber(protocol.getSequenceNumber()); protocolCorrespondence.setProtoCorrespTypeCode(correspTypeCode); ProtocolActionBase lastAction = protocol.getLastProtocolAction(); protocolCorrespondence.setProtocolAction(lastAction); protocolCorrespondence.setActionIdFk(lastAction.getProtocolActionId()); protocolCorrespondence.setCorrespondence(data); protocolCorrespondence.setActionId(lastAction.getActionId()); // What is Final flag used for? ANSWER: the final flag is used by the IRB admin to denote // correspondences // that are ready to be sent/published to the PI etc. protocolCorrespondence.setFinalFlag(false); protocolCorrespondence.setCreateUser(GlobalVariables.getUserSession().getPrincipalName()); protocolCorrespondence.setCreateTimestamp(dateTimeService.getCurrentTimestamp()); if (lastAction.getProtocolCorrespondences() == null) { List<ProtocolCorrespondence> correspondences = new ArrayList<ProtocolCorrespondence>(); correspondences.add(protocolCorrespondence); lastAction.setProtocolCorrespondences(correspondences); protocol.refreshReferenceObject("protocolSubmissions"); } else { lastAction.getProtocolCorrespondences().add(protocolCorrespondence); } getBusinessObjectService().save(protocolCorrespondence); getBusinessObjectService().save(protocol); }
/** * Is the protocol an amendment or renewal protocol? Including continuation here - since * continuation is similar to renewal * * @param protocol the protocol * @return true if the protocol is an amendment or renewal; otherwise false */ protected final boolean isAmendmentOrRenewal(ProtocolBase protocol) { return protocol.getProtocolNumber() != null && (protocol.getProtocolNumber().contains("A") || protocol.getProtocolNumber().contains("R") || protocol.getProtocolNumber().contains("C")); }