Ejemplo n.º 1
0
        /// <summary>
        /// Load the available tests
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadTests(object sender, EventArgs e)
        {
            AddTestForm tf = this.ParentForm as AddTestForm;

            this.visitID = tf.VisitID;

            this.all     = controller.GetAllTests();
            this.ordered = controller.GetTestsByVisitId(this.visitID);

            foreach (var test in ordered)
            {
                all.Remove(all.Single(s => s.TestCode == test.TestCode));
            }

            this.RefreshListView();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Process submit order click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubmitOrderButton_Click(object sender, EventArgs e)
        {
            List <Test> tests = new List <Test>();

            OrderTests(tests);
            MessageBox.Show("Tests Ordered");
            var      parent            = this.ParentForm as AddTestForm;
            ListView apptListView      = parent.VisitControl.Controls["visitListView"] as ListView;
            var      selectedItemIndex = apptListView.SelectedItems[0].Index;

            parent.VisitControl.VisitUserControl_Load(null, null);
            var item = apptListView.Items[selectedItemIndex];

            item.Selected = true;

            AddTestForm tf = this.ParentForm as AddTestForm;

            tf.Close();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// On visit selection change, displays appropriate information
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void VisitListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.visitListView.SelectedItems.Count != 0)
            {
                int   apptID = int.Parse(this.visitListView.SelectedItems[0].SubItems[0].Text);
                Visit visit  = this.controller.GetVisitByAppointmentID(apptID);
                _visitID = visit.VisitID;
                this.CheckVisitStatus(visit);
                this.testsListView.Items.Clear();

                if (visit.VisitID != 0)
                {
                    this.doctorTextBox.Text = visit.DoctorName.ToString();
                    List <Specialty> specials = this.GetSpecialty(visit.DoctorID);
                    this.specialTextBox.Text        = string.Join(", ", specials.Select(x => x.SpecialityName));
                    this.weightTextBox.Text         = visit.Weight.ToString();
                    this.pulseTextBox.Text          = visit.Pulse.ToString();
                    this.tempTextBox.Text           = visit.Temp.ToString();
                    this.systolicTextBox.Text       = visit.SystolicBP.ToString();
                    this.diastolicTextBox.Text      = visit.DiastolicBP.ToString();
                    this.symptomsTextBox.Text       = visit.Symptoms;
                    this.initDiagnosisTextBox.Text  = visit.InitialDiagnosis;
                    this.finalDiagnosisTextBox.Text = visit.FinalDiagnosis;
                    this.GetTests(visit.VisitID);
                    this.addTest = new AddTestForm(visit.VisitID, this);
                }
                else
                {
                    this.doctorTextBox.Text = visit.DoctorName.ToString();
                    List <Specialty> specials = this.GetSpecialty(visit.DoctorID);
                    this.specialTextBox.Text        = string.Join(", ", specials.Select(x => x.SpecialityName));
                    this.weightTextBox.Text         = "";
                    this.pulseTextBox.Text          = "";
                    this.tempTextBox.Text           = "";
                    this.systolicTextBox.Text       = "";
                    this.diastolicTextBox.Text      = "";
                    this.symptomsTextBox.Text       = "";
                    this.initDiagnosisTextBox.Text  = "";
                    this.finalDiagnosisTextBox.Text = "";
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Process cancel button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CancelButton_Click(object sender, EventArgs e)
        {
            AddTestForm tf = this.ParentForm as AddTestForm;

            tf.Close();
        }