public TaskAndTakGroupListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;

            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<SystemRoleDto> ();

            InitializeGroupingDescriptions ();

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

            CreateTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => CreateTaskOrTaskGroupCommand, ExecuteCreateTaskOrTaskGroupCommand );
            EditTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => EditTaskOrTaskGroupCommand, ExecuteEditTaskOrTaskGroupCommand );
            CloneTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => CloneTaskOrTaskGroupCommand, ExecuteCloneTaskOrTaskGroupCommand );
            DeleteTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => DeleteTaskOrTaskGroupCommand, ExecuteDeleteTaskOrTaskGroup );
        }
        public MainViewModel(IPopupService popupService, SynchronizationContext synchonizationContext)
        {
            var client = new MobileServiceClient(
                _mobileServiceUrl,
                _mobileServiceKey);

            _liveAuthClient = new LiveAuthClient(_mobileServiceUrl);
            
            // Apply a ServiceFilter to the mobile client to help with our busy indication
            _mobileServiceClient = client.WithFilter(new DotoServiceFilter(
                busy =>
                {
                    IsBusy = busy;
                }));
            _popupService = popupService;
            _synchronizationContext = synchonizationContext;
            _invitesTable = _mobileServiceClient.GetTable<Invite>();
            _itemsTable = _mobileServiceClient.GetTable<Item>();
            _profilesTable = _mobileServiceClient.GetTable<Profile>();
            _listMembersTable = _mobileServiceClient.GetTable<ListMembership>();
            _devicesTable = _mobileServiceClient.GetTable<Device>();
            _settingsTable = _mobileServiceClient.GetTable<Setting>();

            SetupCommands();

            LoadSettings();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageCenterWorkspaceViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="dispatcherFactory">The dispatcher factory.</param>
        public MessageCenterWorkspaceViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IPopupService popupService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory dispatcherFactory
            )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _dispatcherFactory = dispatcherFactory;
            IncomingMail = new ObservableCollection<DirectMailDto>();
            SentMail = new ObservableCollection<DirectMailDto>();

            CommandFactoryHelper<MessageCenterWorkspaceViewModel> commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );
            SendNewMailCommand = commandFactoryHelper.BuildDelegateCommand ( () => SendNewMailCommand, ExecuteSendNewMail );
            OpenSaveToExternalPatientHistoryCommand =
                commandFactoryHelper.BuildDelegateCommand<string> (
                    () => OpenSaveToExternalPatientHistoryCommand, ExecuteOpenSaveToExternalPatientHistory );
            DownloadMailAttachmentCommand = commandFactoryHelper.BuildDelegateCommand<string>(
                () => DownloadMailAttachmentCommand, DownloadMailAttachment);
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs>(() => DragQueryCommand, ExecuteDragQuery);

            eventAggregator.GetEvent<MessageSentEvent> ().Subscribe ( HandleMessageSent );

            SetupImapFolderTimers ();
            RequestInboxContent ( null, null );
            RequestSentItemsContent ( null, null );
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendC32ViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        public SendC32ViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICurrentUserContextService currentUserContextService )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;
            _popupService = popupService;

            currentUserContextService.RegisterForContext ( ( cuc, b ) => _currentContext = cuc );

            // UI Commands
            SendC32Command = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => SendC32Command, ExecuteSendC32 );

            OpenAddressBookCommand = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => OpenAddressBookCommand, ExecuteOpenAddressBook );

            // Navigation Commands

            OpenSendC32ViewCommand = NavigationCommandManager.BuildCommand ( () => OpenSendC32ViewCommand, NavigateToOpenSendC32ViewCommand );

            _eventAggregator.GetEvent<DirectAddressRecipientSelectedEvent> ().Subscribe ( HandleDirectAddressRecipientSelectedEventHandler );
        }
        public JobFunctionListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<SystemRoleDto> ();

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

            CreateJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand ( () => CreateJobFunctionCommand, ExecuteCreateJobFunctionCommand );
            EditJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => EditJobFunctionCommand, ExecuteEditJobFunctionCommand );
            CloneJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => CloneJobFunctionCommand, ExecuteCloneJobFunctionCommand );
            DeleteJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => DeleteJobFunctionCommand, ExecuteDeleteJobFunction );
        }
        public ProgramOfferingListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramOfferingDto> ();
            _userDialogService = userDialogService;
            _popupService = popupService;

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

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );
            ShowProgramOfferingAddCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => ShowProgramOfferingAddCommand, ExecuteShowProgramOfferingAddCommand );
            ShowProgramOfferingEditCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ShowProgramOfferingEditCommand, ExecuteShowProgramOfferingEditCommand );
            DeleteProgramOfferingCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => DeleteProgramOfferingCommand, ExecuteDeleteProgramOfferingCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;
            InitializeGroupingDescriptions ();
        }
        public EditJobFunctionViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper ();

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

            SaveJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand ( () => SaveJobFunctionCommand, ExecuteSaveJobFunctionCommand );
            GrantSystemRoleCommand = commandFactoryHelper.BuildDelegateCommand ( () => GrantSystemRoleCommand, ExecuteGrantSystemRoleCommand );
            RevokeSystemRoleCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => RevokeSystemRoleCommand, ExecuteRevokeSystemRoleCommand );
            CancelCommand = commandFactoryHelper.BuildDelegateCommand ( () => CancelCommand, ExecuteCancelCommand );

            CreateCommand = NavigationCommandManager.BuildCommand ( () => CreateCommand, NavigateToCreateCommand );
            EditCommand = NavigationCommandManager.BuildCommand ( () => EditCommand, NavigateToEditCommand );
            CloneCommand = NavigationCommandManager.BuildCommand ( () => CloneCommand, NavigateToCloneCommand );
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomePageViewModel"/> class.
 /// </summary>
 /// <param name="accessControlManager">The access control manager.</param>
 /// <param name="navigationService">The navigation service.</param>
 /// <param name="commandFactory">The command factory.</param>
 /// <param name="popupService">The popup service.</param>
 public HomePageViewModel(
     IAccessControlManager accessControlManager,
     INavigationService navigationService,
     ICommandFactory commandFactory,
     IPopupService popupService)
     : base(accessControlManager, commandFactory)
 {
     _navigationService = navigationService;
     _popupService = popupService;
 }
        public FrontDeskDashboardViewModel(
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _navigationService = navigationService;
            _popupService = popupService;

            CreateAppointmentCommand = NavigationCommandManager.BuildCommand ( () => CreateAppointmentCommand, NavigateToCreateAppointmentCommand );
            MakePaymentCommand = NavigationCommandManager.BuildCommand ( () => MakePaymentCommand, NavigateToMakePaymentCommand );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateBillingOfficeButtonViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        public CreateBillingOfficeButtonViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IPopupService popupService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            CreateBillingOfficeCommand = commandFactoryHelper.BuildDelegateCommand (
                () => CreateBillingOfficeCommand, ExecuteCreateBillingOfficeCommand, () => !_hasBillingOffice );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HealthProvidersDirectoryViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="dispatcherFactory">The dispatcher factory.</param>
        public HealthProvidersDirectoryViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IPopupService popupService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory dispatcherFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _eventAggregator = eventAggregator;

            // [Agatha] Dispatcher factory
            _dispatcherFactory = dispatcherFactory;

            // Using the Command Factory Helper, build all the commands used by this ViewModel.
            // This is required because the generated command(s) are [Castle] Dynamic Proxies, which run special logic (i.e.: Run Rule Engine Rules)
            // before the Execute Action is called. See Pillar.FluentRuleEngine.CheckRulesInterceptor for an example.
            CommandFactoryHelper<HealthProvidersDirectoryViewModel> commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            // UI Commands
            DoneCommand = commandFactoryHelper.BuildDelegateCommand ( () => DoneCommand, ExecuteDoneCommand );

            // Navigation Command

            // Event Aggregator Events Subscription

            Providers = new ObservableCollection<HealthProviderEntryDto>
                {
                    new HealthProviderEntryDto
                        {
                            FirstName = "John",
                            LastName = "Snow",
                            Mail = "[email protected]",
                            OrganizationName = "IniTech",
                            Specialization = "Cardiologist",
                            TelephoneNumber = "(123)456-7890"
                        }
                };

            Directories = new ObservableCollection<Tuple<string, string>>
                {
                    new Tuple<string, string> ( "EHRDoctors", "nhin.medibridge.net" )
                };

            SelectedDirectory = Directories.First ();
        }
示例#12
0
        public PayorTypeListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;

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

            ShowPayorTypeAddCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowPayorTypeAddCommand, ExecuteShowPayorTypeAddCommand );
            ShowPayorTypeEditCommand = commandFactoryHelper.BuildDelegateCommand<PayorTypeDto> (
                () => ShowPayorTypeEditCommand, ExecuteShowPayorTypeEditCommand );
        }
示例#13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SelfPaymentViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public SelfPaymentViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;

            PageSize = 50;

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

            AddSelfPaymentCommand = commandFactoryHelper.BuildDelegateCommand ( () => AddSelfPaymentCommand, ExecuteAddSelfPaymentCommand );
            DeleteSelfPaymentCommand = commandFactoryHelper.BuildDelegateCommand<SelfPaymentDto> ( () => DeleteSelfPaymentCommand, ExecuteDeleteSelfPaymentCommand );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EditPayorCoverageViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public EditPayorCoverageViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;

            CreateCommand = NavigationCommandManager.BuildCommand ( () => CreateCommand, OnNavigateToCreateCommand );
            EditCommand = NavigationCommandManager.BuildCommand ( () => EditCommand, OnNavigateToEditCommand );

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

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(() => SaveCommand, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor<EditPayorCoverageViewModel, IDataTransferObject>();
        }
示例#15
0
        public ProgramListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramDto> ();
            _userDialogService = userDialogService;
            _popupService = popupService;
            _eventAggregator = eventAggregator;

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

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );
            ShowProgramAddCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => ShowProgramAddCommand, ExecuteShowProgramAddCommand );
            ShowProgramEditCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> (
                () => ShowProgramEditCommand, ExecuteShowProgramEditCommand );
            DeleteProgramCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> ( () => DeleteProgramCommand, ExecuteDeleteProgramCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;
            InitializeGroupingDescriptions ();

            _eventAggregator.GetEvent<ProgramChangedEvent> ().Subscribe (
                ProgramChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterProgramChangedEvents );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateBillingOfficeViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public CreateBillingOfficeViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            INavigationService navigationService,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _navigationService = navigationService;
            _userDialogService = userDialogService;
            _popupService = popupService;
            _eventAggregator = eventAggregator;
            currentUserContextService.RegisterForContext ( ( u, b ) => { _currentStaff = u.Staff; } );

            var commandFactoryHelper = CreateCommandFactoryHelper ( commandFactory );
            CreateCommand = commandFactoryHelper.BuildDelegateCommand ( () => CreateCommand, ExecuteCreateCommand );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EditTaskAndTaskGroupViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public EditTaskAndTaskGroupViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            _permissionCollectionView = new PagedCollectionView ( new List<SystemPermissionDto> () );
            _taskCollectionView = new PagedCollectionView ( new List<SystemRoleDto> () );
            _taskGroupCollectionView = new PagedCollectionView ( new List<SystemRoleDto> () );

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

            CloseCommand = commandFactoryHelper.BuildDelegateCommand ( () => CloseCommand, ExecuteCloseCommand );

            RoleWorkingModeChangedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => RoleWorkingModeChangedCommand, ExecuteRoleWorkingModeChangedCommand );
            PermissionToBeRemovedCheckedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => PermissionToBeRemovedCheckedCommand, ExecutePermissionToBeRemovedCheckedCommand );
            PermissionToBeAddedCheckedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => PermissionToBeAddedCheckedCommand, ExecutePermissionToBeAddedCheckedCommand );
            TaskToBeRemovedCheckedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => TaskToBeRemovedCheckedCommand, ExecuteTaskToBeRemovedCheckedCommand );
            TaskToBeAddedCheckedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => TaskToBeAddedCheckedCommand, ExecuteTaskToBeAddedCheckedCommand );

            AddToTaskCommand = commandFactoryHelper.BuildDelegateCommand (
                () => AddToTaskCommand, ExecuteAddToTaskCommand, CanExecuteAddToTaskCommand );
            CreateNewTaskCommand = commandFactoryHelper.BuildDelegateCommand (
                () => CreateNewTaskCommand, ExecuteCreateNewTaskCommand, CanExecuteCreateNewTaskCommand );
            RenameTaskCommand = commandFactoryHelper.BuildDelegateCommand (
                () => RenameTaskCommand, ExecuteRenameTaskCommand, CanExecuteRenameTaskCommand );
            SaveTaskNameCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => SaveTaskNameCommand, ExecuteSaveTaskNameCommand );
            CancelSaveTaskNameCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => CancelSaveTaskNameCommand, ExecuteCancelSaveTaskNameCommand );
            RemoveFromTaskCommand = commandFactoryHelper.BuildDelegateCommand (
                () => RemoveFromTaskCommand, ExecuteRemoveFromTaskCommand, CanExecuteRemoveFromTaskCommand );

            AddToTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand (
                () => AddToTaskGroupCommand, ExecuteAddToTaskGroupCommand, CanExecuteAddToTaskGroupCommand );
            CreateNewTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand (
                () => CreateNewTaskGroupCommand, ExecuteCreateNewTaskGroupCommand, CanExecuteCreateNewTaskGroupCommand );
            RenameTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand (
                () => RenameTaskGroupCommand, ExecuteRenameTaskGroupCommand, CanExecuteRenameTaskGroupCommand );
            SaveTaskGroupNameCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => SaveTaskGroupNameCommand, ExecuteSaveTaskGroupNameCommand );
            CancelSaveTaskGroupNameCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => CancelSaveTaskGroupNameCommand, ExecuteCancelSaveTaskGroupNameCommand );
            RemoveFromTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand (
                () => RemoveFromTaskGroupCommand, ExecuteRemoveFromTaskGroupCommand, CanExecuteRemoveFromTaskGroupCommand );

            CreateTaskCommand = NavigationCommandManager.BuildCommand ( () => CreateTaskCommand, NavigateToCreateTaskCommand );
            CreateTaskGroupCommand = NavigationCommandManager.BuildCommand ( () => CreateTaskGroupCommand, NavigateToCreateTaskGroupCommand );
            EditCommand = NavigationCommandManager.BuildCommand ( () => EditCommand, NavigateToEditCommand );
            CloneCommand = NavigationCommandManager.BuildCommand ( () => CloneCommand, NavigateToCloneCommand );
        }
示例#18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddSelfPaymentViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        public AddSelfPaymentViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            ICurrentUserContextService currentUserContextService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;
            currentUserContextService.RegisterForContext((cuc, b) => _currentStaffKey = cuc.Staff.Key);

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

            SaveCommand = commandFactoryHelper.BuildDelegateCommand(
                () => SaveCommand, () => SelfPayment, ExecuteSaveCommand);

            _ruleExecutor = new NotifyPropertyChangedRuleExecutor<AddSelfPaymentViewModel, IDataTransferObject>();
        }
示例#19
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;
        }
示例#20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PayorCoverageViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="navigationService">The navigation service.</param>
        public PayorCoverageViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService,
            INavigationService navigationService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;
            _navigationService = navigationService;

            PageSize = 50;

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

            DeletePayorCoverageCommand = commandFactoryHelper.BuildDelegateCommand<PayorCoverageCacheDto> (
                () => DeletePayorCoverageCommand, ExecuteDeletePayorCoverageCommand );
            ShowPayorCoverageEditorCommand = commandFactoryHelper.BuildDelegateCommand<PayorCoverageCacheDto> (
                () => ShowPayorCoverageEditorCommand, ExecuteShowPayorCoverageEditorCommand );
            GoToPatientHistoryCommand = commandFactoryHelper.BuildDelegateCommand (
                () => GoToPatientHistoryCommand, ExecuteGoToPatientHistoryCommand );
        }
        public ProgramEnrollmentListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;

            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramEnrollmentDto> ();

            InitializeGroupingDescriptions ();

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

            ShowAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );

            CreateProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand (
                () => CreateProgramEnrollmentCommand, ExecuteCreateProgramEnrollmentCommand );
            EditProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                () => EditProgramEnrollmentCommand, ExecuteEditProgramEnrollmentCommand );
            DisenrollProgramEnrollmentCommand =
                commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                    () => DisenrollProgramEnrollmentCommand, ExecuteDisenrollProgramEnrollmentCommand );
            DeleteProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                () => DeleteProgramEnrollmentCommand, ExecuteDeleteProgramEnrollment, CanExecuteDeleteProgramEnrollment );
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs> ( () => DragQueryCommand, ExecuteDragQueryCommand );

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

            _eventAggregator.GetEvent<ProgramEnrollmentChangedEvent> ()
                .Subscribe ( ProgramEnrollmentChangedEventHandler, ThreadOption.BackgroundThread, false, FilterProgramEnrollmentChangedEvents );
        }
        public ClinicianScheduleTileViewModel (
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INotificationService notificationService,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IPopupService popupService)
            : base ( accessControlManager, commandFactory )
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _notificationService = notificationService;
            _navigationService = navigationService;
            _popupService = popupService;
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;

            _eventAggregator.GetEvent<AppointmentCreatedEvent> ().Subscribe (
                AppointmentCreatedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterAppointmentCreatedEvents );

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

            _eventAggregator.GetEvent<AppointmentUpdatedEvent> ().Subscribe (
                AppointmentUpdatedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterAppointmentUpdatedEvents );

            _eventAggregator.GetEvent<PatientChangedEvent> ().Subscribe (
                FilterPatientChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterPatientChangedEvents );

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

            StatusUpdatedCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => StatusUpdatedCommand, ExecuteStatusUpdatedCommand );
            AppointmentUpdatedCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => AppointmentUpdatedCommand,
                ExecuteAppointmentUpdatedCommand,
                CanExecuteAppointmentUpdatedCommand );
            ShowAppointmentDetailsCommand =
                commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                    () => ShowAppointmentDetailsCommand, ExecuteDoubleClickAppointmentCommand, CanExecuteDoubleClickAppointmentCommand );
            RangeUpdatedCommand = commandFactoryHelper.BuildDelegateCommand<DateRange> (
                () => RangeUpdatedCommand,
                ExecuteRangeUpdatedCommand,
                CanExecuteRangeUpdatedCommand );
            AppointmentAddedCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => AppointmentAddedCommand, ExecuteAppointmentAddedCommand, CanExecuteAppointmentAddedCommand );
            AppointmentDeletedCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => AppointmentDeletedCommand, ExecuteAppointmentDeletedCommand, CanExecuteAppointmentDeletedCommand );
            ShowAlertDetailsCommand = commandFactoryHelper.BuildDelegateCommand<PatientAlertDto> (
                () => ShowAlertDetailsCommand, ExecuteShowAlertDetailsCommand );
            GoToPatientDashboardCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => GoToPatientDashboardCommand, ExecuteGoToPatientDashboardCommand );
            GoToPatientProfileCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => GoToPatientProfileCommand, ExecuteGoToPatientProfileCommand);
            GoToPaymentCommand = commandFactoryHelper.BuildDelegateCommand<ClinicianAppointmentDto> (
                () => GoToPaymentCommand, ExecuteGoToPaymentCommand );

            ClinicianSchedule = new ClinicianScheduleDto ();

            _eventAggregator.GetEvent<FrontDeskDashboardDateChangedEvent> ().Subscribe (
                OnFrontDeskDashboardDateChanged, ThreadOption.PublisherThread, false, FilterFrontDeskDashboardDateChanged );
        }
        public VisitForBillingListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<VisitForBillingDto> ();

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

            SendToBilling = commandFactoryHelper.BuildDelegateCommand<object> (
                () => SendToBilling, ExecuteSendToBillingCommand, CanExecuteSendToBilling );
            SendToBillingDirectly = commandFactoryHelper.BuildDelegateCommand<object> (
                () => SendToBillingDirectly, ExecuteSendToBillingCommandDirectly, CanExecuteSendToBilling );
        }
示例#24
0
        public ClaimBatchListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ClaimBatchDisplayNameDto> ();

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

            DownloadHealthCareClaim837ProfessionalCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => DownloadHealthCareClaim837ProfessionalCommand,
                ExecuteDownloadHealthCareClaim837ProfessionalCommand,
                CanExecuteDownloadHealthCareClaim837ProfessionalCommand );

            RefreshCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => RefreshCommand, ExecuteRefreshCommand );
            ResetTestDataCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => ResetTestDataCommand, ExecuteResetTestDataCommand );
        }
示例#25
0
        public EditCaseProblemViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper ();
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProblemDto> ();

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

            SaveProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> ( () => SaveProblemCommand, ExecuteSaveProblem );

            DtsSearchSelectionChangedCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> (
                () => DtsSearchSelectionChangedCommand, ExecuteDtsSearchSelectionChangedCommand );
        }
示例#26
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 );
        }
        public EditProgramEnrollmentViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper ();
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramEnrollmentDto> ();

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

            EditProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                () => EditProgramEnrollmentCommand, ExecuteEditProgramEnrollment );
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientHistoryDocumentViewModel"/> class.
        /// </summary>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        public PatientHistoryDocumentViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService,
            INavigationService navigationService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _popupService = popupService;
            _navigationService = navigationService;
            _eventAggregator = eventAggregator;

            _eventAggregator.GetEvent<PatientDocumentUploadedEvent> ().Subscribe (
                PatientDocumentUploadedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                PatientDocumentUploadedEvents );
            IsOtherTypeReadOnly = true;

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

            OpenDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto> (
                () => OpenDocumentCommand, ExecuteOpenDocumentCommand );
            OpenEncryptedDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto> (
                () => OpenEncryptedDocumentCommand, ExecuteOpenEncryptedDocumentCommand );

            SaveNewDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto>(
                () => SaveNewDocumentCommand, ExecuteSaveNewDocument);
            CancelNewDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto>(
                () => CancelNewDocumentCommand, ExecuteCancelNewDocument);

            UpdateDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto> (
                () => UpdateDocumentCommand, ExecuteUpdateDocument );
            DeleteDocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto> (
                () => DeleteDocumentCommand, ExecuteDeleteDocumentCommand, CanExecuteDeleteDocumentCommand );

            DocumentTypeChangedCommand = commandFactoryHelper.BuildDelegateCommand<LookupValueDto> (
                () => DocumentTypeChangedCommand, ExecuteDocumentTypeChangedCommand );
            ClinicalStartDateChangedCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => ClinicalStartDateChangedCommand, ExecuteClinicalStartDateChangedCommand );

            ImportC32DocumentCommand = commandFactoryHelper.BuildDelegateCommand<PatientDocumentDto>(
               () => ImportC32DocumentCommand, ExecuteImportC32DocumentCommand, CanExecuteImportC32DocumnetCommand);
        }
示例#29
0
        public CaseProblemListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;

            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher ();
            IsLoading = true;
            requestDispatcher
                .AddLookupValuesRequest ( ProblemTypeLookupName )
                .AddLookupValuesRequest ( ProblemStatusLookupName )
                .ProcessRequests ( HandleGetLookupValuesCompleted, HandleGetLookupValuesException );

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProblemDto> ();

            InitializeGroupingDescriptions ();

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

            ShowAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            DeleteProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> (
                () => DeleteProblemCommand, ExecuteDeleteProblem, CanExecuteDeleteProblem );

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

            EditProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> ( () => EditProblemCommand, ExecuteEditProblemCommand );
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs> ( () => DragQueryCommand, ExecuteDragQueryCommand );
            GenerateHL7ProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> (
                () => GenerateHL7ProblemCommand, ExecuteGenerateHL7ProblemCommand );
        }
示例#30
0
        public ImportC32ViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper ();

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

            ImportC32Command = commandFactoryHelper.BuildDelegateCommand ( () => ImportC32Command, ExecuteImportC32Command, CanExecuteImportC32Command );
            CancelCommand = commandFactoryHelper.BuildDelegateCommand ( () => CancelCommand, ExecuteCancelCommand );
            SelectionChangedCommand = commandFactoryHelper.BuildDelegateCommand ( () => SelectionChangedCommand, ExecuteSelectionChangedCommand );
        }