Browse Source

医生诊台

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
de7bda0999
  1. 12
      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

12
src/Shentun.ColumnReferencePlugIns/LisResultImportPlugInsDbBase.cs

@ -33,6 +33,15 @@ namespace Shentun.Peis.PlugIns
throw new Exception("没有设置项目编码对照");
}
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);
using (DbConnection conn = CreateInterfaceDbConnect())
{
@ -60,7 +69,7 @@ namespace Shentun.Peis.PlugIns
{
throw new Exception($"{lisResult.ItemName}对照的编码无效");
}
var createImportLisResultDto = new CreateImportLisResultDto()
{
LisRequestNo = lisResult.LisRequestNo,
@ -74,6 +83,7 @@ namespace Shentun.Peis.PlugIns
ReportPrompt = lisResult.ReportPrompt,
CheckDoctorName = lisResult.CheckDoctorName,
CheckDate = lisResult.CheckDate,
ExecOrganizationUnitId = execOrganizationUnitId
};
createImportLisResultDtos.Add(createImportLisResultDto);
}

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

@ -21,6 +21,8 @@ namespace Shentun.Peis.RegisterChecks
/// 检查日期(格式:2023-07-18) 空值跟null取当前日期
/// </summary>
public DateTime? CheckDate { get; set; }
public Guid? ExecOrganizationUnitId { get; set; }
public List<UpdateRegisterCheckItemDetail> RegisterCheckItems { get; set; }
public List<UpdateRegisterCheckSummaryDetail> Summarys { get; set; } = new List<UpdateRegisterCheckSummaryDetail>();
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.CheckDate = inputItem.CheckDate;
lisRequestItem.registerCheck.ExecOrganizationUnitId = inputItem.ExecOrganizationUnitId;
registerChecks.Add(lisRequestItem.registerCheck);
}
@ -212,6 +213,7 @@ namespace Shentun.Peis.ImportLisResults
RegisterCheckId = registerCheck.Id,
CheckDoctorId = registerCheck.CheckDoctorId,
CheckDate = registerCheck.CheckDate,
ExecOrganizationUnitId = registerCheck.ExecOrganizationUnitId,
RegisterCheckItems = list.Where(o => o.registerCheck.Id == registerCheck.Id)
.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())
.Include(x => x.RegisterCheckAsbitems)
.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 增加项目类别权限
@ -279,7 +281,11 @@ namespace Shentun.Peis.RegisterChecks
var registerCheck = await _registerCheckRepository.GetAsync(input.RegisterCheckId);
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;
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.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Volo.Abp.Identity;
using Volo.Abp.Users;
namespace Shentun.Peis.RegisterChecks
@ -25,6 +26,8 @@ namespace Shentun.Peis.RegisterChecks
private readonly IRepository<SysParmValue> _sysParmValueRepository;
private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository;
private readonly IRepository<PrimarykeyBuilder> _primarykeyBuilderRepository;
private readonly IRepository<IdentityUser, Guid> _usersRepository;
private readonly IRepository<IdentityUserOrganizationUnit> _identityUserOrganizationUnitRepository;
private readonly RegisterCheckSummaryManager _registerCheckSummaryManager;
private readonly RegisterCheckSuggestionManager _registerCheckSuggestionManager;
private readonly CurrentUser _currentUser;
@ -37,7 +40,9 @@ namespace Shentun.Peis.RegisterChecks
IRepository<RegisterCheckItem> registerCheckItemRepository,
RegisterCheckSummaryManager registerCheckSummaryManager,
RegisterCheckSuggestionManager registerCheckSuggestionManager,
IRepository<PatientRegister, Guid> patientRegisterRepository)
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<IdentityUser, Guid> usersRepository,
IRepository<IdentityUserOrganizationUnit> identityUserOrganizationUnitRepository)
{
this._registerCheckRepository = registerCheckRepository;
this._sysParmValueRepository = sysParmValueRepository;
@ -48,6 +53,8 @@ namespace Shentun.Peis.RegisterChecks
this._registerCheckSummaryManager = registerCheckSummaryManager;
this._registerCheckSuggestionManager = registerCheckSuggestionManager;
_patientRegisterRepository = patientRegisterRepository;
_usersRepository = usersRepository;
_identityUserOrganizationUnitRepository = identityUserOrganizationUnitRepository;
}
/// <summary>
@ -152,6 +159,11 @@ namespace Shentun.Peis.RegisterChecks
entity.CheckDate = DateTime.Now;
else
entity.CheckDate = entitydto.CheckDate;
if (string.IsNullOrWhiteSpace(entitydto.CheckDoctorId))
{
entitydto.CheckDoctorId = _currentUser.Id.ToString();
}
entity.CheckDoctorId = entitydto.CheckDoctorId;
entity.CompleteFlag = RegisterCheckCompleteFlag.Checked;
@ -161,7 +173,8 @@ namespace Shentun.Peis.RegisterChecks
PatientRegister patientRegister,
RegisterCheck entity,
string checkDoctorId,
DateTime? checkDate
DateTime? checkDate,
Guid? execOrganizationUnitId
)
{
if (entity == null)
@ -185,8 +198,24 @@ namespace Shentun.Peis.RegisterChecks
else
entity.CheckDate = checkDate;
if (string.IsNullOrWhiteSpace(checkDoctorId))
{
checkDoctorId = _currentUser.Id.ToString();
}
entity.CheckDoctorId = checkDoctorId;
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>
/// 更改危警值内容

Loading…
Cancel
Save