schedule_models.go 4.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. Patient string `gorm:"-" json:"patient" form:"patient"`
  16. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  17. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  18. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  19. DialysisOrder DialysisOrder `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  20. PatientInfectiousDiseases []InfectiousDiseases `json:"patient_contagions" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  21. }
  22. func (Schedule) TableName() string {
  23. return "xt_schedule"
  24. }
  25. type PatientSchedule struct {
  26. Schedule
  27. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:PartitionId"`
  28. DeviceNumber DeviceNumber `json:"bed" gorm:"foreignkey:BedId"`
  29. Week int64 `gorm:"-" json:"week" form:"week"`
  30. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  31. }
  32. type Partition struct {
  33. DeviceZone
  34. Jihaos []DeviceNumber `json:"jihaos" gorm:"foreignkey:ZoneID"`
  35. }
  36. type Search_Schedule struct {
  37. ID int64 `gorm:"column:id" json:"id" form:"id"`
  38. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  39. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  40. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  41. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  42. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  43. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  44. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  45. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  46. Status int64 `gorm:"column:status" json:"status" form:"status"`
  47. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  48. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  49. Patient string `gorm:"-" json:"patient" form:"patient"`
  50. }
  51. func (Search_Schedule) TableName() string {
  52. return "xt_schedule"
  53. }
  54. type WeekSchedule struct {
  55. ID int64 `gorm:"column:id" json:"id" form:"id"`
  56. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  57. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  58. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  59. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  60. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  61. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  62. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  63. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  64. Status int64 `gorm:"column:status" json:"status" form:"status"`
  65. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  66. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  67. Patient string `gorm:"-" json:"patient" form:"patient"`
  68. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  69. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  70. DialysisPrescription DialysisSolution `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  71. DoctorAdvice []*DoctorAdvice `json:"doctor_advice" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId"`
  72. }
  73. func (WeekSchedule) TableName() string {
  74. return "xt_schedule"
  75. }