Skip to content
Snippets Groups Projects
Commit 664aea92 authored by Matthew Williams's avatar Matthew Williams
Browse files

Merge branch 'UC92v2' of https://gitlab.engr.illinois.edu/htmoss2/cs427fa20team22 into UC92v2

parents c176b762 edfd743c
No related branches found
No related tags found
1 merge request!22Merge UC92 into Master
......@@ -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
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment