Exemple #1
0
        /// <summary>
        /// Creates the checkup.
        /// </summary>
        /// <param name="appointmentid">The appointmentid.</param>
        /// <param name="systolic">The systolic.</param>
        /// <param name="diastolic">The diastolic.</param>
        /// <param name="temperature">The temperature.</param>
        /// <param name="weight">The weight.</param>
        /// <param name="pulse">The pulse.</param>
        /// <param name="diagnosis">The diagnosis.</param>
        /// <param name="finaldiagnosis"></param>
        /// <returns></returns>
        public static bool createCheckup(int appointmentid, int systolic, int diastolic, decimal temperature, decimal weight, int pulse, string diagnosis, string finaldiagnosis)
        {
            var cdb     = new CheckupDatabaseAccess();
            var checkup = new Checkup(0, appointmentid, systolic, diastolic, temperature, weight, pulse, diagnosis, finaldiagnosis);

            return(cdb.CreateCheckup(checkup));
        }
        /// <summary>
        /// Checks if checkup done.
        /// </summary>
        private void checkIfCheckupDone()
        {
            var db   = new CheckupDatabaseAccess();
            var data = db.GetCheckupFromAppointmentid(this.appointmentid);

            if (data.Count == 0)
            {
                this.finalDiagnosisTextBox.IsEnabled      = false;
                this.submitFinalDiagnosisButton.IsEnabled = false;
                this.enterTestsButton.IsEnabled           = false;
            }
        }
        /// <summary>
        /// Checks if final diagnosis.
        /// </summary>
        /// <returns></returns>
        private bool checkIfFinalDiagnosis()
        {
            var db      = new CheckupDatabaseAccess();
            var checkup = db.GetCheckupFromAppointmentid(this.appointmentid);

            if (checkup.Count == 8 && !string.IsNullOrEmpty(checkup[6]))
            {
                this.finalDiagnosisTextBox.Text = checkup[6];
                return(true);
            }
            return(false);
        }
 /// <summary>
 /// Ons the confirmation final diagnosis.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void onConfirmationFinalDiagnosis(object sender, RoutedEventArgs e)
 {
     this.enterTestFlyout.Hide();
     if (this.confirmationCheckBox.IsChecked == true)
     {
         var db = new CheckupDatabaseAccess();
         db.EditCheckupFinalDiagnosis(this.finalDiagnosisTextBox.Text, this.checkupid);
         this.enterTestsButton.IsEnabled           = false;
         this.orderTestsButton.IsEnabled           = false;
         this.makeCheckupButton.IsEnabled          = false;
         this.submitFinalDiagnosisButton.IsEnabled = false;
     }
 }
Exemple #5
0
        /// <summary>
        /// Gets the checkup from appointmentid.
        /// </summary>
        /// <param name="appointmentid">The appointmentid.</param>
        /// <returns></returns>
        public static Checkup GetCheckupFromAppointmentid(int appointmentid)
        {
            var cdb         = new CheckupDatabaseAccess();
            var information = cdb.GetCheckupFromAppointmentid(appointmentid);

            if (information.Count != 8)
            {
                return(null);
            }
            var systolic       = int.Parse(information[0]);
            var diastolic      = int.Parse(information[1]);
            var temperature    = decimal.Parse(information[2]);
            var weight         = decimal.Parse(information[3]);
            var pulse          = int.Parse(information[4]);
            var diagnosis      = information[5];
            var finaldiagnosis = information[6];
            var checkupid      = int.Parse(information[7]);

            return(new Checkup(
                       checkupid, appointmentid, systolic, diastolic, temperature, weight, pulse, diagnosis, finaldiagnosis));
        }