Browse Source

体检报告查询优先条码号、档案号

bjmzak
wxd 2 years ago
parent
commit
b9efb9bf5b
  1. 33
      src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs

33
src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs

@ -129,6 +129,27 @@ namespace Shentun.Peis.PeisReports
var sumquery = query;
var isIgnoreOtherConditions = false;
if (!string.IsNullOrEmpty(input.PatientRegisterNo))
{
sumquery = sumquery.Where(m => m.a.PatientRegisterNo == input.PatientRegisterNo);
isIgnoreOtherConditions = true;
}
if (!string.IsNullOrEmpty(input.PatientNo))
{
sumquery = sumquery.Where(m => m.ab.PatientNo == input.PatientNo);
isIgnoreOtherConditions = true;
}
if (isIgnoreOtherConditions)
{
sumquery = sumquery.Where(m => m.a.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration);
}
else
{
if (input.CustomerOrgs.Any())
{
@ -216,16 +237,6 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.a.PatientName != null && m.a.PatientName.Contains(input.PatientName));
}
if (!string.IsNullOrEmpty(input.PatientRegisterNo))
{
sumquery = sumquery.Where(m => m.a.PatientRegisterNo == input.PatientRegisterNo);
}
if (!string.IsNullOrEmpty(input.PatientNo))
{
sumquery = sumquery.Where(m => m.ab.PatientNo == input.PatientNo);
}
if (!string.IsNullOrEmpty(input.phone))
{
sumquery = sumquery.Where(m => m.ab.MobileTelephone == input.phone || m.ab.Telephone == input.phone);
@ -277,7 +288,7 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.ab.IdNo == input.IdNo);
}
}
var sumqueryGroup = sumquery.ToList().GroupBy(g => g.a.Id);

Loading…
Cancel
Save