Browse Source

0710

master
wxd 4 months ago
parent
commit
9c5b7e3141
  1. 16
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs
  2. 51
      src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
  3. 97
      src/Shentun.Pacs.Domain/ThirdPacsResults/ThirdPacsResult.cs
  4. 35
      src/Shentun.Pacs.EntityFrameworkCore/DbMapping/ThirdPacsResults/ThirdPacsResultDbMapping.cs
  5. 5
      src/Shentun.Pacs.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
  6. 16412
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616093830_add_third_pacs_result.Designer.cs
  7. 51
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616093830_add_third_pacs_result.cs
  8. 16413
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616094200_update_third_pacs_result_id_length.Designer.cs
  9. 33
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616094200_update_third_pacs_result_id_length.cs
  10. 16394
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250618020501_update_third_pacs_result_01.Designer.cs
  11. 60
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250618020501_update_third_pacs_result_01.cs
  12. 79
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

16
src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
@ -16,9 +18,23 @@ namespace Shentun.Pacs.PacsBusiness
/// </summary>
public char CompleteFlag { get; set; }
/// <summary>
/// 发送到体检的状态 Y N
/// </summary>
public char? IsSend { get; set; }
/// <summary>
/// 审核医生 传空字符串 清空 并清理时间
/// </summary>
public string AuditorUserId { get; set; }
/// <summary>
/// 检查医生 传空字符串 清空 并清理时间
/// </summary>
public string CheckDoctorId { get; set; }
}
}

51
src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs

@ -410,12 +410,17 @@ namespace Shentun.Pacs.PacsBusiness
var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId into registerCheckAsbitemTemp
from registerCheckAsbitemEmpty in registerCheckAsbitemTemp.DefaultIfEmpty()
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitemEmpty.AsbitemId equals asbitem.Id into asbitemTemp
from asbitemEmpty in asbitemTemp.DefaultIfEmpty()
where registerCheck.Id == input.RegisterCheckId
select new
{
patientRegisterNo = patientRegister.PatientRegisterNo,
patientRegisterId = patientRegister.Id,
registerCheckId = registerCheck.Id
registerCheckId = registerCheck.Id,
asbitemDefaultResult = asbitemEmpty != null ? asbitemEmpty.DefaultResult : ""
}).FirstOrDefault();
if (query == null)
@ -443,6 +448,27 @@ namespace Shentun.Pacs.PacsBusiness
resultDto.registerCheckPictureDetails = await _registerCheckPictureAppService.GetRegisterCheckPictureInRegisterCheckIdAsync(query.registerCheckId);
if (!resultDto.RegisterCheckSummaryDetails.Any())
{
var defultResult = new RegisterCheckSummaryDto
{
Id = Guid.Empty,
CreationTime = DateTime.Now,
CreatorId = Guid.Empty,
CreatorName = "",
DisplayOrder = 0,
LastModificationTime = DateTime.Now,
LastModifierId = Guid.Empty,
LastModifierName = "",
RegisterCheckId = query.registerCheckId,
Summary = query.asbitemDefaultResult,
SummaryFlag = '0'
};
//增加默认小结 去组合项目的默认结果
resultDto.RegisterCheckSummaryDetails = new List<RegisterCheckSummaryDto>() { defultResult };
}
return resultDto;
}
@ -1913,6 +1939,7 @@ namespace Shentun.Pacs.PacsBusiness
//更新审核状态
registerCheckFirst.registerCheck.IsAudit = 'Y';
registerCheckFirst.registerCheck.AuditorUserId = _currentUser.Id;
registerCheckFirst.registerCheck.AuditTime = DateTime.Now;
await _registerCheckRepository.UpdateAsync(registerCheckFirst.registerCheck);
@ -2065,6 +2092,28 @@ namespace Shentun.Pacs.PacsBusiness
registerCheckFirst.IsSend = input.IsSend.Value;
}
if (string.IsNullOrWhiteSpace(input.AuditorUserId))
{
registerCheckFirst.AuditorUserId = null;
registerCheckFirst.AuditTime = null;
}
else
{
registerCheckFirst.AuditorUserId = Guid.Parse(input.AuditorUserId);
registerCheckFirst.AuditTime = DateTime.Now;
}
if (string.IsNullOrWhiteSpace(input.CheckDoctorId))
{
registerCheckFirst.CheckDoctorId = null;
registerCheckFirst.CheckDate = null;
}
else
{
registerCheckFirst.CheckDoctorId = input.CheckDoctorId;
registerCheckFirst.CheckDate = DateTime.Now;
}
await _registerCheckRepository.UpdateAsync(registerCheckFirst);
}

97
src/Shentun.Pacs.Domain/ThirdPacsResults/ThirdPacsResult.cs

@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace Shentun.Pacs.Models
{
/// <summary>
/// 第三方pacs结果
/// </summary>
[Table("third_pacs_result")]
[Index(nameof(CheckRequestNo), nameof(AsbitemName), Name = "ix_thirdpacsresult_check_request_no_asbitem_name", IsUnique = true)]
public class ThirdPacsResult : Entity<string>
{
/// <summary>
/// 检查单号
/// </summary>
[Column("check_request_no")]
[StringLength(20)]
public string CheckRequestNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
[Column("patient_name")]
[StringLength(50)]
public string PatientName { get; set; }
/// <summary>
/// 性别 M=男 F=女 U=未知
/// </summary>
[Column("sex_id")]
[MaxLength(1)]
public char? SexId { get; set; }
/// <summary>
/// 年龄
/// </summary>
[Column("age")]
public short? Age { get; set; }
/// <summary>
/// 检查项目
/// </summary>
[Column("asbitem_name")]
[StringLength(50)]
public string AsbitemName { get; set; }
/// <summary>
/// 检查描述
/// </summary>
[Column("check_description")]
[StringLength(8000)]
public string CheckDescription { get; set; }
/// <summary>
/// 检查结论
/// </summary>
[Column("check_conclusion")]
[StringLength(8000)]
public string CheckConclusion { get; set; }
/// <summary>
/// 检查时间
/// </summary>
[Column("check_time")]
public DateTime? CheckTime { get; set; }
/// <summary>
/// 检查医生
/// </summary>
[Column("check_doctor")]
[StringLength(50)]
public string CheckDoctor { get; set; }
/// <summary>
/// 创建时间 自动生成
/// </summary>
public DateTime CreateTime { get; set; }
}
}

35
src/Shentun.Pacs.EntityFrameworkCore/DbMapping/ThirdPacsResults/ThirdPacsResultDbMapping.cs

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using Shentun.Pacs.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shentun.Pacs.EntityFrameworkCore;
namespace Shentun.Pacs.DbMapping
{
internal class ThirdPacsResultDbMapping : IEntityTypeConfiguration<ThirdPacsResult>
{
public void Configure(EntityTypeBuilder<ThirdPacsResult> entity)
{
entity.HasComment("第三方pacs结果");
entity.Property(t => t.CheckRequestNo).HasComment("检查单号").IsRequired();
entity.Property(t => t.PatientName).HasComment("姓名");
entity.Property(t => t.SexId).HasComment("性别 M=男 F=女 U=未知");
entity.Property(t => t.Age).HasComment("年龄");
entity.Property(t => t.AsbitemName).HasComment("检查项目").IsRequired();
entity.Property(t => t.CheckDescription).HasComment("检查描述").IsRequired();
entity.Property(t => t.CheckConclusion).HasComment("检查结论").IsRequired();
entity.Property(t => t.CheckDoctor).HasComment("检查医生");
entity.Property(t => t.CheckTime).HasComment("检查时间");
entity.Property(t => t.CreateTime).HasComment("创建时间").IsRequired().HasDefaultValueSql("date(timezone('UTC-8'::text, now()))");
entity.Property(e => e.Id).HasMaxLength(50).IsRequired();
entity.ConfigureByConvention();
}
}
}

5
src/Shentun.Pacs.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs

@ -385,6 +385,8 @@ public class PeisDbContext :
public DbSet<ItemBigtextResultType> ItemBigtextResultTypes { get; set; } = null!;
public DbSet<ThirdPacsResult> ThirdPacsResults { get; set; } = null!;
public PeisDbContext(DbContextOptions<PeisDbContext> options)
: base(options)
{
@ -638,7 +640,8 @@ public class PeisDbContext :
.ApplyConfiguration(new DicomFileDetailDbMapping())
.ApplyConfiguration(new DoctorSignInDbMapping())
.ApplyConfiguration(new ThirdMedicalCenterDetailDbMapping())
.ApplyConfiguration(new ItemBigtextResultTypeDbMapping());
.ApplyConfiguration(new ItemBigtextResultTypeDbMapping())
.ApplyConfiguration(new ThirdPacsResultDbMapping());
#endregion

16412
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616093830_add_third_pacs_result.Designer.cs
File diff suppressed because it is too large
View File

51
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616093830_add_third_pacs_result.cs

@ -0,0 +1,51 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Pacs.Migrations
{
public partial class add_third_pacs_result : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "third_pacs_result",
columns: table => new
{
id = table.Column<string>(type: "text", nullable: false),
check_request_no = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "检查单号"),
patient_name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "姓名"),
sex_id = table.Column<char>(type: "character(1)", maxLength: 1, nullable: true, comment: "性别 M=男 F=女 U=未知"),
age = table.Column<short>(type: "smallint", nullable: true, comment: "年龄"),
asbitem_name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "检查项目"),
check_description = table.Column<string>(type: "character varying(8000)", maxLength: 8000, nullable: false, comment: "检查描述"),
check_conclusion = table.Column<string>(type: "character varying(8000)", maxLength: 8000, nullable: false, comment: "检查结论"),
check_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true, comment: "检查时间"),
check_doctor = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "检查医生"),
CreateTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, defaultValueSql: "date(timezone('UTC-8'::text, now()))", comment: "创建时间"),
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
creator_id = table.Column<Guid>(type: "uuid", nullable: false),
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_third_pacs_result", x => x.id);
},
comment: "第三方pacs结果");
migrationBuilder.CreateIndex(
name: "ix_thirdpacsresult_check_request_no_asbitem_name",
table: "third_pacs_result",
columns: new[] { "check_request_no", "asbitem_name" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "third_pacs_result");
}
}
}

16413
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616094200_update_third_pacs_result_id_length.Designer.cs
File diff suppressed because it is too large
View File

33
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250616094200_update_third_pacs_result_id_length.cs

@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Pacs.Migrations
{
public partial class update_third_pacs_result_id_length : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "id",
table: "third_pacs_result",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "id",
table: "third_pacs_result",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
}
}
}

16394
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250618020501_update_third_pacs_result_01.Designer.cs
File diff suppressed because it is too large
View File

60
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250618020501_update_third_pacs_result_01.cs

@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Pacs.Migrations
{
public partial class update_third_pacs_result_01 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "creation_time",
table: "third_pacs_result");
migrationBuilder.DropColumn(
name: "creator_id",
table: "third_pacs_result");
migrationBuilder.DropColumn(
name: "last_modification_time",
table: "third_pacs_result");
migrationBuilder.DropColumn(
name: "last_modifier_id",
table: "third_pacs_result");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "creation_time",
table: "third_pacs_result",
type: "timestamp without time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<Guid>(
name: "creator_id",
table: "third_pacs_result",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AddColumn<DateTime>(
name: "last_modification_time",
table: "third_pacs_result",
type: "timestamp without time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<Guid>(
name: "last_modifier_id",
table: "third_pacs_result",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
}
}
}

79
src/Shentun.Pacs.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -12407,6 +12407,85 @@ namespace Shentun.Pacs.Migrations
b.HasComment("分院对应的分组");
});
modelBuilder.Entity("Shentun.Pacs.Models.ThirdPacsResult", b =>
{
b.Property<string>("Id")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("id");
b.Property<short?>("Age")
.HasColumnType("smallint")
.HasColumnName("age")
.HasComment("年龄");
b.Property<string>("AsbitemName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("asbitem_name")
.HasComment("检查项目");
b.Property<string>("CheckConclusion")
.IsRequired()
.HasMaxLength(8000)
.HasColumnType("character varying(8000)")
.HasColumnName("check_conclusion")
.HasComment("检查结论");
b.Property<string>("CheckDescription")
.IsRequired()
.HasMaxLength(8000)
.HasColumnType("character varying(8000)")
.HasColumnName("check_description")
.HasComment("检查描述");
b.Property<string>("CheckDoctor")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("check_doctor")
.HasComment("检查医生");
b.Property<string>("CheckRequestNo")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasColumnName("check_request_no")
.HasComment("检查单号");
b.Property<DateTime?>("CheckTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("check_time")
.HasComment("检查时间");
b.Property<DateTime>("CreateTime")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp without time zone")
.HasDefaultValueSql("date(timezone('UTC-8'::text, now()))")
.HasComment("创建时间");
b.Property<string>("PatientName")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("patient_name")
.HasComment("姓名");
b.Property<char?>("SexId")
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasColumnName("sex_id")
.HasComment("性别 M=男 F=女 U=未知");
b.HasKey("Id");
b.HasIndex(new[] { "CheckRequestNo", "AsbitemName" }, "ix_thirdpacsresult_check_request_no_asbitem_name")
.IsUnique();
b.ToTable("third_pacs_result");
b.HasComment("第三方pacs结果");
});
modelBuilder.Entity("Shentun.Pacs.Models.TitleType", b =>
{
b.Property<Guid>("Id")

Loading…
Cancel
Save