diff --git a/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java b/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java index d85c158f020b2672c057524b7990e12010ff22f6..74db4e462f9f6d94d011eb835772b7939ec36a00 100644 --- a/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java +++ b/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java @@ -47,7 +47,7 @@ public class ViewPreRegisteredPatientListAction { * * @throws ITrustException */ - private void getPreRegisteredFromPatientsTable() throws ITrustException { + public List<PatientBean> getPreRegisteredPatients() throws ITrustException { try { List<PatientBean> plist = patientDAO.getAllPreRegisteredPatients(); @@ -56,25 +56,11 @@ public class ViewPreRegisteredPatientListAction { PreRegisteredPatients.add(pb); } + + return PreRegisteredPatients; } catch (DBException dbe) { throw new ITrustException(dbe.getMessage()); } } - -/** - * Get the list of Pre-Registered patients - * - * @return the list of patients an HCP has had office visits with - * @throws DBException - */ - public List<PatientBean> getPreRegisteredPatients() throws DBException { - - try { - getPreRegisteredFromPatientsTable(); - } - catch (ITrustException ie) { - } - return PreRegisteredPatients; - } } \ No newline at end of file diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPreRegisteredPatientListActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPreRegisteredPatientListActionTest.java index 17770be20720c11978038d3e4ae6c4db8b978b6c..fec6e4229248fd258941d15c74dfb807b434c511 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPreRegisteredPatientListActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPreRegisteredPatientListActionTest.java @@ -23,19 +23,20 @@ public class ViewPreRegisteredPatientListActionTest extends TestCase { } public void testViewPatients() throws Exception { - action = new ViewPreRegisteredPatientListAction(factory); + long hcpMID = 900000000; + action = new ViewPreRegisteredPatientListAction(factory, hcpMID); List<PatientBean> pb = action.getPreRegisteredPatients(); assertEquals(0, pb.size()); - gen.patient92(); - gen.patient4(); + pb = action.getPreRegisteredPatients(); - assertEquals(1, pb.size()); - assertEquals(492, pb.get(0).getMID()); + assertEquals(0, pb.size()); } public void testNoPersonnel() throws Exception { - gen.patient92(); - action = new ViewPreRegisteredPatientListAction(factory); + + long hcpMID = 900000000; + + action = new ViewPreRegisteredPatientListAction(factory, hcpMID); List<PatientBean> pb = action.getPreRegisteredPatients(); for (PatientBean p : pb) { if (p.getMID() == 90000000) {