@Override
  public ProtocolOnlineReviewDocumentBase createAndRouteProtocolOnlineReviewDocument(
      ProtocolSubmissionBase protocolSubmission,
      ProtocolReviewer protocolReviewer,
      String documentDescription,
      String documentExplanation,
      String documentOrganizationDocumentNumber,
      String documentRouteAnnotation,
      boolean initialApproval,
      Date dateRequested,
      Date dateDue,
      String principalId) {

    ProtocolOnlineReviewDocumentBase document = null;

    try {
      if (LOG.isDebugEnabled()) {
        String protocolNumber = protocolSubmission.getProtocolNumber();
        Integer submissionNumber = protocolSubmission.getSubmissionNumber();
        LOG.debug(
            String.format(
                "Assigning online reviewer [%s] to protocol [%s].",
                protocolReviewer, protocolNumber));
        LOG.debug(
            String.format(
                "Current submission for protocol %s is %s.", protocolNumber, submissionNumber));
      }

      document =
          createProtocolOnlineReviewDocument(
              protocolSubmission,
              protocolReviewer,
              documentDescription,
              documentExplanation,
              documentOrganizationDocumentNumber,
              dateRequested,
              dateDue,
              principalId);

      documentService.routeDocument(
          document,
          "Review Requested by PI during protocol submission.",
          new ArrayList<AdHocRouteRecipient>());

      if (initialApproval) {
        documentService.approveDocument(document, "", new ArrayList<AdHocRouteRecipient>());
      }
    } catch (WorkflowException e) {
      String errorString =
          String.format(
              "WorkflowException creating new ProtocolOnlineReviewDocumentBase for reviewer %s, protocol %s",
              protocolReviewer.getPersonId(), protocolSubmission.getProtocolNumber());
      LOG.error(errorString, e);
      throw new RuntimeException(errorString, e);
    }

    return document;
  }
  public boolean isProtocolInStateToBeReviewed(ProtocolBase protocol) {
    boolean isReviewable = false;
    ProtocolSubmissionBase submission =
        (IacucProtocolSubmission) ((IacucProtocol) protocol).getProtocolSubmission();

    if (submission != null) {
      try {
        isReviewable =
            StringUtils.isNotEmpty(submission.getScheduleId())
                || StringUtils.equals(
                    submission.getProtocolSubmissionType().getSubmissionTypeCode(),
                    IacucProtocolSubmissionType.NOTIFY_IACUC);
        isReviewable &=
            (StringUtils.equals(
                    submission.getSubmissionStatusCode(),
                    IacucProtocolSubmissionStatus.SUBMITTED_TO_COMMITTEE)
                || StringUtils.equals(
                    submission.getSubmissionStatusCode(), IacucProtocolSubmissionStatus.IN_AGENDA));
        ProtocolDocumentBase protocolDocument =
            (ProtocolDocumentBase)
                documentService.getByDocumentHeaderId(
                    protocol.getProtocolDocument().getDocumentNumber());
        isReviewable &=
            kraWorkflowService.isCurrentNode(
                protocolDocument, Constants.IACUC_PROTOCOL_IACUCREVIEW_ROUTE_NODE_NAME);
      } catch (WorkflowException e) {
        String errorString =
            String.format(
                "WorkflowException checking route node for creating new ProtocolOnlineReviewDocumentBase "
                    + "for protocol %s",
                submission.getProtocolNumber());
        LOG.error(errorString, e);
        throw new RuntimeException(errorString, e);
      }
    }
    return isReviewable;
  }
  @Override
  public ProtocolReviewer createProtocolReviewer(
      String principalId,
      boolean nonEmployeeFlag,
      String reviewerTypeCode,
      ProtocolSubmissionBase protocolSubmission) {
    ProtocolReviewer reviewer = createNewProtocolReviewerInstanceHook();
    reviewer.setProtocolIdFk(protocolSubmission.getProtocolId());
    reviewer.setSubmissionIdFk(protocolSubmission.getSubmissionId());
    reviewer.setProtocolNumber(protocolSubmission.getProtocolNumber());
    reviewer.setSequenceNumber(protocolSubmission.getSequenceNumber());
    reviewer.setSubmissionNumber(protocolSubmission.getSubmissionNumber());
    if (!nonEmployeeFlag) {
      reviewer.setPersonId(principalId);
    } else {
      reviewer.setRolodexId(Integer.parseInt(principalId));
    }
    reviewer.setNonEmployeeFlag(nonEmployeeFlag);
    reviewer.setReviewerTypeCode(reviewerTypeCode);

    businessObjectService.save(reviewer);

    return reviewer;
  }