コード例 #1
0
ファイル: EditPHRAction.java プロジェクト: bsundar2/iTrust
 /**
  * Checks to see if the family member is dead and returns their cause of death if so
  *
  * @param member the family member to check
  * @return the cause of death if there is one; otherwise null
  * @throws ITrustException
  */
 public String getFamilyMemberCOD(FamilyMemberBean member) throws ITrustException {
   PatientBean patient = patientDAO.getPatient(member.getMid());
   if (patient.getCauseOfDeath() == null) return "";
   DiagnosisBean diag = icdDAO.getICDCode(patient.getCauseOfDeath());
   if (diag == null) return "";
   return diag.getDescription();
 }
コード例 #2
0
 /**
  * The DateOfDeactivationStr of the PatientBean when not null indicates that the user has been
  * deactivated.
  *
  * @throws DBException
  */
 public void deactivate() throws DBException {
   PatientBean p = patientDAO.getPatient(this.getPid());
   p.setMID(pid);
   p.setDateOfDeactivationStr(
       new SimpleDateFormat("MM/dd/yyyy").format(Calendar.getInstance().getTime()));
   patientDAO.editPatient(p, loggedInMID);
   patientDAO.removeAllRepresented(pid);
   patientDAO.removeAllRepresentee(pid);
 }
コード例 #3
0
  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());
  }
コード例 #4
0
  public void testGetPatientHistory() 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");
    patientDAO.editPatient(p, 9000000003L);

    List<PatientHistoryBean> pList = patientDAO.getPatientHistory(p.getMID());
    assertEquals(pList.size(), 1);
    assertEquals("Person1", pList.get(0).getFirstName());
    assertEquals(9000000003L, pList.get(0).getChangeMID());
  }
コード例 #5
0
  public void testHasHistory() throws Exception {
    PatientBean p = patientDAO.getPatient(2);

    assertFalse(patientDAO.hasHistory(p.getMID()));

    p.setFirstName("Person1");
    p.setEmail("another email");
    p.setEmergencyName("another emergency person");
    p.setTopicalNotes("some topical notes");
    p.setDateOfBirthStr("05/20/1984");
    patientDAO.editPatient(p, 9000000003L);

    assertTrue(patientDAO.hasHistory(p.getMID()));
  }
コード例 #6
0
ファイル: EditPHRAction.java プロジェクト: bsundar2/iTrust
 /**
  * Super class validates the patient id
  *
  * @param factory The DAOFactory to be used in creating DAOs for this action.
  * @param loggedInMID The MID of the currently logged in user who is authorizing this action.
  * @param pidString The MID of the patient whose personal health records are being added.
  * @throws ITrustException
  * @throws NoHealthRecordsException
  */
 public EditPHRAction(DAOFactory factory, long loggedInMID, String pidString)
     throws ITrustException {
   super(factory, pidString);
   this.patientDAO = factory.getPatientDAO();
   this.allergyDAO = factory.getAllergyDAO();
   this.familyDAO = factory.getFamilyDAO();
   this.hrDAO = factory.getHealthRecordsDAO();
   this.ovDAO = factory.getOfficeVisitDAO();
   this.icdDAO = factory.getICDCodesDAO();
   this.personnelDAO = factory.getPersonnelDAO();
   this.HCPUAP = personnelDAO.getPersonnel(loggedInMID);
   this.patient = patientDAO.getPatient(pid);
   this.procDAO = factory.getProceduresDAO();
   this.ndcodesDAO = factory.getNDCodesDAO(); // NEW
   this.loggingAction = new EventLoggingAction(factory);
   emailutil = new EmailUtil(factory);
   this.factory = factory;
 }
コード例 #7
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;
  }
コード例 #8
0
 /**
  * Returns a PatientBean for the patient
  *
  * @return the PatientBean
  * @throws DBException
  */
 public PatientBean getPatient() throws DBException {
   return patientDAO.getPatient(this.getPid());
 }
コード例 #9
0
 /**
  * The DateOfDeactivationStr of the PatientBean is null when the patient is activated
  *
  * @throws DBException
  */
 public void activate() throws DBException {
   PatientBean p = patientDAO.getPatient(this.getPid());
   p.setMID(pid);
   p.setDateOfDeactivationStr(null);
   patientDAO.editPatient(p, loggedInMID);
 }
コード例 #10
0
 public void testGetPatient2() throws Exception {
   PatientBean p = patientDAO.getPatient(2);
   assertNotNull(p);
   assertIsPatient2(p);
 }
コード例 #11
0
 public void testGetEmpty() throws Exception {
   assertNull(patientDAO.getPatient(0L));
 }
コード例 #12
0
ファイル: EditPHRAction.java プロジェクト: bsundar2/iTrust
 /**
  * Returns a PatientBean for the patient
  *
  * @return PatientBean
  * @throws ITrustException
  */
 public PatientBean getPatient() throws ITrustException {
   return patientDAO.getPatient(pid);
 }