|
@@ -912,8 +912,12 @@ func FindSickById(id int64) (*models.OutpatientServiceSick, error) {
|
912
|
912
|
|
913
|
913
|
func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, end_time int64) (prescription []*models.HisPrescription, err error) {
|
914
|
914
|
err = readDb.Model(&models.HisPrescription{}).
|
915
|
|
- Preload("HisAdditionalCharge", "status = 1 AND user_org_id = ? AND med_list_codg <> ''", org_id).
|
916
|
|
- Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
|
|
915
|
+ Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
|
|
916
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
|
|
917
|
+ }).
|
|
918
|
+ Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
|
|
919
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("BaseDrugLib", "status=1")
|
|
920
|
+ }).
|
917
|
921
|
Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
|
918
|
922
|
return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
|
919
|
923
|
}).
|