private static async System.Threading.Tasks.Task <int> CreateReportTemplateAsync() { Console.WriteLine("----------Initiating Create ReportTemplate API Call"); ReportTemplateService reportTemplateService = new ReportTemplateService(hostConfig, clientConfig); var responseString = await reportTemplateService.CreateReportTemplateAsync(); Console.WriteLine($"----------Create ReportTemplate Initiated, response received: {responseString}"); Console.WriteLine("**********************************"); if (!string.IsNullOrEmpty(responseString)) { try { var reportTemplateResponse = JsonConvert.DeserializeObject <APIResponse <ReportTemplateResponse> >(responseString); if (reportTemplateResponse != null && reportTemplateResponse.Data != null) { return(reportTemplateResponse.Data.TemplateId); } } catch (Exception e) { Console.Write($"Exception Occured: {e.Message}"); return(-1); } } return(-1); }
public GetReportTemplatesResponse Process(GetReportTemplatesRequest request) { var reportTemplates = ReportTemplateService.GetReportTemplates(); return(new GetReportTemplatesResponse() { ResultType = ResultTypes.Ok, ReportTemplateFiles = reportTemplates.ToArray() }); }
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 }; }