This document outlines a test plan for a medical record system (MRS) that allows users to log in, add doctors and patients, add medical records with treatments, medications, and allergies, and search for patients by allergy. It defines the following features that must be tested: user login, adding doctors and ensuring unique IDs, adding medical records which includes creating associated patient history and relationships between treatments, medications, and allergies. The roles are a software developer who will perform unit testing. The testing level is unit testing and the deliverable will be a zip file containing all JUnit tests.
7. if(personAdded){
System.out.println(person +" "+ response.getOne()+" was succe
sfully addedn");
}else{
System.out.println(person +" "+ response.getOne()+" Could not
be addedn");
}
System.out.println(
"Would you like to add another "+ person +"?n 1 for Yesn 0 T
o return to the Main Menu");
input = scanner.nextInt();
}
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Allergey.javacs320_final_
project_code/medicalApplication/src/main/java/medical/com/me
dicalApplication/model/Allergey.javapackage medical.com.medi
calApplication.model;
/**
* This class represent the Allergy model in the application
*
*/
publicclassAllergey{
privateString name;
publicAllergey(String name){
this.name = name;
}
publicString getName(){
return name;
}
8. publicvoid setName(String name){
this.name = name;
}
@Override
publicString toString(){
return"Allergy "+ name;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Doctor.javacs320_final_pr
oject_code/medicalApplication/src/main/java/medical/com/medi
calApplication/model/Doctor.javapackage medical.com.medical
Application.model;
/**
*
* This class represents the Doctor data model in the system
*
*/
publicclassDoctor{
privateString name;
privateString id;
publicDoctor(String name,String id){
super();
this.name = name;
this.id = id;
}
publicString getName(){
return name;
}
publicvoid setName(String name){
9. this.name = name;
}
publicString getId(){
return id;
}
publicvoid setId(String id){
this.id = id;
}
@Override
publicString toString(){
return"Doctor Name:"+ name +" ID: "+id;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Employee.javacs320_final
_project_code/medicalApplication/src/main/java/medical/com/m
edicalApplication/model/Employee.javapackage medical.com.m
edicalApplication.model;
/**
*
* This class represents the employee model in the system
*
*/
publicclassEmployee{
privateString name;
privateString id;
privateString password;
publicEmployee(String name,String id){
super();
this.name = name;
this.id = id;
this.password ="Open";
}
10. publicString getName(){
return name;
}
publicString getId(){
return id;
}
publicString getPassword(){
return password;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/MedicalRecord.javacs320_
final_project_code/medicalApplication/src/main/java/medical/c
om/medicalApplication/model/MedicalRecord.javapackage medi
cal.com.medicalApplication.model;
/**
*
*
* This class represents a medical record model in the system
*
*/
publicclassMedicalRecord{
privatePatient patient;
privatePatientHistory history;
publicMedicalRecord(Patient patient){
super();
this.patient = patient;
11. this.history =newPatientHistory();
}
publicPatient getPatient(){
return patient;
}
publicPatientHistory getHistory(){
return history;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Medication.javacs320_fina
l_project_code/medicalApplication/src/main/java/medical/com/
medicalApplication/model/Medication.javapackage medical.com
.medicalApplication.model;
/**
*
* This class represents the mediation model in the system
*
*/
publicclassMedication{
privateString name;
privateString startDate;
privateString endDate;
privateString dose;
publicMedication(String name,String startDate,String endDate,S
tring dose){
super();
this.name = name;
this.startDate = startDate;
17. add a doctor to the list of doctors. Doctors’ names do not have
to be unique, but
doctors’ IDs should be unique.
allow the user to add a
medical record to a patient.
i. Add a patient.
ii. Add a medical record with treatments, medications, and
allergies.
o When you create a medical record, it is necessary to create a
patient
history, which will contain 1 to many treatments, 1 to many
medications,
and 1 to many allergies. Medications cannot be assigned to a
patient
history unless there has been a treatment first.
the user to search for
allergies and print all patients with allergies.
II. Roles: The software developer will perform unit tests.
III. Testing levels
i. Unit testing
IV. Testing artifacts: The deliverable for this project will be a
zip file containing all the JUnit tests.
cs320_final_project_code/medicalApplication/.classpath
23. case0:
System.out.println("Good bye!");
break;
default:
break;
}
}
scanner.close();
}else{
System.out.println("Invalid Password after 3 tries");
}
}
privatestaticvoid addPerson(boolean addDoctor,Scanner scanner
){
int input =-1;
String person = addDoctor ?"Doctor":"Patient";
while(input !=0){
Pair response =MenuUtil.createTwoItemMenu(scanner,"Enter N
ame:","Enter ID:");
boolean personAdded =false;
if(addDoctor){
personAdded =DoctorService.getReference().addDoct
or(response.getOne(), response.getTwo());
}else{
personAdded =MedicalRescordService.getReference(
).addPatient(response.getOne(), response.getTwo());
}
if(personAdded){
System.out.println(person +" "+ response.getOne()+" was succe
sfully addedn");
}else{
System.out.println(person +" "+ response.getOne()+" Could not
24. be addedn");
}
System.out.println(
"Would you like to add another "+ person +"?n 1 for Yesn 0 T
o return to the Main Menu");
input = scanner.nextInt();
}
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Allergey.javacs320_final_
project_code/medicalApplication/src/main/java/medical/com/me
dicalApplication/model/Allergey.javapackage medical.com.medi
calApplication.model;
/**
* This class represent the Allergy model in the application
*
*/
publicclassAllergey{
privateString name;
publicAllergey(String name){
this.name = name;
}
publicString getName(){
return name;
}
publicvoid setName(String name){
this.name = name;
}
25. @Override
publicString toString(){
return"Allergy "+ name;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Doctor.javacs320_final_pr
oject_code/medicalApplication/src/main/java/medical/com/medi
calApplication/model/Doctor.javapackage medical.com.medical
Application.model;
/**
*
* This class represents the Doctor data model in the system
*
*/
publicclassDoctor{
privateString name;
privateString id;
publicDoctor(String name,String id){
super();
this.name = name;
this.id = id;
}
publicString getName(){
return name;
}
publicvoid setName(String name){
this.name = name;
}
publicString getId(){
return id;
}
26. publicvoid setId(String id){
this.id = id;
}
@Override
publicString toString(){
return"Doctor Name:"+ name +" ID: "+id;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/Employee.javacs320_final
_project_code/medicalApplication/src/main/java/medical/com/m
edicalApplication/model/Employee.javapackage medical.com.m
edicalApplication.model;
/**
*
* This class represents the employee model in the system
*
*/
publicclassEmployee{
privateString name;
privateString id;
privateString password;
publicEmployee(String name,String id){
super();
this.name = name;
this.id = id;
this.password ="Open";
}
publicString getName(){
return name;
}
27. publicString getId(){
return id;
}
publicString getPassword(){
return password;
}
}
cs320_final_project_code/medicalApplication/src/main/java/me
dical/com/medicalApplication/model/MedicalRecord.javacs320_
final_project_code/medicalApplication/src/main/java/medical/c
om/medicalApplication/model/MedicalRecord.javapackage medi
cal.com.medicalApplication.model;
/**
*
*
* This class represents a medical record model in the system
*
*/
publicclassMedicalRecord{
privatePatient patient;
privatePatientHistory history;
publicMedicalRecord(Patient patient){
super();
this.patient = patient;
this.history =newPatientHistory();
}
publicPatient getPatient(){
return patient;
33. *
* This class represents a treatment model in the system.
*
*/
publicclassTreatment{
privateString treatmentDate;
privateString diagnose;
privateString description;
publicTreatment(String treatmentDate,String diagnose,String de
scription){
super();
this.treatmentDate = treatmentDate;
…