diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs index 5159dd58a..12aa41424 100644 --- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs +++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs @@ -293,6 +293,33 @@ namespace IRaCIS.Core.Domain.Share Freeze = 5, } + /// + /// 评估进度 + /// + public enum EvaluateProgress + { + /// + /// 默认 + /// + Default = 0, + + /// + /// 放射学 + /// + Radiology = 1, + + /// + /// 核医学 + /// + NuclearMedicine = 2, + + /// + /// 肿瘤学 + /// + Oncology = 3, + + } + //阅片状态 public enum ReadingTaskState { diff --git a/IRaCIS.Core.Domain/Allocation/TaskEvaluateProgress.cs b/IRaCIS.Core.Domain/Allocation/TaskEvaluateProgress.cs new file mode 100644 index 000000000..5c989a9ec --- /dev/null +++ b/IRaCIS.Core.Domain/Allocation/TaskEvaluateProgress.cs @@ -0,0 +1,20 @@ +using IRaCIS.Core.Domain.Share; + +namespace IRaCIS.Core.Domain.Models; + +[Comment("项目阅片 - 任务评估进度")] +[Table("TaskEvaluateProgress")] +public class TaskEvaluateProgress : BaseAddAuditEntity +{ + /// + /// 任务Id + /// + public Guid VisitTaskId { get; set; } + + /// + /// 评估进度 + /// + public EvaluateProgress EvaluateProgressEnum { get; set; } +} + + diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index d64d31d55..77f920d78 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -304,6 +304,11 @@ public class VisitTask : BaseFullAuditEntity [ForeignKey("SubjectCriterionClaimUserId")] public UserRole SubjectCriterionClaimUser { get; set; } + /// + /// 评估进度 + /// + public EvaluateProgress EvaluateProgressEnum { get; set; } = EvaluateProgress.Default; + [NotMapped] public List PIAuditImagePathList diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 5b724f9c9..e37aeb78d 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -543,6 +543,8 @@ public class IRaCISDBContext : DbContext public virtual DbSet TaskConsistentRule { get; set; } + public virtual DbSet TaskEvaluateProgress { get; set; } + public virtual DbSet TaskInfluence { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20250828061251_TaskEvaluateProgress.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20250828061251_TaskEvaluateProgress.cs new file mode 100644 index 000000000..54b45517e --- /dev/null +++ b/IRaCIS.Core.Infra.EFCore/Migrations/20250828061251_TaskEvaluateProgress.cs @@ -0,0 +1,46 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace IRaCIS.Core.Infra.EFCore.Migrations +{ + /// + public partial class TaskEvaluateProgress : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "EvaluateProgressEnum", + table: "VisitTask", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "TaskEvaluateProgress", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + VisitTaskId = table.Column(type: "uniqueidentifier", nullable: false), + EvaluateProgressEnum = table.Column(type: "int", nullable: false), + CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TaskEvaluateProgress", x => x.Id); + }, + comment: "项目阅片 - 任务评估进度"); + + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs b/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs index 1cceb9770..9b9e6c293 100644 --- a/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs +++ b/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs @@ -3092,6 +3092,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasKey("Id"); + b.HasIndex("CreateUserId"); + b.HasIndex("TrialId"); b.ToTable("IdentityUser", t => @@ -10098,6 +10100,33 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }); }); + modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskEvaluateProgress", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreateUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("EvaluateProgressEnum") + .HasColumnType("int"); + + b.Property("VisitTaskId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CreateUserId"); + + b.ToTable("TaskEvaluateProgress", t => + { + t.HasComment("项目阅片 - 任务评估进度"); + }); + }); + modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskInfluence", b => { b.Property("Id") @@ -13568,6 +13597,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasKey("Id"); + b.HasIndex("CreateUserId"); + b.HasIndex("DoctorId") .IsUnique() .HasFilter("[DoctorId] IS NOT NULL"); @@ -14010,6 +14041,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("DoctorUserId") .HasColumnType("uniqueidentifier"); + b.Property("EvaluateProgressEnum") + .HasColumnType("int"); + b.Property("ExpetidEmailNoticeTime") .HasColumnType("datetime2") .HasComment("通知IR加急阅片时间"); @@ -15206,10 +15240,18 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.IdentityUser", b => { + b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole") + .WithMany() + .HasForeignKey("CreateUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial") .WithMany() .HasForeignKey("TrialId"); + b.Navigation("CreateUserRole"); + b.Navigation("Trial"); }); @@ -16350,7 +16392,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .IsRequired(); b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask") - .WithMany() + .WithMany("ReadingTaskQuestionMarkList") .HasForeignKey("VisitTaskId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -17263,6 +17305,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Navigation("TrialReadingCriterion"); }); + modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskEvaluateProgress", b => + { + b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole") + .WithMany() + .HasForeignKey("CreateUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreateUserRole"); + }); + modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskInfluence", b => { b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole") @@ -18249,6 +18302,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.UserRole", b => { + b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole") + .WithMany() + .HasForeignKey("CreateUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.HasOne("IRaCIS.Core.Domain.Models.Doctor", null) .WithOne("User") .HasForeignKey("IRaCIS.Core.Domain.Models.UserRole", "DoctorId"); @@ -18265,6 +18324,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("CreateUserRole"); + b.Navigation("IdentityUser"); b.Navigation("UserTypeRole"); @@ -18979,6 +19040,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Navigation("ReadingTaskQuestionAnswerList"); + b.Navigation("ReadingTaskQuestionMarkList"); + b.Navigation("TaskInfluenceList"); b.Navigation("TaskMedicalReviewList");