wxd 1 year ago
parent
commit
54b959a89c
  1. 2
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs
  2. 34
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpSimpleDto.cs
  3. 87
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpWithCriticalItemDto.cs
  4. 4
      src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs
  5. 139
      src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
  6. 4
      src/Shentun.Peis.Domain/BigtextResultTypes/BigtextResultType.cs
  7. 2
      src/Shentun.Peis.Domain/Items/ItemManager.cs
  8. 1
      src/Shentun.Peis.Domain/RegisterChecks/RegisterCheck.cs
  9. 2
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/RegisterChecks/RegisterCheckDbMapping.cs
  10. 15731
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924041518_insert_register_check_is_pacs_check_index.Designer.cs
  11. 24
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924041518_insert_register_check_is_pacs_check_index.cs
  12. 15731
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924075252_update_bigtext_result_type_display_name_length.Designer.cs
  13. 61
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924075252_update_bigtext_result_type_display_name_length.cs
  14. 10
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  15. 8
      src/Shentun.Peis.HttpApi.Host/appsettings.json

2
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs

@ -19,7 +19,7 @@ namespace Shentun.Peis.PhoneFollowUps
public string ModeValue { get; set; }
/// <summary>
/// 截止时间
/// 截止时间 采用corn表达式时需要截止日期
/// </summary>
public string EndDate { get; set; }

34
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpSimpleDto.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.PhoneFollowUps
{
public class PhoneFollowUpSimpleDto
{
/// <summary>
/// 随访内容
/// </summary>
public string FollowUpContent { get; set; }
/// <summary>
/// 回复内容
/// </summary>
public string ReplyContent { get; set; }
///// <summary>
///// 随访ID
///// </summary>
//public Guid FollowUpId { get; set; }
/// <summary>
/// 随访日期
/// </summary>
public string PlanFollowDate { get; set; }
/// <summary>
/// 是否完成
/// </summary>
public char IsComplete { get; set; }
}
}

87
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpWithCriticalItemDto.cs

@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.PhoneFollowUps
{
public class PhoneFollowUpWithCriticalItemDto
{
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdNo { get; set; }
/// <summary>
/// 人员条码号
/// </summary>
public string PatientRegisterNo { get; set; }
/// <summary>
/// 组合异常集合
/// </summary>
public List<PhoneFollowUpWithCriticalItemAbnormalAsbitemDto> AbnormalAsbitemDetail { get; set; }
/// <summary>
/// 异常集合
/// </summary>
public List<PhoneFollowUpWithCriticalItemAbnormalItemDto> AbnormalItemDetail { get; set; }
/// <summary>
/// 电话随访记录
/// </summary>
public List<PhoneFollowUpSimpleDto> PhoneFollowUpDetail { get; set; }
}
public class PhoneFollowUpWithCriticalItemAbnormalItemDto
{
/// <summary>
///项目名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
///异常描述
/// </summary>
public string CriticalValueContent { get; set; }
/// <summary>
/// 是否危急值
/// </summary>
public char IsCriticalValue { get; set; }
/// <summary>
/// 是否复查
/// </summary>
public char IsReview { get; set; }
}
public class PhoneFollowUpWithCriticalItemAbnormalAsbitemDto
{
/// <summary>
///组合项目名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
///异常描述
/// </summary>
public string CriticalValueContent { get; set; }
/// <summary>
/// 是否危急值
/// </summary>
public char IsCriticalValue { get; set; }
/// <summary>
/// 是否复查
/// </summary>
public char IsReview { get; set; }
}
}

4
src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NPOI.POIFS.Storage;
using NPOI.Util;
@ -357,7 +358,8 @@ namespace Shentun.Peis.PacsBusiness
}
var checkRequestNoGroup = query.GroupBy(g => g.checkRequestNo);
var checkRequestNoGroup = query.ToList().GroupBy(g => g.checkRequestNo);
int totalCount = checkRequestNoGroup.Count();

139
src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs

@ -1,6 +1,7 @@
using Cronos;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.CriticalFollowValues;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
@ -28,18 +29,35 @@ namespace Shentun.Peis.PhoneFollowUps
private readonly CacheService _cacheService;
private readonly IRepository<FollowUp, Guid> _followUpRepository;
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
private readonly IRepository<RegisterCheck, Guid> _registerCheckRepository;
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository;
private readonly IRepository<RegisterCheckAsbitem, Guid> _registerCheckAsbitemRepository;
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
private readonly IRepository<Item, Guid> _itemRepository;
private readonly IRepository<Patient, Guid> _patientRepository;
public PhoneFollowUpAppService(
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository,
CacheService cacheService,
IRepository<FollowUp, Guid> followUpRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository
)
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<RegisterCheck, Guid> registerCheckRepository,
IRepository<RegisterCheckItem> registerCheckItemRepository,
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository,
IRepository<Asbitem, Guid> asbitemRepository,
IRepository<Item, Guid> itemRepository,
IRepository<Patient, Guid> patientRepository)
{
_phoneFollowUpRepository = phoneFollowUpRepository;
_cacheService = cacheService;
_followUpRepository = followUpRepository;
_patientRegisterRepository = patientRegisterRepository;
_registerCheckRepository = registerCheckRepository;
_registerCheckItemRepository = registerCheckItemRepository;
_registerCheckAsbitemRepository = registerCheckAsbitemRepository;
_asbitemRepository = asbitemRepository;
_itemRepository = itemRepository;
_patientRepository = patientRepository;
}
@ -121,6 +139,123 @@ namespace Shentun.Peis.PhoneFollowUps
}
/// <summary>
/// 获取人员随访记录
/// </summary>
/// <returns></returns>
[HttpPost("api/app/PhoneFollowUp/GetPatientRegisterCriticalList")]
public async Task<List<PhoneFollowUpWithCriticalItemDto>> GetPatientRegisterCriticalListAsync()
{
var query = from followUp in await _followUpRepository.GetQueryableAsync()
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on followUp.PatientRegisterId equals patientRegister.Id
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join registerCheckItem in await _registerCheckItemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckItem.RegisterCheckId
join item in await _itemRepository.GetQueryableAsync() on registerCheckItem.ItemId equals item.Id
join phoneFollowUp in await _phoneFollowUpRepository.GetQueryableAsync() on followUp.Id equals phoneFollowUp.FollowUpId into phoneFollowUpTemp
from phoneFollowUpEmpty in phoneFollowUpTemp.DefaultIfEmpty()
select new
{
patientRegister,
registerCheck,
asbitem,
registerCheckItem,
item,
followUp,
phoneFollowUpEmpty,
patient
};
var ff = query.ToQueryString();
var followUpGroup = query.ToList().GroupBy(g => g.followUp);
var entListDto = followUpGroup.Select(s => new PhoneFollowUpWithCriticalItemDto
{
PatientName = s.FirstOrDefault().patientRegister.PatientName,
IdNo = s.FirstOrDefault().patient.IdNo,
PatientRegisterNo = s.FirstOrDefault().patientRegister.PatientRegisterNo,
PhoneFollowUpDetail = s.Where(m => m.phoneFollowUpEmpty != null).GroupBy(g => g.phoneFollowUpEmpty).Select(ss => new PhoneFollowUpSimpleDto
{
FollowUpContent = ss.Key.FollowUpContent,
IsComplete = ss.Key.IsComplete,
PlanFollowDate = DataHelper.ConversionDateToString(ss.Key.PlanFollowDate),
ReplyContent = ss.Key.ReplyContent
}).ToList(),
AbnormalAsbitemDetail = s.Where(m => m.registerCheck.IsCriticalValue != null).GroupBy(g => g.registerCheck).Select(ss => new PhoneFollowUpWithCriticalItemAbnormalAsbitemDto
{
CriticalValueContent = ss.Key.CriticalValueContent,
AsbitemName = string.Join(",", ss.Select(sss => sss.asbitem.DisplayName).Distinct()),
IsCriticalValue = ss.Key.IsCriticalValue == null ? 'N' : ss.Key.IsCriticalValue.Value,
IsReview = ss.Key.IsReview == null ? 'N' : ss.Key.IsReview.Value
}).ToList(),
AbnormalItemDetail = s.Where(m => m.registerCheckItem.IsCriticalValue != null).GroupBy(g => g.registerCheckItem).Select(ss => new PhoneFollowUpWithCriticalItemAbnormalItemDto
{
CriticalValueContent = ss.Key.CriticalValueContent,
ItemName = ss.FirstOrDefault().item.DisplayName,
IsCriticalValue = ss.Key.IsCriticalValue == null ? 'N' : ss.Key.IsCriticalValue.Value,
IsReview = ss.Key.IsReview == null ? 'N' : ss.Key.IsReview.Value
}).ToList()
}).ToList();
return entListDto;
//var query = from phoneFollowUp in await _phoneFollowUpRepository.GetQueryableAsync()
// join followUp in await _followUpRepository.GetQueryableAsync() on phoneFollowUp.FollowUpId equals followUp.Id
// join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on followUp.PatientRegisterId equals patientRegister.Id
// orderby patientRegister.Id, phoneFollowUp.PlanFollowDate
// select new
// {
// patientName = patientRegister.PatientName,
// phoneFollowUp
// };
//if (input.FollowUpId != null)
//{
// query = query.Where(m => m.phoneFollowUp.FollowUpId == input.FollowUpId);
//}
//if (!string.IsNullOrWhiteSpace(input.KeyWord))
//{
// query = query.Where(m => (!string.IsNullOrWhiteSpace(m.phoneFollowUp.FollowUpContent) && m.phoneFollowUp.FollowUpContent.Contains(input.KeyWord))
// || (!string.IsNullOrWhiteSpace(m.phoneFollowUp.ReplyContent) && m.phoneFollowUp.ReplyContent.Contains(input.KeyWord))
// );
//}
//if (input.IsComplete != null)
//{
// query = query.Where(m => m.phoneFollowUp.IsComplete == input.IsComplete);
//}
//if (!string.IsNullOrWhiteSpace(input.StartDate) && !string.IsNullOrWhiteSpace(input.EndDate))
//{
// query = query.Where(m => m.phoneFollowUp.PlanFollowDate >= Convert.ToDateTime(input.StartDate)
// && m.phoneFollowUp.PlanFollowDate <= Convert.ToDateTime(input.EndDate).AddDays(1));
//}
//var entListDto = query.ToList().Select(s => new PhoneFollowUpWithPatientRegisterDto
//{
// FollowUpId = s.phoneFollowUp.FollowUpId,
// CreationTime = s.phoneFollowUp.CreationTime,
// ReplyContent = s.phoneFollowUp.ReplyContent,
// PlanFollowDate = DataHelper.ConversionDateToString(s.phoneFollowUp.PlanFollowDate),
// CreatorId = s.phoneFollowUp.CreatorId,
// FollowUpContent = s.phoneFollowUp.ReplyContent,
// Id = s.phoneFollowUp.Id,
// IsComplete = s.phoneFollowUp.IsComplete,
// LastModificationTime = s.phoneFollowUp.LastModificationTime,
// LastModifierId = s.phoneFollowUp.LastModifierId,
// CreatorName = _cacheService.GetSurnameAsync(s.phoneFollowUp.CreatorId).GetAwaiter().GetResult(),
// LastModifierName = _cacheService.GetSurnameAsync(s.phoneFollowUp.LastModifierId).GetAwaiter().GetResult(),
// PatientName = s.patientName
//}).ToList();
//return entListDto;
}
/// <summary>
/// 创建电话随访记录
/// </summary>

4
src/Shentun.Peis.Domain/BigtextResultTypes/BigtextResultType.cs

@ -24,7 +24,7 @@ namespace Shentun.Peis.Models
/// 名称
/// </summary>
[Column("display_name")]
[StringLength(20)]
[StringLength(50)]
public string DisplayName { get; set; } = null!;
/// <summary>
/// 父编号
@ -46,7 +46,7 @@ namespace Shentun.Peis.Models
public Guid ItemTypeId { get; set; }
[Column("simple_code")]
[StringLength(20)]
[StringLength(50)]
public string SimpleCode { get; set; } = null!;
[Column("display_order")]
public int DisplayOrder { get; set; }

2
src/Shentun.Peis.Domain/Items/ItemManager.cs

@ -125,7 +125,7 @@ namespace Shentun.Peis.Items
}
//await EntityHelper.CheckSameName<Item, Guid>(_repository, sourceEntity.DisplayName, targetEntity);
targetEntity.DisplayName = sourceEntity.DisplayName;
targetEntity.SimpleCode = LanguageConverter.GetPYSimpleCode(targetEntity.DisplayName);
targetEntity.SimpleCode = LanguageConverter.GetPYSimpleCode(sourceEntity.DisplayName);
}
targetEntity.DefaultResult = sourceEntity.DefaultResult;

1
src/Shentun.Peis.Domain/RegisterChecks/RegisterCheck.cs

@ -15,6 +15,7 @@ namespace Shentun.Peis.Models
[Table("register_check")]
[Index(nameof(CheckRequestNo), Name = "ix_register_check_1")]
[Index(nameof(PatientRegisterId), Name = "ix_register_check_patient_register_id")]
[Index(nameof(IsPacsCheck), Name = "ix_register_check_is_pacs_check")]
public class RegisterCheck: AuditedEntity<Guid>, IHasConcurrencyStamp
{
public RegisterCheck()

2
src/Shentun.Peis.EntityFrameworkCore/DbMapping/RegisterChecks/RegisterCheckDbMapping.cs

@ -21,7 +21,7 @@ namespace Shentun.Peis.DbMapping
entity.Property(t => t.CompleteFlag).HasComment("完成标志").IsRequired().HasDefaultValueSql("0");
entity.Property(t => t.CheckRequestPrintTimes).HasComment("检查申请单打印次数").IsRequired().HasDefaultValueSql("0");
entity.Property(t => t.CriticalRangeValue).HasComment("危急值");
entity.Property(t => t.IsCriticalValue).HasComment("危急值标志").HasDefaultValueSql("0");
//entity.Property(t => t.IsCriticalValue).HasComment("危急值标志").HasDefaultValueSql("N");
entity.Property(t => t.CriticalValueContent).HasComment("危急值处理内容");
//entity.Property(t => t.CriticalValueProcessFlag).HasComment("危急值处理标志");
//entity.Property(t => t.CriticalValueProcessDoctor).HasComment("危急值处理医生");

15731
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924041518_insert_register_check_is_pacs_check_index.Designer.cs
File diff suppressed because it is too large
View File

24
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924041518_insert_register_check_is_pacs_check_index.cs

@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class insert_register_check_is_pacs_check_index : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "ix_register_check_is_pacs_check",
table: "register_check",
column: "is_pacs_check");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "ix_register_check_is_pacs_check",
table: "register_check");
}
}
}

15731
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924075252_update_bigtext_result_type_display_name_length.Designer.cs
File diff suppressed because it is too large
View File

61
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240924075252_update_bigtext_result_type_display_name_length.cs

@ -0,0 +1,61 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class update_bigtext_result_type_display_name_length : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "simple_code",
table: "bigtext_result_type",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(20)",
oldMaxLength: 20,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "display_name",
table: "bigtext_result_type",
type: "character varying(50)",
maxLength: 50,
nullable: false,
comment: "名称",
oldClrType: typeof(string),
oldType: "character varying(20)",
oldMaxLength: 20,
oldComment: "名称");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "simple_code",
table: "bigtext_result_type",
type: "character varying(20)",
maxLength: 20,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "display_name",
table: "bigtext_result_type",
type: "character varying(20)",
maxLength: 20,
nullable: false,
comment: "名称",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldComment: "名称");
}
}
}

10
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -1028,8 +1028,8 @@ namespace Shentun.Peis.Migrations
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("display_name")
.HasComment("名称");
@ -1067,8 +1067,8 @@ namespace Shentun.Peis.Migrations
.HasComment("路径编码");
b.Property<string>("SimpleCode")
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("simple_code");
b.HasKey("Id");
@ -8734,6 +8734,8 @@ namespace Shentun.Peis.Migrations
b.HasIndex(new[] { "CheckRequestNo" }, "ix_register_check_1");
b.HasIndex(new[] { "IsPacsCheck" }, "ix_register_check_is_pacs_check");
b.HasIndex(new[] { "PatientRegisterId" }, "ix_register_check_patient_register_id");
b.ToTable("register_check");

8
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -5,14 +5,14 @@
"CorsOrigins": "https://*.Peis.com,http://localhost:4200,http://localhost:9530,http://192.168.1.108:9530,http://localhost:8080,http://localhost:8081",
"RedirectAllowedUrls": "http://localhost:9530",
"SelfUser": "admin",
"SelfPassword": "Shentun!@#qwe123",
"SelfPassword": "666666",
"LisUser": "admin",
"LisPassword": "Shentun!@#qwe123"
"LisPassword": "666666"
},
"ConnectionStrings": {
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123;"
"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
//"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
},
"AuthServer": {
"Authority": "http://localhost:9530",

Loading…
Cancel
Save