コード例 #1
0
ファイル: EditPHRAction.java プロジェクト: bsundar2/iTrust
  /**
   * Creates a fake e-mail to notify the user that their records have been altered.
   *
   * @return the e-mail to be sent
   * @throws DBException
   */
  private Email makeEmail() throws DBException {

    Email email = new Email();
    List<PatientBean> reps = patientDAO.getRepresenting(patient.getMID());

    List<String> toAddrs = new ArrayList<String>();
    toAddrs.add(patient.getEmail());
    for (PatientBean r : reps) {
      toAddrs.add(r.getEmail());
    }

    email.setFrom("*****@*****.**");
    email.setToList(toAddrs); // patient and personal representative
    email.setSubject(String.format("Your medical records have been altered"));
    email.setBody(
        "Health care professional "
            + HCPUAP.getFullName()
            + " has altered your medical records. "
            + "She is not on your list of designated health care professionals.");
    return email;
  }