qc.go 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. package models
  2. type CustomDialysisData struct {
  3. Date string `json:"date"`
  4. Count int64 `json:"count"`
  5. Total int64 `json:"total"`
  6. }
  7. type QCPrescription struct {
  8. ID int64 `gorm:"column:id" json:"id"`
  9. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
  10. PatientId int64 `gorm:"column:patient_id" json:"patient_id"`
  11. ModeId int64 `gorm:"column:mode_id" json:"mode_id"`
  12. Status int64 `gorm:"column:status" json:"status"`
  13. CreatedTime int64 `gorm:"column:created_time" json:"created_time"`
  14. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time"`
  15. RecordDate int64 `gorm:"column:record_date" json:"record_date"`
  16. RecordId int64 `gorm:"column:record_id" json:"record_id"`
  17. UserAdminRole UserAdminRole `json:"role" gorm:"foreignkey:AdminUserId;AssociationForeignKey:Creater;"`
  18. Creater int64 `gorm:"column:creater" json:"creater"`
  19. Modifier int64 `gorm:"column:modifier" json:"modifier"`
  20. QCPatients QCPatients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
  21. QCDialysisOrder QCDialysisOrder `gorm:"ForeignKey:PatientId,DialysisDate;AssociationForeignKey:PatientId,RecordDate" json:"order"`
  22. QCAssessmentAfterDislysis QCAssessmentAfterDislysis `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,RecordDate" json:"ad"`
  23. }
  24. func (QCPrescription) TableName() string {
  25. return "xt_dialysis_prescription"
  26. }
  27. type QCPatients struct {
  28. ID int64 `gorm:"column:id" json:"id" form:"id"`
  29. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  30. Gender int64 `gorm:"column:gender" json:"gender" form:"gender"`
  31. DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
  32. Name string `gorm:"column:name" json:"name" form:"name"`
  33. IdCardNo string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
  34. Status int64 `gorm:"column:status" json:"status" form:"status"`
  35. }
  36. func (QCPatients) TableName() string {
  37. return "xt_patients"
  38. }
  39. type QCDialysisOrder struct {
  40. ID int64 `gorm:"column:id" json:"id"`
  41. DialysisDate int64 `gorm:"column:dialysis_date" json:"dialysis_date"`
  42. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
  43. PatientId int64 `gorm:"column:patient_id" json:"patient_id"`
  44. Stage int64 `gorm:"column:stage" json:"stage"`
  45. Remark string `gorm:"column:remark" json:"remark"`
  46. BedID int64 `gorm:"column:bed_id" json:"bed_id"`
  47. StartNurse int64 `gorm:"column:start_nurse" json:"start_nurse"`
  48. FinishNurse int64 `gorm:"column:finish_nurse" json:"finish_nurse"`
  49. Status int64 `gorm:"column:status" json:"status"`
  50. DeviceNumber DeviceNumber `gorm:"ForeignKey:BedID"`
  51. StartTime int64 `gorm:"column:start_time" json:"start_time"`
  52. EndTime int64 `gorm:"column:end_time" json:"end_time"`
  53. FinishCreator int64 `gorm:"column:finish_creator" json:"finish_creator"`
  54. FinishModifier int64 `gorm:"column:finish_modifier" json:"finish_modifier"`
  55. SchedualType int64 `gorm:"column:schedual_type" json:"schedual_type"`
  56. UserAdminRole UserAdminRole `json:"role" gorm:"foreignkey:AdminUserId;AssociationForeignKey:StartNurse;"`
  57. ZoneId int64 `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
  58. }
  59. func (QCDialysisOrder) TableName() string {
  60. return "xt_dialysis_order"
  61. }
  62. type QCAssessmentAfterDislysis struct {
  63. ID int64 `gorm:"column:id" json:"id" form:"id"`
  64. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  65. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  66. AssessmentDate int64 `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
  67. ActualTreatmentHour int64 `gorm:"column:actual_treatment_hour" json:"actual_treatment_hour" form:"actual_treatment_hour"`
  68. ActualTreatmentMinute int64 `gorm:"column:actual_treatment_minute" json:"actual_treatment_minute" form:"actual_treatment_minute"`
  69. }
  70. func (QCAssessmentAfterDislysis) TableName() string {
  71. return "xt_assessment_after_dislysis"
  72. }
  73. type QCSchedule struct {
  74. ID int64 `gorm:"column:id" json:"id" form:"id"`
  75. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  76. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  77. ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
  78. ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
  79. ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
  80. ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
  81. Status int64 `gorm:"column:status" json:"status" form:"status"`
  82. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  83. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  84. QCSPrescription QCSPrescription `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"prescription"`
  85. QCPatients QCPatients `gorm:"ForeignKey:ID;AssociationForeignKey:PatientId" json:"patient"`
  86. QCDialysisOrder QCDialysisOrder `gorm:"ForeignKey:PatientId,DialysisDate;AssociationForeignKey:PatientId,ScheduleDate" json:"order"`
  87. QCAssessmentAfterDislysis QCAssessmentAfterDislysis `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate" json:"ad"`
  88. }
  89. // `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
  90. func (QCSchedule) TableName() string {
  91. return "xt_schedule"
  92. }
  93. type QCSPrescription struct {
  94. ID int64 `gorm:"column:id" json:"id"`
  95. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
  96. PatientId int64 `gorm:"column:patient_id" json:"patient_id"`
  97. ModeId int64 `gorm:"column:mode_id" json:"mode_id"`
  98. Status int64 `gorm:"column:status" json:"status"`
  99. CreatedTime int64 `gorm:"column:created_time" json:"created_time"`
  100. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time"`
  101. RecordDate int64 `gorm:"column:record_date" json:"record_date"`
  102. RecordId int64 `gorm:"column:record_id" json:"record_id"`
  103. UserAdminRole UserAdminRole `json:"role" gorm:"foreignkey:AdminUserId;AssociationForeignKey:Creater;"`
  104. Creater int64 `gorm:"column:creater" json:"creater"`
  105. Modifier int64 `gorm:"column:modifier" json:"modifier"`
  106. }
  107. func (QCSPrescription) TableName() string {
  108. return "xt_dialysis_prescription"
  109. }