Exemplo n.º 1
0
  @Override
  public String populateEpicDesc(String xmlData) {
    List<User> piUserLst =
        formService.getUsersByKeywordAndSearchField(
            "Principal Investigator", xmlData, UserSearchField.ROLE);
    List<User> emrStudyContactUserLst =
        formService.getUsersByKeywordAndSearchField(
            "EMR Study Contact", xmlData, UserSearchField.RESPONSIBILITY);

    String epicDescription = "";

    if (piUserLst.size() > 0) {
      epicDescription += String.format("Principal Investigator: ");

      for (User user : piUserLst) {
        Person person = user.getPerson();
        epicDescription +=
            String.format(
                "Name: "
                    + person.getFullname()
                    + " Department: "
                    + person.getDepartment()
                    + " Email: "
                    + person.getEmail()
                    + " Phone: "
                    + person.getWorkphone()
                    + "%n");
      }
    }

    if (emrStudyContactUserLst.size() > 0) {
      epicDescription += String.format(" EMR Study Contact: ");

      for (User user : emrStudyContactUserLst) {
        Person person = user.getPerson();
        epicDescription +=
            String.format(
                "Name: "
                    + person.getFullname()
                    + " Department: "
                    + person.getDepartment()
                    + " Email: "
                    + person.getEmail()
                    + " Phone: "
                    + person.getWorkphone()
                    + "%n");
      }
    }

    return epicDescription;
  }