|
|
@ -36,6 +36,7 @@ using Shentun.Peis.SumSummaryReports; |
|
|
using Shentun.Peis.SysParmValues; |
|
|
using Shentun.Peis.SysParmValues; |
|
|
using Shentun.Peis.ThirdBookingPushs; |
|
|
using Shentun.Peis.ThirdBookingPushs; |
|
|
using Shentun.Utilities; |
|
|
using Shentun.Utilities; |
|
|
|
|
|
using SqlSugar; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Diagnostics; |
|
|
using System.Diagnostics; |
|
|
@ -3339,8 +3340,26 @@ namespace Shentun.Peis.PatientRegisters |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(input.IdNo)) |
|
|
if (!string.IsNullOrWhiteSpace(input.IdNo)) |
|
|
|
|
|
{ |
|
|
input.IdNo = input.IdNo.Trim(); |
|
|
input.IdNo = input.IdNo.Trim(); |
|
|
|
|
|
|
|
|
|
|
|
var idInfo = DataHelper.AutoIDCard(input.IdNo); |
|
|
|
|
|
if (idInfo != null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (input.Age == null) |
|
|
|
|
|
{ |
|
|
|
|
|
input.Age = idInfo.Age; |
|
|
|
|
|
} |
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.BirthDate)) |
|
|
|
|
|
{ |
|
|
|
|
|
input.BirthDate = idInfo.BirthDate; |
|
|
|
|
|
} |
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.SexName)) |
|
|
|
|
|
{ |
|
|
|
|
|
input.SexName = idInfo.SexId == 'M' ? "男" : "女"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
#region 转换职业病信息
|
|
|
#region 转换职业病信息
|
|
|
|
|
|
|
|
|
Guid ocCheckTypeId = Guid.Empty; |
|
|
Guid ocCheckTypeId = Guid.Empty; |
|
|
@ -3698,6 +3717,12 @@ namespace Shentun.Peis.PatientRegisters |
|
|
return null; |
|
|
return null; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按全部数据查重名数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="getSameNamePatientInputDto"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("api/app/patientregister/GetSameNamePatient")] |
|
|
[HttpPost("api/app/patientregister/GetSameNamePatient")] |
|
|
public async Task<List<GetSameNamePatientDto>> GetSameNamePatientAsync(GetSameNamePatientInputDto getSameNamePatientInputDto) |
|
|
public async Task<List<GetSameNamePatientDto>> GetSameNamePatientAsync(GetSameNamePatientInputDto getSameNamePatientInputDto) |
|
|
{ |
|
|
{ |
|
|
@ -3708,10 +3733,6 @@ namespace Shentun.Peis.PatientRegisters |
|
|
var result = (from patient in patientQuery |
|
|
var result = (from patient in patientQuery |
|
|
join patientRegister in patientRegisterQuery |
|
|
join patientRegister in patientRegisterQuery |
|
|
on patient.Id equals patientRegister.PatientId |
|
|
on patient.Id equals patientRegister.PatientId |
|
|
join customerOrg in customerOrgQuery |
|
|
|
|
|
on patientRegister.CustomerOrgId equals customerOrg.Id |
|
|
|
|
|
join topCustomerOrg in topCustomerOrgQuery |
|
|
|
|
|
on customerOrg.PathCode.Substring(0, 5) equals topCustomerOrg.PathCode |
|
|
|
|
|
where patient.DisplayName == getSameNamePatientInputDto.Name |
|
|
where patient.DisplayName == getSameNamePatientInputDto.Name |
|
|
select new |
|
|
select new |
|
|
{ |
|
|
{ |
|
|
@ -3720,29 +3741,31 @@ namespace Shentun.Peis.PatientRegisters |
|
|
SexId = patient.SexId, |
|
|
SexId = patient.SexId, |
|
|
NationId = patient.NationId, |
|
|
NationId = patient.NationId, |
|
|
BirthDate = patient.BirthDate, |
|
|
BirthDate = patient.BirthDate, |
|
|
//SexName = _cacheService.GetSexNameAsync(patient.SexId).Result,
|
|
|
|
|
|
//NationName = _cacheService.GetNationNameAsync(patient.NationId).Result,
|
|
|
|
|
|
// BirthDate = ConvertExtr.ToStringByDateOnly( patient.BirthDate),
|
|
|
|
|
|
IdNo = patient.IdNo, |
|
|
IdNo = patient.IdNo, |
|
|
PostalCode = patient.PostalCode, |
|
|
PostalCode = patient.PostalCode, |
|
|
Email = patient.Email, |
|
|
Email = patient.Email, |
|
|
Telephone = patient.Telephone, |
|
|
Telephone = patient.Telephone, |
|
|
MobileTelephone = patient.MobileTelephone, |
|
|
MobileTelephone = patient.MobileTelephone, |
|
|
Address = patient.Address, |
|
|
Address = patient.Address, |
|
|
CustomerOrgName = topCustomerOrg.DisplayName, |
|
|
|
|
|
CustomerOrgId = patientRegister.CustomerOrgId, |
|
|
CustomerOrgId = patientRegister.CustomerOrgId, |
|
|
DepartmentName = customerOrg.DisplayName |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MedicalStartDate = patientRegister.MedicalStartDate, |
|
|
|
|
|
CustomerOrgGroupId = patientRegister.CustomerOrgGroupId, |
|
|
|
|
|
MedicalPackageId = patientRegister.MedicalPackageId |
|
|
}).Distinct().ToList(); |
|
|
}).Distinct().ToList(); |
|
|
var getSameNamePatientDtos = new List<GetSameNamePatientDto>(); |
|
|
var getSameNamePatientDtos = new List<GetSameNamePatientDto>(); |
|
|
|
|
|
|
|
|
foreach (var item in result) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var patientGroup = result.GroupBy(g => g.PatientNo); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var itemPatient in patientGroup) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var item = itemPatient.OrderByDescending(o => o.MedicalStartDate).FirstOrDefault(); |
|
|
|
|
|
|
|
|
getSameNamePatientDtos.Add(new GetSameNamePatientDto() |
|
|
getSameNamePatientDtos.Add(new GetSameNamePatientDto() |
|
|
{ |
|
|
{ |
|
|
PatientName = item.PatientName, |
|
|
PatientName = item.PatientName, |
|
|
PatientNo = item.PatientNo, |
|
|
PatientNo = item.PatientNo, |
|
|
|
|
|
|
|
|
SexName = _cacheService.GetSexNameAsync(item.SexId).Result, |
|
|
SexName = _cacheService.GetSexNameAsync(item.SexId).Result, |
|
|
NationName = _cacheService.GetNationNameAsync(item.NationId).Result, |
|
|
NationName = _cacheService.GetNationNameAsync(item.NationId).Result, |
|
|
BirthDate = DataHelper.ConversionDateToString(item.BirthDate), |
|
|
BirthDate = DataHelper.ConversionDateToString(item.BirthDate), |
|
|
@ -3752,8 +3775,10 @@ namespace Shentun.Peis.PatientRegisters |
|
|
Telephone = item.Telephone, |
|
|
Telephone = item.Telephone, |
|
|
MobileTelephone = item.MobileTelephone, |
|
|
MobileTelephone = item.MobileTelephone, |
|
|
Address = item.Address, |
|
|
Address = item.Address, |
|
|
CustomerOrgName = item.CustomerOrgName, |
|
|
|
|
|
DepartmentName = item.DepartmentName |
|
|
|
|
|
|
|
|
CustomerOrgName = _cacheService.GetTopCustomerOrgNameAsync(item.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
DepartmentName = _cacheService.GetCustomerOrgNameAsync(item.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
CustomerOrgGroupName = item.CustomerOrgGroupId == null ? "" : _cacheService.GetCustomerOrgGroupAsync(item.CustomerOrgGroupId.Value).GetAwaiter().GetResult().DisplayName, |
|
|
|
|
|
MedicalPackageName = _cacheService.GetMedicalTypeNameAsync(item.MedicalPackageId).GetAwaiter().GetResult() |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -3761,6 +3786,11 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按部门数据查重名数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="getCustomerOrgSameNamePatientInputDto"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("api/app/patientregister/GetCustomerOrgSameNamePatient")] |
|
|
[HttpPost("api/app/patientregister/GetCustomerOrgSameNamePatient")] |
|
|
public async Task<List<GetSameNamePatientDto>> GetCustomerOrgSameNamePatientAsync(GetCustomerOrgSameNamePatientInputDto getCustomerOrgSameNamePatientInputDto) |
|
|
public async Task<List<GetSameNamePatientDto>> GetCustomerOrgSameNamePatientAsync(GetCustomerOrgSameNamePatientInputDto getCustomerOrgSameNamePatientInputDto) |
|
|
{ |
|
|
{ |
|
|
@ -3783,9 +3813,6 @@ namespace Shentun.Peis.PatientRegisters |
|
|
SexId = patient.SexId, |
|
|
SexId = patient.SexId, |
|
|
NationId = patient.NationId, |
|
|
NationId = patient.NationId, |
|
|
BirthDate = patient.BirthDate, |
|
|
BirthDate = patient.BirthDate, |
|
|
//SexName = _cacheService.GetSexNameAsync(patient.SexId).Result,
|
|
|
|
|
|
//NationName = _cacheService.GetNationNameAsync(patient.NationId).Result,
|
|
|
|
|
|
// BirthDate = ConvertExtr.ToStringByDateOnly( patient.BirthDate),
|
|
|
|
|
|
IdNo = patient.IdNo, |
|
|
IdNo = patient.IdNo, |
|
|
PostalCode = patient.PostalCode, |
|
|
PostalCode = patient.PostalCode, |
|
|
Email = patient.Email, |
|
|
Email = patient.Email, |
|
|
@ -3793,18 +3820,22 @@ namespace Shentun.Peis.PatientRegisters |
|
|
MobileTelephone = patient.MobileTelephone, |
|
|
MobileTelephone = patient.MobileTelephone, |
|
|
Address = patient.Address, |
|
|
Address = patient.Address, |
|
|
CustomerOrgId = patientRegister.CustomerOrgId, |
|
|
CustomerOrgId = patientRegister.CustomerOrgId, |
|
|
DepartmentName = customerOrg.DisplayName |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CustomerOrgGroupId = patientRegister.CustomerOrgGroupId, |
|
|
|
|
|
MedicalPackageId = patientRegister.MedicalPackageId, |
|
|
|
|
|
MedicalStartDate = patientRegister.MedicalStartDate |
|
|
}).Distinct().ToList(); |
|
|
}).Distinct().ToList(); |
|
|
var getSameNamePatientDtos = new List<GetSameNamePatientDto>(); |
|
|
var getSameNamePatientDtos = new List<GetSameNamePatientDto>(); |
|
|
|
|
|
|
|
|
foreach (var item in result) |
|
|
|
|
|
|
|
|
var patientGroup = result.GroupBy(g => g.PatientNo); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var itemPatient in patientGroup) |
|
|
{ |
|
|
{ |
|
|
|
|
|
var item = itemPatient.OrderByDescending(o => o.MedicalStartDate).FirstOrDefault(); |
|
|
|
|
|
|
|
|
getSameNamePatientDtos.Add(new GetSameNamePatientDto() |
|
|
getSameNamePatientDtos.Add(new GetSameNamePatientDto() |
|
|
{ |
|
|
{ |
|
|
PatientName = item.PatientName, |
|
|
PatientName = item.PatientName, |
|
|
PatientNo = item.PatientNo, |
|
|
PatientNo = item.PatientNo, |
|
|
|
|
|
|
|
|
SexName = _cacheService.GetSexNameAsync(item.SexId).Result, |
|
|
SexName = _cacheService.GetSexNameAsync(item.SexId).Result, |
|
|
NationName = _cacheService.GetNationNameAsync(item.NationId).Result, |
|
|
NationName = _cacheService.GetNationNameAsync(item.NationId).Result, |
|
|
BirthDate = DataHelper.ConversionDateToString(item.BirthDate), |
|
|
BirthDate = DataHelper.ConversionDateToString(item.BirthDate), |
|
|
@ -3814,8 +3845,10 @@ namespace Shentun.Peis.PatientRegisters |
|
|
Telephone = item.Telephone, |
|
|
Telephone = item.Telephone, |
|
|
MobileTelephone = item.MobileTelephone, |
|
|
MobileTelephone = item.MobileTelephone, |
|
|
Address = item.Address, |
|
|
Address = item.Address, |
|
|
CustomerOrgName = customerOrgEntity.DisplayName, |
|
|
|
|
|
DepartmentName = item.DepartmentName |
|
|
|
|
|
|
|
|
CustomerOrgName = _cacheService.GetTopCustomerOrgNameAsync(item.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
DepartmentName = _cacheService.GetCustomerOrgNameAsync(item.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
CustomerOrgGroupName = item.CustomerOrgGroupId == null ? "" : _cacheService.GetCustomerOrgGroupAsync(item.CustomerOrgGroupId.Value).GetAwaiter().GetResult().DisplayName, |
|
|
|
|
|
MedicalPackageName = _cacheService.GetMedicalTypeNameAsync(item.MedicalPackageId).GetAwaiter().GetResult() |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -3956,10 +3989,11 @@ namespace Shentun.Peis.PatientRegisters |
|
|
PatientPassword = s.ab.PatientPassword, |
|
|
PatientPassword = s.ab.PatientPassword, |
|
|
PostalCode = s.ab.PostalCode, |
|
|
PostalCode = s.ab.PostalCode, |
|
|
Telephone = s.ab.Telephone, |
|
|
Telephone = s.ab.Telephone, |
|
|
CustomerOrgName = EntityHelper.GetCustomerOrgNameNoSql(customerOrgList, s.a.CustomerOrgId), |
|
|
|
|
|
CustomerOrgParentId = EntityHelper.GetParentNoSql(customerOrgList, s.a.CustomerOrgId), |
|
|
|
|
|
CustomerOrgParentName = EntityHelper.GetCustomerOrgParentNameNoSql(customerOrgList, s.a.CustomerOrgId) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CustomerOrgName = _cacheService.GetCustomerOrgNameAsync(s.a.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
CustomerOrgParentId = _cacheService.GetTopCustomerOrgIdAsync(s.a.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
CustomerOrgParentName = _cacheService.GetTopCustomerOrgNameAsync(s.a.CustomerOrgId).GetAwaiter().GetResult(), |
|
|
|
|
|
CustomerOrgGroupName = s.a.CustomerOrgGroupId == null ? "" : _cacheService.GetCustomerOrgGroupAsync(s.a.CustomerOrgGroupId.Value).GetAwaiter().GetResult().DisplayName, |
|
|
|
|
|
MedicalPackageName = _cacheService.GetMedicalTypeNameAsync(s.a.MedicalPackageId).GetAwaiter().GetResult() |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -5123,6 +5157,11 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
|
|
|
|
|
var DepartmentReturn = await _customerOrgRepository.InsertAsync(DepartmentEnt, true); |
|
|
var DepartmentReturn = await _customerOrgRepository.InsertAsync(DepartmentEnt, true); |
|
|
|
|
|
|
|
|
|
|
|
#region 更新缓存版本
|
|
|
|
|
|
var versonNo = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); |
|
|
|
|
|
_cacheService.SetDataVersonCache("customer_three", versonNo); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
return DepartmentReturn.Id; |
|
|
return DepartmentReturn.Id; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|