修改医生既往阅片情况声明

Test.EIImageViewer
{872297557@qq.com} 2023-01-31 09:35:52 +08:00
parent e18b890f96
commit 79d4c6a116
21 changed files with 242 additions and 117 deletions

View File

@ -913,6 +913,9 @@ namespace IRaCIS.Core.API.Controllers
} }
/// <summary> /// <summary>
/// 上传文件( 不是医生个人的文件)[FileUpload] /// 上传文件( 不是医生个人的文件)[FileUpload]
/// 例如:阅片章程等 /// 例如:阅片章程等

View File

@ -0,0 +1,46 @@
using IRaCIS.Core.Domain.Share;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
namespace IRaCIS.Core.API
{
public class JSONCustomDateConverter : DateTimeConverterBase
{
private TimeZoneInfo _timeZoneInfo;
private string _dateFormat;
private IUserInfo _userInfo;
public JSONCustomDateConverter(string dateFormat, TimeZoneInfo timeZoneInfo, IUserInfo userInfo)
{
_dateFormat = dateFormat;
_timeZoneInfo = timeZoneInfo;
_userInfo = userInfo;
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var timeZoneId = _userInfo.TimeZoneId;
var needConvertUtcDateTime = Convert.ToDateTime(value);
var tz = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
var dateTimeOffset = new DateTimeOffset(needConvertUtcDateTime);
var time = TimeZoneInfo.ConvertTimeFromUtc(needConvertUtcDateTime, tz).ToString(_dateFormat);
writer.WriteValue(time);
writer.Flush();
}
}
}

View File

@ -1,6 +1,7 @@
 
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System; using System;
namespace IRaCIS.Core.API namespace IRaCIS.Core.API
@ -22,6 +23,9 @@ namespace IRaCIS.Core.API
// 设置时间格式 // 设置时间格式
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
//options.SerializerSettings.Converters.Add(new JSONCustomDateConverter()) ;
//IsoDateTimeConverter
//options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; //options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
}) })

View File

@ -9942,16 +9942,6 @@
<member name="M:IRaCIS.Application.Services.VisitPlanService.DeleteVisitStage(System.Guid)"> <member name="M:IRaCIS.Application.Services.VisitPlanService.DeleteVisitStage(System.Guid)">
<summary> 删除项目计划某一项 废弃 </summary> <summary> 删除项目计划某一项 废弃 </summary>
</member> </member>
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.UploadReviewerAckSOW(System.Guid,IRaCIS.Application.Contracts.ReviewerAckDTO)">
<summary>
保存协议- ack Sow [AUTH]
</summary>
</member>
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.DeleteReviewerAckSOW(System.Guid,System.Guid,System.Guid)">
<summary>
删除协议
</summary>
</member>
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.SetEnrollReadingCategory(IRaCIS.Application.Contracts.SetEnrollReadingCategoryInDto)"> <member name="M:IRaCIS.Application.Services.DoctorWorkloadService.SetEnrollReadingCategory(IRaCIS.Application.Contracts.SetEnrollReadingCategoryInDto)">
<summary> <summary>
修改项目医生的阅片类型 修改项目医生的阅片类型

View File

@ -98,7 +98,7 @@ namespace IRaCIS.Core.Application.Service
var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstOrDefaultAsync(); var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstOrDefaultAsync();
//获取确认的临床数据配置 //获取确认的临床数据配置
var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t=>t.TrialClinicalDataSetCriteriaList).ToList(); var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault(); var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault();
@ -207,7 +207,7 @@ namespace IRaCIS.Core.Application.Service
} }
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); _provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
@ -215,7 +215,7 @@ namespace IRaCIS.Core.Application.Service
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated; var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1!=null) if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
{ {
task1.TaskAllocationState = defaultState; task1.TaskAllocationState = defaultState;
//分配给对应Arm的人 //分配给对应Arm的人
@ -225,7 +225,7 @@ namespace IRaCIS.Core.Application.Service
task1.SuggesteFinishedTime = DateTime.Now.AddDays(7); task1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
} }
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2!=null) if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
{ {
task2.TaskAllocationState = defaultState; task2.TaskAllocationState = defaultState;
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId; task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
@ -339,7 +339,7 @@ namespace IRaCIS.Core.Application.Service
{ {
return false; return false;
} }
var isClinicalDataSign = false; var isClinicalDataSign = false;
@ -391,7 +391,7 @@ namespace IRaCIS.Core.Application.Service
} }
return isClinicalDataSign; return isClinicalDataSign;
} }
@ -621,12 +621,19 @@ namespace IRaCIS.Core.Application.Service
else else
{ {
var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1); var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
if (arm1 != null) if (arm1 != null)
{ {
arm1.TaskAllocationState = TaskAllocationState.Allocated;
arm1.AllocateTime = DateTime.Now; //有可能仅仅只分配了一个Subject 未分配 那么
arm1.DoctorUserId = task1.DoctorUserId; if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
arm1.SuggesteFinishedTime = DateTime.Now.AddDays(7); {
arm1.TaskAllocationState = TaskAllocationState.Allocated;
arm1.AllocateTime = DateTime.Now;
arm1.DoctorUserId = task1.DoctorUserId;
arm1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
}
} }
else else
{ {
@ -677,10 +684,15 @@ namespace IRaCIS.Core.Application.Service
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2); var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
if (arm2 != null) if (arm2 != null)
{ {
arm2.TaskAllocationState = TaskAllocationState.Allocated; //有可能仅仅只分配了一个Subject
arm2.AllocateTime = DateTime.Now; if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
arm2.DoctorUserId = task2.DoctorUserId; {
arm2.SuggesteFinishedTime = DateTime.Now.AddDays(7); arm2.TaskAllocationState = TaskAllocationState.Allocated;
arm2.AllocateTime = DateTime.Now;
arm2.DoctorUserId = task2.DoctorUserId;
arm2.SuggesteFinishedTime = DateTime.Now.AddDays(7);
}
} }
else else
{ {

View File

@ -26,6 +26,9 @@
} }
public class TrialSOWPathDTO public class TrialSOWPathDTO
{ {
public Guid TrialId { get; set; } public Guid TrialId { get; set; }

View File

@ -691,6 +691,12 @@ namespace IRaCIS.Application.Contracts
{ {
public Guid? Id { get; set; } public Guid? Id { get; set; }
public Guid? TrialId { get; set; }
public Guid? TrialReadingCriterionId { get; set; }
public string CriterionName { get; set; }
public bool IsEnable { get; set; } = true; public bool IsEnable { get; set; } = true;
/// <summary> /// <summary>
@ -772,6 +778,9 @@ namespace IRaCIS.Application.Contracts
/// CreateTime /// CreateTime
/// </summary> /// </summary>
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
} }
public class GetDoctorCriterionFileInDto public class GetDoctorCriterionFileInDto

View File

@ -72,7 +72,7 @@ namespace IRaCIS.Application.Services
{ {
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand()); return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
} }
if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail)) if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail))
{ {
return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand()); return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand());
@ -80,7 +80,7 @@ namespace IRaCIS.Application.Services
doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1; doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1;
doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code,nameof(Doctor)) ; doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code, nameof(Doctor));
doctor.Password = MD5Helper.Md5(doctor.Phone); doctor.Password = MD5Helper.Md5(doctor.Phone);
@ -103,7 +103,7 @@ namespace IRaCIS.Application.Services
var updateModel = basicInfoModel; var updateModel = basicInfoModel;
var phone = updateModel.Phone.Trim(); var phone = updateModel.Phone.Trim();
if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id) )!= null) if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id)) != null)
{ {
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand()); return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
} }
@ -116,10 +116,10 @@ namespace IRaCIS.Application.Services
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException(); var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();
//删除中间表 Title对应的记录 //删除中间表 Title对应的记录
await _repository.BatchDeleteAsync<DoctorDictionary>(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title); await _repository.BatchDeleteAsync<DoctorDictionary>(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
var adddata=new List<DoctorDictionary>();
var adddata = new List<DoctorDictionary>();
//重新插入新的 Title记录 //重新插入新的 Title记录
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId })); updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
@ -284,7 +284,7 @@ namespace IRaCIS.Application.Services
} }
[HttpPost] [HttpPost]
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel) public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
{ {
#region 废弃 #region 废弃
@ -314,7 +314,7 @@ namespace IRaCIS.Application.Services
//_mapper.Map(doctorWorkInfoModel, doctor); //_mapper.Map(doctorWorkInfoModel, doctor);
//var success = _doctorRepository.SaveChanges(); //var success = _doctorRepository.SaveChanges();
#endregion #endregion
var entity = await _repository.InsertOrUpdateAsync<Doctor, EmploymentCommand>(doctorWorkInfoModel, true); var entity = await _repository.InsertOrUpdateAsync<Doctor, EmploymentCommand>(doctorWorkInfoModel, true);
@ -369,7 +369,7 @@ namespace IRaCIS.Application.Services
return test; return test;
} }
[HttpPost] [HttpPost]
public async Task<IResponseOutput> UpdateSpecialtyInfo(SpecialtyCommand specialtyUpdateModel) public async Task<IResponseOutput> UpdateSpecialtyInfo(SpecialtyCommand specialtyUpdateModel)
{ {
@ -421,7 +421,7 @@ namespace IRaCIS.Application.Services
#endregion #endregion
#region 简历审核 #region 简历审核
[HttpPost] [HttpPost]
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam) public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
{ {
@ -441,8 +441,8 @@ namespace IRaCIS.Application.Services
ReviewStatus = auditResumeParam.ReviewStatus, ReviewStatus = auditResumeParam.ReviewStatus,
AcceptingNewTrial = auditResumeParam.AcceptingNewTrial, AcceptingNewTrial = auditResumeParam.AcceptingNewTrial,
ActivelyReading = auditResumeParam.ActivelyReading, ActivelyReading = auditResumeParam.ActivelyReading,
IsVirtual=auditResumeParam.IsVirtual, IsVirtual = auditResumeParam.IsVirtual,
BlindName=auditResumeParam.BlindName, BlindName = auditResumeParam.BlindName,
BlindNameCN = auditResumeParam.BlindNameCN, BlindNameCN = auditResumeParam.BlindNameCN,
BlindPublications = auditResumeParam.BlindPublications, BlindPublications = auditResumeParam.BlindPublications,
AuditTime = DateTime.Now, AuditTime = DateTime.Now,
@ -479,11 +479,22 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto) public async Task<IResponseOutput> AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto)
{ {
if (await _doctorCriterionFileRepository.AnyAsync(x =>inDto.IsEnable&& x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id)) if (await _doctorCriterionFileRepository.AnyAsync(x => inDto.IsEnable && x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.TrialId==inDto.TrialId &&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id))
{ {
throw new BusinessValidationFailedException("当前标准已添加过此类型文件"); throw new BusinessValidationFailedException("当前标准已添加过此类型文件");
} }
var entity = await _doctorCriterionFileRepository.InsertOrUpdateAsync(inDto, true);
var entity = await _doctorCriterionFileRepository.InsertOrUpdateAsync(inDto);
if (inDto.TrialId != null)
{
entity.Remark = await _trialRepository.Where(t => t.Id == inDto.TrialId).Select(t => t.TrialCode).FirstOrDefaultAsync();
}
await _doctorCriterionFileRepository.SaveChangesAsync();
return ResponseOutput.Ok(entity.Id.ToString()); return ResponseOutput.Ok(entity.Id.ToString());
} }
@ -523,7 +534,7 @@ namespace IRaCIS.Application.Services
var doctor = (await _doctorRepository var doctor = (await _doctorRepository
.ProjectTo<ResumeConfirmDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync(t => t.Id == doctorId)).IfNullThrowException(); .ProjectTo<ResumeConfirmDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync(t => t.Id == doctorId)).IfNullThrowException();
doctor.InHoliday = (await _repository.CountAsync<Vacation>(x=>x.DoctorId==doctorId&&x.EndDate<=DateTime.Now&&x.StartDate<=DateTime.Now)) > 0; doctor.InHoliday = (await _repository.CountAsync<Vacation>(x => x.DoctorId == doctorId && x.EndDate <= DateTime.Now && x.StartDate <= DateTime.Now)) > 0;
return doctor; return doctor;
} }

View File

@ -1,5 +1,6 @@
using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Application.Services namespace IRaCIS.Application.Services
@ -164,6 +165,7 @@ namespace IRaCIS.Application.Services
} }
[AllowAnonymous]
public async Task<List<MenuTreeNode>> GetUserMenuTree() public async Task<List<MenuTreeNode>> GetUserMenuTree()
{ {
@ -182,7 +184,7 @@ namespace IRaCIS.Application.Services
return list; return list;
} }
[AllowAnonymous]
public async Task<List<string>> GetUserPermissions() public async Task<List<string>> GetUserPermissions()
{ {

View File

@ -874,7 +874,7 @@ namespace IRaCIS.Core.Application
EnrollStatus = EnrollStatus.Finished EnrollStatus = EnrollStatus.Finished
}); });
await _trialRepository.BatchUpdateNoTrackingAsync(u => u.Id == trialId, s => new Trial { TrialFinishedTime = DateTime.UtcNow.AddHours(8) }); await _trialRepository.BatchUpdateNoTrackingAsync(u => u.Id == trialId, s => new Trial { TrialFinishedTime = DateTime.Now });
} }

View File

@ -340,11 +340,11 @@ namespace IRaCIS.Application.Contracts
public Guid Id { get; set; } public Guid Id { get; set; }
public Guid? TrialReadingCriterionId { get; set; }
/// <summary> /// <summary>
/// 文件名称 /// 文件名称
/// </summary> /// </summary>
public string FileName { get; set; } public string FileName { get; set; }
/// <summary> /// <summary>
/// 文件路径 /// 文件路径

View File

@ -50,53 +50,63 @@ namespace IRaCIS.Application.Services
} }
#region 入组工作量统计列表 具体详情 增删改查相关 上传\删除协议 #region 入组工作量统计列表 具体详情 增删改查相关 上传\删除协议
/// <summary>
/// 保存协议- ack Sow [AUTH]
/// </summary>
[HttpPost("{trialId}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId,
ReviewerAckDTO attachmentViewModel)
{
var intoGroupItem = (await _enrollRepository.Where(t => t.TrialId == trialId && t.DoctorId == attachmentViewModel.DoctorId).FirstOrDefaultAsync()).IfNullThrowException();
if (attachmentViewModel.Id != Guid.Empty) #region 协议废弃
{ ///// <summary>
await _attachmentRepository.BatchDeleteNoTrackingAsync(t => t.Id == attachmentViewModel.Id); ///// 保存协议- ack Sow [AUTH]
} ///// </summary>
//[HttpPost("{trialId}")]
var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel); //[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
//public async Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId,
// ReviewerAckDTO attachmentViewModel)
//{
//intoGroupItem.AttachmentId = attachment.Id; // var intoGroupItem = (await _enrollRepository.Where(t => t.TrialId == trialId && t.DoctorId == attachmentViewModel.DoctorId).FirstOrDefaultAsync()).IfNullThrowException();
await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
var success = await _enrollRepository.SaveChangesAsync(); // if (attachmentViewModel.Id != Guid.Empty)
// {
// await _attachmentRepository.BatchDeleteNoTrackingAsync(t => t.Id == attachmentViewModel.Id);
// }
// var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel);
// //intoGroupItem.AttachmentId = attachment.Id;
// await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
// var success = await _enrollRepository.SaveChangesAsync();
// return ResponseOutput.Result(success, attachment.Id.ToString());
//}
///// <summary>
///// 删除协议
///// </summary>
//[HttpDelete, Route("{trialId}/{doctorId}/{attachmentId}")]
//[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
//public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
//{
// var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
// await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
// new Enroll()
// {
// AttachmentId = Guid.Empty
// }, true);
// return ResponseOutput.Ok(success1);
//}
#endregion
return ResponseOutput.Result(success, attachment.Id.ToString());
}
/// <summary>
/// 删除协议
/// </summary>
[HttpDelete, Route("{trialId}/{doctorId}/{attachmentId}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
{
var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
new Enroll()
{
AttachmentId = Guid.Empty
}, true);
return ResponseOutput.Ok(success1);
}
/// <summary> /// <summary>
/// 修改项目医生的阅片类型 /// 修改项目医生的阅片类型
@ -207,22 +217,30 @@ namespace IRaCIS.Application.Services
IsEnable = allocateRule.IsEnable, IsEnable = allocateRule.IsEnable,
TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>new TrialReadingCriterionDto() { TrialReadingCriterionId=t.Id,TrialReadingCriterionName=t.CriterionName,CriterionType=t.CriterionType,IsOncologyReading=t.IsOncologyReading,IsArbitrationReading=t.IsArbitrationReading,IsGlobalReading=t.IsGlobalReading,ReadingInfoSignTime=t.ReadingInfoSignTime,ReadingType=t.ReadingType}).ToList(), TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>new TrialReadingCriterionDto() { TrialReadingCriterionId=t.Id,TrialReadingCriterionName=t.CriterionName,CriterionType=t.CriterionType,IsOncologyReading=t.IsOncologyReading,IsArbitrationReading=t.IsArbitrationReading,IsGlobalReading=t.IsGlobalReading,ReadingInfoSignTime=t.ReadingInfoSignTime,ReadingType=t.ReadingType}).ToList(),
CriterionFileList= doctor.CriterionFileList.Where(x=>x.IsEnable).Select(x=> new CriterionFile() {
CriterionType=x.CriterionType,
DoctorId=x.DoctorId,
FileName=x.FileName,
FilePath=x.FilePath,
FileType=x.FileType,
Remark=x.Remark,
Id=x.Id
}).ToList(),
CriterionReadingCategoryList =intoGroup.EnrollReadingCategoryList.Select(t=>new TrialCriterionReadingCategory() { EnrollId=t.EnrollId,ReadingCategory=t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(), CriterionReadingCategoryList =intoGroup.EnrollReadingCategoryList.Select(t=>new TrialCriterionReadingCategory() { EnrollId=t.EnrollId,ReadingCategory=t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
ReadingTaskStateList=doctor.User.VisitTaskList.Where(x=>x.TaskState==TaskState.Effect&&x.TrialId== trialId).Select(x=> new DoctorUserTask() { CriterionFileList = doctor.CriterionFileList.Where(x => x.IsEnable && (x.TrialId==null ||x.TrialId==trialId)).Select(x => new CriterionFile()
ReadingTaskState= x.ReadingTaskState, {
CriterionType=x.TrialReadingCriterion.CriterionType, CriterionType = x.CriterionType,
DoctorId = x.DoctorId,
FileName = x.FileName,
FilePath = x.FilePath,
FileType = x.FileType,
Remark = x.Remark,
TrialReadingCriterionId=x.TrialReadingCriterionId,
Id = x.Id
}).ToList(),
ReadingTaskStateList = doctor.User.VisitTaskList.Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
{
ReadingTaskState = x.ReadingTaskState,
CriterionType = x.TrialReadingCriterion.CriterionType,
}).ToList(), }).ToList(),
DoctorId = doctor.Id, DoctorId = doctor.Id,
Code = doctor.ReviewerCode, Code = doctor.ReviewerCode,
FirstName = doctor.FirstName, FirstName = doctor.FirstName,

View File

@ -5,14 +5,14 @@ namespace IRaCIS.Application.Services
public interface IDoctorWorkloadService public interface IDoctorWorkloadService
{ {
Task<IResponseOutput> AddOrUpdateWorkload(WorkloadCommand workLoadAddOrUpdateModel, Guid userId); Task<IResponseOutput> AddOrUpdateWorkload(WorkloadCommand workLoadAddOrUpdateModel, Guid userId);
Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId); //Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId);
Task<IResponseOutput> DeleteWorkload(Guid workloadId); Task<IResponseOutput> DeleteWorkload(Guid workloadId);
PageOutput<WorkLoadDetailDTO> GetEnrollmentWorkloadStatsDetail(WorkLoadStatsQueryDTO workLoadSearch); PageOutput<WorkLoadDetailDTO> GetEnrollmentWorkloadStatsDetail(WorkLoadStatsQueryDTO workLoadSearch);
Task<List<WorkLoadDetailViewModel>> GetReviewerWorkLoadListDetail(WorkLoadDetailQueryDTO workLoadSearch); Task<List<WorkLoadDetailViewModel>> GetReviewerWorkLoadListDetail(WorkLoadDetailQueryDTO workLoadSearch);
Task<PageOutput<WorkLoadAndAgreementDTO>> GetTrialEnrollmentWorkloadStats(WorkLoadDoctorQueryDTO doctorSearchModel); Task<PageOutput<WorkLoadAndAgreementDTO>> GetTrialEnrollmentWorkloadStats(WorkLoadDoctorQueryDTO doctorSearchModel);
Task<WorkloadDTO> GetWorkloadDetailById(Guid id); Task<WorkloadDTO> GetWorkloadDetailById(Guid id);
Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type); Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type);
Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId, ReviewerAckDTO attachmentViewModel); //Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId, ReviewerAckDTO attachmentViewModel);
Task<IResponseOutput<ExistWorkloadViewModel>> WorkloadExist(WorkloadExistQueryDTO param); Task<IResponseOutput<ExistWorkloadViewModel>> WorkloadExist(WorkloadExistQueryDTO param);
} }
} }

View File

@ -23,7 +23,7 @@ namespace IRaCIS.Core.Domain.Share
string RealName { get; } string RealName { get; }
string ReviewerCode { get; } string ReviewerCode { get; }
bool IsAdmin { get; } bool IsAdmin { get; }
bool IsTestUser { get; } bool IsTestUser { get; }
@ -31,9 +31,9 @@ namespace IRaCIS.Core.Domain.Share
string UserTypeEnumStr { get; } string UserTypeEnumStr { get; }
int UserTypeEnumInt { get; } int UserTypeEnumInt { get; }
Guid UserTypeId { get; } Guid UserTypeId { get; }
string UserToken { get; } string UserToken { get; }
@ -43,13 +43,18 @@ namespace IRaCIS.Core.Domain.Share
string LocalIp { get; } string LocalIp { get; }
bool IsEn_Us { get; } bool IsEn_Us { get; }
string RequestUrl { get; } string RequestUrl { get; }
Guid? SignId { get; set; } Guid? SignId { get; set; }
Guid? BatchId { get; set; } Guid? BatchId { get; set; }
/// <summary>
/// 字符串形式 标识时区
/// </summary>
string TimeZoneId { get; }
} }
} }

View File

@ -266,6 +266,23 @@ namespace IRaCIS.Core.Domain.Share
} }
} }
public string TimeZoneId
{
get
{
var timeZoneId = _accessor?.HttpContext?.Request?.Headers["TimeZoneId"];
if (timeZoneId is not null && !string.IsNullOrEmpty(timeZoneId.Value))
{
return timeZoneId.Value;
}
return "Asia/Shanghai";
}
}
public Guid? SignId public Guid? SignId
{ {

View File

@ -65,6 +65,11 @@ namespace IRaCIS.Core.Domain.Models
[ForeignKey("DoctorId")] [ForeignKey("DoctorId")]
public Doctor Doctor { get; set; } public Doctor Doctor { get; set; }
public string CriterionName { get; set; }
public Guid? TrialReadingCriterionId { get; set; }
public Guid? TrialId { get; set; }
} }

View File

@ -501,7 +501,7 @@ namespace IRaCIS.Core.Infra.EFCore
await auditingData.InsertAddEntitys(entities); await auditingData.InsertAddEntitys(entities);
} }
} }
@ -529,7 +529,7 @@ namespace IRaCIS.Core.Infra.EFCore
if (t.Entity is IAuditUpdate updateEntity1) if (t.Entity is IAuditUpdate updateEntity1)
{ {
updateEntity1.UpdateTime = DateTime.UtcNow.AddHours(8); updateEntity1.UpdateTime = DateTime.Now;
updateEntity1.UpdateUserId = _userInfo.Id; updateEntity1.UpdateUserId = _userInfo.Id;
} }
@ -538,7 +538,7 @@ namespace IRaCIS.Core.Infra.EFCore
if (softDelete.IsDeleted) if (softDelete.IsDeleted)
{ {
softDelete.DeleteUserId = _userInfo.Id; softDelete.DeleteUserId = _userInfo.Id;
softDelete.DeletedTime = DateTime.UtcNow.AddHours(8); softDelete.DeletedTime = DateTime.Now;
} }
else else
{ {
@ -555,7 +555,7 @@ namespace IRaCIS.Core.Infra.EFCore
{ {
if (addEntity.CreateTime == default(DateTime)) if (addEntity.CreateTime == default(DateTime))
{ {
addEntity.CreateTime = DateTime.UtcNow.AddHours(8); addEntity.CreateTime = DateTime.Now;
} }
addEntity.CreateUserId = _userInfo.Id; addEntity.CreateUserId = _userInfo.Id;
@ -563,7 +563,7 @@ namespace IRaCIS.Core.Infra.EFCore
if (t.Entity is IAuditUpdate updateEntity) if (t.Entity is IAuditUpdate updateEntity)
{ {
updateEntity.UpdateTime = DateTime.UtcNow.AddHours(8); updateEntity.UpdateTime = DateTime.Now;
updateEntity.UpdateUserId = _userInfo.Id; updateEntity.UpdateUserId = _userInfo.Id;
} }
@ -571,7 +571,7 @@ namespace IRaCIS.Core.Infra.EFCore
{ {
if (addEntity3.CreateTime == default(DateTime)) if (addEntity3.CreateTime == default(DateTime))
{ {
addEntity3.CreateTime = DateTime.UtcNow.AddHours(8); addEntity3.CreateTime = DateTime.Now;
} }

View File

@ -24,7 +24,7 @@
// if (context.Entity.CreateTime == default(DateTime)) // if (context.Entity.CreateTime == default(DateTime))
// { // {
// context.Entity.CreateTime = DateTime.UtcNow.AddHours(8); // context.Entity.CreateTime = DateTime.Now;
// } // }
@ -53,7 +53,7 @@
// if (context.Entity.CreateTime == default(DateTime)) // if (context.Entity.CreateTime == default(DateTime))
// { // {
// context.Entity.CreateTime = DateTime.UtcNow.AddHours(8); // context.Entity.CreateTime = DateTime.Now;
// } // }
// } // }

View File

@ -20,7 +20,7 @@
// { // {
// if (context.ChangeType == ChangeType.Modified || context.ChangeType == ChangeType.Added) // if (context.ChangeType == ChangeType.Modified || context.ChangeType == ChangeType.Added)
// { // {
// context.Entity.UpdateTime = DateTime.UtcNow.AddHours(8); // context.Entity.UpdateTime = DateTime.Now;
// context.Entity.UpdateUserId = _userInfo.Id; // context.Entity.UpdateUserId = _userInfo.Id;

View File

@ -26,7 +26,7 @@
// if (context.Entity.IsDeleted) // if (context.Entity.IsDeleted)
// { // {
// context.Entity.DeleteUserId = _userInfo.Id; // context.Entity.DeleteUserId = _userInfo.Id;
// context.Entity.DeletedTime = DateTime.UtcNow.AddHours(8); // context.Entity.DeletedTime = DateTime.Now;
// } // }
// else // else
// { // {

View File

@ -49,7 +49,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
{ {
var auditContext = eventData.Context as IRaCISDBContext; var auditContext = eventData.Context as IRaCISDBContext;
_audit.Succeeded = true; _audit.Succeeded = true;
_audit.EndTime = DateTime.UtcNow.AddHours(8); _audit.EndTime = DateTime.Now;
auditContext.SaveChangesAudits.Add(_audit); auditContext.SaveChangesAudits.Add(_audit);
auditContext.SaveChanges(); auditContext.SaveChanges();
} }
@ -67,7 +67,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
var auditContext = eventData.Context as IRaCISDBContext; var auditContext = eventData.Context as IRaCISDBContext;
_audit.Succeeded = true; _audit.Succeeded = true;
auditContext.SaveChangesAudits.Add(_audit); auditContext.SaveChangesAudits.Add(_audit);
_audit.EndTime = DateTime.UtcNow.AddHours(8); _audit.EndTime = DateTime.Now;
await auditContext.SaveChangesAsync(); await auditContext.SaveChangesAsync();
} }
@ -83,7 +83,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
{ {
auditContext.Attach(_audit); auditContext.Attach(_audit);
_audit.Succeeded = false; _audit.Succeeded = false;
_audit.EndTime = DateTime.UtcNow.AddHours(8); _audit.EndTime = DateTime.Now;
_audit.ErrorMessage = eventData.Exception.Message; _audit.ErrorMessage = eventData.Exception.Message;
auditContext.SaveChanges(); auditContext.SaveChanges();
@ -98,7 +98,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
{ {
auditContext.Attach(_audit); auditContext.Attach(_audit);
_audit.Succeeded = false; _audit.Succeeded = false;
_audit.EndTime = DateTime.UtcNow.AddHours(8); _audit.EndTime = DateTime.Now;
_audit.ErrorMessage = eventData.Exception.InnerException?.Message; _audit.ErrorMessage = eventData.Exception.InnerException?.Message;
await auditContext.SaveChangesAsync(cancellationToken); await auditContext.SaveChangesAsync(cancellationToken);
@ -119,7 +119,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
{ {
context.ChangeTracker.DetectChanges(); context.ChangeTracker.DetectChanges();
var audit = new SaveChangesAudit { StartTime = DateTime.UtcNow.AddHours(8) }; var audit = new SaveChangesAudit { StartTime = DateTime.Now };
foreach (var entry in context.ChangeTracker.Entries().Where(t => NeedAudit(t))) foreach (var entry in context.ChangeTracker.Entries().Where(t => NeedAudit(t)))
{ {