|
|
|
@ -23,6 +23,7 @@ using Shentun.Peis.SumSuggestionHeaders; |
|
|
|
using Shentun.Peis.SumSummaryContents; |
|
|
|
using Shentun.Peis.SumSummaryHeaders; |
|
|
|
using Shentun.Peis.SumSummaryReports; |
|
|
|
using Shentun.Peis.SysParmValues; |
|
|
|
using Shentun.Utilities; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
@ -103,9 +104,12 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
//private readonly IRepository<SysParmValue> _sysParmValueRepository;
|
|
|
|
private readonly PatientRegisterManager _manager; |
|
|
|
private readonly CacheService _cacheService; |
|
|
|
private readonly SysParmValueManager _sysParmValueManager; |
|
|
|
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|
|
|
public PatientRegisterAppService( |
|
|
|
IRepository<PatientRegister, Guid> repository, |
|
|
|
IRepository<Patient, Guid> patientRepository, |
|
|
|
IRepository<PatientRegister,Guid> patientRegisterRepository, |
|
|
|
IRepository<IdentityUser, Guid> userRepository, |
|
|
|
IRepository<Sex> sexRepository, |
|
|
|
IRepository<BirthPlace, Guid> birthPlaceRepository, |
|
|
|
@ -145,7 +149,8 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
SumSummaryHeaderManager sumSummaryHeaderManager, |
|
|
|
SumSummaryContentManager sumSummaryContentManager, |
|
|
|
SumSuggestionHeaderManager sumSuggestionHeaderManager, |
|
|
|
SumSuggestionContentManager sumSuggestionContentManager |
|
|
|
SumSuggestionContentManager sumSuggestionContentManager, |
|
|
|
SysParmValueManager sysParmValueManager |
|
|
|
) |
|
|
|
: base(repository) |
|
|
|
{ |
|
|
|
@ -191,6 +196,8 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
_sumSummaryContentManager = sumSummaryContentManager; |
|
|
|
_sumSuggestionHeaderManager = sumSuggestionHeaderManager; |
|
|
|
_sumSuggestionContentManager = sumSuggestionContentManager; |
|
|
|
_sysParmValueManager = sysParmValueManager; |
|
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 获取通过主键
|
|
|
|
@ -1444,23 +1451,38 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 更改总检检查医生信息(保存时,医生跟日期不传时取默认登录的用户跟当前时间;取消时,如果不传就不更新医生跟日期,只更新状态)
|
|
|
|
/// 取消总检
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("api/app/patientregister/updatepatientregistersummarydoctor")] |
|
|
|
public async Task<PatientRegisterDto> UpdatePatientRegisterSummaryDoctorAsync(UpdatePatientRegisterSummaryDoctorDto input) |
|
|
|
[HttpPost("api/app/patientregister/CancelSumCheck")] |
|
|
|
public async Task<PatientRegisterDto> CancelSumCheckAsync(PatientRegisterIdInputDto input) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("禁止使用"); |
|
|
|
|
|
|
|
if (input == null || input.PatientRegisterId == Guid.Empty) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("请求参数有误"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entity = await _repository.GetAsync(input.PatientRegisterId); |
|
|
|
var entitydto = ObjectMapper.Map<UpdatePatientRegisterSummaryDoctorDto, PatientRegister>(input); |
|
|
|
var newentity = await _manager.UpdatePatientRegisterSummaryDoctorAsync(entitydto, entity); |
|
|
|
|
|
|
|
if(entity.CompleteFlag != PatientRegisterCompleteFlag.SumCheck) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("没有总检,无需取消总检"); |
|
|
|
} |
|
|
|
if(entity.IsAudit == 'Y') |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("已审核,请先取消审核"); |
|
|
|
} |
|
|
|
var isSummaryCheckOnlySelfCanCancel = await _sysParmValueManager.GetSysParmValueInMedicalCenterId(entity.MedicalCenterId, "summary_check_only_self_can_cancel"); |
|
|
|
if(isSummaryCheckOnlySelfCanCancel == "Y") |
|
|
|
{ |
|
|
|
if(entity.SummaryDoctorId != CurrentUser.Id) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("只有本人才能取消总检"); |
|
|
|
} |
|
|
|
} |
|
|
|
var newentity = await _patientRegisterRepository.UpdateAsync(entity); |
|
|
|
return ObjectMapper.Map<PatientRegister, PatientRegisterDto>(newentity); |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
@ -2124,7 +2146,7 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("个人体检不支持调整"); |
|
|
|
} |
|
|
|
if (patientRegisterEnt.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) |
|
|
|
if (patientRegisterEnt.CompleteFlag == PatientRegisterCompleteFlag.SumCheck) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("当前体检人员已完成总检"); |
|
|
|
} |
|
|
|
@ -2270,7 +2292,7 @@ namespace Shentun.Peis.PatientRegisters |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("个人体检不支持调整"); |
|
|
|
} |
|
|
|
if (patientRegisterEnt.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) |
|
|
|
if (patientRegisterEnt.CompleteFlag == PatientRegisterCompleteFlag.SumCheck) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("当前体检人员已完成总检"); |
|
|
|
} |
|
|
|
|