4 changed files with 52 additions and 96 deletions
			
			
		- 
					54src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
 - 
					20src/Shentun.Peis.Domain/PrintReports/ICheckRequestNoReportRepository.cs
 - 
					5src/Shentun.Peis.Domain/PrintReports/PacsNoReportDto.cs
 - 
					65src/Shentun.Peis.EntityFrameworkCore/PrintReports/CheckRequestNoReportRepository.cs
 
@ -1,20 +0,0 @@ | 
				
			|||
using Shentun.Peis.Models; | 
				
			|||
using System; | 
				
			|||
using System.Collections.Generic; | 
				
			|||
using System.Linq; | 
				
			|||
using System.Text; | 
				
			|||
using System.Threading.Tasks; | 
				
			|||
using Volo.Abp.Domain.Repositories; | 
				
			|||
 | 
				
			|||
namespace Shentun.Peis.PrintReports | 
				
			|||
{ | 
				
			|||
    public interface ICheckRequestNoReportRepository : IRepository<RegisterCheck, Guid> | 
				
			|||
    { | 
				
			|||
        /// <summary>
 | 
				
			|||
        /// Pacs条码数据
 | 
				
			|||
        /// </summary>
 | 
				
			|||
        /// <param name="PatientRegisterId"></param>
 | 
				
			|||
        /// <returns></returns>
 | 
				
			|||
        Task<List<PacsNoReportDto>> GetPacsNoReportAsync(Guid PatientRegisterId); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -1,65 +0,0 @@ | 
				
			|||
using Shentun.Peis.EntityFrameworkCore; | 
				
			|||
using Shentun.Peis.Models; | 
				
			|||
using System; | 
				
			|||
using System.Collections.Generic; | 
				
			|||
using System.Linq; | 
				
			|||
using System.Text; | 
				
			|||
using System.Threading.Tasks; | 
				
			|||
using Volo.Abp.Domain.Repositories; | 
				
			|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; | 
				
			|||
using Volo.Abp.EntityFrameworkCore; | 
				
			|||
 | 
				
			|||
namespace Shentun.Peis.PrintReports | 
				
			|||
{ | 
				
			|||
    public class CheckRequestNoReportRepository : EfCoreRepository<PeisDbContext, RegisterCheck, Guid>, ICheckRequestNoReportRepository | 
				
			|||
    { | 
				
			|||
        private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository; | 
				
			|||
 | 
				
			|||
        public CheckRequestNoReportRepository( | 
				
			|||
            IRepository<CustomerOrg, Guid> customerOrgRepository, | 
				
			|||
            IDbContextProvider<PeisDbContext> dbContextProvider | 
				
			|||
            ) : base(dbContextProvider) | 
				
			|||
        { | 
				
			|||
            this._customerOrgRepository = customerOrgRepository; | 
				
			|||
        } | 
				
			|||
 | 
				
			|||
        /// <summary>
 | 
				
			|||
        /// 获取Pacs条码数据
 | 
				
			|||
        /// </summary>
 | 
				
			|||
        /// <param name="PatientRegisterId"></param>
 | 
				
			|||
        /// <returns></returns>
 | 
				
			|||
        /// <exception cref="NotImplementedException"></exception>
 | 
				
			|||
        public async Task<List<PacsNoReportDto>> GetPacsNoReportAsync(Guid PatientRegisterId) | 
				
			|||
        { | 
				
			|||
            var dbContext = await GetDbContextAsync(); | 
				
			|||
 | 
				
			|||
            var customerOrgList = await _customerOrgRepository.GetListAsync(); | 
				
			|||
 | 
				
			|||
            var query = (from a in dbContext.PatientRegisters | 
				
			|||
                         join b in dbContext.Sexes on a.SexId equals b.Id into bb | 
				
			|||
                         from ab in bb.DefaultIfEmpty() | 
				
			|||
                         join c in dbContext.RegisterCheckAsbitems on a.Id equals c.PatientRegisterId into cc | 
				
			|||
                         from ac in cc.DefaultIfEmpty() | 
				
			|||
                         join d in dbContext.Asbitems on ac.AsbitemId equals d.Id into dd | 
				
			|||
                         from ad in dd.DefaultIfEmpty() | 
				
			|||
                         join e in dbContext.RegisterChecks on ac.RegisterCheckId equals e.Id into ee | 
				
			|||
                         from ae in ee.DefaultIfEmpty() | 
				
			|||
                         join f in dbContext.ItemTypes on ad.ItemTypeId equals f.Id into ff | 
				
			|||
                         from af in ff.DefaultIfEmpty() | 
				
			|||
                         where (a.Id == PatientRegisterId && af.IsCheckRequest == 'Y') | 
				
			|||
                         select new PacsNoReportDto | 
				
			|||
                         { | 
				
			|||
                             Age = a.Age, | 
				
			|||
                             AsbitemName = ad.DisplayName, | 
				
			|||
                             CheckRequestNo = ae.CheckRequestNo, | 
				
			|||
                             PatientName = a.PatientName, | 
				
			|||
                             PatientRegisterNo = a.PatientRegisterNo, | 
				
			|||
                             SexName = ab.DisplayName, | 
				
			|||
                             CustomerOrgName = EntityHelper.GetCustomerOrgParentNameNoSql(customerOrgList, a.CustomerOrgId), | 
				
			|||
                             DepartmentName = EntityHelper.GetCustomerOrgNameNoSql(customerOrgList, a.CustomerOrgId) | 
				
			|||
                         }).ToList(); | 
				
			|||
 | 
				
			|||
            return query; | 
				
			|||
        } | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue