From b8d494ae05bb945ec742457dd778a8aad22814fd Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Tue, 23 Apr 2024 21:17:54 +0800 Subject: [PATCH] 333 --- .../BaseDataHandleAppService.cs | 952 +- src/Shentun.Peis.Domain/ImageHelper.cs | 85 +- .../RegisterCheckSummary.cs | 2 +- .../SumSuggestionContent.cs | 2 +- .../SumSummaryContents/SumSummaryContent.cs | 2 +- .../20240423075634_init20240423.Designer.cs | 13788 ++++++++++++++++ .../Migrations/20240423075634_init20240423.cs | 139 + .../Migrations/PeisDbContextModelSnapshot.cs | 14 +- .../BaseDataHandleTest.cs | 50 +- .../PeisEntityFrameworkCoreTestModule.cs | 4 +- 10 files changed, 15001 insertions(+), 37 deletions(-) create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.Designer.cs create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.cs diff --git a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs index 1f842f9..a872ea1 100644 --- a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs +++ b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs @@ -7,23 +7,28 @@ using Microsoft.Extensions.DependencyModel; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NPOI.DDF; +using NUglify.Helpers; using Shentun.Peis.CustomerOrgs; using Shentun.Peis.Enums; using Shentun.Peis.ItemTypes; using Shentun.Peis.Models; using Shentun.Peis.MyUser; +using Shentun.Peis.RegisterCheckItems; using Shentun.Peis.Sexs; using Shentun.Utilities; using SqlSugar; using System; using System.Collections.Generic; using System.Data; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Loader; +using System.Text; using System.Threading; using System.Threading.Tasks; +using TencentCloud.Mrs.V20200910.Models; using TencentCloud.Sqlserver.V20180328.Models; using Volo.Abp; using Volo.Abp.Application.Services; @@ -52,7 +57,7 @@ namespace Shentun.Peis.DataMigrations private readonly SqlSugarClient PgDb = new SqlSugarClient(new ConnectionConfig() { - ConnectionString = "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123;", + ConnectionString = "Host=10.1.12.140;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;", DbType = SqlSugar.DbType.PostgreSQL, IsAutoCloseConnection = true }); @@ -68,8 +73,8 @@ namespace Shentun.Peis.DataMigrations private readonly char defaultMedicalReportTypeId = '0'; //默认体检中心 private readonly Guid defaultMedicalCenterId = Guid.Parse("0de5b78a-731d-4f80-b262-655ebbf04581"); + private readonly string defaultMedicalConclusionType = "01"; - private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IRepository _deviceTypeRepository; private readonly IRepository _itemTypeRepository; private readonly ItemTypeManager _itemTypeManager; @@ -99,7 +104,20 @@ namespace Shentun.Peis.DataMigrations private readonly IRepository _patientRepository; private readonly IRepository _nationRepository; private readonly ILogger _logger; - + private readonly IRepository _identityUserRepository; + private readonly IRepository _medicalConclusionRepository; + private readonly IRepository _patientRegisterRepository; + private readonly IRepository _registerCheckRepository; + private readonly IRepository _registerCheckAsbitemRepository; + private readonly IRepository _registerCheckItemRepository; + private readonly RegisterCheckItemManager _registerCheckItemManager; + private readonly UnitOfWorkManager _unitOfWorkManager; + private readonly IRepository _registerCheckSummaryRepository; + private readonly IRepository _sumSummaryHeaderRepository; + private readonly IRepository _sumSummaryContentRepository; + private readonly IRepository _sumSuggestionHeaderRepository; + private readonly IRepository _sumSuggestionContentRepository; + private readonly IRepository _sumDiagnosisRepository; private Dictionary veryPatientNo = new Dictionary(); @@ -132,8 +150,21 @@ namespace Shentun.Peis.DataMigrations IRepository customerOrgGroupDetailRepository, IRepository nationRepository, IRepository patientRepository, - IUnitOfWorkManager unitOfWorkManager, - ILogger logger) + ILogger logger, + IRepository identityUserRepository, + IRepository medicalConclusionRepository, + IRepository patientRegisterRepository, + IRepository registerCheckRepository, + IRepository registerCheckAsbitemRepository, + IRepository registerCheckItemRepository, + RegisterCheckItemManager registerCheckItemManager, + UnitOfWorkManager unitOfWorkManager, + IRepository registerCheckSummaryRepository, + IRepository sumSummaryHeaderRepository, + IRepository sumSummaryContentRepository, + IRepository sumSuggestionHeaderRepository, + IRepository sumSuggestionContentRepository, + IRepository sumDiagnosisRepository) { _deviceTypeRepository = deviceTypeRepository; _itemTypeRepository = itemTypeRepository; @@ -163,8 +194,21 @@ namespace Shentun.Peis.DataMigrations _customerOrgGroupDetailRepository = customerOrgGroupDetailRepository; _nationRepository = nationRepository; _patientRepository = patientRepository; - _unitOfWorkManager = unitOfWorkManager; _logger = logger; + _identityUserRepository = identityUserRepository; + _medicalConclusionRepository = medicalConclusionRepository; + _patientRegisterRepository = patientRegisterRepository; + _registerCheckRepository = registerCheckRepository; + _registerCheckAsbitemRepository = registerCheckAsbitemRepository; + _registerCheckItemRepository = registerCheckItemRepository; + _registerCheckItemManager = registerCheckItemManager; + _unitOfWorkManager = unitOfWorkManager; + _registerCheckSummaryRepository = registerCheckSummaryRepository; + _sumSummaryHeaderRepository = sumSummaryHeaderRepository; + _sumSummaryContentRepository = sumSummaryContentRepository; + _sumSuggestionHeaderRepository = sumSuggestionHeaderRepository; + _sumSuggestionContentRepository = sumSuggestionContentRepository; + _sumDiagnosisRepository = sumDiagnosisRepository; } @@ -1671,6 +1715,47 @@ namespace Shentun.Peis.DataMigrations } } + /// + /// 迁移体检结论 + /// + /// + public async Task TransferMedicalConclusionData() + { + var count = await _medicalConclusionRepository.GetCountAsync(); + if (count == 0) + { + List dataList = new List(); + var oldMedicalConclusionList = await Db.Ado.GetDataTableAsync("select medical_conclusion_id,medical_conclusion_name from medical_conclusion order by display_order asc"); + if (oldMedicalConclusionList.Rows.Count > 0) + { + List fieldComparisons = new List(); + + foreach (DataRow row in oldMedicalConclusionList.Rows) + { + var data = new MedicalConclusion + { + DisplayName = row["medical_conclusion_name"].ToString(), + DisplayOrder = oldMedicalConclusionList.Rows.IndexOf(row) + 1, + SimpleCode = LanguageConverter.GetPYSimpleCode(row["medical_conclusion_name"].ToString()), + MedicalConclusionTypeId = defaultMedicalConclusionType + }; + + var ent = await _medicalConclusionRepository.InsertAsync(data, true); + + fieldComparisons.Add(new FieldComparison + { + TableName = "medical_conclusion", + FieldName = "id", + NewKeyValue = ent.Id.ToString(), + OldKeyValue = row["medical_conclusion_id"].ToString() + }); + } + + await _fieldComparisonRepository.InsertManyAsync(fieldComparisons); + } + } + } + /// @@ -1723,33 +1808,28 @@ namespace Shentun.Peis.DataMigrations List dataList = new List(); - List oldPatientNos = (await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "patient") - .Select(s => s.OldKeyValue).ToList(); - - //var oldCustomerOrgGroupList = await Db.Ado.GetDataTableAsync("select top 200 * from patient_register where patient_id not in (@ids) order by patient_register_id asc", - // new { ids = oldPatientNos }); - - var oldCustomerOrgGroupList = await Db.Ado.GetDataTableAsync("select top 500 patient_id,nation_id,address," + + var oldPatientList = await Db.Ado.GetDataTableAsync("select top 500 patient_id,nation_id,address," + "birth_date,name,email,id_card_no,marital_status_id,mobile_telephone,patient_password,postalcode,telephone,sex_id " + "from patient_register where is_hand is null order by patient_register_id asc"); - List tempPatientNos=new List(); + List tempPatientNos = new List(); - if (oldCustomerOrgGroupList.Rows.Count > 0) + if (oldPatientList.Rows.Count > 0) { List fieldComparisons = new List(); List fieldComparisonList = await _fieldComparisonRepository.GetListAsync(m => m.TableName == "nation"); - foreach (DataRow row in oldCustomerOrgGroupList.Rows) + foreach (DataRow row in oldPatientList.Rows) { - tempPatientNos.Add(row["patient_id"].ToString()); - if (!veryPatientNo.ContainsKey(row["patient_id"].ToString()) && !oldPatientNos.Contains(row["patient_id"].ToString())) + + if (!tempPatientNos.Contains(row["patient_id"].ToString())) { string nationId = null; if (!string.IsNullOrWhiteSpace(row["nation_id"].ToString())) { + nationId = fieldComparisonList.Where(m => m.OldKeyValue == row["nation_id"].ToString()).FirstOrDefault().NewKeyValue; } @@ -1790,6 +1870,7 @@ namespace Shentun.Peis.DataMigrations #endregion } + tempPatientNos.Add(row["patient_id"].ToString()); } if (dataList.Any()) @@ -1814,15 +1895,834 @@ namespace Shentun.Peis.DataMigrations return false; } + } + + /// + /// 迁移人员登记数据 + /// + /// + public async Task TransferPatientRegisterData() + { + List dataList = new List(); + + var oldPatientRegisterList = await Db.Ado.GetDataTableAsync("select top 1000 * from patient_register where is_dj is null order by patient_register_id asc"); + List tempPatientRegisterIds = new List(); + if (oldPatientRegisterList.Rows.Count > 0) + { + List fieldComparisons = new List(); + List fieldComparisonList = await _fieldComparisonRepository.GetListAsync(); + var userList = await _identityUserRepository.GetListAsync(); + List customerOrgRegisterList = await _customerOrgRegisterRepository.GetListAsync(); + + foreach (DataRow row in oldPatientRegisterList.Rows) + { + Guid patientRegisterId = GuidGenerator.Create(); //生成登记ID + + #region 转换审核医生ID + Guid? AuditDoctorId = null; + if (!string.IsNullOrWhiteSpace(row["audit_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["audit_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + AuditDoctorId = userEnt.Id; + } + } + #endregion + + #region 转换单位分组ID + Guid? customerOrgGroupId = null; + if (!string.IsNullOrWhiteSpace(row["org_group_id"].ToString())) + { + var customerOrgGroupEnt = fieldComparisonList.Where(m => m.TableName == "customer_org_group" && m.OldKeyValue == row["org_group_id"].ToString()).FirstOrDefault(); + if (customerOrgGroupEnt != null) + { + customerOrgGroupId = Guid.Parse(customerOrgGroupEnt.NewKeyValue); + } + } + #endregion + + #region 转换单位ID 部门 + Guid customerOrgId = Guid.Parse(fieldComparisonList.Where(m => m.TableName == "customer_org" && m.OldKeyValue == row["org_id"].ToString()).FirstOrDefault().NewKeyValue); + #endregion + + #region 转换单位体检次数ID 没有增加默认值 + Guid customerOrgRegisterId = GuidFlag.PersonCustomerOrgRegisterId; + if (row["org_id"].ToString() != "00000") + { + var customerOrgRegisterEnt = customerOrgRegisterList.Where(m => m.CustomerOrgId == customerOrgId + && m.MedicalTimes == (short)Convert.ToInt32(row["org_medical_times"].ToString())).FirstOrDefault(); + if (customerOrgRegisterEnt != null) + { + customerOrgRegisterId = customerOrgRegisterEnt.Id; + } + } + #endregion + + #region 转换体检结论ID + Guid? medicalConclusionId = null; + if (!string.IsNullOrWhiteSpace(row["medical_conclusion_id"].ToString())) + { + var medicalConclusionEnt = fieldComparisonList.Where(m => m.TableName == "medical_conclusion" + && m.OldKeyValue == row["medical_conclusion_id"].ToString()).FirstOrDefault(); + if (medicalConclusionEnt != null) + { + medicalConclusionId = Guid.Parse(medicalConclusionEnt.NewKeyValue); + } + } + #endregion + + #region 转换套餐ID + Guid? medicalPackageId = null; + if (!string.IsNullOrWhiteSpace(row["medical_package_id"].ToString())) + { + var medicalPackageEnt = fieldComparisonList.Where(m => m.TableName == "medical_package" && m.OldKeyValue == row["medical_package_id"].ToString()).FirstOrDefault(); + if (medicalPackageEnt != null) + { + medicalPackageId = Guid.Parse(medicalPackageEnt.NewKeyValue); + } + } + #endregion + + #region 转换体检类别ID + Guid? medicalTypeId = null; + if (!string.IsNullOrWhiteSpace(row["medical_type_id"].ToString())) + { + var medicalTypeEnt = fieldComparisonList.Where(m => m.TableName == "medical_type" && m.OldKeyValue == row["medical_type_id"].ToString()).FirstOrDefault(); + if (medicalTypeEnt != null) + { + medicalTypeId = Guid.Parse(medicalTypeEnt.NewKeyValue); + } + } + #endregion + + #region 获取档案ID + Guid patientId = Guid.Parse(fieldComparisonList.Where(m => m.TableName == "patient" && m.OldKeyValue == row["patient_id"].ToString()).FirstOrDefault().NewKeyValue); + #endregion + + #region 转换人员类别ID + Guid? personnelTypeId = null; + if (!string.IsNullOrWhiteSpace(row["personnel_type_id"].ToString())) + { + var personnelTypeEnt = fieldComparisonList.Where(m => m.TableName == "personnel_type" && m.OldKeyValue == row["personnel_type_id"].ToString()).FirstOrDefault(); + if (personnelTypeEnt != null) + { + personnelTypeId = Guid.Parse(personnelTypeEnt.NewKeyValue); + } + } + #endregion + + #region 转换总检医生ID + Guid? summaryDoctorId = null; + if (!string.IsNullOrWhiteSpace(row["summary_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["summary_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + summaryDoctorId = userEnt.Id; + } + } + #endregion + + + #region 上传图片,获取地址 + + string photo = ""; + if (!string.IsNullOrEmpty(row["photograph"].ToString())) + { + photo = UpLoadImg(patientRegisterId, (byte[])row["photograph"]); + } + + #endregion + + var data = new PatientRegister(patientRegisterId) + { + BirthDate = string.IsNullOrEmpty(row["birth_date"].ToString()) ? null : Convert.ToDateTime(row["birth_date"].ToString()), + MaritalStatusId = Convert.ToChar(row["marital_status_id"].ToString()), + MedicalCenterId = defaultMedicalCenterId, + SexId = ConvertSex(row["sex_id"].ToString()), + Age = string.IsNullOrWhiteSpace(row["age"].ToString()) ? null : Convert.ToInt16(row["age"].ToString()), + AuditDate = string.IsNullOrWhiteSpace(row["audit_date"].ToString()) ? null : Convert.ToDateTime(row["audit_date"].ToString()), + AuditDoctorId = AuditDoctorId, + CompleteFlag = Convert.ToChar(row["complete_flag"].ToString()), + CustomerOrgGroupId = customerOrgGroupId, + CustomerOrgId = customerOrgId, + CustomerOrgRegisterId = customerOrgRegisterId, + GuidePrintTimes = string.IsNullOrWhiteSpace(row["instruct_print_times"].ToString()) ? (short)0 : Convert.ToInt16(row["instruct_print_times"].ToString()), + InterposeMeasure = null, + IsAudit = string.IsNullOrWhiteSpace(row["audit_flag"].ToString()) ? 'N' : Convert.ToChar(row["audit_flag"].ToString()), + IsLock = string.IsNullOrWhiteSpace(row["lock_flag"].ToString()) ? 'N' : Convert.ToChar(row["lock_flag"].ToString()), + IsMedicalStart = string.IsNullOrWhiteSpace(row["medical_start_flag"].ToString()) ? 'N' : Convert.ToChar(row["medical_start_flag"].ToString()), + IsNameHide = string.IsNullOrWhiteSpace(row["name_encrypt_flag"].ToString()) ? 'N' : Convert.ToChar(row["name_encrypt_flag"].ToString()), + IsPhoneFollow = 'N', + IsRecoverGuide = string.IsNullOrWhiteSpace(row["recover_form_flag"].ToString()) ? 'N' : Convert.ToChar(row["recover_form_flag"].ToString()), + IsUpload = string.IsNullOrWhiteSpace(row["upload_flag"].ToString()) ? 'N' : Convert.ToChar(row["upload_flag"].ToString()), + IsVip = string.IsNullOrWhiteSpace(row["vip_flag"].ToString()) ? 'N' : Convert.ToChar(row["vip_flag"].ToString()), + JobCardNo = row["job_card_no"].ToString(), + JobPost = row["job_post"].ToString(), + JobTitle = row["job_title"].ToString(), + MedicalCardNo = row["medical_card_no"].ToString(), + MedicalConclusionId = medicalConclusionId, + MedicalPackageId = medicalPackageId, + MedicalStartDate = string.IsNullOrEmpty(row["medical_start_date"].ToString()) ? null : Convert.ToDateTime(row["medical_start_date"].ToString()), + MedicalTimes = Convert.ToInt16(row["medical_times"].ToString()), + MedicalTypeId = medicalTypeId, + PatientId = patientId, + PatientName = row["name"].ToString(), + PatientRegisterNo = row["barcode_no"].ToString(), + PersonnelTypeId = personnelTypeId, + Photo = "", + Remark = row["remark"].ToString(), + ReportPrintTimes = Convert.ToInt16(row["report_print_times"].ToString()), + Salesman = row["salesman"].ToString(), + SexHormoneTermId = null, + SummaryDate = string.IsNullOrEmpty(row["summary_date"].ToString()) ? null : Convert.ToDateTime(row["summary_date"].ToString()), + SummaryDoctorId = summaryDoctorId, + ThirdInfo = row["third_info"].ToString(), + }; + + //图片、 + dataList.Add(data); + + fieldComparisons.Add(new FieldComparison + { + FieldName = "id", + NewKeyValue = patientRegisterId.ToString(), + OldKeyValue = row["patient_register_id"].ToString(), + TableName = "patient_register" + }); + + + tempPatientRegisterIds.Add(row["patient_register_id"].ToString()); + } + + if (dataList.Any()) + await _patientRegisterRepository.InsertManyAsync(dataList); + if (fieldComparisons.Any()) + await _fieldComparisonRepository.InsertManyAsync(fieldComparisons); + + + #region 修改状态 + Thread.Sleep(100); + + await Db.Ado.ExecuteCommandAsync("update patient_register set is_dj='Y' where patient_register_id in (@ids) ", new { ids = tempPatientRegisterIds }); + + #endregion + _logger.LogInformation($"当前时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")},迁移数据{dataList.Count}"); + + return true; + } + else + { + return false; + } } - //public async Task TransferPatientRegisterData() - //{ - //} + /// + /// 处理异常 人员登记 异常后更新状态 + /// + /// + public async Task HandPatientRegisterStatus() + { + List updateIds = new List(); + List newIds = (await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "patient_register").Select(s => s.OldKeyValue).ToList(); + + var oldPatientRegisterList = await Db.Ado.GetDataTableAsync("select patient_register_id,is_dj from patient_register where is_dj is not null order by patient_register_id asc"); + if (oldPatientRegisterList.Rows.Count > 0) + { + foreach (DataRow row in oldPatientRegisterList.Rows) + { + if (!newIds.Contains(row["patient_register_id"].ToString())) + { + updateIds.Add(row["patient_register_id"].ToString()); + } + } + + if (updateIds.Any()) + { + await Db.Ado.ExecuteCommandAsync("update patient_register set is_dj=null where patient_register_id in (@ids) ", new { ids = updateIds }); + } + } + } + + + + /// + /// 处理人员登记 登记医生跟登记时间 + /// + /// + public async Task HandPatientRegisterDoctor() + { + var oldPatientRegisterList = await Db.Ado.GetDataTableAsync("select patient_register_id,register_doctor,register_date,audit_doctor,summary_doctor from patient_register where is_doctor is null "); + if (oldPatientRegisterList.Rows.Count > 0) + { + var userList = await _identityUserRepository.GetListAsync(); + List fieldComparisonList = await _fieldComparisonRepository.GetListAsync(m => m.TableName == "patient_register"); + + + StringBuilder sb = new StringBuilder(); + + foreach (DataRow row in oldPatientRegisterList.Rows) + { + Guid patientRegisterId = Guid.Parse(fieldComparisonList.Where(m => m.OldKeyValue == row["patient_register_id"].ToString()).FirstOrDefault().NewKeyValue); + // Guid registerDoctorId = userList.Where(m => m.UserName == row["register_doctor"].ToString().Trim()).FirstOrDefault().Id; + Guid registerDoctorId = Guid.Parse("3a11fe49-5719-0e9e-dd44-0c4aff0900b0"); + var registerDoctorEnt = userList.Where(m => m.UserName == row["register_doctor"].ToString().Trim()).FirstOrDefault(); + if (registerDoctorEnt != null) + { + registerDoctorId = registerDoctorEnt.Id; + } + + #region 转换审核医生ID + Guid? auditDoctorId = null; + if (!string.IsNullOrWhiteSpace(row["audit_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["audit_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + auditDoctorId = userEnt.Id; + } + } + #endregion + + #region 转换总检医生ID + Guid? summaryDoctorId = null; + if (!string.IsNullOrWhiteSpace(row["summary_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["summary_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + summaryDoctorId = userEnt.Id; + } + } + #endregion + + + string sql_update = $"update patient_register set creator_id='{registerDoctorId}',creation_time='{Convert.ToDateTime(row["register_date"]).ToString("yyyy-MM-dd HH:mm:ss")}'"; + if (auditDoctorId != null) + { + sql_update += $",audit_doctor_id='{auditDoctorId}'"; + } + if (summaryDoctorId != null) + { + sql_update += $",summary_doctor_id='{summaryDoctorId}'"; + } + + sql_update += $" where id='{patientRegisterId}' "; + + await PgDb.Ado.ExecuteCommandAsync(sql_update); + string sql_update_status = $"update patient_register set is_doctor='Y' where patient_register_id='{row["patient_register_id"].ToString()}' "; + await Db.Ado.ExecuteCommandAsync(sql_update_status); + + + } + + return true; + } + else + { + return false; + } + } + + + + /// + /// 迁移检查单 组合项目 查询register_asbitem + /// + /// + public async Task TransferRegisterCheckData(int handcount) + { + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='patient_register'"); + + var patientRegisterList = (await _patientRegisterRepository.GetQueryableAsync()).OrderBy(o => o.Id) + .Where(m => string.Compare(m.Id.ToString(), nextKeyValue) > 0).Take(handcount).ToList(); + + + if (patientRegisterList.Any()) + { + var userList = await _identityUserRepository.GetListAsync(); + + + + foreach (var item in patientRegisterList) + { + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + + List registerCheckInsert = new List(); + List registerCheckAsbitemInsert = new List(); + + #region 转换成老系统ID + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.Id.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + var oldRegisterAsbitemList = await Db.Ado.GetDataTableAsync($"select * from register_asbitem where patient_register_id='{oldPatientRegisterId}'"); + + if (oldRegisterAsbitemList.Rows.Count > 0) + { + + foreach (DataRow row in oldRegisterAsbitemList.Rows) + { + #region 转换审核医生ID + Guid? auditorUserId = null; + if (!string.IsNullOrWhiteSpace(row["audit_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["audit_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + auditorUserId = userEnt.Id; + } + } + #endregion + + #region 转换检查医生ID + string checkDoctorId = null; + if (!string.IsNullOrWhiteSpace(row["check_doctor"].ToString())) + { + var userEnt = userList.Where(m => m.UserName == row["check_doctor"].ToString().Trim()).FirstOrDefault(); + if (userEnt != null) + { + checkDoctorId = userEnt.Id.ToString(); + } + else + { + checkDoctorId = row["check_doctor"].ToString().Trim(); + } + } + #endregion + + Guid registerCheckId = GuidGenerator.Create(); + var data = new RegisterCheck(registerCheckId) + { + AuditorUserId = auditorUserId, + AuditTime = string.IsNullOrEmpty(row["audit_date"].ToString()) ? null : Convert.ToDateTime(row["audit_date"].ToString()), + CheckDate = string.IsNullOrEmpty(row["check_date"].ToString()) ? null : Convert.ToDateTime(row["check_date"].ToString()), + CheckDoctorId = checkDoctorId, + CheckRequestNo = "", + CheckRequestPrintTimes = (short)1, + CompleteFlag = Convert.ToChar(row["complete_flag"].ToString()), + CriticalValue = null, + CriticalValueCreateDate = null, + CriticalValueFlag = null, + CriticalValueProcessContent = null, + CriticalValueProcessDate = null, + CriticalValueProcessDoctor = null, + CriticalValueProcessFlag = null, + IsAudit = string.IsNullOrEmpty(row["audit_flag"].ToString()) ? 'N' : Convert.ToChar(row["audit_flag"].ToString()), + IsLock = string.IsNullOrEmpty(row["lock_flag"].ToString()) ? 'N' : Convert.ToChar(row["lock_flag"].ToString()), + PatientRegisterId = item.Id, + ThirdInfo = row["third_info"].ToString() + }; + + registerCheckInsert.Add(data); + + Guid registerCheckAsbitemId = GuidGenerator.Create(); + + #region 转换组合项目ID + Guid newAsbitemId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "asbitem" && m.OldKeyValue == row["asbitem_id"].ToString()).FirstOrDefault().NewKeyValue); + #endregion + + var dataRegisterAsbitem = new RegisterCheckAsbitem(registerCheckAsbitemId) + { + Amount = 1, + IsCharge = Convert.ToChar(row["charge_flag"].ToString()), + AsbitemId = newAsbitemId, + ChargePrice = Convert.ToDecimal(row["price"].ToString()), + GroupPackageId = null, + LisRequestId = null, + PatientRegisterId = item.Id, + PayTypeFlag = Convert.ToChar(row["payment_mode"].ToString()), + RegisterCheckId = registerCheckId, + StandardPrice = Convert.ToDecimal(row["standard_price"].ToString()) + }; + + registerCheckAsbitemInsert.Add(dataRegisterAsbitem); + } + + } + + + if (registerCheckInsert.Any()) + await _registerCheckRepository.InsertManyAsync(registerCheckInsert); + if (registerCheckAsbitemInsert.Any()) + await _registerCheckAsbitemRepository.InsertManyAsync(registerCheckAsbitemInsert); + + + await uow.CompleteAsync(); + + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.Id}',addtime=getdate(),handlecount+=1 where tablename='patient_register' "); + + } + } + + + + } + } + + + /// + /// 迁移明细项目 查询register_item + /// + /// + public async Task TransferRegisterCheckItemData() + { + + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='register_check_asbitem'"); + + var registerCheckAsbitemList = await _registerCheckAsbitemRepository.GetListAsync(m => string.Compare(m.Id.ToString(), nextKeyValue) > 0); + if (registerCheckAsbitemList.Any()) + { + + foreach (var item in registerCheckAsbitemList) + { + + + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + List registerCheckItemInsert = new List(); + + #region 转换成老系统PatientRegisterId + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.PatientRegisterId.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + #region 转换成老系统AsbitemId + string oldAsbitemId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "asbitem" && m.NewKeyValue == item.AsbitemId.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + var oldRegisterCheckItemList = await Db.Ado.GetDataTableAsync($"select * from register_item where patient_register_id='{oldPatientRegisterId}' and asbitem_id='{oldAsbitemId}'"); + + if (oldRegisterCheckItemList.Rows.Count > 0) + { + + foreach (DataRow row in oldRegisterCheckItemList.Rows) + { + #region 转换项目ID 老转新 + Guid newItemId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "item" && m.OldKeyValue == row["item_id"].ToString()).FirstOrDefault().NewKeyValue); + + #endregion + + + var data = new RegisterCheckItem + { + CheckDate = string.IsNullOrEmpty(row["check_date"].ToString()) ? null : Convert.ToDateTime(row["check_date"].ToString()), + CriticalValue = null, + CheckDoctorName = row["check_doctor"].ToString().Trim(), + CriticalRangeValue = null, + ItemId = newItemId, + ReferenceRangeValue = row["reference_range_value"].ToString(), + RegisterCheckId = item.RegisterCheckId, + Result = row["result"].ToString(), + ResultStatusId = _registerCheckItemManager.GetResultStatusId(row["result"].ToString(), row["reference_range_value"].ToString()), + Unit = row["Unit"].ToString() + }; + + registerCheckItemInsert.Add(data); + + } + + } + + if (registerCheckItemInsert.Any()) + await _registerCheckItemRepository.InsertManyAsync(registerCheckItemInsert); + + + await uow.CompleteAsync(); + + + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.Id}',addtime=getdate(),handlecount+=1 where tablename='register_check_asbitem' "); + } + } + + + + } + } + + + + /// + /// 迁移医生小结 查询register_asbitem + /// + /// + public async Task TransferRegisterCheckSummaryData() + { + + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='register_check_summary'"); + + var registerCheckAsbitemList = (from registerCheckQuery in await _registerCheckRepository.GetQueryableAsync() + join registerCheckAsbitemQuery in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheckQuery.Id equals registerCheckAsbitemQuery.RegisterCheckId + where string.Compare(registerCheckQuery.Id.ToString(), nextKeyValue) > 0 + select new + { + PatientRegisterId = registerCheckQuery.PatientRegisterId, + RegisterCheckId = registerCheckQuery.Id, + AsbitemId = registerCheckAsbitemQuery.AsbitemId + }).ToList(); + + if (registerCheckAsbitemList.Any()) + { + + foreach (var item in registerCheckAsbitemList) + { + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + #region 转换成老系统PatientRegisterId + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.PatientRegisterId.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + #region 转换成老系统AsbitemId + string oldAsbitemId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "asbitem" && m.NewKeyValue == item.AsbitemId.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + var oldSummary = await Db.Ado.GetStringAsync($"select summary from register_asbitem where patient_register_id='{oldPatientRegisterId}' and asbitem_id='{oldAsbitemId}'"); + if (!string.IsNullOrWhiteSpace(oldSummary)) + { + var data = new RegisterCheckSummary + { + RegisterCheckId = item.RegisterCheckId, + DisplayOrder = 1, + Summary = oldSummary, + SummaryFlag = '0' + }; + + + await _registerCheckSummaryRepository.InsertAsync(data); + + await uow.CompleteAsync(); + } + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.RegisterCheckId}',addtime=getdate(),handlecount+=1 where tablename='register_check_summary' "); + } + } + + + + } + } + + + /// + /// 迁移总检综述 查询patient_register + /// + /// + public async Task TransferSumSummaryData(int handcount) + { + + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='sum_summary'"); + + var patientRegisterList = (await _patientRegisterRepository.GetQueryableAsync()).OrderBy(o => o.Id) + .Where(m => string.Compare(m.Id.ToString(), nextKeyValue) > 0).Take(handcount).ToList(); + + + if (patientRegisterList.Any()) + { + + + foreach (var item in patientRegisterList) + { + + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + #region 转换成老系统PatientRegisterId + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.Id.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + + var oldSummary = await Db.Ado.GetStringAsync($"select summary from patient_register where patient_register_id='{oldPatientRegisterId}' "); + + if (!string.IsNullOrWhiteSpace(oldSummary)) + { + + Guid sumSummaryHeaderId = GuidGenerator.Create(); + + var dataSumSummaryHeader = new SumSummaryHeader(sumSummaryHeaderId) + { + DisplayOrder = 1, + SummaryFlag = '0', + PatientRegisterId = item.Id, + SummaryTitle = "." + }; + + await _sumSummaryHeaderRepository.InsertAsync(dataSumSummaryHeader); + + Guid sumSummaryContentId = GuidGenerator.Create(); + var dataSumSummaryContent = new SumSummaryContent(sumSummaryContentId) + { + DisplayOrder = 1, + SumSummaryHeaderId = sumSummaryHeaderId, + SummaryContent = oldSummary + }; + + await _sumSummaryContentRepository.InsertAsync(dataSumSummaryContent); + + await uow.CompleteAsync(); + } + + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.Id}',addtime=getdate(),handlecount+=1 where tablename='sum_summary' "); + } + } + + + + } + } + + + /// + /// 迁移总检建议 查询patient_register + /// + /// + public async Task TransferSumSuggestionData(int handcount) + { + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='sum_suggestion'"); + + var patientRegisterList = (await _patientRegisterRepository.GetQueryableAsync()).OrderBy(o => o.Id) + .Where(m => string.Compare(m.Id.ToString(), nextKeyValue) > 0).Take(handcount).ToList(); + + if (patientRegisterList.Any()) + { + + foreach (var item in patientRegisterList) + { + + + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + #region 转换成老系统PatientRegisterId + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.Id.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + + var oldSuggestion = await Db.Ado.GetStringAsync($"select suggestion from patient_register where patient_register_id='{oldPatientRegisterId}' "); + + if (!string.IsNullOrWhiteSpace(oldSuggestion)) + { + + Guid sumSuggestionHeaderId = GuidGenerator.Create(); + + var dataSumSuggestionHeader = new SumSuggestionHeader(sumSuggestionHeaderId) + { + DisplayOrder = 1, + SuggestionFlag = '0', + PatientRegisterId = item.Id, + SuggestionTitle = "." + }; + + await _sumSuggestionHeaderRepository.InsertAsync(dataSumSuggestionHeader); + + Guid sumSuggestionContentId = GuidGenerator.Create(); + var dataSumSuggestionContent = new SumSuggestionContent(sumSuggestionContentId) + { + DisplayOrder = 1, + SuggestionContent = oldSuggestion, + SuggestionType = SuggestionTypeFlag.HealthGuidance, + SumSuggestionHeaderId = sumSuggestionHeaderId + }; + + await _sumSuggestionContentRepository.InsertAsync(dataSumSuggestionContent); + + await uow.CompleteAsync(); + } + + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.Id}',addtime=getdate(),handlecount+=1 where tablename='sum_suggestion' "); + } + } + + + + } + } + + + + /// + /// 迁移总症诊断 查询summary_diagnosis + /// + /// + public async Task TransferSumDiagnosisData(int handcount) + { + + string nextKeyValue = Db.Ado.GetString("select keyvalue from tb_export_key where tablename='sum_diagnosis'"); + + var patientRegisterList = (await _patientRegisterRepository.GetQueryableAsync()).OrderBy(o => o.Id) + .Where(m => string.Compare(m.Id.ToString(), nextKeyValue) > 0).Take(handcount).ToList(); + + if (patientRegisterList.Any()) + { + + foreach (var item in patientRegisterList) + { + + + using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) + { + #region 转换成老系统PatientRegisterId + string oldPatientRegisterId = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "patient_register" && m.NewKeyValue == item.Id.ToString()).FirstOrDefault().OldKeyValue; + #endregion + + + var oldSummaryDiagnosis = await Db.Ado.GetDataTableAsync($"select diagnosis_id from summary_diagnosis where patient_register_id='{oldPatientRegisterId}' order by display_order asc "); + + if (oldSummaryDiagnosis.Rows.Count > 0) + { + //获取建议头 + var sumSuggestionHeaderEnt = await _sumSuggestionHeaderRepository.FirstOrDefaultAsync(m => m.PatientRegisterId == item.Id); + if (sumSuggestionHeaderEnt != null) + { + List sumDiagnosisInsert = new List(); + + foreach (DataRow row in oldSummaryDiagnosis.Rows) + { + var diagnosisEnt = (await _fieldComparisonRepository.GetQueryableAsync()) + .Where(m => m.TableName == "diagnosis" && m.OldKeyValue == row["diagnosis_id"].ToString()).FirstOrDefault(); + if (diagnosisEnt != null) + { + + var dataSumDiagnosis = new SumDiagnosis + { + DisplayOrder = oldSummaryDiagnosis.Rows.IndexOf(row) + 1, + PatientRegisterId = item.Id, + DiagnosisId = Guid.Parse(diagnosisEnt.NewKeyValue), + SumSuggestionHeaderId = sumSuggestionHeaderEnt.Id + }; + + sumDiagnosisInsert.Add(dataSumDiagnosis); + } + + + } + + if (sumDiagnosisInsert.Any()) + await _sumDiagnosisRepository.InsertManyAsync(sumDiagnosisInsert); + + await uow.CompleteAsync(); + } + } + + + await Db.Ado.ExecuteCommandAsync($"update tb_export_key set keyvalue='{item.Id}',addtime=getdate(),handlecount+=1 where tablename='sum_diagnosis' "); + } + } + + + + } + } @@ -1900,6 +2800,16 @@ namespace Shentun.Peis.DataMigrations } } + private string UpLoadImg(Guid PatientRegisterId, byte[] Photo) + { + string imgurl = "UpLoad/" + PatientRegisterId; + var isupload = ImageHelper.ByteToImage(Photo, imgurl); + if (!string.IsNullOrEmpty(isupload)) + return isupload; + else + return ""; + } + } diff --git a/src/Shentun.Peis.Domain/ImageHelper.cs b/src/Shentun.Peis.Domain/ImageHelper.cs index c171144..85ecb49 100644 --- a/src/Shentun.Peis.Domain/ImageHelper.cs +++ b/src/Shentun.Peis.Domain/ImageHelper.cs @@ -99,6 +99,87 @@ namespace Shentun.Peis + /// + /// 将Base64字符串转换为图片并保存到本地 + /// + /// base64字符串 + /// 图片保存地址,如:/Content/Images/10000 + /// + public static string ByteToImage(byte[] photo, string savePath) + { + var ret = ""; + + try + { + MemoryStream ms = new MemoryStream(photo); + Bitmap bitmap = new Bitmap(ms); + ms.Close(); + + + if (bitmap != null) + { + string ImageSuffix = ""; + if (ImageFormat.Png.Guid == bitmap.RawFormat.Guid) + { + ImageSuffix = ".png"; + } + else if (ImageFormat.Gif.Guid == bitmap.RawFormat.Guid) + { + ImageSuffix = ".gif"; + } + else + { + ImageSuffix = ".jpg"; + } + + savePath = savePath + ImageSuffix; + + //创建文件夹 + var folderPath = savePath.Substring(0, savePath.LastIndexOf('/')); + + if (!Directory.Exists(folderPath)) + { + Directory.CreateDirectory(folderPath); + } + + //图片后缀格式 + var suffix = savePath.Substring(savePath.LastIndexOf('.') + 1, savePath.Length - savePath.LastIndexOf('.') - 1).ToLower(); + var suffixName = suffix == "png" ? ImageFormat.Png : + suffix == "jpg" || suffix == "jpeg" ? ImageFormat.Jpeg : + suffix == "bmp" ? ImageFormat.Bmp : + suffix == "gif" ? ImageFormat.Gif : ImageFormat.Jpeg; + + + + //这里复制一份对图像进行保存,否则会出现“GDI+ 中发生一般性错误”的错误提示 + var bmpNew = new Bitmap(bitmap); + // bmpNew.Save(_hostingEnvironment.ContentRootPath + savePath, suffixName); + + var s1 = Directory.GetCurrentDirectory(); + + string saveurl = Path.Combine(s1, savePath); + + bmpNew.Save(saveurl, suffixName); + bmpNew.Dispose(); + + bitmap.Dispose(); + + ret = savePath; + } + else + { + ret = ""; + } + } + catch (Exception ex) + { + ret = ""; + } + + return ret; + } + + /// /// 将Base64字符串转换为图片并保存到服务器 /// @@ -234,8 +315,8 @@ namespace Shentun.Peis throw new UserFriendlyException("请上传jpg、png、gif格式的图片"); } - - + + savePath = AbsolutePath + "\\" + PatientRegisterId + "\\" + RegisterCheckId + "\\" + ImageName + ImageSuffix; hostPath = "/CheckPictureImg/" + PatientRegisterId + "/" + RegisterCheckId + "/" + ImageName + ImageSuffix; diff --git a/src/Shentun.Peis.Domain/RegisterCheckSummarys/RegisterCheckSummary.cs b/src/Shentun.Peis.Domain/RegisterCheckSummarys/RegisterCheckSummary.cs index 605091c..0a17217 100644 --- a/src/Shentun.Peis.Domain/RegisterCheckSummarys/RegisterCheckSummary.cs +++ b/src/Shentun.Peis.Domain/RegisterCheckSummarys/RegisterCheckSummary.cs @@ -27,7 +27,7 @@ namespace Shentun.Peis.Models /// 综述 /// [Column("summary")] - [StringLength(500)] + [StringLength(2000)] public string Summary { get; set; } = null!; /// /// 顺序 diff --git a/src/Shentun.Peis.Domain/SumSuggestionContents/SumSuggestionContent.cs b/src/Shentun.Peis.Domain/SumSuggestionContents/SumSuggestionContent.cs index d76d550..40893fe 100644 --- a/src/Shentun.Peis.Domain/SumSuggestionContents/SumSuggestionContent.cs +++ b/src/Shentun.Peis.Domain/SumSuggestionContents/SumSuggestionContent.cs @@ -31,7 +31,7 @@ namespace Shentun.Peis.Models /// 建议内容 /// [Column("suggestion_content")] - [StringLength(100)] + [StringLength(10000)] public string SuggestionContent { get; set; } = null!; [Column("display_order")] public int DisplayOrder { get; set; } diff --git a/src/Shentun.Peis.Domain/SumSummaryContents/SumSummaryContent.cs b/src/Shentun.Peis.Domain/SumSummaryContents/SumSummaryContent.cs index fd45f36..3493edb 100644 --- a/src/Shentun.Peis.Domain/SumSummaryContents/SumSummaryContent.cs +++ b/src/Shentun.Peis.Domain/SumSummaryContents/SumSummaryContent.cs @@ -27,7 +27,7 @@ namespace Shentun.Peis.Models /// 建议内容 /// [Column("summary_content")] - [StringLength(100)] + [StringLength(3000)] public string SummaryContent { get; set; } = null!; [Column("display_order")] public int DisplayOrder { get; set; } diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.Designer.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.Designer.cs new file mode 100644 index 0000000..c49f5ae --- /dev/null +++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.Designer.cs @@ -0,0 +1,13788 @@ +// +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("20240423075634_init20240423")] + partial class init20240423 + { + 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("AsbitemRoom", b => + { + b.Property("AsbitemId") + .HasColumnType("uuid"); + + b.Property("RoomId") + .HasColumnType("uuid"); + + b.HasKey("AsbitemId", "RoomId"); + + b.ToTable("AsbitemRoom"); + }); + + modelBuilder.Entity("RoomAsbitem", b => + { + b.Property("RoomId") + .HasMaxLength(5) + .HasColumnType("uuid") + .HasColumnName("room_id") + .IsFixedLength(); + + b.Property("AsbitemId") + .HasMaxLength(6) + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength(); + + b.HasKey("RoomId", "AsbitemId") + .HasName("pk_room_asbitem"); + + b.HasIndex("AsbitemId"); + + b.ToTable("room_asbitem", (string)null); + + b.HasComment("房间包含组合项目设置"); + }); + + 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("ClinicalMeaning") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("clinical_meaning") + .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("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("DisplayName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'") + .HasComment("适用性别,M-男,F-女,A-全部"); + + b.Property("InvoiceItemTypeId") + .HasColumnType("uuid") + .HasColumnName("invoice_item_type_id") + .IsFixedLength() + .HasComment("发票类别"); + + 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("IsDiagnosisFunction") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_diagnosis_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("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("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.HasKey("Id"); + + b.HasIndex("InvoiceItemTypeId"); + + 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("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("organization_unit_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("OrganizationUnitId", "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("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("InvoiceNo") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("invoice_no"); + + b.Property("InvoiceOrgName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("invoice_org_name"); + + 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("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("登记流水号"); + + b.Property("SettleAccountId") + .HasColumnType("uuid") + .HasColumnName("settle_account_id"); + + b.Property("SettleTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("settle_time"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "PatientRegisterId" }, "fki_fk_patient_register_charge"); + + b.HasIndex(new[] { "PatientRegisterId" }, "ix_charge"); + + b.ToTable("charge"); + + b.HasComment("收费主档"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeAsbitem", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("smallint") + .HasColumnName("amount"); + + b.Property("AsbitemId") + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength() + .HasComment("组合项目"); + + b.Property("ChargeId") + .HasColumnType("uuid") + .HasColumnName("charge_id") + .HasComment("收据号"); + + b.Property("ChargePrice") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("charge_price") + .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("RegisterAsbitemId") + .HasColumnType("uuid") + .HasColumnName("register_asbitem_id"); + + b.HasKey("Id"); + + b.HasIndex("AsbitemId"); + + b.HasIndex("ChargeId"); + + b.ToTable("charge_asbitem"); + + b.HasComment("收费包含组合项目"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeBack", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .HasComment("退费编号"); + + b.Property("ChargeId") + .HasColumnType("uuid") + .HasColumnName("charge_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("SettleAccountId") + .HasColumnType("uuid") + .HasColumnName("settle_account_id") + .HasComment("结账ID"); + + b.Property("SettleTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("settle_time"); + + b.HasKey("Id"); + + b.HasIndex("ChargeId"); + + b.ToTable("charge_back"); + + b.HasComment("退费主档"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeBackPay", b => + { + b.Property("ChargeBackId") + .HasColumnType("uuid") + .HasColumnName("charge_back_id"); + + b.Property("PayModeId") + .HasMaxLength(4) + .HasColumnType("character varying(4)") + .HasColumnName("pay_mode_id") + .HasComment("支付方式ID"); + + b.Property("BackMoeny") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("back_moeny") + .HasComment("退费金额"); + + b.Property("CardBillId") + .HasColumnType("uuid") + .HasColumnName("card_bill_id") + .HasComment("会员卡ID"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("ChargeBackId", "PayModeId") + .HasName("pk_department_charge_back_pay"); + + b.HasIndex("PayModeId"); + + b.ToTable("charge_back_pay"); + + b.HasComment("退费支付方式"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargePay", b => + { + b.Property("ChargeId") + .HasColumnType("uuid") + .HasColumnName("charge_id") + .HasComment("收据号"); + + b.Property("PayModeId") + .HasMaxLength(4) + .HasColumnType("character varying(4)") + .HasColumnName("pay_mode_id") + .HasComment("支付方式"); + + b.Property("CardBillId") + .HasColumnType("uuid") + .HasColumnName("card_bill_id") + .HasComment("会员卡ID"); + + b.Property("ChargeMoney") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("charge_money") + .HasComment("金额"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("ChargeId", "PayModeId") + .HasName("pk_department_charge_pay"); + + b.HasIndex("PayModeId"); + + b.ToTable("charge_pay"); + + b.HasComment("收费支付方式"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargePriceItem", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("smallint") + .HasColumnName("amount"); + + b.Property("ChargeAsbitemId") + .HasColumnType("uuid") + .HasColumnName("charge_asbitem_id"); + + b.Property("ChargePrice") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("charge_price"); + + 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"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ChargeAsbitemId" }, "fki_fk_charge_asbitem"); + + b.HasIndex(new[] { "ChargeAsbitemId", "PriceItemId" }, "ix_charge_price_item"); + + b.ToTable("charge_price_item"); + + b.HasComment("收费价表项目"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("编号"); + + b.Property("ColumnReferencePlugInsId") + .HasColumnType("uuid") + .HasColumnName("column_reference_plug_ins_id") + .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("DisplayName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("display_name") + .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("Id"); + + b.HasIndex("ColumnReferencePlugInsId"); + + b.ToTable("column_reference"); + + b.HasComment("字段对照主表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceCode", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("编号"); + + b.Property("CodeValue") + .IsRequired() + .HasColumnType("text") + .HasColumnName("code_value") + .HasComment("本系统编码值"); + + b.Property("ColumnReferenceId") + .HasColumnType("uuid") + .HasColumnName("column_reference_id") + .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("FilterCodeValue") + .HasColumnType("text") + .HasColumnName("filter_code_value") + .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("Id"); + + b.HasIndex("ColumnReferenceId"); + + b.ToTable("column_reference_code"); + + b.HasComment("字段对照本系统编码表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceInterface", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("编号"); + + b.Property("ColumnReferenceCodeId") + .HasColumnType("uuid") + .HasColumnName("column_reference_code_id") + .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("InterfaceCodeValue") + .IsRequired() + .HasColumnType("text") + .HasColumnName("interface_code_value") + .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("Id"); + + b.HasIndex("ColumnReferenceCodeId"); + + b.ToTable("column_reference_interface"); + + b.HasComment("字段对照第三方系统编码表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferencePlugIns", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(30) + .HasColumnType("character varying(30)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DllName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("dll_name") + .HasComment("Dll名称"); + + 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("ParmValue") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("parm_value") + .HasComment("配置参数"); + + b.HasKey("Id"); + + b.ToTable("column_reference_plug_ins"); + + b.HasComment("字段对照插件表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CommonChar", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("CommonCharTypeId") + .HasColumnType("uuid") + .HasColumnName("common_char_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(1) + .HasColumnType("character varying(1)") + .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(1) + .HasColumnType("character varying(1)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex("CommonCharTypeId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_common_char") + .IsUnique(); + + b.ToTable("common_char"); + + b.HasComment("常用字符"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CommonCharType", 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") + .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(new[] { "DisplayName" }, "ix_common_char_type") + .IsUnique(); + + b.ToTable("common_char_type"); + + b.HasComment("常用字符类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ContactMethod", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("ContactMethodType") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("contact_method_type") + .HasDefaultValueSql("'M'::bpchar") + .HasComment("联系方式类别-比如0-手机、1-电子邮箱"); + + b.Property("ContactMethodValue") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("contact_method_value") + .HasComment("联系方式,比如18911254911,839860190@qq.com"); + + b.Property("ContactPersonId") + .HasColumnType("uuid") + .HasColumnName("contact_person_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.HasKey("Id"); + + b.HasIndex("ContactPersonId"); + + b.ToTable("contact_method"); + + b.HasComment("联系方式新增量主键,更新映射关系"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ContactPerson", 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("CustomerOrgId") + .HasColumnType("uuid") + .HasColumnName("customer_org_id") + .IsFixedLength() + .HasComment("客户单位编号"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .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("Remark") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.Property("Title") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("title") + .HasComment("职务"); + + b.HasKey("Id"); + + b.HasIndex("CustomerOrgId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_contact"); + + b.HasIndex(new[] { "SimpleCode" }, "ix_contact_simple_code"); + + b.ToTable("contact_person"); + + b.HasComment("联系人"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CriticalValue", 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("CriticalValueTypeId") + .HasColumnType("uuid") + .HasColumnName("critical_value_type_id") + .IsFixedLength() + .HasComment("危急值类别编号"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .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.HasKey("Id"); + + b.HasIndex("CriticalValueTypeId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_critical_value") + .IsUnique(); + + b.ToTable("critical_value"); + + b.HasComment("危急值关键字设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CriticalValueType", 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(40) + .HasColumnType("character varying(40)") + .HasColumnName("display_name") + .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.Property("ParentId") + .HasColumnType("uuid") + .HasColumnName("parent_id") + .IsFixedLength() + .HasComment("父编号"); + + b.Property("PathCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("path_code") + .HasComment("路径编码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_critical_value_type") + .IsUnique(); + + b.ToTable("critical_value_type"); + + b.HasComment("危急值类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrg", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("单位ID"); + + b.Property("Accounts") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("accounts") + .HasComment("银行帐号"); + + b.Property("Address") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("address") + .HasComment("联系地址"); + + b.Property("Bank") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("bank") + .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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("Fax") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("fax") + .HasComment("传真"); + + b.Property("InvoiceName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("invoice_name") + .HasComment("开票名称"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active") + .HasDefaultValueSql("'Y'") + .HasComment("状态"); + + b.Property("IsLock") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_lock") + .HasDefaultValueSql("'N'") + .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") + .HasComment("体检中心ID"); + + b.Property("OrgTypeId") + .HasColumnType("uuid") + .HasColumnName("org_type_id") + .IsFixedLength() + .HasComment("单位性质"); + + b.Property("ParentId") + .HasColumnType("uuid") + .HasColumnName("parent_id") + .IsFixedLength() + .HasComment("父编号"); + + b.Property("PathCode") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("character varying(60)") + .HasColumnName("path_code") + .HasComment("路径编码"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("postal_code") + .HasComment("邮政编码"); + + b.Property("Remark") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("short_name") + .HasComment("简称"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("拼音简码"); + + b.Property("Telephone") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("telephone") + .HasComment("联系电话"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "MedicalCenterId" }, "fki_fk_customer_org_organization_units"); + + b.HasIndex(new[] { "ParentId", "DisplayName" }, "ix_org") + .IsUnique(); + + b.ToTable("customer_org"); + + b.HasComment("团检单位设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgCharge", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ChargeFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("charge_flag") + .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("CustomerOrgRegisterId") + .HasColumnType("uuid") + .HasColumnName("customer_org_register_id") + .HasComment("客户单位登记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("Payer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("payer") + .HasComment("付款人"); + + b.Property("SettleAccountId") + .HasColumnType("uuid") + .HasColumnName("settle_account_id") + .HasComment("结算账户ID"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "CustomerOrgRegisterId" }, "fki_fk_customer_org_charge_register"); + + b.ToTable("customer_org_charge"); + + b.HasComment("团检单位收费"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargeBack", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("CustomerOrgChargeId") + .HasColumnType("uuid") + .HasColumnName("customer_org_charge_id") + .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("SettleAccountId") + .HasColumnType("uuid") + .HasColumnName("settle_account_id") + .HasComment("结算账户ID"); + + b.HasKey("Id"); + + b.HasIndex("CustomerOrgChargeId"); + + b.ToTable("customer_org_charge_back"); + + b.HasComment("团检单位退费"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargeBackPay", b => + { + b.Property("CustomerOrgChargeBackId") + .HasColumnType("uuid") + .HasColumnName("customer_org_charge_back_id"); + + b.Property("PayModeId") + .HasMaxLength(4) + .HasColumnType("character varying(4)") + .HasColumnName("pay_mode_id") + .HasComment("支付方式"); + + b.Property("BackMoeny") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("back_moeny") + .HasComment("退费金额"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("CustomerOrgChargeBackId", "PayModeId") + .HasName("pk_org_charge_back_pay"); + + b.HasIndex("PayModeId"); + + b.ToTable("customer_org_charge_back_pay"); + + b.HasComment("团检退费支付方式"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargePay", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ChargeMoney") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("charge_money") + .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("PayModeId"); + + b.ToTable("customer_org_charge_pay"); + + b.HasComment("团检收费支付方式"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgGroup", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("分组编号"); + + b.Property("AgeLowerLimit") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("age_lower_limit") + .HasDefaultValueSql("0") + .HasComment("适用年龄下限"); + + b.Property("AgeUpperLimit") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("age_upper_limit") + .HasDefaultValueSql("200") + .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("CustomerOrgRegisterId") + .HasColumnType("uuid") + .HasColumnName("customer_org_register_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("display_name") + .HasComment("分组名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'::bpchar") + .HasComment("适用性别"); + + b.Property("JobPost") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("job_post") + .HasComment("适用职务"); + + b.Property("JobTitle") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("job_title") + .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") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("marital_status_id") + .HasComment("适用婚姻状况"); + + b.Property("Price") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price") + .HasComment("价格"); + + b.Property("Remark") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("remark") + .HasComment("备注"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "CustomerOrgRegisterId" }, "fki_fk_customer_org_group_register"); + + b.ToTable("customer_org_group"); + + b.HasComment("团体分组主档"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgGroupDetail", b => + { + b.Property("CustomerOrgGroupId") + .HasColumnType("uuid") + .HasColumnName("customer_org_group_id") + .IsFixedLength() + .HasComment("分组编号"); + + b.Property("AsbitemId") + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength() + .HasComment("组合项目编号"); + + b.Property("Amount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("amount") + .HasDefaultValueSql("1") + .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("Price") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price") + .HasComment("价格"); + + b.HasKey("CustomerOrgGroupId", "AsbitemId") + .HasName("pk_org_group_detail"); + + b.HasIndex("AsbitemId"); + + b.ToTable("customer_org_group_detail"); + + b.HasComment("团检分组包含组合项目"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgRegister", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("BeginTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("begin_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)") + .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("CustomerOrgId") + .HasColumnType("uuid") + .HasColumnName("customer_org_id") + .IsFixedLength() + .HasComment("单位编号"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("end_time") + .HasComment("结束日期"); + + b.Property("IsComplete") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_complete") + .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("MedicalTimes") + .HasColumnType("smallint") + .HasColumnName("medical_times") + .HasComment("单位体检次数"); + + b.Property("RegisterName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("register_name") + .HasComment("计划名称"); + + b.Property("RegisterNo") + .HasMaxLength(12) + .HasColumnType("character varying(12)") + .HasColumnName("register_no") + .HasComment("计划号"); + + b.HasKey("Id"); + + b.HasIndex("CustomerOrgId"); + + b.ToTable("customer_org_register"); + + b.HasComment("团检体检登记"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgType", 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("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_org_type") + .IsUnique(); + + b.ToTable("customer_org_type"); + + b.HasComment("客户单位类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Department", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("CodePrefix") + .HasMaxLength(2) + .HasColumnType("character varying(2)") + .HasColumnName("code_prefix"); + + 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("DepartmentTypeFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("department_type_flag"); + + b.Property("DisplayName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("1"); + + b.Property("IsActive") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active"); + + 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") + .HasMaxLength(4) + .HasColumnType("uuid") + .HasColumnName("parent_id") + .IsFixedLength(); + + b.Property("PathCode") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("path_code"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName", "ParentId" }, "ix_department") + .IsUnique(); + + b.ToTable("department"); + + b.HasComment("部门,已经废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DeviceType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("仪器类别编号"); + + b.Property("CheckTypeFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("check_type_flag"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.ToTable("device_type"); + + b.HasComment("仪器类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Diagnosis", 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("DiagnosisLevelId") + .HasColumnType("smallint") + .HasColumnName("diagnosis_level_id") + .HasComment("诊断级别"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'") + .HasComment("适用性别"); + + b.Property("IsIll") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_ill") + .HasComment("是疾病"); + + b.Property("IsSummaryTemplate") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_summary_template") + .HasDefaultValueSql("'N'") + .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("SimpleCode") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("simple_code"); + + b.Property("SuggestionName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("suggestion_name") + .HasComment("建议名称"); + + b.HasKey("Id"); + + b.HasIndex("DiagnosisLevelId"); + + b.HasIndex("ItemTypeId"); + + b.ToTable("diagnosis"); + + b.HasComment("诊断设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisLevel", b => + { + b.Property("Id") + .HasColumnType("smallint") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("display_name"); + + 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.HasKey("Id"); + + b.ToTable("diagnosis_level"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisPostfix", 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("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_diagnosis_postfix") + .IsUnique(); + + b.ToTable("diagnosis_postfix"); + + b.HasComment("诊断后缀设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisTemplate", 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("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_diagnosis_template") + .IsUnique(); + + b.ToTable("diagnosis_template"); + + b.HasComment("诊断模板设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisTemplateDetail", b => + { + b.Property("DiagnosisTemplateId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_template_id") + .IsFixedLength() + .HasComment("诊断模板编号"); + + b.Property("DiagnosisId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_id") + .IsFixedLength() + .HasComment("诊断编号"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("DiagnosisTemplateId", "DiagnosisId") + .HasName("pk_diagnosis_template_detail"); + + b.HasIndex("DiagnosisId"); + + b.ToTable("diagnosis_template_detail"); + + b.HasComment("诊断模板包含明细"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisType", 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("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("path_code") + .HasComment("路径编码"); + + b.HasKey("Id"); + + b.ToTable("diagnosis_type"); + + b.HasComment("诊断类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.FieldComparison", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("FieldName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("field_name") + .HasComment("字段名"); + + b.Property("NewKeyValue") + .IsRequired() + .HasColumnType("text") + .HasColumnName("new_key_value") + .HasComment("新系统主键值"); + + b.Property("OldKeyValue") + .IsRequired() + .HasColumnType("text") + .HasColumnName("old_key_value") + .HasComment("老系统主键值"); + + b.Property("TableName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("table_name") + .HasComment("表名"); + + b.HasKey("Id"); + + b.ToTable("field_comparison"); + + b.HasComment("字段对照"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.FollowUpMode", 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("smallint") + .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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.ToTable("follow_up_mode"); + + b.HasComment("随访方式"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.FollowUpPlan", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("content") + .HasComment("随访内容"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("CycleDays") + .HasColumnType("smallint") + .HasColumnName("cycle_days") + .HasComment("周期天数"); + + b.Property("DoctorUserId") + .HasColumnType("uuid") + .HasColumnName("doctor_user_id") + .HasComment("医生"); + + b.Property("FollowUpModeId") + .HasColumnType("uuid") + .HasColumnName("follow_up_mode_id") + .IsFixedLength() + .HasComment("随访方式"); + + b.Property("FollowUpTypeId") + .HasColumnType("uuid") + .HasColumnName("follow_up_type_id") + .IsFixedLength() + .HasComment("随访类别"); + + b.Property("IsLoop") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_loop") + .HasDefaultValueSql("'N'") + .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("PerfomFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("perfom_flag") + .HasComment("执行标志"); + + b.Property("PerfomTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("perfom_time") + .HasComment("执行时间"); + + b.Property("PerfomUserId") + .HasColumnType("uuid") + .HasColumnName("perfom_user_id") + .HasComment("执行者用户ID"); + + b.Property("Remark") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("remark") + .HasComment("备注"); + + b.HasKey("Id"); + + b.ToTable("follow_up_plan"); + + b.HasComment("随访计划"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.FollowUpType", 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("smallint") + .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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.ToTable("follow_up_type"); + + b.HasComment("随访类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ForSex", b => + { + b.Property("Id") + .HasMaxLength(1) + .HasColumnType("character(1)") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("display_name"); + + 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(10) + .HasColumnType("character varying(10)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.ToTable("for_sex"); + + b.HasComment("适用性别设置,固定编码"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Grouping", 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("DisplayName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name"); + + 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("ModifiedDate") + .HasColumnType("date") + .HasColumnName("modified_date"); + + b.Property("Modifier") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("modifier"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_grouping") + .IsUnique(); + + b.ToTable("grouping"); + + b.HasComment("废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.GuideType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasColumnName("id") + .IsFixedLength(); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("DisplayName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .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.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("guide_type"); + + b.HasComment("指引类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.HealthCertificate", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .HasComment("登记流水号"); + + b.Property("CertificateDate") + .HasColumnType("date") + .HasColumnName("certificate_date") + .HasComment("发证日期"); + + b.Property("CertificateNo") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("certificate_no") + .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("ServiceOrg") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("service_org") + .HasComment("服务单位"); + + b.Property("ServiceTradesId") + .IsRequired() + .HasColumnType("smallint") + .HasColumnName("service_trades_id") + .HasComment("服务行业"); + + b.HasKey("Id"); + + b.ToTable("health_certificate"); + + b.HasComment("健康证办理"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ImportLisResult", b => + { + b.Property("LisRequestNo") + .HasColumnType("uuid") + .HasColumnName("lis_request_no") + .HasComment("条码号"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_id") + .HasComment("项目"); + + b.Property("CheckDoctorName") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("check_doctor_name") + .HasComment("检查医生"); + + b.Property("CheckTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("check_time") + .HasComment("检查日期"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CriticalRangeValue") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("critical_range_value"); + + b.Property("ImportTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("import_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)") + .HasComment("导入日期"); + + b.Property("ItemName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("item_name"); + + b.Property("PatientRegisterNo") + .HasMaxLength(12) + .HasColumnType("character varying(12)") + .HasColumnName("patient_register_no") + .HasComment("条码号"); + + b.Property("ReferenceRangeValue") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("reference_range_value") + .HasComment("参考范围"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("ReportPrompt") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("report_prompt") + .HasComment("报告单提示"); + + b.Property("Result") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("result") + .HasComment("结果"); + + b.Property("Unit") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("unit") + .HasComment("单位"); + + b.HasKey("LisRequestNo", "ItemId") + .HasName("pk_import_lis_result"); + + b.HasIndex(new[] { "PatientRegisterNo" }, "ix_import_lis_result"); + + b.ToTable("import_lis_result"); + + b.HasComment("检验结果中间表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ImportPacsPicture", b => + { + b.Property("CheckRequestNo") + .HasColumnType("uuid") + .HasColumnName("check_request_no") + .HasComment("检查申请单号"); + + b.Property("PictureFilename") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("picture_filename") + .HasComment("图片文件名"); + + b.Property("AsbitemNames") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("asbitem_names") + .HasComment("组合项目名称"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order") + .HasComment("诊断结论"); + + b.Property("ImportTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("import_time") + .HasComment("导入日期"); + + b.Property("IsPrint") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_print") + .HasComment("检查所见"); + + b.Property("PatientRegisterNo") + .HasMaxLength(12) + .HasColumnType("character varying(12)") + .HasColumnName("patient_register_no"); + + b.HasKey("CheckRequestNo", "PictureFilename") + .HasName("pk_import_pacs_picture_1"); + + b.ToTable("import_pacs_picture"); + + b.HasComment("pacs图片中间表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ImportPacsResult", b => + { + b.Property("CheckRequestNo") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("check_request_no"); + + b.Property("AsbitemNames") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("asbitem_names") + .HasComment("组合项目名称"); + + b.Property("CheckDoctorName") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("check_doctor_name") + .HasComment("检查医生"); + + b.Property("CheckItems") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("check_items") + .HasComment("检查部位"); + + b.Property("CheckTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("check_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)") + .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("Description") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)") + .HasColumnName("description") + .HasComment("检查所见"); + + b.Property("ImportTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("import_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)") + .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("PatientRegisterNo") + .HasMaxLength(12) + .HasColumnType("character varying(12)") + .HasColumnName("patient_register_no"); + + b.Property("Suggestion") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("suggestion") + .HasComment("建议"); + + b.Property("Summary") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)") + .HasColumnName("summary") + .HasComment("诊断结论"); + + b.HasKey("CheckRequestNo"); + + b.HasIndex(new[] { "PatientRegisterNo" }, "ix_import_pacs_result"); + + b.ToTable("import_pacs_result"); + + b.HasComment("PACS结果中间表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.InvoiceItemType", 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("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_invoice_item_type") + .IsUnique(); + + b.ToTable("invoice_item_type"); + + b.HasComment("发票项目类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.InvoiceOrg", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("display_name") + .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.Property("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_invoice_org") + .IsUnique(); + + b.ToTable("invoice_org"); + + b.HasComment("发票单位设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Item", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("CalculationFunction") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("calculation_function") + .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("DefaultResult") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("default_result") + .HasComment("默认结果"); + + b.Property("DeviceTypeId") + .HasColumnType("uuid") + .HasColumnName("device_type_id"); + + b.Property("DiagnosisFunction") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("diagnosis_function") + .HasComment("诊断函数"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("EnglishShortName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("english_short_name") + .HasComment("英文缩写"); + + b.Property("InputCheck") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("input_check") + .HasComment("输入结果校验公式"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active") + .HasDefaultValueSql("'Y'") + .HasComment("启用"); + + b.Property("IsCalculationItem") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_calculation_item") + .HasDefaultValueSql("'N'") + .HasComment("是计算项目"); + + b.Property("IsContinueProcess") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_continue_process") + .HasDefaultValueSql("'Y'") + .HasComment("是继续处理"); + + b.Property("IsDiagnosisFunction") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_diagnosis_function") + .HasDefaultValueSql("'N'") + .HasComment("启用诊断函数"); + + b.Property("IsNameIntoSummary") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_name_into_summary") + .HasDefaultValueSql("'N'") + .HasComment("名称进入小结"); + + b.Property("IsProduceSummary") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_produce_summary") + .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("LineModeFlag") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasDefaultValue('2') + .HasColumnName("line_mode_flag") + .HasComment("项目结果行模式"); + + b.Property("Price") + .ValueGeneratedOnAdd() + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price") + .HasDefaultValueSql("0") + .HasComment("价格"); + + b.Property("PriceItemId") + .HasMaxLength(8) + .HasColumnType("uuid") + .HasColumnName("price_item_id") + .HasComment("价表项目编码"); + + b.Property("ReferenceRangeTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("reference_range_type_flag") + .HasDefaultValueSql("'0'::bpchar") + .HasComment("参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素"); + + b.Property("ResultTemplateTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("result_template_type_flag") + .HasDefaultValueSql("0") + .HasComment("结果模板类别标志"); + + b.Property("SimpleCode") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("simple_code"); + + b.Property("UnitId") + .HasColumnType("uuid") + .HasColumnName("unit_id") + .HasComment("单位"); + + b.HasKey("Id"); + + b.HasIndex("ItemTypeId"); + + b.HasIndex(new[] { "DisplayName", "ItemTypeId" }, "ix_item") + .IsUnique(); + + b.ToTable("item"); + + b.HasComment("项目设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemDefaultResult", 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(50) + .HasColumnType("character varying(50)") + .HasColumnName("display_name") + .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.Property("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_item_default_result") + .IsUnique(); + + b.ToTable("item_default_result"); + + b.HasComment("项目默认结果设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultMatch", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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("DiagnosisId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_id") + .IsFixedLength() + .HasComment("诊断编号"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_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("Result") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("result") + .HasComment("结果"); + + b.HasKey("Id"); + + b.HasIndex("DiagnosisId"); + + b.HasIndex("ItemId"); + + b.ToTable("item_result_match"); + + b.HasComment("结果匹配设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultTemplate", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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("DiagnosisId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_id") + .HasComment("诊断编号"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("IsNameIntoSummary") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_name_into_summary") + .HasComment("小结前是否加名称"); + + b.Property("IsResultIntoSummary") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_result_into_summary"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_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("Result") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("result") + .HasComment("结果"); + + b.Property("ResultStatusId") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("character varying(2)") + .HasColumnName("result_status_id") + .HasComment("结果状态"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("simple_code") + .HasComment("拼音简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ItemId", "Result" }, "ix_item_result_template") + .IsUnique(); + + b.ToTable("item_result_template"); + + b.HasComment("项目结果模板设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultTemplateType", 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"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_id") + .IsFixedLength(); + + 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(new[] { "ItemId", "DisplayName" }, "ix_item_result_template_type") + .IsUnique(); + + b.ToTable("item_result_template_type"); + + b.HasComment("项目结果模板类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemTemplate", 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"); + + 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") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_item_template") + .IsUnique(); + + b.ToTable("item_template"); + + b.HasComment("项目模板设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemTemplateDetail", b => + { + b.Property("ItemTemplateId") + .HasColumnType("uuid") + .HasColumnName("item_template_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("ItemTemplateId", "ItemId") + .HasName("pk_item_template_detail"); + + b.HasIndex("ItemId"); + + b.ToTable("item_template_detail"); + + b.HasComment("项目模板明细"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("CheckTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("check_type_flag") + .HasDefaultValueSql("'G'::bpchar") + .HasComment("检查类别,0-普通检查,1-检验,2-影像检查"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999"); + + b.Property("GuidTypeId") + .HasColumnType("character(1)") + .HasColumnName("guid_type_id") + .IsFixedLength() + .HasComment("指引类别"); + + b.Property("IsMergeAsbitem") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_merge_asbitem") + .HasDefaultValueSql("'N'") + .HasComment("合并组合项目,Y-是,N-否"); + + b.Property("IsWrap") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasColumnName("is_wrap") + .HasDefaultValueSql("'N'") + .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("MedicalReportTypeId") + .HasColumnType("character(1)") + .HasColumnName("medical_report_type_id") + .IsFixedLength() + .HasComment("体检报告类别"); + + b.Property("ParentId") + .HasColumnType("uuid") + .HasColumnName("parent_id") + .IsFixedLength() + .HasComment("父id"); + + b.Property("PathCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("path_code") + .HasComment("路径编码"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex("GuidTypeId"); + + b.HasIndex("MedicalReportTypeId"); + + b.HasIndex(new[] { "DisplayName", "ParentId" }, "ix_item_type") + .IsUnique(); + + b.ToTable("item_type"); + + b.HasComment("项目类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.LisRequest", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("IsPrint") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_print") + .HasDefaultValueSql("'N'") + .HasComment("是否已打印"); + + b.Property("IsSignIn") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_sign_in") + .HasDefaultValueSql("'N'") + .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("LisRequestNo") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("lis_request_no") + .HasComment("检验申请单号"); + + b.Property("SampleContainerId") + .HasColumnType("uuid") + .HasColumnName("sample_container_id") + .HasComment("标本容器编号"); + + b.Property("SampleTypeId") + .HasColumnType("uuid") + .HasColumnName("sample_type_id") + .HasComment("标本类型"); + + b.Property("SamplerId") + .HasColumnType("uuid") + .HasColumnName("sampler_id") + .HasComment("采样人ID"); + + b.Property("SamplingTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("sampling_time") + .HasComment("采样时间"); + + b.Property("SignInOrder") + .HasColumnType("integer") + .HasColumnName("sign_in_order") + .HasComment("签收顺序"); + + b.Property("SignInPerson") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("sign_in_person") + .HasComment("签收人姓名"); + + b.Property("SignInTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("sign_in_time") + .HasComment("签收时间"); + + b.HasKey("Id"); + + b.HasIndex("SampleContainerId"); + + b.HasIndex("SampleTypeId"); + + b.HasIndex(new[] { "LisRequestNo" }, "ix_lis_request") + .IsUnique(); + + b.ToTable("lis_request"); + + b.HasComment("检验申请单"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MaritalStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("id") + .HasDefaultValueSql("'0'::bpchar") + .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(10) + .HasColumnType("character varying(10)") + .HasColumnName("display_name") + .HasComment("婚姻状况名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_marital_status") + .IsUnique(); + + b.ToTable("marital_status"); + + b.HasComment("婚姻状况设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalConclusion", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("体检结论名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("MedicalConclusionTypeId") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("character(2)") + .HasColumnName("medical_conclusion_type_id") + .IsFixedLength(); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex("MedicalConclusionTypeId"); + + b.ToTable("medical_conclusion"); + + b.HasComment("体检结论设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalConclusionType", b => + { + b.Property("Id") + .HasMaxLength(2) + .HasColumnType("character(2)") + .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"); + + 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(new[] { "DisplayName" }, "ix_medical_conclusion_type") + .IsUnique(); + + b.ToTable("medical_conclusion_type"); + + b.HasComment("体检结论类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalPackage", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'::bpchar") + .HasComment("适用性别"); + + b.Property("IsActive") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active") + .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("Price") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price") + .HasComment("价格"); + + b.Property("Remark") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_medical_package") + .IsUnique(); + + b.ToTable("medical_package"); + + b.HasComment("体检套餐主档设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalPackageDetail", b => + { + b.Property("MedicalPackageId") + .HasColumnType("uuid") + .HasColumnName("medical_package_id") + .IsFixedLength() + .HasComment("套餐编号"); + + b.Property("AsbitemId") + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength() + .HasComment("组合项目编号"); + + b.Property("Amount") + .HasColumnType("smallint") + .HasColumnName("amount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Price") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price"); + + b.HasKey("MedicalPackageId", "AsbitemId") + .HasName("pk_medical_package_detail"); + + b.HasIndex("AsbitemId"); + + b.ToTable("medical_package_detail"); + + b.HasComment("体检套餐包含的组合项目设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalReportType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasColumnName("id") + .IsFixedLength(); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("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("DisplayName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("1") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("medical_report_type"); + + b.HasComment("体检报告类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_medical_type") + .IsUnique(); + + b.ToTable("medical_type"); + + b.HasComment("体检类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MenuInfo", 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(999999) + .HasColumnName("display_order"); + + b.Property("IconName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("icon_name") + .HasComment("菜单图标"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasColumnName("is_active") + .HasDefaultValueSql("'Y'") + .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("MenuType") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasDefaultValue('1') + .HasColumnName("menu_type"); + + b.Property("ParentId") + .HasColumnType("uuid") + .HasColumnName("parent_id") + .IsFixedLength() + .HasComment("父id"); + + b.Property("RouteUrl") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("route_url") + .HasComment("路由地址"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName", "ParentId" }, "ix_menu_info") + .IsUnique(); + + b.ToTable("menu_info"); + + b.HasComment("菜单设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Nation", b => + { + b.Property("Id") + .HasMaxLength(3) + .HasColumnType("character(3)") + .HasColumnName("id") + .IsFixedLength() + .HasComment("编号"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CountryCode") + .HasMaxLength(2) + .HasColumnType("character varying(2)") + .HasColumnName("country_code"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("拼音简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_nation") + .IsUnique(); + + b.ToTable("nation"); + + b.HasComment("民族设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.OcCheckType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("职业病检查类别名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("显示顺序"); + + b.HasKey("Id"); + + b.ToTable("oc_check_type"); + + b.HasComment("职业病检查类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.OperateLog", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ComputerName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("computer_name"); + + 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("OperateContent") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("operate_content"); + + b.Property("OperateTime") + .HasColumnType("date") + .HasColumnName("operate_time"); + + b.Property("OperateType") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("operate_type"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("remark"); + + b.Property("Sqlsyntax") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("sqlsyntax"); + + b.Property("TableName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("table_name"); + + b.Property("UserId") + .HasMaxLength(16) + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("WindowName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("window_name"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ComputerName" }, "ix_operate_log"); + + b.HasIndex(new[] { "WindowName" }, "ix_operate_log_1"); + + b.ToTable("operate_log"); + + b.HasComment("操作日志,已经废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.OrganizationUnitsCustomerOrg", b => + { + b.Property("CustomerOrgId") + .HasColumnType("uuid") + .HasColumnName("customer_org_id") + .IsFixedLength() + .HasComment("客户单位编号"); + + b.Property("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("organization_unit_id") + .IsFixedLength() + .HasComment("体检中心编号"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("CustomerOrgId", "OrganizationUnitId") + .HasName("pk_medical_center_org"); + + b.HasIndex("OrganizationUnitId"); + + b.ToTable("organization_units_customer_org"); + + b.HasComment("体检中心单位权限"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Patient", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Address") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("address") + .HasComment("地址"); + + b.Property("BirthDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("birth_date") + .HasComment("出生日期"); + + b.Property("BirthPlaceId") + .HasColumnType("uuid") + .HasColumnName("birth_place_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(30) + .HasColumnType("character varying(30)") + .HasColumnName("display_name") + .HasComment("姓名"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("email") + .HasComment("email"); + + b.Property("IdNo") + .HasMaxLength(18) + .HasColumnType("character varying(18)") + .HasColumnName("id_no") + .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("'9'") + .HasComment("婚姻状况"); + + b.Property("MedicalCenterId") + .HasColumnType("uuid") + .HasColumnName("medical_center_id") + .HasComment("组织单位ID"); + + b.Property("MobileTelephone") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("mobile_telephone") + .HasComment("手机号"); + + b.Property("NationId") + .HasColumnType("text") + .HasColumnName("nation_id") + .IsFixedLength() + .HasComment("民族编号"); + + b.Property("PatientNo") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("patient_no") + .HasComment("档案号"); + + b.Property("PatientPassword") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("patient_password") + .HasComment("登录密码"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("postal_code") + .HasComment("邮政编码"); + + b.Property("SexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("sex_id") + .HasDefaultValueSql("'U'") + .HasComment("性别"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("telephone") + .HasComment("电话"); + + b.HasKey("Id"); + + b.HasIndex("PatientNo") + .IsUnique(); + + b.HasIndex(new[] { "IdNo" }, "ix_patient"); + + b.HasIndex(new[] { "DisplayName" }, "ix_patient_1"); + + b.ToTable("patient"); + + b.HasComment("体检人员档案"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientOccupationalDisease", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AbnormalTimes") + .HasColumnType("integer") + .HasColumnName("abnormal_times"); + + b.Property("AbortionTimes") + .HasColumnType("integer") + .HasColumnName("abortion_times"); + + b.Property("ChildrenNum") + .HasColumnType("integer") + .HasColumnName("children_num"); + + 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("DiagnosisDate") + .HasColumnType("date") + .HasColumnName("diagnosis_date"); + + b.Property("DiagnosisHospital") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("diagnosis_hospital"); + + b.Property("DrinkFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("drink_flag"); + + b.Property("DrinkNum") + .HasColumnType("integer") + .HasColumnName("drink_num"); + + b.Property("DrinkYears") + .HasColumnType("integer") + .HasColumnName("drink_years"); + + b.Property("FirstMenstruation") + .HasColumnType("integer") + .HasColumnName("first_menstruation"); + + b.Property("HandleSuggestion") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("handle_suggestion"); + + 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("MenstrualHistory") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("menstrual_history"); + + b.Property("MenstruationCycle") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("menstruation_cycle"); + + b.Property("MenstruationEndAge") + .HasColumnType("integer") + .HasColumnName("menstruation_end_age"); + + b.Property("MenstruationFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("menstruation_flag"); + + b.Property("MenstruationTimeLength") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("menstruation_time_length"); + + b.Property("NoOccupAbSuggestion") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("no_occup_ab_suggestion"); + + b.Property("NoOccupationalAbnormal") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("no_occupational_abnormal"); + + b.Property("OcCheckTypeId") + .HasColumnType("uuid") + .HasColumnName("oc_check_type_id") + .IsFixedLength(); + + b.Property("OccupationalAbSuggestion") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("occupational_ab_suggestion"); + + b.Property("OccupationalAbnormal") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("occupational_abnormal"); + + b.Property("OccupationalDisease") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("occupational_disease"); + + b.Property("Other") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("other"); + + b.Property("PoisonWorkTime") + .HasMaxLength(6) + .HasColumnType("character varying(6)") + .HasColumnName("poison_work_time"); + + b.Property("PrematureBirthTimes") + .HasColumnType("integer") + .HasColumnName("premature_birth_times"); + + b.Property("PreviousHistory") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("previous_history"); + + b.Property("Recovery") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("recovery"); + + b.Property("SmokeFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("smoke_flag"); + + b.Property("SmokeNum") + .HasColumnType("integer") + .HasColumnName("smoke_num"); + + b.Property("SmokeYears") + .HasColumnType("integer") + .HasColumnName("smoke_years"); + + b.Property("StillbirthTimes") + .HasColumnType("integer") + .HasColumnName("stillbirth_times"); + + b.Property("TotalWorkTime") + .HasMaxLength(6) + .HasColumnType("character varying(6)") + .HasColumnName("total_work_time"); + + b.HasKey("Id"); + + b.ToTable("patient_occupational_disease"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientOccupationalHistory", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("BeginDate") + .HasColumnType("date") + .HasColumnName("begin_date"); + + 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("EndDate") + .HasColumnType("date") + .HasColumnName("end_date"); + + 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("Org") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("org"); + + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id"); + + b.Property("Poison") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("poison"); + + b.Property("ProtectiveMeasures") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("protective_measures"); + + b.Property("WorkShop") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("work_shop"); + + b.Property("WorkType") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("work_type"); + + b.HasKey("Id"); + + b.HasIndex("PatientRegisterId"); + + b.ToTable("patient_occupational_history"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientPoison", b => + { + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id"); + + b.Property("PoisonId") + .HasColumnType("uuid") + .HasColumnName("poison_id") + .IsFixedLength(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("PatientRegisterId", "PoisonId") + .HasName("pk_patient_poison"); + + b.HasIndex("PoisonId"); + + b.ToTable("patient_poison"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientRegister", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .HasComment("登记流水号"); + + b.Property("Age") + .HasColumnType("smallint") + .HasColumnName("age") + .HasComment("年龄"); + + b.Property("AuditDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("audit_date") + .HasComment("审核日期"); + + b.Property("AuditDoctorId") + .HasColumnType("uuid") + .HasColumnName("audit_doctor_id") + .HasComment("审核医生"); + + b.Property("BirthDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("birth_date") + .HasComment("出生日期"); + + b.Property("CompleteFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("complete_flag") + .HasDefaultValueSql("'0'::bpchar") + .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("CustomerOrgGroupId") + .HasColumnType("uuid") + .HasColumnName("customer_org_group_id") + .IsFixedLength() + .HasComment("分组"); + + b.Property("CustomerOrgId") + .HasColumnType("uuid") + .HasColumnName("customer_org_id") + .IsFixedLength() + .HasComment("单位编号"); + + b.Property("CustomerOrgRegisterId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasDefaultValue(new Guid("00000000-0000-0000-0000-000000000000")) + .HasColumnName("customer_org_register_id") + .HasComment("客户单位登记ID"); + + b.Property("GuidePrintTimes") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0) + .HasColumnName("guide_print_times") + .HasComment("指引单打印次数"); + + b.Property("InterposeMeasure") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("interpose_measure") + .HasComment("干预措施"); + + b.Property("IsAudit") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_audit") + .HasDefaultValueSql("'N'") + .HasComment("审核"); + + b.Property("IsLock") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_lock") + .HasDefaultValueSql("'N'") + .HasComment("锁住"); + + b.Property("IsMedicalStart") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_medical_start") + .HasDefaultValueSql("'N'") + .HasComment("体检开始标志"); + + b.Property("IsNameHide") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_name_hide") + .HasDefaultValueSql("'N'") + .HasComment("隐藏姓名"); + + b.Property("IsPhoneFollow") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_phone_follow") + .HasDefaultValueSql("'N'") + .HasComment("电话随访"); + + b.Property("IsRecoverGuide") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_recover_guide") + .HasDefaultValueSql("'N'") + .HasComment("指引单收回"); + + b.Property("IsUpload") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_upload") + .HasDefaultValueSql("'N'") + .HasComment("是否上传到WEB"); + + b.Property("IsVip") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_vip") + .HasDefaultValueSql("'N'") + .HasComment("vip客户"); + + b.Property("JobCardNo") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("job_card_no") + .HasComment("工卡号"); + + b.Property("JobPost") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("job_post") + .HasComment("职务"); + + b.Property("JobTitle") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("job_title") + .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("'9'") + .HasComment("婚姻状况"); + + b.Property("MedicalCardNo") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("medical_card_no") + .HasComment("体检卡号"); + + b.Property("MedicalCenterId") + .HasColumnType("uuid") + .HasColumnName("medical_center_id") + .HasComment("体检中心ID"); + + b.Property("MedicalConclusionId") + .HasColumnType("uuid") + .HasColumnName("medical_conclusion_id") + .IsFixedLength() + .HasComment("体检结论"); + + b.Property("MedicalPackageId") + .HasColumnType("uuid") + .HasColumnName("medical_package_id") + .IsFixedLength() + .HasComment("套餐"); + + b.Property("MedicalStartDate") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("medical_start_date") + .HasDefaultValueSql("date(timezone('UTC-8'::text, now()))") + .HasComment("体检开始日期"); + + b.Property("MedicalTimes") + .HasColumnType("smallint") + .HasColumnName("medical_times") + .HasComment("体检次数"); + + b.Property("MedicalTypeId") + .HasColumnType("uuid") + .HasColumnName("medical_type_id") + .IsFixedLength() + .HasComment("体检类别"); + + b.Property("PatientId") + .HasColumnType("uuid") + .HasColumnName("patient_id") + .HasComment("档案号"); + + b.Property("PatientName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("patient_name") + .HasComment("姓名"); + + b.Property("PatientRegisterNo") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("patient_register_no") + .HasComment("条码号"); + + b.Property("PersonnelTypeId") + .HasColumnType("uuid") + .HasColumnName("personnel_type_id") + .IsFixedLength() + .HasComment("人员类别"); + + b.Property("Photo") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("photo") + .HasComment("照片"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("ReportPrintTimes") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0) + .HasColumnName("report_print_times") + .HasComment("体检报告打印次数"); + + b.Property("Salesman") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("salesman") + .HasComment("介绍人"); + + b.Property("SexHormoneTermId") + .HasColumnType("uuid") + .HasColumnName("sex_hormone_term_id") + .HasComment("性激素期限"); + + b.Property("SexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("sex_id") + .HasDefaultValueSql("'U'") + .HasComment("性别"); + + b.Property("SummaryDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("summary_date") + .HasComment("总检日期"); + + b.Property("SummaryDoctorId") + .HasColumnType("uuid") + .HasColumnName("summary_doctor_id") + .HasComment("总检医生"); + + b.Property("ThirdInfo") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("third_info") + .HasComment("附加第三方信息"); + + b.HasKey("Id"); + + b.HasIndex("MaritalStatusId"); + + b.HasIndex(new[] { "MedicalCenterId" }, "fki_fk_patient_register_ororganization_unit"); + + b.HasIndex(new[] { "PatientRegisterNo" }, "ix_patient_register") + .IsUnique(); + + b.HasIndex(new[] { "PatientId", "MedicalTimes" }, "ix_patient_register_1") + .IsUnique(); + + b.HasIndex(new[] { "PatientName" }, "ix_patient_register_2"); + + b.ToTable("patient_register"); + + b.HasComment("体检登记主档"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientSymptom", b => + { + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id"); + + b.Property("SymptomId") + .HasColumnType("uuid") + .HasColumnName("symptom_id") + .IsFixedLength(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Degree") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("degree"); + + b.Property("TimeLength") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("time_length"); + + b.HasKey("PatientRegisterId", "SymptomId") + .HasName("pk_patient_symptom"); + + b.HasIndex("SymptomId"); + + b.ToTable("patient_symptom"); + + b.HasComment("职业病-体检病人症状"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PayMode", b => + { + b.Property("Id") + .HasMaxLength(4) + .HasColumnType("character varying(4)") + .HasColumnName("id") + .HasComment("编号,固定编码"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("character(1)") + .HasDefaultValue('Y') + .HasColumnName("is_active"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_payment_mode") + .IsUnique(); + + b.ToTable("pay_mode"); + + b.HasComment("支付方式设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PersonnelType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_personnel_type") + .IsUnique(); + + b.ToTable("personnel_type"); + + b.HasComment("人员类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PhoneFollow", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("FollowContent") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("follow_content") + .HasComment("随访内容"); + + b.Property("FollowUpPlanId") + .HasColumnType("uuid") + .HasColumnName("follow_up_plan_id") + .HasComment("随访计划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("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("病人登记ID"); + + b.Property("ReplyContent") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("reply_content") + .HasComment("回复内容"); + + b.HasKey("Id"); + + b.HasIndex("PatientRegisterId"); + + b.ToTable("phone_follow"); + + b.HasComment("电话随访"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Poison", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("毒害名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("PoisonTypeId") + .HasColumnType("uuid") + .HasColumnName("poison_type_id") + .IsFixedLength(); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex("PoisonTypeId"); + + b.ToTable("poison"); + + b.HasComment("毒害因素设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PoisonType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("毒害类别名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("poison_type"); + + b.HasComment("毒害因素类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PositionType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("职务编号"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("LastModificationTime") + .IsRequired() + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time") + .HasComment("最后修改日期"); + + b.Property("LastModifierId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("last_modifier_id") + .HasComment("最后修改者"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("自定义简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_position_type") + .IsUnique(); + + b.ToTable("position_type"); + + b.HasComment("职务类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PriceItem", 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(50) + .HasColumnType("character varying(50)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("InvoiceItemTypeId") + .HasColumnType("uuid") + .HasColumnName("invoice_item_type_id") + .IsFixedLength() + .HasComment("发票项目类别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("Price") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("price") + .HasComment("价格"); + + b.Property("PriceItemCode") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("price_item_code") + .HasComment("价表编码"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceItemTypeId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_price_item") + .IsUnique(); + + b.ToTable("price_item"); + + b.HasComment("价表项目设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PrimarykeyBuilder", b => + { + b.Property("PrimarykeyBuilderId") + .HasMaxLength(30) + .HasColumnType("character varying(30)") + .HasColumnName("primarykey_builder_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("DateString") + .HasMaxLength(8) + .HasColumnType("character(8)") + .HasColumnName("date_string") + .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("SerialNo") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("serial_no") + .HasComment("序列号"); + + b.HasKey("PrimarykeyBuilderId"); + + b.ToTable("primarykey_builder"); + + b.HasComment("主键产生器"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.QueueRegister", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("CallTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("call_time") + .HasComment("叫号时间"); + + b.Property("CompleteFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("complete_flag") + .HasDefaultValueSql("0") + .HasComment("完成标志"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order") + .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("NoCompleteReason") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("no_complete_reason") + .HasDefaultValueSql("0") + .HasComment("未完成原因"); + + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("病人登记ID"); + + b.Property("RoomId") + .HasColumnType("uuid") + .HasColumnName("room_id") + .IsFixedLength() + .HasComment("房间ID"); + + b.HasKey("Id"); + + b.HasIndex("PatientRegisterId"); + + b.ToTable("queue_register"); + + b.HasComment("排队登记"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReferenceRange", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength() + .HasComment("参考范围编号"); + + b.Property("AgeLowerLimit") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("age_lower_limit") + .HasDefaultValueSql("0") + .HasComment("年龄下限"); + + b.Property("AgeUpperLimit") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("age_upper_limit") + .HasDefaultValueSql("200") + .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("CriticalRangeValue") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("critical_range_value"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'::bpchar") + .HasComment("性别"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_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("LowerDiagnosisId") + .HasColumnType("uuid") + .HasColumnName("lower_diagnosis_id") + .IsFixedLength() + .HasComment("偏低诊断"); + + b.Property("ReferenceRangeTypeFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("reference_range_type_flag") + .HasComment("参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素"); + + b.Property("ReferenceRangeValue") + .HasMaxLength(150) + .HasColumnType("character varying(150)") + .HasColumnName("reference_range_value"); + + b.Property("UpperDiagnosisId") + .HasColumnType("uuid") + .HasColumnName("upper_diagnosis_id") + .IsFixedLength() + .HasComment("偏高诊断"); + + b.HasKey("Id"); + + b.HasIndex("ItemId"); + + b.ToTable("reference_range"); + + b.HasComment("项目参考范围设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheck", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AuditTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("audit_time") + .HasComment("审核时间"); + + b.Property("AuditorUserId") + .HasColumnType("uuid") + .HasColumnName("auditor_user_id") + .HasComment("审核医生ID"); + + b.Property("CheckDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("check_date") + .HasComment("检查日期"); + + b.Property("CheckDoctorId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("check_doctor_id") + .HasComment("检查医生ID"); + + b.Property("CheckRequestNo") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("check_request_no") + .HasComment("检查单号"); + + b.Property("CheckRequestPrintTimes") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("check_request_print_times") + .HasDefaultValueSql("0") + .HasComment("检查申请单打印次数"); + + b.Property("CompleteFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("complete_flag") + .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("CriticalValue") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("critical_value") + .HasComment("危急值"); + + b.Property("CriticalValueCreateDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("critical_value_create_date") + .HasComment("危急值创建日期"); + + b.Property("CriticalValueFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("critical_value_flag") + .HasDefaultValueSql("0") + .HasComment("危急值标志"); + + b.Property("CriticalValueProcessContent") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("critical_value_process_content") + .HasComment("危急值处理内容"); + + b.Property("CriticalValueProcessDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("critical_value_process_date") + .HasComment("危急值处理日期"); + + b.Property("CriticalValueProcessDoctor") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("critical_value_process_doctor") + .HasComment("危急值处理医生"); + + b.Property("CriticalValueProcessFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("critical_value_process_flag") + .HasComment("危急值处理标志"); + + b.Property("IsAudit") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_audit") + .HasComment("是审核"); + + b.Property("IsLock") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_lock") + .HasDefaultValueSql("'N'") + .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("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id"); + + b.Property("ThirdInfo") + .HasMaxLength(80) + .HasColumnType("character varying(80)") + .HasColumnName("third_info") + .HasComment("第三方信息"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "CheckRequestNo" }, "ix_register_check_1"); + + b.ToTable("register_check"); + + b.HasComment("登记检查单"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckAsbitem", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .HasComment("主键"); + + b.Property("Amount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("amount") + .HasDefaultValueSql("1") + .HasComment("数量"); + + b.Property("AsbitemId") + .HasMaxLength(6) + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength() + .HasComment("组合项目"); + + b.Property("ChargePrice") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("charge_price") + .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("GroupPackageId") + .HasColumnType("uuid") + .HasColumnName("group_package_id"); + + b.Property("IsCharge") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_charge") + .HasDefaultValueSql("'N'") + .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("LisRequestId") + .HasColumnType("uuid") + .HasColumnName("lis_request_id") + .HasComment("LIS申请ID"); + + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("登记流水号"); + + b.Property("PayTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("pay_type_flag") + .HasDefaultValueSql("0") + .HasComment("支付方式,比如是自费、免费、单位支付"); + + b.Property("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id"); + + b.Property("StandardPrice") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)") + .HasColumnName("standard_price") + .HasComment("标准价格"); + + b.HasKey("Id"); + + b.HasIndex("AsbitemId"); + + b.HasIndex("RegisterCheckId"); + + b.HasIndex(new[] { "PatientRegisterId", "AsbitemId" }, "ix_register_asbitem") + .IsUnique(); + + b.ToTable("register_check_asbitem"); + + b.HasComment("检查组合项目记录"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckCriticalValue", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("CriticalValue") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("critical_value") + .HasComment("危急值"); + + b.Property("Doctor") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("doctor") + .HasComment("处理医生"); + + b.Property("IsComplete") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_complete") + .HasDefaultValueSql("'N'") + .HasComment("是否完成"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_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("ProcessTypeFlag") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('0') + .HasColumnName("process_type_flag") + .HasComment("处理类别标志"); + + b.Property("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id") + .HasComment("登记检查ID"); + + b.HasKey("Id"); + + b.ToTable("register_check_critical_value"); + + b.HasComment("检查危急值"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckItem", b => + { + b.Property("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_id") + .IsFixedLength() + .HasComment("项目编号"); + + b.Property("CheckDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("check_date") + .HasComment("检查日期"); + + b.Property("CheckDoctorName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("check_doctor_name") + .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("CriticalRangeValue") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("critical_range_value") + .HasComment("危急值范围"); + + b.Property("CriticalValue") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("critical_value") + .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("ReferenceRangeValue") + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("reference_range_value") + .HasDefaultValueSql("''::character varying") + .HasComment("参考范围"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)") + .HasColumnName("result") + .HasComment("结果"); + + b.Property("ResultStatusId") + .HasMaxLength(2) + .HasColumnType("character varying(2)") + .HasColumnName("result_status_id") + .HasComment("报告单提示"); + + b.Property("Unit") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("unit") + .HasComment("单位"); + + b.HasKey("RegisterCheckId", "ItemId") + .HasName("pk_register_item_1"); + + b.HasIndex("ItemId"); + + b.HasIndex("ResultStatusId"); + + b.ToTable("register_check_item"); + + b.HasComment("检查明细项目记录"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckPicture", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("1") + .HasComment("显示顺序"); + + b.Property("IsPrint") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_print") + .HasDefaultValueSql("'N'") + .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("PictureFilename") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("picture_filename") + .HasComment("图片名"); + + b.Property("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id") + .HasComment("登记流水号"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "RegisterCheckId", "PictureFilename" }, "ix_check_picture") + .IsUnique(); + + b.ToTable("register_check_picture"); + + b.HasComment("体检登记组合项目图片"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckSuggestion", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id") + .HasComment("登记检查ID"); + + b.Property("Suggestion") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("suggestion") + .HasComment("建议"); + + b.HasKey("Id"); + + b.HasIndex("RegisterCheckId"); + + b.ToTable("register_check_suggestion"); + + b.HasComment("登记检查建议"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckSummary", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("RegisterCheckId") + .HasColumnType("uuid") + .HasColumnName("register_check_id") + .HasComment("登记检查ID"); + + b.Property("Summary") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("summary") + .HasComment("综述"); + + b.Property("SummaryFlag") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("summary_flag") + .HasComment("综述标志"); + + b.HasKey("Id"); + + b.HasIndex("RegisterCheckId"); + + b.ToTable("register_check_summary"); + + b.HasComment("登记检查综述"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Report", b => + { + b.Property("Id") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("id") + .HasComment("主键Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("display_name") + .HasComment("报表名称"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('N') + .HasColumnName("is_active") + .HasComment("启用标志(N:禁用,Y:启用)"); + + 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.ToTable("report"); + + b.HasComment("自定义报表主表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b => + { + b.Property("Id") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("id") + .HasComment("主键Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("display_name") + .HasComment("格式名称"); + + b.Property("IsDefault") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('N') + .HasColumnName("isDefault") + .HasComment("默认标志(N:不默认,Y:默认)"); + + 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("ReportId") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("report_id") + .HasComment("报表ID"); + + b.HasKey("Id"); + + b.HasIndex("ReportId"); + + b.ToTable("report_format"); + + b.HasComment("自定义报表格式表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportFormatTemplate", b => + { + b.Property("Id") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("id") + .HasComment("主键Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DataSetJson") + .HasColumnType("text") + .HasColumnName("data_set_json") + .HasComment("模板文件"); + + b.Property("DisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("display_name") + .HasComment("模板名称"); + + b.Property("IsDefault") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('N') + .HasColumnName("isDefault") + .HasComment("是否默认(N:不默认,Y:默认)"); + + b.Property("IsSystem") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('N') + .HasColumnName("isSystem") + .HasComment("是否系统自定义(N:停用,Y:启用)"); + + 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("ReportFormatId") + .HasColumnType("character varying(16)") + .HasColumnName("report_format_id") + .HasComment("报表格式ID"); + + b.Property("TemplateFile") + .HasColumnType("text") + .HasColumnName("template_file") + .HasComment("模板文件"); + + b.Property("TemplateFileType") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("template_file_type") + .HasDefaultValueSql("1") + .HasComment("模板文件类型(0:FastReport,1:Grid++Report)"); + + b.HasKey("Id"); + + b.HasIndex("ReportFormatId"); + + b.ToTable("report_format_template"); + + b.HasComment("自定义报表格式模板表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportPrinter", b => + { + b.Property("Id") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("id") + .HasComment("主键Id"); + + b.Property("ComputerName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("pc_name") + .HasComment("计算机名称"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationTime") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + 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("PrinterName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("printer_name") + .HasComment("打印机名称"); + + b.Property("ReportId") + .HasColumnType("character varying(16)") + .HasColumnName("report_id") + .HasComment("报表ID"); + + b.HasKey("Id"); + + b.HasIndex("ReportId"); + + b.ToTable("report_printer"); + + b.HasComment("自定义报表客户端打印机设置表"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ResultStatus", b => + { + b.Property("Id") + .HasMaxLength(2) + .HasColumnType("character varying(2)") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DataInputBackgroundColor") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("data_input_background_color") + .HasDefaultValueSql("16777215") + .HasComment("数据录入报告单颜色"); + + b.Property("DataInputFontColor") + .HasColumnType("integer") + .HasColumnName("data_input_font_color") + .HasComment("数据录入字体颜色"); + + b.Property("DataInputPrompt") + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("data_input_prompt") + .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"); + + 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("ReportBackgroundColor") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("report_background_color") + .HasDefaultValueSql("16777215") + .HasComment("报告单背景颜色"); + + b.Property("ReportFontColor") + .HasColumnType("integer") + .HasColumnName("report_font_color") + .HasComment("报告单字体颜色"); + + b.Property("ReportPrompt") + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("report_prompt") + .HasComment("报告单提示"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_result_status") + .IsUnique(); + + b.ToTable("result_status"); + + b.HasComment("结果状态设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Room", 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") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("ForSexId") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("for_sex_id") + .HasDefaultValueSql("'A'::bpchar"); + + b.Property("IsActive") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active"); + + 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("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("department_id") + .IsFixedLength() + .HasComment(""); + + b.Property("RoomTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("room_type_flag") + .HasDefaultValueSql("0"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex("ItemTypeId"); + + b.HasIndex("OrganizationUnitId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_room") + .IsUnique(); + + b.ToTable("room"); + + b.HasComment("房间设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleContainer", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("ContainerColor") + .HasColumnType("integer") + .HasColumnName("container_color") + .HasComment("颜色"); + + b.Property("ContainerColorName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("container_color_name") + .HasComment("颜色名"); + + b.Property("ContainerRemark") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("container_remark"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_sample_container") + .IsUnique(); + + b.ToTable("sample_container"); + + b.HasComment("标本容器设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleGroup", 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("LastModificationTime") + .IsRequired() + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("SampleContainerId") + .HasColumnType("uuid") + .HasColumnName("sample_container_id") + .IsFixedLength() + .HasComment("标本容器ID"); + + b.Property("SampleTypeId") + .HasColumnType("uuid") + .HasColumnName("sample_type_id") + .IsFixedLength() + .HasComment("标本类型ID"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.HasKey("Id"); + + b.HasIndex("SampleContainerId"); + + b.HasIndex("SampleTypeId"); + + b.HasIndex(new[] { "DisplayName" }, "ix_sample_group") + .IsUnique(); + + b.ToTable("sample_group"); + + b.HasComment("标本分组设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleGroupDetail", b => + { + b.Property("SampleGroupId") + .HasColumnType("uuid") + .HasColumnName("sample_group_id") + .IsFixedLength(); + + b.Property("AsbitemId") + .HasColumnType("uuid") + .HasColumnName("asbitem_id") + .IsFixedLength() + .HasComment("组合项目编号"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.HasKey("SampleGroupId", "AsbitemId") + .HasName("pk_sample_group_detail"); + + b.HasIndex("AsbitemId") + .IsUnique(); + + b.ToTable("sample_group_detail"); + + b.HasComment("标本分组包含组合项目设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleType", 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_sample_type"); + + b.ToTable("sample_type"); + + b.HasComment("标本类型设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ServiceTrade", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("department_id") + .IsFixedLength(); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.Property("ValidPeriod") + .HasColumnType("smallint") + .HasColumnName("valid_period") + .HasComment("有效期"); + + b.Property("ValidPeriodDisplayName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("valid_period_display_name"); + + b.Property("ValidPeriodUnit") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("valid_period_unit"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "OrganizationUnitId", "DisplayName" }, "ix_service_trades") + .IsUnique(); + + b.ToTable("service_trades"); + + b.HasComment("服务行业设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SettleAccount", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("CompletedBy") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("completed_by") + .HasComment("结账人"); + + b.Property("CompletedTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("completed_time") + .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("IsComplete") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_complete") + .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("Id"); + + b.ToTable("settle_account"); + + b.HasComment("结账"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Sex", b => + { + b.Property("Id") + .HasMaxLength(1) + .HasColumnType("character(1)") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("sex"); + + b.HasComment("性别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SexHormoneReferenceRange", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("AgeLowerLimit") + .HasColumnType("smallint") + .HasColumnName("age_lower_limit") + .HasComment("年龄下限"); + + b.Property("AgeUpperLimit") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("age_upper_limit") + .HasDefaultValueSql("200") + .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("CriticalRangeValue") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("critical_range_value") + .HasComment("危急值参考范围"); + + b.Property("ItemId") + .HasColumnType("uuid") + .HasColumnName("item_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("LowerDiagnosisId") + .HasColumnType("uuid") + .HasColumnName("lower_diagnosis_id") + .IsFixedLength() + .HasComment("下限诊断"); + + b.Property("ReferenceRangeValue") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("reference_range_value") + .HasComment("参考范围"); + + b.Property("SexHormoneTermId") + .HasColumnType("uuid") + .HasColumnName("sex_hormone_term_id") + .IsFixedLength() + .HasComment("性激素期限ID"); + + b.Property("UpperDiagnosisId") + .HasColumnType("uuid") + .HasColumnName("upper_diagnosis_id") + .IsFixedLength() + .HasComment("上限诊断"); + + b.HasKey("Id"); + + b.HasIndex("ItemId"); + + b.HasIndex("SexHormoneTermId"); + + b.ToTable("sex_hormone_reference_range"); + + b.HasComment("性激素参考范围设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SexHormoneTerm", 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_sex_hormone_term") + .IsUnique(); + + b.ToTable("sex_hormone_term"); + + b.HasComment("性激素期限设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SmsSend", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("content") + .HasComment("短信内容"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("FollowUpPlanId") + .HasColumnType("uuid") + .HasColumnName("follow_up_plan_id") + .HasComment("随访计划ID"); + + b.Property("IsComplete") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_complete") + .HasDefaultValueSql("'N'") + .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("MobileTelephone") + .IsRequired() + .HasMaxLength(11) + .HasColumnType("character varying(11)") + .HasColumnName("mobile_telephone") + .HasComment("手机号"); + + b.Property("PatientId") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("uuid") + .HasColumnName("patient_id") + .HasComment("人员ID"); + + b.Property("PatientName") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("patient_name") + .HasComment("姓名"); + + b.Property("SmsTypeId") + .HasColumnType("uuid") + .HasColumnName("sms_type_id") + .IsFixedLength() + .HasComment("短信类别ID"); + + b.HasKey("Id"); + + b.ToTable("sms_send"); + + b.HasComment("短信发送"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SmsTemplate", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id") + .IsFixedLength(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("content") + .HasComment("短信内容"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.Property("SmsTypeId") + .HasColumnType("uuid") + .HasColumnName("sms_type_id") + .IsFixedLength() + .HasComment("短信类别ID"); + + b.HasKey("Id"); + + b.ToTable("sms_template"); + + b.HasComment("短信模板"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SmsType", 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") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("sms_type"); + + b.HasComment("短信类别"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Suggestion", 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("DiagnosisId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_id") + .IsFixedLength() + .HasComment("诊断ID"); + + 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("SuggestionContent") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("suggestion_content") + .HasComment("建议内容"); + + b.Property("SuggestionType") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("suggestion_type") + .HasDefaultValueSql("'0'::bpchar") + .HasComment("建议类别"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DiagnosisId", "SuggestionContent" }, "ix_suggestion") + .IsUnique(); + + b.ToTable("suggestion"); + + b.HasComment("建议设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumDiagnosis", b => + { + b.Property("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("病人登记ID"); + + b.Property("DiagnosisId") + .HasColumnType("uuid") + .HasColumnName("diagnosis_id") + .IsFixedLength() + .HasComment("诊断ID"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("DisplayOrder") + .HasColumnType("integer") + .HasColumnName("display_order"); + + b.Property("SumSuggestionHeaderId") + .HasColumnType("uuid") + .HasColumnName("sum_suggestion_header_id") + .HasComment("建议头ID"); + + b.HasKey("PatientRegisterId", "DiagnosisId") + .HasName("pk_summary_diagnosis"); + + b.HasIndex("DiagnosisId"); + + b.ToTable("sum_diagnosis"); + + b.HasComment("总检诊断"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SummaryTemplate", 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.Property("TemplateContent") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("template_content") + .HasComment("模板内容"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_summary_template") + .IsUnique(); + + b.ToTable("summary_template"); + + b.HasComment("综述模板设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSuggestionContent", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SuggestionContent") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("character varying(10000)") + .HasColumnName("suggestion_content") + .HasComment("建议内容"); + + b.Property("SuggestionType") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("suggestion_type") + .HasDefaultValueSql("'0'::bpchar") + .HasComment("建议类型"); + + b.Property("SumSuggestionHeaderId") + .HasColumnType("uuid") + .HasColumnName("sum_suggestion_header_id") + .HasComment("建议头ID"); + + b.HasKey("Id"); + + b.HasIndex("SumSuggestionHeaderId"); + + b.ToTable("sum_suggestion_content"); + + b.HasComment("总检建议内容"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSuggestionHeader", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + 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("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("病人登记ID"); + + b.Property("SuggestionFlag") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('0') + .HasColumnName("suggestion_flag") + .HasComment("建议标志"); + + b.Property("SuggestionTitle") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("suggestion_title") + .HasComment("建议标题"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "PatientRegisterId", "SuggestionTitle" }, "ix_sum_suggestion_title") + .IsUnique(); + + b.ToTable("sum_suggestion_header"); + + b.HasComment("总检建议头"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSummaryContent", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + 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("SumSummaryHeaderId") + .HasColumnType("uuid") + .HasColumnName("sum_summary_header_id") + .HasComment("建议头ID"); + + b.Property("SummaryContent") + .IsRequired() + .HasMaxLength(3000) + .HasColumnType("character varying(3000)") + .HasColumnName("summary_content") + .HasComment("建议内容"); + + b.HasKey("Id"); + + b.HasIndex("SumSummaryHeaderId"); + + b.ToTable("sum_summary_content"); + + b.HasComment("总检综述内容"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSummaryHeader", 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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + 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("PatientRegisterId") + .HasColumnType("uuid") + .HasColumnName("patient_register_id") + .HasComment("病人登记ID"); + + b.Property("SummaryFlag") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('0') + .HasColumnName("summary_flag") + .HasComment("综述标志"); + + b.Property("SummaryTitle") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("summary_title") + .HasComment("综述标题"); + + b.HasKey("Id"); + + b.HasIndex("PatientRegisterId"); + + b.ToTable("sum_summary_header"); + + b.HasComment("总检综述头"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Symptom", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("symptom"); + + b.HasComment("症状"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Sysdiagram", 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("Definition") + .HasColumnType("bytea") + .HasColumnName("definition"); + + b.Property("DisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("display_name"); + + 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("PrincipalId") + .HasColumnType("uuid") + .HasColumnName("principal_id"); + + b.Property("Version") + .HasColumnType("integer") + .HasColumnName("version"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "PrincipalId", "DisplayName" }, "uk_principal_name") + .IsUnique(); + + b.ToTable("sysdiagrams"); + + b.HasComment("不是本软件的表,估计是系统自动生成的"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParm", b => + { + b.Property("Id") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("display_name") + .HasComment("参数名"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .HasComment("显示顺序"); + + b.Property("IsPublic") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasDefaultValue('N') + .HasColumnName("is_public") + .HasComment("是否支持设置按体检中心设置参数值(Y 直接取公共参数,无法设置 N.可以设置多个参数)"); + + 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(500) + .HasColumnType("character varying(500)") + .HasColumnName("remark") + .HasComment("备注"); + + b.Property("SimpleCode") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("simple_code"); + + b.Property("SysParmTypeId") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("sys_parm_type_id") + .HasComment("参数类别ID"); + + b.Property("ValueType") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("value_type") + .HasComment("结果类别"); + + b.HasKey("Id"); + + b.HasIndex("SysParmTypeId"); + + b.ToTable("sys_parm"); + + b.HasComment("系统参数设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmType", b => + { + b.Property("Id") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .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") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("parent_id") + .HasComment("父ID"); + + b.Property("SimpleCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("sys_parm_type"); + + b.HasComment("系统参数类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmValue", b => + { + b.Property("SysParmId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("sys_parm_id") + .HasComment("参数ID"); + + b.Property("MedicalCenterId") + .HasColumnType("uuid") + .HasColumnName("medical_center_id") + .IsFixedLength() + .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("LastModificationTime") + .IsRequired() + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("ParmValue") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("parm_value") + .HasComment("参数值"); + + b.Property("Remark") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("remark") + .HasComment("备注"); + + b.HasKey("SysParmId", "MedicalCenterId") + .HasName("pk_sys_parm_value"); + + b.ToTable("sys_parm_value"); + + b.HasComment("系统参数值设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmValueOption", b => + { + b.Property("SysParmId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("sys_parm_id"); + + b.Property("ValueOption") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("value_option") + .HasComment("可选项"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("1"); + + b.Property("ValueOptionName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("value_option_name") + .HasComment("可选项名"); + + b.HasKey("SysParmId", "ValueOption") + .HasName("pk_sys_parm_value_option"); + + b.ToTable("sys_parm_value_option"); + + b.HasComment("系统参数可选值设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.TitleType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("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(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name") + .HasComment("名称"); + + b.Property("DisplayOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "DisplayName" }, "ix_title_type") + .IsUnique(); + + b.ToTable("title_type"); + + b.HasComment("职称类别设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Unit", 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") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("display_order") + .HasDefaultValueSql("999999") + .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("SimpleCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code") + .HasComment("简码"); + + b.HasKey("Id"); + + b.ToTable("unit"); + + b.HasComment("单位设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.User", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Address") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("address"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .IsRequired() + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DepartmentId") + .HasColumnType("uuid") + .HasColumnName("department_id") + .IsFixedLength(); + + b.Property("DisplayName") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("display_name"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("email"); + + b.Property("IsActive") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_active"); + + 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("LockScreenTimeInterval") + .HasColumnType("integer") + .HasColumnName("lock_screen_time_interval"); + + b.Property("ModifiedDate") + .ValueGeneratedOnAdd() + .HasColumnType("date") + .HasColumnName("modified_date") + .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); + + b.Property("Modifier") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("modifier"); + + b.Property("PasswordHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("password_hash"); + + b.Property("PasswordSalt") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("password_salt"); + + b.Property("Photo") + .HasColumnType("bytea") + .HasColumnName("photo"); + + b.Property("PositionTypeId") + .HasColumnType("uuid") + .HasColumnName("position_type_id"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("remark"); + + b.Property("SexId") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("sex_id"); + + b.Property("SimpleCode") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("simple_code"); + + b.Property("Telephone") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("telephone"); + + b.Property("TitleTypeId") + .HasColumnType("uuid") + .HasColumnName("title_type_id"); + + b.Property("UserTypeFlag") + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("user_type_flag") + .HasDefaultValueSql("0") + .HasComment("用户类型"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.ToTable("users"); + + b.HasComment("用户表,废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserDepartment", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("DepartmentId") + .HasColumnType("uuid") + .HasColumnName("department_id") + .IsFixedLength(); + + b.HasKey("UserId", "DepartmentId") + .HasName("pk_user_operate_department"); + + b.HasIndex("DepartmentId"); + + b.ToTable("user_department"); + + b.HasComment("用户科室操作权限,废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserGrouping", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("GroupingId") + .HasColumnType("uuid") + .HasColumnName("grouping_id"); + + b.HasKey("UserId", "GroupingId") + .HasName("pk_user_grouping"); + + b.HasIndex("GroupingId"); + + b.ToTable("user_grouping"); + + b.HasComment("用户组权限-废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserItemType", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("ItemTypeId") + .HasColumnType("uuid") + .HasColumnName("item_type_id") + .IsFixedLength() + .HasComment("项目类别ID"); + + b.HasKey("UserId", "ItemTypeId") + .HasName("pk_user_item_type"); + + b.HasIndex("ItemTypeId"); + + b.ToTable("user_item_type"); + + b.HasComment("用户项目类别权限设置"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserRight", b => + { + b.Property("Application") + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("application"); + + b.Property("WindowName") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("window_name"); + + b.Property("ControlName") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("control_name"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("IsUser") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("is_user"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Status") + .HasMaxLength(1) + .HasColumnType("character(1)") + .HasColumnName("status"); + + b.HasKey("Application", "WindowName", "ControlName", "UserId", "IsUser") + .HasName("pk_sys_function"); + + b.ToTable("user_rights"); + + b.HasComment("用户控件权限-废弃"); + }); + + modelBuilder.Entity("Shentun.Peis.RoleMenuInfos.RoleMenuInfo", b => + { + b.Property("RoleId") + .HasColumnType("uuid") + .HasColumnName("role_id") + .IsFixedLength(); + + b.Property("MenuInfoId") + .HasColumnType("uuid") + .HasColumnName("menu_info_id") + .IsFixedLength(); + + b.HasKey("RoleId", "MenuInfoId") + .HasName("pk_role_menuinfo"); + + b.ToTable("role_menu_info"); + + b.HasComment("角色对应菜单权限"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("application_name"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("browser_info"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("client_id"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("client_ip_address"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("client_name"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("correlation_id"); + + b.Property("Exceptions") + .HasColumnType("text") + .HasColumnName("exceptions"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("execution_duration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("execution_time"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("http_method"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("http_status_code"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("impersonator_tenant_id"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("impersonator_tenant_name"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("impersonator_user_id"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("impersonator_user_name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("tenant_name"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("user_name"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("abp_audit_logs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("audit_log_id"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("execution_duration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("execution_time"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("method_name"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("service_name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("abp_audit_log_actions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("audit_log_id"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("change_time"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("change_type"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("entity_id"); + + b.Property("EntityTenantId") + .HasColumnType("uuid") + .HasColumnName("entity_tenant_id"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("entity_type_full_name"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("abp_entity_changes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("EntityChangeId") + .HasColumnType("uuid") + .HasColumnName("entity_change_id"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("new_value"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("original_value"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("property_name"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("property_type_full_name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("abp_entity_property_changes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", 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("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_abandoned"); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)") + .HasColumnName("job_args"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("job_name"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_try_time"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("next_try_time"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15) + .HasColumnName("priority"); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0) + .HasColumnName("try_count"); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("abp_background_jobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("name"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_key"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_name"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("value"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("abp_feature_values", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("description"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("is_static"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("name"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("regex"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("regex_description"); + + b.Property("Required") + .HasColumnType("boolean") + .HasColumnName("required"); + + b.Property("ValueType") + .HasColumnType("integer") + .HasColumnName("value_type"); + + b.HasKey("Id"); + + b.ToTable("abp_claim_types", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("SourceTenantId") + .HasColumnType("uuid") + .HasColumnName("source_tenant_id"); + + b.Property("SourceUserId") + .HasColumnType("uuid") + .HasColumnName("source_user_id"); + + b.Property("TargetTenantId") + .HasColumnType("uuid") + .HasColumnName("target_tenant_id"); + + b.Property("TargetUserId") + .HasColumnType("uuid") + .HasColumnName("target_user_id"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("abp_link_users", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("is_default"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("is_static"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("name"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("normalized_name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("abp_roles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("claim_type"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)") + .HasColumnName("claim_value"); + + b.Property("RoleId") + .HasColumnType("uuid") + .HasColumnName("role_id"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("abp_role_claims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("action"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("application_name"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("browser_info"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("client_id"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("client_ip_address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("correlation_id"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("identity"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("tenant_name"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("user_name"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("abp_security_logs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("access_failed_count"); + + 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("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("email_confirmed"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("is_active"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_external"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("lockout_enabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone") + .HasColumnName("lockout_end"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("normalized_email"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("normalized_user_name"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("password_hash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("phone_number"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("phone_number_confirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("security_stamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("two_factor_enabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("user_name"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("abp_users", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("claim_type"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)") + .HasColumnName("claim_value"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("abp_user_claims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("login_provider"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("provider_display_name"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)") + .HasColumnName("provider_key"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("abp_user_logins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("organization_unit_id"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("abp_user_organization_units", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("RoleId") + .HasColumnType("uuid") + .HasColumnName("role_id"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("abp_user_role", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("login_provider"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("Value") + .HasColumnType("text") + .HasColumnName("value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("abp_user_tokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("code"); + + 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("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("display_name"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("IsPeis") + .HasMaxLength(1) + .HasColumnType("character varying(1)"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("ParentId") + .HasColumnType("uuid") + .HasColumnName("parent_id"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("abp_organization_units", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid") + .HasColumnName("organization_unit_id"); + + b.Property("RoleId") + .HasColumnType("uuid") + .HasColumnName("role_id"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("abp_organization_unit_roles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("client_id"); + + b.Property("ClientSecret") + .HasColumnType("text") + .HasColumnName("client_secret"); + + b.Property("ClientUri") + .HasColumnType("text") + .HasColumnName("client_uri"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("consent_type"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("DisplayName") + .HasColumnType("text") + .HasColumnName("display_name"); + + b.Property("DisplayNames") + .HasColumnType("text") + .HasColumnName("display_names"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("LogoUri") + .HasColumnType("text") + .HasColumnName("logo_uri"); + + b.Property("Permissions") + .HasColumnType("text") + .HasColumnName("permissions"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text") + .HasColumnName("post_logout_redirect_uris"); + + b.Property("Properties") + .HasColumnType("text") + .HasColumnName("properties"); + + b.Property("RedirectUris") + .HasColumnType("text") + .HasColumnName("redirect_uris"); + + b.Property("Requirements") + .HasColumnType("text") + .HasColumnName("requirements"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("type"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("open_iddict_applications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ApplicationId") + .HasColumnType("uuid") + .HasColumnName("application_id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_date"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("Properties") + .HasColumnType("text") + .HasColumnName("properties"); + + b.Property("Scopes") + .HasColumnType("text") + .HasColumnName("scopes"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("status"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)") + .HasColumnName("subject"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("type"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("open_iddict_authorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", 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("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); + + b.Property("Descriptions") + .HasColumnType("text") + .HasColumnName("descriptions"); + + b.Property("DisplayName") + .HasColumnType("text") + .HasColumnName("display_name"); + + b.Property("DisplayNames") + .HasColumnType("text") + .HasColumnName("display_names"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("name"); + + b.Property("Properties") + .HasColumnType("text") + .HasColumnName("properties"); + + b.Property("Resources") + .HasColumnType("text") + .HasColumnName("resources"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("open_iddict_scopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ApplicationId") + .HasColumnType("uuid") + .HasColumnName("application_id"); + + b.Property("AuthorizationId") + .HasColumnType("uuid") + .HasColumnName("authorization_id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("concurrency_stamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_date"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("creation_time"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("creator_id"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("expiration_date"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("Payload") + .HasColumnType("text") + .HasColumnName("payload"); + + b.Property("Properties") + .HasColumnType("text") + .HasColumnName("properties"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone") + .HasColumnName("redemption_date"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("reference_id"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("status"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)") + .HasColumnName("subject"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("type"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("open_iddict_tokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("name"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_key"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_name"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("abp_permission_grants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("name"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_key"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("provider_name"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)") + .HasColumnName("value"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("abp_settings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", 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("DeleterId") + .HasColumnType("uuid") + .HasColumnName("deleter_id"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("deletion_time"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("extra_properties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_deleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("last_modification_time"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("last_modifier_id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("abp_tenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("tenant_id"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("name"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)") + .HasColumnName("value"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("abp_tenant_connection_strings", (string)null); + }); + + modelBuilder.Entity("RoomAsbitem", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", null) + .WithMany() + .HasForeignKey("AsbitemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_room_asbitem_asbitem"); + + b.HasOne("Shentun.Peis.Models.Room", null) + .WithMany() + .HasForeignKey("RoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_room_asbitem_room"); + }); + + modelBuilder.Entity("Shentun.Peis.Books.Mb", b => + { + b.HasOne("Shentun.Peis.Books.Ma", "Ma") + .WithMany("Mbs") + .HasForeignKey("MaId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_mb_ma_1"); + + b.Navigation("Ma"); + }); + + modelBuilder.Entity("Shentun.Peis.Books.Mc", b => + { + b.HasOne("Shentun.Peis.Books.Mb", "Mb") + .WithMany("Mcs") + .HasForeignKey("MbId") + .HasConstraintName("fk_mc_mb_1"); + + b.Navigation("Mb"); + }); + + modelBuilder.Entity("Shentun.Peis.Books.TestB", b => + { + b.HasOne("Shentun.Peis.Books.TestA", "TestAs") + .WithMany("TestBs") + .HasForeignKey("TestAsAId"); + + b.Navigation("TestAs"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b => + { + b.HasOne("Shentun.Peis.Models.InvoiceItemType", "InvoiceItemType") + .WithMany("Asbitems") + .HasForeignKey("InvoiceItemTypeId") + .IsRequired() + .HasConstraintName("fk_asbitem_invoice_item_type"); + + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("Asbitems") + .HasForeignKey("ItemTypeId") + .IsRequired() + .HasConstraintName("fk_asbitem_item_type"); + + b.Navigation("InvoiceItemType"); + + b.Navigation("ItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.AsbitemDetail", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithMany("AsbitemDetails") + .HasForeignKey("AsbitemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_asbitem_detail_asbitem"); + + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("AsbitemDetails") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_asbitem_detail_item"); + + b.Navigation("Asbitem"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultConclusion", b => + { + b.HasOne("Shentun.Peis.Models.BigtextResultTemplate", "BigtextResultTemplate") + .WithMany("BigtextResultConclusions") + .HasForeignKey("BigtextResultTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_bigtext"); + + b.Navigation("BigtextResultTemplate"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultDescription", b => + { + b.HasOne("Shentun.Peis.Models.BigtextResultTemplate", "BigtextResultTemplate") + .WithMany("BigtextResultDescriptions") + .HasForeignKey("BigtextResultTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_bigtext"); + + b.Navigation("BigtextResultTemplate"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultTemplate", b => + { + b.HasOne("Shentun.Peis.Models.BigtextResultType", "BigtextResultType") + .WithMany("BigtextResultTemplates") + .HasForeignKey("BigtextResultTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_bigtext"); + + b.Navigation("BigtextResultType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultType", b => + { + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("BigtextResultTypes") + .HasForeignKey("ItemTypeId") + .IsRequired() + .HasConstraintName("fk_bigtext"); + + b.Navigation("ItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CardBill", b => + { + b.HasOne("Shentun.Peis.Models.CardRegister", "CardRegister") + .WithMany("CardBills") + .HasForeignKey("CardRegisterId") + .IsRequired() + .HasConstraintName("fk_card_bil_reference_card_reg"); + + b.HasOne("Shentun.Peis.Models.PayMode", "PayMode") + .WithMany("CardBills") + .HasForeignKey("PayModeId") + .IsRequired() + .HasConstraintName("fk_card_bill_payment_mode"); + + b.Navigation("CardRegister"); + + b.Navigation("PayMode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CardRegister", b => + { + b.HasOne("Shentun.Peis.Models.CardType", "CardType") + .WithMany("CardRegisters") + .HasForeignKey("CardTypeId") + .IsRequired() + .HasConstraintName("fk_card_reg_reference_card_typ"); + + b.Navigation("CardType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Charge", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("Charges") + .HasForeignKey("PatientRegisterId") + .IsRequired() + .HasConstraintName("fk_patient_register_charge"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeAsbitem", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithMany("ChargeAsbitems") + .HasForeignKey("AsbitemId") + .IsRequired() + .HasConstraintName("fk_charge_asbitem_asbitem"); + + b.HasOne("Shentun.Peis.Models.Charge", "Charge") + .WithMany("ChargeAsbitems") + .HasForeignKey("ChargeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_charge_asbitem_charge"); + + b.Navigation("Asbitem"); + + b.Navigation("Charge"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeBack", b => + { + b.HasOne("Shentun.Peis.Models.Charge", "Charge") + .WithMany("ChargeBacks") + .HasForeignKey("ChargeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_bill_bac_reference_bill"); + + b.Navigation("Charge"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeBackPay", b => + { + b.HasOne("Shentun.Peis.Models.ChargeBack", "ChargeBack") + .WithMany("ChargeBackPays") + .HasForeignKey("ChargeBackId") + .IsRequired() + .HasConstraintName("fk_charge_back_pay_charge_back"); + + b.HasOne("Shentun.Peis.Models.PayMode", "PayMode") + .WithMany("ChargeBackPays") + .HasForeignKey("PayModeId") + .IsRequired() + .HasConstraintName("fk_charge_back_pay_pay_mode"); + + b.Navigation("ChargeBack"); + + b.Navigation("PayMode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargePay", b => + { + b.HasOne("Shentun.Peis.Models.Charge", "Charge") + .WithMany("ChargePays") + .HasForeignKey("ChargeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_charge_payment_mode_charge"); + + b.HasOne("Shentun.Peis.Models.PayMode", "PayMode") + .WithMany("ChargePays") + .HasForeignKey("PayModeId") + .IsRequired() + .HasConstraintName("fk_charge_"); + + b.Navigation("Charge"); + + b.Navigation("PayMode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargePriceItem", b => + { + b.HasOne("Shentun.Peis.Models.ChargeAsbitem", "ChargeAsbitem") + .WithMany("ChargePriceItems") + .HasForeignKey("ChargeAsbitemId") + .IsRequired() + .HasConstraintName("fk_charge_asbitem"); + + b.Navigation("ChargeAsbitem"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b => + { + b.HasOne("Shentun.Peis.Models.ColumnReferencePlugIns", "ColumnReferencePlugIns") + .WithMany("ColumnReferences") + .HasForeignKey("ColumnReferencePlugInsId") + .IsRequired() + .HasConstraintName("fk_columnreference_columnreferenceplugins"); + + b.Navigation("ColumnReferencePlugIns"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceCode", b => + { + b.HasOne("Shentun.Peis.Models.ColumnReference", "ColumnReference") + .WithMany("ColumnReferenceCodes") + .HasForeignKey("ColumnReferenceId") + .IsRequired() + .HasConstraintName("fk_columnreferencecode_columnreference"); + + b.Navigation("ColumnReference"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceInterface", b => + { + b.HasOne("Shentun.Peis.Models.ColumnReferenceCode", "ColumnReferenceCode") + .WithMany("ColumnReferenceInterfaces") + .HasForeignKey("ColumnReferenceCodeId") + .IsRequired() + .HasConstraintName("fk_columnreferenceinterface_columnreferencecode"); + + b.Navigation("ColumnReferenceCode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CommonChar", b => + { + b.HasOne("Shentun.Peis.Models.CommonCharType", "CommonCharType") + .WithMany("CommonChars") + .HasForeignKey("CommonCharTypeId") + .IsRequired() + .HasConstraintName("fk_common_char_common_char_type"); + + b.Navigation("CommonCharType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ContactMethod", b => + { + b.HasOne("Shentun.Peis.Models.ContactPerson", "ContactPerson") + .WithMany("ContactMethods") + .HasForeignKey("ContactPersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_contact_method_contact"); + + b.Navigation("ContactPerson"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ContactPerson", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrg", "CustomerOrg") + .WithMany("ContactPeople") + .HasForeignKey("CustomerOrgId") + .IsRequired() + .HasConstraintName("fk_contact_org"); + + b.Navigation("CustomerOrg"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CriticalValue", b => + { + b.HasOne("Shentun.Peis.Models.CriticalValueType", "CriticalValueType") + .WithMany("CriticalValues") + .HasForeignKey("CriticalValueTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_critica"); + + b.Navigation("CriticalValueType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgCharge", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrgRegister", "CustomerOrgRegister") + .WithMany("CustomerOrgCharges") + .HasForeignKey("CustomerOrgRegisterId") + .IsRequired() + .HasConstraintName("fk_customer_org_charge_register"); + + b.Navigation("CustomerOrgRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargeBack", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrgCharge", "CustomerOrgCharge") + .WithMany("CustomerOrgChargeBacks") + .HasForeignKey("CustomerOrgChargeId") + .IsRequired() + .HasConstraintName("fk_org_charge_back_org_charge"); + + b.Navigation("CustomerOrgCharge"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargeBackPay", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrgChargeBack", "CustomerOrgChargeBack") + .WithMany("CustomerOrgChargeBackPays") + .HasForeignKey("CustomerOrgChargeBackId") + .IsRequired() + .HasConstraintName("fk_org_cha"); + + b.HasOne("Shentun.Peis.Models.PayMode", "PayMode") + .WithMany("CustomerOrgChargeBackPays") + .HasForeignKey("PayModeId") + .IsRequired() + .HasConstraintName("fk_org_charge_back_pay_pay_mode"); + + b.Navigation("CustomerOrgChargeBack"); + + b.Navigation("PayMode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargePay", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrgCharge", "CustomerOrgCharge") + .WithOne("CustomerOrgChargePay") + .HasForeignKey("Shentun.Peis.Models.CustomerOrgChargePay", "Id") + .IsRequired() + .HasConstraintName("fk_org_charge_pay_org_charge"); + + b.HasOne("Shentun.Peis.Models.PayMode", "PayMode") + .WithMany("CustomerOrgChargePays") + .HasForeignKey("PayModeId") + .IsRequired() + .HasConstraintName("fk_org_charge_pay_pay_mode"); + + b.Navigation("CustomerOrgCharge"); + + b.Navigation("PayMode"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgGroup", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrgRegister", "CustomerOrgRegister") + .WithMany("CustomerOrgGroups") + .HasForeignKey("CustomerOrgRegisterId") + .IsRequired() + .HasConstraintName("fk_customer_org_group_register"); + + b.Navigation("CustomerOrgRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgGroupDetail", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithMany("CustomerOrgGroupDetails") + .HasForeignKey("AsbitemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_org_group_detail_asbitem"); + + b.HasOne("Shentun.Peis.Models.CustomerOrgGroup", "CustomerOrgGroup") + .WithMany("CustomerOrgGroupDetails") + .HasForeignKey("CustomerOrgGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_org_group_detail_org_group"); + + b.Navigation("Asbitem"); + + b.Navigation("CustomerOrgGroup"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgRegister", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrg", "CustomerOrg") + .WithMany("CustomerOrgRegisters") + .HasForeignKey("CustomerOrgId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_org_medi_reference_org"); + + b.Navigation("CustomerOrg"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Diagnosis", b => + { + b.HasOne("Shentun.Peis.Models.DiagnosisLevel", "DiagnosisLevel") + .WithMany("Diagnoses") + .HasForeignKey("DiagnosisLevelId") + .IsRequired() + .HasConstraintName("fk_diagnosis_diagnosis_level"); + + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("Diagnoses") + .HasForeignKey("ItemTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_diagnosis_item_type"); + + b.Navigation("DiagnosisLevel"); + + b.Navigation("ItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisTemplateDetail", b => + { + b.HasOne("Shentun.Peis.Models.Diagnosis", "Diagnosis") + .WithMany("DiagnosisTemplateDetails") + .HasForeignKey("DiagnosisId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_diagnos"); + + b.HasOne("Shentun.Peis.Models.DiagnosisTemplate", "DiagnosisTemplate") + .WithMany("DiagnosisTemplateDetails") + .HasForeignKey("DiagnosisTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_diagno2"); + + b.Navigation("Diagnosis"); + + b.Navigation("DiagnosisTemplate"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.HealthCertificate", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithOne("HealthCertificate") + .HasForeignKey("Shentun.Peis.Models.HealthCertificate", "Id") + .IsRequired() + .HasConstraintName("fk_health_"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Item", b => + { + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("Items") + .HasForeignKey("ItemTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_item_type"); + + b.Navigation("ItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultMatch", b => + { + b.HasOne("Shentun.Peis.Models.Diagnosis", "Diagnosis") + .WithMany("ItemResultMatches") + .HasForeignKey("DiagnosisId") + .IsRequired() + .HasConstraintName("fk_item_result_match_diagnosis"); + + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("ItemResultMatches") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_res_reference_item1"); + + b.Navigation("Diagnosis"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultTemplate", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("ItemResultTemplates") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_res_reference_item"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemResultTemplateType", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("ItemResultTemplateTypes") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_re"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemTemplateDetail", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("ItemTemplateDetails") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_template_detail_item"); + + b.HasOne("Shentun.Peis.Models.ItemTemplate", "ItemTemplate") + .WithMany("ItemTemplateDetails") + .HasForeignKey("ItemTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_item_te"); + + b.Navigation("Item"); + + b.Navigation("ItemTemplate"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemType", b => + { + b.HasOne("Shentun.Peis.Models.GuideType", "GuidType") + .WithMany("ItemTypes") + .HasForeignKey("GuidTypeId") + .IsRequired() + .HasConstraintName("fk_item_type_guide_type"); + + b.HasOne("Shentun.Peis.Models.MedicalReportType", "MedicalReportType") + .WithMany("ItemTypes") + .HasForeignKey("MedicalReportTypeId") + .IsRequired() + .HasConstraintName("fk_item_type_medical_report_type"); + + b.Navigation("GuidType"); + + b.Navigation("MedicalReportType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.LisRequest", b => + { + b.HasOne("Shentun.Peis.Models.SampleContainer", "SampleContainer") + .WithMany("LisRequests") + .HasForeignKey("SampleContainerId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired() + .HasConstraintName("fk_lis_request_sample_container"); + + b.HasOne("Shentun.Peis.Models.SampleType", "SampleType") + .WithMany("LisRequests") + .HasForeignKey("SampleTypeId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired() + .HasConstraintName("fk_lis_request_sample_type"); + + b.Navigation("SampleContainer"); + + b.Navigation("SampleType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalConclusion", b => + { + b.HasOne("Shentun.Peis.Models.MedicalConclusionType", "MedicalConclusionType") + .WithMany("MedicalConclusions") + .HasForeignKey("MedicalConclusionTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_medical"); + + b.Navigation("MedicalConclusionType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalPackageDetail", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithMany("MedicalPackageDetails") + .HasForeignKey("AsbitemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_medical"); + + b.HasOne("Shentun.Peis.Models.MedicalPackage", "MedicalPackage") + .WithMany("MedicalPackageDetails") + .HasForeignKey("MedicalPackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_medica2"); + + b.Navigation("Asbitem"); + + b.Navigation("MedicalPackage"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.OrganizationUnitsCustomerOrg", b => + { + b.HasOne("Shentun.Peis.Models.CustomerOrg", "CustomerOrg") + .WithMany("OrganizationUnitsCustomerOrgs") + .HasForeignKey("CustomerOrgId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_medical_center_org_org"); + + b.HasOne("Shentun.Peis.Models.Department", "OrganizationUnit") + .WithMany("OrganizationUnitsCustomerOrgs") + .HasForeignKey("OrganizationUnitId") + .IsRequired() + .HasConstraintName("fk_medical"); + + b.Navigation("CustomerOrg"); + + b.Navigation("OrganizationUnit"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientOccupationalDisease", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithOne("PatientOccupationalDisease") + .HasForeignKey("Shentun.Peis.Models.PatientOccupationalDisease", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_patient"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientOccupationalHistory", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("PatientOccupationalHistories") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_occupat"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientPoison", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("PatientPoisons") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_patient"); + + b.HasOne("Shentun.Peis.Models.Poison", "Poison") + .WithMany("PatientPoisons") + .HasForeignKey("PoisonId") + .IsRequired() + .HasConstraintName("fk_patient_poison_poison"); + + b.Navigation("PatientRegister"); + + b.Navigation("Poison"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientRegister", b => + { + b.HasOne("Shentun.Peis.Models.MaritalStatus", "MaritalStatus") + .WithMany("PatientRegisters") + .HasForeignKey("MaritalStatusId") + .IsRequired() + .HasConstraintName("fk_patient_register_marital_status_id"); + + b.HasOne("Shentun.Peis.Models.Patient", "Patient") + .WithMany("PatientRegisters") + .HasForeignKey("PatientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_patient_register_patient"); + + b.Navigation("MaritalStatus"); + + b.Navigation("Patient"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientSymptom", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("PatientSymptoms") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_patient"); + + b.HasOne("Shentun.Peis.Models.Symptom", "Symptom") + .WithMany("PatientSymptoms") + .HasForeignKey("SymptomId") + .IsRequired() + .HasConstraintName("fk_patient_symptom_symptom"); + + b.Navigation("PatientRegister"); + + b.Navigation("Symptom"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PhoneFollow", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("PhoneFollows") + .HasForeignKey("PatientRegisterId") + .IsRequired() + .HasConstraintName("fk_phone_f"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Poison", b => + { + b.HasOne("Shentun.Peis.Models.PoisonType", "PoisonType") + .WithMany("Poisons") + .HasForeignKey("PoisonTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_poison_poison_type"); + + b.Navigation("PoisonType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PriceItem", b => + { + b.HasOne("Shentun.Peis.Models.InvoiceItemType", "InvoiceItemType") + .WithMany("PriceItems") + .HasForeignKey("InvoiceItemTypeId") + .IsRequired() + .HasConstraintName("fk_price_item_invoice_item_type"); + + b.Navigation("InvoiceItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.QueueRegister", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("QueueRegisters") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_queue_r"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReferenceRange", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("ReferenceRanges") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_referenc_reference_item"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckAsbitem", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithMany("RegisterCheckAsbitems") + .HasForeignKey("AsbitemId") + .IsRequired() + .HasConstraintName("fk_register_reference_asbitem"); + + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("RegisterCheckAsbitems") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_register_reference_patient_"); + + b.HasOne("Shentun.Peis.Models.RegisterCheck", "RegisterCheck") + .WithMany("RegisterCheckAsbitems") + .HasForeignKey("RegisterCheckId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_registerasbitem_registercheck"); + + b.Navigation("Asbitem"); + + b.Navigation("PatientRegister"); + + b.Navigation("RegisterCheck"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckItem", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("RegisterCheckItems") + .HasForeignKey("ItemId") + .IsRequired() + .HasConstraintName("fk_register_reference_item"); + + b.HasOne("Shentun.Peis.Models.RegisterCheck", "RegisterCheck") + .WithMany("RegisterCheckItems") + .HasForeignKey("RegisterCheckId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_register_item_register_check"); + + b.HasOne("Shentun.Peis.Models.ResultStatus", "ResultStatus") + .WithMany("RegisterCheckItems") + .HasForeignKey("ResultStatusId") + .HasConstraintName("fk_register_item_result_status"); + + b.Navigation("Item"); + + b.Navigation("RegisterCheck"); + + b.Navigation("ResultStatus"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckPicture", b => + { + b.HasOne("Shentun.Peis.Models.RegisterCheck", "RegisterCheck") + .WithMany("RegisterCheckPictures") + .HasForeignKey("RegisterCheckId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_check_picture_register_check"); + + b.Navigation("RegisterCheck"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckSuggestion", b => + { + b.HasOne("Shentun.Peis.Models.RegisterCheck", "RegisterCheck") + .WithMany("RegisterCheckSuggestions") + .HasForeignKey("RegisterCheckId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_registe"); + + b.Navigation("RegisterCheck"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheckSummary", b => + { + b.HasOne("Shentun.Peis.Models.RegisterCheck", "RegisterCheck") + .WithMany("RegisterCheckSummaries") + .HasForeignKey("RegisterCheckId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_registe"); + + b.Navigation("RegisterCheck"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b => + { + b.HasOne("Shentun.Peis.Models.Report", "Report") + .WithMany("ReportFormats") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reportformat_report_1"); + + b.Navigation("Report"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportFormatTemplate", b => + { + b.HasOne("Shentun.Peis.Models.ReportFormat", "ReportFormat") + .WithMany("ReportFormatTemplates") + .HasForeignKey("ReportFormatId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reportformattemplate_reportprinter_1"); + + b.Navigation("ReportFormat"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportPrinter", b => + { + b.HasOne("Shentun.Peis.Models.Report", "Report") + .WithMany("ReportPrinters") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reportprinter_report_1"); + + b.Navigation("Report"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Room", b => + { + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("Rooms") + .HasForeignKey("ItemTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_room_item_type"); + + b.HasOne("Shentun.Peis.Models.Department", "Department") + .WithMany("Rooms") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_room_department"); + + b.Navigation("Department"); + + b.Navigation("ItemType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleGroup", b => + { + b.HasOne("Shentun.Peis.Models.SampleContainer", "SampleContainer") + .WithMany("SampleGroups") + .HasForeignKey("SampleContainerId") + .IsRequired() + .HasConstraintName("fk_sample_group_sample_container"); + + b.HasOne("Shentun.Peis.Models.SampleType", "SampleType") + .WithMany("SampleGroups") + .HasForeignKey("SampleTypeId") + .IsRequired() + .HasConstraintName("fk_sample_group_sample_type"); + + b.Navigation("SampleContainer"); + + b.Navigation("SampleType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleGroupDetail", b => + { + b.HasOne("Shentun.Peis.Models.Asbitem", "Asbitem") + .WithOne("SampleGroupDetail") + .HasForeignKey("Shentun.Peis.Models.SampleGroupDetail", "AsbitemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sample_group_detail_asbitem"); + + b.HasOne("Shentun.Peis.Models.SampleGroup", "SampleGroup") + .WithMany("SampleGroupDetails") + .HasForeignKey("SampleGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sample_"); + + b.Navigation("Asbitem"); + + b.Navigation("SampleGroup"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ServiceTrade", b => + { + b.HasOne("Shentun.Peis.Models.Department", "Department") + .WithMany("ServiceTrades") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_service_trades_department"); + + b.Navigation("Department"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SexHormoneReferenceRange", b => + { + b.HasOne("Shentun.Peis.Models.Item", "Item") + .WithMany("SexHormoneReferenceRanges") + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sex_hor"); + + b.HasOne("Shentun.Peis.Models.SexHormoneTerm", "SexHormoneTerm") + .WithMany("SexHormoneReferenceRanges") + .HasForeignKey("SexHormoneTermId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sex_ho2"); + + b.Navigation("Item"); + + b.Navigation("SexHormoneTerm"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Suggestion", b => + { + b.HasOne("Shentun.Peis.Models.Diagnosis", "Diagnosis") + .WithMany("Suggestions") + .HasForeignKey("DiagnosisId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_suggestion_diagnosis"); + + b.Navigation("Diagnosis"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumDiagnosis", b => + { + b.HasOne("Shentun.Peis.Models.Diagnosis", "Diagnosis") + .WithMany("SumDiagnoses") + .HasForeignKey("DiagnosisId") + .IsRequired() + .HasConstraintName("fk_sum_diagnosis_diagnosis"); + + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("SumDiagnoses") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sum_dia"); + + b.Navigation("Diagnosis"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSuggestionContent", b => + { + b.HasOne("Shentun.Peis.Models.SumSuggestionHeader", "SumSuggestionHeader") + .WithMany("SumSuggestionContents") + .HasForeignKey("SumSuggestionHeaderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sum_sug"); + + b.Navigation("SumSuggestionHeader"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSuggestionHeader", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("SumSuggestionHeaders") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sum_sug"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSummaryContent", b => + { + b.HasOne("Shentun.Peis.Models.SumSummaryHeader", "SumSummaryHeader") + .WithMany("SumSummaryContents") + .HasForeignKey("SumSummaryHeaderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sum_sum"); + + b.Navigation("SumSummaryHeader"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSummaryHeader", b => + { + b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister") + .WithMany("SumSummaryHeaders") + .HasForeignKey("PatientRegisterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_sum_sum"); + + b.Navigation("PatientRegister"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParm", b => + { + b.HasOne("Shentun.Peis.Models.SysParmType", "SysParmType") + .WithMany("SysParms") + .HasForeignKey("SysParmTypeId") + .IsRequired() + .HasConstraintName("fk_sys_parm_sys_parm_type"); + + b.Navigation("SysParmType"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmValue", b => + { + b.HasOne("Shentun.Peis.Models.SysParm", "SysParm") + .WithMany("SysParmValues") + .HasForeignKey("SysParmId") + .IsRequired() + .HasConstraintName("fk_sys_parm_value_sys_parm"); + + b.Navigation("SysParm"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmValueOption", b => + { + b.HasOne("Shentun.Peis.Models.SysParm", "SysParm") + .WithMany("SysParmValueOptions") + .HasForeignKey("SysParmId") + .IsRequired() + .HasConstraintName("fk_sys_par"); + + b.Navigation("SysParm"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.User", b => + { + b.HasOne("Shentun.Peis.Models.Department", "Department") + .WithMany("Users") + .HasForeignKey("DepartmentId") + .IsRequired() + .HasConstraintName("fk_user_department"); + + b.Navigation("Department"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserDepartment", b => + { + b.HasOne("Shentun.Peis.Models.Department", "Department") + .WithMany("UserDepartments") + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_op"); + + b.HasOne("Shentun.Peis.Models.User", "User") + .WithMany("UserDepartments") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_o2"); + + b.Navigation("Department"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserGrouping", b => + { + b.HasOne("Shentun.Peis.Models.Grouping", "Grouping") + .WithMany("UserGroupings") + .HasForeignKey("GroupingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_grouping_grouping"); + + b.HasOne("Shentun.Peis.Models.User", "User") + .WithMany("UserGroupings") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_grouping_users"); + + b.Navigation("Grouping"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.UserItemType", b => + { + b.HasOne("Shentun.Peis.Models.ItemType", "ItemType") + .WithMany("UserItemTypes") + .HasForeignKey("ItemTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_item_type_item_type"); + + b.HasOne("Shentun.Peis.Models.User", "User") + .WithMany("UserItemTypes") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_user_item_type_users"); + + b.Navigation("ItemType"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Shentun.Peis.Books.Ma", b => + { + b.Navigation("Mbs"); + }); + + modelBuilder.Entity("Shentun.Peis.Books.Mb", b => + { + b.Navigation("Mcs"); + }); + + modelBuilder.Entity("Shentun.Peis.Books.TestA", b => + { + b.Navigation("TestBs"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b => + { + b.Navigation("AsbitemDetails"); + + b.Navigation("ChargeAsbitems"); + + b.Navigation("CustomerOrgGroupDetails"); + + b.Navigation("MedicalPackageDetails"); + + b.Navigation("RegisterCheckAsbitems"); + + b.Navigation("SampleGroupDetail"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultTemplate", b => + { + b.Navigation("BigtextResultConclusions"); + + b.Navigation("BigtextResultDescriptions"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.BigtextResultType", b => + { + b.Navigation("BigtextResultTemplates"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CardRegister", b => + { + b.Navigation("CardBills"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CardType", b => + { + b.Navigation("CardRegisters"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Charge", b => + { + b.Navigation("ChargeAsbitems"); + + b.Navigation("ChargeBacks"); + + b.Navigation("ChargePays"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeAsbitem", b => + { + b.Navigation("ChargePriceItems"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ChargeBack", b => + { + b.Navigation("ChargeBackPays"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b => + { + b.Navigation("ColumnReferenceCodes"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceCode", b => + { + b.Navigation("ColumnReferenceInterfaces"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ColumnReferencePlugIns", b => + { + b.Navigation("ColumnReferences"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CommonCharType", b => + { + b.Navigation("CommonChars"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ContactPerson", b => + { + b.Navigation("ContactMethods"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CriticalValueType", b => + { + b.Navigation("CriticalValues"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrg", b => + { + b.Navigation("ContactPeople"); + + b.Navigation("CustomerOrgRegisters"); + + b.Navigation("OrganizationUnitsCustomerOrgs"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgCharge", b => + { + b.Navigation("CustomerOrgChargeBacks"); + + b.Navigation("CustomerOrgChargePay"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgChargeBack", b => + { + b.Navigation("CustomerOrgChargeBackPays"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgGroup", b => + { + b.Navigation("CustomerOrgGroupDetails"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.CustomerOrgRegister", b => + { + b.Navigation("CustomerOrgCharges"); + + b.Navigation("CustomerOrgGroups"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Department", b => + { + b.Navigation("OrganizationUnitsCustomerOrgs"); + + b.Navigation("Rooms"); + + b.Navigation("ServiceTrades"); + + b.Navigation("UserDepartments"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Diagnosis", b => + { + b.Navigation("DiagnosisTemplateDetails"); + + b.Navigation("ItemResultMatches"); + + b.Navigation("Suggestions"); + + b.Navigation("SumDiagnoses"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisLevel", b => + { + b.Navigation("Diagnoses"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.DiagnosisTemplate", b => + { + b.Navigation("DiagnosisTemplateDetails"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Grouping", b => + { + b.Navigation("UserGroupings"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.GuideType", b => + { + b.Navigation("ItemTypes"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.InvoiceItemType", b => + { + b.Navigation("Asbitems"); + + b.Navigation("PriceItems"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Item", b => + { + b.Navigation("AsbitemDetails"); + + b.Navigation("ItemResultMatches"); + + b.Navigation("ItemResultTemplateTypes"); + + b.Navigation("ItemResultTemplates"); + + b.Navigation("ItemTemplateDetails"); + + b.Navigation("ReferenceRanges"); + + b.Navigation("RegisterCheckItems"); + + b.Navigation("SexHormoneReferenceRanges"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemTemplate", b => + { + b.Navigation("ItemTemplateDetails"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ItemType", b => + { + b.Navigation("Asbitems"); + + b.Navigation("BigtextResultTypes"); + + b.Navigation("Diagnoses"); + + b.Navigation("Items"); + + b.Navigation("Rooms"); + + b.Navigation("UserItemTypes"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MaritalStatus", b => + { + b.Navigation("PatientRegisters"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalConclusionType", b => + { + b.Navigation("MedicalConclusions"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalPackage", b => + { + b.Navigation("MedicalPackageDetails"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.MedicalReportType", b => + { + b.Navigation("ItemTypes"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Patient", b => + { + b.Navigation("PatientRegisters"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PatientRegister", b => + { + b.Navigation("Charges"); + + b.Navigation("HealthCertificate"); + + b.Navigation("PatientOccupationalDisease"); + + b.Navigation("PatientOccupationalHistories"); + + b.Navigation("PatientPoisons"); + + b.Navigation("PatientSymptoms"); + + b.Navigation("PhoneFollows"); + + b.Navigation("QueueRegisters"); + + b.Navigation("RegisterCheckAsbitems"); + + b.Navigation("SumDiagnoses"); + + b.Navigation("SumSuggestionHeaders"); + + b.Navigation("SumSummaryHeaders"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PayMode", b => + { + b.Navigation("CardBills"); + + b.Navigation("ChargeBackPays"); + + b.Navigation("ChargePays"); + + b.Navigation("CustomerOrgChargeBackPays"); + + b.Navigation("CustomerOrgChargePays"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Poison", b => + { + b.Navigation("PatientPoisons"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.PoisonType", b => + { + b.Navigation("Poisons"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.RegisterCheck", b => + { + b.Navigation("RegisterCheckAsbitems"); + + b.Navigation("RegisterCheckItems"); + + b.Navigation("RegisterCheckPictures"); + + b.Navigation("RegisterCheckSuggestions"); + + b.Navigation("RegisterCheckSummaries"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Report", b => + { + b.Navigation("ReportFormats"); + + b.Navigation("ReportPrinters"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b => + { + b.Navigation("ReportFormatTemplates"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.ResultStatus", b => + { + b.Navigation("RegisterCheckItems"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleContainer", b => + { + b.Navigation("LisRequests"); + + b.Navigation("SampleGroups"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleGroup", b => + { + b.Navigation("SampleGroupDetails"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SampleType", b => + { + b.Navigation("LisRequests"); + + b.Navigation("SampleGroups"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SexHormoneTerm", b => + { + b.Navigation("SexHormoneReferenceRanges"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSuggestionHeader", b => + { + b.Navigation("SumSuggestionContents"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SumSummaryHeader", b => + { + b.Navigation("SumSummaryContents"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.Symptom", b => + { + b.Navigation("PatientSymptoms"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParm", b => + { + b.Navigation("SysParmValueOptions"); + + b.Navigation("SysParmValues"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.SysParmType", b => + { + b.Navigation("SysParms"); + }); + + modelBuilder.Entity("Shentun.Peis.Models.User", b => + { + b.Navigation("UserDepartments"); + + b.Navigation("UserGroupings"); + + b.Navigation("UserItemTypes"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.cs new file mode 100644 index 0000000..e630a16 --- /dev/null +++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240423075634_init20240423.cs @@ -0,0 +1,139 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Shentun.Peis.Migrations +{ + public partial class init20240423 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "summary_content", + table: "sum_summary_content", + type: "character varying(3000)", + maxLength: 3000, + nullable: false, + comment: "建议内容", + oldClrType: typeof(string), + oldType: "character varying(100)", + oldMaxLength: 100, + oldComment: "建议内容"); + + migrationBuilder.AlterColumn( + name: "suggestion_content", + table: "sum_suggestion_content", + type: "character varying(10000)", + maxLength: 10000, + nullable: false, + comment: "建议内容", + oldClrType: typeof(string), + oldType: "character varying(100)", + oldMaxLength: 100, + oldComment: "建议内容"); + + migrationBuilder.AlterColumn( + name: "report_prompt", + table: "result_status", + type: "character varying(8)", + maxLength: 8, + nullable: true, + comment: "报告单提示", + oldClrType: typeof(string), + oldType: "character varying(8)", + oldMaxLength: 8, + oldComment: "报告单提示"); + + migrationBuilder.AlterColumn( + name: "data_input_prompt", + table: "result_status", + type: "character varying(8)", + maxLength: 8, + nullable: true, + comment: "数据录入提示", + oldClrType: typeof(string), + oldType: "character varying(8)", + oldMaxLength: 8, + oldComment: "数据录入提示"); + + migrationBuilder.AlterColumn( + name: "summary", + table: "register_check_summary", + type: "character varying(2000)", + maxLength: 2000, + nullable: false, + comment: "综述", + oldClrType: typeof(string), + oldType: "character varying(500)", + oldMaxLength: 500, + oldComment: "综述"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "summary_content", + table: "sum_summary_content", + type: "character varying(100)", + maxLength: 100, + nullable: false, + comment: "建议内容", + oldClrType: typeof(string), + oldType: "character varying(3000)", + oldMaxLength: 3000, + oldComment: "建议内容"); + + migrationBuilder.AlterColumn( + name: "suggestion_content", + table: "sum_suggestion_content", + type: "character varying(100)", + maxLength: 100, + nullable: false, + comment: "建议内容", + oldClrType: typeof(string), + oldType: "character varying(10000)", + oldMaxLength: 10000, + oldComment: "建议内容"); + + migrationBuilder.AlterColumn( + name: "report_prompt", + table: "result_status", + type: "character varying(8)", + maxLength: 8, + nullable: false, + defaultValue: "", + comment: "报告单提示", + oldClrType: typeof(string), + oldType: "character varying(8)", + oldMaxLength: 8, + oldNullable: true, + oldComment: "报告单提示"); + + migrationBuilder.AlterColumn( + name: "data_input_prompt", + table: "result_status", + type: "character varying(8)", + maxLength: 8, + nullable: false, + defaultValue: "", + comment: "数据录入提示", + oldClrType: typeof(string), + oldType: "character varying(8)", + oldMaxLength: 8, + oldNullable: true, + oldComment: "数据录入提示"); + + migrationBuilder.AlterColumn( + name: "summary", + table: "register_check_summary", + type: "character varying(500)", + maxLength: 500, + nullable: false, + comment: "综述", + oldClrType: typeof(string), + oldType: "character varying(2000)", + oldMaxLength: 2000, + oldComment: "综述"); + } + } +} diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs index 85ec11d..251d320 100644 --- a/src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs +++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs @@ -7981,8 +7981,8 @@ namespace Shentun.Peis.Migrations b.Property("Summary") .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") .HasColumnName("summary") .HasComment("综述"); @@ -8307,7 +8307,6 @@ namespace Shentun.Peis.Migrations .HasComment("数据录入字体颜色"); b.Property("DataInputPrompt") - .IsRequired() .HasMaxLength(8) .HasColumnType("character varying(8)") .HasColumnName("data_input_prompt") @@ -8349,7 +8348,6 @@ namespace Shentun.Peis.Migrations .HasComment("报告单字体颜色"); b.Property("ReportPrompt") - .IsRequired() .HasMaxLength(8) .HasColumnType("character varying(8)") .HasColumnName("report_prompt") @@ -9488,8 +9486,8 @@ namespace Shentun.Peis.Migrations b.Property("SuggestionContent") .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasMaxLength(10000) + .HasColumnType("character varying(10000)") .HasColumnName("suggestion_content") .HasComment("建议内容"); @@ -9623,8 +9621,8 @@ namespace Shentun.Peis.Migrations b.Property("SummaryContent") .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasMaxLength(3000) + .HasColumnType("character varying(3000)") .HasColumnName("summary_content") .HasComment("建议内容"); diff --git a/test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs b/test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs index 6be0ff3..e94dabd 100644 --- a/test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs +++ b/test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs @@ -32,7 +32,7 @@ namespace Shentun.Peis public async Task TransferPatientData() { - for (int i = 0; i < 1000; i++) + for (int i = 0; i < 500; i++) { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) { @@ -54,5 +54,53 @@ namespace Shentun.Peis } + [Fact] + public async Task TransferPatientRegisterData() + { + + for (int i = 0; i < 3000; i++) + { + using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) + { + var IsHand = await _appService.TransferPatientRegisterData(); + + await unitOfWork.CompleteAsync(); + + _output.WriteLine($"处理{(i + 1) * 1000}"); + + if (!IsHand) + { + break; + } + } + } + + } + + [Fact] + public async Task HandPatientRegisterDoctor() + { + + for (int i = 0; i < 3000; i++) + { + using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) + { + var IsHand = await _appService.HandPatientRegisterDoctor(); + + await unitOfWork.CompleteAsync(); + + _output.WriteLine($"处理{(i + 1) * 1000}"); + + if (!IsHand) + { + break; + } + } + } + + + + } + } } diff --git a/test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs b/test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs index c4c6915..199c37d 100644 --- a/test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs +++ b/test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs @@ -40,8 +40,8 @@ public class PeisEntityFrameworkCoreTestModule : AbpModule } private void ConfigurePostGress(IServiceCollection services) { - string connectStr = "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123"; - //string connectStr = "Host=10.1.12.140;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"; + //string connectStr = "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123"; + string connectStr = "Host=10.1.12.140;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"; services.Configure(options => {