public AppointmentSet(IClientPatientRepository patientRepository,
                              IClientLabelRepository labelRepository,
                              IEnumerable <AppointmentTransferData> initialAppointmentData,
                              ClientMedicalPracticeData medicalPractice,
                              Action <string> errorCallback)
        {
            this.patientRepository = patientRepository;
            this.labelRepository   = labelRepository;
            this.medicalPractice   = medicalPractice;

            ObservableAppointments = new ObservableAppointmentCollection();

            foreach (var appointmentTransferData in initialAppointmentData)
            {
                AddAppointment(appointmentTransferData.PatientId,
                               appointmentTransferData.Description,
                               appointmentTransferData.StartTime,
                               appointmentTransferData.EndTime,
                               appointmentTransferData.Day,
                               appointmentTransferData.TherapyPlaceId,
                               appointmentTransferData.Id,
                               appointmentTransferData.LabelId,
                               errorCallback);
            }
        }
Exemple #2
0
        public PatientSelectorViewModel(IClientPatientRepository patientRepository,
                                        ISharedState <Patient> selectedPatientSharedVariable,
                                        Action <string> errorCallback)
        {
            this.patientRepository             = patientRepository;
            this.selectedPatientSharedVariable = selectedPatientSharedVariable;
            this.errorCallback = errorCallback;

            Patients         = new CollectionViewSource();
            Patients.Filter += Filter;
            SearchFilter     = "";

            patientRepository.NewPatientAvailable     += PatientRepositoryChanged;
            patientRepository.UpdatedPatientAvailable += PatientRepositoryChanged;

            patientRepository.RequestAllPatientList(
                patientList =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    Patients.Source = patientList;
                    UpdateForNewInput();
                });
            },
                errorCallback
                );
        }
 public AddAppointmentCommandHandler(IConnectionService connectionService,
                                     ISession session,
                                     IClientPatientRepository patientRepository,
                                     IUserActionBuilder userActionBuilder,
                                     Action <string> errorCallback)
 {
     this.connectionService = connectionService;
     this.session           = session;
     this.patientRepository = patientRepository;
     this.userActionBuilder = userActionBuilder;
     this.errorCallback     = errorCallback;
 }
        public ClientReadModelRepository(IClientEventBus eventBus,
                                         IClientPatientRepository patientsRepository,
                                         IClientMedicalPracticeRepository medicalPracticeRepository,
                                         IClientLabelRepository labelRepository,
                                         IConnectionService connectionService)
        {
            this.eventBus                  = eventBus;
            this.patientsRepository        = patientsRepository;
            this.medicalPracticeRepository = medicalPracticeRepository;
            this.labelRepository           = labelRepository;
            this.connectionService         = connectionService;

            cachedDayReadmodels    = new ConcurrentDictionary <AggregateIdentifier, AppointmentsOfADayReadModel>();
            cachedPatientReadmodel = new ConcurrentDictionary <Guid, AppointmentsOfAPatientReadModel>();
        }
        public FixedAppointmentSet(ClientMedicalPracticeData medicalPractice,
                                   IClientPatientRepository patientsRepository,
                                   IClientLabelRepository labelRepository,
                                   IEnumerable <AppointmentTransferData> initialAppointmentData,
                                   uint aggregateVersion,
                                   AggregateIdentifier identifier,
                                   Action <string> errorCallback)
        {
            AggregateVersion = aggregateVersion;
            Identifier       = identifier;

            var appointmentSet = new AppointmentSet(patientsRepository, labelRepository, initialAppointmentData,
                                                    medicalPractice, errorCallback);

            Appointments = appointmentSet.AppointmentList;
        }
 public AddAppointmentDialogWindowBuilder(IClientPatientRepository patientRepository,
                                          IClientReadModelRepository readModelRepository,
                                          IClientMedicalPracticeRepository medicalPracticeRepository,
                                          IClientLabelRepository labelRepository,
                                          ISharedStateReadOnly <Guid> selectedMedicalPractiveVariable,
                                          ISharedStateReadOnly <Date> selectedDateVariable,
                                          IAppointmentViewModelBuilder appointmentViewModelBuilder,
                                          Action <string> errorCallback)
 {
     this.patientRepository               = patientRepository;
     this.readModelRepository             = readModelRepository;
     this.medicalPracticeRepository       = medicalPracticeRepository;
     this.labelRepository                 = labelRepository;
     this.selectedMedicalPractiveVariable = selectedMedicalPractiveVariable;
     this.selectedDateVariable            = selectedDateVariable;
     this.appointmentViewModelBuilder     = appointmentViewModelBuilder;
     this.errorCallback = errorCallback;
 }
        public AppointmentsOfADayReadModel(IClientEventBus eventBus,
                                           IClientPatientRepository patientsRepository,
                                           IClientLabelRepository labelRepository,
                                           ClientMedicalPracticeData medicalPractice,
                                           IEnumerable <AppointmentTransferData> initialAppointmentData,
                                           AggregateIdentifier identifier,
                                           uint initialAggregateVersion,
                                           Action <string> errorCallback)
            : base(eventBus)
        {
            this.errorCallback = errorCallback;

            AggregateVersion = initialAggregateVersion;
            Identifier       = identifier;

            var initialAppointmentList = initialAppointmentData.ToList();

            appointmentSet = new AppointmentSet(patientsRepository, labelRepository,
                                                initialAppointmentList, medicalPractice,
                                                errorCallback);
        }
Exemple #8
0
 public MainWindowBuilder(ILocalSettingsRepository localSettingsRepository,
                          IClientPatientRepository patientRepository,
                          IClientMedicalPracticeRepository medicalPracticeRepository,
                          IClientReadModelRepository readModelRepository,
                          IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                          IClientLabelRepository labelRepository,
                          ICommandService commandService,
                          IViewModelCommunication viewModelCommunication,
                          ISession session,
                          Action <string> errorCallback)
 {
     this.localSettingsRepository    = localSettingsRepository;
     this.patientRepository          = patientRepository;
     this.medicalPracticeRepository  = medicalPracticeRepository;
     this.readModelRepository        = readModelRepository;
     this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;
     this.labelRepository            = labelRepository;
     this.commandService             = commandService;
     this.viewModelCommunication     = viewModelCommunication;
     this.session       = session;
     this.errorCallback = errorCallback;
 }
 public MainViewModelBuilder(IClientMedicalPracticeRepository medicalPracticeRepository,
                             IClientReadModelRepository readModelRepository,
                             IClientPatientRepository patientRepository,
                             IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                             IClientLabelRepository labelRepository,
                             ICommandService commandService,
                             ILocalSettingsRepository localSettingsRepository,
                             IViewModelCommunication viewModelCommunication,
                             ISession session,
                             AdornerControl adornerControl)
 {
     this.medicalPracticeRepository  = medicalPracticeRepository;
     this.readModelRepository        = readModelRepository;
     this.patientRepository          = patientRepository;
     this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;
     this.labelRepository            = labelRepository;
     this.commandService             = commandService;
     this.localSettingsRepository    = localSettingsRepository;
     this.viewModelCommunication     = viewModelCommunication;
     this.session        = session;
     this.adornerControl = adornerControl;
 }