You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
4.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. using Microsoft.EntityFrameworkCore;
  2. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  3. using Shentun.Peis.Books;
  4. using Shentun.Peis.EntityFrameworkCore;
  5. using Shentun.Peis.Models;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace Shentun.Peis.DbMapping
  12. {
  13. internal class AsbitemDbMapping : IEntityTypeConfiguration<Asbitem>
  14. {
  15. public void Configure(EntityTypeBuilder<Asbitem> entity)
  16. {
  17. entity.HasComment("组合项目");
  18. entity.Property(t => t.DisplayName).HasComment("名称").IsRequired();
  19. entity.Property(t => t.ShortName).HasComment("简称");
  20. entity.Property(t => t.ForSexId).HasComment("适用性别,M-男,F-女,A-全部").IsRequired().HasDefaultValueSql("'A'");
  21. entity.Property(t => t.MaritalStatusId).HasComment("适用婚姻状况,0-未婚,1-已婚,A-全部").IsRequired().HasDefaultValueSql("'A'");
  22. entity.Property(t => t.ItemTypeId).HasComment("项目类别").IsRequired().IsFixedLength();
  23. entity.Property(t => t.Price).HasComment("价格").IsRequired().HasDefaultValueSql("0");
  24. entity.Property(t => t.DeviceTypeId).HasComment("仪器类别");
  25. entity.Property(t => t.CollectItemTypeId).HasComment("汇总项目类别").IsRequired().IsFixedLength();
  26. entity.Property(t => t.IsItemResultMerger).HasComment("项目结果合并").IsRequired().HasDefaultValueSql("'N'");
  27. entity.Property(t => t.IsBeforeEat).HasComment("餐前项目").IsRequired().HasDefaultValueSql("'N'");
  28. entity.Property(t => t.ClinicalMeaning).HasComment("临床意义");
  29. entity.Property(t => t.DefaultResult).HasComment("默认结果");
  30. entity.Property(t => t.QueueTime).HasComment("候诊时间").IsRequired().HasDefaultValueSql("0");
  31. entity.Property(t => t.IsDiagnosisFunction).HasComment("启用诊断函数").IsRequired().HasDefaultValueSql("'N'");
  32. entity.Property(t => t.DiagnosisFunction).HasComment("诊断函数");
  33. entity.Property(t => t.IsContinueProcess).HasComment("诊断函数处理完毕后继续处理").IsRequired().HasDefaultValueSql("'N'");
  34. entity.Property(t => t.IsPictureRotate).HasComment("体检报告图片旋转90°").IsRequired().HasDefaultValueSql("'N'");
  35. entity.Property(t => t.IsCheck).HasComment("是检查项目").IsRequired().HasDefaultValueSql("'Y'");
  36. entity.Property(t => t.IsActive).HasComment("是启用").IsRequired().HasDefaultValueSql("'Y'");
  37. entity.Property(t => t.BarcodeMode).HasComment("条码模式").IsRequired().HasDefaultValueSql("'0'");
  38. entity.Property(t => t.IsWebAppoint).HasComment("是否支持网上预约").IsRequired().HasDefaultValueSql("'Y'");
  39. entity.Property(t => t.ForPregnantFlag).HasComment("备怀孕期间禁止检查").IsRequired().HasDefaultValueSql("'A'");
  40. entity.Property(t => t.IsCriticalValueFunction).HasComment("是否启用危急值函数").IsRequired().HasDefaultValueSql("'N'");
  41. entity.Property(t => t.CriticalValueFunction).HasComment("危急值函数");
  42. entity.Property(t => t.IsFollowUpFunction).HasComment("是否启用随访函数").IsRequired().HasDefaultValueSql("'N'");
  43. entity.Property(t => t.FollowUpFunction).HasComment("随访函数");
  44. entity.Property(e => e.Id)
  45. .IsFixedLength()
  46. .HasComment("编号").HasColumnName("id");
  47. entity.HasOne(d => d.CollectItemType)
  48. .WithMany(p => p.Asbitems)
  49. .HasForeignKey(d => d.CollectItemTypeId)
  50. .OnDelete(DeleteBehavior.ClientSetNull)
  51. .HasConstraintName("fk_asbitem_collect_item_type");
  52. entity.HasOne(d => d.ItemType)
  53. .WithMany(p => p.Asbitems)
  54. .HasForeignKey(d => d.ItemTypeId)
  55. .OnDelete(DeleteBehavior.ClientSetNull)
  56. .HasConstraintName("fk_asbitem_item_type");
  57. entity.ConfigureByConvention();
  58. }
  59. }
  60. }