瀏覽代碼

历史排班

28169 1 年之前
父節點
當前提交
ee67911363

+ 19 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go 查看文件

433
 				newprescribe.Remark = ""
433
 				newprescribe.Remark = ""
434
 			}
434
 			}
435
 
435
 
436
+			if adminUserInfo.Org.Id == 10599 {
437
+				// 获取透析模版
438
+				solutionone, _ := service.MobileGetDialysisSolutionByModeIdSevenTwety(adminUserInfo.Org.Id, id, schedual.ModeId)
439
+				if solutionone.Anticoagulant > 0 {
440
+					newprescribe.Anticoagulant = solutionone.Anticoagulant
441
+					newprescribe.AnticoagulantShouji = solutionone.AnticoagulantShouji
442
+					newprescribe.AnticoagulantWeichi = solutionone.AnticoagulantWeichi
443
+					newprescribe.AnticoagulantZongliang = solutionone.AnticoagulantZongliang
444
+					newprescribe.BloodAccess = solutionone.BloodAccess
445
+					newprescribe.DialysisDurationHour = solutionone.DialysisDurationHour
446
+					newprescribe.DialysisDurationMinute = solutionone.DialysisDurationMinute
447
+					newprescribe.DialysisIrrigation = solutionone.DialysisIrrigation
448
+					newprescribe.DialysisDialyszers = solutionone.DialysisDialyszers
449
+					newprescribe.DialysisStrainer = solutionone.DialysisStrainer
450
+
451
+				}
452
+
453
+			}
454
+
436
 			//针对普宁和揭阳
455
 			//针对普宁和揭阳
437
 			if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 {
456
 			if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 {
438
 				prescriptionTwenty, _ := service.GetLastDialysisPrescriptionTwenty(newprescribe.PatientId, newprescribe.RecordDate, newprescribe.UserOrgId)
457
 				prescriptionTwenty, _ := service.GetLastDialysisPrescriptionTwenty(newprescribe.PatientId, newprescribe.RecordDate, newprescribe.UserOrgId)

+ 16 - 16
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

1666
 				//
1666
 				//
1667
 				fmt.Println("config.IsOpen", config.IsOpen)
1667
 				fmt.Println("config.IsOpen", config.IsOpen)
1668
 				fmt.Println("config.IsOpen", item.UserOrgId)
1668
 				fmt.Println("config.IsOpen", item.UserOrgId)
1669
-				//if config.IsOpen == 0 && item.UserOrgId == 10402 {
1670
-				//
1671
-				//	service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1672
-				//	//更新字典里面的库存
1673
-				//	stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1674
-				//	var sum_count int64
1675
-				//	for _, its := range stockInfo {
1676
-				//		if its.MaxUnit == medical.MaxUnit {
1677
-				//			its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1678
-				//		}
1679
-				//		sum_count += its.StockMaxNumber + its.StockMinNumber
1680
-				//	}
1681
-				//	service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1682
-				//	//剩余库存
1683
-				//	service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1684
-				//}
1669
+				if config.IsOpen == 1 && item.UserOrgId == 10375 {
1670
+
1671
+					service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1672
+					//更新字典里面的库存
1673
+					stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1674
+					var sum_count int64
1675
+					for _, its := range stockInfo {
1676
+						if its.MaxUnit == medical.MaxUnit {
1677
+							its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1678
+						}
1679
+						sum_count += its.StockMaxNumber + its.StockMinNumber
1680
+					}
1681
+					service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1682
+					//剩余库存
1683
+					service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1684
+				}
1685
 
1685
 
1686
 			}
1686
 			}
1687
 		}
1687
 		}

+ 28 - 7
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

10
 	"fmt"
10
 	"fmt"
11
 	"github.com/astaxie/beego"
11
 	"github.com/astaxie/beego"
12
 	"github.com/jinzhu/gorm"
12
 	"github.com/jinzhu/gorm"
13
+	"github.com/mozillazg/go-pinyin"
13
 	"strconv"
14
 	"strconv"
14
 	"strings"
15
 	"strings"
15
 	"time"
16
 	"time"
272
 			return
273
 			return
273
 		}
274
 		}
274
 
275
 
276
+		hans := name // 要转换的汉字字符串
277
+		// 创建一个拼音转换器
278
+		p := pinyin.NewArgs()
279
+
280
+		// 将汉字转为拼音
281
+		pinyinSlice := pinyin.Pinyin(hans, p)
282
+
283
+		// 输出拼音
284
+		fmt.Println("Pinyin:", pinyinSlice)
285
+
286
+		// 获取首字母
287
+		firstLetter := ""
288
+		for _, py := range pinyinSlice {
289
+			if len(py) > 0 {
290
+				firstLetter += string(py[0][0])
291
+			}
292
+		}
293
+
275
 		patients := models.Patients{
294
 		patients := models.Patients{
276
 			Name:              name,
295
 			Name:              name,
277
 			Gender:            sex,
296
 			Gender:            sex,
296
 			SchRemark:         remark,
315
 			SchRemark:         remark,
297
 			TreatmentPlan:     treatment_plan,
316
 			TreatmentPlan:     treatment_plan,
298
 		}
317
 		}
318
+		patients.FirstLetter = firstLetter
299
 		err = service.CreateOldPatient(&patients)
319
 		err = service.CreateOldPatient(&patients)
300
 		fmt.Print("报错", err)
320
 		fmt.Print("报错", err)
301
 		patient, err := service.GetLastOldPatient(orgid)
321
 		patient, err := service.GetLastOldPatient(orgid)
340
 			SchRemark:         remark,
360
 			SchRemark:         remark,
341
 			TreatmentPlan:     treatment_plan,
361
 			TreatmentPlan:     treatment_plan,
342
 		}
362
 		}
363
+		patientsNew.FirstLetter = firstLetter
343
 		err = service.CreateNewPatient(&patientsNew)
364
 		err = service.CreateNewPatient(&patientsNew)
344
 		key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patient.ID, 10) + ":patient_info"
365
 		key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patient.ID, 10) + ":patient_info"
345
 		redis := service.RedisClient()
366
 		redis := service.RedisClient()
1368
 		}
1389
 		}
1369
 
1390
 
1370
 		//查询号透析号是否相同
1391
 		//查询号透析号是否相同
1371
-		thisPatientother, _ := service.FindPatientByDialysisNoOne(orgid, dialysis, id)
1372
-		if thisPatientother.ID > 0 && thisPatientother.ID != patient.BloodId {
1373
-			returnData := make(map[string]interface{}, 0)
1374
-			returnData["msg"] = "透析号码已存在"
1375
-			this.ServeSuccessJSON(returnData)
1376
-			return
1377
-		}
1392
+		//thisPatientother, _ := service.FindPatientByDialysisNoOne(orgid, dialysis, id)
1393
+		//if thisPatientother.ID > 0 && thisPatientother.ID != patient.BloodId {
1394
+		//	returnData := make(map[string]interface{}, 0)
1395
+		//	returnData["msg"] = "透析号码已存在"
1396
+		//	this.ServeSuccessJSON(returnData)
1397
+		//	return
1398
+		//}
1378
 
1399
 
1379
 		patients := models.Patients{
1400
 		patients := models.Patients{
1380
 			Name:              name,
1401
 			Name:              name,

+ 11 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go 查看文件

399
 	}
399
 	}
400
 
400
 
401
 	//针对百霖和贝尔
401
 	//针对百霖和贝尔
402
-	if orgid == 10138 || orgid == 10278 || orgid == 3877 || orgid == 10585 {
402
+	if orgid == 10138 || orgid == 10278 || orgid == 3877 {
403
 		//获取今日的排班数据
403
 		//获取今日的排班数据
404
 		list, _ := service.GetMobileScheduleListByScheduleDate(orgid, startTime)
404
 		list, _ := service.GetMobileScheduleListByScheduleDate(orgid, startTime)
405
 		for _, item := range list {
405
 		for _, item := range list {
409
 		}
409
 		}
410
 	}
410
 	}
411
 
411
 
412
+	if orgid == 10585 {
413
+		//获取今日的排班数据
414
+		list, _ := service.GetMobileScheduleListByScheduleDate(orgid, startTime)
415
+		for _, item := range list {
416
+			solution, _ := service.GetLongSolutionByModeId(item.PatientId, item.ModeId, item.UserOrgId)
417
+			var str = solution.DialyzerPerfusionApparatus
418
+			service.UpdateScheduleByDialysis(item.PatientId, item.ModeId, item.ScheduleDate, item.UserOrgId, str, item.ScheduleType)
419
+		}
420
+	}
421
+
412
 	//查询排班里面的空透析器
422
 	//查询排班里面的空透析器
413
 	if orgid == 10375 {
423
 	if orgid == 10375 {
414
 
424
 

+ 22 - 0
controllers/patient_api_controller.go 查看文件

7
 	"XT_New/utils"
7
 	"XT_New/utils"
8
 	"encoding/json"
8
 	"encoding/json"
9
 	"github.com/jinzhu/gorm"
9
 	"github.com/jinzhu/gorm"
10
+	"github.com/mozillazg/go-pinyin"
10
 
11
 
11
 	//"github.com/jinzhu/gorm"
12
 	//"github.com/jinzhu/gorm"
12
 	"math"
13
 	"math"
355
 	patient.BindingState = 2
356
 	patient.BindingState = 2
356
 	// patient.Lapseto = 1
357
 	// patient.Lapseto = 1
357
 
358
 
359
+	hans := patient.Name // 要转换的汉字字符串
360
+	// 创建一个拼音转换器
361
+	p := pinyin.NewArgs()
362
+
363
+	// 将汉字转为拼音
364
+	pinyinSlice := pinyin.Pinyin(hans, p)
365
+
366
+	// 输出拼音
367
+	fmt.Println("Pinyin:", pinyinSlice)
368
+
369
+	// 获取首字母
370
+	firstLetter := ""
371
+	for _, py := range pinyinSlice {
372
+		if len(py) > 0 {
373
+			firstLetter += string(py[0][0])
374
+		}
375
+	}
376
+
377
+	patient.FirstLetter = firstLetter
378
+
358
 	err := service.CreatePatient(&patient, contagions, diseases)
379
 	err := service.CreatePatient(&patient, contagions, diseases)
359
 	fmt.Println("创建病人失败err")
380
 	fmt.Println("创建病人失败err")
360
 	if err != nil {
381
 	if err != nil {
466
 		AllergicHistory:              patient.AllergicHistory,
487
 		AllergicHistory:              patient.AllergicHistory,
467
 		PatientAddress:               patient.PatientAddress,
488
 		PatientAddress:               patient.PatientAddress,
468
 	}
489
 	}
490
+	patientsNew.FirstLetter = firstLetter
469
 
491
 
470
 	err = service.CreatePatientsNew(&patientsNew)
492
 	err = service.CreatePatientsNew(&patientsNew)
471
 	fmt.Print("创建失败", err)
493
 	fmt.Print("创建失败", err)

+ 1 - 0
controllers/pharmacy_controller.go 查看文件

495
 		etime = stime + 86399
495
 		etime = stime + 86399
496
 	}
496
 	}
497
 	err = service.DrugWithdrawal(orgid, patient_id, stime, etime, creater)
497
 	err = service.DrugWithdrawal(orgid, patient_id, stime, etime, creater)
498
+
498
 	if err != nil {
499
 	if err != nil {
499
 		utils.ErrorLog(err.Error())
500
 		utils.ErrorLog(err.Error())
500
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
501
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())

+ 30 - 30
controllers/sign_api_controller.go 查看文件

665
 
665
 
666
 func (this *SignApiController) UploadPrintOrder() {
666
 func (this *SignApiController) UploadPrintOrder() {
667
 
667
 
668
-	//list, _ := service.GetAllPatientNew(10622)
669
-	//for _, item := range list {
670
-	//
671
-	//	hans := item.Name // 要转换的汉字字符串
672
-	//	// 创建一个拼音转换器
673
-	//	p := pinyin.NewArgs()
674
-	//
675
-	//	// 将汉字转为拼音
676
-	//	pinyinSlice := pinyin.Pinyin(hans, p)
677
-	//
678
-	//	// 输出拼音
679
-	//	fmt.Println("Pinyin:", pinyinSlice)
680
-	//
681
-	//	// 获取首字母
682
-	//	firstLetter := ""
683
-	//	for _, py := range pinyinSlice {
684
-	//		if len(py) > 0 {
685
-	//			firstLetter += string(py[0][0])
686
-	//		}
687
-	//	}
688
-	//
689
-	//	item.FirstLetter = firstLetter
690
-	//	service.UpdatePatientNew(item.ID, item.FirstLetter)
691
-	//	// 输出首字母
692
-	//	//fmt.Println("First Letter:", firstLetter)
693
-	//}
668
+	list, _ := service.GetAllPatientNew(10375)
669
+	for _, item := range list {
694
 
670
 
695
-	baseList, _ := service.GeteAllBaseList(10622)
696
-	for _, item := range baseList {
697
-		hans := item.DrugName // 要转换的汉字字符串
671
+		hans := item.Name // 要转换的汉字字符串
698
 		// 创建一个拼音转换器
672
 		// 创建一个拼音转换器
699
 		p := pinyin.NewArgs()
673
 		p := pinyin.NewArgs()
674
+
700
 		// 将汉字转为拼音
675
 		// 将汉字转为拼音
701
 		pinyinSlice := pinyin.Pinyin(hans, p)
676
 		pinyinSlice := pinyin.Pinyin(hans, p)
677
+
678
+		// 输出拼音
679
+		fmt.Println("Pinyin:", pinyinSlice)
680
+
702
 		// 获取首字母
681
 		// 获取首字母
703
 		firstLetter := ""
682
 		firstLetter := ""
704
 		for _, py := range pinyinSlice {
683
 		for _, py := range pinyinSlice {
706
 				firstLetter += string(py[0][0])
685
 				firstLetter += string(py[0][0])
707
 			}
686
 			}
708
 		}
687
 		}
688
+
709
 		item.FirstLetter = firstLetter
689
 		item.FirstLetter = firstLetter
710
-		service.UpdateBaseList(item.ID, item.FirstLetter)
690
+		service.UpdatePatientNew(item.ID, item.FirstLetter)
691
+		// 输出首字母
692
+		//fmt.Println("First Letter:", firstLetter)
711
 	}
693
 	}
694
+
695
+	//baseList, _ := service.GeteAllBaseList(10375)
696
+	//for _, item := range baseList {
697
+	//	hans := item.DrugName // 要转换的汉字字符串
698
+	//	// 创建一个拼音转换器
699
+	//	p := pinyin.NewArgs()
700
+	//	// 将汉字转为拼音
701
+	//	pinyinSlice := pinyin.Pinyin(hans, p)
702
+	//	// 获取首字母
703
+	//	firstLetter := ""
704
+	//	for _, py := range pinyinSlice {
705
+	//		if len(py) > 0 {
706
+	//			firstLetter += string(py[0][0])
707
+	//		}
708
+	//	}
709
+	//	item.FirstLetter = firstLetter
710
+	//	service.UpdateBaseList(item.ID, item.FirstLetter)
711
+	//}
712
 	//pdf := gofpdf.New("P", "mm", "A4", "")
712
 	//pdf := gofpdf.New("P", "mm", "A4", "")
713
 	//pdf.AddPage()
713
 	//pdf.AddPage()
714
 	//pdf.Text(5, 10, "血液净化治疗记录单")
714
 	//pdf.Text(5, 10, "血液净化治疗记录单")

+ 1 - 0
models/dialysis.go 查看文件

1274
 	ExecutionFrequencyId  int64              `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1274
 	ExecutionFrequencyId  int64              `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1275
 	IsMobile              int64              `gorm:"column:is_mobile" json:"is_mobile" form:"is_mobile"`
1275
 	IsMobile              int64              `gorm:"column:is_mobile" json:"is_mobile" form:"is_mobile"`
1276
 	IsSelfDrug            int64              `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
1276
 	IsSelfDrug            int64              `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
1277
+	IsMedicine            int64              `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
1277
 }
1278
 }
1278
 
1279
 
1279
 func (HisDoctorAdvice) TableName() string {
1280
 func (HisDoctorAdvice) TableName() string {

+ 3 - 3
service/dialysis_solution_service.go 查看文件

2
 
2
 
3
 import (
3
 import (
4
 	"XT_New/models"
4
 	"XT_New/models"
5
-	"fmt"
6
 	"github.com/jinzhu/gorm"
5
 	"github.com/jinzhu/gorm"
7
 )
6
 )
8
 
7
 
42
 }
41
 }
43
 
42
 
44
 func GetPatientDialysisSolutionGroupList(keywords string, limit int64, page int64, partition_id int64, schedule_type int64, scheduleDate int64, orgID int64, ids []string) (schedule []*models.VmBloodSchedule, total int64, err error) {
43
 func GetPatientDialysisSolutionGroupList(keywords string, limit int64, page int64, partition_id int64, schedule_type int64, scheduleDate int64, orgID int64, ids []string) (schedule []*models.VmBloodSchedule, total int64, err error) {
45
-	fmt.Println("ids23322332323232wode", len(ids))
44
+
46
 	db := XTReadDB().Model(&models.VmBloodSchedule{}).Where("xt_schedule.status = 1")
45
 	db := XTReadDB().Model(&models.VmBloodSchedule{}).Where("xt_schedule.status = 1")
47
 	offset := (page - 1) * limit
46
 	offset := (page - 1) * limit
48
 	if scheduleDate > 0 {
47
 	if scheduleDate > 0 {
66
 		db = db.Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
65
 		db = db.Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
67
 			Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
66
 			Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
68
 			Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
67
 			Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
69
-			Preload("DialysisSolution", "status = 1 AND user_org_id = ? and solution_status = 1", orgID)
68
+			Preload("DialysisSolution", "status = 1 AND user_org_id = ? and solution_status = 1", orgID).Preload("DialysisPrescription", "status=1 and user_org_id =? and record_date =?", orgID, scheduleDate)
70
 		db = db.Joins("JOIN xt_patients AS patient ON patient.id=xt_schedule.patient_id AND patient.status = 1 AND patient.user_org_id = ? AND patient.name Like ?", orgID, keywords)
69
 		db = db.Joins("JOIN xt_patients AS patient ON patient.id=xt_schedule.patient_id AND patient.status = 1 AND patient.user_org_id = ? AND patient.name Like ?", orgID, keywords)
71
 		err = db.Count(&total).Offset(offset).Limit(limit).Find(&schedule).Error
70
 		err = db.Count(&total).Offset(offset).Limit(limit).Find(&schedule).Error
72
 	} else {
71
 	} else {
73
 		err = db.Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
72
 		err = db.Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
74
 			Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
73
 			Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
75
 			Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
74
 			Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
75
+			Preload("DialysisPrescription", "status=1 and user_org_id =? and record_date =?", orgID, scheduleDate).
76
 			Preload("DialysisSolution", "status = 1 AND user_org_id = ? and solution_status = 1", orgID).Count(&total).Offset(offset).Limit(limit).Find(&schedule).Error
76
 			Preload("DialysisSolution", "status = 1 AND user_org_id = ? and solution_status = 1", orgID).Count(&total).Offset(offset).Limit(limit).Find(&schedule).Error
77
 	}
77
 	}
78
 
78
 

+ 8 - 0
service/mobile_dialysis_service.go 查看文件

2332
 	return &record, nil
2332
 	return &record, nil
2333
 }
2333
 }
2334
 
2334
 
2335
+// 透析方案
2336
+func MobileGetDialysisSolutionByModeIdSevenTwety(orgID int64, patientID int64, mode_id int64) (models.DialysisSolution, error) {
2337
+	var record models.DialysisSolution
2338
+	err = readDb.Model(&models.DialysisSolution{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ? and solution_status =1", patientID, orgID, mode_id).Last(&record).Error
2339
+
2340
+	return record, nil
2341
+}
2342
+
2335
 // 透析方案
2343
 // 透析方案
2336
 func MobileGetDialysisSolutionByModeId(orgID int64, patientID int64, mode_id int64) (*models.DialysisSolution, error) {
2344
 func MobileGetDialysisSolutionByModeId(orgID int64, patientID int64, mode_id int64) (*models.DialysisSolution, error) {
2337
 	var record models.DialysisSolution
2345
 	var record models.DialysisSolution

+ 9 - 2
service/pharmacy_service.go 查看文件

1053
 			//扣减库存
1053
 			//扣减库存
1054
 			UpdateDrugStockCount(v.DrugId, v.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1054
 			UpdateDrugStockCount(v.DrugId, v.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1055
 
1055
 
1056
+			//退药
1057
+			UpdateHisPrescriptionInfo(v.PatientId, v.AdviceDate, v.UserOrgId)
1058
+
1056
 		}
1059
 		}
1057
 	}
1060
 	}
1058
 
1061
 
1108
 			//扣减库存
1111
 			//扣减库存
1109
 			UpdateDrugStockCount(v.DrugId, v.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1112
 			UpdateDrugStockCount(v.DrugId, v.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1110
 
1113
 
1111
-			//退药
1112
-			UpdateHisPrescriptionInfo(v.PatientId, v.AdviceDate, v.UserOrgId)
1113
 		}
1114
 		}
1114
 	}
1115
 	}
1115
 
1116
 
2277
 	err = XTWriteDB().Model(&models.HisPrintPrescription{}).Where("patient_id = ? and record_date = ? and user_org_id = ? and status=1", patient_id, advice_date, user_org_id).Updates(map[string]interface{}{"is_medicine": 0}).Error
2278
 	err = XTWriteDB().Model(&models.HisPrintPrescription{}).Where("patient_id = ? and record_date = ? and user_org_id = ? and status=1", patient_id, advice_date, user_org_id).Updates(map[string]interface{}{"is_medicine": 0}).Error
2278
 	return err
2279
 	return err
2279
 }
2280
 }
2281
+
2282
+func GetHisPatientAdviceList(user_org_id int64, patient_id int64, start_time int64, end_time int64) (list []*models.HisDoctorAdvice, err error) {
2283
+
2284
+	err = XTReadDB().Model(&models.HisDoctorAdvice{}).Where("patient_id=? and advice_date=? and advice_date>=? and advice_date<=? and status=1 and user_org_id = ? and is_medicine =1", patient_id, start_time, end_time, user_org_id).Find(&list).Error
2285
+	return list, err
2286
+}