更新读片状态

Uat_Study
hang 2022-06-17 13:54:54 +08:00
parent 77f478c293
commit 3f573d6c11
6 changed files with 35 additions and 24 deletions

View File

@ -395,7 +395,7 @@ namespace IRaCIS.Core.API.Controllers
/// <summary> /// <summary>
/// 上传阅片临床数据 /// 上传阅片临床数据
/// </summary> /// </summary>
/// <param name="trialId"></param /// <param name="trialId"></param>
/// <param name="subjectId"></param> /// <param name="subjectId"></param>
/// <param name="readingId"></param> /// <param name="readingId"></param>
/// <returns></returns> /// <returns></returns>

View File

@ -178,7 +178,15 @@
<param name="subjectVisitId"></param> <param name="subjectVisitId"></param>
<returns></returns> <returns></returns>
</member> </member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.API.Controllers.StudyController.UploadReadClinicalData(System.Guid,System.Guid,System.Guid)" --> <member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadReadClinicalData(System.Guid,System.Guid,System.Guid)">
<summary>
上传阅片临床数据
</summary>
<param name="trialId"></param>
<param name="subjectId"></param>
<param name="readingId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(Microsoft.AspNetCore.Http.IFormCollection,System.Guid,System.Guid)"> <member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(Microsoft.AspNetCore.Http.IFormCollection,System.Guid,System.Guid)">
<summary> <summary>
上传非Dicom 文件 支持压缩包 多文件上传 上传非Dicom 文件 支持压缩包 多文件上传

View File

@ -25,13 +25,14 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository<Trial> _trialRepository; private readonly IRepository<Trial> _trialRepository;
private readonly IRepository<SubjectVisit> _subjectVisitRepository; private readonly IRepository<SubjectVisit> _subjectVisitRepository;
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository; private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
private readonly IRepository<Subject> _subjectRepository; private readonly IRepository<Subject> _subjectRepository;
private readonly IRepository<SubjectUser> _subjectUserRepository; private readonly IRepository<SubjectUser> _subjectUserRepository;
private readonly IRepository<ReadModule> _readModuleRepository;
public VisitTaskService(IRepository<VisitTask> visitTaskRepository, IRepository<Trial> trialRepository, IRepository<SubjectVisit> subjectVisitRepository, public VisitTaskService(IRepository<VisitTask> visitTaskRepository, IRepository<Trial> trialRepository, IRepository<SubjectVisit> subjectVisitRepository,
IRepository<Subject> subjectRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository IRepository<Subject> subjectRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<ReadModule> readModuleRepository
) )
{ {
_taskAllocationRuleRepository = taskAllocationRuleRepository; _taskAllocationRuleRepository = taskAllocationRuleRepository;
@ -40,6 +41,7 @@ namespace IRaCIS.Core.Application.Service
_subjectVisitRepository = subjectVisitRepository; _subjectVisitRepository = subjectVisitRepository;
_subjectRepository = subjectRepository; _subjectRepository = subjectRepository;
_subjectUserRepository = subjectUserRepository; _subjectUserRepository = subjectUserRepository;
_readModuleRepository = readModuleRepository;
} }
/// <summary> /// <summary>
@ -447,6 +449,10 @@ namespace IRaCIS.Core.Application.Service
task.AllocateTime = DateTime.Now; task.AllocateTime = DateTime.Now;
task.TaskState = TaskState.Allocated; task.TaskState = TaskState.Allocated;
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == task.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.ImageReading });
await _readModuleRepository.BatchUpdateNoTrackingAsync(t => t.Id == task.SouceReadModuleId, u => new ReadModule() { ReadingStatus = ReadingStatusEnum.ImageReading });
} }
else else
{ {
@ -798,8 +804,8 @@ namespace IRaCIS.Core.Application.Service
doctor1Arm = 1; doctor1Arm = 1;
doctor2Arm = 2; doctor2Arm = 2;
} }
else if ( (preferredDoctor1Arm == null && preferredDoctor2Arm == 1)|| else if ((preferredDoctor1Arm == null && preferredDoctor2Arm == 1) ||
(preferredDoctor1Arm == 2 && preferredDoctor2Arm == 1)|| (preferredDoctor1Arm == 2 && preferredDoctor2Arm == 1) ||
(preferredDoctor1Arm == 2 && preferredDoctor2Arm == null)) (preferredDoctor1Arm == 2 && preferredDoctor2Arm == null))
{ {
doctor1Arm = 2; doctor1Arm = 2;
@ -810,7 +816,7 @@ namespace IRaCIS.Core.Application.Service
{ {
doctor1Arm = 1; doctor1Arm = 1;
doctor2Arm = 2; doctor2Arm = 2;
} }
else if (preferredDoctor1Arm == 2 && preferredDoctor2Arm == 2) else if (preferredDoctor1Arm == 2 && preferredDoctor2Arm == 2)
{ {
doctor1Arm = 2; doctor1Arm = 2;
@ -820,27 +826,27 @@ namespace IRaCIS.Core.Application.Service
//if(!waitAllocationDoctorList.Where(t=>t.DoctorUserId== allocateDoctorList[0].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId)) //if(!waitAllocationDoctorList.Where(t=>t.DoctorUserId== allocateDoctorList[0].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId))
//{ //{
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[0].DoctorUserId, ArmEnum = doctor1Arm, AssignTime = DateTime.Now }); await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[0].DoctorUserId, ArmEnum = doctor1Arm, AssignTime = DateTime.Now });
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[0].DoctorUserId).SubjectArmList.Add(new SubjectArm() waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[0].DoctorUserId).SubjectArmList.Add(new SubjectArm()
{ {
SubjectId = subject.SubjectId, SubjectId = subject.SubjectId,
ArmEnum = doctor1Arm ArmEnum = doctor1Arm
}); });
//} //}
//if (!waitAllocationDoctorList.Where(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId)) //if (!waitAllocationDoctorList.Where(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId))
//{ //{
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[1].DoctorUserId, ArmEnum = doctor2Arm, AssignTime = DateTime.Now }); await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[1].DoctorUserId, ArmEnum = doctor2Arm, AssignTime = DateTime.Now });
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SubjectArmList.Add(new SubjectArm() waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SubjectArmList.Add(new SubjectArm()
{ {
SubjectId = subject.SubjectId, SubjectId = subject.SubjectId,
ArmEnum = doctor2Arm ArmEnum = doctor2Arm
}); });
//} //}
} }

View File

@ -4,7 +4,6 @@ using System;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {

View File

@ -4,7 +4,6 @@ using System;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic; using System.Collections.Generic;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models

View File

@ -4,7 +4,6 @@ using System;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic; using System.Collections.Generic;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models