schedule_models.go 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package models
  2. type Schedule struct {
  3. ID int64 `gorm:"column:id" json:"id" form:"id"`
  4. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  5. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  6. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  7. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  8. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  9. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  10. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  11. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  12. Status int64 `gorm:"column:status" json:"status" form:"status"`
  13. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  14. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  15. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  16. Patient string `gorm:"-" json:"patient" form:"patient"`
  17. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  18. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  19. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  20. DialysisOrder DialysisOrder `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  21. PatientInfectiousDiseases []InfectiousDiseases `json:"patient_contagions" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  22. }
  23. func (Schedule) TableName() string {
  24. return "xt_schedule"
  25. }
  26. type SchedulePatients struct {
  27. ID int64 `gorm:"column:id" json:"id" form:"id"`
  28. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  29. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  30. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  31. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  32. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  33. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  34. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  35. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  36. Status int64 `gorm:"column:status" json:"status" form:"status"`
  37. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  38. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  39. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  40. Patient PatientListForFace `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
  41. }
  42. func (SchedulePatients) TableName() string {
  43. return "xt_schedule"
  44. }
  45. type PatientSchedule struct {
  46. Schedule
  47. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:PartitionId"`
  48. DeviceNumber DeviceNumber `json:"bed" gorm:"foreignkey:BedId"`
  49. Week int64 `gorm:"-" json:"week" form:"week"`
  50. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  51. }
  52. type Partition struct {
  53. DeviceZone
  54. Jihaos []DeviceNumber `json:"jihaos" gorm:"foreignkey:ZoneID"`
  55. }
  56. type Search_Schedule struct {
  57. ID int64 `gorm:"column:id" json:"id" form:"id"`
  58. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  59. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  60. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  61. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  62. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  63. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  64. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  65. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  66. Status int64 `gorm:"column:status" json:"status" form:"status"`
  67. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  68. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  69. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  70. Patient string `gorm:"-" json:"patient" form:"patient"`
  71. }
  72. func (Search_Schedule) TableName() string {
  73. return "xt_schedule"
  74. }
  75. type WeekSchedule struct {
  76. ID int64 `gorm:"column:id" json:"id" form:"id"`
  77. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  78. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  79. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  80. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  81. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  82. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  83. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  84. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  85. Status int64 `gorm:"column:status" json:"status" form:"status"`
  86. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  87. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  88. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  89. Patient string `gorm:"-" json:"patient" form:"patient"`
  90. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  91. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  92. DialysisPrescription DialysisSolution `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  93. DoctorAdvice []*DoctorAdvice `json:"doctor_advice" gorm:"-"`
  94. }
  95. func (WeekSchedule) TableName() string {
  96. return "xt_schedule"
  97. }