Browse Source

forsexid字符类型修改

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
a6fa180793
  1. 2
      src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
  2. 8
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  3. 6
      src/Shentun.Peis.Domain.Shared/Enums/ForSexFlag.cs
  4. 4
      src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuideManager.cs
  5. 20
      src/Shentun.Peis.Domain/Diagnosises/DiagnosisManager.cs
  6. 2
      src/Shentun.Peis.EntityFrameworkCore/SumSummaryReports/SumSummaryReportRepository.cs

2
src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs

@ -526,7 +526,7 @@ namespace Shentun.Peis.DiagnosisFunctions
if (!referenceRanges2.Any())
{
//未找到,去匹配适用性别为A的
referenceRanges2 = referenceRanges.Where(m => m.ForSexId.ToString() == ForSexFlag.All).ToList();
referenceRanges2 = referenceRanges.Where(m => m.ForSexId == ForSexFlag.All).ToList();
if (referenceRanges2.Any())
{

8
src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

@ -291,7 +291,7 @@ namespace Shentun.Peis.PatientRegisters
if (!string.IsNullOrEmpty(input.Phone))
entlist = entlist.Where(m => m.Patient.MobileTelephone == input.Phone || m.Patient.Telephone == input.Phone);
if (input.SexId != null && input.SexId.ToString() != ForSexFlag.All)
if (input.SexId != null && input.SexId != ForSexFlag.All)
entlist = entlist.Where(m => m.SexId == input.SexId);
if (!string.IsNullOrEmpty(input.StartDate) && !string.IsNullOrEmpty(input.EndDate))
@ -1326,7 +1326,7 @@ namespace Shentun.Peis.PatientRegisters
#region 检测单位分组的性别是否符合
//单位分组信息
if (CustomerOrgGroupEnt.ForSexId.ToString() != ForSexFlag.All
if (CustomerOrgGroupEnt.ForSexId != ForSexFlag.All
&& SexId != null
&& CustomerOrgGroupEnt.ForSexId != SexId)
{
@ -1744,7 +1744,7 @@ namespace Shentun.Peis.PatientRegisters
query = query.Where(m => m.a.PatientName != null && m.a.PatientName.Contains(input.PatientName));
}
if (input.SexId != null && input.SexId.ToString() != ForSexFlag.All)
if (input.SexId != null && input.SexId != ForSexFlag.All)
{
query = query.Where(m => m.a.SexId == input.SexId);
}
@ -1864,7 +1864,7 @@ namespace Shentun.Peis.PatientRegisters
var customerOrgGroupEntity = await _customerOrgGroupRepository.FindAsync(m => m.Id == input.CustomerOrgGroupId);
if (customerOrgGroupEntity != null)
{
if (customerOrgGroupEntity.ForSexId.ToString() != ForSexFlag.All
if (customerOrgGroupEntity.ForSexId != ForSexFlag.All
&& oldPatientRegisterEntity.SexId != null
&& customerOrgGroupEntity.ForSexId != oldPatientRegisterEntity.SexId)
{

6
src/Shentun.Peis.Domain.Shared/Enums/ForSexFlag.cs

@ -14,16 +14,16 @@ namespace Shentun.Peis.Enums
/// 男
/// </summary>
[Description("男")]
public const string Male = "M";
public const char Male = 'M';
/// <summary>
/// 女
/// </summary>
[Description("女")]
public const string Female = "F";
public const char Female = 'F';
/// <summary>
/// 全部
/// </summary>
[Description("全部")]
public const string All = "A";
public const char All = 'A';
}
}

4
src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuideManager.cs

@ -33,7 +33,7 @@ namespace Shentun.Peis.AsbitemGuides
if (SexFlag.UnKnown == SexId.ToString())
{
//判断是否为未知、未知去找适用性别为全部的
entlist = entlist.Where(m => m.ForSexId.ToString() == ForSexFlag.All).ToList();
entlist = entlist.Where(m => m.ForSexId == ForSexFlag.All).ToList();
}
else
{
@ -41,7 +41,7 @@ namespace Shentun.Peis.AsbitemGuides
if (!entlist.Any())
{
//找不到直接匹配的 去找全部的匹配数据
entlist = entlist.Where(m => m.ForSexId.ToString() == ForSexFlag.All).ToList();
entlist = entlist.Where(m => m.ForSexId == ForSexFlag.All).ToList();
}
}

20
src/Shentun.Peis.Domain/Diagnosises/DiagnosisManager.cs

@ -1,4 +1,5 @@
using Shentun.Peis.HelperDto;
using Shentun.Peis.Enums;
using Shentun.Peis.HelperDto;
using Shentun.Peis.Models;
using Shentun.Utilities;
using System;
@ -118,6 +119,23 @@ namespace Shentun.Peis.Diagnosises
}
private void Verify(Diagnosis entity)
{
DataHelper.CheckEntityIsNull(entity);
DataHelper.CheckStringIsNull(entity.DisplayName, "名称");
DataHelper.CheckGuidIsDefaultValue(entity.ItemTypeId, "项目类别");
DataHelper.CheckCharIsYOrN(entity.IsIll, "是否疾病");
DataHelper.CheckCharIsYOrN(entity.IsSummaryTemplate, "是否总检模板");
if (entity.ForSexId != ForSexFlag.Male && entity.ForSexId != ForSexFlag.Female && entity.ForSexId != ForSexFlag.All)
{
throw new ArgumentOutOfRangeException("适用性别参数不正确");
}
if (entity.DiagnosisLevelId < 0 || entity.DiagnosisLevelId > 10)
{
throw new ArgumentOutOfRangeException("诊断级别参数不正确");
}
}
}
}

2
src/Shentun.Peis.EntityFrameworkCore/SumSummaryReports/SumSummaryReportRepository.cs

@ -86,7 +86,7 @@ namespace Shentun.Peis.SumSummaryReports
//数字型
if (SexId != null && Age != null)
{
ReferenceRangeList = ReferenceRangeList.Where(m => (m.ForSexId == SexId || m.ForSexId.ToString() == ForSexFlag.All)
ReferenceRangeList = ReferenceRangeList.Where(m => (m.ForSexId == SexId || m.ForSexId == ForSexFlag.All)
&& m.AgeLowerLimit <= Age && m.AgeUpperLimit >= Age).ToList(); //查询性别跟年龄(性别增加全部)
msg = ReferenceRangeList.Any() ? ReferenceRangeList.First().ReferenceRangeValue : "";

Loading…
Cancel
Save