增加课题组标签,以及患者和标签关联
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
36844c291a
commit
1fc70b1340
|
|
@ -37,6 +37,43 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
}
|
||||
|
||||
|
||||
#region 课题组标签 标签跟患者进行关联
|
||||
public class HospitalGroupTag : BaseFullAuditEntity
|
||||
{
|
||||
[JsonIgnore]
|
||||
public HospitalGroup HospitalGroup { get; set; }
|
||||
|
||||
|
||||
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class PatientHospitalGroupTag : BaseAddAuditEntity
|
||||
{
|
||||
[ForeignKey("PatientId")]
|
||||
[JsonIgnore]
|
||||
public SCPPatient Patient { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public HospitalGroupTag HospitalGroupTag { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public Guid PatientId { get; set; }
|
||||
|
||||
public Guid HospitalGroupTagId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
[Comment("用户课题组中间关系表")]
|
||||
public class HospitalGroupIdentityUser : BaseFullAuditEntity
|
||||
{
|
||||
|
|
|
|||
|
|
@ -593,6 +593,11 @@ public class IRaCISDBContext : DbContext
|
|||
|
||||
public virtual DbSet<CmoveStudy> CmoveStudy { get; set; }
|
||||
|
||||
|
||||
public virtual DbSet<HospitalGroupTag> HospitalGroupTag { get; set; }
|
||||
|
||||
public virtual DbSet<PatientHospitalGroupTag> PatientHospitalGroupTag { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class TestLength : Entity
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,112 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtag : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "HospitalGroupTag",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
HospitalGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_HospitalGroupTag", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_HospitalGroupTag_HospitalGroup_HospitalGroupId",
|
||||
column: x => x.HospitalGroupId,
|
||||
principalTable: "HospitalGroup",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_HospitalGroupTag_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PatientHospitalGroupTag",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PatientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
HospitalGroupTagId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PatientHospitalGroupTag", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientHospitalGroupTag_HospitalGroupTag_HospitalGroupTagId",
|
||||
column: x => x.HospitalGroupTagId,
|
||||
principalTable: "HospitalGroupTag",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientHospitalGroupTag_SCPPatient_PatientId",
|
||||
column: x => x.PatientId,
|
||||
principalTable: "SCPPatient",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientHospitalGroupTag_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HospitalGroupTag_CreateUserId",
|
||||
table: "HospitalGroupTag",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HospitalGroupTag_HospitalGroupId",
|
||||
table: "HospitalGroupTag",
|
||||
column: "HospitalGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientHospitalGroupTag_CreateUserId",
|
||||
table: "PatientHospitalGroupTag",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientHospitalGroupTag_HospitalGroupTagId",
|
||||
table: "PatientHospitalGroupTag",
|
||||
column: "HospitalGroupTagId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientHospitalGroupTag_PatientId",
|
||||
table: "PatientHospitalGroupTag",
|
||||
column: "PatientId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PatientHospitalGroupTag");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "HospitalGroupTag");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2973,6 +2973,40 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.HospitalGroupTag", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("HospitalGroupId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("HospitalGroupId");
|
||||
|
||||
b.ToTable("HospitalGroupTag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.IdentityUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -3746,6 +3780,34 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.ToTable("PIAudit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.PatientHospitalGroupTag", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("HospitalGroupTagId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PatientId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("HospitalGroupTagId");
|
||||
|
||||
b.HasIndex("PatientId");
|
||||
|
||||
b.ToTable("PatientHospitalGroupTag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Payment", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -15255,6 +15317,25 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("IdentityUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.HospitalGroupTag", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.HospitalGroup", "HospitalGroup")
|
||||
.WithMany()
|
||||
.HasForeignKey("HospitalGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("HospitalGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.IdentityUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
@ -15418,6 +15499,33 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("VisitTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.PatientHospitalGroupTag", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.HospitalGroupTag", "HospitalGroupTag")
|
||||
.WithMany()
|
||||
.HasForeignKey("HospitalGroupTagId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.SCPPatient", "Patient")
|
||||
.WithMany()
|
||||
.HasForeignKey("PatientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("HospitalGroupTag");
|
||||
|
||||
b.Navigation("Patient");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Payment", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
|
|||
Loading…
Reference in New Issue