So I have a program that is going to run with priority queue once, and then simple queue. The program is based on a hospital determining what is the time someone can live without being on a er table, wait times, emptying tables, etc. We are going to assume that if that make it to the er table they will live. So I have completed most of it, but I just need some help in the final pieces. its honestly not that difficult, or not suppose to be but I am scratching my head at the end here. SO there are todo comments, and under those I have what I think is the correct code.
1) I want to make sure I did this correct. The todo says to do this only if the conditions are right, so I call getnewpatients to get the list of new patients, then it says to go through the triage queue which is created in the method. I cant call that out of a method, and since it returns a queue of patients I assume that I can just loop through the method.
2) I am not really sure what this is asking. if im just returning the count of waiting room or what?
3) So for this I
ant to check and see if the patient time has expired, and if so then add to the expiry count. I am just not sure of the if statement or what goes in there. I am mainly working out of 2 classes EmergencyRoom and Patient. Here are a description of the patient variables. Between these and whats in the emergencyRoom I am sot sure what to use.
• TimeToLive - minutes until it is too late for the patient to survive if not on an ER table
• TimeForProcedure - minutes to perform the procedure for this patient
• LastPossibleMoment - time (relative to hospital time) when this patient MUST be on an ER table
• IntakeTime - time entering waiting room; setting this value also adjusts the LastPossibleMoment based on the current time
• TimeEnteringER - time when patient is placed on an ER table
3a) if the patient time is not up then we add him to the er table, and set the time he made it to the er table. But I get errors on patient.timeenteringer, and my add patient method. timeenteringer says I need a object reference, and add patient does not like the patient I give it.