wxd 2 years ago
parent
commit
c54627c2ab
  1. 10
      src/Shentun.ColumnReferencePlugIns/LisResultImportPlugInsDbBase.cs
  2. 2
      src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs
  3. 2
      src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs
  4. 10
      src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
  5. 33
      src/Shentun.Peis.Domain/RegisterChecks/RegisterCheckManager.cs

10
src/Shentun.ColumnReferencePlugIns/LisResultImportPlugInsDbBase.cs

@ -33,6 +33,15 @@ namespace Shentun.Peis.PlugIns
throw new Exception("没有设置项目编码对照"); throw new Exception("没有设置项目编码对照");
} }
var result = new LisResultImportPlugInsOut(); var result = new LisResultImportPlugInsOut();
var execOrganizationUnitIdStr = InterfaceConfig.GetSection("Interface").GetSection("ExecOrganizationUnitId").Value;
if(string.IsNullOrWhiteSpace(execOrganizationUnitIdStr))
{
throw new Exception("执行科室配置不能为空");
}
if(!Guid.TryParse(execOrganizationUnitIdStr, out Guid execOrganizationUnitId))
{
throw new Exception("执行科室配置不是有效的GUID值");
}
var lisRequests = await GetLisRequestForResultImportPlugInssAsync(input.PatientRegisterId); var lisRequests = await GetLisRequestForResultImportPlugInssAsync(input.PatientRegisterId);
using (DbConnection conn = CreateInterfaceDbConnect()) using (DbConnection conn = CreateInterfaceDbConnect())
{ {
@ -74,6 +83,7 @@ namespace Shentun.Peis.PlugIns
ReportPrompt = lisResult.ReportPrompt, ReportPrompt = lisResult.ReportPrompt,
CheckDoctorName = lisResult.CheckDoctorName, CheckDoctorName = lisResult.CheckDoctorName,
CheckDate = lisResult.CheckDate, CheckDate = lisResult.CheckDate,
ExecOrganizationUnitId = execOrganizationUnitId
}; };
createImportLisResultDtos.Add(createImportLisResultDto); createImportLisResultDtos.Add(createImportLisResultDto);
} }

2
src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs

@ -21,6 +21,8 @@ namespace Shentun.Peis.RegisterChecks
/// 检查日期(格式:2023-07-18) 空值跟null取当前日期 /// 检查日期(格式:2023-07-18) 空值跟null取当前日期
/// </summary> /// </summary>
public DateTime? CheckDate { get; set; } public DateTime? CheckDate { get; set; }
public Guid? ExecOrganizationUnitId { get; set; }
public List<UpdateRegisterCheckItemDetail> RegisterCheckItems { get; set; } public List<UpdateRegisterCheckItemDetail> RegisterCheckItems { get; set; }
public List<UpdateRegisterCheckSummaryDetail> Summarys { get; set; } = new List<UpdateRegisterCheckSummaryDetail>(); public List<UpdateRegisterCheckSummaryDetail> Summarys { get; set; } = new List<UpdateRegisterCheckSummaryDetail>();
public List<UpdateRegisterCheckSuggestionDetail> Suggestions { get; set; } = new List<UpdateRegisterCheckSuggestionDetail>(); public List<UpdateRegisterCheckSuggestionDetail> Suggestions { get; set; } = new List<UpdateRegisterCheckSuggestionDetail>();

2
src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs

@ -165,6 +165,7 @@ namespace Shentun.Peis.ImportLisResults
{ {
lisRequestItem.registerCheck.CheckDoctorId = inputItem.CheckDoctorName; lisRequestItem.registerCheck.CheckDoctorId = inputItem.CheckDoctorName;
lisRequestItem.registerCheck.CheckDate = inputItem.CheckDate; lisRequestItem.registerCheck.CheckDate = inputItem.CheckDate;
lisRequestItem.registerCheck.ExecOrganizationUnitId = inputItem.ExecOrganizationUnitId;
registerChecks.Add(lisRequestItem.registerCheck); registerChecks.Add(lisRequestItem.registerCheck);
} }
@ -212,6 +213,7 @@ namespace Shentun.Peis.ImportLisResults
RegisterCheckId = registerCheck.Id, RegisterCheckId = registerCheck.Id,
CheckDoctorId = registerCheck.CheckDoctorId, CheckDoctorId = registerCheck.CheckDoctorId,
CheckDate = registerCheck.CheckDate, CheckDate = registerCheck.CheckDate,
ExecOrganizationUnitId = registerCheck.ExecOrganizationUnitId,
RegisterCheckItems = list.Where(o => o.registerCheck.Id == registerCheck.Id) RegisterCheckItems = list.Where(o => o.registerCheck.Id == registerCheck.Id)
.Select(o => new UpdateRegisterCheckItemDetail() .Select(o => new UpdateRegisterCheckItemDetail()
{ {

10
src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs

@ -217,7 +217,9 @@ namespace Shentun.Peis.RegisterChecks
var entlist = (await _registerCheckRepository.GetQueryableAsync()) var entlist = (await _registerCheckRepository.GetQueryableAsync())
.Include(x => x.RegisterCheckAsbitems) .Include(x => x.RegisterCheckAsbitems)
.ThenInclude(x => x.Asbitem).ThenInclude(x => x.ItemType) .ThenInclude(x => x.Asbitem).ThenInclude(x => x.ItemType)
.Where(m => m.RegisterCheckAsbitems.Select(s => s.PatientRegisterId).Contains(input.PatientRegisterId));
.Where(m => m.RegisterCheckAsbitems.Select(s => s.PatientRegisterId)
.Contains(input.PatientRegisterId)
&& m.RegisterCheckAsbitems.Select(s=>s.Asbitem.IsCheck).Contains('Y'));
#region 增加项目类别权限 #region 增加项目类别权限
@ -279,7 +281,11 @@ namespace Shentun.Peis.RegisterChecks
var registerCheck = await _registerCheckRepository.GetAsync(input.RegisterCheckId); var registerCheck = await _registerCheckRepository.GetAsync(input.RegisterCheckId);
var patientRegister = await _patientRegisterRepository.GetAsync(registerCheck.PatientRegisterId); var patientRegister = await _patientRegisterRepository.GetAsync(registerCheck.PatientRegisterId);
//修改医生和检查日期 //修改医生和检查日期
_registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate);
if(string.IsNullOrWhiteSpace(input.CheckDoctorId))
{
input.CheckDoctorId = CurrentUser.Id.ToString();
}
_registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate,input.ExecOrganizationUnitId);
//更新人员登记信息完成标志 //更新人员登记信息完成标志
patientRegister.CompleteFlag = PatientRegisterCompleteFlag.PartCheck; patientRegister.CompleteFlag = PatientRegisterCompleteFlag.PartCheck;
await _patientRegisterRepository.UpdateAsync(patientRegister); await _patientRegisterRepository.UpdateAsync(patientRegister);

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

@ -10,6 +10,7 @@ using System.Threading.Tasks;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
using Volo.Abp.Identity;
using Volo.Abp.Users; using Volo.Abp.Users;
namespace Shentun.Peis.RegisterChecks namespace Shentun.Peis.RegisterChecks
@ -25,6 +26,8 @@ namespace Shentun.Peis.RegisterChecks
private readonly IRepository<SysParmValue> _sysParmValueRepository; private readonly IRepository<SysParmValue> _sysParmValueRepository;
private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository; private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository;
private readonly IRepository<PrimarykeyBuilder> _primarykeyBuilderRepository; private readonly IRepository<PrimarykeyBuilder> _primarykeyBuilderRepository;
private readonly IRepository<IdentityUser, Guid> _usersRepository;
private readonly IRepository<IdentityUserOrganizationUnit> _identityUserOrganizationUnitRepository;
private readonly RegisterCheckSummaryManager _registerCheckSummaryManager; private readonly RegisterCheckSummaryManager _registerCheckSummaryManager;
private readonly RegisterCheckSuggestionManager _registerCheckSuggestionManager; private readonly RegisterCheckSuggestionManager _registerCheckSuggestionManager;
private readonly CurrentUser _currentUser; private readonly CurrentUser _currentUser;
@ -37,7 +40,9 @@ namespace Shentun.Peis.RegisterChecks
IRepository<RegisterCheckItem> registerCheckItemRepository, IRepository<RegisterCheckItem> registerCheckItemRepository,
RegisterCheckSummaryManager registerCheckSummaryManager, RegisterCheckSummaryManager registerCheckSummaryManager,
RegisterCheckSuggestionManager registerCheckSuggestionManager, RegisterCheckSuggestionManager registerCheckSuggestionManager,
IRepository<PatientRegister, Guid> patientRegisterRepository)
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<IdentityUser, Guid> usersRepository,
IRepository<IdentityUserOrganizationUnit> identityUserOrganizationUnitRepository)
{ {
this._registerCheckRepository = registerCheckRepository; this._registerCheckRepository = registerCheckRepository;
this._sysParmValueRepository = sysParmValueRepository; this._sysParmValueRepository = sysParmValueRepository;
@ -48,6 +53,8 @@ namespace Shentun.Peis.RegisterChecks
this._registerCheckSummaryManager = registerCheckSummaryManager; this._registerCheckSummaryManager = registerCheckSummaryManager;
this._registerCheckSuggestionManager = registerCheckSuggestionManager; this._registerCheckSuggestionManager = registerCheckSuggestionManager;
_patientRegisterRepository = patientRegisterRepository; _patientRegisterRepository = patientRegisterRepository;
_usersRepository = usersRepository;
_identityUserOrganizationUnitRepository = identityUserOrganizationUnitRepository;
} }
/// <summary> /// <summary>
@ -152,6 +159,11 @@ namespace Shentun.Peis.RegisterChecks
entity.CheckDate = DateTime.Now; entity.CheckDate = DateTime.Now;
else else
entity.CheckDate = entitydto.CheckDate; entity.CheckDate = entitydto.CheckDate;
if (string.IsNullOrWhiteSpace(entitydto.CheckDoctorId))
{
entitydto.CheckDoctorId = _currentUser.Id.ToString();
}
entity.CheckDoctorId = entitydto.CheckDoctorId; entity.CheckDoctorId = entitydto.CheckDoctorId;
entity.CompleteFlag = RegisterCheckCompleteFlag.Checked; entity.CompleteFlag = RegisterCheckCompleteFlag.Checked;
@ -161,7 +173,8 @@ namespace Shentun.Peis.RegisterChecks
PatientRegister patientRegister, PatientRegister patientRegister,
RegisterCheck entity, RegisterCheck entity,
string checkDoctorId, string checkDoctorId,
DateTime? checkDate
DateTime? checkDate,
Guid? execOrganizationUnitId
) )
{ {
if (entity == null) if (entity == null)
@ -185,8 +198,24 @@ namespace Shentun.Peis.RegisterChecks
else else
entity.CheckDate = checkDate; entity.CheckDate = checkDate;
if (string.IsNullOrWhiteSpace(checkDoctorId))
{
checkDoctorId = _currentUser.Id.ToString();
}
entity.CheckDoctorId = checkDoctorId; entity.CheckDoctorId = checkDoctorId;
entity.CompleteFlag = RegisterCheckCompleteFlag.Checked; entity.CompleteFlag = RegisterCheckCompleteFlag.Checked;
if(execOrganizationUnitId != null && execOrganizationUnitId != Guid.Empty)
{
entity.ExecOrganizationUnitId = execOrganizationUnitId;
}
else
{
if(Guid.TryParse(entity.CheckDoctorId,out var checkDoctorIdGuid))
{
var identityUserOrganizationUnit = _identityUserOrganizationUnitRepository.GetAsync(o => o.UserId == checkDoctorIdGuid).Result;
entity.ExecOrganizationUnitId = identityUserOrganizationUnit.OrganizationUnitId;
}
}
} }
/// <summary> /// <summary>
/// 更改危警值内容 /// 更改危警值内容

Loading…
Cancel
Save