コード例 #1
0
 public AddTreatment(Treatment pTreatment)
 {
     InitializeComponent();
     treatment = pTreatment;
     waitlist = new WaitlistedPatient(treatment.TreatmentID);
     patient = new Patient();
     patient.GetPatient(treatment.PatientID);
     populatePreBoxFields();
      _isNewTreatment  = false;
 }
コード例 #2
0
 public AddTreatment(int healthCareNo)
 {
     InitializeComponent();
     this.patient = new Patient(healthCareNo);
     treatment = new Treatment();
     waitlist = new WaitlistedPatient();
     treatment.Status = "Upcoming";
     treatment.PatientID = patient.PatientID;
     waitlist.Pid = patient.PatientID;
     populatePreBoxFields();
     boxDate.Text = System.DateTime.Today.ToString();
 }
コード例 #3
0
        public void TestSelectWithValidRtid()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UnitTestWard-WLP", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UnitTestWard-WLP");
            b.Insert();
            Patient p = new Patient(10000, "Test-WLP", "Test-WLP", new DateTime(), "", "", "", "", "", "", "");
            p.Insert();
            p.Select();
            Treatment treat = new Treatment(p.PatientID, "UnitTestTreatment-WLP", 1, 1, 1, "", "", 1, "Upcoming");
            treat.Insert();
            List<Treatment> list = Treatment.GetTreatments(p.PatientID, "Upcoming");
            Treatment t = list[0];

            WaitlistedPatient.AddPatientToWaitlist(p.PatientID, "UnitTestWard-WLP", "High", t.TreatmentID);
            List<WaitlistedPatient> patients = WaitlistedPatient.GetWaitlistedPatientsForWard("UnitTestWard-WLP");

            WaitlistedPatient waitlist = new WaitlistedPatient(t.TreatmentID);

            Assert.True(waitlist.Pid == p.PatientID);

            patients[0].RemovedPatientFromWaitlist();
            t.Delete();
            p.Delete();
            b.Delete();
            r.Delete();
            w.Delete();
        }
コード例 #4
0
        public static List<WaitlistedPatient> GetWaitlistedPatientsForWard(string ward)
        {
            List<object[]> patients = Database.Select("Select WL.waitlistId, WL.patientId, P.fname, P.lname, WL.priority, WL.treatmentID, TM.treatment " +
                                                        "FROM Waitlist as WL " +
                                                        "INNER JOIN (SELECT patient,rtid,treatment " +
                                                                    "FROM ReceivesTreatment " +
                                                                    "WHERE treatmentStatus = 'Upcoming' " +
                                                                    "AND patient NOT IN(	Select patient " +
                                                                    "FROM ReceivesTreatment " +
                                                                    "WHERE treatmentStatus = 'Current') " +
                                                                    ") as TM " +
                                                        "ON WL.treatmentID = TM.rtid " +
                                                        "INNER JOIN Patient as P on P.pid = WL.patientID " +
                                                        "WHERE WL.wardName = '" + ward + "' " +
                                                        "ORDER BY priority='Low',priority='Medium',priority='High';");
            List<WaitlistedPatient> getpatients = new List<WaitlistedPatient>();
            if (patients != null)
                foreach (object[] row in patients)
                {
                    if (row.Length == 7)
                    {
                        WaitlistedPatient newPatient = new WaitlistedPatient(Convert.ToInt32(row[0]), Convert.ToInt32(row[1]), row[2].ToString(), row[3].ToString(), row[4].ToString(), Convert.ToInt32(row[5]), row[6].ToString(),ward);
                        getpatients.Add(newPatient);
                    }
                }

            return getpatients;
        }
コード例 #5
0
 public void TestGetSetWard()
 {
     WaitlistedPatient w = new WaitlistedPatient();
     w.Ward = "Test";
     Assert.True(w.Ward == "Test");
 }
コード例 #6
0
 public void TestSelectWithInvalidRtid()
 {
     WaitlistedPatient w = new WaitlistedPatient(-1);
     Assert.True(w.Pid == 0);
 }
コード例 #7
0
 public void TestGetSetTreatment()
 {
     WaitlistedPatient w = new WaitlistedPatient();
     w.Treatment = "Test";
     Assert.True(w.Treatment == "Test");
 }
コード例 #8
0
 public void TestGetSetPriority()
 {
     WaitlistedPatient w = new WaitlistedPatient();
     w.Priority = "Test";
     Assert.True(w.Priority == "Test");
 }
コード例 #9
0
 public void TestGetSetPid()
 {
     WaitlistedPatient w = new WaitlistedPatient();
     w.Pid = 1;
     Assert.True(w.Pid == 1);
 }
コード例 #10
0
 public void TestGetSetLname()
 {
     WaitlistedPatient w = new WaitlistedPatient();
     w.Lname = "Test";
     Assert.True(w.Lname == "Test");
 }
コード例 #11
0
 private void dgHistory_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     treatment = (Treatment)dgHistory.SelectedItem;
     waitlist = new WaitlistedPatient(treatment.TreatmentID);
     lblDetails.Content = treatment.Type + " " + treatment.DateToShortDateString + " " + treatment.Time;
 }