|
|
@ -1,6 +1,7 @@ |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal; |
|
|
using NUglify.Helpers; |
|
|
using NUglify.Helpers; |
|
|
using Shentun.Peis.Enums; |
|
|
using Shentun.Peis.Enums; |
|
|
using Shentun.Peis.Models; |
|
|
using Shentun.Peis.Models; |
|
|
@ -148,7 +149,7 @@ namespace Shentun.Peis.InternalReports |
|
|
var query = (from a in await _patientRegisterRepository.GetQueryableAsync() |
|
|
var query = (from a in await _patientRegisterRepository.GetQueryableAsync() |
|
|
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb |
|
|
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb |
|
|
from ab in bb.DefaultIfEmpty() |
|
|
from ab in bb.DefaultIfEmpty() |
|
|
where (a.SummaryDoctorId!=null) && a.SummaryDate != null && a.SummaryDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
|
|
|
|
|
|
where (a.SummaryDoctorId != null) && a.SummaryDate != null && a.SummaryDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
a.SummaryDate < Convert.ToDateTime(input.EndDate).AddDays(1) |
|
|
a.SummaryDate < Convert.ToDateTime(input.EndDate).AddDays(1) |
|
|
select new |
|
|
select new |
|
|
{ |
|
|
{ |
|
|
@ -187,7 +188,7 @@ namespace Shentun.Peis.InternalReports |
|
|
var query = (from a in await _patientRegisterRepository.GetQueryableAsync() |
|
|
var query = (from a in await _patientRegisterRepository.GetQueryableAsync() |
|
|
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb |
|
|
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb |
|
|
from ab in bb.DefaultIfEmpty() |
|
|
from ab in bb.DefaultIfEmpty() |
|
|
where (a.AuditDoctorId!=null) && a.AuditDate != null && a.AuditDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
|
|
|
|
|
|
where (a.AuditDoctorId != null) && a.AuditDate != null && a.AuditDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
a.AuditDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1) |
|
|
a.AuditDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1) |
|
|
select new |
|
|
select new |
|
|
{ |
|
|
{ |
|
|
@ -228,9 +229,9 @@ namespace Shentun.Peis.InternalReports |
|
|
var qeruy = from a in await _registerAsbitemRepository.GetQueryableAsync() |
|
|
var qeruy = from a in await _registerAsbitemRepository.GetQueryableAsync() |
|
|
join b in await _asbitemRepository.GetQueryableAsync() on a.AsbitemId equals b.Id |
|
|
join b in await _asbitemRepository.GetQueryableAsync() on a.AsbitemId equals b.Id |
|
|
join c in await _itemTypeRepository.GetQueryableAsync() on b.ItemTypeId equals c.Id |
|
|
join c in await _itemTypeRepository.GetQueryableAsync() on b.ItemTypeId equals c.Id |
|
|
join d in await _registerCheckRepository.GetQueryableAsync() on a.RegisterCheckId equals d.Id into dd |
|
|
|
|
|
from ad in dd.DefaultIfEmpty() |
|
|
|
|
|
where (!string.IsNullOrEmpty(ad.CheckDoctorId) && ad.CheckDate != null) |
|
|
|
|
|
|
|
|
join d in await _registerCheckRepository.GetQueryableAsync() on a.RegisterCheckId equals d.Id |
|
|
|
|
|
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on d.PatientRegisterId equals patientRegister.Id |
|
|
|
|
|
where (!string.IsNullOrEmpty(d.CheckDoctorId) && d.CheckDate != null) |
|
|
select new |
|
|
select new |
|
|
{ |
|
|
{ |
|
|
a.AsbitemId, |
|
|
a.AsbitemId, |
|
|
@ -240,7 +241,8 @@ namespace Shentun.Peis.InternalReports |
|
|
AsbitemName = b.DisplayName, |
|
|
AsbitemName = b.DisplayName, |
|
|
ItemTypeId = b.ItemTypeId, |
|
|
ItemTypeId = b.ItemTypeId, |
|
|
ItemTypeName = c.DisplayName, |
|
|
ItemTypeName = c.DisplayName, |
|
|
ad.CheckDate |
|
|
|
|
|
|
|
|
d.CheckDate, |
|
|
|
|
|
MedicalTypeId = patientRegister.MedicalTypeId |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if (input.ItemTypeId.Any()) |
|
|
if (input.ItemTypeId.Any()) |
|
|
@ -253,6 +255,10 @@ namespace Shentun.Peis.InternalReports |
|
|
qeruy = qeruy.Where(m => m.CheckDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
qeruy = qeruy.Where(m => m.CheckDate.Value >= Convert.ToDateTime(input.StartDate) && |
|
|
m.CheckDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1)); |
|
|
m.CheckDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1)); |
|
|
} |
|
|
} |
|
|
|
|
|
if (input.MedicalTypeIds.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
qeruy = qeruy.Where(m => m.MedicalTypeId != null && input.MedicalTypeIds.Contains(m.MedicalTypeId.Value)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var entlist = qeruy.GroupBy(g => new { g.ItemTypeId, g.AsbitemId }) |
|
|
var entlist = qeruy.GroupBy(g => new { g.ItemTypeId, g.AsbitemId }) |
|
|
.Select(s => new GetItemTypeWorkLoadInStandardDto |
|
|
.Select(s => new GetItemTypeWorkLoadInStandardDto |
|
|
|