@Override
 protected void setUp() throws Exception {
   gen = new TestDataGenerator();
   gen.clearAllTables();
   gen.patient1();
   gen.patient2();
 }
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   gen.clearAllTables();
   gen.standardData();
   gen.hcp4();
 }
예제 #3
0
 @Before
 public void setUp() throws Exception {
   gen.clearAllTables();
   gen.patient2();
   action = new ViewPatientAction(factory, 2L, "2");
   badAction = new ViewPatientAction(factory, -1L, "2");
 }
  public void testRemoveAllRepresented() throws Exception {
    // 2 represents 1, but not 4
    gen.patient1();
    gen.patient4();

    // Add patient 4 to be represented by patient 2
    patientDAO.addRepresentative(2L, 4L);

    // Ensure the representatives were added correctly
    assertEquals(2, patientDAO.getRepresented(2L).size());

    // Remove all patient's from being represented by patient 2
    patientDAO.removeAllRepresented(2L);
    // Assert that no more patients are represented by patient 2
    assertTrue(patientDAO.getRepresented(2L).isEmpty());

    // Test with an evil factory
    patientDAO = new PatientDAO(EvilDAOFactory.getEvilInstance());

    try {
      patientDAO.removeAllRepresented(2L);
      fail("Exception should be caught");
    } catch (DBException e) {
      // Successful test
    }
  }
  @Override
  protected void setUp() throws Exception {
    TestDataGenerator gen = new TestDataGenerator();
    gen.clearAllTables();
    gen.standardData();

    action = new ViewMyRecordsAction(factory, pid);
    fmbList = famDAO.getParents(5);
    fmBean = fmbList.get(0);
  }
 @Override
 protected void setUp() throws Exception {
   factor = new ChildhoodInfectionFactor(factory, 2L, 250.3, 487);
   gen = new TestDataGenerator();
   gen.clearAllTables();
   gen.hospitals();
   gen.hcp0();
   gen.patient2();
   p = factory.getPatientDAO().getPatient(2L);
 }
 public void testMakeEmailApp() throws FormValidationException, Exception {
   gen.patient2();
   gen.hcp0();
   Email testEmail = action.makeEmailApp(9000000000L, "2", "You are allergic.");
   assertEquals("*****@*****.**", testEmail.getFrom());
   assertEquals("*****@*****.**", testEmail.getToListStr());
   assertEquals(
       "HCP has prescribed you a potentially dangerous medication", testEmail.getSubject());
   assertEquals(
       "Kelly Doctor has prescribed a medication that you are allergic to or that has a known interaction with a drug you are currently taking. You are allergic.",
       testEmail.getBody());
 }
  @Before
  public void setUp() throws Exception {
    gen.clearAllTables();
    b1 = new BillingBean();
    b1.setAmt(40);
    b1.setInsAddress1("123 else drive");
    b1.setInsAddress2(" ");
    b1.setInsCity("Durham");
    b1.setInsHolderName("dad");
    b1.setInsID("1234");
    b1.setInsPhone("333-333-3333");
    b1.setInsProviderName("Cigna");
    b1.setInsState("NC");
    b1.setInsZip("27607");
    b1.setPatient(PATIENT_MID);
    b1.setStatus(BillingBean.PENDING);
    b1.setSubTime(new Timestamp(new Date().getTime()));
    ov = new OfficeVisitBean();
    ov.setAppointmentType("Mammogram");
    ov.setBilled(true);
    ov.setHcpID(DOCTOR_MID);
    ov.setPatientID(PATIENT_MID);
    int ovID = (int) init2.add(ov);
    b1.setApptID(ovID);

    b1.setBillID((int) init.addBill(b1));
    init.editBill(b1);
    subject = new VerifyClaimAction(factory, b1.getBillID());
  }
 @Override
 protected void setUp() throws Exception {
   gen = new TestDataGenerator();
   gen.labProcedures();
   l = new LabProcedureBean();
   l.setPid(1L);
   l.setOvID(905L);
   l.setLoinc("10763-8");
   l.statusPending();
   l.setCommentary("Awaiting results");
   l.setResults("");
   l.restrict();
 }
예제 #10
0
  @Override
  protected void setUp() throws Exception {
    gen.clearAllTables();
    gen.hospitals();
    gen.hcp0();
    gen.patient1();
    gen.admin1();
    gen.officeVisit1();
    gen.ndCodes();

    action = new EditOfficeVisitAction(factory, 9000000001L, "1", "1");
  }
  /**
   * testDeletePatientInstructions
   *
   * @throws Exception
   */
  public void testDeletePatientInstructions() throws Exception {
    // Without an Office visit ID, this should throw.
    action = new EditPatientInstructionsAction(factory, 9000000000L, "2");
    try {
      action.deletePatientInstructions(bean);
      fail("Expected an exception.");
    } catch (ITrustException e) {
      assertEquals("Cannot perform action.  OfficeVisit is not saved.", e.getMessage());
    }

    // Try deleting patient specific instructions.
    gen.uc44_acceptance_scenario_2();
    action = new EditPatientInstructionsAction(factory, 9000000004L, "1", "44100");
    assertEquals(1, action.getPatientInstructions().size());
    bean.setId(44100);
    action.deletePatientInstructions(bean);
    assertEquals(0, action.getPatientInstructions().size());
  }
  /**
   * testValidate
   *
   * @throws Exception
   */
  public void testValidate() throws Exception {
    // Without an Office visit ID, this should throw.
    action = new EditPatientInstructionsAction(factory, 9000000000L, "2");
    try {
      action.validate(bean);
      fail("Expected an exception.");
    } catch (ITrustException e) {
      assertEquals("Cannot perform action.  OfficeVisit is not saved.", e.getMessage());
    }

    // Try validating patient specific instructions.
    gen.uc44_acceptance_scenario_2();
    action = new EditPatientInstructionsAction(factory, 9000000004L, "1", "44100");
    bean.setName("This is an instruction name.");
    bean.setComment("This is an instruction comment.");
    bean.setUrl("http://example.com/");
    bean.setVisitID(952);
    bean.setModified(new Date());
    try {
      action.validate(bean);
    } catch (FormValidationException e) {
      fail("Expected validation to succeed.");
    }
  }
예제 #13
0
 @Override
 protected void setUp() throws Exception {
   gen = new TestDataGenerator();
   gen.clearAllTables();
   gen.transactionLog();
 }
 protected void setUp() throws Exception {
   gen.clearAllTables();
   gen.standardData();
   allPatients = pDAO.getAllPatients();
 }
 @Override
 protected void setUp() throws Exception {
   gen = new TestDataGenerator();
   gen.clearAllTables();
   gen.labProcedures();
 }
 @Override
 protected void setUp() throws Exception {
   gen.clearAllTables();
   gen.patient2();
 }