public void patientDataCreatedCorrectly()
		{
			var pd = new PatientData (dataLine1);
            patientDataTestOK1(pd);
			var pd2 = new PatientData (dataLine2);
            patientDataTestOK2(pd2);
		}
        public Object CreateandReturnObj(PatientClassesEnumeration objectToGet)
        {
            object createdObject = null;
            switch (objectToGet)
            {
                case PatientClassesEnumeration.PatientAlarmer:
                    PatientAlarmer alarmer = new PatientAlarmer();
                    createdObject = alarmer;
                    break;

                case PatientClassesEnumeration.PatientDataReader:
                    PatientDataReader dataReader = new PatientDataReader();
                    createdObject = dataReader;
                    break;

                case PatientClassesEnumeration.PatientData:
                    PatientData patientData = new PatientData();
                    createdObject = patientData;
                    break;

                default:
                    throw new ArgumentException("Invalid parameter passed");
            }
            return createdObject;
        }
        void createPatients()
        {
            dataFile = new StreamReader(patientDatbasePath);
            string text;
            dataFile.ReadLine();
            //dataFile.ReadLine();
            while ((text = dataFile.ReadLine()) != null)
            {
                //text = dataFile.ReadLine();
                string[] dataItems = text.Split(',');
                int pNum = int.Parse(dataItems[0]);
                string pName = dataItems[1];
                int pl = int.Parse(dataItems[2]);
                int ph = int.Parse(dataItems[3]);
                int bl = int.Parse(dataItems[4]);
                int bh = int.Parse(dataItems[5]);
                int sl = int.Parse(dataItems[6]);
                int sh = int.Parse(dataItems[7]);
                int dl = int.Parse(dataItems[8]);
                int dh = int.Parse(dataItems[9]);
                int tl = int.Parse(dataItems[10]);
                int th = int.Parse(dataItems[11]);
                Patient newPatient = new Patient(pNum, pName, pl, ph, bl, bh, sl, sh, dl, dh, tl, th);
                PatientData pd = new PatientData();
                newPatient.setPatientData(pd);
                PatientAlarmer alarm  = new PatientAlarmer(newPatient, window);
                newPatient.setAlarm(alarm);
                bay.Add(newPatient);

            }
        }
 void patientDataTestOK2(PatientData pd)
 {
     Assert.AreEqual(62.0f, pd.PulseRate);
     Assert.AreEqual(21.0f, pd.BreathingRate);
     Assert.AreEqual(102.0f, pd.SystolicBloodPressure);
     Assert.AreEqual(72.0f, pd.DiastolicBloodPressure);
     Assert.AreEqual(38.0f, pd.Temperature);
 }
 void patientDataTestOK1(PatientData pd)
 {
     Assert.AreEqual(60.0f, pd.PulseRate);
     Assert.AreEqual(20.0f, pd.BreathingRate);
     Assert.AreEqual(100.0f, pd.SystolicBloodPressure);
     Assert.AreEqual(70.0f, pd.DiastolicBloodPressure);
     Assert.AreEqual(37.7f, pd.Temperature);
 }
        public void patientDataSetCorrectly()
        {
            var pd = new PatientData();
            pd.SetPatientData(dataLine1);
            patientDataTestOK1(pd);

            var pd2 = new PatientData();
            pd2.SetPatientData(dataLine2);
            patientDataTestOK2(pd2);
        }
 public Patient(int pl, int ph, int bl, int bh, int sl, int sh, int dl, int dh, int tl, int th, PatientData _pdata)
 {
     pulseRateLower = pl;
     pulseRateHigher = ph;
     breathingRateLower = bl;
     breathingRateHigher = bh;
     systolicPressureLower = sl;
     systolicPressureHigher = sh;
     diastolicPressureLower = dl;
     diastolicPressureHigher = dh;
     temperatureLower = tl;
     temperatureHigher = th;
     pData = _pdata;
 }
        void setupComponents()
        {
            _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData);
            _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader);
            _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);

            _alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm);
            _tickTimer.Stop();
            _tickTimer.Interval= TimeSpan.FromMilliseconds(1000);
            _tickTimer.Tick += new EventHandler(updateReadings);
        }
Exemple #9
0
        void setupComponents()
        {
            _patientData  = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData);
            _patientData1 = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData);
            _dataReader   = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader);
            _dataReader1  = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader);
            _alarmer      = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer.BreathingRateAlarm          += new EventHandler(soundMutableAlarm);
            _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.PulseRateAlarm             += new EventHandler(soundMutableAlarm);
            _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.TemperatureAlarm           += new EventHandler(soundMutableAlarm);

            /*string fileName = @"..\..\..\" + "Bed 1" + ".csv";
             * _dataReader.Connect(fileName);
             *
             * string fileName2 = @"..\..\..\" + "Bed 2" + ".csv";
             * _dataReader1.Connect(fileName2);*/

            _tickTimer.Stop();
            _tickTimer.Interval = TimeSpan.FromMilliseconds(1000);
            _tickTimer.Tick    += new EventHandler(updateReadings);
            _tickTimer.Start();
        }
 public void updateReadings(object sender, EventArgs e)
 {
     PatientData patientReadings;
     for (int i = 0; i < 8; i++)
     {
         _mainWindow.ListOfRectangles[i].Alarming(false); //Settings rectangles to green if bed alarms are not alarming.
     }
     for (int i = 0; i < 8; i++)
     {
         patientReadings = new PatientData(readers[i].getData());     // creates new instance of reader
         if (readings.Count == 8)
         {
             readings[i] = patientReadings; //assigns temporary readings to readings list.
         }
         else
         {
             readings.Add(patientReadings); //adds patient readings to patient readings list.
         }
         alarmers[i].ReadingsTest(readings[i], _mainWindow, i); //alarmers function to test if readings are outside of set limits.
     } 
     UpdateAllReadingsToScreen(); //displays all patient readings to screen
 }
        void setupComponents()
        {
            _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData);
            _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader);
            _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer1 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer2 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer3 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer4 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer5 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer6 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
            _alarmer7 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);

            _alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
            _alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm);

            _alarmer1.BreathingRateAlarm += new EventHandler(soundMutableAlarm1);
            _alarmer1.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm1);
            _alarmer1.PulseRateAlarm += new EventHandler(soundMutableAlarm1);
            _alarmer1.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm1);
            _alarmer1.TemperatureAlarm += new EventHandler(soundMutableAlarm1);

            _alarmer2.BreathingRateAlarm2 += new EventHandler(soundMutableAlarm2);
            _alarmer2.DiastolicBloodPressureAlarm2 += new EventHandler(soundMutableAlarm2);
            _alarmer2.PulseRateAlarm2 += new EventHandler(soundMutableAlarm2);
            _alarmer2.SystolicBloodPressureAlarm2 += new EventHandler(soundMutableAlarm2);
            _alarmer2.TemperatureAlarm2 += new EventHandler(soundMutableAlarm2);

            _alarmer3.BreathingRateAlarm3 += new EventHandler(soundMutableAlarm3);
            _alarmer3.DiastolicBloodPressureAlarm3 += new EventHandler(soundMutableAlarm3);
            _alarmer3.PulseRateAlarm3 += new EventHandler(soundMutableAlarm3);
            _alarmer3.SystolicBloodPressureAlarm3 += new EventHandler(soundMutableAlarm3);
            _alarmer3.TemperatureAlarm3 += new EventHandler(soundMutableAlarm3);

            _alarmer4.BreathingRateAlarm4 += new EventHandler(soundMutableAlarm4);
            _alarmer4.DiastolicBloodPressureAlarm4 += new EventHandler(soundMutableAlarm4);
            _alarmer4.PulseRateAlarm4 += new EventHandler(soundMutableAlarm4);
            _alarmer4.SystolicBloodPressureAlarm4 += new EventHandler(soundMutableAlarm4);
            _alarmer4.TemperatureAlarm4 += new EventHandler(soundMutableAlarm4);

            _alarmer5.BreathingRateAlarm5 += new EventHandler(soundMutableAlarm5);
            _alarmer5.DiastolicBloodPressureAlarm5 += new EventHandler(soundMutableAlarm5);
            _alarmer5.PulseRateAlarm5 += new EventHandler(soundMutableAlarm5);
            _alarmer5.SystolicBloodPressureAlarm5 += new EventHandler(soundMutableAlarm5);
            _alarmer5.TemperatureAlarm5 += new EventHandler(soundMutableAlarm5);

            _alarmer6.BreathingRateAlarm6 += new EventHandler(soundMutableAlarm6);
            _alarmer6.DiastolicBloodPressureAlarm6 += new EventHandler(soundMutableAlarm6);
            _alarmer6.PulseRateAlarm6 += new EventHandler(soundMutableAlarm6);
            _alarmer6.SystolicBloodPressureAlarm6 += new EventHandler(soundMutableAlarm6);
            _alarmer6.TemperatureAlarm6 += new EventHandler(soundMutableAlarm6);

            _alarmer7.BreathingRateAlarm7 += new EventHandler(soundMutableAlarm7);
            _alarmer7.DiastolicBloodPressureAlarm7 += new EventHandler(soundMutableAlarm7);
            _alarmer7.PulseRateAlarm7 += new EventHandler(soundMutableAlarm7);
            _alarmer7.SystolicBloodPressureAlarm7 += new EventHandler(soundMutableAlarm7);
            _alarmer7.TemperatureAlarm7 += new EventHandler(soundMutableAlarm7);

            _tickTimer.Stop();
            _tickTimer.Interval = TimeSpan.FromMilliseconds(1000);
            _tickTimer.Tick += new EventHandler(updateReadings);
        }
 public void setPatientData(PatientData pdata)
 {
     pData = pdata;
 }
 void setupComponents()
 {
     _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData);
     _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader);
     _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer);
     #region old code
     //_alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm);
     //_alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
     //_alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm);
     //_alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm);
     //_alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm);
     foreach (Patient p in pCreator.bay)
     {
         foreach (Mod _mods in p.pAlarmer.Mods)
         {
             _mods.ModAlarm += new EventHandler(soundMutableAlarm);
         }
         //p.pAlarmer.Mod1Alarm += new EventHandler(soundMutableAlarm);
         //p.pAlarmer.Mod3BAlarm += new EventHandler(soundMutableAlarm);
         //p.pAlarmer.Mod2Alarm += new EventHandler(soundMutableAlarm);
         //p.pAlarmer.Mod3AAlarm += new EventHandler(soundMutableAlarm);
         //p.pAlarmer.Mod4Alarm += new EventHandler(soundMutableAlarm);
     }
     #endregion
     _tickTimer.Start();
     _tickTimer.Interval= TimeSpan.FromMilliseconds(1000);
     _tickTimer.Tick += new EventHandler(updateReadings);
 }