Пример #1
0
  private void updateParentQuery(QueryServiceHelperBean helperBean) {
    if (helperBean.getDn().getParentDiscrepancyNote() == null) return;

    DiscrepancyNote itemParentNote =
        discrepancyNoteDao.findByDiscrepancyNoteId(
            helperBean.getDn().getParentDiscrepancyNote().getDiscrepancyNoteId());
    itemParentNote.setResolutionStatus(helperBean.getResStatus());
    discrepancyNoteDao.saveOrUpdate(itemParentNote);
  }
Пример #2
0
  private void saveQueryItemDatamap(QueryServiceHelperBean helperBean) {
    // Create Mapping for new Discrepancy Note
    DnItemDataMapId dnItemDataMapId = new DnItemDataMapId();
    dnItemDataMapId.setDiscrepancyNoteId(helperBean.getDn().getDiscrepancyNoteId());
    dnItemDataMapId.setItemDataId(helperBean.getItemData().getItemDataId());
    dnItemDataMapId.setStudySubjectId(helperBean.getContainer().getSubject().getStudySubjectId());
    dnItemDataMapId.setColumnName("value");

    DnItemDataMap mapping = new DnItemDataMap();
    mapping.setDnItemDataMapId(dnItemDataMapId);
    mapping.setItemData(helperBean.getItemData());
    mapping.setStudySubject(helperBean.getContainer().getSubject());
    mapping.setActivated(false);
    mapping.setDiscrepancyNote(helperBean.getDn());
    dnItemDataMapDao.saveOrUpdate(mapping);
    // updateParentQuery(helperBean);
  }
Пример #3
0
  private void prepareEmail(QueryServiceHelperBean helperBean) throws Exception {
    StringBuffer message = new StringBuffer();

    message.append(
        MessageFormat.format(
            respage.getString("mailDNHeader"),
            helperBean.getUserAccount().getFirstName(),
            helperBean.getUserAccount().getLastName()));
    message.append(
        "<A HREF='"
            + SQLInitServlet.getField("sysURL.base")
            + "ViewNotes?module=submit&listNotes_f_discrepancyNoteBean.user="******"&listNotes_f_entityName="
            + helperBean.getParentElementName()
            + "'>"
            + SQLInitServlet.getField("sysURL.base")
            + "</A><BR/>");
    message.append(respage.getString("you_received_this_from"));
    message.append(respage.getString("email_body_separator"));
    message.append(respage.getString("disc_note_info"));
    message.append(respage.getString("email_body_separator"));
    message.append(
        MessageFormat.format(
            respage.getString("mailDNParameters1"),
            helperBean.getDn().getDescription(),
            helperBean.getDn().getDetailedNotes(),
            helperBean.getUserAccount().getUserName()));
    message.append(respage.getString("email_body_separator"));
    message.append(respage.getString("entity_information"));
    message.append(respage.getString("email_body_separator"));
    message.append(
        MessageFormat.format(
            respage.getString("mailDNParameters2"),
            helperBean.getDn().getStudy().getName(),
            helperBean.getDn().getDescription()));

    if (!("studySub".equalsIgnoreCase(helperBean.getDn().getEntityType())
        || "subject".equalsIgnoreCase(helperBean.getDn().getEntityType()))) {
      message.append(
          MessageFormat.format(
              respage.getString("mailDNParameters3"),
              helperBean.getContainer().getStudyEvent().getStudyEventDefinition().getName()));
      if (!"studyEvent".equalsIgnoreCase(helperBean.getDn().getEntityType())) {
        message.append(
            MessageFormat.format(
                respage.getString("mailDNParameters4"),
                helperBean.getContainer().getCrfVersion().getCrf().getName()));
        if (!"eventCrf".equalsIgnoreCase(helperBean.getDn().getEntityType())) {
          message.append(
              MessageFormat.format(
                  respage.getString("mailDNParameters6"), helperBean.getParentElementName()));
        }
      }
    }

    message.append(respage.getString("email_body_separator"));
    message.append(
        MessageFormat.format(
            respage.getString("mailDNThanks"), helperBean.getDn().getStudy().getName()));
    message.append(respage.getString("email_body_separator"));
    message.append(respage.getString("disclaimer"));
    message.append(respage.getString("email_body_separator"));
    message.append(respage.getString("email_footer"));
    String subject =
        MessageFormat.format(
            respage.getString("mailDNSubject"),
            helperBean.getDn().getStudy().getName(),
            helperBean.getParentElementName());

    String emailBodyString = message.toString();
    try {
      sendEmail(helperBean.getUserAccount().getEmail().trim(), subject, emailBodyString, true);
    } catch (Exception e) {
      logger.error(e.getMessage());
      throw e;
    }
  }