|
@@ -37,7 +37,7 @@ func MobileGetDialysisScheduals(orgID int64, scheduleDate int64, scheduleType in
|
37
|
37
|
Preload("DialysisOrder.DeviceNumber", "status = 1 AND org_id = ?", orgID).
|
38
|
38
|
Preload("TreatmentSummary", "status = 1 AND user_org_id = ? AND assessment_date = ?", orgID, scheduleDate).
|
39
|
39
|
Preload("AssessmentAfterDislysis", "status = 1 AND user_org_id = ? AND assessment_date = ?", orgID, scheduleDate).
|
40
|
|
-
|
|
40
|
+ Preload("HisAdvices", "status = 1 AND user_org_id = ? AND advice_date = ? ", orgID, scheduleDate).
|
41
|
41
|
// Preload("DialysisOrder.MonitoringRecords", func(rdb *gorm.DB) *gorm.DB {
|
42
|
42
|
// return rdb.Where("status = 1 AND user_org_id = ?", orgID).Order("operate_time DESC")
|
43
|
43
|
// }).
|
|
@@ -102,26 +102,25 @@ func (AssessmentAfterDislysis) TableName() string {
|
102
|
102
|
}
|
103
|
103
|
|
104
|
104
|
type MDialysisScheduleVM struct {
|
105
|
|
- ID int64 `gorm:"column:id" json:"id"`
|
106
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
|
107
|
|
- PartitionId int64 `gorm:"column:partition_id" json:"partition_id"`
|
108
|
|
- BedId int64 `gorm:"column:bed_id" json:"bed_id"`
|
109
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id"`
|
110
|
|
- ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date"`
|
111
|
|
- ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type"`
|
112
|
|
- ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week"`
|
113
|
|
- ModeId int64 `gorm:"column:mode_id" json:"mode_id"`
|
114
|
|
- Status int64 `gorm:"column:status" json:"status"`
|
115
|
|
-
|
|
105
|
+ ID int64 `gorm:"column:id" json:"id"`
|
|
106
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
|
|
107
|
+ PartitionId int64 `gorm:"column:partition_id" json:"partition_id"`
|
|
108
|
+ BedId int64 `gorm:"column:bed_id" json:"bed_id"`
|
|
109
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id"`
|
|
110
|
+ ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date"`
|
|
111
|
+ ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type"`
|
|
112
|
+ ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week"`
|
|
113
|
+ ModeId int64 `gorm:"column:mode_id" json:"mode_id"`
|
|
114
|
+ Status int64 `gorm:"column:status" json:"status"`
|
116
|
115
|
SchedualPatient *MSchedualPatientVMList `gorm:"ForeignKey:PatientId" json:"patient"`
|
117
|
116
|
DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedId" json:"device_number"`
|
118
|
117
|
DialysisOrder *MDialysisOrderVMList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"dialysis_order"`
|
119
|
118
|
Prescription *models.DialysisPrescriptionList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
|
120
|
119
|
AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
|
121
|
120
|
AssessmentAfterDislysis *AssessmentAfterDislysis `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_after_dislysis"`
|
122
|
|
-
|
123
|
|
- Advices []*VMDoctorAdvice `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"doctor_advice"`
|
124
|
|
- TreatmentSummary *VMTreatmentSummary `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"treatment_summary"`
|
|
121
|
+ HisAdvices []*VMHisDoctorAdviceInfo `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"his_doctor_advice"`
|
|
122
|
+ Advices []*VMDoctorAdvice `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"doctor_advice"`
|
|
123
|
+ TreatmentSummary *VMTreatmentSummary `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"treatment_summary"`
|
125
|
124
|
}
|
126
|
125
|
|
127
|
126
|
func (MDialysisScheduleVM) TableName() string {
|
|
@@ -298,6 +297,20 @@ func (VMDoctorAdvice) TableName() string {
|
298
|
297
|
return "xt_doctor_advice"
|
299
|
298
|
}
|
300
|
299
|
|
|
300
|
+type VMHisDoctorAdviceInfo struct {
|
|
301
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
302
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
303
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
304
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
305
|
+ ExecutionTime int64 `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
|
|
306
|
+ ExecutionStaff int64 `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
|
|
307
|
+ ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
|
|
308
|
+}
|
|
309
|
+
|
|
310
|
+func (VMHisDoctorAdviceInfo) TableName() string {
|
|
311
|
+ return "his_doctor_advice_info"
|
|
312
|
+}
|
|
313
|
+
|
301
|
314
|
// 获取透析记录
|
302
|
315
|
func MobileGetDialysisRecord(orgID int64, patientID int64, recordDate int64) (*models.DialysisOrder, error) {
|
303
|
316
|
var record models.DialysisOrder
|