XMLWAN пре 3 година
родитељ
комит
21149c7a59
1 измењених фајлова са 13 додато и 1 уклоњено
  1. 13 1
      service/patient_service.go

+ 13 - 1
service/patient_service.go Прегледај датотеку

@@ -413,7 +413,7 @@ func GetAllHisAdvicesByList(orgID int64, scheduleDate int64) (hisAdvices []VMHis
413 413
 	defer redis.Close()
414 414
 	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":his_advices_list_all"
415 415
 	his_advices_all, _ := redis.Get(key).Result()
416
-	fmt.Println("hish233232222332232323232323", len(his_advices_all))
416
+
417 417
 	if len(his_advices_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
418 418
 		err = readDb.Model(&VMHisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? AND advice_date = ?", orgID, scheduleDate).Find(&hisAdvices).Error
419 419
 		if err != nil {
@@ -523,6 +523,10 @@ func FindPatientByIdTwo(orgID int64, id int64) (patient models.XtPatientsNew, er
523 523
 	return
524 524
 }
525 525
 
526
+//func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
527
+// err = readDb.Model(&models.Patients{}).Preload("Contagions", "status = 1").Preload("Diseases", "status = 1").Where("id = ? and user_org_id=? and status=1", id, orgID).First(&patient).Error
528
+// return
529
+//}
526 530
 func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
527 531
 	redis := RedisClient()
528 532
 	defer redis.Close()
@@ -2607,3 +2611,11 @@ func GetAllPrescriptionByListOne(orgID int64, scheduleDate int64) (prescriptions
2607 2611
 		return prescriptions, nil
2608 2612
 	}
2609 2613
 }
2614
+
2615
+func GetAllHisProjectPrescription(orgid int64, recorddate int64) (project []*models.HisPrescriptionProject, err error) {
2616
+
2617
+	err = XTReadDB().Where("user_org_id = ? and record_date = ? and status = 1", orgid, recorddate).Preload("GoodInfo", func(db *gorm.DB) *gorm.DB {
2618
+		return db.Preload("GoodsType", "status = 1").Where("status = 1 ")
2619
+	}).Find(&project).Error
2620
+	return project, err
2621
+}