修改非dicom 阅片
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
hang 2025-02-26 13:25:56 +08:00
parent 2a9c1ec45c
commit 56170b73ed
11 changed files with 19328 additions and 20 deletions

View File

@ -1505,6 +1505,13 @@
<param name="_userInfo"></param>
<param name="_localizer"></param>
</member>
<member name="M:IRaCIS.Core.Application.Service.TrialFinalRecordService.AuthorizedTrialFinalRecord(IRaCIS.Core.Application.ViewModel.AuthorizedTrialFinalRecordInDto)">
<summary>
授权文档
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Service.TrialNormalRecordService">
<summary>
项目-一般文件记录
@ -16816,6 +16823,16 @@
<param name="state"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.SetNodicomStudyState(System.Guid,System.Guid,System.Nullable{System.Guid},System.Int32)">
<summary>
1、设置为不读片2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除
</summary>
<param name="subjectVisitId"></param>
<param name="noneDicomStudyId"></param>
<param name="noneDicomStudyFileId"></param>
<param name="state"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.UpdateModality(IRaCIS.Core.Application.Contracts.DTO.UpdateModalityCommand)">
<summary>
type 1 :study 2: series 3:非dicom QC修改检查部位和 拍片类型

View File

@ -8,6 +8,7 @@ using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using Medallion.Threading;
using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.Contracts
@ -34,11 +35,19 @@ namespace IRaCIS.Core.Application.Contracts
[FromQuery] bool isFilterZip,
[FromQuery] Guid? visitTaskId)
{
var qcAuditState = await _subjectVisitRepository.Where(s => s.Id == subjectVisitId).Select(t => t.AuditState).FirstOrDefaultAsync();
//质控过程中,因为会修改统计数字,但是此时其他人看,应该看到完整的影像
var isQCFinished = qcAuditState == AuditStateEnum.QCPassed;
//质控过程中并且不是IQC时 需要忽略过滤器+忽略质控设置删除的
var isIgnoreDelete = _userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC && !isQCFinished;
IQueryable<NoneDicomStudyView> noneDicomStudyQueryable = default;
if (visitTaskId == null)
{
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
//质控过程中,需要忽略过滤质控设置删除的检查,以及设置删除的文件,质控通过后才
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId, ignoreQueryFilters: isIgnoreDelete).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip });
}
@ -47,7 +56,7 @@ namespace IRaCIS.Core.Application.Contracts
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(t => new { t.BlindSubjectCode, t.TrialReadingCriterionId, t.TrialReadingCriterion.IsImageFilter, t.TrialReadingCriterion.CriterionModalitys }).FirstNotNullAsync();
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == visitTaskId))
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == visitTaskId), ignoreQueryFilters: isIgnoreDelete)
.Where(t => taskinfo.IsImageFilter ? ("|" + taskinfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
.WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
.ProjectTo<TaskDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visitTaskId });
@ -158,18 +167,35 @@ namespace IRaCIS.Core.Application.Contracts
[HttpGet("{noneDicomStudyId:guid}")]
public async Task<List<NoneDicomStudyFileView>> GetNoneDicomStudyFileList(Guid noneDicomStudyId)
{
return await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudyId == noneDicomStudyId)
var qcAuditState = await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudyId == noneDicomStudyId).Select(t => t.NoneDicomStudy.SubjectVisit.AuditState).FirstOrDefaultAsync();
//质控过程中,因为会修改统计数字,但是此时其他人看,应该看到完整的影像
var isQCFinished = qcAuditState == AuditStateEnum.QCPassed;
//质控过程中并且不是IQC时 需要忽略过滤器+忽略质控设置删除的
var isIgnoreDelete = _userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC && !isQCFinished;
return await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudyId == noneDicomStudyId, ignoreQueryFilters: isIgnoreDelete)
.ProjectTo<NoneDicomStudyFileView>(_mapper.ConfigurationProvider).OrderBy(t => t.CreateTime).ToListAsync();
}
[HttpGet("{subjectVisitId:guid}")]
public async Task<List<NoneDicomStudyFileView>> GetVisitNoneDicomStudyFileList(Guid subjectVisitId)
{
return await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudy.SubjectVisitId == subjectVisitId)
var qcAuditState = await _subjectVisitRepository.Where(s => s.Id == subjectVisitId).Select(t => t.AuditState).FirstOrDefaultAsync();
//质控过程中,因为会修改统计数字,但是此时其他人看,应该看到完整的影像
var isQCFinished = qcAuditState == AuditStateEnum.QCPassed;
//质控过程中并且不是IQC时 需要忽略过滤器+忽略质控设置删除的
var isIgnoreDelete = _userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC && !isQCFinished;
return await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudy.SubjectVisitId == subjectVisitId, ignoreQueryFilters: isIgnoreDelete)
.ProjectTo<NoneDicomStudyFileView>(_mapper.ConfigurationProvider).ToListAsync();
}
}
}

View File

@ -18,6 +18,9 @@ namespace IRaCIS.Core.Application.Contracts
public List<NoneDicomStudyFileView> NoneDicomStudyFileList { get; set; } = new List<NoneDicomStudyFileView>();
public bool IsReading { get; set; }
public bool IsDeleted { get; set; }
}
public class TaskDicomStudyView : NoneDicomStudyView
@ -53,9 +56,10 @@ namespace IRaCIS.Core.Application.Contracts
public DateTime ImageDate { get; set; }
public string Description { get; set; } = string.Empty;
public int Code { get; set; }
public int Code { get; set; }
public string VideoName { get; set; } = string.Empty;
public string VideoObjectName { get; set; } = string.Empty;

View File

@ -33,6 +33,8 @@ namespace IRaCIS.Core.Application.Image.QA
IRepository<ReadModule> _readModuleRepository,
IRepository<DicomInstance> _dicomInstanceRepository,
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService,
IOSSService _oSSService,
@ -698,13 +700,6 @@ namespace IRaCIS.Core.Application.Image.QA
study.InstanceCount = study.InstanceCount - 1;
////删除到最后一个instance
//if (series.InstanceCount == 0)
//{
// series.IsDeleted = true;
//}
}
else if (state == 5)
@ -726,7 +721,73 @@ namespace IRaCIS.Core.Application.Image.QA
}
/// <summary>
/// 1、设置为不读片2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除
/// </summary>
/// <param name="subjectVisitId"></param>
/// <param name="noneDicomStudyId"></param>
/// <param name="noneDicomStudyFileId"></param>
/// <param name="state"></param>
/// <returns></returns>
[HttpPut]
[TrialGlobalLimit("AfterStopCannNotOpt")]
public async Task<IResponseOutput> SetNodicomStudyState(Guid subjectVisitId, Guid noneDicomStudyId, Guid? noneDicomStudyFileId, int state)
{
await VerifyIsCanQCAsync(null, subjectVisitId);
//设置检查
if (noneDicomStudyFileId == null)
{
var noneDicomStudy = (await _noneDicomStudyRepository.Where(t => t.Id == noneDicomStudyId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
if (state == 1)
{
noneDicomStudy.IsReading = false;
}
else if (state == 2)
{
noneDicomStudy.IsReading = true;
}
else if (state == 4)
{
noneDicomStudy.IsDeleted = true;
}
else if (state == 5)
{
noneDicomStudy.IsDeleted = false;
}
}
//设置检查下面的文件
else
{
var noneDicomStudyFile = (await _noneDicomStudyFileRepository.Where(t => t.Id == noneDicomStudyFileId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
if (state == 1)
{
noneDicomStudyFile.IsReading = false;
}
else if (state == 2)
{
noneDicomStudyFile.IsReading = true;
}
else if (state == 4)
{
noneDicomStudyFile.IsDeleted = true;
}
else if (state == 5)
{
noneDicomStudyFile.IsDeleted = false;
}
}
await _noneDicomStudyRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
/// <summary>
///type 1 :study 2: series 3:非dicom QC修改检查部位和 拍片类型

View File

@ -401,6 +401,8 @@ namespace IRaCIS.Core.Application.Service
bool isFilterZip = false;
bool isIgnoreDelete = false;
string token = string.Empty;
//一致性核查

View File

@ -682,7 +682,8 @@ namespace IRaCIS.Core.Application.Services
#region 非Dicom 检查查询
var noDicomList = await _noneDicomStudyRepository.Where(x => x.TrialId == indto.TrialId && x.SubjectVisitId == indto.SujectVisitId && x.NoneDicomFileList.Any(t => !t.FileType.Contains(StaticData.FileType.Zip)))
.WhereIf(taskInfo.IsImageFilter == true, t => taskInfo.CriterionModalitys.Contains(t.Modality)).ToListAsync();
.Where(t => t.IsReading)
.WhereIf(taskInfo.IsImageFilter == true, t => taskInfo.CriterionModalitys.Contains(t.Modality)).ToListAsync();
List<VisitStudyDTO> noDicomStudyList = noDicomList.Select(x => new VisitStudyDTO()
@ -702,7 +703,8 @@ namespace IRaCIS.Core.Application.Services
{
var nodicom = noDicomList.Where(x => x.Id == item.StudyId).First();
var instanceCount = await _noneDicomStudyFileRepository.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId)
var instanceCount = await _noneDicomStudyFileRepository.Where(t=>t.IsReading)
.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId)
.WhereIf(isExistTaskNoneDicomFile == false, x => x.NoneDicomStudyId == item.StudyId).CountAsync();
if (instanceCount == 0)

View File

@ -2,7 +2,7 @@ namespace IRaCIS.Core.Domain.Models;
[Comment("影像 - 非dicom检查")]
[Table("NoneDicomStudy")]
public class NoneDicomStudy : BaseFullAuditEntity
public class NoneDicomStudy : BaseFullDeleteAuditEntity
{
#region 导航属性
[JsonIgnore]
@ -31,6 +31,12 @@ public class NoneDicomStudy : BaseFullAuditEntity
public DateTime ImageDate { get; set; }
public string Description { get; set; } = string.Empty;
public bool IsReading { get; set; } = true;
#region Video 暂时无用
public string VideoName { get; set; } = string.Empty;
public string VideoObjectName { get; set; } = string.Empty;
@ -39,5 +45,8 @@ public class NoneDicomStudy : BaseFullAuditEntity
public string VideoUrl { get; set; } = string.Empty;
#endregion
}

View File

@ -2,7 +2,7 @@ namespace IRaCIS.Core.Domain.Models;
[Comment("影像 - 非dicom检查关联文件表")]
[Table("NoneDicomStudyFile")]
public class NoneDicomStudyFile : BaseAddAuditEntity
public class NoneDicomStudyFile : BaseAddDeleteAuditEntity
{
#region 导航属性
[ForeignKey("NoneDicomStudyId")]
@ -24,6 +24,9 @@ public class NoneDicomStudyFile : BaseAddAuditEntity
public string FileType { get; set; } = string.Empty;
public long? FileSize { get; set; }
public bool IsReading { get; set; } = true;
#region 跟任务绑定 同时区分检查
public Guid? VisitTaskId { get; set; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,115 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class nonedicomStudyIsReading : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "IsAuthorizedView",
// table: "TrialFileType");
migrationBuilder.AddColumn<Guid>(
name: "DeleteUserId",
table: "NoneDicomStudyFile",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "DeletedTime",
table: "NoneDicomStudyFile",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "NoneDicomStudyFile",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsReading",
table: "NoneDicomStudyFile",
type: "bit",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn<Guid>(
name: "DeleteUserId",
table: "NoneDicomStudy",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "DeletedTime",
table: "NoneDicomStudy",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "NoneDicomStudy",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsReading",
table: "NoneDicomStudy",
type: "bit",
nullable: false,
defaultValue: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DeleteUserId",
table: "NoneDicomStudyFile");
migrationBuilder.DropColumn(
name: "DeletedTime",
table: "NoneDicomStudyFile");
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "NoneDicomStudyFile");
migrationBuilder.DropColumn(
name: "IsReading",
table: "NoneDicomStudyFile");
migrationBuilder.DropColumn(
name: "DeleteUserId",
table: "NoneDicomStudy");
migrationBuilder.DropColumn(
name: "DeletedTime",
table: "NoneDicomStudy");
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "NoneDicomStudy");
migrationBuilder.DropColumn(
name: "IsReading",
table: "NoneDicomStudy");
//migrationBuilder.AddColumn<bool>(
// name: "IsAuthorizedView",
// table: "TrialFileType",
// type: "bit",
// nullable: false,
// defaultValue: false,
// comment: "是否授权查看");
}
}
}

View File

@ -3124,6 +3124,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<Guid>("CreateUserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleteUserId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletedTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(400)
@ -3135,6 +3141,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<DateTime>("ImageDate")
.HasColumnType("datetime2");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsReading")
.HasColumnType("bit");
b.Property<string>("Modality")
.IsRequired()
.HasMaxLength(400)
@ -3203,6 +3215,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<Guid>("CreateUserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleteUserId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletedTime")
.HasColumnType("datetime2");
b.Property<string>("FileName")
.IsRequired()
.HasMaxLength(400)
@ -3216,6 +3234,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsReading")
.HasColumnType("bit");
b.Property<Guid>("NoneDicomStudyId")
.HasColumnType("uniqueidentifier");
@ -11918,10 +11942,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("date")
.HasComment("首次定稿日期");
b.Property<bool>("IsAuthorizedView")
.HasColumnType("bit")
.HasComment("是否授权查看");
b.Property<bool>("IsConfirmRecord")
.HasColumnType("bit")
.HasComment("是否确认收入项");