Exemplo n.º 1
0
        public void SubscribeToVitals(string patientId, string doctorId)
        {
            ICallbackDoctorMonitoringService callbackChannel = OperationContext.Current.GetCallbackChannel <ICallbackDoctorMonitoringService>();
            VitalsMonitorList vitalsList = VitalsMonitorList.Instance;

            vitalsList.Subscribe(patientId, doctorId, callbackChannel.ReceiveVitals);
        }
Exemplo n.º 2
0
        public void SubscribeToVitals(string patientId, string locationId)
        {
            ICallbackNurseMonitoringService callbackChannel =
                OperationContext.Current.GetCallbackChannel <ICallbackNurseMonitoringService>();
            VitalsMonitorList list = VitalsMonitorList.Instance;

            list.Subscribe(patientId, locationId, callbackChannel.ReceiveVitals);
        }
        public void Given_Valid_Arguments_Floor_Subscription_When_AlertUsers_Invoked_Then_Valid_Result_Asserted()
        {
            Callbacks         callbacks = new Callbacks();
            VitalsMonitorList subList   = VitalsMonitorList.Instance;

            subList.Subscribe("Pat111", "PIC-2", callbacks.VitalsCallback);
            PatientVitals vitals = new PatientVitals
            {
                PatientId = "Pat111",
                Vitals    = new List <Vitals>()
            };

            vitals.Vitals.Add(new Vitals
            {
                DeviceId = "Dev111",
                Value    = 50
            });
            vitalsAlertManager.AlertUsers(vitals);
            Assert.AreEqual("TestPassed", vitals.PatientId);
            subList.Unsubscribe("Pat111", "PIC-2");
        }
        public void Given_Invalid_Arguments_When_AlertUsers_Invoked_Then_Invalid_Result_Asserted()
        {
            Callbacks         callbacks = new Callbacks();
            VitalsMonitorList subList   = VitalsMonitorList.Instance;

            subList.Subscribe("Pat112", "Doc100", callbacks.VitalsCallback);
            PatientAlert alerts = new PatientAlert
            {
                CriticalAlerts = new List <DeviceAlert>(),
                MuteAlert      = false,
                PatientId      = "Pat111",
                WarningAlerts  = new List <DeviceAlert>()
            };

            alerts.WarningAlerts.Add(new DeviceAlert
            {
                DeviceId = "Dev111",
                Message  = "Warning",
                Value    = 86
            });
            alertManager.AlertUsers(alerts);
            Assert.AreNotEqual("TestPassed", alerts.PatientId);
            subList.Unsubscribe("Pat112", "Doc100");
        }