受试者取消医生

Uat_Study
hang 2022-07-29 11:03:40 +08:00
parent 0b5cd87212
commit 283bbd29e5
8 changed files with 97 additions and 8 deletions

View File

@ -327,6 +327,13 @@
</summary> </summary>
<param name="origenalTask"></param> <param name="origenalTask"></param>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetReReadingOrBackInfluenceAnalysisAsync(System.Guid)">
<summary>
PM 申请重阅 被同意 或者 PM 直接退回的时候影响
</summary>
<param name="subjectId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.ConfirmReReading(IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand,IRaCIS.Core.Application.Service.IVisitTaskHelpeService)"> <member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.ConfirmReReading(IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand,IRaCIS.Core.Application.Service.IVisitTaskHelpeService)">
<summary> <summary>
确认重阅与否 1同意 2 拒绝 确认重阅与否 1同意 2 拒绝

View File

@ -141,6 +141,25 @@ namespace IRaCIS.Core.Application.ViewModel
public string Note { get; set; } = string.Empty; public string Note { get; set; } = string.Empty;
} }
public class CancelDoctorCommand
{
public Guid TrialId { get; set; }
public Guid SubjectId { get; set; }
public string Note { get; set; }
}
public class SubjectCancelDoctorView
{
public Guid SubjectId { get; set; }
public string Note { get; set; }
public DateTime CreateTime { get; set; }
}
public class TrialDoctorUserSelectView public class TrialDoctorUserSelectView
{ {
public Guid TrialId { get; set; } public Guid TrialId { get; set; }

View File

@ -25,13 +25,16 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository<Trial> _trialRepository; private readonly IRepository<Trial> _trialRepository;
private readonly IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository;
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository)
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository, IRepository<SubjectCanceDoctor> subjectCanceDoctorRepository)
{ {
_taskAllocationRuleRepository = taskAllocationRuleRepository; _taskAllocationRuleRepository = taskAllocationRuleRepository;
_userRepository = userRepository; _userRepository = userRepository;
_trialRepository = trialRepository; _trialRepository = trialRepository;
_subjectCanceDoctorRepository = subjectCanceDoctorRepository;
} }
@ -42,7 +45,7 @@ namespace IRaCIS.Core.Application.Service
/// </summary> /// </summary>
/// <param name="trialId"></param> /// <param name="trialId"></param>
/// <returns></returns> /// <returns></returns>
public async Task<(List<TaskAllocationRuleDTO>,object?)> GetDoctorPlanAllocationRuleList(Guid trialId) public async Task<(List<TaskAllocationRuleDTO>, object?)> GetDoctorPlanAllocationRuleList(Guid trialId)
{ {
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync(); var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync();
@ -58,7 +61,7 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule) public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
{ {
//冗余 存 //冗余 存
@ -87,7 +90,7 @@ namespace IRaCIS.Core.Application.Service
[HttpDelete("{taskAllocationRuleId:guid}")] [HttpDelete("{taskAllocationRuleId:guid}")]
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId) public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId)
{ {
if (await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId).AnyAsync(t => t.DoctorUser.VisitTaskList.Where(u=>u.TrialId==t.TrialId).Any())) if (await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId).AnyAsync(t => t.DoctorUser.VisitTaskList.Where(u => u.TrialId == t.TrialId).Any()))
{ {
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除"); return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
} }
@ -99,11 +102,29 @@ namespace IRaCIS.Core.Application.Service
} }
public async Task<IResponseOutput> AddSubjectCancelDoctorNote(CancelDoctorCommand command)
{
await _subjectCanceDoctorRepository.InsertOrUpdateAsync(command, true);
return ResponseOutput.Ok();
}
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId)
{
var list = await _subjectCanceDoctorRepository.Where(t => t.SubjectId == subjectId).ProjectTo<SubjectCancelDoctorView>(_mapper.ConfigurationProvider).ToListAsync();
return list;
}
/// <summary> /// <summary>
/// 获取访视任务 应用Subject后 医生比率情况 /// 获取访视任务 应用Subject后 医生比率情况
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Obsolete]
public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand) public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
{ {
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor) var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
@ -115,6 +136,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost] [HttpPost]
[Obsolete]
public async Task<(List<DoctorVisitTaskStatView>, object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) public async Task<(List<DoctorVisitTaskStatView>, object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
{ {
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/) var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/)
@ -147,7 +169,7 @@ namespace IRaCIS.Core.Application.Service
UserCode = user.UserCode, UserCode = user.UserCode,
UserName = user.UserName, UserName = user.UserName,
UserTypeEnum = user.UserTypeRole.UserTypeEnum, UserTypeEnum = user.UserTypeRole.UserTypeEnum,
ReadingCategoryList=enroll.EnrollReadingCategoryList.Select(t=>t.ReadingCategory).ToList() ReadingCategoryList = enroll.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList()
}; };
@ -159,7 +181,7 @@ namespace IRaCIS.Core.Application.Service
public async Task<List<TrialDoctorUserSelectView>> GetDoctorSelectList(DoctorSelectQuery selectQuery, [FromServices] IRepository<Enroll> _enrollRepository) public async Task<List<TrialDoctorUserSelectView>> GetDoctorSelectList(DoctorSelectQuery selectQuery, [FromServices] IRepository<Enroll> _enrollRepository)
{ {
var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable) var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable)
.WhereIf(selectQuery.ReadingCategory!=null,t=>t.Enroll.EnrollReadingCategoryList.Any(t=>t.ReadingCategory==selectQuery.ReadingCategory)) .WhereIf(selectQuery.ReadingCategory != null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.ReadingCategory == selectQuery.ReadingCategory))
join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id
select new TrialDoctorUserSelectView() select new TrialDoctorUserSelectView()
{ {

View File

@ -121,9 +121,14 @@ namespace IRaCIS.Core.Application.Service
CreateMap<VisitTask, AnalysisTaskView>().IncludeBase<VisitTask, VisitTaskView>() CreateMap<VisitTask, AnalysisTaskView>().IncludeBase<VisitTask, VisitTaskView>()
.ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis)); .ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis));
CreateMap<CancelDoctorCommand, SubjectCanceDoctor>();
CreateMap<SubjectCanceDoctor, SubjectCancelDoctorView>();
CreateMap<VisitTaskReReading, ReReadingTaskView>() CreateMap<VisitTaskReReading, ReReadingTaskView>()
.ForMember(o => o.ReReadingNewTaskCode, t => t.MapFrom(u => u.NewReReadingTask.TaskCode)) .ForMember(o => o.ReReadingNewTaskCode, t => t.MapFrom(u => u.NewReReadingTask.TaskCode))

View File

@ -93,6 +93,8 @@ namespace IRaCIS.Core.Domain.Models
public bool IsReReadingOrBackInfluenceAnalysis { get; set; } public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
public List<SubjectCanceDoctor> SubjectCanceDoctorList { get; set; }
//是否分配了读片医生 //是否分配了读片医生
//public bool IsAssignDoctorUser{get;set;} //public bool IsAssignDoctorUser{get;set;}
} }

View File

@ -0,0 +1,31 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-07-29 10:43:49
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
using System;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models
{
///<summary>
///SubjectCanceDoctor
///</summary>
[Table("SubjectCanceDoctor")]
public class SubjectCanceDoctor : Entity, IAuditAdd
{
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
public Guid SubjectId { get; set; }
public string Note { get; set; }
}
}

View File

@ -619,6 +619,9 @@ namespace IRaCIS.Core.Infra.EFCore
public virtual DbSet<TaskInfluence> TaskInfluence { get; set; } public virtual DbSet<TaskInfluence> TaskInfluence { get; set; }
public virtual DbSet<SubjectCanceDoctor> SubjectCanceDoctor { get; set; }
} }

View File

@ -4,7 +4,7 @@
public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
public static readonly string DbDatabase = "IRaCIS_New_Tet"; public static readonly string DbDatabase = "IRaCIS_New_Tet";
//表名称用字符串,拼接 //表名称用字符串,拼接
public static readonly string TableName = "TaskInfluence"; public static readonly string TableName = "SubjectCanceDoctor";
//具体文件里面 例如service 可以配置是否分页 //具体文件里面 例如service 可以配置是否分页
} }
#> #>