浏览代码

耗材参数

XMLWAN 4 年前
父节点
当前提交
763ba1873c
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      service/his_project_service.go

+ 5 - 1
service/his_project_service.go 查看文件

393
 
393
 
394
 func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []string, orgid int64) (prescription []*models.HisPrescription, err error) {
394
 func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []string, orgid int64) (prescription []*models.HisPrescription, err error) {
395
 
395
 
396
-	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 ", his_patient_id, recorddate, schIDs).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", "status = 1 and user_org_id = ?", orgid).Preload("HisPrescriptionProject", "status = 1 and user_org_id = ?", orgid).Preload("VMHisPrescriptionInfo", "status =1 and user_org_id = ?", orgid).Preload("XtHisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
396
+	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 ", his_patient_id, recorddate, schIDs).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
397
+		return XTReadDB().Where("user_org_id=? and status=1", orgid).Preload("Drug", func(db *gorm.DB) *gorm.DB {
398
+			return XTReadDB().Where("status = 1")
399
+		})
400
+	}).Preload("HisPrescriptionProject", "status = 1 and user_org_id = ?", orgid).Preload("VMHisPrescriptionInfo", "status =1 and user_org_id = ?", orgid).Preload("XtHisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
397
 
401
 
398
 	return prescription, err
402
 	return prescription, err
399
 }
403
 }