コード例 #1
0
 ///-------------------------------------------------------------------------------------------------
 /// \fn public void ResetDetails()
 ///
 /// \brief  Resets the details of the search result holder instance
 ///
 /// \author Bailey
 /// \date   2019-04-18
 ///-------------------------------------------------------------------------------------------------
 public void ResetDetails()
 {
     lblPlaceholder.Content = DEFAULT_TEXT;
     lblFirstName.Content   = "";
     lblHCN.Content         = "";
     patient = null;
 }
コード例 #2
0
        private void ExitSearch(Demographics.Patient selectedItem)
        {
            Grid holder = (Grid)this.Parent;

            Patients.SearchPatientPage parent = (Patients.SearchPatientPage)holder.Parent;

            parent.ReturnPatient(selectedItem);
        }
コード例 #3
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn public void UpdateDetails (Demographics.Patient patient)
        ///
        /// \brief  Updates the details of the search holder to contain the given patient's details
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///
        /// \param Patient selectedPatient
        ///-------------------------------------------------------------------------------------------------
        public void UpdateDetails(Demographics.Patient patient)
        {
            TabScheduling.tabScheduling.patient2.UpdateColour();

            if (patient != null)
            {
                lblFirstName.Content = patient.FirstName + " " + patient.LastName;
                lblHCN.Content       = patient.HCN.ToString();

                lblPlaceholder.Content = "";
            }
            else
            {
                ResetDetails();
            }
        }
コード例 #4
0
        ///
        /// <summary>   Called upon exiting the search  To return a patient.</summary>
        ///
        /// <remarks>    2019-04-20. </remarks>
        ///
        /// <param name="selectedItem"> The selected item. </param>
        ///

        private void ExitSearch(Demographics.Patient selectedItem)
        {
            Grid holder = (Grid)this.Parent;

            if (string.Compare(modifyOrReport, "Modify") == 0)
            {
                //Return to modify
                Patients.ModifyPatient parent = (Patients.ModifyPatient)holder.Parent;
                parent.ReturnPatient(selectedItem);
            }
            else if (string.Compare(modifyOrReport, "Report") == 0)
            {
                //Return to HoH
                Patients.HoHReport parent = (Patients.HoHReport)holder.Parent;
                parent.ReturnPatient(selectedItem);
            }
        }
コード例 #5
0
        /**
         * \fn public static bool BookAppointment(Demographics.Patient patient, Demographics.Patient hoh, DateTime date)
         * \author Bailey Mills
         * \brief Attempts to book an appointment using all necessary components for a patient. If hoh is null then
         *			then they will not be in the appointment
         * \return int count
         */
        public static bool BookAppointment(Demographics.Patient patient, Demographics.Patient hoh, DateTime date)
        {
            bool booked = true;

            // Ensure there is enough room
            if (GetAppointmentCountForDay(date) < MaxAppointmentsForDay(date))
            {
                // Single Appointment
                if (patient != null && hoh == null)
                {
                    String[] attributes = new String[]
                    {
                        "0",
                        date.ToString(),
                        patient.HCN
                    };

                    Appointment_Single appt = new Appointment_Single(attributes);
                    appt.Add();
                }
                // Double Appointment
                else if (patient != null && hoh != null)
                {
                    String[] attributes = new String[]
                    {
                        "0",
                        date.ToString(),
                        patient.HCN,
                        hoh.HCN
                    };

                    Appointment_Double appt = new Appointment_Double(attributes);
                    appt.Add();
                }
            }
            else
            {
                booked = false;
            }

            return(booked);
        }
コード例 #6
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn public void UpdateSelectedPatient(Demographics.Patient selectedPatient)
        ///
        /// \brief  Called with the patient chosen from the search so that the patient holders can be loaded
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///
        /// \param Patient selectedPatient
        ///-------------------------------------------------------------------------------------------------
        public void UpdateSelectedPatient(Demographics.Patient selectedPatient)
        {
            TabScheduling tab = TabScheduling.tabScheduling;

            patient = selectedPatient;

            if (searchScreen != null)
            {
                TabScheduling.tabScheduling.searchPatientParent.Children.Remove(searchScreen);
            }

            // Clearing old details
            // Updating primary should remove secondary
            if (patientType == PATIENT_PRIMARY)
            {
                // Try to load HoH details
                if (patient != null && patient is Demographics.Patient_Dependant)
                {
                    // Update details if they are found
                    var family = Database.HoH_Report(patient.HCN);
                    if (family != null && family.Count > 0)
                    {
                        Demographics.Patient hoh = family[0];
                        tab.patient2.UpdateSelectedPatient(hoh);
                    }
                }
                else
                {
                    tab.patient2.ResetDetails();
                }
            }

            // Update Details
            UpdateDetails(patient);
            if (selectedPatient == null)
            {
                ResetDetails();
            }
        }
コード例 #7
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private void GrdAppointmentDetails_Click(object sender, MouseButtonEventArgs e)
        ///
        /// \brief  Handles all possible cases for when the object is clicked
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///
        /// \param  object sender
        /// \param  MouseButtonEventArgs e
        ///-------------------------------------------------------------------------------------------------
        private void GrdAppointmentDetails_Click(object sender, MouseButtonEventArgs e)
        {
            if (clickable)
            {
                // Booking an appointment
                if (bookable)
                {
                    TabScheduling        tab     = TabScheduling.tabScheduling;
                    Demographics.Patient patient = tab.patient1.patient;
                    Demographics.Patient hoh     = tab.patient2.patient;

                    // Book appointment
                    if (patient != null)
                    {
                        // Only allow booking on and after today
                        if (tab.selectedDate >= DateTime.Today)
                        {
                            SchedulingSupport.BookAppointment(patient, hoh, tab.selectedDate);

                            // Clear instructions
                            tab.ClearInformation();

                            // Refresh Calendar
                            tab.LoadCalendar(tab.currentMonth);
                        }
                        else
                        {
                            TabScheduling.tabScheduling.SetInformation("You cannot book an appointment for a date that has already past");
                        }
                    }
                    // No patient(s) given
                    else
                    {
                        tab.SetInformation("You must first select the patient that the appointment is for.");
                    }
                }
                // Inspecting actions for a tile
                else
                {
                    // Enable all items
                    itemRecallBook.IsEnabled  = false;
                    itemRecallClear.IsEnabled = true;
                    itemRecall1.IsEnabled     = true;
                    itemRecall2.IsEnabled     = true;
                    itemRecall3.IsEnabled     = true;

                    // Update Context Menu
                    int recallFlag = appointment.RecallFlag;
                    if (recallFlag == 0)
                    {
                        itemRecallClear.IsEnabled = false;
                    }
                    else if (recallFlag > 0)
                    {
                        itemRecallBook.IsEnabled = true;

                        if (TabScheduling.currentMode == TabScheduling.MODE_RECALL)
                        {
                            itemRecall1.IsEnabled     = false;
                            itemRecall2.IsEnabled     = false;
                            itemRecall3.IsEnabled     = false;
                            itemRecallClear.IsEnabled = false;
                            itemRecallBook.Header     = "Cancel";
                        }
                        else
                        {
                            itemRecallBook.Header = "Book";
                            if (recallFlag == 1)
                            {
                                itemRecall1.IsEnabled = false;
                            }
                            else if (recallFlag == 2)
                            {
                                itemRecall2.IsEnabled = false;
                            }
                            else if (recallFlag == 3)
                            {
                                itemRecall3.IsEnabled = false;
                            }
                        }
                    }

                    // Display Context Menu
                    cm.PlacementTarget = sender as Button;
                    cm.IsOpen          = true;
                }
            }
        }
コード例 #8
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn public void UpdateAppointmentDetails(List<Demographics.Patient> patientList, Appointment appointment)
        ///
        /// \brief  Updates the appointment details for the appointmentdetailline using the given details about
        ///			the appointment
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///
        /// \param  List<Demographics.Patient> patientList : either 1 or both people in the
        ///				appointment (0: patient, 1: hoh)
        /// \param	Appointment appointment : the appointment instance
        ///-------------------------------------------------------------------------------------------------
        public void UpdateAppointmentDetails(List <Demographics.Patient> patientList, Appointment appointment)
        {
            int count = patientList.Count;

            bool recallFlag  = false;
            bool billingFlag = false;

            if (count >= 1)
            {
                Demographics.Patient patient = patientList[0];
                patients[0] = patient;

                SetPatientDetails(patient, "Patient", lblPatientName, lblPatientHCN, lblPatientDescription);

                // Update recall flag
                if (appointment.RecallFlag > 0)
                {
                    recallFlag = true;
                }

                // Updating billing flag
                if (appointment.GetBillcodesByHCN(patient.HCN).Count > 0)
                {
                    billingFlag = true;
                }

                if (count == 2)
                {
                    Demographics.Patient hoh = patientList[1];
                    patients[1] = hoh;

                    SetPatientDetails(hoh, "Head of Household", lblHoHName, lblHoHHCN, lblHoHDescription);

                    // Update width (shrink width of patient info to fit hoh info)
                    Grid.SetColumnSpan(viewPatient, 1);
                    Grid.SetColumnSpan(lblPatientHCN, 1);
                    Grid.SetColumnSpan(lblPatientDescription, 1);

                    // Updating billing flag
                    if (!billingFlag && appointment.GetBillcodesByHCN(hoh.HCN).Count > 0)
                    {
                        billingFlag = true;
                    }
                }
                else
                {
                    ClearHoHDetails();

                    // Update width (expand width of patient info)
                    Grid.SetColumnSpan(viewPatient, 2);
                    Grid.SetColumnSpan(lblPatientHCN, 2);
                    Grid.SetColumnSpan(lblPatientDescription, 2);
                }

                // Update colouring based on the recall and billing contents
                if (recallFlag && billingFlag)
                {
                    backgroundColour = Brushes.Plum;
                }
                else if (recallFlag)
                {
                    backgroundColour = Brushes.LightPink;
                }
                else if (billingFlag)
                {
                    backgroundColour = Brushes.LightBlue;
                }
                else
                {
                    backgroundColour = Brushes.White;
                }
            }
            else
            {
                ClearDetails();
            }

            this.appointment = appointment;
        }
コード例 #9
0
 ///-------------------------------------------------------------------------------------------------
 /// \fn private void SetPatientDetails(Demographics.Patient patient, string strDescription, Label name, Label hcn, Label description)
 ///
 /// \brief  Updates the given ui elements with the necessary content from the Patient object
 ///
 /// \author Bailey
 /// \date   2019-04-18
 ///
 /// \param  Patient patient
 /// \param	string strDescription
 /// \param	Label name
 /// \param	Label hcn
 /// \param	Label description
 ///-------------------------------------------------------------------------------------------------
 private void SetPatientDetails(Demographics.Patient patient, string strDescription, Label name, Label hcn, Label description)
 {
     name.Content        = patient.FirstName + " " + patient.LastName;
     hcn.Content         = patient.HCN;
     description.Content = strDescription;
 }
コード例 #10
0
 public void ReturnPatient(Demographics.Patient p)
 {
     parent.UpdateSelectedPatient(p);
 }