|
|
@ -27,6 +27,8 @@ namespace Shentun.Peis.FollowUps |
|
|
private readonly IRepository<SmsSend, Guid> _smsSendRepository; |
|
|
private readonly IRepository<SmsSend, Guid> _smsSendRepository; |
|
|
private readonly SmsSendAppService _smsSendAppService; |
|
|
private readonly SmsSendAppService _smsSendAppService; |
|
|
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|
|
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|
|
|
|
|
private readonly IRepository<RegisterCheck, Guid> _registerCheckRepository; |
|
|
|
|
|
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository; |
|
|
public FollowUpAppService( |
|
|
public FollowUpAppService( |
|
|
IRepository<FollowUp, Guid> followUpRepository, |
|
|
IRepository<FollowUp, Guid> followUpRepository, |
|
|
CacheService cacheService, |
|
|
CacheService cacheService, |
|
|
@ -34,7 +36,9 @@ namespace Shentun.Peis.FollowUps |
|
|
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository, |
|
|
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository, |
|
|
IRepository<SmsSend, Guid> smsSendRepository, |
|
|
IRepository<SmsSend, Guid> smsSendRepository, |
|
|
SmsSendAppService smsSendAppService, |
|
|
SmsSendAppService smsSendAppService, |
|
|
IRepository<PatientRegister, Guid> patientRegisterRepository) |
|
|
|
|
|
|
|
|
IRepository<PatientRegister, Guid> patientRegisterRepository, |
|
|
|
|
|
IRepository<RegisterCheck, Guid> registerCheckRepository, |
|
|
|
|
|
IRepository<RegisterCheckItem> registerCheckItemRepository) |
|
|
{ |
|
|
{ |
|
|
_followUpRepository = followUpRepository; |
|
|
_followUpRepository = followUpRepository; |
|
|
_cacheService = cacheService; |
|
|
_cacheService = cacheService; |
|
|
@ -43,6 +47,8 @@ namespace Shentun.Peis.FollowUps |
|
|
_smsSendRepository = smsSendRepository; |
|
|
_smsSendRepository = smsSendRepository; |
|
|
_smsSendAppService = smsSendAppService; |
|
|
_smsSendAppService = smsSendAppService; |
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
|
|
|
_registerCheckRepository = registerCheckRepository; |
|
|
|
|
|
_registerCheckItemRepository = registerCheckItemRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -76,6 +82,21 @@ namespace Shentun.Peis.FollowUps |
|
|
/// <param name="input"></param>
|
|
|
/// <param name="input"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
public async Task DeleteByPatientRegisterId(PatientRegisterIdInputDto input) |
|
|
public async Task DeleteByPatientRegisterId(PatientRegisterIdInputDto input) |
|
|
|
|
|
{ |
|
|
|
|
|
//检查是否所有项目都没有
|
|
|
|
|
|
|
|
|
|
|
|
var isFollowUpDelete = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() |
|
|
|
|
|
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId |
|
|
|
|
|
join registerCheckItem in await _registerCheckItemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckItem.RegisterCheckId |
|
|
|
|
|
where patientRegister.Id == input.PatientRegisterId |
|
|
|
|
|
&& (registerCheck.IsFollowUp == 'Y' |
|
|
|
|
|
|| registerCheck.IsCriticalValue == 'Y' |
|
|
|
|
|
|| registerCheckItem.IsCriticalValue == 'Y' |
|
|
|
|
|
|| registerCheckItem.IsFollowUp == 'Y') |
|
|
|
|
|
select patientRegister.Id |
|
|
|
|
|
).Count(); |
|
|
|
|
|
|
|
|
|
|
|
if (isFollowUpDelete == 0) |
|
|
{ |
|
|
{ |
|
|
var isFollowUp = await _followUpRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId); |
|
|
var isFollowUp = await _followUpRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId); |
|
|
if (isFollowUp != null) |
|
|
if (isFollowUp != null) |
|
|
@ -116,6 +137,7 @@ namespace Shentun.Peis.FollowUps |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 获取随访主表记录 可根据人员跟状态筛选
|
|
|
/// 获取随访主表记录 可根据人员跟状态筛选
|
|
|
|