public SupplementaryReportViewModel(IWorkListDataSource dataSource, string siteID, string accessionNumber, string caseURN, CaseConsultationList consultationList, bool isGlobalReadOnly = false, ReadingSiteType siteType = ReadingSiteType.interpretation) { this.DataSource = dataSource; // case info this.SiteID = siteID; this.AccessionNumber = accessionNumber; this.CaseURN = caseURN; this.ConsultationList = consultationList; this.CurrentSiteType = siteType; this.IsEditorReadOnly = isGlobalReadOnly; GetConsultationID(); // retrieve all the supplementary reports for the case srModel = dataSource.GetSupplementalReports(this.CaseURN); ClearSRCommand = new RelayCommand(ClearSR, () => this.CanClearSR); AddNewSRCommand = new RelayCommand(AddNewSR, () => this.CanAddNewSR); UpdateSRCommand = new RelayCommand(UpdateSR, () => this.CanUpdateSR); VerifySRCommand = new RelayCommand(VerifySR, () => this.CanVerifySR); CompleteConsultationCommand = new RelayCommand(CompleteConsultation, () => this.CanCompleteConsultation); ClearSR(); // retrieve the Esignature status at the case's primary site GetESignatureStatus(); }
public WorklistsViewModel(IWorkListDataSource dataSource) { _dataSource = dataSource; // create worklists WorklistViewModels = new Dictionary<ExamListViewType, WorklistViewModel>(); WorklistViewModels[ExamListViewType.Unread] = new WorklistViewModel(ExamListViewType.Unread, dataSource){ Title = "Unread" }; WorklistViewModels[ExamListViewType.Patient] = new WorklistViewModel(ExamListViewType.Patient, dataSource) { Title = "[No Patient]" }; WorklistViewModels[ExamListViewType.Read] = new WorklistViewModel(ExamListViewType.Read, dataSource) { Title = "Read" }; this.RefreshCommand = new RelayCommand(Refresh); this.ReserveCaseCommand = new RelayCommand(ReserveCases, () => CanReserveCases()); this.UnreserveCaseCommand = new RelayCommand(UnreserveCases, () => CanUnreserveCases()); this.RequestConsultationCommand = new RelayCommand(RequestConsultation, () => CanRequestConsultation()); this.EditReportCommand = new RelayCommand(EditReport, () => CanEditReport()); this.ViewReportCommand = new RelayCommand(ViewReport, () => CanViewReport()); this.ViewSnapshotsCommand = new RelayCommand(ViewSnapshots, () => CanViewSnapshots()); this.ViewNotesCommand = new RelayCommand(ViewNotes, () => CanViewNotes()); this.ViewDefaultHealthSummaryCommand = new RelayCommand(ViewDefaultHealthSummary, () => CanViewDefaultHealthSummary()); this.ViewHealthSummaryListCommand = new RelayCommand(ViewHealthSummaryList, () => CanViewHealthSummaryList()); }
public ReportCodingViewModel(IWorkListDataSource datasource, string caseURN, string siteNumber, bool isGlobalReadOnly = false, ReadingSiteType siteType = ReadingSiteType.interpretation) { this.IsEditorReadOnly = isGlobalReadOnly; this.CurrentSiteType = siteType; this.DataSource = datasource; this.CaseURN = caseURN; this.SiteStationNumber = siteNumber; COT = new CaseOrganTissue(); CPTList = new PathologyCptCodesType(); PathologySnomedCodesType snomedList = this.DataSource.GetSnomedCodeForCase(this.CaseURN); COT.InitializeList(snomedList); CPTList = this.DataSource.GetCptCodesForCase(this.CaseURN); this.SupportCPT = true; if (CPTList == null) { this.SupportCPT = false; MessageBox.Show("The current case does not support CPT coding.", "Information", MessageBoxButton.OK, MessageBoxImage.Information); CPTList = new PathologyCptCodesType(); } this.SearchItems = new ObservableCollection<PathologyFieldValue>(); this.SearchLocationItems = new ObservableCollection<PathologyFieldValue>(); // enable adding new organ intially this.SelectedItemType = "Organ/Tissue"; this.SelectedSearchItem = null; this.SearchSnomedItemCommand = new RelayCommand(SearchSnomedItem, () => this.CanSearchSnomedItem); this.AddSnomedItemCommand = new RelayCommand(AddSnomedItem, () => this.CanAddSnomedItem); this.RemoveSnomedItemCommand = new RelayCommand(RemoveSnomedItem, () => this.CanRemoveSnomedItem); this.SearchLocationItemCommand = new RelayCommand(SearchLocationItem, () => this.CanSearchLocationItem ); this.AddCPTCommand = new RelayCommand(AddCPTItems, () => this.CanAddCPT ); }
public ReportViewModel(IWorkListDataSource dataSource, CaseListItem caseItem, bool isGlobalReadOnly = false, ReadingSiteType siteType = ReadingSiteType.interpretation) { DataSource = dataSource; // editor property this.IsEditorReadOnly = isGlobalReadOnly; this.CurrentSiteType = siteType; // case's properties this.CaseURN = caseItem.CaseURN; this.SiteAbbr = caseItem.SiteAbbr; this.SiteCode = caseItem.SiteCode; this.AccessionNumber = caseItem.AccessionNumber; ChangeList = new PathologyCaseReportFieldsType(); // patient's info this.PatientName = caseItem.PatientName; this.PatientID = caseItem.PatientID; this.Patient = DataSource.GetPatient(caseItem.SiteCode, caseItem.PatientICN); // retrieve the Esignature status at the case's primary site GetESignatureStatus(); // consultations this.ConsultationList = caseItem.ConsultationList; // CCOW set patient context IContextManager contextManager = ViewModelLocator.ContextManager; contextManager.SetCurrentPatient(this.Patient); this.CCOWContextState = contextManager.GetPatientContextState(this.Patient); // get notified of CCOW context state change events contextManager.PropertyChanged += new PropertyChangedEventHandler(contextManager_PropertyChanged); // retrieve report data report = dataSource.GetReport(caseItem); // retrieve supplementary reports DateTime srDisplayDateStart; if (!DateTime.TryParse(DateSpecReceived, out srDisplayDateStart)) { srDisplayDateStart = DateTime.Today; } SRViewModel = new SupplementaryReportViewModel(DataSource, SiteCode, AccessionNumber, this.CaseURN, this.ConsultationList, this.IsEditorReadOnly, this.CurrentSiteType); SRViewModel.SRDateStart = srDisplayDateStart; SRViewModel.Practitioner = Practitioner; SRViewModel.EsigStatus = this.EsigStatus; //srViewModel.LocalEsigStatus = this.LocalEsigStatus; // initialized codeing tab ReportCodingVM = new ReportCodingViewModel(this.DataSource, this.CaseURN, this.SiteCode, this.IsEditorReadOnly, this.CurrentSiteType); LaunchCPRSReportCommand = new RelayCommand(LaunchCPRSReport, () => this.State == ReportState.Verified); SaveReportCommand = new RelayCommand(SaveMainReportToDatabase, () => CanSaveMainReport); CompleteReportCommand = new RelayCommand(CompleteReport, () => CanCompleteMainReport); VerifyReportCommand = new RelayCommand(VerifyReport, () => CanVerifyMainReport); SearchUserCommand = new RelayCommand<string>((s) => SearchUser(s), (s) => CanSearchUser); if ((this.report == null) || (this.report.FieldList == null) || (this.report.FieldList.Count <= 0)) { Log.Error("Missing report template."); MessageBox.Show("Cannot retrieve data fields for the main report. Please contact system administrator.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } // check the condition and set the GUI as read only or not SetMainReportReadOnly(); }
public WorklistViewModel(ExamListViewType examlistType, IWorkListDataSource dataSource) { this.Type = examlistType; this._dataSource = dataSource; Root = new CaseListItem(); IsActive = false; this.RefreshCommand = new RelayCommand(Refresh); this.ReserveCaseCommand = new RelayCommand(ReserveCases, () => CanReserveCases()); this.UnreserveCaseCommand = new RelayCommand(UnreserveCases, () => CanUnreserveCases()); this.RequestConsultationCommand = new RelayCommand(RequestConsultation, () => CanRequestConsultation()); this.EditReportCommand = new RelayCommand(EditReport, () => CanEditReport()); this.ViewReportCommand = new RelayCommand(ViewReport, () => CanViewReport()); this.ViewSnapshotsCommand = new RelayCommand(ViewSnapshots, () => CanViewSnapshots()); this.ViewNotesCommand = new RelayCommand(ViewNotes, () => CanViewNotes()); this.ViewInCaptureCommand = new RelayCommand(ViewInCapture, () => CanViewInCapture()); //this.DoubleClickCommand = new RelayCommand(this.ReserveCases, () => CanReserveCases()); this.ViewDefaultHealthSummaryCommand = new RelayCommand(ViewDefaultHealthSummary, () => CanViewDefaultHealthSummary()); this.ViewHealthSummaryListCommand = new RelayCommand(ViewHealthSummaryList, () => CanViewHealthSummaryList()); this.WorklistFilterViewModel = new WorklistFilterViewModel(this.Type); this.WorklistFilterViewModel.PropertyChanged += new PropertyChangedEventHandler(WorklistFilterViewModel_PropertyChanged); // configure periodic refresh, periodically refreshes active worklist _refreshTimer = new DispatcherTimer(); _refreshTimer.Interval = TimeSpan.FromMilliseconds(3000); _refreshTimer.Tick += new EventHandler(_timer_Tick); _refreshTimer.Start(); }
public static WorklistViewModel Create(ExamListViewType examListViewType, IWorkListDataSource dataSource) { WorklistViewModel viewModel = new WorklistViewModel(examListViewType, dataSource); switch (examListViewType) { case ExamListViewType.Read: viewModel.Title = "Readlist"; break; case ExamListViewType.Unread: viewModel.Title = "Results"; break; case ExamListViewType.Patient: viewModel.Title = "Patient"; break; } return viewModel; }