Compare commits
No commits in common. "c49a74d7427b39b153b53472c7acdb585856db0c" and "c76fc8f05257e26457e636ae16c65e5c748f318e" have entirely different histories.
c49a74d742
...
c76fc8f052
|
|
@ -216,8 +216,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//public bool IsAfterConvertedTask { get; set; }
|
//public bool IsAfterConvertedTask { get; set; }
|
||||||
|
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
public int? RandomOrder { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -484,9 +482,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public string? RequestReReadingReason { get; set; }
|
public string? RequestReReadingReason { get; set; }
|
||||||
|
|
||||||
public ExportResult? ReadingExportType { get; set; }
|
public ExportResult? ReadingExportType { get; set; }
|
||||||
|
|
||||||
public int? RandomOrder { get; set; }
|
|
||||||
public bool? IsRandomOrderList { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -913,30 +908,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
CancelAssign = 4,
|
CancelAssign = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class SetRandomTaskOrderCommand
|
|
||||||
{
|
|
||||||
[NotDefault]
|
|
||||||
public Guid TrialId { get; set; }
|
|
||||||
|
|
||||||
[NotDefault]
|
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
|
||||||
|
|
||||||
[NotDefault]
|
|
||||||
public Guid DoctorUserId { get; set; }
|
|
||||||
|
|
||||||
public bool IsAutoSet { get; set; }
|
|
||||||
|
|
||||||
public List<VisitTaskOrderCommand> SetList { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class VisitTaskOrderCommand
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
public int? RandomOrder { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
return await _visitTaskRepository.SaveChangesAsync();
|
return await _visitTaskRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null, bool? isRandom = null)
|
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null)
|
||||||
{
|
{
|
||||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
||||||
|
|
||||||
|
|
@ -107,8 +107,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
|
|
||||||
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
||||||
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate)
|
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate).ToList();
|
||||||
.WhereIf(isRandom == true, t => t.IsReadingTaskViewInOrder == ReadingOrder.Random).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -762,8 +761,6 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||||
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
|
||||||
.WhereIf(inQuery.IsRandomOrderList == true, t => t.ReadingTaskState==ReadingTaskState.WaitReading && t.TaskAllocationState==TaskAllocationState.Allocated)
|
|
||||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
||||||
|
|
@ -2945,88 +2942,6 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 完全随机设置序号
|
|
||||||
[HttpPost]
|
|
||||||
[UnitOfWork]
|
|
||||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
||||||
public async Task<IResponseOutput> SetRandomTaskOrder(SetRandomTaskOrderCommand inCommand)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (inCommand.IsAutoSet)
|
|
||||||
{
|
|
||||||
//找到所有的已分配的,未阅片的,生效的 非一致性分析
|
|
||||||
|
|
||||||
var needRandomOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
|
||||||
.Where(t => t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
|
||||||
.Select(t => t.Id).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
//var haveSignOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
|
||||||
// .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime != null && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
|
||||||
// .Select(t => t.RandomOrder).ToList();
|
|
||||||
|
|
||||||
//已阅,阅片中任务的序号
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId
|
|
||||||
&& t.DoctorUserId == inCommand.DoctorUserId && t.ReadingTaskState != ReadingTaskState.WaitReading, u => new VisitTask() { RandomOrder = null });
|
|
||||||
|
|
||||||
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
|
||||||
List<int> availableNumbers = Enumerable.Range(1, needRandomOrderList.Count).ToList();
|
|
||||||
Random rng = new Random();
|
|
||||||
foreach (var id in needRandomOrderList)
|
|
||||||
{
|
|
||||||
int randomIndex = rng.Next(availableNumbers.Count);
|
|
||||||
|
|
||||||
var num = availableNumbers[randomIndex];
|
|
||||||
|
|
||||||
var order = 11 + 5 * (num - 1);
|
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, t => new VisitTask() { RandomOrder = order });
|
|
||||||
|
|
||||||
availableNumbers.RemoveAt(randomIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var item in inCommand.SetList)
|
|
||||||
{
|
|
||||||
var task = await _visitTaskRepository.Where(t => t.Id == item.Id).Select(t => new { t.RandomOrder, t.ReadingTaskState, t.TaskAllocationState, t.DoctorUserId }).FirstNotNullAsync();
|
|
||||||
|
|
||||||
if (task.ReadingTaskState != ReadingTaskState.WaitReading || task.DoctorUserId != inCommand.DoctorUserId
|
|
||||||
|| task.TaskAllocationState != TaskAllocationState.Allocated)
|
|
||||||
{
|
|
||||||
//"任务不符合设置阅片序号条件"
|
|
||||||
return ResponseOutput.NotOk(_localizer["VisitTask_NotRandomOrderTask"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置交换序号的任务,可能不符合条件
|
|
||||||
|
|
||||||
//没有序号,直接设置
|
|
||||||
if (task.RandomOrder == null)
|
|
||||||
{
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId
|
|
||||||
&& t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
|
||||||
&& t.RandomOrder == item.RandomOrder))
|
|
||||||
{
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//"序号已被占用!"
|
|
||||||
return ResponseOutput.NotOk(_localizer["VisitTask_RandomOrderUserd"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
#region 暂时废弃
|
#region 暂时废弃
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -288,13 +288,4 @@ public class VisitTask : BaseFullAuditEntity
|
||||||
|
|
||||||
[Comment("退回原因")]
|
[Comment("退回原因")]
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
#region 完全随机增加字段
|
|
||||||
|
|
||||||
[Comment("完全随机阅片号")]
|
|
||||||
public int? RandomOrder { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,70 +0,0 @@
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class addRandomOrder : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "RandomOrder",
|
|
||||||
table: "VisitTask",
|
|
||||||
type: "int",
|
|
||||||
nullable: true,
|
|
||||||
comment: "完全随机阅片号");
|
|
||||||
|
|
||||||
//migrationBuilder.CreateIndex(
|
|
||||||
// name: "IX_NoneDicomStudy_TrialId",
|
|
||||||
// table: "NoneDicomStudy",
|
|
||||||
// column: "TrialId");
|
|
||||||
|
|
||||||
//migrationBuilder.CreateIndex(
|
|
||||||
// name: "IX_ClinicalForm_ReadingId",
|
|
||||||
// table: "ClinicalForm",
|
|
||||||
// column: "ReadingId");
|
|
||||||
|
|
||||||
//migrationBuilder.AddForeignKey(
|
|
||||||
// name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
|
||||||
// table: "ClinicalForm",
|
|
||||||
// column: "ReadingId",
|
|
||||||
// principalTable: "SubjectVisit",
|
|
||||||
// principalColumn: "Id");
|
|
||||||
|
|
||||||
//migrationBuilder.AddForeignKey(
|
|
||||||
// name: "FK_NoneDicomStudy_Trial_TrialId",
|
|
||||||
// table: "NoneDicomStudy",
|
|
||||||
// column: "TrialId",
|
|
||||||
// principalTable: "Trial",
|
|
||||||
// principalColumn: "Id",
|
|
||||||
// onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
|
||||||
table: "ClinicalForm");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_NoneDicomStudy_Trial_TrialId",
|
|
||||||
table: "NoneDicomStudy");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_NoneDicomStudy_TrialId",
|
|
||||||
table: "NoneDicomStudy");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_ClinicalForm_ReadingId",
|
|
||||||
table: "ClinicalForm");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "RandomOrder",
|
|
||||||
table: "VisitTask");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -487,8 +487,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("CreateUserId");
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
b.HasIndex("ReadingId");
|
|
||||||
|
|
||||||
b.HasIndex("SubjectId");
|
b.HasIndex("SubjectId");
|
||||||
|
|
||||||
b.ToTable("ClinicalForm", t =>
|
b.ToTable("ClinicalForm", t =>
|
||||||
|
|
@ -3289,8 +3287,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("SubjectVisitId");
|
b.HasIndex("SubjectVisitId");
|
||||||
|
|
||||||
b.HasIndex("TrialId");
|
|
||||||
|
|
||||||
b.ToTable("NoneDicomStudy", t =>
|
b.ToTable("NoneDicomStudy", t =>
|
||||||
{
|
{
|
||||||
t.HasComment("影像 - 非dicom检查");
|
t.HasComment("影像 - 非dicom检查");
|
||||||
|
|
@ -14394,10 +14390,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("nvarchar(2000)")
|
.HasColumnType("nvarchar(2000)")
|
||||||
.HasComment("既往任务Id 不包括自己");
|
.HasComment("既往任务Id 不包括自己");
|
||||||
|
|
||||||
b.Property<int?>("RandomOrder")
|
|
||||||
.HasColumnType("int")
|
|
||||||
.HasComment("完全随机阅片号");
|
|
||||||
|
|
||||||
b.Property<int>("ReReadingApplyState")
|
b.Property<int>("ReReadingApplyState")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("重阅状态");
|
.HasComment("重阅状态");
|
||||||
|
|
@ -14875,10 +14867,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.SubjectVisit", "SubjectVisit")
|
|
||||||
.WithMany("ClinicalFormList")
|
|
||||||
.HasForeignKey("ReadingId");
|
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
||||||
.WithMany("ClinicalFormList")
|
.WithMany("ClinicalFormList")
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
|
|
@ -14890,8 +14878,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
|
||||||
b.Navigation("SubjectVisit");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
||||||
|
|
@ -15481,12 +15467,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Trial", null)
|
|
||||||
.WithMany("NoneDicomStudyList")
|
|
||||||
.HasForeignKey("TrialId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
|
@ -16593,7 +16573,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
||||||
.WithMany("ReadingTaskQuestionMarkList")
|
.WithMany()
|
||||||
.HasForeignKey("VisitTaskId")
|
.HasForeignKey("VisitTaskId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
@ -19261,8 +19241,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
{
|
{
|
||||||
b.Navigation("CheckChallengeDialogList");
|
b.Navigation("CheckChallengeDialogList");
|
||||||
|
|
||||||
b.Navigation("ClinicalFormList");
|
|
||||||
|
|
||||||
b.Navigation("NoneDicomStudyList");
|
b.Navigation("NoneDicomStudyList");
|
||||||
|
|
||||||
b.Navigation("PreviousHistoryList");
|
b.Navigation("PreviousHistoryList");
|
||||||
|
|
@ -19331,8 +19309,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("EnrollList");
|
b.Navigation("EnrollList");
|
||||||
|
|
||||||
b.Navigation("NoneDicomStudyList");
|
|
||||||
|
|
||||||
b.Navigation("ReadModuleList");
|
b.Navigation("ReadModuleList");
|
||||||
|
|
||||||
b.Navigation("ReadingClinicalDataList");
|
b.Navigation("ReadingClinicalDataList");
|
||||||
|
|
@ -19460,8 +19436,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("ReadingTaskQuestionAnswerList");
|
b.Navigation("ReadingTaskQuestionAnswerList");
|
||||||
|
|
||||||
b.Navigation("ReadingTaskQuestionMarkList");
|
|
||||||
|
|
||||||
b.Navigation("TaskInfluenceList");
|
b.Navigation("TaskInfluenceList");
|
||||||
|
|
||||||
b.Navigation("TaskMedicalReviewList");
|
b.Navigation("TaskMedicalReviewList");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue