Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs427fa20team22
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
htmoss2
cs427fa20team22
Commits
3846322f
Commit
3846322f
authored
4 years ago
by
xuechen5
Browse files
Options
Downloads
Patches
Plain Diff
Backend: Add function to retrieve a list of pre-registered patients
parent
677b7bce
No related branches found
No related tags found
2 merge requests
!22
Merge UC92 into Master
,
!15
Merge 5-uc-92-activate-pre-registered-patient-2 into UC92v2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java
+54
-33
54 additions, 33 deletions
...csc/itrust/action/ViewPreRegisteredPatientListAction.java
with
54 additions
and
33 deletions
iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java
+
54
−
33
View file @
3846322f
...
...
@@ -4,7 +4,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Scanner
;
import
edu.ncsu.csc.itrust.Messages
;
import
edu.ncsu.csc.itrust.beans.OfficeVisitBean
;
import
edu.ncsu.csc.itrust.beans.PatientBean
;
import
edu.ncsu.csc.itrust.beans.PatientVisitBean
;
...
...
@@ -22,38 +21,60 @@ import edu.ncsu.csc.itrust.exception.ITrustException;
*
*/
public
class
ViewPreRegisteredPatientListAction
{
private
long
loggedInMID
;
private
PatientDAO
patientDAO
;
private
List
<
PatientBean
>
PreRegisteredPatients
;
private
long
loggedInMID
;
private
PatientDAO
patientDAO
;
private
PersonnelDAO
personnelDAO
;
/**
* Set up defaults
* @param factory The DAOFactory used to create the DAOs used in this action.
* @param loggedInMID The MID of the person viewing the office visits.
*/
public
ViewPreRegisteredPatientListAction
(
DAOFactory
factory
)
{
this
.
patientDAO
=
factory
.
getPatientDAO
();
}
/**
* Identify all the PreRegistered Patients from Patients Table using Users Table Role="PreRegistered", and add them to a list.
*
* @throws ITrustException
*/
public
List
<
PatientBean
>
getPreRegisteredPatients
()
throws
ITrustException
{
try
{
private
ArrayList
<
PatientBean
>
PreRegisteredPatients
;
PreRegisteredPatients
=
patientDAO
.
getAllPreRegisteredPatients
();
if
(
PreRegisteredPatients
!=
null
)
{
return
PreRegisteredPatients
;
}
else
{
throw
new
ITrustException
(
"getAllPreRegisteredPatients() has returned null"
);
}
/**
* Set up defaults
* @param factory The DAOFactory used to create the DAOs used in this action.
* @param loggedInMID The MID of the person viewing the office visits.
*/
public
ViewPreRegisteredPatientListAction
(
DAOFactory
factory
,
long
loggedInMID
)
{
this
.
loggedInMID
=
loggedInMID
;
this
.
personnelDAO
=
factory
.
getPersonnelDAO
();
this
.
patientDAO
=
factory
.
getPatientDAO
();
PreRegisteredPatients
=
new
ArrayList
<
PatientBean
>();
}
/**
* Identify all the PreRegistered Patients from Patients Table using Users Table Role="PreRegistered", and add them to a list.
*
* @throws ITrustException
*/
private
void
getPreRegisteredFromPatientsTable
()
throws
ITrustException
{
try
{
List
<
PatientBean
>
plist
=
patientDAO
.
getAllPreRegisteredPatients
();
}
catch
(
DBException
dbe
)
{
throw
new
ITrustException
(
dbe
.
getMessage
());
}
}
}
for
(
PatientBean
pb
:
plist
)
{
PreRegisteredPatients
.
add
(
pb
);
}
}
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment