private void assertIsPatient2(PatientBean p) {
   assertEquals(2L, p.getMID());
   assertEquals("Andy", p.getFirstName());
   assertEquals("Programmer", p.getLastName());
   assertEquals("05/19/1984", p.getDateOfBirthStr());
   assertEquals("250.10", p.getCauseOfDeath());
   assertEquals("*****@*****.**", p.getEmail());
   assertEquals("344 Bob Street", p.getStreetAddress1());
   assertEquals("", p.getStreetAddress2());
   assertEquals("Raleigh", p.getCity());
   assertEquals("NC", p.getState());
   assertEquals("27607", p.getZip());
   assertEquals("555-555-5555", p.getPhone());
   assertEquals("Mr Emergency", p.getEmergencyName());
   assertEquals("555-555-5551", p.getEmergencyPhone());
   assertEquals("IC", p.getIcName());
   assertEquals("Street1", p.getIcAddress1());
   assertEquals("Street2", p.getIcAddress2());
   assertEquals("City", p.getIcCity());
   assertEquals("PA", p.getIcState());
   assertEquals("19003-2715", p.getIcZip());
   assertEquals("555-555-5555", p.getIcPhone());
   assertEquals("1", p.getIcID());
   assertEquals("1", p.getMotherMID());
   assertEquals("0", p.getFatherMID());
   assertEquals("O-", p.getBloodType().getName());
   assertEquals(Ethnicity.Caucasian, p.getEthnicity());
   assertEquals(Gender.Male, p.getGender());
   assertEquals("This person is absolutely crazy. Do not touch them.", p.getTopicalNotes());
 }
예제 #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;
  }
예제 #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;
  }
예제 #4
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;
  }
  public void testEditPatient2() throws Exception {
    PatientBean p = patientDAO.getPatient(2);
    p.setFirstName("Person1");
    p.setEmail("another email");
    p.setEmergencyName("another emergency person");
    p.setTopicalNotes("some topical notes");
    p.setDateOfBirthStr("05/20/1984");
    p.setDateOfDeactivationStr("05/21/1984");
    patientDAO.editPatient(p, 9000000003L);

    p = patientDAO.getPatient(2);
    assertEquals("Person1", p.getFirstName());
    assertEquals("Programmer", p.getLastName());
    assertEquals("another email", p.getEmail());
    assertEquals("another emergency person", p.getEmergencyName());
    assertEquals("some topical notes", p.getTopicalNotes());
    assertEquals("05/20/1984", p.getDateOfBirthStr());
    assertEquals("05/21/1984", p.getDateOfDeactivationStr());
    assertEquals("250.10", p.getCauseOfDeath());
    assertEquals("344 Bob Street", p.getStreetAddress1());
    assertEquals("", p.getStreetAddress2());
    assertEquals("Raleigh", p.getCity());
    assertEquals("NC", p.getState());
    assertEquals("27607", p.getZip());
    assertEquals("555-555-5555", p.getPhone());
    assertEquals("555-555-5551", p.getEmergencyPhone());
    assertEquals("IC", p.getIcName());
    assertEquals("Street1", p.getIcAddress1());
    assertEquals("Street2", p.getIcAddress2());
    assertEquals("City", p.getIcCity());
    assertEquals("PA", p.getIcState());
    assertEquals("19003-2715", p.getIcZip());
    assertEquals("555-555-5555", p.getIcPhone());
    assertEquals("1", p.getIcID());
    assertEquals("1", p.getMotherMID());
    assertEquals("0", p.getFatherMID());
    assertEquals("O-", p.getBloodType().getName());
    assertEquals(Ethnicity.Caucasian, p.getEthnicity());
    assertEquals(Gender.Male, p.getGender());
  }