diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/AiDiKang/ImportLisResultPlugInsAiDiKang.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/AiDiKang/ImportLisResultPlugInsAiDiKang.cs index 83507046..c81b8ddc 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/AiDiKang/ImportLisResultPlugInsAiDiKang.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/AiDiKang/ImportLisResultPlugInsAiDiKang.cs @@ -133,7 +133,9 @@ namespace Shentun.Peis.PlugIns.Extensions.ImportLisResults.AiDiKang { //检查完 - var sdsd = client.GetJSONReportItemListByCustomerBarocdeAsync(barCode, aiDiKangKeyValue); + var sdsd = await client.GetJSONReportItemListByCustomerBarocdeAsync(barCode, aiDiKangKeyValue); + + var sdsd2 = await client.GetReportItemListByCustomerBarocdeAsync(aiDiKangKeyValue, barCode, "常规报告"); } ////病理结果 diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs index e66a97d4..e2c1547f 100644 --- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs +++ b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs @@ -228,7 +228,7 @@ namespace Shentun.Peis.CustomerReports PatientName = s.Key.PatientName, Age = s.Key.Age, PatientNo = s.FirstOrDefault().patient.PatientNo, - DiagnosisNames = string.Join(",", s.Where(m => m.diagnosisEmptyHave != null).Select(sa => sa.diagnosisEmptyHave.DisplayName)), + DiagnosisNames = string.Join(";", s.Where(m => m.diagnosisEmptyHave != null).Select((sa, index) => $"{(index + 1).ToCircledNumber()}.{sa.diagnosisEmptyHave.DisplayName}")), SexName = _cacheService.GetSexNameAsync(s.Key.SexId).GetAwaiter().GetResult(), MedicalTimes = s.Key.MedicalTimes, MobileTelephone = s.FirstOrDefault().patient.MobileTelephone, @@ -340,7 +340,7 @@ namespace Shentun.Peis.CustomerReports } - + var queryGroup = queryNull.ToList().GroupBy(g => g.patientRegister); @@ -450,8 +450,11 @@ namespace Shentun.Peis.CustomerReports if (diagnosisNameDetail.Count > 0) { + + //诊断数据 - patientRegisterTemp.DiagnosisNames = string.Join(",", diagnosisNameDetail); + // patientRegisterTemp.DiagnosisNames = string.Join(",", diagnosisNameDetail); + patientRegisterTemp.DiagnosisNames = string.Join(";", diagnosisNameDetail.Select((sa, index) => $"{(index + 1).ToCircledNumber()}.{sa}")); if (input.IsSumSummary == 'Y') { //处理综述 diff --git a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs index c024ffe3..f9183122 100644 --- a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs +++ b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs @@ -333,12 +333,11 @@ namespace Shentun.Peis.ImportLisResults /// - /// 导入迪安结果 外检 + /// 导入迪安、艾迪康结果 外检 /// /// /// [HttpPost("api/app/ImportLisResult/ImportDianResultByPatientRegisterId")] - [AllowAnonymous] public async Task ImportDianResultByPatientRegisterIdAsync(PatientRegisterIdInputDto input) { var patientRegister = await _patientRegisterRepository.GetAsync(input.PatientRegisterId); diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 5649719c..94b42b72 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -2370,8 +2370,8 @@ namespace Shentun.Peis.PatientRegisters ReportPrintTimes = patientRegisterFirst.ReportPrintTimes, Salesman = patientRegisterFirst.Salesman, SexHormoneTermId = patientRegisterFirst.SexHormoneTermId, - CreatorName = "", - LastModifierName = "", + CreatorName = _cacheService.GetSurnameAsync(patientRegisterFirst.CreatorId).GetAwaiter().GetResult(), + LastModifierName = _cacheService.GetSurnameAsync(patientRegisterFirst.LastModifierId).GetAwaiter().GetResult(), Address = patientFirst.Address, //档案表信息 BirthPlaceId = patientFirst.BirthPlaceId, DisplayName = patientFirst.DisplayName, @@ -2391,7 +2391,9 @@ namespace Shentun.Peis.PatientRegisters PersonnelTypeName = _cacheService.GetPersonnelTypeNameAsync(patientRegisterFirst.PersonnelTypeId).GetAwaiter().GetResult(), MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(patientRegisterFirst.MaritalStatusId).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, Salesman = s.FirstOrDefault().a.Salesman, 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, //档案表信息 BirthPlaceId = s.FirstOrDefault().ab.BirthPlaceId, DisplayName = s.FirstOrDefault().ab.DisplayName, @@ -3463,7 +3465,23 @@ namespace Shentun.Peis.PatientRegisters throw new UserFriendlyException("系统中已有该身份证号的不同姓名人员"); else { - patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + 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); + } + } + else + { + patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + } } } @@ -3477,7 +3495,7 @@ namespace Shentun.Peis.PatientRegisters } } - + if (patient == null) { patient = await _patientManager.CreateAsync(updatePatientEntity); @@ -3538,8 +3556,11 @@ namespace Shentun.Peis.PatientRegisters } #endregion - await _patientManager.UpdateAsync(newUpdatePatientEntity, patient); - await _patientRepository.UpdateAsync(patient, true); + if (newUpdatePatientEntity != patient) + { + await _patientManager.UpdateAsync(newUpdatePatientEntity, patient); + await _patientRepository.UpdateAsync(patient, true); + } } Guid? customerOrgId = await GetCustomerOrgIdByName(input.CustomerOrgId, input.DepartmentName, input.IsAutoCreateDepartment); if (customerOrgId == null) diff --git a/src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs b/src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs index 115c8232..ca2d22c4 100644 --- a/src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs +++ b/src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs @@ -472,7 +472,8 @@ public class PeisApplicationAutoMapperProfile : Profile CreateMap(); - CreateMap(); + //CreateMap(); + CreateMap().ForMember(d => d.ExpiryDate, opt => opt.MapFrom(src => DataHelper.ConversionDateToString(src.ExpiryDate))); CreateMap().ForMember(d => d.ExpiryDate, opt => opt.MapFrom(src => PageHelper.ConvertDatetimeV(src.ExpiryDate))); CreateMap().ForMember(d => d.ExpiryDate, opt => opt.MapFrom(src => PageHelper.ConvertDatetimeV(src.ExpiryDate))); diff --git a/src/Shentun.Peis.Domain/DataHelper.cs b/src/Shentun.Peis.Domain/DataHelper.cs index 0d6969d9..1d9fefc3 100644 --- a/src/Shentun.Peis.Domain/DataHelper.cs +++ b/src/Shentun.Peis.Domain/DataHelper.cs @@ -777,5 +777,13 @@ namespace Shentun.Peis } + public static string ToCircledNumber(this int number) + { + if (number < 1 || number > 20) return number.ToString(); + + // ① 到 ⑳ 的 Unicode 编码范围是 9312 到 9331 + char circledNumber = (char)(9311 + number); + return circledNumber.ToString(); + } } }