Exemple #1
0
        /// <summary>
        /// Requests the completed.
        /// </summary>
        /// <param name="receivedResponses">The received responses.</param>
        protected override void RequestCompleted(ReceivedResponses receivedResponses)
        {
            base.RequestCompleted(receivedResponses);

            //Publish visit changed event.
            var visitChangedEventArgs = new VisitChangedEventArgs
            {
                Sender             = this,
                VisitKey           = EditingDto.VisitKey,
                ClinicianKey       = EditingDto.ClinicianKey,
                PatientKey         = EditingDto.PatientKey,
                VisitStartDateTime = EditingDto.AppointmentStartDateTime
            };

            _eventAggregator.GetEvent <VisitChangedEvent> ().Publish(visitChangedEventArgs);

            var activityChangedEventArgs = new ActivityChangedEventArgs
            {
                Sender       = this,
                VisitKey     = EditingDto.VisitKey,
                ClinicianKey = EditingDto.ClinicianKey,
                PatientKey   = EditingDto.PatientKey
            };

            _eventAggregator.GetEvent <ActivityChangedEvent> ().Publish(activityChangedEventArgs);

            if (EditingDto.IsNidaDrugQuestionnaireCreated)
            {
                _userDialogService.ShowDialog(
                    "The following activity item(s) have been created: \nNidaDrugQuestionnaire", "Notification", UserDialogServiceOptions.Ok);
            }

            SetCanViewGuidanceFlag();
        }
        /// <summary>
        /// Requests the completed.
        /// </summary>
        /// <param name="receivedResponses">The received responses.</param>
        protected override void RequestCompleted(ReceivedResponses receivedResponses)
        {
            base.RequestCompleted(receivedResponses);

            //Publish visit changed event.
            var visitChangedEventArgs = new VisitChangedEventArgs
            {
                Sender             = this,
                VisitKey           = EditingDto.VisitKey,
                ClinicianKey       = EditingDto.ClinicianKey,
                PatientKey         = EditingDto.PatientKey,
                VisitStartDateTime = EditingDto.AppointmentStartDateTime
            };

            _eventAggregator.GetEvent <VisitChangedEvent> ().Publish(visitChangedEventArgs);

            var activityChangedEventArgs = new ActivityChangedEventArgs
            {
                Sender       = this,
                VisitKey     = EditingDto.VisitKey,
                ClinicianKey = EditingDto.ClinicianKey,
                PatientKey   = EditingDto.PatientKey
            };

            _eventAggregator.GetEvent <ActivityChangedEvent> ().Publish(activityChangedEventArgs);

            if (EditingDto.IsDast10ResultChanged)
            {
                _userDialogService.ShowDialog("DAST-10 guidance has been changed.", "Notification", UserDialogServiceOptions.Ok);
            }
        }
Exemple #3
0
        private void VisitChangedEventHandler(VisitChangedEventArgs obj)
        {
            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();

            requestDispatcher.Add(new GetDtoRequest <AppointmentDetailsDto> (EditingDto.Key));
            requestDispatcher.ProcessRequests(GetAppointmentDetailsRequestCompleted, HandleRequestDispatcherException);
        }
        /// <summary>
        /// Requests the completed.
        /// </summary>
        /// <param name="receivedResponses">The received responses.</param>
        protected override void RequestCompleted(ReceivedResponses receivedResponses)
        {
            base.RequestCompleted(receivedResponses);

            var visitChangedEventArgs = new VisitChangedEventArgs
            {
                Sender             = this,
                VisitKey           = EditingDto.VisitKey,
                ClinicianKey       = EditingDto.ClinicianKey,
                PatientKey         = EditingDto.PatientKey,
                VisitStartDateTime = EditingDto.AppointmentStartDateTime
            };

            _eventAggregator.GetEvent <VisitChangedEvent> ().Publish(visitChangedEventArgs);

            var createdActivityNames = GetCreatedActivityNames();

            if (createdActivityNames.Count <= 0)
            {
                return;
            }

            var activityChangedEventArgs = new ActivityChangedEventArgs
            {
                Sender       = this,
                VisitKey     = EditingDto.VisitKey,
                ClinicianKey = EditingDto.ClinicianKey,
                PatientKey   = EditingDto.PatientKey
            };

            _eventAggregator.GetEvent <ActivityChangedEvent> ().Publish(activityChangedEventArgs);

            var nameBuilder = new StringBuilder();
            var last        = createdActivityNames.Last();

            createdActivityNames.ForEach(
                name =>
            {
                if (name != last)
                {
                    nameBuilder.AppendFormat("{0}, ", name);
                }
                else
                {
                    nameBuilder.Append(name);
                }
            });

            var msg = "The following activity item(s) have been created: " + nameBuilder;

            _userDialogService.ShowDialog(msg, "Notification", UserDialogServiceOptions.Ok);
        }
        /// <summary>
        /// Filters the visit changed events.
        /// </summary>
        /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        public bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
        {
            if (visitChangedEventArgs.Sender == this)
            {
                return(false);
            }
            var isVisitChanged = visitChangedEventArgs.ClinicianKey == ClinicianSchedule.ClinicianKey ||
                                 ClinicianSchedule.ClinicianAppointments.Any(
                a => a.Key == visitChangedEventArgs.VisitKey);

            return(isVisitChanged &&
                   visitChangedEventArgs.VisitStartDateTime.Date == SelectedDate);
        }
Exemple #6
0
        private void RaiseVisitChanged()
        {
            var visitChangedEventArgs = new VisitChangedEventArgs
            {
                Sender             = this,
                ClinicianKey       = Visit.Staff.Key,
                VisitKey           = Visit.Key,
                VisitStartDateTime = Visit.AppointmentStartDateTime,
                PatientKey         = _patientKey,
                VisitStatus        = Visit.VisitStatus
            };

            _eventAggregator.GetEvent <VisitChangedEvent> ().Publish(visitChangedEventArgs);
        }
Exemple #7
0
        /// <summary>
        /// Filters the visit changed events.
        /// </summary>
        /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        public bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
        {
            var senderType = visitChangedEventArgs.Sender.GetType();

            if (senderType.BaseType != null)
            {
                if (senderType.BaseType.IsGenericType && senderType.BaseType.GetGenericTypeDefinition() == typeof(ActivityViewModelBase <>))
                {
                    return(false);
                }
            }
            if (visitChangedEventArgs.Sender == this)
            {
                return(false);
            }
            return(_visit != null && visitChangedEventArgs.VisitKey == _visit.Key);
        }
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
 {
     return(_activityList != null && _activityList.Select(a => a.VisitKey == visitChangedEventArgs.VisitKey).Any());
 }
Exemple #9
0
        private void RaiseVisitChanged()
        {
            var visitChangedEventArgs = new VisitChangedEventArgs
                {
                    Sender = this,
                    ClinicianKey = Visit.Staff.Key,
                    VisitKey = Visit.Key,
                    VisitStartDateTime = Visit.AppointmentStartDateTime,
                    PatientKey = _patientKey,
                    VisitStatus = Visit.VisitStatus
                };

            _eventAggregator.GetEvent<VisitChangedEvent> ().Publish ( visitChangedEventArgs );
        }
Exemple #10
0
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler( VisitChangedEventArgs visitChangedEventArgs )
 {
     Deployment.Current.InvokeIfNeeded ( () => GetVisitByVisitKeyAsync ( visitChangedEventArgs.VisitKey ) );
 }
Exemple #11
0
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents( VisitChangedEventArgs visitChangedEventArgs )
 {
     var senderType = visitChangedEventArgs.Sender.GetType ();
     if ( senderType.BaseType != null )
     {
         if ( senderType.BaseType.IsGenericType && senderType.BaseType.GetGenericTypeDefinition () == typeof( ActivityViewModelBase<> ) )
         {
             return false;
         }
     }
     if ( visitChangedEventArgs.Sender == this )
     {
         return false;
     }
     return _visit != null && visitChangedEventArgs.VisitKey == _visit.Key;
 }
Exemple #12
0
 private bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
 {
     return(visitChangedEventArgs.Sender != this &&
            EditingDto.Key == visitChangedEventArgs.VisitKey);
 }
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents( VisitChangedEventArgs visitChangedEventArgs )
 {
     return _activityList != null && _activityList.Select ( a => a.VisitKey == visitChangedEventArgs.VisitKey ).Any ();
 }
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="args">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler( VisitChangedEventArgs args )
 {
     GetAllActivitiesByClinicalCase ( _clinicalCaseKey );
 }
Exemple #15
0
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="args">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler(VisitChangedEventArgs args)
 {
     GetScheduledActivitiesByClinicalCase(_clinicalCaseKey);
     GetRecentActivitiesByClinicalCase(_clinicalCaseKey);
 }
Exemple #16
0
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
 {
     return((_scheduledActivities != null && _scheduledActivities.Select(a => a.VisitKey == visitChangedEventArgs.VisitKey).Any()) ||
            (_recentActivities != null && _recentActivities.Select(a => a.VisitKey == visitChangedEventArgs.VisitKey).Any()));
 }
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler(VisitChangedEventArgs obj)
 {
     Deployment.Current.InvokeIfNeeded(() => UpdateSchedule(true));
 }
Exemple #18
0
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents( VisitChangedEventArgs visitChangedEventArgs )
 {
     return ( _scheduledActivities != null && _scheduledActivities.Select ( a => a.VisitKey == visitChangedEventArgs.VisitKey ).Any () ) ||
            ( _recentActivities != null && _recentActivities.Select ( a => a.VisitKey == visitChangedEventArgs.VisitKey ).Any () );
 }
Exemple #19
0
 /// <summary>
 /// Handles the visit changed.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void HandleVisitChanged(VisitChangedEventArgs visitChangedEventArgs)
 {
     VisitStatusWellKnownName = visitChangedEventArgs.VisitStatus.WellKnownName;
     UpdateDtoReadOnly();
 }
Exemple #20
0
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="args">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler( VisitChangedEventArgs args )
 {
     GetScheduledActivitiesByClinicalCase ( _clinicalCaseKey );
     GetRecentActivitiesByClinicalCase ( _clinicalCaseKey );
 }
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents ( VisitChangedEventArgs visitChangedEventArgs )
 {
     if ( visitChangedEventArgs.Sender == this )
     {
         return false;
     }
     var isVisitChanged = visitChangedEventArgs.ClinicianKey == ClinicianSchedule.ClinicianKey ||
                           ClinicianSchedule.ClinicianAppointments.Any (
                               a => a.Key == visitChangedEventArgs.VisitKey );
     return isVisitChanged &&
            visitChangedEventArgs.VisitStartDateTime.Date == SelectedDate;
 }
Exemple #22
0
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler(VisitChangedEventArgs visitChangedEventArgs)
 {
     Deployment.Current.InvokeIfNeeded(() => GetVisitByVisitKeyAsync(visitChangedEventArgs.VisitKey));
 }
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler ( VisitChangedEventArgs obj )
 {
     Deployment.Current.InvokeIfNeeded ( () => UpdateSchedule ( true ) );
 }
Exemple #24
0
 /// <summary>
 /// Filters the visit changed events.
 /// </summary>
 /// <param name="visitChangedEventArgs">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterVisitChangedEvents(VisitChangedEventArgs visitChangedEventArgs)
 {
     return(EditingDto != null && EditingDto.VisitKey == visitChangedEventArgs.VisitKey && visitChangedEventArgs.VisitStatus != null);
 }
 /// <summary>
 /// Visits the changed event handler.
 /// </summary>
 /// <param name="args">The <see cref="Rem.Ria.PatientModule.VisitChangedEventArgs"/> instance containing the event data.</param>
 public void VisitChangedEventHandler(VisitChangedEventArgs args)
 {
     GetAllActivitiesByClinicalCase(_clinicalCaseKey);
 }