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.
		
		
		
		
		
			
		
			
				
					
					
						
							110 lines
						
					
					
						
							3.7 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							110 lines
						
					
					
						
							3.7 KiB
						
					
					
				
								using Shentun.Peis.ChargeRequests;
							 | 
						|
								using Shentun.Peis.Models;
							 | 
						|
								using Shentun.Peis.PatientRegisters;
							 | 
						|
								using Shentun.Peis.Patients;
							 | 
						|
								using Shentun.Peis.SumSummaryReports;
							 | 
						|
								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 SumSummaryReportAppServiceTest : PeisApplicationTestBase
							 | 
						|
								    {
							 | 
						|
								        private readonly IRepository<ChargeRequest, Guid> _repository;
							 | 
						|
								        private readonly SumSummaryReportAppService _appService;
							 | 
						|
								        private readonly ITestOutputHelper _output;
							 | 
						|
								        private readonly IUnitOfWorkManager _unitOfWorkManager;
							 | 
						|
								        public SumSummaryReportAppServiceTest(ITestOutputHelper testOutputHelper)
							 | 
						|
								        {
							 | 
						|
								            _output = testOutputHelper;
							 | 
						|
								            _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
							 | 
						|
								            _repository = GetRequiredService<IRepository<ChargeRequest, Guid>>();
							 | 
						|
								            _appService = GetRequiredService<SumSummaryReportAppService>();
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetDetailResultsAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new PatientRegisterIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    PatientRegisterId = new Guid("3a123c55-06de-4988-691c-448b5af468ff"),
							 | 
						|
								                
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.GetDetailResultsAsync(entity);
							 | 
						|
								                foreach(var item in newEntity)
							 | 
						|
								                {
							 | 
						|
								                    foreach(var item2 in item.Asbitems)
							 | 
						|
								                    {
							 | 
						|
								                        foreach(var item3 in item2.Items)
							 | 
						|
								                        {
							 | 
						|
								                            _output.WriteLine(item3.ItemName);
							 | 
						|
								                        }
							 | 
						|
								                    }
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetHorizontalComparisonAsbitemsAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new PatientIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    PatientId = new Guid("3a12169c-6d0e-a9cb-1d46-6c8658d651da"),
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var list = await _appService.GetHorizontalComparisonAsbitemsAsync(entity);
							 | 
						|
								                foreach(var item in list)
							 | 
						|
								                {
							 | 
						|
								                    _output.WriteLine(item.AsbitemId.ToString() + item.AsbitemName);
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetHorizontalComparisonsAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new PatientWithAsbitemIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    PatientId = new Guid("3a12169c-6d0e-a9cb-1d46-6c8658d651da"),
							 | 
						|
								                    AsbitemId = new Guid ("3a1206b3-42a2-7465-94e8-009c549c6edf")
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var list = await _appService.GetHorizontalComparisonsAsync(entity);
							 | 
						|
								                foreach (var item in list)
							 | 
						|
								                {
							 | 
						|
								                    _output.WriteLine(item.CheckDate.ToString());
							 | 
						|
								                    foreach (var item2 in item.Summarys)
							 | 
						|
								                    {
							 | 
						|
								                        _output.WriteLine(item2.Summary);
							 | 
						|
								                    }
							 | 
						|
								                    foreach (var item2 in item.RegisterCheckItems)
							 | 
						|
								                    {
							 | 
						|
								                        _output.WriteLine(item2.ItemName + item2.ResultValue);
							 | 
						|
								                    }
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								}
							 |