private void metroButton2_Click(object sender, EventArgs e)
        {
            Firebase.Firebase firebase = new Firebase.Firebase();

            Classes.Admission admission = new Classes.Admission()
            {
                id               = this.admission.id,
                patient          = this.admission.patient,
                isAdmitted       = 0,
                isDischarged     = 0,
                isTransferred    = 1,
                blood_pressure   = this.admission.blood_pressure,
                cc               = this.admission.cc,
                pulse_rate       = this.admission.pulse_rate,
                respiratory_rate = this.admission.respiratory_rate,
                o2sat            = this.admission.o2sat,
                gcs              = this.admission.gcs,
                temperature      = this.admission.temperature,
                nurseID          = currentUser.id
            };

            Classes.Checkup checkup = GetCheckup();
            checkup.status = "Transferred";

            firebase.UpdateCheckUp(checkup);

            Classes.AdmissionHelper.SaveAdmission(admission);
            Classes.CheckupHelper.UpdateStatus(admission.patient.id, "Transferred");

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Firebase.Firebase firebase = new Firebase.Firebase();

            if (Classes.CheckupHelper.SaveCheckUP("", "", "", "", "", "", id, txtAssesment.Text, txtManagement.Text, "Discharged", 1, "", "", "", doctorID) != 0)
            {
                MessageBox.Show("Successfully updated");
            }
            else
            {
                MessageBox.Show("Error added");
            }

            foreach (Classes.Prescription prescription in prescriptions)
            {
                Classes.PrescriptionHelper.savePrescription(prescription, id, "checkup");
            }
            Classes.Checkup tempCheckup = this.checkup;
            tempCheckup.management    = txtManagement.Text;
            tempCheckup.assesment     = txtAssesment.Text;
            tempCheckup.prescriptions = prescriptions;
            tempCheckup.isTreated     = 1;
            tempCheckup.status        = "Discharged";


            firebase.UpdateCheckUp(tempCheckup);

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
        private void btnAdmissionRequest_Click(object sender, EventArgs e)
        {
            Firebase.Firebase firebase = new Firebase.Firebase();

            if (admissionRequestExisted(this.checkup.patientID))
            {
                MessageBox.Show("Patient already request for admission");
                return;
            }

            Classes.AdmissionHelper.SaveAdmission(new Classes.Admission()
            {
                patient          = currentPatient,
                respiratory_rate = txtrr.Text,
                blood_pressure   = txtBP.Text,
                pulse_rate       = txtPR.Text,
                gcs         = txtGCS.Text,
                o2sat       = txto2sat.Text,
                temperature = txtTemp.Text,
                cc          = this.cc
            });

            if (Classes.CheckupHelper.SaveCheckUP("", "", "", "", "", "", id, txtAssesment.Text, txtManagement.Text, "Pending for Admission", 0) != 0)
            {
                MessageBox.Show("Successfully updated");
            }
            else
            {
                MessageBox.Show("Error added");
            }

            Classes.Checkup tempCheckup = this.checkup;
            tempCheckup.management    = txtManagement.Text;
            tempCheckup.assesment     = txtAssesment.Text;
            tempCheckup.prescriptions = prescriptions;
            tempCheckup.isTreated     = 0;
            tempCheckup.status        = "Pending for Admission";

            firebase.UpdateCheckUp(tempCheckup);



            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
 public CheckUP(Classes.Checkup checkup)
 {
     InitializeComponent();
     id               = checkup.id;
     doctorID         = checkup.user.id;
     this.checkup     = checkup;
     currentPatient   = checkup.patient;
     txtFullname.Text = checkup.patient.firstname + " " + checkup.patient.lastname;
     txtGender.Text   = checkup.patient.gender.ToString();
     txtAge.Text      = (DateTime.Now.Year - checkup.patient.birthdate.Year).ToString();
     txtBP.Text       = checkup.blood_pressure;
     txtPR.Text       = checkup.pulse_rate;
     txto2sat.Text    = checkup.o2sat;
     txtrr.Text       = checkup.respiratory_rate;
     txtGCS.Text      = checkup.gcs;
     cc               = checkup.cc;
     txtTemp.Text     = checkup.temperature + "°C";
     InitListView();
     InitListView2();
     PopulateList(checkup.patientID);
 }
Example #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateInput())
            {
                MessageBox.Show("Please fill up the box");
                return;
            }
            int currentID = Classes.CheckupHelper.SaveCheckUP(txtPatientID.Text, txtBP.Text, txtTemperature.Text, txtPulseRate.Text, txtTimeArrived.Text, txtCC.Text, 0, "", "", "Pending for Checkup", 0, txtRespiratoryRate.Text, txtGCS.Text, txtO2Sat.Text);

            if (currentID != 0)
            {
                Firebase.Firebase firebase = new Firebase.Firebase();
                Classes.Checkup   checkup  = new Classes.Checkup()
                {
                    id               = currentID,
                    patientID        = patient.id,
                    temperature      = txtTemperature.Text,
                    blood_pressure   = txtBP.Text,
                    pulse_rate       = txtPulseRate.Text,
                    respiratory_rate = txtRespiratoryRate.Text,
                    gcs              = txtGCS.Text,
                    o2sat            = txtO2Sat.Text,
                    date             = DateTime.Now,
                    cc               = txtCC.Text,
                    assesment        = "",
                    management       = "",
                    isTreated        = 0,
                    status           = "Pending of Checkup"
                };

                firebase.InsertCheckUp(checkup);
                MessageBox.Show("Successfully added");

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("Error added");
            }
        }