/** 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());
 }
Exemple #3
0
 private ProtocolAction findProtocolActionForSubmission(
     org.kuali.kra.irb.actions.submit.ProtocolSubmissionLite protocolSubmission,
     Protocol protocol) {
   List<ProtocolActionBase> protocolActions = protocol.getProtocolActions();
   for (ProtocolActionBase protocolAction : protocolActions) {
     if (protocolAction.getSubmissionNumber() != null
         && protocolAction
             .getSubmissionNumber()
             .equals(protocolSubmission.getSubmissionNumber())) {
       return (ProtocolAction) protocolAction;
     }
   }
   return null;
 }
 protected void setReferencesForProtocolCorrespondence(ProtocolDocument newDocument) {
   Protocol newProtocol = newDocument.getProtocol();
   newProtocol
       .getProtocolActions()
       .forEach(
           protocolAction -> {
             protocolAction.setSequenceNumber(newProtocol.getSequenceNumber());
             protocolAction
                 .getProtocolCorrespondences()
                 .forEach(
                     protocolCorrespondence -> {
                       protocolCorrespondence.setProtocolId(newProtocol.getProtocolId());
                       protocolCorrespondence.setSequenceNumber(newProtocol.getSequenceNumber());
                     });
           });
 }
Exemple #5
0
  public Schedule getSchedule(CommitteeSchedule committeeSchedule) {
    Schedule schedule = Schedule.Factory.newInstance();
    setScheduleMasterData(committeeSchedule, schedule.addNewScheduleMasterData());
    PreviousSchedule prevSchedule = schedule.addNewPreviousSchedule();
    setPreviousSchedule(committeeSchedule, prevSchedule.addNewScheduleMasterData());
    NextSchedule nextScheduleType = schedule.addNewNextSchedule();
    setNextSchedule(committeeSchedule, nextScheduleType.addNewScheduleMasterData());

    getIrbPrintXmlUtilService().setMinutes(committeeSchedule, schedule);
    setAttendance(committeeSchedule, schedule);
    committeeSchedule.refreshReferenceObject("protocolSubmissions");
    List<org.kuali.kra.irb.actions.submit.ProtocolSubmissionLite> submissions =
        committeeSchedule.getLatestProtocolSubmissions();
    for (org.kuali.kra.irb.actions.submit.ProtocolSubmissionLite protocolSubmission : submissions) {

      ProtocolSubmission protocolSubmissionType = schedule.addNewProtocolSubmission();
      SubmissionDetails protocolSubmissionDetail = protocolSubmissionType.addNewSubmissionDetails();
      ProtocolSummary protocolSummary = protocolSubmissionType.addNewProtocolSummary();
      ProtocolMasterData protocolMaster = protocolSummary.addNewProtocolMasterData();
      String followUpAction = null;
      String actionTypeCode = null;
      Protocol protocol =
          getBusinessObjectService()
              .findByPrimaryKey(
                  Protocol.class,
                  Collections.singletonMap("protocolId", protocolSubmission.getProtocolId()));
      List<ProtocolActionBase> protocolActions = protocol.getProtocolActions();

      for (ProtocolActionBase protocolAction : protocolActions) {
        actionTypeCode = protocolAction.getProtocolActionTypeCode();
        if (actionTypeCode.equals(EXPEDIT_ACTION_TYPE_CODE)
            || actionTypeCode.equals(EXEMPT_ACTION_TYPE_CODE)) {
          if (protocolAction.getFollowupActionCode() != null
              && protocolAction.getFollowupActionCode().equals(FOLLOW_UP_ACTION_CODE)) {
            followUpAction = protocolAction.getFollowupActionCode();
          }
          break;
        }
      }

      protocolMaster.setProtocolNumber(protocol.getProtocolNumber());
      protocolMaster.setSequenceNumber(
          new BigInteger(String.valueOf(protocol.getSequenceNumber())));
      protocolMaster.setProtocolTitle(protocol.getTitle());
      protocolMaster.setProtocolStatusCode(
          new BigInteger(String.valueOf(protocol.getProtocolStatusCode())));
      protocolMaster.setProtocolStatusDesc(protocol.getProtocolStatus().getDescription());
      protocolMaster.setProtocolTypeCode(
          new BigInteger(String.valueOf(protocol.getProtocolTypeCode())));
      protocolMaster.setProtocolTypeDesc(protocol.getProtocolType().getDescription());

      if (protocol.getDescription() != null) {
        protocolMaster.setProtocolDescription(protocol.getDescription());
      }

      if (protocol.getApprovalDate() != null) {
        protocolMaster.setApprovalDate(
            getDateTimeService().getCalendar(protocol.getApprovalDate()));
      }

      if (protocol.getExpirationDate() != null) {
        protocolMaster.setExpirationDate(
            getDateTimeService().getCalendar(protocol.getExpirationDate()));
      }

      if (protocol.getFdaApplicationNumber() != null) {
        protocolMaster.setFdaApplicationNumber(protocol.getFdaApplicationNumber());
      }

      if (protocol.getReferenceNumber1() != null) {
        protocolMaster.setRefNumber1(protocol.getReferenceNumber1());
      }

      if (protocol.getReferenceNumber2() != null) {
        protocolMaster.setRefNumber2(protocol.getReferenceNumber2());
      }

      protocolSubmissionDetail.setProtocolNumber(protocolSubmission.getProtocolNumber());
      if (protocolSubmission.getProtocolSubmissionType() != null) {
        protocolSubmissionDetail.setSubmissionTypeDesc(
            protocolSubmission.getProtocolSubmissionType().getDescription());
      }

      if (protocolSubmission.getProtocolReviewTypeCode() != null) {
        protocolSubmissionDetail.setProtocolReviewTypeCode(
            new BigInteger(protocolSubmission.getProtocolReviewTypeCode()));
      }
      if (protocolSubmission.getProtocolReviewType() != null) {
        protocolSubmissionDetail.setProtocolReviewTypeDesc(
            protocolSubmission.getProtocolReviewType().getDescription());
      }
      if (protocolSubmission.getSubmissionTypeCode() != null) {
        protocolSubmissionDetail.setSubmissionTypeCode(
            new BigInteger(String.valueOf(protocolSubmission.getSubmissionTypeCode())));
      }
      if (protocolSubmission.getProtocolSubmissionType() != null) {
        protocolSubmissionDetail.setSubmissionTypeDesc(
            protocolSubmission.getProtocolSubmissionType().getDescription());
      }
      if (protocolSubmission.getSubmissionNumber() != null) {
        protocolSubmissionDetail.setSubmissionNumber(
            new BigInteger(String.valueOf(protocolSubmission.getSubmissionNumber())));
      }
      if (protocolSubmission.getSubmissionStatusCode() != null) {
        protocolSubmissionDetail.setSubmissionStatusCode(
            new BigInteger(String.valueOf(protocolSubmission.getSubmissionStatusCode())));
      }
      if (protocolSubmission.getSubmissionStatus() != null) {
        protocolSubmissionDetail.setSubmissionStatusDesc(
            protocolSubmission.getSubmissionStatus().getDescription());
      }
      if (protocolSubmission.getSubmissionTypeQualifierCode() != null) {
        protocolSubmissionDetail.setSubmissionTypeQualifierCode(
            new BigInteger(protocolSubmission.getSubmissionTypeQualifierCode()));
      }
      if (protocolSubmission.getProtocolSubmissionQualifierType() != null) {
        protocolSubmissionDetail.setSubmissionTypeQualifierDesc(
            protocolSubmission.getProtocolSubmissionQualifierType().getDescription());
      }
      if (protocolSubmission.getYesVoteCount() != null) {
        protocolSubmissionDetail.setYesVote(
            BigInteger.valueOf(protocolSubmission.getYesVoteCount()));
      } else {
        protocolSubmissionDetail.setYesVote(BigInteger.ZERO);
      }
      if (protocolSubmission.getNoVoteCount() != null) {
        protocolSubmissionDetail.setNoVote(BigInteger.valueOf(protocolSubmission.getNoVoteCount()));
      } else {
        protocolSubmissionDetail.setNoVote(BigInteger.ZERO);
      }
      if (protocolSubmission.getAbstainerCount() != null) {
        protocolSubmissionDetail.setAbstainerCount(
            BigInteger.valueOf(protocolSubmission.getAbstainerCount()));
      } else {
        protocolSubmissionDetail.setAbstainerCount(BigInteger.ZERO);
      }
      protocolSubmissionDetail.setVotingComments(protocolSubmission.getVotingComments());

      setProtocolSubmissionAction(protocolSubmission, protocol, protocolSubmissionDetail);
      if (protocolSubmission.getSubmissionDate() != null) {
        protocolSubmissionDetail.setSubmissionDate(
            getDateTimeService().getCalendar(protocolSubmission.getSubmissionDate()));
      }
      setSubmissionCheckListinfo(protocolSubmission, protocolSubmissionDetail);
      setProtocolSubmissionReviewers(protocolSubmission, protocolSubmissionDetail);
      List<ProtocolPersonBase> protocolPersons = protocol.getProtocolPersons();
      for (ProtocolPersonBase protocolPerson : protocolPersons) {
        if (protocolPerson
                .getProtocolPersonRoleId()
                .equals(ProtocolPersonRole.ROLE_PRINCIPAL_INVESTIGATOR)
            || protocolPerson
                .getProtocolPersonRoleId()
                .equals(ProtocolPersonRole.ROLE_CO_INVESTIGATOR)) {
          Investigator investigator = protocolSummary.addNewInvestigator();
          getIrbPrintXmlUtilService()
              .setPersonRolodexType((ProtocolPerson) protocolPerson, investigator.addNewPerson());
          if (protocolPerson
              .getProtocolPersonRoleId()
              .equals(ProtocolPersonRole.ROLE_PRINCIPAL_INVESTIGATOR)) {
            investigator.setPIFlag(true);
          }
        }
      }
      List<ProtocolRiskLevel> cvRiskLevels = protocol.getProtocolRiskLevels();
      for (ProtocolRiskLevel protocolRiskLevelBean : cvRiskLevels) {
        edu.mit.irb.irbnamespace.ProtocolSummaryDocument.ProtocolSummary.RiskLevels riskLevelType =
            protocolSummary.addNewRiskLevels();
        riskLevelType.setRiskLevelDescription(
            protocolRiskLevelBean.getRiskLevel().getDescription());
        riskLevelType.setComments(protocolRiskLevelBean.getComments());
      }

      List<ProtocolFundingSource> vecFundingSource = (List) protocol.getProtocolFundingSources();
      int fundingSourceTypeCode;
      String fundingSourceName, fundingSourceCode;
      for (ProtocolFundingSource protocolFundingSourceBean : vecFundingSource) {
        protocolFundingSourceBean.refreshNonUpdateableReferences();
        edu.mit.irb.irbnamespace.ProtocolSummaryDocument.ProtocolSummary.FundingSource
            fundingSource = protocolSummary.addNewFundingSource();
        fundingSourceCode = protocolFundingSourceBean.getFundingSourceNumber();
        fundingSourceTypeCode =
            Integer.valueOf(protocolFundingSourceBean.getFundingSourceTypeCode());
        fundingSourceName = getFundingSourceNameForType(fundingSourceTypeCode, fundingSourceCode);

        fundingSource.setFundingSourceName(fundingSourceName);
        if (protocolFundingSourceBean.getFundingSourceType() != null) {
          fundingSource.setTypeOfFundingSource(
              protocolFundingSourceBean.getFundingSourceType().getDescription());
        }
      }

      getIrbPrintXmlUtilService()
          .setProcotolMinutes(committeeSchedule, protocolSubmission, protocolSubmissionType);
    }
    setOtherActionItems(committeeSchedule, schedule);
    return schedule;
  }