Recent disasters (e.g., hurricanes, wildfires, earthquakes) and attacks (e.g., shooting) can suddenly increase the num- ber of patients seeking help at emergency rooms. Emergency rooms have plans to prepare for the influx. How do I design a system that can handle the influx efficiently in java? The goal for this task is to design and implement a system that can efficiently handle the influx of patients at an emergency room. One plan is to triage patients, where patients are prior- itized by their level of severity. Some patients might need to be treated immediately, while some others can be delayed. Consider Emergency Severity Index (ESI) that ranges from 1 (resusitation) to 5 (nonurgent). For simplicity, the number of minutes needed for a doctor to treat a patient is 2^(7−esi). Initially, the emergency room has two available doctors (Alice and Bob) and two nurses (Nancy, Oliver), more doctors may arrive and become available. Furthermore, assume the patient departs after treatment (discharged or admitted to the hospi- tal for further treatment). A patient might also depart after treatment from a nurse instead of a doctor. If a doctor is NOT available, a nurse can treat a patient with ESI of 5 (nonurgent) for 10 minutes and the patient departs. A nurse cannot treat a patient with ESI smaller than 5. When two patients have the same ESI, the patient who arrives earlier will be treated first. Time stamps are unique. To efficiently decide which patient each doctor is going to treat, how do I implement a priority queue using a HeapPriorityQueue class? Sample input and output are provided. Input: • PatientArrives time patient esi • PatientDepartsAfterNurseTreatment time patient • DoctorArrives time doctor time is in HHMM format, where HH ranges from 00 to 23 and MM ranges from 00 to 59 (leading zeros are optional). Output: • PatientArrives time patient esi • PatientDepartsAfterNurseTreatment time patient • DoctorArrives time doctor • DoctorStartsTreatingPatient time doctor patient • DoctorFinishesTreatmentAndPatientDeparts time doctor patien
Recent disasters (e.g., hurricanes, wildfires, earthquakes)
and attacks (e.g., shooting) can suddenly increase the num-
ber of patients seeking help at emergency rooms. Emergency
rooms have plans to prepare for the influx. How do I
design a system that can handle the influx efficiently in java?
The goal for this task is to design and implement a system that
can efficiently handle the influx of patients at an emergency
room. One plan is to triage patients, where patients are prior-
itized by their level of severity. Some patients might need to
be treated immediately, while some others can be delayed.
Consider Emergency Severity Index (ESI) that ranges from
1 (resusitation) to 5 (nonurgent). For simplicity, the number
of minutes needed for a doctor to treat a patient is 2^(7−esi).
Initially, the emergency room has two available doctors (Alice
and Bob) and two nurses (Nancy, Oliver), more doctors may
arrive and become available. Furthermore, assume the patient
departs after treatment (discharged or admitted to the hospi-
tal for further treatment). A patient might also depart after
treatment from a nurse instead of a doctor. If a doctor is NOT
available, a nurse can treat a patient with ESI of 5 (nonurgent)
for 10 minutes and the patient departs. A nurse cannot treat
a patient with ESI smaller than 5. When two patients have
the same ESI, the patient who arrives earlier will be treated
first. Time stamps are unique.
To efficiently decide which patient each doctor is going
to treat, how do I implement a priority queue using a HeapPriorityQueue class?
Sample input and output are provided.
Input:
• PatientArrives time patient esi
• PatientDepartsAfterNurseTreatment time patient
• DoctorArrives time doctor
time is in HHMM format, where HH ranges from 00 to 23 and
MM ranges from 00 to 59 (leading zeros are optional).
Output:
• PatientArrives time patient esi
• PatientDepartsAfterNurseTreatment time patient
• DoctorArrives time doctor
• DoctorStartsTreatingPatient time doctor patient
• DoctorFinishesTreatmentAndPatientDeparts time doctor
patien
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images