static void Main(string[] args)
        {
            RedisInstance = new Redis(cfg => {
                cfg.Port(8096);
                cfg.LogTo(new Action<string>((s) => Console.WriteLine(s)));
            });

            var client = new RedisClient(RedisInstance.Endpoint.ToString());
            var patientClient = client.As<Patient>();

            var patient = new Patient
            {
                Name = "Scott",
                Codes = new List<string> { "1.1", "2.2" }
            };
            patient.Id = patientClient.GetNextSequence();
            patientClient.Store(patient);

            var retrievedPatient = patientClient.GetById(patient.Id);
            Console.WriteLine("{0}:{1}", retrievedPatient.Id, retrievedPatient.Name);

            Console.ReadKey();
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     var person = new Person();
     var patient = new Patient();
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Patients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPatients(Patient patient)
 {
     base.AddObject("Patients", patient);
 }
 /// <summary>
 /// Create a new Patient 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="dateOfBirth">Initial value of the DateOfBirth property.</param>
 /// <param name="phone">Initial value of the Phone property.</param>
 /// <param name="emergencyContact">Initial value of the EmergencyContact property.</param>
 /// <param name="dateOfRegistration">Initial value of the DateOfRegistration property.</param>
 public static Patient CreatePatient(global::System.Int32 id, global::System.String name, global::System.String address, global::System.DateTime dateOfBirth, global::System.String phone, global::System.String emergencyContact, global::System.DateTime dateOfRegistration)
 {
     Patient patient = new Patient();
     patient.Id = id;
     patient.Name = name;
     patient.Address = address;
     patient.DateOfBirth = dateOfBirth;
     patient.Phone = phone;
     patient.EmergencyContact = emergencyContact;
     patient.DateOfRegistration = dateOfRegistration;
     return patient;
 }
Esempio n. 5
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;
        }