Exemplo n.º 1
0
        public MainViewModel()
        {
            _kitNames        = new List <dynamic>();
            _isScriptLoaded  = false;
            _filesToProcess  = new List <string>();
            InterfaceResults = new BindingList <InterfaceResults>();
            Logs             = new BindingList <LogModel>();
            Configuration    = new Config();
            var appSettings = new Properties.Settings();

            Configuration     = JsonConvert.DeserializeObject <Config>(appSettings.Config);
            _resultDataAccess = new ResultDataAccess(new StatusDataAccess(), new ReferenceRangeDataAccess(), new SampleDataAccess());
            _scriptDataAccess = new ScriptDataAccess();
            ConfigureFileSystemWatcher();

            //BackgroundWorker config
            _backgroundWorker = new BackgroundWorker()
            {
                WorkerReportsProgress = true
            };
            _backgroundWorker.DoWork             += new DoWorkEventHandler(ProcessResults);
            _backgroundWorker.ProgressChanged    += new ProgressChangedEventHandler(ReportProgressChanged);
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;

            //Event subscriptions
            fileSystemWatcher.Created += OnFileDetectedInDirectory;
            _initiateJobTimer.Elapsed += OnInitiateJob;
            Initialize += RunInitalze;


            //invoke events
            Initialize?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 2
0
 public AnalysisRequestDataAccess(IPatientDataAccess patientData,
                                  IClinicalDetailsDataAccess clinicalDetailsData,
                                  ISampleDataAccess sampleDataAccess,
                                  IResultDataAccess resultDataAccess,
                                  IStatusDataAccess statusDataAccess)
 {
     this.patientData         = patientData;
     this.clinicalDetailsData = clinicalDetailsData;
     this.sampleDataAccess    = sampleDataAccess;
     this.resultDataAccess    = resultDataAccess;
     this.statusDataAccess    = statusDataAccess;
 }
Exemplo n.º 3
0
        public ResultEntryViewModel
            (IWorkSheetDataAccess workSheetDataAccess,
            IMapper mapper,
            IResultDataAccess resultDataAccess,
            IStatusDataAccess statusDataAccess,
            ISampleDataAccess sampleDataAccess,
            IStaticDataDataAccess staticDataDataAccess,
            AuthorizeDetailEventArgs authorizeDetail,
            ICommentsDataAccess commentsDataAccess,
            IAnalysisRequestDataAccess requestDataAccess)
        {
            GridTestActiveDatasource   = GridControlTestActiveDatasource.Tests;
            GridSampleActiveDatasource = GridControlSampleActiveDatasource.Sample;
            RequestData                    = new List <RequestSampleModel>();
            SelectedResultData             = new BindingList <ResultModel>();
            SelectedClinicalDetails        = new BindingList <string>();
            SelectedRequestData            = new RequestSampleModel();
            AllResultData                  = new List <ResultModel>();
            CodifiedPhrasesForSelectedTest = new BindingList <Model.CodifiedResultsModel>();
            AllCodifiedPhrases             = new List <Model.CodifiedResultsModel>();
            TempCodifiedPhrasesList        = new List <Model.CodifiedResultsModel>();
            AllStatus             = new List <Model.StatusModel>();
            SampleAuditTrail      = new List <Model.AuditTrailModel>();
            NotesCountButtonLabel = "View Notes [ Ctrl+N ]";
            //set the date to load worksheet from
            LoadWorksheetFromDate = DateTime.Today;
            LoadWorksheetToDate   = DateTime.Today;

            //GenerateDemoData();
            _workSheetDataAccess = workSheetDataAccess;
            _mapper                             = mapper;
            _resultDataAccess                   = resultDataAccess;
            _statusDataAccess                   = statusDataAccess;
            _sampleDataAccess                   = sampleDataAccess;
            _staticDataDataAccess               = staticDataDataAccess;
            _authorizeDetail                    = authorizeDetail;
            _commentsDataAccess                 = commentsDataAccess;
            _requestDataAccess                  = requestDataAccess;
            SelectedResultData.ListChanged     += UpdateDatabaseResults;
            LoadAllStatusDataAndCodifiedValues += GetAllStatusData;
            LoadAllStatusDataAndCodifiedValues += FetchAllCodifiedData;
            LoadInitialWorklist                += ResultEntryViewModel_LoadInitialWorklist;

            //load all status Data
            LoadAllStatusDataAndCodifiedValues?.Invoke(this, EventArgs.Empty);
            //Load initial Worklist
            LoadInitialWorklist?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 4
0
        public Worker(ILogger <Worker> logger,
                      IConfiguration configuration,
                      IResultDataAccess resultDataAccess,
                      ISampleDataAccess sampleDataAccess,
                      IStaticDataDataAccess staticDataDataAccess)
        {
            _logger               = logger;
            _configuration        = configuration;
            _resultDataAccess     = resultDataAccess;
            _sampleDataAccess     = sampleDataAccess;
            _staticDataDataAccess = staticDataDataAccess;

            _channelMappings = new List <ChannelMappingModel>();

            LoadChannelMappingAsync().GetAwaiter().GetResult();
        }
Exemplo n.º 5
0
        public LateOrderEntryViewModel(IMapper mapper,
                                       IStaticDataDataAccess staticData,
                                       AuthorizeDetailEventArgs authorizeDetail,
                                       IResultDataAccess resultDataAccess)
        {
            AddedTests   = new BindingList <TestModel>();
            AllTestsData = new List <ProfilesAndTestsDatasourceOeModel>();
            _testsAlreadyPresentOnSample = new List <TestModel>();

            _mapper           = mapper;
            _staticData       = staticData;
            _authorizeDetail  = authorizeDetail;
            _resultDataAccess = resultDataAccess;

            InitializeStaticData += OnInitializeStaticDataAsync;
            InitializeStaticData(this, EventArgs.Empty);
        }