You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							103 lines
						
					
					
						
							4.2 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							103 lines
						
					
					
						
							4.2 KiB
						
					
					
				
								using Shentun.Peis.ImportLisResults;
							 | 
						|
								using Shentun.Peis.ImportPacsResults;
							 | 
						|
								using Shentun.Peis.Models;
							 | 
						|
								using Shentun.Peis.PatientRegisters;
							 | 
						|
								using Shentun.Utilities;
							 | 
						|
								using System;
							 | 
						|
								using System.Collections.Generic;
							 | 
						|
								using System.Linq;
							 | 
						|
								using System.Text;
							 | 
						|
								using System.Threading.Tasks;
							 | 
						|
								using Volo.Abp.Domain.Repositories;
							 | 
						|
								using Volo.Abp.Uow;
							 | 
						|
								using Xunit;
							 | 
						|
								using Xunit.Abstractions;
							 | 
						|
								
							 | 
						|
								namespace Shentun.Peis
							 | 
						|
								{
							 | 
						|
								    public class ImportPacsResultAppServiceTest : PeisApplicationTestBase
							 | 
						|
								    {
							 | 
						|
								        private readonly IRepository<ImportPacsResult> _repository;
							 | 
						|
								        private readonly ImportPacsResultAppService _appService;
							 | 
						|
								        private readonly ITestOutputHelper _output;
							 | 
						|
								        private readonly IUnitOfWorkManager _unitOfWorkManager;
							 | 
						|
								        public ImportPacsResultAppServiceTest(ITestOutputHelper testOutputHelper)
							 | 
						|
								        {
							 | 
						|
								            _output = testOutputHelper;
							 | 
						|
								            _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
							 | 
						|
								            _repository = GetRequiredService<IRepository<ImportPacsResult>>();
							 | 
						|
								            _appService = GetRequiredService<ImportPacsResultAppService>();
							 | 
						|
								        }
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task ImportResultAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new CreateImportPacsResultDto()
							 | 
						|
								                {
							 | 
						|
								                    CheckRequestNo = "2405140365",
							 | 
						|
								                    PatientName = "李湘",
							 | 
						|
								                    Result = "Pacs检查所见",
							 | 
						|
								                    Summary = "Pacs结论",
							 | 
						|
								                    Suggestion = "Pacs建议",
							 | 
						|
								                    CheckDate = DateTime.Now,
							 | 
						|
								                    CheckDoctorName = "张医生",
							 | 
						|
								                    Files = new List<CreateImportPacsResultPictureDto>()
							 | 
						|
								                    {
							 | 
						|
								                        //new CreateImportPacsResultPictureDto()
							 | 
						|
								                        //{
							 | 
						|
								                        //    IsPrint = 'Y',
							 | 
						|
								                        //    FileName = Guid.NewGuid().ToString(),
							 | 
						|
								                        //    FileFormat = "0",
							 | 
						|
								                        //    FileTransMode = "0",
							 | 
						|
								                        //    FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\login.png")
							 | 
						|
								                        //},
							 | 
						|
								                        // new CreateImportPacsResultPictureDto()
							 | 
						|
								                        //{
							 | 
						|
								                        //    IsPrint = 'Y',
							 | 
						|
								                        //    FileFormat = "0",
							 | 
						|
								                        //    FileTransMode = "0",
							 | 
						|
								                        //    FileName = Guid.NewGuid().ToString(),
							 | 
						|
								                        //    FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\首页背景图.jpg")
							 | 
						|
								                        //},
							 | 
						|
								                          new CreateImportPacsResultPictureDto()
							 | 
						|
								                        {
							 | 
						|
								                            IsPrint = 'Y',
							 | 
						|
								                            FileFormat = "1",
							 | 
						|
								                            FileTransMode = "0",
							 | 
						|
								
							 | 
						|
								                            FileName = "http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf",
							 | 
						|
								                            FileUrl = "http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf",
							 | 
						|
								                            FileBase64 = Shentun.Utilities.FileHelper.ToBase64("http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf")
							 | 
						|
								                        },
							 | 
						|
								                    }
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                await _appService.ImportResultAsync(entity);
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task ImportResultByPatientRegisterIdAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								                await _appService.ImportResultByPatientRegisterIdAsync(new PatientRegisterIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    PatientRegisterId = new Guid("3a128196-ec34-aa17-0a04-b4bb6bafc752")
							 | 
						|
								                });
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public void ConvertPdfToImage()
							 | 
						|
								        {
							 | 
						|
								            PDFHelper.ConvertPdfToImage("E:\\Whitedolphins\\doc\\体检中心排队系统.pdf", "E:\\Whitedolphins\\prog20220722\\pic", "测试");
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								}
							 |