Example #1
0
        //TODO: Za duży konstruktor, Dodać IOrderContext.
        public OrderViewModel(IRegionManager regionManager, IOrderRepository orderRepository, IOrderTypeRepository typeRepository,
                              IOrderStatusRepository statusRepository, IEventAggregator eventAggregator, IHardwareTypeRepository hardwareTypesRepository,
                              INumerationRepository numerationRepository, IMessageDialogService messageDialogService, IRBACManager rBACManager,
                              IPrintTemplateRepository templateRepository, ISettingsManager <Setting> settingsManager) : base(eventAggregator, messageDialogService)
        {
            _orderRepository         = orderRepository;
            _typeRepository          = typeRepository;
            _statusRepository        = statusRepository;
            _hardwareTypesRepository = hardwareTypesRepository;
            _numerationRepository    = numerationRepository;
            _rBACManager             = rBACManager;
            _templateRepository      = templateRepository;
            _settingsManager         = settingsManager;
            _regionManager           = regionManager;

            OrderStatuses  = new ObservableCollection <OrderStatus>();
            OrderTypes     = new ObservableCollection <OrderType>();
            HardwareTypes  = new ObservableCollection <HardwareType>();
            Attachments    = new ObservableCollection <Blob>();
            PrintTemplates = new ObservableCollection <PrintTemplate>();

            AddAttachmentCommand            = new DelegateCommand(OnAddAttachmentExecute);
            RemoveAttachmentCommand         = new DelegateCommand(OnRemoveAttachmentExecute, OnRemoveAttachmentCanExecute);
            PrintCommand                    = new DelegateCommand <object>(OnPrintExecute);
            ShowHardwareDetailFlyoutCommand = new DelegateCommand(OnShowHardwareFlyoutExecute);
            ShowCustomerDetailFlyoutCommand = new DelegateCommand(OnShowCustomerFlyoutExecute);
        }
        public PrintTemplateSettingsViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService,
                                              IRegionManager regionManager, IPrintTemplateRepository templateRepository)
            : base(eventAggregator, messageDialogService)
        {
            Title = "Ustawienia szablonów";

            _regionManager      = regionManager;
            _templateRepository = templateRepository;

            Templates = new ObservableCollection <PrintTemplate>();

            EditTemplateCommand = new DelegateCommand(OnEditTemplateExecute, OnEditTemplateCanExecute);
            AddTemplateCommand  = new DelegateCommand(OnAddTemplateExecute);
        }
        public PrintTemplateEditorViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService,
                                            IPrintTemplateRepository templeteRepository, IRegionManager regionManager, IInterpreter interpreter) : base(eventAggregator, messageDialogService)
        {
            _templeteRepository = templeteRepository;
            _regionManager      = regionManager;
            _interpreter        = interpreter;

            Indexes        = new ObservableCollection <IndexLookupItem>();
            PrintTemplates = new ObservableCollection <PrintTemplate>();

            AddIndexToEditorCommand = new DelegateCommand <object>(OnAddIndexExecute);
            SelectTemplateCommand   = new DelegateCommand <object>(OnSelectTemplateExecute);

            PrintCommand = new DelegateCommand(OnPrintExecute);
        }
Example #4
0
        public OrderWizardViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IMessageDialogService messageDialogService,
                                    IOrderContext orderWizardContext, IPrintTemplateRepository printTemplateRepository, ISettingsManager <Setting> settingsManager)
            : base(eventAggregator, messageDialogService)
        {
            _regionManager           = regionManager;
            _orderWizardContext      = orderWizardContext;
            _printTemplateRepository = printTemplateRepository;
            _settingsManager         = settingsManager;

            WizardMode = true;

            PrintTemplates = new ObservableCollection <PrintTemplate>();

            GoForwardCommand  = new DelegateCommand(OnGoForwardExecute, OnGoForwardCanExecute);
            GoBackwardCommand = new DelegateCommand(OnGoBackExecute, OnGoBackwardCanExecute);
            PrintCommand      = new DelegateCommand <object>(OnPrintExecute);
        }
Example #5
0
        public ReportPrintService(
            IReportRepository reportRepository,
            IReportFileRepository reportFileRepository,
            IPrintTemplateRepository printTemplateRepository,
            IPrintTemplateFieldsRepository printTemplateFieldsRepository,
            IReportPrintLogRepository reportPrintLogRepository,
            IRisProContext dbContext)
        {
            _ReportRepository              = reportRepository;
            _ReportFileRepository          = reportFileRepository;
            _PrintTemplateRepository       = printTemplateRepository;
            _PrintTemplateFieldsRepository = printTemplateFieldsRepository;
            _reportPrintLogRepository      = reportPrintLogRepository;
            _dbContext = dbContext;

            AddDisposableObject(reportRepository);
            AddDisposableObject(reportFileRepository);
            AddDisposableObject(printTemplateRepository);
            AddDisposableObject(printTemplateFieldsRepository);
            AddDisposableObject(reportPrintLogRepository);
            AddDisposableObject(dbContext);
            REPORT_TEMPORARY_PATH = Directory.GetCurrentDirectory() + "\\Temp";
            PRINT_TEMPLATE_PATH   = Directory.GetCurrentDirectory() + "\\Template";
        }
Example #6
0
        public static void ClassInitialize(TestContext context)
        {
            _reportRepository              = new MockReportRepository(_MockRisProContext);
            _reportFileRepository          = new MockReportFileRepository(_MockRisProContext);
            _printTemplateRepository       = new MockPrintTemplateRepository(_MockRisProContext);
            _printTemplateFieldsRepository = new MockPrintTemplateFieldsRepository(_MockRisProContext);
            _reportTemplateDirecRepository = new MockReportTemplateDirecRepository(_MockRisProContext);
            _reportTemplateRepository      = new MockReportTemplateRepository(_MockRisProContext);
            _reportPrintLogRepository      = new MockReportPrintLogRepository(_MockRisProContext);

            _reportPrintService = new ReportPrintService
                                  (
                _reportRepository,
                _reportFileRepository,
                _printTemplateRepository,
                _printTemplateFieldsRepository,
                _reportPrintLogRepository,
                _MockRisProContext
                                  );
            _reportLockService = new ReportLockService
                                 (
                _MockRisProContext
                                 );
            _reportTemplateService = new ReportTemplateService
                                     (
                _reportTemplateRepository,
                _reportTemplateDirecRepository,
                _MockRisProContext
                                     );

            _reportService = new ReportService
                             (
                _reportRepository,
                _reportFileRepository,
                _MockRisProContext,
                _reportPrintService
                             );

            _userID = Guid.NewGuid().ToString();
            _user   = new User {
                UniqueID = _userID, LoginName = "1", Password = "******"
            };

            _siteName = Guid.NewGuid().ToString();
            _site     = new Site {
                SiteName = _siteName, PacsWebServer = "http://10.184.193.236/masterview/mv.jsp?server_name=FIR&user_name={user_name}&password={password}&patient_id=&accession_number={tbRegOrder__AccNo}&close_on_exit=true"
            };

            _reportID = Guid.NewGuid().ToString();
            _report1  = new Report {
                UniqueID = _reportID.ToString(), ReportName = "ReportName1", ReportText = "ReportText1", PrintTemplateID = "dd5e991d-b595-4ed2-9958-126d1ea82b10"
            };
            _report2 = new Report {
                UniqueID = Guid.NewGuid().ToString(), ReportName = "ReportName2", ReportText = "ReportText2"
            };
            _report3 = new Report {
                UniqueID = Guid.NewGuid().ToString(), ReportName = "ReportName3", ReportText = "ReportText3"
            };

            //order
            _patientID = Guid.NewGuid().ToString();
            _patient1  = new Patient {
                UniqueID = _patientID.ToString(), LocalName = "LocalName1"
            };

            //order
            _orderID = Guid.NewGuid().ToString();
            _order1  = new Order {
                UniqueID = _orderID.ToString(), PatientID = _patientID, ExamSite = _siteName
            };

            //procedure
            _procedureID  = Guid.NewGuid().ToString();
            _procedureID2 = Guid.NewGuid().ToString();
            _procedure1   = new Procedure {
                UniqueID = _procedureID.ToString(), ReportID = _reportID.ToString(), OrderID = _orderID, Status = 50
            };
            _procedure2 = new Procedure {
                UniqueID = _procedureID2.ToString()
            };

            //reportfile
            _reportFileID = Guid.NewGuid().ToString();
            _reportFile1  = new ReportFile {
                UniqueID = _reportFileID.ToString(), ReportID = _reportID.ToString(), FileName = "ReportFileName1"
            };

            //PrintTemplate
            _printTemplateID = Guid.NewGuid().ToString();
            _printTemplate1  = new PrintTemplate {
                UniqueID = _printTemplateID.ToString(), TemplateName = "TemplateName1", Type = 1
            };
            string templateInfo = @"<?xml version='1.0' encoding='utf-8'?><Reports><Report version='4.6.20131.54624'>"
                                  + "<Name>Template</Name>"
                                  + "<ReportInfo>"
                                  + "<Author>10027008</Author>"
                                  + "</ReportInfo>"
                                  + "<DataSource>"
                                  + @"<ConnectionString>C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\YW0P4GHB.B7T\6P43HV32.GD3\care..tion_324c4122a6cd491e_0002.0001_781aa2e02dbf3870\PrintTemplateFiles\SystemFiles\2052\Basic_Field.xml</ConnectionString>"
                                  + "<RecordSource>Fields</RecordSource>"
                                  + "<DataProvider>0</DataProvider>"
                                  + "</DataSource>"
                                  + "<Layout>"
                                  + "<Width>9120</Width>"
                                  + " <Orientation>1</Orientation>"
                                  + "</Layout>"
                                  + "<Font>"
                                  + "  <Name>Times New Roman</Name>"
                                  + "  <Size>9</Size>"
                                  + "</Font>"
                                  + "<CompatibilityOptions />"
                                  + "<Groups />"
                                  + "<Sections>"
                                  + "  <Section>"
                                  + "<Name>Detail</Name>"
                                  + "<Type>0</Type>"
                                  + "<Height>1200</Height>"
                                  + "</Section>"
                                  + "<Section>"
                                  + "<Name>Header</Name>"
                                  + "<Type>1</Type>"
                                  + "<Height>20</Height>"
                                  + "</Section>"
                                  + "<Section>"
                                  + "<Name>Footer</Name>"
                                  + "<Type>2</Type>"
                                  + "<Visible>0</Visible>"
                                  + "</Section>"
                                  + "<Section>"
                                  + "<Name>PageHeader</Name>"
                                  + "<Type>3</Type>"
                                  + "</Section>"
                                  + "<Section>"
                                  + "<Name>PageFooter</Name>"
                                  + "<Type>4</Type>"
                                  + "    <Height>20</Height>"
                                  + "  </Section>"
                                  + "</Sections>"
                                  + "<Fields>"
                                  + " <Field>"
                                  + "<Name>CityCtl1</Name>"
                                  + "<Section>0</Section>"
                                  + "<Text>tbRegPatient__LocalName</Text>"
                                  + "<Calculated>-1</Calculated>"
                                  + "<Left>1000</Left>"
                                  + "<Top>300</Top>"
                                  + "<Width>2280</Width>"
                                  + "<Height>300</Height>"
                                  + "<Align>6</Align>"
                                  + "<Font>"
                                  + "<Name>Arial</Name>"
                                  + " <Size>9</Size>"
                                  + " </Font>"
                                  + "</Field>"
                                  + "<Field>"
                                  + " <Name>CityLbl1</Name>"
                                  + " <Section>0</Section>"
                                  + " <Text>病人姓名</Text>"
                                  + "<Left>150</Left>"
                                  + " <Top>300</Top>"
                                  + " <Width>885</Width>"
                                  + " <Height>300</Height>"
                                  + " <Align>6</Align>"
                                  + "<ForeColor>128</ForeColor>"
                                  + " <WordWrap>0</WordWrap>"
                                  + " <Font>"
                                  + "   <Name>Arial</Name>"
                                  + "   <Size>9</Size>"
                                  + " </Font>"
                                  + "</Field>"
                                  + "</Fields>"
                                  + "</Report>"
                                  + "</Reports>";

            _printTemplate2 = new PrintTemplate {
                UniqueID = "dd5e991d-b595-4ed2-9958-126d1ea82b10", TemplateName = "baseinfo", Type = 0, Version = 0, TemplateInfo = System.Text.Encoding.Unicode.GetBytes(templateInfo)
            };

            //PrintTemplateFields
            _printTemplateFieldsID = Guid.NewGuid().ToString();
            _printTemplateFields1  = new PrintTemplateFields {
                UniqueID = _printTemplateFieldsID.ToString(), FieldName = "FieldName1"
            };

            // Report template
            _reportTemplateID = Guid.NewGuid().ToString();
            _reportTemplate   = new ReportTemplate {
                UniqueID = _reportTemplateID, TemplateName = "templateName1"
            };
            _reportTemplateDirecID       = Guid.NewGuid().ToString();
            _reportTemplateDirecParentID = Guid.NewGuid().ToString();
            _reportTemplateDirecUserID   = Guid.NewGuid().ToString();
            _reportTemplateDirec         = new ReportTemplateDirec {
                UniqueID = _reportTemplateDirecID, TemplateID = _reportTemplateID, ParentID = _reportTemplateDirecParentID, UserID = _reportTemplateDirecUserID, DirectoryType = "report", Type = 1, ItemOrder = 0
            };

            //history
            _reportList = new ReportList {
                UniqueID = Guid.NewGuid().ToString(), ReportID = _reportID, OperationTime = DateTime.Now, Creater = _userID, Mender = _userID
            };
        }