/// <summary>
 /// Deprecated Method for adding a new object to the Doctors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDoctors(Doctor doctor)
 {
     base.AddObject("Doctors", doctor);
 }
 /// <summary>
 /// Create a new Doctor object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="phone">Initial value of the Phone property.</param>
 public static Doctor CreateDoctor(global::System.Int32 id, global::System.String name, global::System.String address, global::System.String phone)
 {
     Doctor doctor = new Doctor();
     doctor.Id = id;
     doctor.Name = name;
     doctor.Address = address;
     doctor.Phone = phone;
     return doctor;
 }
示例#3
0
        private static PatientStay ProcessPatientVisit(DateTime now, Patient nextPatient, Doctor doctor, bool isOutPatient)
        {
            Visit visit = Visit.CreateVisit(0, doctor.Id, nextPatient.Id, now);

             if (isOutPatient)
             {
            visit.DateOfDischarge = now;
             }
             else
             {
            var nextBed = NextAvailableBed();
            if (nextBed == null)
            {
               Console.WriteLine("no beds available!!!!");
               Console.WriteLine("Current time: {0}", now);
               return null;
            }

            visit.Bed = nextBed;
             }

             context.Visits.AddObject(visit);
             context.SaveChanges();

             if (!isOutPatient || RandomEvent(out_patient_notes_chance))
             {
            CreateAmusingVisitDetail(visit);
             }

             if (isOutPatient) return null;

             PatientStay stay = new PatientStay() {
             visit = visit,
             length = new TimeSpan(rnd.Next(min_stay_duration, max_stay_duration), 0, 0, 0)};

             return stay;
        }