Example #1
0
        } // end of CreateOutpatientTreatmentPath

        #endregion

        #region GetNextWaitingListPatient

        /// <summary>
        /// Stream of patients arriving at the waiting list , for this example exponential interarrival time
        /// and patients arrive 24/7
        /// </summary>
        /// <param name="arrivalTime">Arrival time of next patient</param>
        /// <param name="admission">Admission type of next patient</param>
        /// <param name="parentControlUnit">Control unit of outpatient department</param>
        /// <param name="currentTime">Current time</param>
        /// <returns>Next patient with associated patient class</returns>
        public EntityPatient GetNextWaitingListPatient(out DateTime arrivalTime, out Admission admission, ControlUnit parentControlUnit, DateTime currentTime)
        {
            PatientClass newPatientClass = (PatientClass)PatientClassPerXmlPatientClass[PatientClassDistribution.GetRandomValue()].Clone();

            EntityPatient patient = new EntityPatient(EntityPatient.RunningPatientID++, newPatientClass);

            admission   = new Admission(patient, new OutpatientAdmissionTypes("SurgicalOutpatient"), 0, 100, true);
            arrivalTime = currentTime + TimeSpan.FromMinutes(Distributions.Instance.Exponential(400));

            return(patient);
        } // end of GetNextWaitingListPatient
Example #2
0
        } // end of PatientEmergencyTreatmentTime

        #endregion

        #region GetNextPatient

        /// <summary>
        /// The patient part of the arrival stream, defines patient category and other attributes of arriving
        /// patients
        /// </summary>
        /// <returns>The next patient to arrive</returns>
        public EntityPatient GetNextPatient()
        {
            PatientClass newPatientClass = (PatientClass)PatientClassPerXmlPatientClass[PatientClassDistribution.GetRandomValue()].Clone();

            return(new EntityPatient(EntityPatient.RunningPatientID++, newPatientClass));
        } // end of PatientArrivalTime