Question
I am having no luck with this. I have tried for two days to figure it out. Hoping someone can help. __________________________________________________________________________________________ package medical.com.medicalApplication.model; public
I am having no luck with this. I have tried for two days to figure it out. Hoping someone can help.
__________________________________________________________________________________________
package medical.com.medicalApplication.model;
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; } }
__________________________________________________________________________________________
package medical.com.medicalApplication.model;
import java.util.ArrayList; import java.util.List; public class PatientHistory {
private List
public PatientHistory() { this.treatments = new ArrayList
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
public List
public List
} __________________________________________________________________________________________
This is what I have for the JUnit Test. My test case for patient history works fine. I guess I am not clear how I can pass data into the patient history class from the medical records class?
package medical.com.medicalApplication.model;
import static org.junit.Assert.*;
import org.junit.Before; import org.junit.Test; import medical.com.medicalApplication.model.MedicalRecord; import medical.com.medicalApplication.model.Patient;
public class MedicalRecordTest2 {
MedicalRecord medicalRecord = new MedicalRecord(new Patient("John Jacob", "5544"));
@Test public void testMedicalRecordGetPatient(){ assertEquals(medicalRecord.getPatient().toString(), "Patient Name: John Jacob ID: 5544"); }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started