From e3e2b325c6283ffdf0cffe1cd1b1859c9ca9c0ee Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Thu, 19 Sep 2024 10:55:29 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=B1=E6=80=A5=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FollowUps/FollowUpDto.cs | 27 +
.../FollowUps/FollowUpIdInputDto.cs | 11 +
.../FollowUps/GetFollowUpListInputDto.cs | 27 +
.../PhoneFollowUps/CreatePhoneFollowUpDto.cs | 31 +
...UpdateRegisterCheckItemCriticalInputDto.cs | 41 +
.../RegisterChecks/RegisterCheckDto.cs | 2 +
.../UpdateRegisterCheckCriticalInputDto.cs | 38 +
.../DiagnosisFunctionAppService.cs | 17 +-
.../FollowUps/FollowUpAppService.cs | 109 +
.../PhoneFollowUps/PhoneFollowUpAppService.cs | 39 +
.../RegisterCheckItemAppService.cs | 72 +-
.../RegisterChecks/RegisterCheckAppService.cs | 68 +-
src/Shentun.Peis.Domain/FollowUps/FollowUp.cs | 11 +
.../FollowUps/FollowUpManager.cs | 58 +
.../PatientRegisters/PatientRegister.cs | 6 +-
.../PhoneFollowUps/PhoneFollowUp.cs | 23 +-
src/Shentun.Peis.Domain/SmsSends/SmsSend.cs | 6 +
.../PhoneFollows/PhoneFollowDbMapping.cs | 2 +-
.../DbMapping/SmsSends/SmsSendDbMapping.cs | 2 +-
...pdate_follow_up_follow_up_date.Designer.cs | 15637 ++++++++++++++++
...9025259_update_follow_up_follow_up_date.cs | 38 +
.../Migrations/PeisDbContextModelSnapshot.cs | 12 +
22 files changed, 16255 insertions(+), 22 deletions(-)
create mode 100644 src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpIdInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/FollowUps/GetFollowUpListInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs
create mode 100644 src/Shentun.Peis.Application/FollowUps/FollowUpAppService.cs
create mode 100644 src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
create mode 100644 src/Shentun.Peis.Domain/FollowUps/FollowUpManager.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.cs
diff --git a/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpDto.cs b/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpDto.cs
new file mode 100644
index 00000000..73f700cb
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpDto.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace Shentun.Peis.FollowUps
+{
+ public class FollowUpDto : AuditedEntityDtoName
+ {
+ ///
+ /// 人员登记ID
+ ///
+ public Guid PatientRegisterId { get; set; }
+
+
+ ///
+ /// 是否短信随访创建完成
+ ///
+ public char IsSmsComplete { get; set; }
+
+ ///
+ /// 是否电话随访创建完成
+ ///
+ public char IsPhoneComplete { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpIdInputDto.cs b/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpIdInputDto.cs
new file mode 100644
index 00000000..f47d5d48
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpIdInputDto.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.FollowUps
+{
+ public class FollowUpIdInputDto
+ {
+ public Guid FollowUpId { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/FollowUps/GetFollowUpListInputDto.cs b/src/Shentun.Peis.Application.Contracts/FollowUps/GetFollowUpListInputDto.cs
new file mode 100644
index 00000000..67401c40
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/FollowUps/GetFollowUpListInputDto.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace Shentun.Peis.FollowUps
+{
+ public class GetFollowUpListInputDto
+ {
+ ///
+ /// 人员登记ID 集合
+ ///
+ public List PatientRegisterIds { get; set; } = new List();
+
+
+ ///
+ /// 是否短信随访创建完成
+ ///
+ public char? IsSmsComplete { get; set; }
+
+ ///
+ /// 是否电话随访创建完成
+ ///
+ public char? IsPhoneComplete { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs b/src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs
new file mode 100644
index 00000000..8487e664
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace Shentun.Peis.PhoneFollowUps
+{
+ public class CreatePhoneFollowUpDto
+ {
+ ///
+ /// 表达式
+ ///
+ public string CornValue { get; set; }
+
+ ///
+ /// 随访主表ID
+ ///
+ public Guid FollowUpId { get; set; }
+
+ ///
+ /// 随访内容
+ ///
+ public string FollowUpContent { get; set; }
+
+ ///
+ /// 回复内容
+ ///
+ public string? ReplyContent { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs
new file mode 100644
index 00000000..41703758
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckItems
+{
+ public class UpdateRegisterCheckItemCriticalInputDto
+ {
+ public Guid RegisterCheckId { get; set; }
+
+ public Guid ItemId { get; set; }
+
+ ///
+ /// 危急值标志 Y N 无需修改时传null
+ ///
+ public char? IsCriticalValue { get; set; }
+
+
+ ///
+ /// 随访值标志 Y N 无需修改时传null
+ ///
+ public char? IsFollowUp { get; set; }
+
+
+ ///
+ /// 危急值医生填写的内容
+ ///
+ public string CriticalValueContent { get; set; }
+
+ ///
+ /// 危急值是否审核 Y N 无需修改时传null
+ ///
+ public char? IsCriticalValueAudit { get; set; }
+
+
+ ///
+ /// 该项目要复查 Y N 无需修改时传null
+ ///
+ public char? IsReview { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs
index 84505c0c..0940ef77 100644
--- a/src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs
@@ -87,5 +87,7 @@ namespace Shentun.Peis.RegisterChecks
///// 检查组合项目记录ID
/////
//public Guid RegisterAsbitemId { get; set; }
+
+ public string AsbitemName { get; set; }
}
}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs
new file mode 100644
index 00000000..e3012416
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterChecks
+{
+ public class UpdateRegisterCheckCriticalInputDto
+ {
+ public Guid RegisterCheckId { get; set; }
+
+
+ ///
+ /// 危急值标志 Y N 无需修改时传null
+ ///
+ public char? IsCriticalValue { get; set; }
+
+ ///
+ /// 随访值标志 Y N 无需修改时传null
+ ///
+ public char? IsFollowUp { get; set; }
+
+ ///
+ /// 危急值医生填写的内容
+ ///
+ public string CriticalValueContent { get; set; }
+
+ ///
+ /// 危急值是否审核 Y N 无需修改时传null
+ ///
+ public char? IsCriticalValueAudit { get; set; }
+
+
+ ///
+ /// 该项目要复查 Y N 无需修改时传null
+ ///
+ public char? IsReview { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs b/src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
index 94780720..b6c38162 100644
--- a/src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
+++ b/src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
@@ -7,8 +7,10 @@ using NPOI.DDF;
using NPOI.POIFS.Properties;
using NUglify.Helpers;
using Shentun.Peis.Enums;
+using Shentun.Peis.FollowUps;
using Shentun.Peis.ItemResultMatchs;
using Shentun.Peis.Models;
+using Shentun.Peis.PatientRegisters;
using Shentun.Peis.RegisterCheckItems;
using Shentun.Peis.Sexs;
using Shentun.Peis.SumDiagnosises;
@@ -62,6 +64,7 @@ namespace Shentun.Peis.DiagnosisFunctions
private readonly IRepository _criticalFollowValueRepository;
private readonly ICurrentUser _currentUser;
private readonly IRepository _followUpRepository;
+ private readonly FollowUpAppService _followUpAppService;
public DiagnosisFunctionAppService(
IRepository patientRegisterRepository,
@@ -81,7 +84,8 @@ namespace Shentun.Peis.DiagnosisFunctions
RegisterCheckItemManager registerCheckItemManager,
IRepository criticalFollowValueRepository,
ICurrentUser currentUser,
- IRepository followUpRepository)
+ IRepository followUpRepository,
+ FollowUpAppService followUpAppService)
{
this._patientRegisterRepository = patientRegisterRepository;
@@ -102,6 +106,7 @@ namespace Shentun.Peis.DiagnosisFunctions
_criticalFollowValueRepository = criticalFollowValueRepository;
_currentUser = currentUser;
_followUpRepository = followUpRepository;
+ _followUpAppService = followUpAppService;
}
@@ -547,7 +552,11 @@ namespace Shentun.Peis.DiagnosisFunctions
if (isCritical || isFollowUp)
{
- await CreateFollowUpAsync(query.First().patientRegister.Id); //标记危急值 生成随访记录
+ //await CreateFollowUpAsync(query.First().patientRegister.Id); //标记危急值 生成随访记录
+ await _followUpAppService.CreateAsync(new PatientRegisterIdInputDto
+ {
+ PatientRegisterId = query.First().patientRegister.Id
+ });
}
#endregion
@@ -1911,7 +1920,7 @@ namespace Shentun.Peis.DiagnosisFunctions
registerCheckItemEnt.CriticalValueCreatorId = _currentUser.Id;
registerCheckItemEnt.CriticalValueCreationTime = DateTime.Now;
registerCheckItemEnt.IsCriticalValueAudit = 'N';
- registerCheckItemEnt.IsReview = isCriticalValue;
+ registerCheckItemEnt.IsReview = 'N';
registerCheckItemEnt.FollowUpFlag = '1';
await _registerCheckItemRepository.UpdateAsync(registerCheckItemEnt);
@@ -1937,7 +1946,7 @@ namespace Shentun.Peis.DiagnosisFunctions
registerCheckEnt.CriticalValueCreatorId = _currentUser.Id;
registerCheckEnt.CriticalValueCreationTime = DateTime.Now;
registerCheckEnt.IsCriticalValueAudit = 'N';
- registerCheckEnt.IsReview = isCriticalValue;
+ registerCheckEnt.IsReview = 'N';
registerCheckEnt.FollowUpFlag = '1';
await _registerCheckRepository.UpdateAsync(registerCheckEnt);
diff --git a/src/Shentun.Peis.Application/FollowUps/FollowUpAppService.cs b/src/Shentun.Peis.Application/FollowUps/FollowUpAppService.cs
new file mode 100644
index 00000000..67de341d
--- /dev/null
+++ b/src/Shentun.Peis.Application/FollowUps/FollowUpAppService.cs
@@ -0,0 +1,109 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Shentun.Peis.Models;
+using Shentun.Peis.PatientRegisters;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Repositories;
+
+namespace Shentun.Peis.FollowUps
+{
+ ///
+ /// 随访主表
+ ///
+ [ApiExplorerSettings(GroupName = "Work")]
+ [Authorize]
+ public class FollowUpAppService : ApplicationService
+ {
+ private readonly IRepository _followUpRepository;
+ private readonly CacheService _cacheService;
+ private readonly FollowUpManager _followUpManager;
+ public FollowUpAppService(
+ IRepository followUpRepository,
+ CacheService cacheService,
+ FollowUpManager followUpManager
+ )
+ {
+ _followUpRepository = followUpRepository;
+ _cacheService = cacheService;
+ _followUpManager = followUpManager;
+ }
+
+ ///
+ /// 生成危急值标记、随访记录
+ ///
+ ///
+ ///
+ [HttpPost("api/app/FollowUp/Create")]
+ public async Task CreateAsync(PatientRegisterIdInputDto input)
+ {
+ var isFollowUp = await _followUpRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId);
+ if (isFollowUp == null)
+ {
+ var followUpEnt = new FollowUp
+ {
+ IsPhoneComplete = 'N',
+ IsSmsComplete = 'N',
+ PatientRegisterId = input.PatientRegisterId
+ };
+
+ await _followUpRepository.InsertAsync(followUpEnt);
+ }
+ }
+
+ ///
+ /// 获取随访主表记录 可根据人员跟状态筛选
+ ///
+ ///
+ ///
+ [HttpPost("api/app/FollowUp/GetList")]
+ public async Task> GetListAsync(GetFollowUpListInputDto input)
+ {
+ var query = await _followUpRepository.GetQueryableAsync();
+ if (input.PatientRegisterIds.Any())
+ {
+ query = query.Where(m => input.PatientRegisterIds.Contains(m.PatientRegisterId));
+ }
+ if (input.IsPhoneComplete != null)
+ {
+ query = query.Where(m => m.IsPhoneComplete == input.IsPhoneComplete);
+ }
+
+ if (input.IsSmsComplete != null)
+ {
+ query = query.Where(m => m.IsSmsComplete == input.IsSmsComplete);
+ }
+
+ var entListDto = query.ToList().Select(s => new FollowUpDto
+ {
+ CreationTime = s.CreationTime,
+ CreatorId = s.CreatorId,
+ Id = s.Id,
+ IsPhoneComplete = s.IsPhoneComplete,
+ IsSmsComplete = s.IsSmsComplete,
+ LastModificationTime = s.LastModificationTime,
+ LastModifierId = s.LastModifierId,
+ PatientRegisterId = s.PatientRegisterId,
+ CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).GetAwaiter().GetResult(),
+ LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).GetAwaiter().GetResult()
+ }).ToList();
+
+ return entListDto;
+ }
+
+ ///
+ /// 删除记录
+ ///
+ ///
+ ///
+ [HttpPost("api/app/FollowUp/Delete")]
+ public async Task DeleteAsync(FollowUpIdInputDto input)
+ {
+ await _followUpManager.CheckAndDeleteAsync(input.FollowUpId);
+ }
+ }
+}
diff --git a/src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs b/src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
new file mode 100644
index 00000000..10fee823
--- /dev/null
+++ b/src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
@@ -0,0 +1,39 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Shentun.Peis.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Repositories;
+
+namespace Shentun.Peis.PhoneFollowUps
+{
+ ///
+ /// 电话随访记录
+ ///
+ [ApiExplorerSettings(GroupName = "Work")]
+ [Authorize]
+ public class PhoneFollowUpAppService : ApplicationService
+ {
+ private readonly IRepository _phoneFollowUpRepository;
+
+ public PhoneFollowUpAppService(IRepository phoneFollowUpRepository)
+ {
+ _phoneFollowUpRepository = phoneFollowUpRepository;
+ }
+
+
+ /////
+ ///// 创建电话随访记录
+ /////
+ /////
+ /////
+ //public async Task CreateAsync(CreatePhoneFollowUpDto input)
+ //{
+
+ //}
+ }
+}
diff --git a/src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs b/src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs
index 94f88089..d32e745e 100644
--- a/src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs
+++ b/src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.Enums;
+using Shentun.Peis.FollowUps;
using Shentun.Peis.GuideTypes;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
@@ -18,6 +19,7 @@ using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Users;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace Shentun.Peis.RegisterCheckItems
{
@@ -39,6 +41,8 @@ namespace Shentun.Peis.RegisterCheckItems
private readonly IRepository _registerCheckAsbitemRepository;
private readonly IRepository _asbitemDetailRepository;
private readonly CacheService _cacheService;
+ private readonly ICurrentUser _currentUser;
+ private readonly FollowUpAppService _followUpAppService;
public RegisterCheckItemAppService(
IRepository registerCheckItemRepository,
IRepository userRepository,
@@ -50,7 +54,9 @@ namespace Shentun.Peis.RegisterCheckItems
CacheService cacheService,
IRepository registerCheckRepository,
IRepository registerCheckAsbitemRepository,
- IRepository asbitemDetailRepository)
+ IRepository asbitemDetailRepository,
+ ICurrentUser currentUser,
+ FollowUpAppService followUpAppService)
{
this._registerCheckItemRepository = registerCheckItemRepository;
this._userRepository = userRepository;
@@ -63,6 +69,8 @@ namespace Shentun.Peis.RegisterCheckItems
_registerCheckRepository = registerCheckRepository;
_registerCheckAsbitemRepository = registerCheckAsbitemRepository;
_asbitemDetailRepository = asbitemDetailRepository;
+ _currentUser = currentUser;
+ _followUpAppService = followUpAppService;
}
///
@@ -299,6 +307,7 @@ namespace Shentun.Peis.RegisterCheckItems
///
///
[HttpPost("api/app/RegisterCheckItem/TempHandRegisterCheckItem")]
+ [RemoteService(false)]
public async Task TempHandRegisterCheckItemAsync(Guid AsbitemId)
{
var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
@@ -347,5 +356,66 @@ namespace Shentun.Peis.RegisterCheckItems
}
+
+ ///
+ /// 修改明细表危急值相关内容
+ ///
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheckItem/UpdateRegisterCheckItemCritical")]
+ public async Task UpdateRegisterCheckItemCriticalAsync(UpdateRegisterCheckItemCriticalInputDto input)
+ {
+ var registerCheckItemEnt = await _registerCheckItemRepository.FirstOrDefaultAsync(f => f.RegisterCheckId == input.RegisterCheckId && f.ItemId == input.ItemId);
+ if (registerCheckItemEnt == null)
+ {
+ throw new UserFriendlyException("参数不正确");
+ }
+
+ if (input.IsCriticalValue != null)
+ {
+ registerCheckItemEnt.IsCriticalValue = input.IsCriticalValue;
+ }
+ if (input.IsCriticalValueAudit != null)
+ {
+ registerCheckItemEnt.IsCriticalValueAudit = input.IsCriticalValueAudit;
+ }
+ if (input.IsReview != null)
+ {
+ registerCheckItemEnt.IsReview = input.IsReview;
+ }
+ if (!string.IsNullOrWhiteSpace(input.CriticalValueContent))
+ {
+ registerCheckItemEnt.CriticalValueContent = input.CriticalValueContent;
+ }
+
+ if (input.IsFollowUp != null && input.IsFollowUp == 'Y')
+ {
+ registerCheckItemEnt.FollowUpFlag = '1';
+ }
+
+
+ if (registerCheckItemEnt.CriticalValueCreatorId == null)
+ {
+ registerCheckItemEnt.CriticalValueCreatorId = _currentUser.Id;
+ registerCheckItemEnt.CriticalValueCreationTime = DateTime.Now;
+ }
+
+ await _registerCheckItemRepository.UpdateAsync(registerCheckItemEnt);
+
+ if ((input.IsFollowUp != null && input.IsFollowUp == 'Y')
+ || (input.IsCriticalValue != null && input.IsCriticalValue == 'Y'))
+ {
+ var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(f => f.Id == input.RegisterCheckId);
+ if (registerCheckEnt != null)
+ {
+ //增加随访表记录
+ await _followUpAppService.CreateAsync(new PatientRegisterIdInputDto
+ {
+ PatientRegisterId = registerCheckEnt.PatientRegisterId
+ });
+ }
+ }
+
+ }
}
}
diff --git a/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs b/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
index 1a382f37..e2acc184 100644
--- a/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
+++ b/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Configuration;
using Org.BouncyCastle.Asn1.Ocsp;
using Shentun.Peis.Asbitems;
using Shentun.Peis.Enums;
+using Shentun.Peis.FollowUps;
using Shentun.Peis.MenuInfos;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
@@ -55,6 +56,7 @@ namespace Shentun.Peis.RegisterChecks
private readonly IRepository _userItemTypeRepository;
private readonly IRepository _asbitemRepository;
private readonly IRepository _lisRequestRepository;
+ private readonly FollowUpAppService _followUpAppService;
public RegisterCheckAppService(IRepository registerCheckRepository,
IRepository registerCheckItemRepository,
@@ -73,7 +75,8 @@ namespace Shentun.Peis.RegisterChecks
IRepository asbitemRepository,
IRepository registerCheckAsbitemRepository,
IRepository itemTypeRepository,
- IRepository lisRequestRepository)
+ IRepository lisRequestRepository,
+ FollowUpAppService followUpAppService)
{
_registerCheckRepository = registerCheckRepository;
_userRepository = userRepository;
@@ -93,6 +96,7 @@ namespace Shentun.Peis.RegisterChecks
_registerCheckAsbitemRepository = registerCheckAsbitemRepository;
_itemTypeRepository = itemTypeRepository;
_lisRequestRepository = lisRequestRepository;
+ _followUpAppService = followUpAppService;
}
///
@@ -105,6 +109,7 @@ namespace Shentun.Peis.RegisterChecks
{
var registerCheckEntity = (await _registerCheckRepository.GetQueryableAsync())
.Include(x => x.RegisterCheckAsbitems)
+ .ThenInclude(x => x.Asbitem)
.FirstOrDefault(f => f.Id == id);
var registerCheckDto = new RegisterCheckDto
@@ -133,7 +138,8 @@ namespace Shentun.Peis.RegisterChecks
ThirdInfo = registerCheckEntity.ThirdInfo,
LastModifierName = _cacheService.GetSurnameAsync(registerCheckEntity.LastModifierId).Result,
CreatorName = _cacheService.GetSurnameAsync(registerCheckEntity.CreatorId).Result,
- IsCharge = registerCheckEntity.RegisterCheckAsbitems.Where(m => m.PayTypeFlag == PayTypeFlag.PersonPay && m.IsCharge == 'N').Count() > 0 ? 'N' : 'Y'
+ IsCharge = registerCheckEntity.RegisterCheckAsbitems.Where(m => m.PayTypeFlag == PayTypeFlag.PersonPay && m.IsCharge == 'N').Count() > 0 ? 'N' : 'Y',
+ AsbitemName = string.Join(",", registerCheckEntity.RegisterCheckAsbitems.Select(rs => rs.Asbitem.DisplayName).ToList())
};
return registerCheckDto;
@@ -625,6 +631,64 @@ namespace Shentun.Peis.RegisterChecks
}
}
}
+
+
+ ///
+ /// 修改检查表危急值相关内容
+ ///
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheck/UpdateRegisterCheckCritical")]
+ public async Task UpdateRegisterCheckCriticalAsync(UpdateRegisterCheckCriticalInputDto input)
+ {
+ var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(f => f.Id == input.RegisterCheckId);
+ if (registerCheckEnt == null)
+ {
+ throw new UserFriendlyException("参数不正确");
+ }
+
+ if (input.IsCriticalValue != null)
+ {
+ registerCheckEnt.IsCriticalValue = input.IsCriticalValue;
+ }
+ if (input.IsCriticalValueAudit != null)
+ {
+ registerCheckEnt.IsCriticalValueAudit = input.IsCriticalValueAudit;
+ }
+ if (input.IsReview != null)
+ {
+ registerCheckEnt.IsReview = input.IsReview;
+ }
+ if (!string.IsNullOrWhiteSpace(input.CriticalValueContent))
+ {
+ registerCheckEnt.CriticalValueContent = input.CriticalValueContent;
+ }
+
+ if (input.IsFollowUp != null && input.IsFollowUp == 'Y')
+ {
+ registerCheckEnt.FollowUpFlag = '1';
+ }
+
+ if (registerCheckEnt.CriticalValueCreatorId == null)
+ {
+ registerCheckEnt.CriticalValueCreatorId = _currentUser.Id;
+ registerCheckEnt.CriticalValueCreationTime = DateTime.Now;
+ }
+
+ await _registerCheckRepository.UpdateAsync(registerCheckEnt);
+
+ if ((input.IsFollowUp != null && input.IsFollowUp == 'Y')
+ || (input.IsCriticalValue != null && input.IsCriticalValue == 'Y'))
+ {
+
+ //增加随访表记录
+ await _followUpAppService.CreateAsync(new PatientRegisterIdInputDto
+ {
+ PatientRegisterId = registerCheckEnt.PatientRegisterId
+ });
+
+ }
+ }
}
diff --git a/src/Shentun.Peis.Domain/FollowUps/FollowUp.cs b/src/Shentun.Peis.Domain/FollowUps/FollowUp.cs
index 7e8a2320..efc2561a 100644
--- a/src/Shentun.Peis.Domain/FollowUps/FollowUp.cs
+++ b/src/Shentun.Peis.Domain/FollowUps/FollowUp.cs
@@ -16,6 +16,12 @@ namespace Shentun.Peis.Models
[Table("follow_up")]
public class FollowUp : AuditedEntity, IHasConcurrencyStamp
{
+ public FollowUp()
+ {
+ PhoneFollowUps = new HashSet();
+ }
+
+
///
/// 登记流水号
///
@@ -40,6 +46,11 @@ namespace Shentun.Peis.Models
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }
+
+ [InverseProperty(nameof(PhoneFollowUp.FollowUp))]
+ public virtual ICollection PhoneFollowUps { get; set; }
+
+
}
diff --git a/src/Shentun.Peis.Domain/FollowUps/FollowUpManager.cs b/src/Shentun.Peis.Domain/FollowUps/FollowUpManager.cs
new file mode 100644
index 00000000..28ea25cf
--- /dev/null
+++ b/src/Shentun.Peis.Domain/FollowUps/FollowUpManager.cs
@@ -0,0 +1,58 @@
+using Shentun.Peis.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.Domain.Repositories;
+using Volo.Abp.Domain.Services;
+
+namespace Shentun.Peis.FollowUps
+{
+ ///
+ /// 随访主表
+ ///
+ public class FollowUpManager : DomainService
+ {
+ private readonly IRepository _followUpRepository;
+ private readonly IRepository _phoneFollowUpRepository;
+ private readonly IRepository _smsSendRepository;
+ public FollowUpManager(
+ IRepository followUpRepository,
+ IRepository phoneFollowUpRepository,
+ IRepository smsSendRepository
+ )
+ {
+ _followUpRepository = followUpRepository;
+ _phoneFollowUpRepository = phoneFollowUpRepository;
+ _smsSendRepository = smsSendRepository;
+ }
+
+
+ ///
+ /// 删除
+ ///
+ ///
+ ///
+ ///
+ public async Task CheckAndDeleteAsync(Guid id)
+ {
+
+ var phoneFollowUpEnt = await _phoneFollowUpRepository.FirstOrDefaultAsync(m => m.FollowUpId == id);
+ if (phoneFollowUpEnt != null)
+ {
+ throw new UserFriendlyException($"已创建电话随访记录,不能删除");
+ }
+
+ var smsSendEnt = await _smsSendRepository.FirstOrDefaultAsync(m => m.FollowUpId == id);
+ if (smsSendEnt != null)
+ {
+ throw new UserFriendlyException($"已创建短信随访记录,不能删除");
+ }
+
+ await _followUpRepository.DeleteAsync(id);
+
+ }
+ }
+}
diff --git a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
index b7b10f43..17dcb2bf 100644
--- a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
+++ b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
@@ -26,7 +26,6 @@ namespace Shentun.Peis.Models
PatientOccupationalHistories = new HashSet();
PatientPoisons = new HashSet();
PatientSymptoms = new HashSet();
- PhoneFollows = new HashSet();
QueueRegisters = new HashSet();
RegisterCheckAsbitems = new HashSet();
SumDiagnoses = new HashSet();
@@ -43,7 +42,6 @@ namespace Shentun.Peis.Models
PatientOccupationalHistories = new HashSet();
PatientPoisons = new HashSet();
PatientSymptoms = new HashSet();
- PhoneFollows = new HashSet();
QueueRegisters = new HashSet();
RegisterCheckAsbitems = new HashSet();
SumDiagnoses = new HashSet();
@@ -348,8 +346,8 @@ namespace Shentun.Peis.Models
public virtual ICollection PatientPoisons { get; set; }
[InverseProperty(nameof(PatientSymptom.PatientRegister))]
public virtual ICollection PatientSymptoms { get; set; }
- [InverseProperty(nameof(PhoneFollowUp.PatientRegister))]
- public virtual ICollection PhoneFollows { get; set; }
+ //[InverseProperty(nameof(PhoneFollowUp.PatientRegister))]
+ //public virtual ICollection PhoneFollows { get; set; }
[InverseProperty(nameof(QueueRegister.PatientRegister))]
public virtual ICollection QueueRegisters { get; set; }
[InverseProperty(nameof(RegisterCheckAsbitem.PatientRegister))]
diff --git a/src/Shentun.Peis.Domain/PhoneFollowUps/PhoneFollowUp.cs b/src/Shentun.Peis.Domain/PhoneFollowUps/PhoneFollowUp.cs
index 85991fc1..d72d6b52 100644
--- a/src/Shentun.Peis.Domain/PhoneFollowUps/PhoneFollowUp.cs
+++ b/src/Shentun.Peis.Domain/PhoneFollowUps/PhoneFollowUp.cs
@@ -14,11 +14,11 @@ namespace Shentun.Peis.Models
[Table("phone_follow_up")]
public class PhoneFollowUp : AuditedEntity, IHasConcurrencyStamp
{
- ///
- /// 病人登记ID
- ///
- [Column("patient_register_id")]
- public Guid PatientRegisterId { get; set; }
+ /////
+ ///// 病人登记ID
+ /////
+ //[Column("patient_register_id")]
+ //public Guid PatientRegisterId { get; set; }
///
/// 随访内容
///
@@ -42,8 +42,13 @@ namespace Shentun.Peis.Models
/// 随访ID
///
[Column("follow_up_id")]
- public Guid? FollowUpId { get; set; }
+ public Guid FollowUpId { get; set; }
+ ///
+ /// 随访日期
+ ///
+ [Column("follow_up_date")]
+ public DateTime FollowUpDate { get; set; }
///
/// 是否完成
@@ -69,9 +74,9 @@ namespace Shentun.Peis.Models
//[StringLength(40)]
//public string ConcurrencyStamp { get; set; } = null!;
- [ForeignKey(nameof(PatientRegisterId))]
- [InverseProperty("PhoneFollows")]
- public virtual PatientRegister PatientRegister { get; set; } = null!;
+ [ForeignKey(nameof(FollowUpId))]
+ [InverseProperty("PhoneFollowUps")]
+ public virtual FollowUp FollowUp { get; set; } = null!;
//public override object[] GetKeys()
//{
diff --git a/src/Shentun.Peis.Domain/SmsSends/SmsSend.cs b/src/Shentun.Peis.Domain/SmsSends/SmsSend.cs
index 396ccc2b..aedd4e51 100644
--- a/src/Shentun.Peis.Domain/SmsSends/SmsSend.cs
+++ b/src/Shentun.Peis.Domain/SmsSends/SmsSend.cs
@@ -63,6 +63,12 @@ namespace Shentun.Peis.Models
[MaxLength(1)]
public char IsComplete { get; set; }
+ ///
+ /// 短信推送时间
+ ///
+ [Column("send_date")]
+ public DateTime? SendDate { get; set; }
+
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }
diff --git a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs
index 38960469..02a2ac09 100644
--- a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs
+++ b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs
@@ -23,7 +23,7 @@ namespace Shentun.Peis.DbMapping
entity.Property(e => e.Id).ValueGeneratedNever().IsRequired();
- //entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
+ entity.Property(e => e.FollowUpDate).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
//entity.Property(e => e.LastModificationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
diff --git a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/SmsSends/SmsSendDbMapping.cs b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/SmsSends/SmsSendDbMapping.cs
index 20a60fe9..b3fbe92f 100644
--- a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/SmsSends/SmsSendDbMapping.cs
+++ b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/SmsSends/SmsSendDbMapping.cs
@@ -22,7 +22,7 @@ namespace Shentun.Peis.DbMapping
entity.Property(t => t.MobileTelephone).HasComment("手机号").IsRequired();
entity.Property(t => t.Content).HasComment("短信内容").IsRequired();
entity.Property(t => t.IsComplete).HasComment("是否完成").IsRequired().HasDefaultValueSql("'N'");
-
+ entity.Property(e => e.SendDate).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.Property(e => e.Id).ValueGeneratedNever();
entity.Property(e => e.SmsTypeId).IsFixedLength();
diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs
new file mode 100644
index 00000000..7763320a
--- /dev/null
+++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs
@@ -0,0 +1,15637 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Shentun.Peis.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace Shentun.Peis.Migrations
+{
+ [DbContext(typeof(PeisDbContext))]
+ [Migration("20240919025259_update_follow_up_follow_up_date")]
+ partial class update_follow_up_follow_up_date
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
+ .HasAnnotation("ProductVersion", "6.0.5")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Shentun.Peis.Books.HelloA", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("ADesc")
+ .HasColumnType("text")
+ .HasColumnName("a_desc");
+
+ b.Property("AName")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text")
+ .HasDefaultValue("默认值")
+ .HasColumnName("a_name");
+
+ b.Property("AddTime")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("add_time")
+ .HasDefaultValueSql("now()");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("HelloTypeId")
+ .HasColumnType("text")
+ .HasColumnName("hello_type_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("S2")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasDefaultValueSql("'A'::bpchar");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "AName" }, "ix_helloa")
+ .IsUnique();
+
+ b.ToTable("hello_a");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.HelloType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("TypeName")
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)")
+ .HasColumnName("type_name")
+ .HasComment("类型名称");
+
+ b.Property("s1")
+ .HasColumnType("uuid")
+ .HasColumnName("s1");
+
+ b.Property("s2")
+ .HasColumnType("uuid")
+ .HasColumnName("s2");
+
+ b.Property("s3")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("s3");
+
+ b.HasKey("Id");
+
+ b.ToTable("hello_type");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Ma", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.ToTable("ma");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Mb", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MaId")
+ .HasColumnType("text")
+ .HasColumnName("ma_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MaId");
+
+ b.ToTable("mb");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Mc", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MbId")
+ .HasColumnType("text")
+ .HasColumnName("mb_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MbId");
+
+ b.ToTable("mc");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Student", b =>
+ {
+ b.Property("Sid")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("sid");
+
+ b.Property("Cid")
+ .HasColumnType("text");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Uid")
+ .HasColumnType("uuid");
+
+ b.HasKey("Sid");
+
+ b.ToTable("student");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestA", b =>
+ {
+ b.Property("AId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("AName")
+ .HasColumnType("text");
+
+ b.HasKey("AId");
+
+ b.ToTable("testa");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestB", b =>
+ {
+ b.Property("BId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AId")
+ .HasColumnType("uuid")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("AName")
+ .HasColumnType("text");
+
+ b.Property("TestAsAId")
+ .HasColumnType("uuid");
+
+ b.HasKey("BId");
+
+ b.HasIndex("TestAsAId");
+
+ b.ToTable("testb");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestCT", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("TName")
+ .HasColumnType("text")
+ .HasColumnName("t_name");
+
+ b.HasKey("Id");
+
+ b.ToTable("test_ct");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AbpUserDepartment", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.Property("OrganizationUnitId")
+ .HasColumnType("uuid")
+ .HasColumnName("organization_unit_id");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("UserId", "OrganizationUnitId")
+ .HasName("pk_user_organizationunitid");
+
+ b.ToTable("abp_user_department");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("BarcodeMode")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("barcode_mode")
+ .HasDefaultValueSql("'0'")
+ .HasComment("条码模式");
+
+ b.Property("ClinicalMeaning")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)")
+ .HasColumnName("clinical_meaning")
+ .HasComment("临床意义");
+
+ b.Property("CollectItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("collect_item_type_id")
+ .IsFixedLength()
+ .HasComment("汇总项目类别");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("CriticalValueFunction")
+ .HasColumnType("text")
+ .HasColumnName("critical_value_function")
+ .HasComment("危急值函数");
+
+ b.Property("DefaultResult")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)")
+ .HasColumnName("default_result")
+ .HasComment("默认结果");
+
+ b.Property("DeviceTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("device_type_id")
+ .HasComment("仪器类别");
+
+ b.Property("DiagnosisFunction")
+ .HasMaxLength(4000)
+ .HasColumnType("character varying(4000)")
+ .HasColumnName("diagnosis_function")
+ .HasComment("诊断函数");
+
+ b.Property("DiseaseScreeningTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("disease_screening_type_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("FollowUpFunction")
+ .HasColumnType("text")
+ .HasColumnName("follow_up_function")
+ .HasComment("随访函数");
+
+ b.Property("ForPregnantFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_pregnant_flag")
+ .HasDefaultValueSql("'A'")
+ .HasComment("备怀孕期间禁止检查");
+
+ b.Property("ForSexId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_sex_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用性别,M-男,F-女,A-全部");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_active")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是启用");
+
+ b.Property("IsBeforeEat")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_before_eat")
+ .HasDefaultValueSql("'N'")
+ .HasComment("餐前项目");
+
+ b.Property("IsCheck")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_check")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是检查项目");
+
+ b.Property("IsContinueProcess")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_continue_process")
+ .HasDefaultValueSql("'N'")
+ .HasComment("诊断函数处理完毕后继续处理");
+
+ b.Property("IsCriticalValueFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_critical_value_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否启用危急值函数");
+
+ b.Property("IsDiagnosisFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_diagnosis_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("启用诊断函数");
+
+ b.Property("IsFollowUpFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_follow_up_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否启用随访函数");
+
+ b.Property("IsItemResultMerger")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_item_result_merger")
+ .HasDefaultValueSql("'N'")
+ .HasComment("项目结果合并");
+
+ b.Property("IsPictureRotate")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_picture_rotate")
+ .HasDefaultValueSql("'N'")
+ .HasComment("体检报告图片旋转90°");
+
+ b.Property("IsPrivacy")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasColumnName("is_privacy")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否隐私项目");
+
+ b.Property("IsWebAppoint")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_web_appoint")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是否支持网上预约");
+
+ b.Property("ItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_type_id")
+ .IsFixedLength()
+ .HasComment("项目类别");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MaritalStatusId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("marital_status_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用婚姻状况,0-未婚,1-已婚,A-全部");
+
+ b.Property("Price")
+ .ValueGeneratedOnAdd()
+ .HasPrecision(8, 2)
+ .HasColumnType("numeric(8,2)")
+ .HasColumnName("price")
+ .HasDefaultValueSql("0")
+ .HasComment("价格");
+
+ b.Property("QueueTime")
+ .ValueGeneratedOnAdd()
+ .HasPrecision(3, 1)
+ .HasColumnType("numeric(3,1)")
+ .HasColumnName("queue_time")
+ .HasDefaultValueSql("0")
+ .HasComment("候诊时间");
+
+ b.Property("ShortName")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("short_name")
+ .HasComment("简称");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)")
+ .HasColumnName("simple_code");
+
+ b.Property("Warn")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)")
+ .HasColumnName("warn");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CollectItemTypeId");
+
+ b.HasIndex("ItemTypeId");
+
+ b.HasIndex(new[] { "DisplayName" }, "ix_asbitem")
+ .IsUnique();
+
+ b.ToTable("asbitem");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemDetail", b =>
+ {
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength();
+
+ b.Property("ItemId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_id")
+ .IsFixedLength()
+ .HasComment("项目编码");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.HasKey("AsbitemId", "ItemId")
+ .HasName("pk_department_asbitem_detail");
+
+ b.HasIndex("ItemId");
+
+ b.ToTable("asbitem_detail");
+
+ b.HasComment("组合项目包含项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemGuide", b =>
+ {
+ b.Property("MedicalCenterId")
+ .HasColumnType("uuid")
+ .HasColumnName("medical_center_id")
+ .IsFixedLength()
+ .HasComment("单位科室ID");
+
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength()
+ .HasComment("组合项目ID");
+
+ b.Property("ForSexId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_sex_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用性别ID");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Guide")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("guide")
+ .HasComment("指引单内容");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("MedicalCenterId", "AsbitemId", "ForSexId")
+ .HasName("pk_department_asbitem_guide");
+
+ b.ToTable("asbitem_guide");
+
+ b.HasComment("体检中心组和项目指引内容");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemPriceItem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("Amount")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasColumnType("smallint")
+ .HasColumnName("amount")
+ .HasDefaultValueSql("0")
+ .HasComment("数量");
+
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength()
+ .HasComment("组合项目编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("PriceItemId")
+ .HasColumnType("uuid")
+ .HasColumnName("price_item_id")
+ .IsFixedLength()
+ .HasComment("价表项目编码");
+
+ b.HasKey("Id");
+
+ b.ToTable("asbitem_price_item");
+
+ b.HasComment("组和项目包含价表项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultConclusion", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTemplateId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_template_id")
+ .IsFixedLength();
+
+ b.Property("Conclusion")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)")
+ .HasColumnName("conclusion")
+ .HasComment("结论");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTemplateId");
+
+ b.ToTable("bigtext_result_conclusion");
+
+ b.HasComment("大文本结果结论");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultDescription", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTemplateId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_template_id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Description")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)")
+ .HasColumnName("description")
+ .HasComment("描述");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTemplateId");
+
+ b.ToTable("bigtext_result_description");
+
+ b.HasComment("大文本结果描述");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultTemplate", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_type_id")
+ .IsFixedLength()
+ .HasComment("结果类别编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTypeId");
+
+ b.ToTable("bigtext_result_template");
+
+ b.HasComment("大文本结果模板");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("ItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_type_id")
+ .IsFixedLength()
+ .HasComment("项目类别");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("ParentId")
+ .HasColumnType("uuid")
+ .HasColumnName("parent_id")
+ .IsFixedLength()
+ .HasComment("父编号");
+
+ b.Property("PathCode")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("path_code")
+ .HasComment("路径编码");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ItemTypeId");
+
+ b.ToTable("bigtext_result_type");
+
+ b.HasComment("大文本结果类别");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BirthPlace", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CountryCode")
+ .IsRequired()
+ .HasMaxLength(6)
+ .HasColumnType("character varying(6)")
+ .HasColumnName("country_code")
+ .HasComment("国家标准码");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("display_name");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "DisplayName" }, "ix_birth_place")
+ .IsUnique();
+
+ b.ToTable("birth_place");
+
+ b.HasComment("出生地");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardBill", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("编号");
+
+ b.Property("BillFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("bill_flag")
+ .HasDefaultValueSql("'0'::bpchar")
+ .HasComment("记账标志");
+
+ b.Property("BillMoney")
+ .HasPrecision(10, 2)
+ .HasColumnType("numeric(10,2)")
+ .HasColumnName("bill_money")
+ .HasComment("记账金额");
+
+ b.Property("CardRegisterId")
+ .HasColumnType("uuid")
+ .HasColumnName("card_register_id")
+ .HasComment("卡登记编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("PayModeId")
+ .IsRequired()
+ .HasMaxLength(4)
+ .HasColumnType("character varying(4)")
+ .HasColumnName("pay_mode_id")
+ .HasComment("支付方式");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CardRegisterId");
+
+ b.HasIndex("PayModeId");
+
+ b.ToTable("card_bill");
+
+ b.HasComment("卡记账记录");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardRegister", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("编号");
+
+ b.Property("CardBalance")
+ .HasPrecision(10, 2)
+ .HasColumnType("numeric(10,2)")
+ .HasColumnName("card_balance");
+
+ b.Property("CardNo")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)")
+ .HasColumnName("card_no")
+ .HasComment("卡号");
+
+ b.Property("CardPassword")
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)")
+ .HasColumnName("card_password");
+
+ b.Property("CardTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("card_type_id")
+ .IsFixedLength()
+ .HasComment("卡类型");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("CustomerName")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("customer_name")
+ .HasComment("领用者");
+
+ b.Property("Discount")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("discount")
+ .HasDefaultValueSql("100")
+ .HasComment("折扣");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("expiry_date")
+ .HasComment("有效期");
+
+ b.Property("IdNo")
+ .IsRequired()
+ .HasMaxLength(18)
+ .HasColumnType("character varying(18)")
+ .HasColumnName("id_no")
+ .HasComment("身份证号");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_active")
+ .HasDefaultValueSql("0")
+ .HasComment("使用标志");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MedicalCenterId")
+ .HasColumnType("uuid")
+ .HasColumnName("medical_center_id");
+
+ b.Property("MobileTelephone")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("mobile_telephone")
+ .HasComment("手机");
+
+ b.Property("Remark")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("remark")
+ .HasComment("备注");
+
+ b.Property("Telephone")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("telephone")
+ .HasComment("电话");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CardTypeId");
+
+ b.HasIndex(new[] { "CardNo", "IsActive" }, "ix_card_register")
+ .IsUnique();
+
+ b.ToTable("card_register");
+
+ b.HasComment("会员卡登记");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("CardModeId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("card_mode_id")
+ .HasDefaultValueSql("0")
+ .HasComment("卡模式");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Discount")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("discount")
+ .HasDefaultValueSql("100")
+ .HasComment("折扣");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999")
+ .HasComment("显示顺序");
+
+ b.Property("ExpiryDay")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("expiry_day")
+ .HasDefaultValueSql("3650")
+ .HasComment("有效期");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("Remark")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("remark")
+ .HasComment("备注");
+
+ b.HasKey("Id");
+
+ b.ToTable("card_type");
+
+ b.HasComment("会员卡类别");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.Charge", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("收据号");
+
+ b.Property("ChargeFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("charge_flag")
+ .HasDefaultValueSql("0");
+
+ b.Property