|
@@ -11,7 +11,7 @@ import (
|
11
|
11
|
"github.com/jinzhu/gorm"
|
12
|
12
|
)
|
13
|
13
|
|
14
|
|
-//GetPatientList 返回患者的列表
|
|
14
|
+// GetPatientList 返回患者的列表
|
15
|
15
|
func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bindingState, lapseto, source, startTime, endTime, contagion, reimbursementWay, isscheduling, isprescription int64, isStartTime, isEndTime bool) (patients []*models.Patients, total int64, err error) {
|
16
|
16
|
|
17
|
17
|
db := readDb.Table("xt_patients as p").Where("p.status=1")
|
|
@@ -79,7 +79,7 @@ func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bind
|
79
|
79
|
|
80
|
80
|
}
|
81
|
81
|
|
82
|
|
-//GetAllPatientList 返回全部患者的列表
|
|
82
|
+// GetAllPatientList 返回全部患者的列表
|
83
|
83
|
func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, err error) {
|
84
|
84
|
|
85
|
85
|
db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1", orgID)
|
|
@@ -103,7 +103,7 @@ func GetAllPatientListSix(orgID int64) (patients []*models.MSchedualPatientList,
|
103
|
103
|
return patients, err
|
104
|
104
|
}
|
105
|
105
|
|
106
|
|
-//GetAllPatientList 返回全部患者的列表
|
|
106
|
+// GetAllPatientList 返回全部患者的列表
|
107
|
107
|
func GetAllPatientListByList(orgID int64) (patients []*models.MSchedualPatientList, err error) {
|
108
|
108
|
redis := RedisClient()
|
109
|
109
|
defer redis.Close()
|
|
@@ -557,10 +557,10 @@ func FindPatientByIdTwo(orgID int64, id int64) (patient models.XtPatientsNew, er
|
557
|
557
|
return
|
558
|
558
|
}
|
559
|
559
|
|
560
|
|
-//func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
|
|
560
|
+// func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
|
561
|
561
|
// 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
|
562
|
562
|
// return
|
563
|
|
-//}
|
|
563
|
+// }
|
564
|
564
|
func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
|
565
|
565
|
redis := RedisClient()
|
566
|
566
|
defer redis.Close()
|
|
@@ -919,7 +919,7 @@ func UpdatePatientDialysisSolution(solution *models.DialysisSolution) (err error
|
919
|
919
|
return
|
920
|
920
|
}
|
921
|
921
|
|
922
|
|
-//GetPatientDialysisSolutionList 返回患者透析方案的列表
|
|
922
|
+// GetPatientDialysisSolutionList 返回患者透析方案的列表
|
923
|
923
|
func GetPatientDialysisSolutionList(orgID int64, patientID int64, page, limit int64) (solutions []*models.DialysisSolution, total int64, err error) {
|
924
|
924
|
|
925
|
925
|
offset := (page - 1) * limit
|
|
@@ -964,7 +964,7 @@ func GetPatientDialysisSolutionList(orgID int64, patientID int64, page, limit in
|
964
|
964
|
return
|
965
|
965
|
}
|
966
|
966
|
|
967
|
|
-//GetPatientDryWeightAdjustList 返回患者调整干体重的列表
|
|
967
|
+// GetPatientDryWeightAdjustList 返回患者调整干体重的列表
|
968
|
968
|
func GetPatientDryWeightAdjustList(orgID int64, patientID int64, page int64, limit int64) (weights []*models.DryWeightAdjust, total int64, err error) {
|
969
|
969
|
db := readDb.Table("xt_dry_weight_adjust as dwa").Where("dwa.status=1")
|
970
|
970
|
if orgID > 0 {
|
|
@@ -2363,6 +2363,7 @@ func GetAllPrescriptionByList(orgID int64, scheduleDate int64) (prescriptions []
|
2363
|
2363
|
redis := RedisClient()
|
2364
|
2364
|
defer redis.Close()
|
2365
|
2365
|
key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":prescriptions_list_all"
|
|
2366
|
+ redis.Set(key, "", time.Second)
|
2366
|
2367
|
prescriptions_list_all, _ := redis.Get(key).Result()
|
2367
|
2368
|
|
2368
|
2369
|
if len(prescriptions_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|
|
@@ -2461,6 +2462,7 @@ func GetAllAssessmentAfterDislysisByListOne(orgID int64, scheduleDate int64) (as
|
2461
|
2462
|
redis := RedisClient()
|
2462
|
2463
|
defer redis.Close()
|
2463
|
2464
|
key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":assessment_after_dislysis_list_all"
|
|
2465
|
+ redis.Set(key, "", time.Second)
|
2464
|
2466
|
assessment_after_dislysis__all, _ := redis.Get(key).Result()
|
2465
|
2467
|
|
2466
|
2468
|
if len(assessment_after_dislysis__all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|