Question: A medical facility needs a system that keeps a record of each patient. Each record contains an integer identification of the patient and strings for
A medical facility needs a system that keeps a record of each patient. Each record contains an integer identification of the patient and strings for date of the visit, the reason of the visit, and the treatment prescribed. The system needs to provide three operations: Search for a patient at a specific date and return the record of this visit showing the reason of visit and the treatment if found. Find the total number of visits a specific patient made. Add a new record to the system specifying: the patient id date of visit, reason of visit, and the treatment. Your task is to design and implement a program for such system that allows performing the required operations search and insert efficiently. The program should read the initial records of the patients from a text file and stores them in the system. Each line in the text file represents a patient record ordered as follows: PatientId DateOfVisit ReasonOfVisit Treatment In addition to the operations described above, the program should allow the user to print the content of the text file and print all the patients records stored in the medical facility system. Check the sample output. Your program should accept the upperlower cases letter. You have the freedom to select the data structures and algorithm that you consider to be more efficient for this task, but you need to justify your choice. A full mark is only guaranteed if you choose the most efficient data structure for the requirements of the system. You might need to use the method Integer.parseInts to convert String s to integer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
