CS 320 Final Project Module 7
cs320_final_project_code/medicalApplication/.classpath
cs320_final_project_code/medicalApplication/.DS_Store
cs320_final_project_code/medicalApplication/.project
medicalApplication org.eclipse.jdt.core.javabuilder org.eclipse.m2e.core.maven2Builder org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature
cs320_final_project_code/medicalApplication/.settings/org.eclipse.core.resources.prefs
eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/test/java=UTF-8 encoding/<project>=UTF-8
cs320_final_project_code/medicalApplication/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.8
cs320_final_project_code/medicalApplication/.settings/org.eclipse.m2e.core.prefs
activeProfiles= eclipse.preferences.version=1 resolveWorkspaceProjects=true version=1
cs320_final_project_code/medicalApplication/pom.xml
4.0.0 medical.com medicalApplication 0.0.1-SNAPSHOT jar medicalApplication http://maven.apache.org UTF-8 org.seleniumhq.selenium selenium-java 2.47.1 junit junit 4.10 test info.cukes cucumber-java 1.0.2 test
cs320_final_project_code/medicalApplication/src/.DS_Store
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/App.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/App.java
package
medical
.
com
.
medicalApplication
;
import
java
.
util
.
Arrays
;
import
java
.
util
.
List
;
import
java
.
util
.
Scanner
;
import
medical
.
com
.
medicalApplication
.
model
.
Employee
;
import
medical
.
com
.
medicalApplication
.
prompts
.
MedicalRecordPrompt
;
import
medical
.
com
.
medicalApplication
.
services
.
DoctorService
;
import
medical
.
com
.
medicalApplication
.
services
.
MedicalRescordService
;
import
medical
.
com
.
medicalApplication
.
util
.
MenuUtil
;
import
medical
.
com
.
medicalApplication
.
util
.
Pair
;
//Add duplicate doctors
//Adding medical records
//Find Allergies per patient
public
class
App
{
private
static
List
<
String
>
mainMenu
=
Arrays
.
asList
(
""
,
"Main Menu"
,
"Please select from the following options"
,
"1 Print Patient List"
,
"2 Print Doctor List"
,
"3 Add a Doctor"
,
"4 Add a Patient"
,
"5 Medical Records"
,
"6 Search for Allergies"
,
"0 to Exit"
);
public
static
void
main
(
String
[]
args
)
{
//Created for testing purposes password is "Open"
Employee
employee
=
new
Employee
(
"Mike"
,
"1111"
);
//Read console input
Scanner
scanner
=
new
Scanner
(
System
.
in
);
scanner
.
useDelimiter
(
System
.
getProperty
(
"line.separator"
));
int
passwordAttepts
=
3
;
String
password
=
null
;
boolean
loginSuccess
=
false
;
//Login
while
(
passwordAttepts
>
0
&&
!
loginSuccess
)
{
System
.
out
.
println
(
"Login Enter Password"
);
password
=
scanner
.
next
();
loginSuccess
=
employee
.
getPassword
().
equals
(
password
);
passwordAttepts
--
;
}
if
(
loginSuccess
)
{
MedicalRecordPrompt
medicalRecordPrompt
=
new
MedicalRecordPrompt
();
int
input
=
-
1
;
System
.
out
.
println
(
"Welcome to Mercy Hospitol System"
);
while
(
input
!=
0
)
{
mainMenu
.
stream
().
forEach
(
System
.
out
::
println
);
input
=
scanner
.
nextInt
();
switch
(
input
)
{
case
1
:
MedicalRescordService
.
getReference
().
getAllPatients
().
forEach
(
System
.
out
::
println
);
break
;
case
2
:
DoctorService
.
getReference
().
getAllDoctors
().
forEach
(
System
.
out
::
println
);
break
;
case
3
:
addPerson
(
true
,
scanner
);
break
;
case
4
:
addPerson
(
false
,
scanner
);
break
;
case
5
:
medicalRecordPrompt
.
mainPrompt
(
scanner
);
break
;
case
6
:
medicalRecordPrompt
.
findAllPatientsWithAllergy
(
scanner
).
forEach
(
System
.
out
::
println
);
break
;
case
0
:
System
.
out
.
println
(
"Good bye!"
);
break
;
default
:
break
;
}
}
scanner
.
close
();
}
else
{
System
.
out
.
println
(
"Invalid Password after 3 tries"
);
}
}
private
static
void
addPerson
(
boolean
addDoctor
,
Scanner
scanner
)
{
int
input
=
-
1
;
String
person
=
addDoctor
?
"Doctor"
:
"Patient"
;
while
(
input
!=
0
)
{
Pair
response
=
MenuUtil
.
createTwoItemMenu
(
scanner
,
"Enter Name:"
,
"Enter ID:"
);
boolean
personAdded
=
false
;
if
(
addDoctor
)
{
personAdded
=
DoctorService
.
getReference
().
addDoctor
(
response
.
getOne
(),
response
.
getTwo
());
}
else
{
personAdded
=
MedicalRescordService
.
getReference
().
addPatient
(
response
.
getOne
(),
response
.
getTwo
());
}
if
(
personAdded
)
{
System
.
out
.
println
(
person
+
" "
+
response
.
getOne
()
+
" was succesfully added\n"
);
}
else
{
System
.
out
.
println
(
person
+
" "
+
response
.
getOne
()
+
" Could not be added\n"
);
}
System
.
out
.
println
(
"Would you like to add another "
+
person
+
"?\n 1 for Yes\n 0 To return to the Main Menu"
);
input
=
scanner
.
nextInt
();
}
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Allergey.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Allergey.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
* This class represent the Allergy model in the application
*
*/
public
class
Allergey
{
private
String
name
;
public
Allergey
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
@
Override
public
String
toString
()
{
return
"Allergy "
+
name
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Doctor.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Doctor.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
* This class represents the Doctor data model in the system
*
*/
public
class
Doctor
{
private
String
name
;
private
String
id
;
public
Doctor
(
String
name
,
String
id
)
{
super
();
this
.
name
=
name
;
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@
Override
public
String
toString
()
{
return
"Doctor Name:"
+
name
+
" ID: "
+
id
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Employee.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Employee.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
* This class represents the employee model in the system
*
*/
public
class
Employee
{
private
String
name
;
private
String
id
;
private
String
password
;
public
Employee
(
String
name
,
String
id
)
{
super
();
this
.
name
=
name
;
this
.
id
=
id
;
this
.
password
=
"Open"
;
}
public
String
getName
()
{
return
name
;
}
public
String
getId
()
{
return
id
;
}
public
String
getPassword
()
{
return
password
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/MedicalRecord.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/MedicalRecord.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
*
* This class represents a medical record model in the system
*
*/
public
class
MedicalRecord
{
private
Patient
patient
;
private
PatientHistory
history
;
public
MedicalRecord
(
Patient
patient
)
{
super
();
this
.
patient
=
patient
;
this
.
history
=
new
PatientHistory
();
}
public
Patient
getPatient
()
{
return
patient
;
}
public
PatientHistory
getHistory
()
{
return
history
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Medication.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Medication.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
* This class represents the mediation model in the system
*
*/
public
class
Medication
{
private
String
name
;
private
String
startDate
;
private
String
endDate
;
private
String
dose
;
public
Medication
(
String
name
,
String
startDate
,
String
endDate
,
String
dose
)
{
super
();
this
.
name
=
name
;
this
.
startDate
=
startDate
;
this
.
endDate
=
endDate
;
this
.
dose
=
dose
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getStartDate
()
{
return
startDate
;
}
public
void
setStartDate
(
String
startDate
)
{
this
.
startDate
=
startDate
;
}
public
String
getEndDate
()
{
return
endDate
;
}
public
void
setEndDate
(
String
endDate
)
{
this
.
endDate
=
endDate
;
}
public
String
getDose
()
{
return
dose
;
}
public
void
setDose
(
String
dose
)
{
this
.
dose
=
dose
;
}
@
Override
public
String
toString
()
{
return
"Medication:"
+
name
+
" Start Date: "
+
startDate
+
" End Date: "
+
endDate
+
" Dose: "
+
dose
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Patient.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Patient.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
* This class represents a patient model in the system
*
*/
public
class
Patient
{
private
String
name
;
private
String
id
;
public
Patient
(
String
name
,
String
id
)
{
super
();
this
.
name
=
name
;
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@
Override
public
String
toString
()
{
return
"Patient Name: "
+
name
+
" ID: "
+
id
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/PatientHistory.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/PatientHistory.java
package
medical
.
com
.
medicalApplication
.
model
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
List
;
/**
*
* This class represents a patient history model in the system
*
*/
public
class
PatientHistory
{
private
List
<
Treatment
>
treatments
;
private
List
<
Medication
>
medications
;
private
List
<
Allergey
>
allergy
;
public
PatientHistory
()
{
this
.
treatments
=
new
ArrayList
<
Treatment
>
();
this
.
medications
=
new
ArrayList
<
Medication
>
();
this
.
allergy
=
new
ArrayList
<
Allergey
>
();
}
public
void
addTreatment
(
Treatment
treatment
)
{
treatments
.
add
(
treatment
);
}
public
void
addAllergy
(
Allergey
allegry
)
{
allergy
.
add
(
allegry
);
}
public
void
addMedication
(
Medication
medication
)
{
if
(
treatments
!=
null
){
medications
.
add
(
medication
);
}
}
public
List
<
Allergey
>
getAlergies
()
{
return
allergy
;
}
public
List
<
Treatment
>
getAllTreatments
()
{
return
treatments
;
}
public
List
<
Medication
>
getAllMedications
()
{
return
medications
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Treatment.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/model/Treatment.java
package
medical
.
com
.
medicalApplication
.
model
;
/**
*
* This class represents a treatment model in the system.
*
*/
public
class
Treatment
{
private
String
treatmentDate
;
private
String
diagnose
;
private
String
description
;
public
Treatment
(
String
treatmentDate
,
String
diagnose
,
String
description
)
{
super
();
this
.
treatmentDate
=
treatmentDate
;
this
.
diagnose
=
diagnose
;
this
.
description
=
description
;
}
public
String
getTreatmentDate
()
{
return
treatmentDate
;
}
public
void
setTreatmentDate
(
String
treatmentDate
)
{
this
.
treatmentDate
=
treatmentDate
;
}
public
String
getDiagnose
()
{
return
diagnose
;
}
public
void
setDiagnose
(
String
diagnose
)
{
this
.
diagnose
=
diagnose
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
@
Override
public
String
toString
()
{
return
"Treatment: "
+
" Date: "
+
treatmentDate
+
" Diagnose: "
+
diagnose
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/prompts/MedicalRecordPrompt.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/prompts/MedicalRecordPrompt.java
package
medical
.
com
.
medicalApplication
.
prompts
;
import
java
.
util
.
Arrays
;
import
java
.
util
.
List
;
import
java
.
util
.
Scanner
;
import
medical
.
com
.
medicalApplication
.
model
.
Allergey
;
import
medical
.
com
.
medicalApplication
.
model
.
MedicalRecord
;
import
medical
.
com
.
medicalApplication
.
model
.
Medication
;
import
medical
.
com
.
medicalApplication
.
model
.
Patient
;
import
medical
.
com
.
medicalApplication
.
model
.
Treatment
;
import
medical
.
com
.
medicalApplication
.
services
.
MedicalRescordService
;
/**
*
* This class creates the prompts for the medical application
*
*/
public
class
MedicalRecordPrompt
{
private
static
List
<
String
>
prompt
=
Arrays
.
asList
(
""
,
"Medical Record Menu"
,
"1 Add a Treatment"
,
"2 Add a Medication"
,
"3 Print Patient's Treatments"
,
"4 Print Patient's Medications"
,
"5 Add Allergy"
,
"6 Print Allergies"
,
"0 Main Menu"
);
public
void
mainPrompt
(
Scanner
scanner
)
{
int
input
=
-
1
;
System
.
out
.
println
(
"Enter Patient ID:"
);
String
patientId
=
scanner
.
next
();
Patient
patient
=
MedicalRescordService
.
getReference
().
getPatient
(
patientId
);
if
(
patient
!=
null
)
{
while
(
input
!=
0
)
{
System
.
out
.
println
(
"Patient: "
+
patient
.
getName
());
prompt
.
stream
().
forEach
(
System
.
out
::
println
);
input
=
scanner
.
nextInt
();
switch
(
input
)
{
case
1
:
addTreatment
(
scanner
,
patient
.
getId
());
break
;
case
2
:
addMedication
(
scanner
,
patient
.
getId
());
break
;
case
3
:
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
).
getHistory
().
getAllTreatments
()
.
forEach
(
System
.
out
::
println
);
break
;
case
4
:
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
).
getHistory
().
getAllMedications
()
.
forEach
(
System
.
out
::
println
);
break
;
case
5
:
addAllergy
(
scanner
,
patient
.
getId
());
break
;
case
6
:
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
).
getHistory
().
getAlergies
()
.
forEach
(
System
.
out
::
println
);
break
;
case
0
:
break
;
default
:
break
;
}
}
}
else
{
System
.
out
.
println
(
"Patient with that ID could not be found"
);
}
}
private
void
addAllergy
(
Scanner
scanner
,
String
patientId
)
{
int
input
=
-
1
;
while
(
input
!=
0
)
{
System
.
out
.
println
(
"Enter Allergy:"
);
String
allergyName
=
scanner
.
next
();
Allergey
allergy
=
new
Allergey
(
allergyName
);
MedicalRecord
medicalRecord
=
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
);
if
(
medicalRecord
!=
null
)
{
medicalRecord
.
getHistory
().
addAllergy
(
allergy
);
}
else
{
System
.
err
.
println
(
"Error! Medical Record is null"
);
}
System
.
out
.
println
(
"Would you like to add another Allergy?\n 1 for Yes\n 0 To return to the Medical Record Menu"
);
input
=
scanner
.
nextInt
();
}
}
public
void
addTreatment
(
Scanner
scanner
,
String
patientId
)
{
int
input
=
-
1
;
while
(
input
!=
0
)
{
System
.
out
.
println
(
"Enter the treatment date:"
);
String
treatmentDate
=
scanner
.
next
();
System
.
out
.
println
(
"Enter diagnose:"
);
String
diagnose
=
scanner
.
next
();
System
.
out
.
println
(
"Enter description:"
);
String
description
=
scanner
.
next
();
Treatment
treatment
=
new
Treatment
(
treatmentDate
,
diagnose
,
description
);
MedicalRecord
medicalRecord
=
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
);
if
(
medicalRecord
!=
null
)
{
medicalRecord
.
getHistory
().
addTreatment
(
treatment
);
}
else
{
System
.
err
.
println
(
"Error! Medical Record is null"
);
}
System
.
out
.
println
(
"Would you like to add another Treatment?\n 1 for Yes\n 0 To return to the Medical Record Menu"
);
input
=
scanner
.
nextInt
();
}
}
public
List
<
Patient
>
findAllPatientsWithAllergy
(
Scanner
scanner
){
System
.
out
.
println
(
"Enter Allergy:"
);
String
allergy
=
scanner
.
next
();
return
MedicalRescordService
.
getReference
().
getPatientsWithAllergies
(
allergy
);
}
public
void
addMedication
(
Scanner
scanner
,
String
patientId
)
{
int
input
=
-
1
;
while
(
input
!=
0
)
{
System
.
out
.
println
(
"Enter medication name:"
);
String
name
=
scanner
.
next
();
System
.
out
.
println
(
"Enter startDate:"
);
String
startDate
=
scanner
.
next
();
System
.
out
.
println
(
"Enter endDate:"
);
String
endDate
=
scanner
.
next
();
System
.
out
.
println
(
"Enter dose:"
);
String
dose
=
scanner
.
next
();
Medication
medication
=
new
Medication
(
name
,
startDate
,
endDate
,
dose
);
MedicalRecord
medicalRecord
=
MedicalRescordService
.
getReference
().
getMedicalRecord
(
patientId
);
if
(
medicalRecord
!=
null
)
{
medicalRecord
.
getHistory
().
addMedication
(
medication
);
}
else
{
System
.
err
.
println
(
"Error! Medical Record is null"
);
}
System
.
out
.
println
(
"Would you like to add another Medication?\n 1 for Yes\n 0 To return to the Medical Record Menu"
);
input
=
scanner
.
nextInt
();
}
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/services/DoctorService.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/services/DoctorService.java
package
medical
.
com
.
medicalApplication
.
services
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
List
;
import
medical
.
com
.
medicalApplication
.
model
.
Doctor
;
/**
*
* This class uses a singleton pattern to mock a service instead of using dependency injection
*
* In addition, it stores data in memory only using Lists
*
*/
public
class
DoctorService
{
private
static
DoctorService
reference
=
new
DoctorService
();
private
static
List
<
Doctor
>
doctors
;
DoctorService
(){
doctors
=
new
ArrayList
<
Doctor
>
();
}
public
static
DoctorService
getReference
(){
return
reference
;
}
public
List
<
Doctor
>
getAllDoctors
(){
return
doctors
;
}
public
boolean
addDoctor
(
String
name
,
String
id
){
String
tempId
=
new
String
(
id
);
boolean
createDoctor
=
!
doctors
.
stream
().
anyMatch
(
doctor
->
doctor
.
getId
()
==
tempId
);
if
(
createDoctor
)
{
doctors
.
add
(
new
Doctor
(
name
,
id
));
}
return
createDoctor
;
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/services/MedicalRescordService.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/services/MedicalRescordService.java
package
medical
.
com
.
medicalApplication
.
services
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
Collections
;
import
java
.
util
.
List
;
import
medical
.
com
.
medicalApplication
.
model
.
MedicalRecord
;
import
medical
.
com
.
medicalApplication
.
model
.
Patient
;
/**
*
* This class uses a singleton pattern to mock a service instead of using dependency injection
*
* In addition, it stores data in memory only using Lists
*
*/
public
class
MedicalRescordService
{
private
static
MedicalRescordService
reference
=
new
MedicalRescordService
();
private
List
<
Patient
>
patients
;
private
List
<
MedicalRecord
>
medicalRecords
;
public
static
MedicalRescordService
getReference
()
{
return
reference
;
}
MedicalRescordService
()
{
this
.
patients
=
new
ArrayList
<
Patient
>
();
this
.
medicalRecords
=
new
ArrayList
<
MedicalRecord
>
();
}
public
boolean
addPatient
(
String
name
,
String
id
)
{
boolean
patientAdded
=
!
patients
.
stream
()
.
anyMatch
(
patient
->
patient
.
getId
().
equals
(
id
));
if
(
patientAdded
)
{
Patient
newPatient
=
new
Patient
(
name
,
id
);
patients
.
add
(
newPatient
);
medicalRecords
.
add
(
new
MedicalRecord
(
newPatient
));
}
return
patientAdded
;
}
public
MedicalRecord
getMedicalRecord
(
String
patientId
)
{
return
medicalRecords
.
stream
()
.
filter
(
medicalRecord
->
medicalRecord
.
getPatient
().
getId
().
equals
(
patientId
)).
findFirst
().
get
();
}
public
Patient
getPatient
(
String
patientId
)
{
return
patients
.
stream
().
filter
(
person
->
person
.
getId
().
equals
(
patientId
))
.
findFirst
().
get
();
}
public
List
<
Patient
>
getAllPatients
()
{
return
patients
;
}
public
List
<
Patient
>
getPatientsWithAllergies
(
String
allergyName
){
for
(
Patient
patient
:
getAllPatients
()){
if
(
getMedicalRecord
(
patient
.
getId
()).
getHistory
().
getAlergies
().
stream
().
filter
(
allergy
->
allergy
.
getName
().
equals
(
allergyName
)).
findFirst
().
get
()
!=
null
){
return
Collections
.
singletonList
(
patient
);
}
}
return
Collections
.
emptyList
();
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/util/MenuUtil.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/util/MenuUtil.java
package
medical
.
com
.
medicalApplication
.
util
;
import
java
.
util
.
Scanner
;
/**
*
* This class creates menu prompts based on prompt one and prompt two
*
*/
public
class
MenuUtil
{
public
static
Pair
createTwoItemMenu
(
Scanner
scanner
,
String
promptOne
,
String
promptTwo
)
{
System
.
out
.
println
(
promptOne
);
String
one
=
scanner
.
next
();
System
.
out
.
println
(
promptTwo
);
String
two
=
scanner
.
next
();
return
new
Pair
(
one
,
two
);
}
}
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/util/Pair.java
cs320_final_project_code/medicalApplication/src/main/java/medical/com/medicalApplication/util/Pair.java
package
medical
.
com
.
medicalApplication
.
util
;
/**
*
*This class is used as a utility class to return two string objects
*
*/
public
class
Pair
{
private
String
one
;
private
String
two
;
public
Pair
(
String
one
,
String
two
)
{
super
();
this
.
one
=
one
;
this
.
two
=
two
;
}
public
String
getOne
()
{
return
one
;
}
public
void
setOne
(
String
one
)
{
this
.
one
=
one
;
}
public
String
getTwo
()
{
return
two
;
}
public
void
setTwo
(
String
two
)
{
this
.
two
=
two
;
}
}
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/App.class
package medical.com.medicalApplication; public synchronized class App { private static java.util.List mainMenu; static void <clinit>(); public void App(); public static void main(String[]); private static void addPerson(boolean, java.util.Scanner); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Allergey.class
package medical.com.medicalApplication.model; public synchronized class Allergey { private String name; public void Allergey(String); public String getName(); public void setName(String); public String toString(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Doctor.class
package medical.com.medicalApplication.model; public synchronized class Doctor { private String name; private String id; public void Doctor(String, String); public String getName(); public void setName(String); public String getId(); public void setId(String); public String toString(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Employee.class
package medical.com.medicalApplication.model; public synchronized class Employee { private String name; private String id; private String password; public void Employee(String, String); public String getName(); public String getId(); public String getPassword(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/MedicalRecord.class
package medical.com.medicalApplication.model; public synchronized class MedicalRecord { private Patient patient; private PatientHistory history; public void MedicalRecord(Patient); public Patient getPatient(); public PatientHistory getHistory(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Medication.class
package medical.com.medicalApplication.model; public synchronized class Medication { private String name; private String startDate; private String endDate; private String dose; public void Medication(String, String, String, String); public String getName(); public void setName(String); public String getStartDate(); public void setStartDate(String); public String getEndDate(); public void setEndDate(String); public String getDose(); public void setDose(String); public String toString(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Patient.class
package medical.com.medicalApplication.model; public synchronized class Patient { private String name; private String id; public void Patient(String, String); public String getName(); public void setName(String); public String getId(); public void setId(String); public String toString(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/PatientHistory.class
package medical.com.medicalApplication.model; public synchronized class PatientHistory { private java.util.List treatments; private java.util.List medications; private java.util.List allergy; public void PatientHistory(); public void addTreatment(Treatment); public void addAllergy(Allergey); public void addMedication(Medication); public java.util.List getAlergies(); public java.util.List getAllTreatments(); public java.util.List getAllMedications(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/model/Treatment.class
package medical.com.medicalApplication.model; public synchronized class Treatment { private String treatmentDate; private String diagnose; private String description; public void Treatment(String, String, String); public String getTreatmentDate(); public void setTreatmentDate(String); public String getDiagnose(); public void setDiagnose(String); public String getDescription(); public void setDescription(String); public String toString(); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/prompts/MedicalRecordPrompt.class
package medical.com.medicalApplication.prompts; public synchronized class MedicalRecordPrompt { private static java.util.List prompt; static void <clinit>(); public void MedicalRecordPrompt(); public void mainPrompt(java.util.Scanner); private void addAllergy(java.util.Scanner, String); public void addTreatment(java.util.Scanner, String); public java.util.List findAllPatientsWithAllergy(java.util.Scanner); public void addMedication(java.util.Scanner, String); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/services/DoctorService.class
package medical.com.medicalApplication.services; public synchronized class DoctorService { private static DoctorService reference; private static java.util.List doctors; static void <clinit>(); void DoctorService(); public static DoctorService getReference(); public java.util.List getAllDoctors(); public boolean addDoctor(String, String); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/services/MedicalRescordService.class
package medical.com.medicalApplication.services; public synchronized class MedicalRescordService { private static MedicalRescordService reference; private java.util.List patients; private java.util.List medicalRecords; static void <clinit>(); public static MedicalRescordService getReference(); void MedicalRescordService(); public boolean addPatient(String, String); public medical.com.medicalApplication.model.MedicalRecord getMedicalRecord(String); public medical.com.medicalApplication.model.Patient getPatient(String); public java.util.List getAllPatients(); public java.util.List getPatientsWithAllergies(String); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/util/MenuUtil.class
package medical.com.medicalApplication.util; public synchronized class MenuUtil { public void MenuUtil(); public static Pair createTwoItemMenu(java.util.Scanner, String, String); }
cs320_final_project_code/medicalApplication/target/classes/medical/com/medicalApplication/util/Pair.class
package medical.com.medicalApplication.util; public synchronized class Pair { private String one; private String two; public void Pair(String, String); public String getOne(); public void setOne(String); public String getTwo(); public void setTwo(String); }
cs320_final_project_code/medicalApplication/target/classes/META-INF/MANIFEST.MF
Manifest-Version: 1.0 Built-By: jeffphillips Build-Jdk: 1.8.0_73 Created-By: Maven Integration for Eclipse
cs320_final_project_code/medicalApplication/target/classes/META-INF/maven/medical.com/medicalApplication/pom.properties
#Generated by Maven Integration for Eclipse #Mon Jan 30 20:23:57 MST 2017 version=0.0.1-SNAPSHOT groupId=medical.com m2e.projectName=medicalApplication m2e.projectLocation=/Users/jeffphillips/Documents/workspace-sts-3.7.3.RELEASE/medicalApplication artifactId=medicalApplication
cs320_final_project_code/medicalApplication/target/classes/META-INF/maven/medical.com/medicalApplication/pom.xml
4.0.0 medical.com medicalApplication 0.0.1-SNAPSHOT jar medicalApplication http://maven.apache.org UTF-8 org.seleniumhq.selenium selenium-java 2.47.1 junit junit 4.10 test info.cukes cucumber-java 1.0.2 test
cs320_final_project_code/medicalApplication/target/maven-archiver/pom.properties
#Generated by Maven #Mon Jan 30 20:11:13 MST 2017 version=0.0.1-SNAPSHOT groupId=medical.com artifactId=medicalApplication
cs320_final_project_code/medicalApplication/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
medical/com/medicalApplication/App.class
cs320_final_project_code/medicalApplication/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
/Users/jeffphillips/Documents/workspace-sts-3.7.3.RELEASE/medicalApplication/src/main/java/medical/com/medicalApplication/App.java
cs320_final_project_code/medicalApplication/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
medical/com/medicalApplication/AppTest.class
cs320_final_project_code/medicalApplication/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
/Users/jeffphillips/Documents/workspace-sts-3.7.3.RELEASE/medicalApplication/src/test/java/medical/com/medicalApplication/AppTest.java
cs320_final_project_code/medicalApplication/target/medicalApplication-0.0.1-SNAPSHOT.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Built-By: jeffphillips Created-By: Apache Maven 3.3.9 Build-Jdk: 1.8.0_73
medical/com/medicalApplication/App.class
package medical.com.medicalApplication; public synchronized class App { public void App(); public static void main(String[]); }
META-INF/maven/medical.com/medicalApplication/pom.xml
4.0.0 medical.com medicalApplication 0.0.1-SNAPSHOT jar medicalApplication http://maven.apache.org UTF-8 org.seleniumhq.selenium selenium-java 2.47.1 junit junit 4.10 test info.cukes cucumber-java 1.0.2 test
META-INF/maven/medical.com/medicalApplication/pom.properties
#Generated by Maven #Mon Jan 30 20:11:13 MST 2017 version=0.0.1-SNAPSHOT groupId=medical.com artifactId=medicalApplication
cs320_final_project_code/medicalApplication/target/surefire-reports/medical.com.medicalApplication.AppTest.txt
------------------------------------------------------------------------------- Test set: medical.com.medicalApplication.AppTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec
cs320_final_project_code/medicalApplication/target/surefire-reports/TEST-medical.com.medicalApplication.AppTest.xml