public void TestMethodResourceForPatientWthFlu()
        {
            var patient           = new Patient("Test Patient", PatientCondition.Flu);
            var resourceAllocator = new ResourceAllocator();

            var consultation =
                new ConsultationRecord(patient, null, null, DateTime.Now.Date, DateTime.MinValue);
            ResourceAllocatorResult r = new ResourceAllocatorResult(false, consultation);

            ManualResetEvent done = new ManualResetEvent(false);

            resourceAllocator.RequestResources(patient, (result) =>
            {
                r = result;
                done.Set();
            });

            done.WaitOne();
            resourceAllocator.Dispose();

            Assert.IsTrue(r.Status, "Failed to get Resource..");
            Assert.IsTrue(r.Consultation.TreatmentRoom != null, "Failed to get Treatment Room..");
            Assert.IsTrue(r.Consultation.Doctor != null, "Failed to get Doctor..");
            Assert.IsTrue(r.Consultation.DateRegistered == consultation.DateRegistered, "Registration date is incorrect.");
            Assert.IsTrue(r.Consultation.ConsulatationDate != DateTime.MinValue, "Consultation date is incorrect.");
        }
Ejemplo n.º 2
0
        public List <ConsultationRecord> FetchConsultationsByMember(int memberID)
        {
            var records = new List <ConsultationRecord>();

            foreach (var rec in consultations)
            {
                ConsultationRecord record = (ConsultationRecord)rec;

                if (record.MemberNumber == memberID)
                {
                    records.Add(record);
                }
            }

            return(records);
        }
Ejemplo n.º 3
0
 public ConsultationRecord FetchConsultation(int memberID, int serviceID, int providerID, DateTime recDate, DateTime serviceDate)
 {
     foreach (var record in consultations)
     {
         ConsultationRecord rec = (ConsultationRecord)record;
         if (
             rec.CurrentDate == recDate &&
             rec.ServiceDate == serviceDate &&
             rec.MemberNumber == memberID &&
             rec.ServiceNumber == serviceID &&
             rec.ProviderNumber == providerID
             )
         {
             return(rec);
         }
     }
     return(null);
 }
Ejemplo n.º 4
0
        private void Load()
        {
            StreamReader inStream = new StreamReader(File.Open(rootPath + "database.db", FileMode.OpenOrCreate, FileAccess.Read));


            String activeType = "";

            while (!inStream.EndOfStream)
            {
                String line = inStream.ReadLine();
                if (line.Equals(""))
                {
                    continue;
                }
                if (line.StartsWith("*"))
                {
                    activeType = line.Substring(1, line.IndexOf(':') - 1);
                    continue;
                }
                switch (activeType)
                {
                case "MEMBERS":
                    members.Add(MemberRecord.FromString(line));
                    break;

                case "PROVIDERS":
                    providers.Add(ProviderRecord.FromString(line));
                    break;

                case "SERVICES":
                    services.Add(ServiceRecord.FromString(line));
                    break;

                case "CONSULTATIONS":
                    consultations.Add(ConsultationRecord.FromString(line));
                    break;

                default:
                    break;
                }
            }
            inStream.Close();
        }
Ejemplo n.º 5
0
 public void InsertConsultation(ConsultationRecord record)
 {
     this.consultations.Add(record);
 }