|
@@ -1562,12 +1562,13 @@ type MDialysisGoodsVM struct {
|
1562
|
1562
|
ModeId int64 `gorm:"column:mode_id" json:"mode_id"`
|
1563
|
1563
|
Status int64 `gorm:"column:status" json:"status"`
|
1564
|
1564
|
|
1565
|
|
- DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedId" json:"device_number"`
|
1566
|
|
- SchedualPatient *MSchedualPatientVMList `gorm:"ForeignKey:PatientId" json:"patient"`
|
1567
|
|
- AutomaticReduceDetail []*AutomaticReduceDetail `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"good_user"`
|
1568
|
|
- LastAutomaticReduceDetail []*AutomaticReduceDetail `gorm:"-" json:"last_good_user"`
|
1569
|
|
- DialysisBeforePrepare []*DialysisBeforePrepare `gorm:"ForeignKey:PatientId,ScheduleDate;AssociationForeignKey:PatientId,RecordDate" json:"good_user_detail"`
|
1570
|
|
- LastDialysisBeforePrepare []*DialysisBeforePrepare `gorm:"-" json:"last_good_user_detail"`
|
|
1565
|
+ DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedId" json:"device_number"`
|
|
1566
|
+ SchedualPatient *MSchedualPatientVMList `gorm:"ForeignKey:PatientId" json:"patient"`
|
|
1567
|
+ AutomaticReduceDetail []*AutomaticReduceDetail `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"good_user"`
|
|
1568
|
+ LastAutomaticReduceDetail []*AutomaticReduceDetail `gorm:"-" json:"last_good_user"`
|
|
1569
|
+ DialysisBeforePrepare []*DialysisBeforePrepare `gorm:"ForeignKey:PatientId,ScheduleDate;AssociationForeignKey:PatientId,RecordDate" json:"good_user_detail"`
|
|
1570
|
+ LastDialysisBeforePrepare []*DialysisBeforePrepare `gorm:"-" json:"last_good_user_detail"`
|
|
1571
|
+ Project []*models.HisPrescriptionProject `gorm:"-" json:"project"`
|
1571
|
1572
|
}
|
1572
|
1573
|
|
1573
|
1574
|
func (MDialysisGoodsVM) TableName() string {
|
|
@@ -2114,7 +2115,9 @@ func GetHisProjectConfig(orgid int64) (models.XtHisProjectConfig, error) {
|
2114
|
2115
|
}
|
2115
|
2116
|
|
2116
|
2117
|
func GetHisPrescriptionProject(org_id int64, patient_id int64, record_date int64) (project []*models.HisPrescriptionProject, err error) {
|
2117
|
|
- err = readDb.Model(&models.HisPrescriptionProject{}).Preload("GoodInfo", "status=1").Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND type = 3", org_id, record_date, patient_id).Find(&project).Error
|
|
2118
|
+ err = readDb.Model(&models.HisPrescriptionProject{}).Preload("GoodInfo", func(db *gorm.DB) *gorm.DB {
|
|
2119
|
+ return db.Preload("GoodsType", "status = 1").Where("status = 1 ")
|
|
2120
|
+ }).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND type = 3", org_id, record_date, patient_id).Find(&project).Error
|
2118
|
2121
|
|
2119
|
2122
|
return
|
2120
|
2123
|
}
|