schedule_models.go 4.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 PatientSchedule struct {
  27. Schedule
  28. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:PartitionId"`
  29. DeviceNumber DeviceNumber `json:"bed" gorm:"foreignkey:BedId"`
  30. Week int64 `gorm:"-" json:"week" form:"week"`
  31. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  32. }
  33. type Partition struct {
  34. DeviceZone
  35. Jihaos []DeviceNumber `json:"jihaos" gorm:"foreignkey:ZoneID"`
  36. }
  37. type Search_Schedule struct {
  38. ID int64 `gorm:"column:id" json:"id" form:"id"`
  39. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  40. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  41. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  42. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  43. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  44. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  45. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  46. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  47. Status int64 `gorm:"column:status" json:"status" form:"status"`
  48. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  49. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  50. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  51. Patient string `gorm:"-" json:"patient" form:"patient"`
  52. }
  53. func (Search_Schedule) TableName() string {
  54. return "xt_schedule"
  55. }
  56. type WeekSchedule 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. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  72. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  73. DialysisPrescription DialysisSolution `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  74. DoctorAdvice []*DoctorAdvice `json:"doctor_advice" gorm:"-"`
  75. }
  76. func (WeekSchedule) TableName() string {
  77. return "xt_schedule"
  78. }