schedule_models.go 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. package models
  2. type VmSchedules 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. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  17. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  18. DialysisOrder DialysisOrder `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  19. XtPatients XtPatients `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
  20. DoctorAdvice []*DoctorAdvice `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  21. DialysisPrescription DialysisPrescription `json:"prescription" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  22. HisDoctorAdviceInfo []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  23. DialysisSolution []*DialysisSolution `json:"dialysissolution" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  24. }
  25. func (VmSchedules) TableName() string {
  26. return "xt_schedule"
  27. }
  28. type Schedule struct {
  29. ID int64 `gorm:"column:id" json:"id" form:"id"`
  30. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  31. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  32. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  33. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  34. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  35. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  36. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  37. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  38. Status int64 `gorm:"column:status" json:"status" form:"status"`
  39. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  40. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  41. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  42. Patient string `gorm:"-" json:"patient" form:"patient"`
  43. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  44. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  45. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  46. DialysisOrder DialysisOrder `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  47. DialysisPrescription DialysisPrescription `json:"dialysis_prescription" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:RecordDate,PatientId;"`
  48. PatientInfectiousDiseases []InfectiousDiseases `json:"patient_contagions" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  49. }
  50. func (Schedule) TableName() string {
  51. return "xt_schedule"
  52. }
  53. type SchedulePatients struct {
  54. ID int64 `gorm:"column:id" json:"id" form:"id"`
  55. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  56. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  57. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  58. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  59. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  60. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  61. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  62. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  63. Status int64 `gorm:"column:status" json:"status" form:"status"`
  64. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  65. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  66. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  67. Patient PatientListForFace `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
  68. }
  69. func (SchedulePatients) TableName() string {
  70. return "xt_schedule"
  71. }
  72. type PatientSchedule struct {
  73. Schedule
  74. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:PartitionId"`
  75. DeviceNumber DeviceNumber `json:"bed" gorm:"foreignkey:BedId"`
  76. Week int64 `gorm:"-" json:"week" form:"week"`
  77. TreatmentMode TreatmentMode `json:"mode" gorm:"foreignkey:ModeId"`
  78. }
  79. type Partition struct {
  80. DeviceZone
  81. Jihaos []DeviceNumber `json:"jihaos" gorm:"foreignkey:ZoneID"`
  82. }
  83. type Search_Schedule struct {
  84. ID int64 `gorm:"column:id" json:"id" form:"id"`
  85. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  86. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  87. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  88. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  89. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  90. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  91. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  92. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  93. Status int64 `gorm:"column:status" json:"status" form:"status"`
  94. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  95. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  96. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  97. Patient string `gorm:"-" json:"patient" form:"patient"`
  98. }
  99. func (Search_Schedule) TableName() string {
  100. return "xt_schedule"
  101. }
  102. type WeekSchedule struct {
  103. ID int64 `gorm:"column:id" json:"id" form:"id"`
  104. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  105. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  106. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  107. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  108. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  109. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  110. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  111. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  112. Status int64 `gorm:"column:status" json:"status" form:"status"`
  113. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  114. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  115. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  116. Patient string `gorm:"-" json:"patient" form:"patient"`
  117. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  118. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  119. DialysisPrescription DialysisSolution `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  120. DoctorAdvice []*DoctorAdvice `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  121. HisDoctorAdviceInfo []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  122. Solution []*DialysisSolution `json:"solution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  123. DialysisSolution DialysisSolution `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  124. XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate"`
  125. }
  126. func (WeekSchedule) TableName() string {
  127. return "xt_schedule"
  128. }
  129. type ScheduleTemplate struct {
  130. ID int64 `gorm:"column:id" json:"id" form:"id"`
  131. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  132. TemplateId int64 `gorm:"column:template_id" json:"template_id" form:"template_id"`
  133. Status int64 `gorm:"column:status" json:"status" form:"status"`
  134. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  135. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  136. }
  137. func (ScheduleTemplate) TableName() string {
  138. return "xt_schedule_template"
  139. }
  140. type XtDataPrint struct {
  141. ID int64 `gorm:"column:id" json:"id" form:"id"`
  142. IsOpen int64 `gorm:"column:is_open" json:"is_open" form:"is_open"`
  143. Status int64 `gorm:"column:status" json:"status" form:"status"`
  144. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  145. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  146. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  147. }
  148. func (XtDataPrint) TableName() string {
  149. return "xt_data_print"
  150. }
  151. type VmSchedulesRemind struct {
  152. ID int64 `gorm:"column:id" json:"id" form:"id"`
  153. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  154. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  155. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  156. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  157. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  158. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  159. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  160. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  161. Status int64 `gorm:"column:status" json:"status" form:"status"`
  162. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  163. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  164. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  165. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  166. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  167. DialysisOrder DialysisOrder `json:"order" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  168. XtPatients XtPatients `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
  169. DoctorAdvice []*DoctorAdvice `json:"doctoradvice" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  170. DialysisPrescription DialysisPrescription `json:"prescription" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  171. HisDoctorAdviceInfo []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  172. DialysisSolution DialysisSolution `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId;"`
  173. XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
  174. LastAfterWeight AssessmentAfterDislysis `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
  175. }
  176. func (VmSchedulesRemind) TableName() string {
  177. return "xt_schedule"
  178. }
  179. type WeekScheduleSix struct {
  180. ID int64 `gorm:"column:id" json:"id" form:"id"`
  181. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  182. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  183. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  184. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  185. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  186. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  187. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  188. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  189. Status int64 `gorm:"column:status" json:"status" form:"status"`
  190. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  191. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  192. IsExport int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
  193. Patient string `gorm:"-" json:"patient" form:"patient"`
  194. DeviceZone DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
  195. DeviceNumber DeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
  196. DialysisPrescription DialysisSolution `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  197. DoctorAdvice []*DoctorAdvice `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  198. HisDoctorAdviceInfo []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  199. DialysisSolution DialysisSolution `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
  200. XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate"`
  201. }
  202. func (WeekScheduleSix) TableName() string {
  203. return "xt_schedule"
  204. }
  205. type BlodSchedule struct {
  206. ID int64 `gorm:"column:id" json:"id" form:"id"`
  207. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  208. PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
  209. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  210. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  211. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  212. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  213. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  214. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  215. Status int64 `gorm:"column:status" json:"status" form:"status"`
  216. VmBloodPatients VmBloodPatients `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
  217. BloodDialysisOrder BloodPatientDialysisOrder `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
  218. BloodDialysisPrescription BloodDialysisPrescription `json:"prescription" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:RecordDate,PatientId;"`
  219. }
  220. func (BlodSchedule) TableName() string {
  221. return "xt_schedule"
  222. }
  223. type BloodPatientDialysisOrder struct {
  224. ID int64 `gorm:"column:id" json:"id" form:"id"`
  225. DialysisDate int64 `gorm:"column:dialysis_date" json:"dialysis_date" form:"dialysis_date"`
  226. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  227. Stage int64 `gorm:"column:stage" json:"stage" form:"stage"`
  228. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  229. }
  230. func (BloodPatientDialysisOrder) TableName() string {
  231. return "xt_dialysis_order"
  232. }
  233. type BloodPatientDialysisPrescription struct {
  234. ID int64 `gorm:"column:id" json:"id" form:"id"`
  235. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  236. MachineType string `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
  237. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  238. DialysisDialyszers string `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
  239. DialysisIrrigation string `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
  240. DialyzerPerfusionApparatus string `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
  241. }
  242. func (BloodPatientDialysisPrescription) TableName() string {
  243. return "xt_dialysis_prescription"
  244. }
  245. type VmBloodPatients struct {
  246. ID int64 `gorm:"column:id" json:"id" form:"id"`
  247. BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
  248. Name string `gorm:"column:name" json:"name" form:"name"`
  249. }
  250. func (VmBloodPatients) TableName() string {
  251. return "xt_patients"
  252. }