Entities.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using SQLite;
  3. namespace StationProbe
  4. {
  5. [Table("Images")]
  6. public class Image
  7. {
  8. [PrimaryKey]
  9. public string Id { get; set; } = string.Empty;
  10. [Indexed]
  11. public string ExamId { get; set; } = string.Empty;
  12. [Indexed]
  13. public int ImageIndex { get; set; }
  14. public byte[] Data { get; set; } = new byte[0];
  15. public DateTime CreateTime { get; set; }
  16. }
  17. [Table("BatchTasks")]
  18. internal class BatchTask
  19. {
  20. [PrimaryKey, AutoIncrement]
  21. public int Id { get; set; }
  22. public string Name { get; set; } = string.Empty;
  23. public int PageCount { get; set; }
  24. public int ExamCount { get; set; }
  25. public DateTime Start { get; set; }
  26. public DateTime End { get; set; }
  27. public DateTime CreateTime { get; set; }
  28. public override string ToString()
  29. {
  30. return Name;
  31. }
  32. }
  33. [Table("Exams")]
  34. internal class Exam
  35. {
  36. [PrimaryKey]
  37. public string Id { get; set; } = string.Empty;
  38. public string PatientName { get; set; } = string.Empty;
  39. public int PatientAge { get; set; }
  40. public string PatientSex { get; set; } = string.Empty;
  41. public DateTime ExamDate { get; set; }
  42. public string Report { get; set; } = string.Empty;
  43. [Indexed]
  44. public int BatchTaskId { get; set; }
  45. [Indexed]
  46. public int ExamIndex { get; set; }
  47. [Indexed]
  48. public int PageIndex { get; set; }
  49. [Indexed]
  50. public int ExamIndexInPage { get; set; }
  51. public DateTime CreateTime { get; set; }
  52. public override string ToString()
  53. {
  54. return $"[{CreateTime}]#{PatientName}#{PatientSex}#{PatientAge}#{ExamDate}";
  55. }
  56. }
  57. }