Example #1
0
  /**
   * Registers Participant in CaTissue
   *
   * @param participant - Participant to be registered
   * @return instance of Participant
   * @throws ApplicationException - ApplicationException
   */
  public Participant registerParticipant(Participant participant) throws ApplicationException {
    if (participant == null || StringUtils.isEmpty(participant.getLastName())) {
      throw new ApplicationException("Participant does not contain the unique medical identifier");
    }

    // populate the CP-Title inside Participant-CPR-CP-Title. Also call
    // populateConsentTierResponse()
    populateCP(participant);

    Participant returnParticipant = null;
    try {
      returnParticipant = caTissueAPIClient.insert(participant);
    } catch (ApplicationException ae) {
      LOG.error(
          "Create Registration Failed for Participant with Subject ID as "
              + participant.getLastName(),
          ae);
      throw new ApplicationException(ae);
    }
    return returnParticipant;
  }