|
@@ -30,7 +30,6 @@ func MobileGetDialysisScheduals(orgID int64, scheduleDate int64, scheduleType in
|
30
|
30
|
Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
|
31
|
31
|
Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
|
32
|
32
|
Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
|
33
|
|
- Preload("TreatmentMode", "status = 1").
|
34
|
33
|
Preload("Advices", "status = 1 AND user_org_id = ? AND advice_type = 2", orgID).
|
35
|
34
|
Preload("Prescription", "status = 1 AND user_org_id = ? AND record_date = ?", orgID, scheduleDate).
|
36
|
35
|
Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).
|
|
@@ -59,7 +58,6 @@ func MobileGetWaitingScheduals(orgID int64, scheduleDate int64) ([]*MDialysisSch
|
59
|
58
|
Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
|
60
|
59
|
Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
|
61
|
60
|
// Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
|
62
|
|
- Preload("TreatmentMode", "status = 1").
|
63
|
61
|
Preload("Prescription", "status = 1 AND user_org_id = ? AND record_date = ?", orgID, scheduleDate).
|
64
|
62
|
Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).
|
65
|
63
|
Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
|
|
@@ -86,13 +84,10 @@ type MDialysisScheduleVM struct {
|
86
|
84
|
|
87
|
85
|
SchedualPatient *MSchedualPatientVMList `gorm:"ForeignKey:PatientId" json:"patient"`
|
88
|
86
|
DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedId" json:"device_number"`
|
89
|
|
- DeviceZone *models.DeviceZone `gorm:"ForeignKey:PartitionId" json:"device_zone"`
|
90
|
|
- TreatmentMode *models.TreatmentMode `gorm:"ForeignKey:ModeId" json:"treatment_mode"`
|
91
|
87
|
DialysisOrder *MDialysisOrderVMList `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
|
92
|
88
|
Prescription *models.DialysisPrescriptionList `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"prescription"`
|
93
|
89
|
AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"assessment_before_dislysis"`
|
94
|
|
- TreatmentSummary *models.TreatmentSummary `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"treatment_summary"`
|
95
|
|
- Advices []*models.DoctorAdvice `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
|
|
90
|
+ Advices []*VMDoctorAdvice `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
|
96
|
91
|
}
|
97
|
92
|
|
98
|
93
|
func (MDialysisScheduleVM) TableName() string {
|
|
@@ -239,23 +234,32 @@ type MDialysisOrderVMList struct {
|
239
|
234
|
// PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id"`
|
240
|
235
|
Stage int64 `gorm:"column:stage" json:"stage"`
|
241
|
236
|
// Remark string `gorm:"column:remark" json:"remark"`
|
242
|
|
- BedID int64 `gorm:"column:bed_id" json:"bed_id"`
|
243
|
|
- StartNurse int64 `gorm:"column:start_nurse" json:"start_nurse"`
|
244
|
|
- FinishNurse int64 `gorm:"column:finish_nurse" json:"finish_nurse"`
|
245
|
|
- Status int64 `gorm:"column:status" json:"status"`
|
246
|
|
- PunctureNurse int64 `gorm:"column:puncture_nurse" json:"puncture_nurse"`
|
247
|
|
- DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
|
248
|
|
- Creator int64 `gorm:"column:creator" json:"creator"`
|
249
|
|
- Modifier int64 `gorm:"column:modifier" json:"modifier"`
|
250
|
|
- FinishCreator int64 `gorm:"column:finish_creator" json:"finish_creator"`
|
251
|
|
- FinishModifier int64 `gorm:"column:finish_modifier" json:"finish_modifier"`
|
252
|
|
- SchedualType int64 `gorm:"column:schedual_type" json:"schedual_type"`
|
|
237
|
+ BedID int64 `gorm:"column:bed_id" json:"bed_id"`
|
|
238
|
+ StartNurse int64 `gorm:"column:start_nurse" json:"start_nurse"`
|
|
239
|
+ Status int64 `gorm:"column:status" json:"status"`
|
|
240
|
+ DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
|
|
241
|
+ Creator int64 `gorm:"column:creator" json:"creator"`
|
253
|
242
|
}
|
254
|
243
|
|
255
|
244
|
func (MDialysisOrderVMList) TableName() string {
|
256
|
245
|
return "xt_dialysis_order"
|
257
|
246
|
}
|
258
|
247
|
|
|
248
|
+type VMDoctorAdvice struct {
|
|
249
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
250
|
+ GroupNo int64 `gorm:"column:groupno" json:"groupno" form:"groupno"`
|
|
251
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
252
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
253
|
+ AdviceDate int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
|
|
254
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
255
|
+ ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
|
|
256
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date"`
|
|
257
|
+}
|
|
258
|
+
|
|
259
|
+func (VMDoctorAdvice) TableName() string {
|
|
260
|
+ return "xt_doctor_advice"
|
|
261
|
+}
|
|
262
|
+
|
259
|
263
|
// 获取透析记录
|
260
|
264
|
func MobileGetDialysisRecord(orgID int64, patientID int64, recordDate int64) (*models.DialysisOrder, error) {
|
261
|
265
|
var record models.DialysisOrder
|