Exemplo n.º 1
0
 private void setValues(PreparedStatement ps, OfficeVisitBean ov) throws SQLException {
   ps.setDate(1, new java.sql.Date(ov.getVisitDate().getTime()));
   ps.setString(2, ov.getNotes());
   ps.setLong(3, ov.getHcpID());
   ps.setLong(4, ov.getPatientID());
   ps.setString(5, ov.getHospitalID());
 }
  /**
   * Test patient office visit
   *
   * @throws iTrustException
   */
  public void testGetOfficeVisit() throws iTrustException {
    OfficeVisitBean ovb = action.getOfficeVisit();
    assertEquals(1l, action.getOvID());
    assertEquals("Generated for Death for Patient: 1", ovb.getNotes());
    assertEquals(9000000000l, ovb.getHcpID());
    assertEquals(1l, ovb.getID());
    assertEquals(1, ovb.getVisitID());
    /*assertEquals(0, ovb.getDiagnoses().size());*/
    assertEquals("1", ovb.getHospitalID());

    assertEquals(0, action.prescriptions().getPrescriptions().size());
  }
  /**
   * Test patient office visit
   *
   * @throws ITrustException
   */
  public void testGetOfficeVisit() throws ITrustException {
    OfficeVisitBean ovb = action.getOfficeVisit();
    assertEquals(1L, action.getOvID());
    assertEquals("Generated for Death for Patient: 1", ovb.getNotes());
    assertEquals(9000000000L, ovb.getHcpID());
    assertEquals(1L, ovb.getID());
    assertEquals(1, ovb.getVisitID());
    assertEquals("1", ovb.getHospitalID());

    assertEquals(0, action.prescriptions().getPrescriptions().size());

    // UC60
    OfficeVisitBean ovb60 = actionUC60.getOfficeVisit();
    assertEquals("Sean needs to lower his sodium intake.", ovb60.getNotes());
  }
Exemplo n.º 4
0
 public void testUpdateNewOfficeVisit() {
   try {
     OfficeVisitBean ov = new OfficeVisitBean();
     long newOVID = ovDAO.add(ov);
     ov = new OfficeVisitBean(newOVID);
     ov.setNotes("some notes");
     ov.setVisitDateStr("07/07/2007");
     ov.setPatientID(65);
     ov.setHcpID(5);
     ov.setHospitalID("9191919191");
     ovDAO.update(ov);
     ov = ovDAO.getOfficeVisit(newOVID);
     assertEquals("some notes", ov.getNotes());
     assertEquals("07/07/2007", new SimpleDateFormat("MM/dd/yyyy").format(ov.getVisitDate()));
     assertEquals(65, ov.getPatientID());
     assertEquals(5, ov.getHcpID());
     assertEquals("9191919191", ov.getHospitalID());
   } catch (Exception e) {
     e.printStackTrace();
   }
 }