Exemplo n.º 1
0
  /**
   * Sends an e-mail informing the patient that their procedure has been updated
   *
   * @param b the procedure that was updated
   * @return an e-mail to the patient with the notice
   * @throws DBException
   */
  private Email makeEmail(LabProcedureBean b) throws DBException {

    PatientBean p = new PatientDAO(factory).getPatient(b.getPid());

    Email email = new Email();
    email.setFrom("*****@*****.**");
    email.setToList(Arrays.asList(p.getEmail()));
    email.setSubject("A Lab Procedure Was Updated");
    email.setBody(
        String.format(
            "Dear %s, \n Your Lab Procedure (%s) has a new updated status of %s. Log on to iTrust to view.",
            p.getFullName(), b.getLoinc(), b.getStatus()));
    return email;
  }
Exemplo n.º 2
0
  /**
   * 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;
  }
Exemplo n.º 3
0
  /**
   * Creates and e-mail to inform the patient that their information has been updated.
   *
   * @return the email with the notice
   * @throws DBException
   */
  private Email makeEmail() throws DBException {

    Email email = new Email();
    List<PatientBean> reps = patientDAO.getRepresenting(pid);
    PatientBean pb = patientDAO.getPatient(pid);

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

    email.setFrom("*****@*****.**");
    email.setToList(toAddrs); // patient and personal representative
    email.setSubject(String.format("Patient Information Updated"));
    email.setBody(
        "Dear "
            + pb.getFullName()
            + ",\n\tYour patient record information has been updated. "
            + "Please login to iTrust to see who has viewed your records.");
    return email;
  }