public void displayData(string[] patientData)
        {
            DbConnector dbConn = new DbConnector();

            dbConn.connect();

            Patient ptient = new Patient();

            ptient.Wing  = patientData[0];
            ptient.Floor = patientData[1];
            ptient.Bay   = patientData[2];
            ptient.Bed   = patientData[3];

            label15.Text = patientData[0];
            label16.Text = patientData[1];
            label17.Text = patientData[2];
            label18.Text = patientData[3];

            PatientHandler patHnd = new PatientHandler();

            string checkId     = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientId");
            string checkName   = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientName");
            string checkAge    = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientAge");
            string checkGender = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientGender");

            label11.Text = checkId;
            label12.Text = checkName;
            label13.Text = checkAge;
            label14.Text = checkGender;

            latestValues();
        }
示例#2
0
        public void getBasicPatientDetails()
        {
            if ((comboBox1.SelectedItem).ToString() != " - SELECT WING - " &&
                (comboBox2.SelectedItem).ToString() != " - SELECT FLOOR - " &&
                (comboBox3.SelectedItem).ToString() != " - SELECT BAY - " &&
                (comboBox4.SelectedItem).ToString() != " - SELECT BED - ")
            {
                DbConnector dbConn = new DbConnector();
                dbConn.connect();

                Patient ptient = new Patient();

                ptient.Wing  = (comboBox1.SelectedItem).ToString();
                ptient.Floor = (comboBox2.SelectedItem).ToString();
                ptient.Bay   = (comboBox3.SelectedItem).ToString();
                ptient.Bed   = (comboBox4.SelectedItem).ToString();

                PatientHandler patHnd = new PatientHandler();

                string checkId     = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientId");
                string checkName   = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientName");
                string checkAge    = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientAge");
                string checkGender = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientGender");

                label1.Text = checkId;
                label2.Text = checkName;
                label3.Text = checkAge;
                label4.Text = checkGender;

                label34.Text = (comboBox1.SelectedItem).ToString() + " → " + (comboBox2.SelectedItem).ToString() + " → " +
                               (comboBox3.SelectedItem).ToString();
                label36.Text = (comboBox4.SelectedItem).ToString().Remove(0, 4);
            }
            else
            {
                label1.Text = "No record found";
                label2.Text = "No record found";
                label3.Text = "No record found";
                label4.Text = "No record found";

                label34.Text = "- Wing → Floor - → Bay - ";
                label36.Text = "-";
            }
        }
示例#3
0
        public void pictureBox1_Click(object sender, EventArgs e)
        {
            string wingSelected  = (comboBox1.SelectedItem).ToString();
            string floorSelected = (comboBox2.SelectedItem).ToString();
            string baySelected   = (comboBox3.SelectedItem).ToString();
            string bedSelected   = (comboBox4.SelectedItem).ToString();

            DbConnector dbConn = new DbConnector();

            dbConn.connect();

            Patient ptient = new Patient();

            ptient.Wing  = wingSelected;
            ptient.Floor = floorSelected;
            ptient.Bay   = baySelected;
            ptient.Bed   = bedSelected;

            PatientHandler patHnd = new PatientHandler();

            string checkId = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientId");

            if (checkId != "No record found")
            {
                string[] patientData = new string[4] {
                    wingSelected, floorSelected, baySelected, bedSelected
                };

                PatientModuleReadingsConfiguration passPatientData = new PatientModuleReadingsConfiguration();
                passPatientData.Show();
                passPatientData.displayData(patientData);
            }
            else
            {
                MessageBox.Show("No patient found !");
            }
        }
示例#4
0
        public void runMonitor(object sender, EventArgs e)
        {
            var pulseRate     = checkBox1.Checked;
            var breathingRate = checkBox2.Checked;
            var bloodPressure = checkBox3.Checked;
            var temperature   = checkBox4.Checked;

            var criticalColor = Color.FromArgb(255, 8, 8);
            var inRiskColor   = Color.FromArgb(255, 214, 8);
            var normalColor   = Color.FromArgb(8, 255, 86);

            line = sr.ReadLine();

            if (line == null)
            {
                sr   = new StreamReader("CSV/ModuleReadingsA.csv");
                line = sr.ReadLine();
            }

            DbConnector dbConn = new DbConnector();

            dbConn.connect();

            Patient        ptient = new Patient();
            PatientHandler patHnd = new PatientHandler();

            ptient.Wing  = (comboBox1.SelectedItem).ToString();
            ptient.Floor = (comboBox2.SelectedItem).ToString();
            ptient.Bay   = (comboBox3.SelectedItem).ToString();
            ptient.Bed   = (comboBox4.SelectedItem).ToString();

            string getPatientId = patHnd.getPatientDetails(dbConn.getConn(), ptient, "patientId");

            int   minPulse     = 60;
            int   maxPulse     = 100;
            int   minBreath    = 12;
            int   maxBreath    = 20;
            int   minSystolic  = 80;
            int   maxSystolic  = 120;
            int   minDiastolic = 60;
            int   maxDiastolic = 80;
            float minTemp      = 35.2F;
            float maxTemp      = 36.1F;

            int pulseIntervalTime         = 1;
            int breathIntervalTime        = 1;
            int bloodPressureIntervalTime = 1;
            int temperatureIntervalTime   = 1;

            if (getPatientId != "No record found")
            {
                ModuleReadingsHandler mRHand = new ModuleReadingsHandler();
                minPulse          = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "pulseRMin", getPatientId));
                maxPulse          = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "pulseRMax", getPatientId));
                pulseIntervalTime = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "pulseRIntTime", getPatientId));

                minBreath          = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "breathRMin", getPatientId));
                maxBreath          = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "breathRMax", getPatientId));
                breathIntervalTime = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "breathRIntTime", getPatientId));

                minSystolic  = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "systolicMin", getPatientId));
                maxSystolic  = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "systolicMax", getPatientId));
                minDiastolic = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "diastolicMin", getPatientId));
                maxDiastolic = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "diastolicMax", getPatientId));
                bloodPressureIntervalTime = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "bloodPIntTime", getPatientId));

                minTemp = float.Parse(mRHand.getModuleReading(dbConn.getConn(), "tempMin", getPatientId));
                maxTemp = float.Parse(mRHand.getModuleReading(dbConn.getConn(), "tempMax", getPatientId));
                temperatureIntervalTime = Int32.Parse(mRHand.getModuleReading(dbConn.getConn(), "tempIntTime", getPatientId));
            }

            PatientReadings        pRead    = new PatientReadings();
            PatientReadingsHandler pReadHnd = new PatientReadingsHandler();

            try
            {
                string[] data = line.Split(',');

                readingsList.Add(Int32.Parse(data[0]));

                //Pulse Rate Readings
                if (counter == pulseRateCounter && pulseRate != false)
                {
                    label10.Text = data[0];
                    label14.Text = (maxPulse).ToString();
                    label15.Text = (minPulse).ToString();

                    if (Int32.Parse(data[0]) == 0)
                    {
                        labelBorder(10, "Critical");
                        label14.ForeColor = criticalColor;
                        label15.ForeColor = criticalColor;
                    }
                    else if (Int32.Parse(data[0]) > maxPulse || Int32.Parse(data[0]) < minPulse)
                    {
                        labelBorder(10, "Risky");

                        if (Int32.Parse(data[0]) > maxPulse)
                        {
                            label14.ForeColor = inRiskColor;
                            label15.ForeColor = normalColor;
                        }
                        else
                        {
                            label14.ForeColor = normalColor;
                            label15.ForeColor = inRiskColor;
                        }
                    }
                    else if (Int32.Parse(data[0]) >= minPulse && Int32.Parse(data[0]) <= maxPulse)
                    {
                        labelBorder(10, "Normal");
                        label14.ForeColor = normalColor;
                        label15.ForeColor = normalColor;
                    }

                    pulseRateCounter = pulseRateCounter + pulseIntervalTime;
                }

                //Breathing Rate Readings
                if (counter == breathingRateCounter && breathingRate != false)
                {
                    label11.Text = data[1];
                    label16.Text = (maxBreath).ToString();
                    label17.Text = (minBreath).ToString();

                    if (Int32.Parse(data[1]) == 0)
                    {
                        labelBorder(11, "Critical");
                        label16.ForeColor = criticalColor;
                        label17.ForeColor = criticalColor;
                    }
                    else if ((Int32.Parse(data[1]) > maxBreath || Int32.Parse(data[1]) < minBreath))
                    {
                        labelBorder(11, "Risky");

                        if (Int32.Parse(data[1]) > maxBreath)
                        {
                            label16.ForeColor = inRiskColor;
                            label17.ForeColor = normalColor;
                        }
                        else
                        {
                            label16.ForeColor = normalColor;
                            label17.ForeColor = inRiskColor;
                        }
                    }
                    else if (Int32.Parse(data[1]) >= minBreath && Int32.Parse(data[1]) <= maxBreath)
                    {
                        labelBorder(11, "Normal");
                        label16.ForeColor = normalColor;
                        label17.ForeColor = normalColor;
                    }

                    breathingRateCounter = breathingRateCounter + breathIntervalTime;
                }

                //Blood Pressure  Readings
                if (counter == bloodPressureCounter && bloodPressure != false)
                {
                    label12.Text = data[2] + "/" + data[3];
                    label18.Text = (maxSystolic).ToString();
                    label19.Text = (minSystolic).ToString();
                    label20.Text = (maxDiastolic).ToString();
                    label21.Text = (minDiastolic).ToString();

                    if (Int32.Parse(data[2]) == 0 || (Int32.Parse(data[3]) == 0))
                    {
                        labelBorder(12, "Critical");
                        label18.ForeColor = criticalColor;
                        label19.ForeColor = criticalColor;
                        label20.ForeColor = criticalColor;
                        label21.ForeColor = criticalColor;
                    }
                    else if ((Int32.Parse(data[2]) > maxSystolic || Int32.Parse(data[2]) < minSystolic) || (Int32.Parse(data[3]) > maxDiastolic || Int32.Parse(data[3]) < minDiastolic))
                    {
                        labelBorder(12, "Risky");

                        if (Int32.Parse(data[2]) > maxSystolic)
                        {
                            label18.ForeColor = inRiskColor;
                            label19.ForeColor = normalColor;
                        }
                        else if (Int32.Parse(data[2]) < minSystolic)
                        {
                            label18.ForeColor = normalColor;
                            label19.ForeColor = inRiskColor;
                        }

                        if (Int32.Parse(data[3]) > maxDiastolic)
                        {
                            label20.ForeColor = inRiskColor;
                            label21.ForeColor = normalColor;
                        }
                        else if (Int32.Parse(data[3]) < minDiastolic)
                        {
                            label20.ForeColor = normalColor;
                            label21.ForeColor = inRiskColor;
                        }
                    }
                    else if (Int32.Parse(data[2]) >= minSystolic && Int32.Parse(data[2]) <= maxSystolic && Int32.Parse(data[3]) >= minSystolic && Int32.Parse(data[3]) <= maxSystolic)
                    {
                        labelBorder(12, "Normal");
                        label18.ForeColor = normalColor;
                        label19.ForeColor = normalColor;
                        label20.ForeColor = normalColor;
                        label21.ForeColor = normalColor;
                    }

                    bloodPressureCounter = bloodPressureCounter + bloodPressureIntervalTime;
                }

                //Temperature Readings
                if (counter == temperatureCounter && temperature != false)
                {
                    label13.Text = data[4] + "°C";
                    label22.Text = (maxTemp).ToString();
                    label23.Text = (minTemp).ToString();

                    if (float.Parse(data[4]) == 0)
                    {
                        labelBorder(13, "Critical");
                        label22.ForeColor = criticalColor;
                        label23.ForeColor = criticalColor;
                    }
                    else if (float.Parse(data[4]) > maxTemp || float.Parse(data[4]) < minTemp)
                    {
                        labelBorder(13, "Risky");

                        if (float.Parse(data[4]) > maxTemp)
                        {
                            label22.ForeColor = inRiskColor;
                            label23.ForeColor = normalColor;
                        }
                        else
                        {
                            label22.ForeColor = normalColor;
                            label23.ForeColor = inRiskColor;
                        }
                    }
                    else if (float.Parse(data[4]) >= minTemp && float.Parse(data[4]) <= maxTemp)
                    {
                        labelBorder(13, "Normal");
                        label22.ForeColor = normalColor;
                        label23.ForeColor = normalColor;
                    }

                    temperatureCounter = temperatureCounter + temperatureIntervalTime;
                }

                if (getPatientId != "No record found")
                {
                    pRead.PatientId     = Int32.Parse(getPatientId);
                    pRead.PulseRate     = Int32.Parse(data[0]);
                    pRead.BreathingRate = Int32.Parse(data[1]);
                    pRead.Systolic      = Int32.Parse(data[2]);
                    pRead.Diastolic     = Int32.Parse(data[3]);
                    pRead.Temperature   = float.Parse(data[4]);
                    pRead.DateTime      = DateTime.Now.ToString();

                    pReadHnd.addPatientReading(dbConn.getConn(), pRead);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("DID NOT RECEIVE ANY DETECTION OF THE READING : " + ex);
                run_Monitor.Stop();
            }

            if (counter == 5)
            {
                counter              = 0;
                pulseRateCounter     = 0;
                bloodPressureCounter = 0;
                breathingRateCounter = 0;
                temperatureCounter   = 0;
            }
            else
            {
                counter++;
            }

            realCounter++;
        }