Browse Source

危急值

master
wxd 1 year ago
parent
commit
a58c523f33
  1. 4
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetPatientRegisterCriticalListInputDto.cs
  2. 4
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpWithCriticalItemDto.cs
  3. 4
      src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemDto.cs
  4. 4
      src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemOrItemOrItemResultTemplateDto.cs
  5. 4
      src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs
  6. 4
      src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs
  7. 5
      src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs
  8. 11
      src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
  9. 6
      src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs
  10. 4
      src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
  11. 34
      src/Shentun.Peis.Domain/CacheService.cs
  12. 6
      src/Shentun.Peis.Domain/RegisterCheckItems/RegisterCheckItem.cs
  13. 6
      src/Shentun.Peis.Domain/RegisterChecks/RegisterCheck.cs
  14. 16226
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20241124063252_update_register_check_add_diagnosis_level_id.Designer.cs
  15. 55
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20241124063252_update_register_check_add_diagnosis_level_id.cs
  16. 16
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

4
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetPatientRegisterCriticalListInputDto.cs

@ -86,9 +86,9 @@ namespace Shentun.Peis.PhoneFollowUps
public char? IsPhoneComplete { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
public int MaxResultCount { get; set; } = 50;

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

@ -153,9 +153,9 @@ namespace Shentun.Peis.PhoneFollowUps
public char IsPhoneComplete { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public string DiagnosisLevelNames { get; set; }
}
public class PhoneFollowUpWithCriticalItemAbnormalItemDto

4
src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemDto.cs

@ -80,9 +80,9 @@ namespace Shentun.Peis.RegisterCheckItems
public string FollowUpCreatorName { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
}
}

4
src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemOrItemOrItemResultTemplateDto.cs

@ -127,9 +127,9 @@ namespace Shentun.Peis.RegisterCheckItems
public string FollowUpCreatorName { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
/// <summary>

4
src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs

@ -41,8 +41,8 @@ namespace Shentun.Peis.RegisterCheckItems
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
}
}

4
src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs

@ -132,9 +132,9 @@ namespace Shentun.Peis.RegisterChecks
public string? FollowUpCreatorName { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
/// <summary>
/// 检查医生ID

5
src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace Shentun.Peis.RegisterChecks
@ -36,8 +37,8 @@ namespace Shentun.Peis.RegisterChecks
public char? IsReview { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
public string CriticalCategory { get; set; }
public short? DiagnosisLevelId { get; set; }
}
}

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

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using NUglify.Helpers;
using Shentun.Peis.CriticalFollowValues;
using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.Enums;
@ -40,6 +41,7 @@ namespace Shentun.Peis.PhoneFollowUps
private readonly CustomerOrgManager _customerOrgManager;
private readonly IRepository<RegisterCheckSummary, Guid> _registerCheckSummaryRepository;
public PhoneFollowUpAppService(
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository,
CacheService cacheService,
@ -52,7 +54,8 @@ namespace Shentun.Peis.PhoneFollowUps
IRepository<Item, Guid> itemRepository,
IRepository<Patient, Guid> patientRepository,
CustomerOrgManager customerOrgManager,
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository)
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository
)
{
_phoneFollowUpRepository = phoneFollowUpRepository;
_cacheService = cacheService;
@ -256,9 +259,9 @@ namespace Shentun.Peis.PhoneFollowUps
query = query.Where(m => m.followUp.IsPhoneComplete == input.IsPhoneComplete);
}
if (!string.IsNullOrWhiteSpace(input.CriticalCategory))
if (input.DiagnosisLevelId != null)
{
query = query.Where(m => m.registerCheck.CriticalCategory == input.CriticalCategory || m.registerCheckItem.CriticalCategory == input.CriticalCategory);
query = query.Where(m => m.registerCheck.DiagnosisLevelId == input.DiagnosisLevelId || m.registerCheckItem.DiagnosisLevelId == input.DiagnosisLevelId);
}
#endregion
@ -320,7 +323,7 @@ namespace Shentun.Peis.PhoneFollowUps
CriticalValueContents = string.Join("<br>", s.Where(m => !string.IsNullOrWhiteSpace(m.registerCheck.CriticalValueContent)).Select(ss => ss.registerCheck.CriticalValueContent).Distinct()) + "<br>" + string.Join("<br>", s.Where(m => !string.IsNullOrWhiteSpace(m.registerCheckItem.CriticalValueContent)).Select(ss => ss.registerCheckItem.CriticalValueContent).Distinct()),
IsPhoneComplete = s.Key.IsPhoneComplete,
IsSmsComplete = s.Key.IsSmsComplete,
CriticalCategory = string.Join("<br>", s.Where(m => !string.IsNullOrWhiteSpace(m.registerCheck.CriticalCategory)).Select(ss => ss.registerCheck.CriticalCategory).Distinct()) + "<br>" + string.Join("<br>", s.Where(m => !string.IsNullOrWhiteSpace(m.registerCheckItem.CriticalCategory)).Select(ss => ss.registerCheckItem.CriticalCategory).Distinct()),
DiagnosisLevelNames = string.Join("<br>", s.Where(m => m.registerCheck.DiagnosisLevelId != null).Select(ss => _cacheService.GetDiagnosisLevelNameAsync(ss.registerCheck.DiagnosisLevelId).GetAwaiter().GetResult()).Distinct()) + "<br>" + string.Join("<br>", s.Where(m => m.registerCheckItem.DiagnosisLevelId != null).Select(ss => _cacheService.GetDiagnosisLevelNameAsync(ss.registerCheckItem.DiagnosisLevelId).GetAwaiter().GetResult()).Distinct())
}).ToList();
return entListDto;

6
src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs

@ -197,7 +197,7 @@ namespace Shentun.Peis.RegisterCheckItems
ItemTypeId = s.Item.ItemTypeId,
CriticalValueCreatorName = _cacheService.GetSurnameAsync(s.CriticalValueCreatorId).GetAwaiter().GetResult(),
FollowUpCreatorName = _cacheService.GetSurnameAsync(s.FollowUpCreatorId).GetAwaiter().GetResult(),
CriticalCategory = s.CriticalCategory
DiagnosisLevelId = s.DiagnosisLevelId
}).ToList();
return entdto;
@ -416,7 +416,7 @@ namespace Shentun.Peis.RegisterCheckItems
IsReview = registerCheckItemEnt.registerCheckItem.IsReview == null ? 'N' : registerCheckItemEnt.registerCheckItem.IsReview,
CriticalValueCreatorName = _cacheService.GetSurnameAsync(registerCheckItemEnt.registerCheckItem.CriticalValueCreatorId).GetAwaiter().GetResult(),
FollowUpCreatorName = _cacheService.GetSurnameAsync(registerCheckItemEnt.registerCheckItem.FollowUpCreatorId).GetAwaiter().GetResult(),
CriticalCategory = registerCheckItemEnt.registerCheckItem.CriticalCategory
DiagnosisLevelId = registerCheckItemEnt.registerCheckItem.DiagnosisLevelId
};
return entDto;
@ -471,7 +471,7 @@ namespace Shentun.Peis.RegisterCheckItems
registerCheckItemEnt.FollowUpCreationTime = DateTime.Now;
}
registerCheckItemEnt.CriticalCategory = input.CriticalCategory;
registerCheckItemEnt.DiagnosisLevelId = input.DiagnosisLevelId;
await _registerCheckItemRepository.UpdateAsync(registerCheckItemEnt);

4
src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs

@ -161,7 +161,7 @@ namespace Shentun.Peis.RegisterChecks
CriticalRangeValue = registerCheckEntity.CriticalRangeValue,
CriticalValueCreatorName = _cacheService.GetSurnameAsync(registerCheckEntity.CriticalValueCreatorId).GetAwaiter().GetResult(),
FollowUpCreatorName = _cacheService.GetSurnameAsync(registerCheckEntity.FollowUpCreatorId).GetAwaiter().GetResult(),
CriticalCategory = registerCheckEntity.CriticalCategory
DiagnosisLevelId = registerCheckEntity.DiagnosisLevelId
};
return registerCheckDto;
@ -726,7 +726,7 @@ namespace Shentun.Peis.RegisterChecks
registerCheckEnt.FollowUpCreationTime = DateTime.Now;
}
registerCheckEnt.CriticalCategory = input.CriticalCategory;
registerCheckEnt.DiagnosisLevelId = input.DiagnosisLevelId;
await _registerCheckRepository.UpdateAsync(registerCheckEnt);

34
src/Shentun.Peis.Domain/CacheService.cs

@ -53,6 +53,9 @@ namespace Shentun.Peis
private readonly SysParmValueManager _sysParmValueManager;
private readonly IDistributedCache<DiagnosisLevel, short> _diagnosisLevelCache;
private readonly IRepository<DiagnosisLevel, short> _diagnosisLevelRepository;
private readonly IDistributedCache<string, string> _customerOrgDisplayModeCache;
@ -83,7 +86,9 @@ namespace Shentun.Peis
IDistributedCache<SampleType, Guid> sampleTypeCache,
IRepository<SampleType, Guid> sampleTypeRepository,
SysParmValueManager sysParmValueManager,
IDistributedCache<string, string> customerOrgDisplayModeCache)
IDistributedCache<string, string> customerOrgDisplayModeCache,
IDistributedCache<DiagnosisLevel, short> diagnosisLevelCache,
IRepository<DiagnosisLevel, short> diagnosisLevelRepository)
{
_userCache = userCache;
_userRepository = userRepository;
@ -122,6 +127,8 @@ namespace Shentun.Peis
_sampleTypeRepository = sampleTypeRepository;
_sysParmValueManager = sysParmValueManager;
_customerOrgDisplayModeCache = customerOrgDisplayModeCache;
_diagnosisLevelCache = diagnosisLevelCache;
_diagnosisLevelRepository = diagnosisLevelRepository;
}
private async Task<IdentityUser> GetUserAsync(Guid id)
@ -614,5 +621,30 @@ namespace Shentun.Peis
return entity.DisplayName;
}
/// <summary>
/// 获取诊断级别名称
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<string> GetDiagnosisLevelNameAsync(short? id)
{
if (id != null)
{
var diagnosisLevelEntity = await _diagnosisLevelCache.GetAsync(id.Value);
if (diagnosisLevelEntity == null)
{
diagnosisLevelEntity = await _diagnosisLevelRepository.FirstOrDefaultAsync(f => f.Id == id);
}
return diagnosisLevelEntity.DisplayName;
}
else
{
return "";
}
}
}
}

6
src/Shentun.Peis.Domain/RegisterCheckItems/RegisterCheckItem.cs

@ -145,10 +145,10 @@ namespace Shentun.Peis.Models
public Guid? FollowUpCreatorId { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
[Column("critical_category")]
public string CriticalCategory { get; set; }
[Column("diagnosis_level_id")]
public short? DiagnosisLevelId { get; set; }
/// <summary>
/// 报告单提示

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

@ -181,10 +181,10 @@ namespace Shentun.Peis.Models
public Guid? FollowUpCreatorId { get; set; }
/// <summary>
/// 危急值类别
/// 诊断级别ID
/// </summary>
[Column("critical_category")]
public string CriticalCategory { get; set; }
[Column("diagnosis_level_id")]
public short? DiagnosisLevelId { get; set; }
///// <summary>
///// 危急值处理标志

16226
src/Shentun.Peis.EntityFrameworkCore/Migrations/20241124063252_update_register_check_add_diagnosis_level_id.Designer.cs
File diff suppressed because it is too large
View File

55
src/Shentun.Peis.EntityFrameworkCore/Migrations/20241124063252_update_register_check_add_diagnosis_level_id.cs

@ -0,0 +1,55 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class update_register_check_add_diagnosis_level_id : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "critical_category",
table: "register_check_item");
migrationBuilder.DropColumn(
name: "critical_category",
table: "register_check");
migrationBuilder.AddColumn<short>(
name: "diagnosis_level_id",
table: "register_check_item",
type: "smallint",
nullable: true);
migrationBuilder.AddColumn<short>(
name: "diagnosis_level_id",
table: "register_check",
type: "smallint",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "diagnosis_level_id",
table: "register_check_item");
migrationBuilder.DropColumn(
name: "diagnosis_level_id",
table: "register_check");
migrationBuilder.AddColumn<string>(
name: "critical_category",
table: "register_check_item",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "critical_category",
table: "register_check",
type: "text",
nullable: true);
}
}
}

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

@ -8779,10 +8779,6 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<string>("CriticalCategory")
.HasColumnType("text")
.HasColumnName("critical_category");
b.Property<string>("CriticalRangeValue")
.HasMaxLength(300)
.HasColumnType("character varying(300)")
@ -8816,6 +8812,10 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("critical_value_sms_creator_id");
b.Property<short?>("DiagnosisLevelId")
.HasColumnType("smallint")
.HasColumnName("diagnosis_level_id");
b.Property<Guid?>("ExecOrganizationUnitId")
.HasColumnType("uuid")
.HasColumnName("exec_organization_unit_id");
@ -9187,10 +9187,6 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<string>("CriticalCategory")
.HasColumnType("text")
.HasColumnName("critical_category");
b.Property<string>("CriticalRangeValue")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
@ -9224,6 +9220,10 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("critical_value_sms_creator_id");
b.Property<short?>("DiagnosisLevelId")
.HasColumnType("smallint")
.HasColumnName("diagnosis_level_id");
b.Property<DateTime?>("FollowUpCreationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("follow_up_creation_time");

Loading…
Cancel
Save