コード例 #1
0
 public void TestGetSetDateString()
 {
     Treatment r = new Treatment();
     r.Date = new DateTime(2012, 12, 12);
     String date = r.Date.ToShortDateString();
     Assert.True(r.DateToShortDateString == date);
 }
コード例 #2
0
 public void TestGetSetDate()
 {
     Treatment r = new Treatment();
     DateTime d = new DateTime(2013, 2, 3);
     r.Date = d;
     Assert.True(r.Date.CompareTo(d) == 0);
 }
コード例 #3
0
        public void TestEditPatientInWaitlist()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UTW", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UTW");
            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, "UTW", "High", t.TreatmentID);
            List<WaitlistedPatient> patients = WaitlistedPatient.GetWaitlistedPatientsForWard("UTW");

            Assert.True(WaitlistedPatient.EditPatientInWaitlist(p.PatientID, "UTW", "High", t.TreatmentID));

            patients[0].RemovedPatientFromWaitlist();
            t.Delete();
            p.Delete();
            b.Delete();
            r.Delete();
            w.Delete();
        }
コード例 #4
0
 public AddTreatment(Treatment pTreatment)
 {
     InitializeComponent();
     treatment = pTreatment;
     waitlist = new WaitlistedPatient(treatment.TreatmentID);
     patient = new Patient();
     patient.GetPatient(treatment.PatientID);
     populatePreBoxFields();
      _isNewTreatment  = false;
 }
コード例 #5
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();
 }
コード例 #6
0
        public static List<Treatment> GetTreatmentHistory(int pID)
        {
            List<object[]> treatmentsFromDatabase = Database.Select("Select * FROM ismacaul_HospiPal.ReceivesTreatment  WHERE patient = " + pID + " ORDER BY (rtid)");
            List<Treatment> treatments = new List<Treatment>();
            treatmentIDList = new Dictionary<int, int>();

            int i = 0;

            foreach (object[] element in treatmentsFromDatabase)
            {
                Treatment treatmentForPatient = new Treatment(Convert.ToInt32(element[0]),pID, element[2].ToString(), Convert.ToInt32(element[3]), Convert.ToInt32(element[4]), Convert.ToInt32(element[5]), element[6].ToString(), element[7].ToString(), Convert.ToInt32(element[8]));
                treatmentForPatient.TreatmentID = Convert.ToInt32(element[0]);
                treatments.Add(treatmentForPatient);

                if (!treatmentIDList.ContainsKey(i))
                {
                    treatmentIDList.Add(i, Convert.ToInt32(element[0]));
                }
                i++;
            }
            return treatments;
        }
コード例 #7
0
 public void TestSelectWithNoTid()
 {
     Treatment t = new Treatment();
     Assert.False(t.Select());
 }
コード例 #8
0
 public void TestGetSetDoctor()
 {
     Treatment r = new Treatment();
     r.Doctor = 1;
     Assert.True(r.Doctor == 1);
 }
コード例 #9
0
        public void TestGetTreatments()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1, "History5");
            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000, "History5");
            Assert.True(list.Count >= 1);

            Treatment treatment = list[0];
            treatment.Delete();
        }
コード例 #10
0
ファイル: Treatments.cs プロジェクト: trbielec/hospipal
 public static List<Treatment> GetTreatments(int pid,string status)
 {
     List<object[]> rows = Database.Select("Select * FROM ReceivesTreatment WHERE patient = " + pid + " AND treatmentstatus = '" + status + "'");
     List<Treatment> getTreatments = new List<Treatment>();
     if (rows != null)
     foreach (object[] row in rows)
     {
         Treatment newTreatment = new Treatment(Convert.ToInt32(row[1]), row[2].ToString(),
                                 Convert.ToInt32(row[3]), Convert.ToInt32(row[4]), Convert.ToInt32(row[5]),
                                 row[6].ToString(), row[7].ToString(), Convert.ToInt32(row[8]),row[9].ToString());
         newTreatment._treatmentID = Convert.ToInt32(row[0]);
         getTreatments.Add(newTreatment);
     }
     return getTreatments;
 }
コード例 #11
0
 public void TestGetSetStatus()
 {
     Treatment r = new Treatment();
     r.Status = "Test";
     Assert.True(r.Status == "Test");
 }
コード例 #12
0
 public void TestGetSetType()
 {
     Treatment r = new Treatment();
     r.Type = "Test";
     Assert.True(r.Type == "Test");
 }
コード例 #13
0
 public void TestGetSetPatientId()
 {
     Treatment r = new Treatment();
     r.PatientID = 1;
     Assert.True(r.PatientID == 1);
 }
コード例 #14
0
 public void TestGetSetNotes()
 {
     Treatment r = new Treatment();
     r.Notes = "Test";
     Assert.True(r.Notes == "Test");
 }
コード例 #15
0
        /*  Constructor that takes patientID
        *
        *
        */
        public TreatmentInformation(int pID)
        {
            InitializeComponent();

            CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
            ci.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture = ci;

            try
            {
                this.patientID = pID;
                //Instantiate control as treatment class in database class folder
                control = new Database_Class.Treatment(patientID);

                //Types of treatments available
                List<object[]> treatments = control.initializeTreatmentList();

                //List of doctors
                List<string> doctors = control.initializeDoctorList();
                //List of treatment history
                List<string> treatmentHistory = control.initializeTreatmentHistory();

                string s = "";

                //Converts each type of treatment to string and adds to text box
                foreach (object[] element in treatments)
                {
                    s = element[0].ToString();
                    boxTreatmentType.Items.Add(s);

                }

                //Adds each doctor to drop down box
                foreach (string element in doctors)
                {
                    boxDoctors.Items.Add(element);

                }

                //Adds each treatment to drop down box
                foreach (string element in treatmentHistory)
                {
                    boxHistory.Items.Add(element);

                }

                //Sets the name label to display patient name
                lblName.Content = control.getPatientName();

            }
            catch(Exception)
            {
                MessageBox.Show("Error with getting treatment, there might be an issue with patientID");
            }
        }
コード例 #16
0
        public void TestTreatmentSelect()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1,"History1");

            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000,"History1");

            Treatment treatment = list[0];
            Assert.True(treatment.Select());

            treatment.Delete();
        }
コード例 #17
0
        public void TestTreatmentUpdate()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1, "History3");
            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000, "History3");

            Treatment treatment = list[0];
            treatment.Notes = "TEST NOTES";
            Assert.True(treatment.Update());

            treatment.Delete();
        }