Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VisitViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="cdsAlertService">The CDS alert service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="patientAccessService">The patient access service.</param>
        /// <param name="activityTypeToViewMapperService">The activity type to view mapper service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        public VisitViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            ICdsAlertService cdsAlertService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPatientAccessService patientAccessService,
            IActivityTypeToViewMapperService activityTypeToViewMapperService,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService               = userDialogService;
            _eventAggregator                 = eventAggregator;
            _cdsAlertService                 = cdsAlertService;
            _asyncRequestDispatcherFactory   = asyncRequestDispatcherFactory;
            _patientAccessService            = patientAccessService;
            _activityTypeToViewMapperService = activityTypeToViewMapperService;
            _navigationService               = navigationService;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SelectAddActivityCommand = commandFactoryHelper.BuildDelegateCommand <object> (() => SelectAddActivityCommand, ExecuteSelectAddActivity);
            SaveVisitCommand         = commandFactoryHelper.BuildDelegateCommand <object> (() => SaveVisitCommand, ExecuteSaveVisit);
            DetachProblemCommand     = commandFactoryHelper.BuildDelegateCommand <ProblemDto> (() => DetachProblemCommand, ExecuteDetachProblem);
            StatusUpdatedCommand     = commandFactoryHelper.BuildDelegateCommand <LookupValueDto> (
                () => StatusUpdatedCommand, ExecuteStatusUpdatedCommand, CanExecuteStatusUpdatedCommand);
            DropQueryCommand       = commandFactoryHelper.BuildDelegateCommand <DragDropQueryEventArgs> (() => DropQueryCommand, ExecuteDropQueryCommand);
            ShowGrowthChartCommand = commandFactoryHelper.BuildDelegateCommand(() => ShowGrowthChartCommand, ExecuteShowGrowthChartCommand);
            CloseViewCommand       = commandFactoryHelper.BuildDelegateCommand(() => CloseViewCommand, ExecuteCloseViewCommand);

            ProblemList = new ObservableCollection <ProblemDto> ();

            _eventAggregator.GetEvent <VisitChangedEvent> ().Subscribe(
                VisitChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterVisitChangedEvents);

            _eventAggregator.GetEvent <ClinicalCaseChangedEvent> ().Subscribe(
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents);

            _eventAggregator.GetEvent <ActivityChangedEvent> ().Subscribe(
                ActivityChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterActivityChangedEvents);
        }
Example #2
0
        public VisitListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IActivityTypeToViewMapperService activityTypeToViewMapper,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _eventAggregator          = eventAggregator;
            _navigationService        = navigationService;
            _activityTypeToViewMapper = activityTypeToViewMapper;
            _popupService             = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            GoToVisitCommand    = commandFactoryHelper.BuildDelegateCommand <object> (() => GoToVisitCommand, ExecuteGoToVisitCommand);
            GoToActivityCommand = commandFactoryHelper.BuildDelegateCommand <VisitActivityDto> (
                () => GoToActivityCommand, ExecuteGoToActivityCommand);
            RecentVisitCountChangedCommand = commandFactoryHelper.BuildDelegateCommand(
                () => RecentVisitCountChangedCommand, ExecuteRecentVisitCountChangedCommand);
            ScheduledVisitCountChangedCommand = commandFactoryHelper.BuildDelegateCommand(
                () => ScheduledVisitCountChangedCommand, ExecuteScheduledVisitCountChangedCommand);

            _eventAggregator.GetEvent <ClinicalCaseChangedEvent> ().Subscribe(
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents);

            _eventAggregator.GetEvent <ActivityChangedEvent> ().Subscribe(
                ActivityChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterActivityChangedEvents);

            _eventAggregator.GetEvent <VisitChangedEvent> ().Subscribe(
                VisitChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterVisitChangedEvents);

            RecentVisitCount = ScheduledVisitCount = _lastRecentVisitCount = _lastScheduledVisitCount = 2;
        }
Example #3
0
        public VisitListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IActivityTypeToViewMapperService activityTypeToViewMapper,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _navigationService = navigationService;
            _activityTypeToViewMapper = activityTypeToViewMapper;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            GoToVisitCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => GoToVisitCommand, ExecuteGoToVisitCommand );
            GoToActivityCommand = commandFactoryHelper.BuildDelegateCommand<VisitActivityDto> (
                () => GoToActivityCommand, ExecuteGoToActivityCommand );
            RecentVisitCountChangedCommand = commandFactoryHelper.BuildDelegateCommand (
                () => RecentVisitCountChangedCommand, ExecuteRecentVisitCountChangedCommand );
            ScheduledVisitCountChangedCommand = commandFactoryHelper.BuildDelegateCommand (
                () => ScheduledVisitCountChangedCommand, ExecuteScheduledVisitCountChangedCommand );

            _eventAggregator.GetEvent<ClinicalCaseChangedEvent> ().Subscribe (
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents );

            _eventAggregator.GetEvent<ActivityChangedEvent> ().Subscribe (
                ActivityChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterActivityChangedEvents );

            _eventAggregator.GetEvent<VisitChangedEvent> ().Subscribe (
                VisitChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterVisitChangedEvents );

            RecentVisitCount = ScheduledVisitCount = _lastRecentVisitCount = _lastScheduledVisitCount = 2;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VisitViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="cdsAlertService">The CDS alert service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="patientAccessService">The patient access service.</param>
        /// <param name="activityTypeToViewMapperService">The activity type to view mapper service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        public VisitViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            ICdsAlertService cdsAlertService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPatientAccessService patientAccessService,
            IActivityTypeToViewMapperService activityTypeToViewMapperService,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _cdsAlertService = cdsAlertService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _patientAccessService = patientAccessService;
            _activityTypeToViewMapperService = activityTypeToViewMapperService;
            _navigationService = navigationService;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            SelectAddActivityCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => SelectAddActivityCommand, ExecuteSelectAddActivity );
            SaveVisitCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => SaveVisitCommand, ExecuteSaveVisit );
            DetachProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> ( () => DetachProblemCommand, ExecuteDetachProblem );
            StatusUpdatedCommand = commandFactoryHelper.BuildDelegateCommand<LookupValueDto> (
                () => StatusUpdatedCommand, ExecuteStatusUpdatedCommand, CanExecuteStatusUpdatedCommand );
            DropQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs> ( () => DropQueryCommand, ExecuteDropQueryCommand );
            ShowGrowthChartCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowGrowthChartCommand, ExecuteShowGrowthChartCommand );
            CloseViewCommand = commandFactoryHelper.BuildDelegateCommand ( () => CloseViewCommand, ExecuteCloseViewCommand );

            ProblemList = new ObservableCollection<ProblemDto> ();

            _eventAggregator.GetEvent<VisitChangedEvent> ().Subscribe (
                VisitChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterVisitChangedEvents );

            _eventAggregator.GetEvent<ClinicalCaseChangedEvent> ().Subscribe (
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents );

            _eventAggregator.GetEvent<ActivityChangedEvent> ().Subscribe (
                ActivityChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterActivityChangedEvents );
        }