|
|
@ -2370,8 +2370,8 @@ namespace Shentun.Peis.PatientRegisters |
|
|
ReportPrintTimes = patientRegisterFirst.ReportPrintTimes, |
|
|
ReportPrintTimes = patientRegisterFirst.ReportPrintTimes, |
|
|
Salesman = patientRegisterFirst.Salesman, |
|
|
Salesman = patientRegisterFirst.Salesman, |
|
|
SexHormoneTermId = patientRegisterFirst.SexHormoneTermId, |
|
|
SexHormoneTermId = patientRegisterFirst.SexHormoneTermId, |
|
|
CreatorName = "", |
|
|
|
|
|
LastModifierName = "", |
|
|
|
|
|
|
|
|
CreatorName = _cacheService.GetSurnameAsync(patientRegisterFirst.CreatorId).GetAwaiter().GetResult(), |
|
|
|
|
|
LastModifierName = _cacheService.GetSurnameAsync(patientRegisterFirst.LastModifierId).GetAwaiter().GetResult(), |
|
|
Address = patientFirst.Address, //档案表信息
|
|
|
Address = patientFirst.Address, //档案表信息
|
|
|
BirthPlaceId = patientFirst.BirthPlaceId, |
|
|
BirthPlaceId = patientFirst.BirthPlaceId, |
|
|
DisplayName = patientFirst.DisplayName, |
|
|
DisplayName = patientFirst.DisplayName, |
|
|
@ -2391,7 +2391,9 @@ namespace Shentun.Peis.PatientRegisters |
|
|
PersonnelTypeName = _cacheService.GetPersonnelTypeNameAsync(patientRegisterFirst.PersonnelTypeId).GetAwaiter().GetResult(), |
|
|
PersonnelTypeName = _cacheService.GetPersonnelTypeNameAsync(patientRegisterFirst.PersonnelTypeId).GetAwaiter().GetResult(), |
|
|
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(patientRegisterFirst.MaritalStatusId).GetAwaiter().GetResult(), |
|
|
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(patientRegisterFirst.MaritalStatusId).GetAwaiter().GetResult(), |
|
|
MedicalTypeName = _cacheService.GetMedicalTypeNameAsync(patientRegisterFirst.MedicalTypeId).GetAwaiter().GetResult(), |
|
|
MedicalTypeName = _cacheService.GetMedicalTypeNameAsync(patientRegisterFirst.MedicalTypeId).GetAwaiter().GetResult(), |
|
|
SexName = _cacheService.GetSexNameAsync(patientRegisterFirst.SexId).GetAwaiter().GetResult() |
|
|
|
|
|
|
|
|
SexName = _cacheService.GetSexNameAsync(patientRegisterFirst.SexId).GetAwaiter().GetResult(), |
|
|
|
|
|
SummaryDoctorName = _cacheService.GetSurnameAsync(patientRegisterFirst.SummaryDoctorId).GetAwaiter().GetResult(), |
|
|
|
|
|
AuditDoctorName = _cacheService.GetSurnameAsync(patientRegisterFirst.AuditDoctorId).GetAwaiter().GetResult() |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -2666,8 +2668,8 @@ namespace Shentun.Peis.PatientRegisters |
|
|
ReportPrintTimes = s.FirstOrDefault().a.ReportPrintTimes, |
|
|
ReportPrintTimes = s.FirstOrDefault().a.ReportPrintTimes, |
|
|
Salesman = s.FirstOrDefault().a.Salesman, |
|
|
Salesman = s.FirstOrDefault().a.Salesman, |
|
|
SexHormoneTermId = s.FirstOrDefault().a.SexHormoneTermId, |
|
|
SexHormoneTermId = s.FirstOrDefault().a.SexHormoneTermId, |
|
|
CreatorName = "", |
|
|
|
|
|
LastModifierName = "", |
|
|
|
|
|
|
|
|
CreatorName = _cacheService.GetSurnameAsync(s.FirstOrDefault().a.CreatorId).GetAwaiter().GetResult(), |
|
|
|
|
|
LastModifierName = _cacheService.GetSurnameAsync(s.FirstOrDefault().a.LastModifierId).GetAwaiter().GetResult(), |
|
|
Address = s.FirstOrDefault().ab.Address, //档案表信息
|
|
|
Address = s.FirstOrDefault().ab.Address, //档案表信息
|
|
|
BirthPlaceId = s.FirstOrDefault().ab.BirthPlaceId, |
|
|
BirthPlaceId = s.FirstOrDefault().ab.BirthPlaceId, |
|
|
DisplayName = s.FirstOrDefault().ab.DisplayName, |
|
|
DisplayName = s.FirstOrDefault().ab.DisplayName, |
|
|
@ -3462,10 +3464,26 @@ namespace Shentun.Peis.PatientRegisters |
|
|
if (patientList.Where(m => m.DisplayName == input.PatientName).Count() == 0) |
|
|
if (patientList.Where(m => m.DisplayName == input.PatientName).Count() == 0) |
|
|
throw new UserFriendlyException("系统中已有该身份证号的不同姓名人员"); |
|
|
throw new UserFriendlyException("系统中已有该身份证号的不同姓名人员"); |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
patientList = patientList.Where(m => m.DisplayName == input.PatientName).ToList(); |
|
|
|
|
|
if (patientList.Count > 1) |
|
|
|
|
|
{ |
|
|
|
|
|
var tPatientRegisterList = await _repository.GetListAsync(m => patientList.Select(s => s.Id).Contains(m.PatientId)); |
|
|
|
|
|
if (tPatientRegisterList.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
patient = patientList.FirstOrDefault(f => f.Id == tPatientRegisterList.OrderByDescending(o => o.MedicalTimes).Select(s => s.PatientId).FirstOrDefault()); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
{ |
|
|
{ |
|
|
patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); |
|
|
patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrWhiteSpace(input.PatientNo)) |
|
|
if (!string.IsNullOrWhiteSpace(input.PatientNo)) |
|
|
@ -3538,9 +3556,12 @@ namespace Shentun.Peis.PatientRegisters |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
if (newUpdatePatientEntity != patient) |
|
|
|
|
|
{ |
|
|
await _patientManager.UpdateAsync(newUpdatePatientEntity, patient); |
|
|
await _patientManager.UpdateAsync(newUpdatePatientEntity, patient); |
|
|
await _patientRepository.UpdateAsync(patient, true); |
|
|
await _patientRepository.UpdateAsync(patient, true); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
Guid? customerOrgId = await GetCustomerOrgIdByName(input.CustomerOrgId, input.DepartmentName, input.IsAutoCreateDepartment); |
|
|
Guid? customerOrgId = await GetCustomerOrgIdByName(input.CustomerOrgId, input.DepartmentName, input.IsAutoCreateDepartment); |
|
|
if (customerOrgId == null) |
|
|
if (customerOrgId == null) |
|
|
{ |
|
|
{ |
|
|
|