Browse Source

创建档案号、条码号、检查单号 修改系统参数配置异常

bjmzak
wxd 2 years ago
parent
commit
265d725751
  1. 38
      src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs
  2. 59
      src/Shentun.Peis.Domain/Patients/PatientManager.cs
  3. 49
      src/Shentun.Peis.Domain/RegisterChecks/RegisterCheckManager.cs

38
src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs

@ -779,8 +779,16 @@ namespace Shentun.Peis.PatientRegisters
} }
if (string.IsNullOrWhiteSpace(patient_register_no_rule_coding)) if (string.IsNullOrWhiteSpace(patient_register_no_rule_coding))
{ {
//获取全局配置
patient_register_no_rule_coding = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_coding").FirstOrDefault().ParmValue;
var patient_register_no_rule_coding_ent = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_coding").FirstOrDefault();
if (patient_register_no_rule_coding_ent == null)
{
throw new UserFriendlyException("全局系统参数patient_register_no_rule_coding未配置");
}
else
{
//获取全局配置
patient_register_no_rule_coding = patient_register_no_rule_coding_ent.ParmValue;
}
} }
if (string.IsNullOrWhiteSpace(patient_register_no_rule_coding)) if (string.IsNullOrWhiteSpace(patient_register_no_rule_coding))
{ {
@ -795,8 +803,17 @@ namespace Shentun.Peis.PatientRegisters
} }
if (string.IsNullOrWhiteSpace(patient_register_no_rule_prefix)) if (string.IsNullOrWhiteSpace(patient_register_no_rule_prefix))
{ {
//获取全局配置
patient_register_no_rule_prefix = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_prefix").FirstOrDefault().ParmValue;
var patient_register_no_rule_prefix_ent = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_prefix").FirstOrDefault();
if (patient_register_no_rule_prefix_ent == null)
{
throw new UserFriendlyException("全局系统参数patient_register_no_rule_prefix未配置");
}
else
{
//获取全局配置
patient_register_no_rule_prefix = patient_register_no_rule_prefix_ent.ParmValue;
}
} }
if (!string.IsNullOrEmpty(patient_register_no_rule_prefix)) if (!string.IsNullOrEmpty(patient_register_no_rule_prefix))
{ {
@ -811,8 +828,17 @@ namespace Shentun.Peis.PatientRegisters
if (string.IsNullOrWhiteSpace(patient_register_no_rule_tail_len)) if (string.IsNullOrWhiteSpace(patient_register_no_rule_tail_len))
{ {
//获取全局配置
patient_register_no_rule_tail_len = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_tail_len").FirstOrDefault().ParmValue;
var patient_register_no_rule_tail_len_ent = spv_global.Where(m => m.SysParmId == "patient_register_no_rule_tail_len").FirstOrDefault();
if (patient_register_no_rule_tail_len_ent == null)
{
throw new UserFriendlyException("全局系统参数patient_register_no_rule_tail_len未配置");
}
else
{
//获取全局配置
patient_register_no_rule_tail_len = patient_register_no_rule_tail_len_ent.ParmValue;
}
} }
if (string.IsNullOrWhiteSpace(patient_register_no_rule_tail_len)) if (string.IsNullOrWhiteSpace(patient_register_no_rule_tail_len))

59
src/Shentun.Peis.Domain/Patients/PatientManager.cs

@ -50,7 +50,7 @@ namespace Shentun.Peis.Patients
Patient entity Patient entity
) )
{ {
await Verify(entity);
await Verify(entity);
if (!string.IsNullOrWhiteSpace(entity.NationId)) if (!string.IsNullOrWhiteSpace(entity.NationId))
{ {
@ -72,7 +72,7 @@ namespace Shentun.Peis.Patients
} }
//允许指定档案号,主要是导入人员名单时使用 //允许指定档案号,主要是导入人员名单时使用
var patientNo = entity.PatientNo; var patientNo = entity.PatientNo;
if(string.IsNullOrWhiteSpace(patientNo))
if (string.IsNullOrWhiteSpace(patientNo))
{ {
patientNo = await CreatePatientNo(entity.MedicalCenterId); patientNo = await CreatePatientNo(entity.MedicalCenterId);
} }
@ -94,7 +94,7 @@ namespace Shentun.Peis.Patients
PostalCode = entity.PostalCode, PostalCode = entity.PostalCode,
SexId = entity.SexId, SexId = entity.SexId,
Telephone = entity.Telephone, Telephone = entity.Telephone,
PatientNo = patientNo,
PatientNo = patientNo,
SimpleCode = LanguageConverter.GetPYSimpleCode(entity.DisplayName) SimpleCode = LanguageConverter.GetPYSimpleCode(entity.DisplayName)
}; };
@ -110,7 +110,7 @@ namespace Shentun.Peis.Patients
Patient targetEntity Patient targetEntity
) )
{ {
if(sourceEntity == targetEntity)
if (sourceEntity == targetEntity)
{ {
throw new UserFriendlyException("更新人员信息时源实体不能等于目标实体"); throw new UserFriendlyException("更新人员信息时源实体不能等于目标实体");
} }
@ -124,7 +124,7 @@ namespace Shentun.Peis.Patients
throw new UserFriendlyException("民族ID不存在"); throw new UserFriendlyException("民族ID不存在");
} }
} }
if(!string.IsNullOrWhiteSpace(sourceEntity.IdNo))
if (!string.IsNullOrWhiteSpace(sourceEntity.IdNo))
{ {
DataHelper.CheckIdNo(sourceEntity.IdNo); DataHelper.CheckIdNo(sourceEntity.IdNo);
} }
@ -144,11 +144,11 @@ namespace Shentun.Peis.Patients
//targetEntity.MedicalCenterId = sourceEntity.MedicalCenterId; //targetEntity.MedicalCenterId = sourceEntity.MedicalCenterId;
targetEntity.DisplayName = sourceEntity.DisplayName; targetEntity.DisplayName = sourceEntity.DisplayName;
targetEntity.MaritalStatusId = sourceEntity.MaritalStatusId; targetEntity.MaritalStatusId = sourceEntity.MaritalStatusId;
if(!string.IsNullOrWhiteSpace(sourceEntity.Address))
if (!string.IsNullOrWhiteSpace(sourceEntity.Address))
{ {
targetEntity.Address = sourceEntity.Address; targetEntity.Address = sourceEntity.Address;
} }
if(sourceEntity.BirthDate!=null)
if (sourceEntity.BirthDate != null)
{ {
targetEntity.BirthDate = sourceEntity.BirthDate; targetEntity.BirthDate = sourceEntity.BirthDate;
} }
@ -178,12 +178,12 @@ namespace Shentun.Peis.Patients
{ {
targetEntity.PostalCode = sourceEntity.PostalCode; targetEntity.PostalCode = sourceEntity.PostalCode;
} }
if(sourceEntity.SexId != SexFlag.UnKnown)
if (sourceEntity.SexId != SexFlag.UnKnown)
{ {
targetEntity.SexId = sourceEntity.SexId; targetEntity.SexId = sourceEntity.SexId;
} }
if(targetEntity.DisplayName != sourceEntity.DisplayName)
if (targetEntity.DisplayName != sourceEntity.DisplayName)
{ {
targetEntity.SimpleCode = LanguageConverter.GetPYSimpleCode(targetEntity.DisplayName); targetEntity.SimpleCode = LanguageConverter.GetPYSimpleCode(targetEntity.DisplayName);
} }
@ -209,9 +209,9 @@ namespace Shentun.Peis.Patients
throw new UserFriendlyException("民族ID不存在"); throw new UserFriendlyException("民族ID不存在");
} }
} }
if(!string.IsNullOrWhiteSpace(entity.IdNo))
if (!string.IsNullOrWhiteSpace(entity.IdNo))
{ {
var existPatient = await _repository.FindAsync(o=>o.IdNo == entity.IdNo);
var existPatient = await _repository.FindAsync(o => o.IdNo == entity.IdNo);
if (existPatient != null) if (existPatient != null)
{ {
throw new UserFriendlyException("该身份证号已经在人员信息中注册"); throw new UserFriendlyException("该身份证号已经在人员信息中注册");
@ -300,10 +300,18 @@ namespace Shentun.Peis.Patients
//获取体检中心配置 //获取体检中心配置
patient_id_rule_prefix = spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_prefix").FirstOrDefault().ParmValue; patient_id_rule_prefix = spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_prefix").FirstOrDefault().ParmValue;
} }
if(string.IsNullOrWhiteSpace(patient_id_rule_prefix))
if (string.IsNullOrWhiteSpace(patient_id_rule_prefix))
{ {
//获取全局配置
patient_id_rule_prefix = spv_global.Where(m => m.SysParmId == "patient_id_rule_prefix").FirstOrDefault().ParmValue;
var patient_id_rule_prefix_ent = spv_global.Where(m => m.SysParmId == "patient_id_rule_prefix").FirstOrDefault();
if (patient_id_rule_prefix_ent == null)
{
throw new UserFriendlyException("全局系统参数patient_id_rule_prefix未配置");
}
else
{
//获取全局配置
patient_id_rule_prefix = patient_id_rule_prefix_ent.ParmValue;
}
} }
if (spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_tail_len").Count() > 0) if (spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_tail_len").Count() > 0)
@ -311,10 +319,18 @@ namespace Shentun.Peis.Patients
//获取体检中心配置 //获取体检中心配置
patient_id_rule_tail_len = spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_tail_len").FirstOrDefault().ParmValue; patient_id_rule_tail_len = spv_tjzx.Where(m => m.SysParmId == "patient_id_rule_tail_len").FirstOrDefault().ParmValue;
} }
if(string.IsNullOrWhiteSpace(patient_id_rule_tail_len))
if (string.IsNullOrWhiteSpace(patient_id_rule_tail_len))
{ {
//获取全局配置
patient_id_rule_tail_len = spv_global.Where(m => m.SysParmId == "patient_id_rule_tail_len").FirstOrDefault().ParmValue;
var patient_id_rule_tail_len_ent = spv_global.Where(m => m.SysParmId == "patient_id_rule_tail_len").FirstOrDefault();
if (patient_id_rule_tail_len_ent == null)
{
throw new UserFriendlyException("全局系统参数patient_id_rule_tail_len未配置");
}
else
{
//获取全局配置
patient_id_rule_tail_len = patient_id_rule_tail_len_ent.ParmValue;
}
} }
if (string.IsNullOrWhiteSpace(patient_id_rule_tail_len)) if (string.IsNullOrWhiteSpace(patient_id_rule_tail_len))
@ -332,9 +348,6 @@ namespace Shentun.Peis.Patients
} }
string maxnum = "1"; //未补位的档案号 string maxnum = "1"; //未补位的档案号
var primarykeyBuilderEnt = await _primarykeyBuilderRepository.FirstOrDefaultAsync(f => f.PrimarykeyBuilderId == "patient_no"); var primarykeyBuilderEnt = await _primarykeyBuilderRepository.FirstOrDefaultAsync(f => f.PrimarykeyBuilderId == "patient_no");
@ -374,7 +387,7 @@ namespace Shentun.Peis.Patients
private async Task Verify(Patient entity) private async Task Verify(Patient entity)
{ {
DataHelper.CheckEntityIsNull(entity); DataHelper.CheckEntityIsNull(entity);
if(!string.IsNullOrEmpty(entity.DisplayName))
if (!string.IsNullOrEmpty(entity.DisplayName))
{ {
entity.DisplayName = entity.DisplayName.Trim(); entity.DisplayName = entity.DisplayName.Trim();
} }
@ -382,7 +395,7 @@ namespace Shentun.Peis.Patients
if (!string.IsNullOrEmpty(entity.IdNo)) if (!string.IsNullOrEmpty(entity.IdNo))
{ {
entity.IdNo = entity.IdNo.Trim(); entity.IdNo = entity.IdNo.Trim();
if(entity.IdNo.Length != 18)
if (entity.IdNo.Length != 18)
{ {
throw new UserFriendlyException("身份证长度必须为18位"); throw new UserFriendlyException("身份证长度必须为18位");
} }
@ -401,7 +414,7 @@ namespace Shentun.Peis.Patients
} }
//DataHelper.CheckStringIsNull(entity.PatientNo, "病人号"); //DataHelper.CheckStringIsNull(entity.PatientNo, "病人号");
DataHelper.CheckGuidIsDefaultValue(entity.MedicalCenterId,"组织单位ID");
DataHelper.CheckGuidIsDefaultValue(entity.MedicalCenterId, "组织单位ID");
DataHelper.CheckStringIsNull(entity.DisplayName, "姓名"); DataHelper.CheckStringIsNull(entity.DisplayName, "姓名");
DataHelper.CheckSex(entity.SexId); DataHelper.CheckSex(entity.SexId);
DataHelper.CheckMaritalStatus(entity.MaritalStatusId); DataHelper.CheckMaritalStatus(entity.MaritalStatusId);

49
src/Shentun.Peis.Domain/RegisterChecks/RegisterCheckManager.cs

@ -72,7 +72,7 @@ namespace Shentun.Peis.RegisterChecks
//if (registerCheckEnt == null) //if (registerCheckEnt == null)
// throw new UserFriendlyException($"数据有误"); // throw new UserFriendlyException($"数据有误");
if(CompleteFlag != RegisterCheckCompleteFlag.UnChecked && CompleteFlag != RegisterCheckCompleteFlag.GiveUpChecked)
if (CompleteFlag != RegisterCheckCompleteFlag.UnChecked && CompleteFlag != RegisterCheckCompleteFlag.GiveUpChecked)
{ {
throw new UserFriendlyException("只能删除结果和弃检时使用,禁止调用"); throw new UserFriendlyException("只能删除结果和弃检时使用,禁止调用");
} }
@ -81,7 +81,7 @@ namespace Shentun.Peis.RegisterChecks
{ {
throw new UserFriendlyException("已总检,不能修改检查状态"); throw new UserFriendlyException("已总检,不能修改检查状态");
} }
if (patientRegister.IsLock == 'Y')
if (patientRegister.IsLock == 'Y')
{ {
throw new UserFriendlyException("人员登记信息已加锁,不能修改检查状态"); throw new UserFriendlyException("人员登记信息已加锁,不能修改检查状态");
} }
@ -92,7 +92,7 @@ namespace Shentun.Peis.RegisterChecks
var count = (await _registerCheckRepository.GetQueryableAsync()).Where(o => o.PatientRegisterId == patientRegister.Id && var count = (await _registerCheckRepository.GetQueryableAsync()).Where(o => o.PatientRegisterId == patientRegister.Id &&
o.Id != RegisterCheckId && o.CompleteFlag != RegisterCheckCompleteFlag.UnChecked).Count(); o.Id != RegisterCheckId && o.CompleteFlag != RegisterCheckCompleteFlag.UnChecked).Count();
if(count == 0)
if (count == 0)
{ {
patientRegister.CompleteFlag = PatientRegisterCompleteFlag.Registration; patientRegister.CompleteFlag = PatientRegisterCompleteFlag.Registration;
await _patientRegisterRepository.UpdateAsync(patientRegister); await _patientRegisterRepository.UpdateAsync(patientRegister);
@ -393,10 +393,20 @@ namespace Shentun.Peis.RegisterChecks
//获取体检中心配置 //获取体检中心配置
check_request_no_rule_coding = spv_tjzx.Where(m => m.SysParmId == "check_request_no_rule_coding").FirstOrDefault().ParmValue; check_request_no_rule_coding = spv_tjzx.Where(m => m.SysParmId == "check_request_no_rule_coding").FirstOrDefault().ParmValue;
} }
if(string.IsNullOrWhiteSpace(check_request_no_rule_coding))
if (string.IsNullOrWhiteSpace(check_request_no_rule_coding))
{ {
//获取全局配置
check_request_no_rule_coding = spv_global.Where(m => m.SysParmId == "check_request_no_rule_coding").FirstOrDefault().ParmValue;
var check_request_no_rule_coding_ent = spv_global.Where(m => m.SysParmId == "check_request_no_rule_coding").FirstOrDefault();
if (check_request_no_rule_coding_ent == null)
{
throw new UserFriendlyException("全局系统参数check_request_no_rule_coding未配置");
}
else
{
//获取全局配置
check_request_no_rule_coding = check_request_no_rule_coding_ent.ParmValue;
}
} }
if (string.IsNullOrWhiteSpace(check_request_no_rule_coding)) if (string.IsNullOrWhiteSpace(check_request_no_rule_coding))
@ -411,8 +421,18 @@ namespace Shentun.Peis.RegisterChecks
} }
if (string.IsNullOrWhiteSpace(check_request_no_rule_tail_len)) if (string.IsNullOrWhiteSpace(check_request_no_rule_tail_len))
{ {
//获取全局配置
check_request_no_rule_tail_len = spv_global.Where(m => m.SysParmId == "check_request_no_rule_tail_len").FirstOrDefault().ParmValue;
var check_request_no_rule_tail_len_ent = spv_global.Where(m => m.SysParmId == "check_request_no_rule_tail_len").FirstOrDefault();
if (check_request_no_rule_tail_len_ent == null)
{
throw new UserFriendlyException("全局系统参数check_request_no_rule_tail_len未配置");
}
else
{
//获取全局配置
check_request_no_rule_tail_len = check_request_no_rule_tail_len_ent.ParmValue;
}
} }
@ -423,8 +443,17 @@ namespace Shentun.Peis.RegisterChecks
} }
if (string.IsNullOrWhiteSpace(check_request_no_rule_prefix)) if (string.IsNullOrWhiteSpace(check_request_no_rule_prefix))
{ {
//获取全局配置
check_request_no_rule_prefix = spv_global.Where(m => m.SysParmId == "check_request_no_rule_prefix").FirstOrDefault().ParmValue;
var check_request_no_rule_prefix_ent = spv_global.Where(m => m.SysParmId == "check_request_no_rule_prefix").FirstOrDefault();
if (check_request_no_rule_prefix_ent == null)
{
throw new UserFriendlyException("全局系统参数check_request_no_rule_prefix未配置");
}
else
{
//获取全局配置
check_request_no_rule_prefix = check_request_no_rule_prefix_ent.ParmValue;
}
} }
if (string.IsNullOrWhiteSpace(check_request_no_rule_tail_len)) if (string.IsNullOrWhiteSpace(check_request_no_rule_tail_len))

Loading…
Cancel
Save