I've been trying to get this done for days and the deadline is tomorrow...
The patients who are registered at the Smiley GoodDoctors practice can see any of the specialists. The practice keeps track of patients, doctors, and visits by patients to doctors in three text files. When the patient information system is booted up, it initializes itself by loading information from these files. Then, it present a menu based interface to the front desk staff. Staff can add patients, doctors, and record visits. They can also list visit information in various ways, and confirm appointments. When the system is shut down, all new doctors, patients, and visits are written into the text files so that they will be in the system.
The format for the patient file is as follows Fname|Lname|ssn|city|state
The format for the doctor file is Fname|Lname|npi|specialty
The format for the visit file is Patientssn|npi|date
Note: NPI refers to National Provider ID, which is a 10 digit number that identifies all health providers for insurance purposes. Sample data files are provided with the assignment, but you should add additional records for testing.
The functionality provided in the menu system should be as follows: Add a patient Add a doctor Add a visit
List all visits on a given date. The display should show patient name and ssn, provider name and specialty, and the date. The display should be sorted by provider name.
List all visits for a patient. The display should show provider name, specialty, and the date. The display should be sorted by date.
List all visits for a provider. The display should show patient name, ssn, and the date. The display should be sorted by patient last name.
Confirm if a particular patient has or had an appointment with a particular doctor on a given date.
please help!
the Patient, doctor, and visit classes are completely finished I'm just struggling with the menu system and the menu itself and I have been lost completely
import java.io.*; import java.util.*; public class MenuSystem { private ArrayList<Patient> patients; private ArrayList<Visit> visits; private ArrayList<Doctor> physicians; public MenuSystem() { patients = new ArrayList<Patient>(); visits = new ArrayList<Visit>(); physicians = new ArrayList<Doctor>(); } public void writePatient() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream("Patients.txt")); os.writeObject(patients); os.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void readPatient() { try{ ObjectInputStream is = new ObjectInputStream(new FileInputStream("Patients.txt")); Patient p = (Patient) is.readObject(); System.out.print(p.toString()); is.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch(ClassNotFoundException e){ e.printStackTrace(); } } public void addPatient(Patient name) { patients.add(name); } public void addPhysician(Doctor physician) { physicians.add(physician); } public void addVisit(Visit visit) { visits.add(visit); } }