コード例 #1
0
        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();
        }
コード例 #2
0
		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 );
		}
コード例 #3
0
        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();
        }