/// <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); }
/// <summary> /// Initializes a new instance of the <see cref="LabResultsViewModel"/> class. /// </summary> /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param> /// <param name="userDialogService">The user dialog service.</param> /// <param name="accessControlManager">The access control manager.</param> /// <param name="eventAggregator">The event aggregator.</param> /// <param name="cdsAlertService">The CDS alert service.</param> /// <param name="commandFactory">The command factory.</param> public LabResultsViewModel( IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory, IUserDialogService userDialogService, IAccessControlManager accessControlManager, IEventAggregator eventAggregator, ICdsAlertService cdsAlertService, ICommandFactory commandFactory) : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory) { _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory; _userDialogService = userDialogService; _cdsAlertService = cdsAlertService; var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher(); requestDispatcher.AddLookupValuesRequest("LabSpecimenType"); requestDispatcher.AddLookupValuesRequest("LabTestName"); IsLoading = true; requestDispatcher.ProcessRequests(LookUpValueRequestCompleted, HandleRequestDispatcherException); }
/// <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 ); }