XMLWAN 3 years ago
parent
commit
fbaaeb575f

+ 2 - 2
conf/app.conf View File

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2
-httpport = 9529
3
-runmode = prod
2
+httpport = 9531
3
+runmode = dev
4 4
 
5 5
 #
6 6
 copyrequestbody = true

+ 3 - 2
controllers/dialysis_api_controller.go View File

@@ -1348,7 +1348,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1348 1348
 	remark := c.GetString("remark")
1349 1349
 	puncture_method := c.GetString("puncture_method")
1350 1350
 
1351
-	dialysis_count, _ := c.GetInt64("dialysis_count", 0)
1351
+	dialysis_count := c.GetString("dialysis_count")
1352 1352
 	emergency_treatment, _ := c.GetInt64("emergency_treatment", 0)
1353 1353
 	emergency_treatment_other := c.GetString("emergency_treatment_other")
1354 1354
 	ductus_arantii := c.GetString("ductus_arantii")
@@ -1372,7 +1372,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1372 1372
 	ductus_arantii_other := c.GetString("ductus_arantii_other")
1373 1373
 	machine_type := c.GetString("machine_type")
1374 1374
 	puncture_needle := c.GetString("puncture_needle")
1375
-	humor_excessive_symptom, _ := c.GetInt64("humor_excessive_symptom", 0)
1375
+	humor_excessive_symptom := c.GetString("humor_excessive_symptom")
1376 1376
 	phinholing := c.GetString("pinholing")
1377 1377
 
1378 1378
 	catheter_suture := c.GetString("catheter_suture")
@@ -3121,6 +3121,7 @@ func (c *DialysisApiController) CreateRemindDoctorAdvice() {
3121 3121
 func (c *DialysisApiController) GetSolution() {
3122 3122
 	patient_id, _ := c.GetInt64("patient_id")
3123 3123
 	mode_id, _ := c.GetInt64("mode_id")
3124
+
3124 3125
 	adminUserInfo := c.GetAdminUserInfo()
3125 3126
 
3126 3127
 	solution, err := service.MobileGetDialysisSolutionByModeId(adminUserInfo.CurrentOrgId, patient_id, mode_id)

+ 39 - 27
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -88,6 +88,7 @@ func (this *DialysisAPIController) Scheduals() {
88 88
 
89 89
 	// cur_date := time.Now().Format("2006-01-02")
90 90
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
91
+	fmt.Println("keyhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", key)
91 92
 	scheduals_json_str, _ := redis.Get(key).Result()
92 93
 
93 94
 	if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -100,23 +101,23 @@ func (this *DialysisAPIController) Scheduals() {
100 101
 				patients, _ := service.GetAllPatientListByList(orgID)
101 102
 				devices, _ := service.GetAllDevicetByList(orgID)
102 103
 				advices, _ := service.GetAllAdvicestByList(orgID, date.Unix())
103
-				prescriptions,_ := service.GetAllPrescriptionsByList(orgID, date.Unix())
104
-				assessmentBefores,_ := service.GetAllAssessmentBeforesByList(orgID, date.Unix())
105
-				dialysisOrders,_ := service.GetAllDialysisOrdersByList(orgID, date.Unix())
106
-				treatmentSummarys,_ := service.GetAllTreatmentSummarysByList(orgID, date.Unix())
107
-				AssessmentAfterDislysis,_ := service.GetAllAssessmentAfterDislysisByList(orgID, date.Unix())
108
-				hisAdvices,_ := service.GetAllHisAdvicesByList(orgID, date.Unix())
109
-
110
-				for key,item := range scheduals {
104
+				prescriptions, _ := service.GetAllPrescriptionsByList(orgID, date.Unix())
105
+				assessmentBefores, _ := service.GetAllAssessmentBeforesByList(orgID, date.Unix())
106
+				dialysisOrders, _ := service.GetAllDialysisOrdersByList(orgID, date.Unix())
107
+				treatmentSummarys, _ := service.GetAllTreatmentSummarysByList(orgID, date.Unix())
108
+				AssessmentAfterDislysis, _ := service.GetAllAssessmentAfterDislysisByList(orgID, date.Unix())
109
+				hisAdvices, _ := service.GetAllHisAdvicesByList(orgID, date.Unix())
110
+
111
+				for key, item := range scheduals {
111 112
 					// 获取患者信息
112
-					for _,patient := range patients {
113
+					for _, patient := range patients {
113 114
 						if item.PatientId == patient.ID {
114 115
 							scheduals[key].SchedualPatient = patient
115 116
 							break
116 117
 						}
117 118
 					}
118 119
 					// 床位信息
119
-					for _,device := range devices {
120
+					for _, device := range devices {
120 121
 						if item.BedId == device.ID {
121 122
 							scheduals[key].DeviceNumber = device
122 123
 							break
@@ -125,55 +126,55 @@ func (this *DialysisAPIController) Scheduals() {
125 126
 
126 127
 					// 医嘱信息
127 128
 					scheduals[key].Advices = make([]models.VMDoctorAdviceForList, 0)
128
-					for _,advice := range advices {
129
-						if item.PatientId == advice.PatientId{
130
-							scheduals[key].Advices = append(scheduals[key].Advices,advice)
129
+					for _, advice := range advices {
130
+						if item.PatientId == advice.PatientId {
131
+							scheduals[key].Advices = append(scheduals[key].Advices, advice)
131 132
 						}
132 133
 					}
133 134
 
134 135
 					// 医嘱信息
135 136
 					scheduals[key].HisAdvices = make([]service.VMHisDoctorAdviceInfo, 0)
136
-					for _,hisAdvice := range hisAdvices {
137
-						if item.PatientId == hisAdvice.PatientId{
138
-							scheduals[key].HisAdvices = append(scheduals[key].HisAdvices,hisAdvice)
137
+					for _, hisAdvice := range hisAdvices {
138
+						if item.PatientId == hisAdvice.PatientId {
139
+							scheduals[key].HisAdvices = append(scheduals[key].HisAdvices, hisAdvice)
139 140
 						}
140 141
 					}
141 142
 
142 143
 					// 医嘱信息
143
-					for _,prescription := range prescriptions {
144
-						if item.PatientId == prescription.PatientId{
144
+					for _, prescription := range prescriptions {
145
+						if item.PatientId == prescription.PatientId {
145 146
 							scheduals[key].Prescription = prescription
146 147
 							break
147 148
 						}
148 149
 					}
149 150
 
150 151
 					// 透前评估
151
-					for _,assessmentBefore := range assessmentBefores {
152
-						if item.PatientId == assessmentBefore.PatientId{
152
+					for _, assessmentBefore := range assessmentBefores {
153
+						if item.PatientId == assessmentBefore.PatientId {
153 154
 							scheduals[key].AssessmentBeforeDislysis = assessmentBefore
154 155
 							break
155 156
 						}
156 157
 					}
157 158
 
158 159
 					// 透析上下机
159
-					for _,dialysisOrder := range dialysisOrders {
160
-						if item.PatientId == dialysisOrder.PatientId{
160
+					for _, dialysisOrder := range dialysisOrders {
161
+						if item.PatientId == dialysisOrder.PatientId {
161 162
 							scheduals[key].DialysisOrder = dialysisOrder
162 163
 							break
163 164
 						}
164 165
 					}
165 166
 
166 167
 					// 治疗小节
167
-					for _,afterDislysis := range AssessmentAfterDislysis {
168
-						if item.PatientId == afterDislysis.PatientId{
168
+					for _, afterDislysis := range AssessmentAfterDislysis {
169
+						if item.PatientId == afterDislysis.PatientId {
169 170
 							scheduals[key].AssessmentAfterDislysis = afterDislysis
170 171
 							break
171 172
 						}
172 173
 					}
173 174
 
174 175
 					// 透后评估
175
-					for _,treatmentSummary := range treatmentSummarys {
176
-						if item.PatientId == treatmentSummary.PatientId{
176
+					for _, treatmentSummary := range treatmentSummarys {
177
+						if item.PatientId == treatmentSummary.PatientId {
177 178
 							scheduals[key].TreatmentSummary = treatmentSummary
178 179
 							break
179 180
 						}
@@ -450,7 +451,7 @@ func (this *DialysisAPIController) DialysisRecord() {
450 451
 	// //}
451 452
 
452 453
 	// // 先走redis,没有走数据库
453
-	lastDialysisPrescribe, _ := service.MobileGetLastDialysisPrescribeByModeId(adminInfo.Org.Id, patientID,date.Unix(), schedual.ModeId)
454
+	lastDialysisPrescribe, _ := service.MobileGetLastDialysisPrescribeByModeId(adminInfo.Org.Id, patientID, schedual.ModeId)
454 455
 	// //fmt.Println("上次透析处方",lastDialysisPrescribe.DialyzerPerfusionApparatus)
455 456
 	// //if getDialysisPrescribeErr != nil {
456 457
 	// //	this.ErrorLog("获取透析处方失败:%v", getDialysisPrescribeErr)
@@ -1415,6 +1416,17 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1415 1416
 		prescription.Creater = adminUserInfo.AdminUser.Id
1416 1417
 		err := service.AddSigleRecord(&prescription)
1417 1418
 
1419
+		//获取key,清空redis
1420
+		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
1421
+		fmt.Println("key23323233232", key)
1422
+		redis := service.RedisClient()
1423
+		defer redis.Close()
1424
+		resultOne, err := redis.Get(key).Result()
1425
+		fmt.Println("清空前23232323223223", resultOne)
1426
+		//清空key 值
1427
+		redis.Set(key, "", time.Second)
1428
+		resultTwo, err := redis.Get(key).Result()
1429
+		fmt.Println("清空后3344444444444", resultTwo)
1418 1430
 		if err == nil {
1419 1431
 			updateErr := service.UpdateScheduleModeId(patient.ID, adminUserInfo.Org.Id, recordDate.Unix(), mode_id)
1420 1432
 			if updateErr != nil {

+ 4 - 3
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2045,8 +2045,8 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2045 2045
 
2046 2046
 	if dataBody["dialysis_count"] != nil && reflect.TypeOf(dataBody["dialysis_count"]).String() == "string" {
2047 2047
 		dialysis_count, _ := dataBody["dialysis_count"].(string)
2048
-		count, _ := strconv.ParseInt(dialysis_count, 10, 64)
2049
-		evaluation.DialysisCount = count
2048
+		//count, _ := strconv.ParseInt(dialysis_count, 10, 64)
2049
+		evaluation.DialysisCount = dialysis_count
2050 2050
 	}
2051 2051
 
2052 2052
 	if dataBody["is_infect"] != nil && reflect.TypeOf(dataBody["is_infect"]).String() == "string" {
@@ -2087,7 +2087,8 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2087 2087
 	}
2088 2088
 
2089 2089
 	if dataBody["humor_excessive_symptom"] != nil && reflect.TypeOf(dataBody["humor_excessive_symptom"]).String() == "float64" {
2090
-		humor_excessive_symptom := int64(dataBody["humor_excessive_symptom"].(float64))
2090
+
2091
+		humor_excessive_symptom, _ := dataBody["humor_excessive_symptom"].(string)
2091 2092
 		evaluation.HumorExcessiveSymptom = humor_excessive_symptom
2092 2093
 	}
2093 2094
 

+ 2 - 2
models/dialysis.go View File

@@ -287,7 +287,7 @@ type PredialysisEvaluation struct {
287 287
 	DuctusArantii                  string  `gorm:"column:ductus_arantii" json:"ductus_arantii"`
288 288
 	EmergencyTreatment             int64   `gorm:"column:emergency_treatment" json:"emergency_treatment"`
289 289
 	EmergencyTreatmentOther        string  `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other"`
290
-	DialysisCount                  int64   `gorm:"column:dialysis_count" json:"dialysis_count"`
290
+	DialysisCount                  string  `gorm:"column:dialysis_count" json:"dialysis_count"`
291 291
 	AssessmentDoctor               int64   `gorm:"column:assessment_doctor" json:"assessment_doctor"`
292 292
 	AssessmentTime                 int64   `gorm:"column:assessment_time" json:"assessment_time"`
293 293
 	MachineType                    string  `gorm:"column:machine_type" json:"machine_type"`
@@ -301,7 +301,7 @@ type PredialysisEvaluation struct {
301 301
 	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other"`
302 302
 	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other"`
303 303
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other"`
304
-	HumorExcessiveSymptom          int64   `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom"`
304
+	HumorExcessiveSymptom          string  `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom"`
305 305
 	Phinholing                     string  `gorm:"column:pinholing" json:"pinholing" form:"pinholing"`
306 306
 	CatheterSuture                 string  `gorm:"column:catheter_suture" json:"catheter_suture" form:"catheter_suture"`
307 307
 	CatheterSutureOther            string  `gorm:"column:catheter_suture_other" json:"catheter_suture_other" form:"catheter_suture_other"`

+ 6 - 6
models/patient_models.go View File

@@ -36,12 +36,12 @@ type MDialysisOrderForList struct {
36 36
 	// PrescriptionId int64  `gorm:"column:prescription_id" json:"prescription_id"`
37 37
 	Stage int64 `gorm:"column:stage" json:"stage"`
38 38
 	// Remark         string `gorm:"column:remark" json:"remark"`
39
-	BedID         int64            `gorm:"column:bed_id" json:"bed_id"`
40
-	StartNurse    int64            `gorm:"column:start_nurse" json:"start_nurse"`
41
-	Status        int64            `gorm:"column:status" json:"status"`
39
+	BedID         int64                 `gorm:"column:bed_id" json:"bed_id"`
40
+	StartNurse    int64                 `gorm:"column:start_nurse" json:"start_nurse"`
41
+	Status        int64                 `gorm:"column:status" json:"status"`
42 42
 	DeviceNumber  *MDeviceNumberForList `gorm:"ForeignKey:BedID" json:"device_number"`
43
-	Creator       int64            `gorm:"column:creator" json:"creator"`
44
-	WashpipeNurse int64            `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
43
+	Creator       int64                 `gorm:"column:creator" json:"creator"`
44
+	WashpipeNurse int64                 `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
45 45
 }
46 46
 
47 47
 func (MDialysisOrderForList) TableName() string {
@@ -1331,7 +1331,7 @@ type XtAssessmentBeforeDislysis struct {
1331 1331
 	DuctusArantiiOther             string  `gorm:"column:ductus_arantii_other" json:"ductus_arantii_other" form:"ductus_arantii_other"`
1332 1332
 	PunctureNeedle                 string  `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
1333 1333
 	DialysisIntakesUnit            int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit" form:"dialysis_intakes_unit"`
1334
-	HumorExcessiveSymptom          int64   `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom" form:"humor_excessive_symptom"`
1334
+	HumorExcessiveSymptom          string  `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom" form:"humor_excessive_symptom"`
1335 1335
 	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other" form:"last_post_dialysis_other"`
1336 1336
 	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other" form:"symptom_before_dialysis_other"`
1337 1337
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other" form:"dialysis_interphase_other"`

+ 1 - 1
models/service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go View File

@@ -252,7 +252,7 @@ type AssessmentBeforeDislysisVM struct {
252 252
 	DuctusArantii                  string  `gorm:"column:ductus_arantii" json:"ductus_arantii"`
253 253
 	EmergencyTreatment             int64   `gorm:"column:emergency_treatment" json:"emergency_treatment"`
254 254
 	EmergencyTreatmentOther        string  `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other"`
255
-	DialysisCount                  int64   `gorm:"column:dialysis_count" json:"dialysis_count"`
255
+	DialysisCount                  string  `gorm:"column:dialysis_count" json:"dialysis_count"`
256 256
 	AssessmentDoctor               int64   `gorm:"column:assessment_doctor" json:"assessment_doctor"`
257 257
 	AssessmentTime                 int64   `gorm:"column:assessment_time" json:"assessment_time"`
258 258
 	MachineType                    string  `gorm:"column:machine_type" json:"machine_type"`

+ 76 - 62
service/mobile_dialysis_service.go View File

@@ -2,11 +2,11 @@ package service
2 2
 
3 3
 import (
4 4
 	"XT_New/models"
5
+	"encoding/json"
5 6
 	"fmt"
6 7
 	"github.com/jinzhu/gorm"
7
-	"time"
8
-	"encoding/json"
9 8
 	"strconv"
9
+	"time"
10 10
 )
11 11
 
12 12
 // func GetSchedualPatients(orgID int64) ([]*MDialysisScheduleVM, error) {
@@ -146,8 +146,8 @@ type MDialysisScheduleVMForList struct {
146 146
 	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
147 147
 	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
148 148
 	AssessmentAfterDislysis  *models.VMAssessmentAfterDislysis `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_after_dislysis"`
149
-	HisAdvices               []VMHisDoctorAdviceInfo          `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"his_doctor_advice"`
150
-	Advices                  []models.VMDoctorAdviceForList   `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"doctor_advice"`
149
+	HisAdvices               []VMHisDoctorAdviceInfo           `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"his_doctor_advice"`
150
+	Advices                  []models.VMDoctorAdviceForList    `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"doctor_advice"`
151 151
 	TreatmentSummary         *models.VMTreatmentSummaryForList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"treatment_summary"`
152 152
 }
153 153
 
@@ -388,18 +388,18 @@ func MobileGetSchedualDetail(orgID int64, patientID int64, schedualDate int64) (
388 388
 	var vm MDialysisScheduleVM
389 389
 
390 390
 	// cur_date := time.Now().Format("2006-01-02")
391
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(schedualDate, 10) + ":schedual_detail"
391
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(schedualDate, 10) + ":schedual_detail"
392 392
 	schedual_detail_str, _ := redis.Get(key).Result()
393 393
 
394 394
 	if len(schedual_detail_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
395 395
 		err := readDb.
396
-		Table("xt_schedule").
397
-		// Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
398
-		Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
399
-		Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
400
-		Where("status = 1 AND user_org_id = ? AND schedule_date = ? AND patient_id = ?", orgID, schedualDate, patientID).
401
-		First(&vm).Error
402
-		
396
+			Table("xt_schedule").
397
+			// Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
398
+			Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
399
+			Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
400
+			Where("status = 1 AND user_org_id = ? AND schedule_date = ? AND patient_id = ?", orgID, schedualDate, patientID).
401
+			First(&vm).Error
402
+
403 403
 		if err != nil {
404 404
 			if err == gorm.ErrRecordNotFound {
405 405
 				return nil, nil
@@ -526,7 +526,7 @@ func MobileGetReceiverTreatmentAccessRecord(orgID int64, patientID int64, record
526 526
 	defer redis.Close()
527 527
 
528 528
 	// cur_date := time.Now().Format("2006-01-02")
529
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":receive_treatment_asses"
529
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":receive_treatment_asses"
530 530
 	receive_treatment_asses_str, _ := redis.Get(key).Result()
531 531
 
532 532
 	if len(receive_treatment_asses_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -563,7 +563,7 @@ func MobileGetPredialysisEvaluation(orgID int64, patientID int64, recordDate int
563 563
 	defer redis.Close()
564 564
 
565 565
 	// cur_date := time.Now().Format("2006-01-02")
566
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":assessment_before_dislysis"
566
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":assessment_before_dislysis"
567 567
 	assessment_before_dislysis_str, _ := redis.Get(key).Result()
568 568
 
569 569
 	if len(assessment_before_dislysis_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -599,7 +599,7 @@ func MobileGetLastTimePredialysisEvaluation(orgID int64, patientID int64, maxDat
599 599
 	defer redis.Close()
600 600
 
601 601
 	// cur_date := time.Now().Format("2006-01-02")
602
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(maxDate, 10) + ":assessment_before_dislysis_last"
602
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(maxDate, 10) + ":assessment_before_dislysis_last"
603 603
 	assessment_before_dislysis_last_str, _ := redis.Get(key).Result()
604 604
 
605 605
 	if len(assessment_before_dislysis_last_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -652,16 +652,16 @@ func MobileGetDoctorAdvicesByGroups(orgID int64, patientID int64, recordDate int
652 652
 	defer redis.Close()
653 653
 
654 654
 	// cur_date := time.Now().Format("2006-01-02")
655
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":doctor_advices"
655
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":doctor_advices"
656 656
 	doctor_advices_str, _ := redis.Get(key).Result()
657 657
 
658 658
 	if len(doctor_advices_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
659 659
 		err := readDb.
660
-		Model(&models.DoctorAdvice{}).
661
-		Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ? and (advice_type = 2 || advice_type = 3)", patientID, orgID, recordDate).
662
-		Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno,way,drug_id,drug_name_id, IF(parent_id > 0, parent_id, id) as advice_order").
663
-		Order("start_time asc, groupno desc, advice_order desc, id asc").
664
-		Scan(&records).Error
660
+			Model(&models.DoctorAdvice{}).
661
+			Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ? and (advice_type = 2 || advice_type = 3)", patientID, orgID, recordDate).
662
+			Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno,way,drug_id,drug_name_id, IF(parent_id > 0, parent_id, id) as advice_order").
663
+			Order("start_time asc, groupno desc, advice_order desc, id asc").
664
+			Scan(&records).Error
665 665
 		if err != nil {
666 666
 			if err == gorm.ErrRecordNotFound {
667 667
 				return nil, nil
@@ -693,7 +693,7 @@ func MobileGetSchedualDialysisRecord(orgID int64, patientID int64, recordDate in
693 693
 	defer redis.Close()
694 694
 
695 695
 	// cur_date := time.Now().Format("2006-01-02")
696
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":dialysis_order"
696
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":dialysis_order"
697 697
 	dialysis_order_str, _ := redis.Get(key).Result()
698 698
 
699 699
 	if len(dialysis_order_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -729,7 +729,7 @@ func MobileGetDoubleCheck(orgID int64, patientID int64, recordDate int64) (*mode
729 729
 	defer redis.Close()
730 730
 
731 731
 	// cur_date := time.Now().Format("2006-01-02")
732
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":double_check"
732
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":double_check"
733 733
 	double_check_str, _ := redis.Get(key).Result()
734 734
 
735 735
 	if len(double_check_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -765,7 +765,7 @@ func MobileGetMonitorRecords(orgID int64, patientID int64, recordDate int64) ([]
765 765
 	defer redis.Close()
766 766
 
767 767
 	// cur_date := time.Now().Format("2006-01-02")
768
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":monitor_records"
768
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":monitor_records"
769 769
 	monitor_records_str, _ := redis.Get(key).Result()
770 770
 
771 771
 	if len(monitor_records_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -809,7 +809,7 @@ func MobileGetLastMonitorRecord(orgID int64, patientID int64, beforeDate int64)
809 809
 	defer redis.Close()
810 810
 
811 811
 	// cur_date := time.Now().Format("2006-01-02")
812
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(beforeDate, 10) + ":monitor_record_last"
812
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(beforeDate, 10) + ":monitor_record_last"
813 813
 	monitor_record_last_str, _ := redis.Get(key).Result()
814 814
 
815 815
 	if len(monitor_record_last_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -845,7 +845,7 @@ func MobileGetAssessmentAfterDislysis(orgID int64, patientID int64, recordDate i
845 845
 	defer redis.Close()
846 846
 
847 847
 	// cur_date := time.Now().Format("2006-01-02")
848
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":assessment_after_dislysis"
848
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":assessment_after_dislysis"
849 849
 	assessment_after_dislysis_str, _ := redis.Get(key).Result()
850 850
 
851 851
 	if len(assessment_after_dislysis_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -881,7 +881,7 @@ func MobileGetLastTimeAssessmentAfterDislysis(orgID int64, patientID int64, maxD
881 881
 	defer redis.Close()
882 882
 
883 883
 	// cur_date := time.Now().Format("2006-01-02")
884
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(maxDate, 10) + ":assessment_after_dislysis_last"
884
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(maxDate, 10) + ":assessment_after_dislysis_last"
885 885
 	assessment_after_dislysis_last_str, _ := redis.Get(key).Result()
886 886
 
887 887
 	if len(assessment_after_dislysis_last_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -922,7 +922,7 @@ func MobileGetTreatmentSummary(orgID int64, patientID int64, recordDate int64) (
922 922
 	defer redis.Close()
923 923
 
924 924
 	// cur_date := time.Now().Format("2006-01-02")
925
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":treatment_summary"
925
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":treatment_summary"
926 926
 	treatment_summary_str, _ := redis.Get(key).Result()
927 927
 
928 928
 	if len(treatment_summary_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -1766,7 +1766,7 @@ func MobileGetLastDryWeight(orgID int64, patientID int64) (*models.SgjPatientDry
1766 1766
 	defer redis.Close()
1767 1767
 
1768 1768
 	// cur_date := time.Now().Format("2006-01-02")
1769
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":last_dry_weight"
1769
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":last_dry_weight"
1770 1770
 	last_dry_weight_str, _ := redis.Get(key).Result()
1771 1771
 
1772 1772
 	if len(last_dry_weight_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -1802,7 +1802,7 @@ func MobileGetDialysisSolutionByModeId(orgID int64, patientID int64, mode_id int
1802 1802
 	defer redis.Close()
1803 1803
 
1804 1804
 	// cur_date := time.Now().Format("2006-01-02")
1805
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) +  ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
1805
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
1806 1806
 	dialysis_solution_str, _ := redis.Get(key).Result()
1807 1807
 
1808 1808
 	if len(dialysis_solution_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -1838,7 +1838,8 @@ func MobileGetDialysisPrescribeByModeId(orgID int64, patientID int64, recordDate
1838 1838
 	defer redis.Close()
1839 1839
 
1840 1840
 	// cur_date := time.Now().Format("2006-01-02")
1841
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
1841
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
1842
+	fmt.Println("透析处方中的keyzhi", key)
1842 1843
 	dialysis_prescribe_str, _ := redis.Get(key).Result()
1843 1844
 
1844 1845
 	if len(dialysis_prescribe_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -1873,7 +1874,7 @@ func MobileGetDialysisPrescribeByModeIdOne(orgID int64, patientID int64, recordD
1873 1874
 	defer redis.Close()
1874 1875
 
1875 1876
 	// cur_date := time.Now().Format("2006-01-02")
1876
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":dialysis_prescribe_by_mode"
1877
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate, 10) + ":dialysis_prescribe_by_mode"
1877 1878
 	dialysis_prescribe_by_mode_str, _ := redis.Get(key).Result()
1878 1879
 
1879 1880
 	if len(dialysis_prescribe_by_mode_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -1915,41 +1916,54 @@ func MobileGetLastDialysisPrescribe(orgID int64, patientID int64) (*models.Dialy
1915 1916
 	return &record, nil
1916 1917
 }
1917 1918
 
1918
-func MobileGetLastDialysisPrescribeByModeId(orgID int64, patientID int64, recordDate int64,mode_id int64) (*models.DialysisPrescription, error) {
1919
+func MobileGetLastDialysisPrescribeByModeId(orgID int64, patientID int64, mode_id int64) (*models.DialysisPrescription, error) {
1919 1920
 	var record models.DialysisPrescription
1920
-	redis := RedisClient()
1921
-	defer redis.Close()
1922
-
1923
-	// cur_date := time.Now().Format("2006-01-02")
1924
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) +  ":" + strconv.FormatInt(recordDate, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe_last"
1925
-	dialysis_prescribe_last_str, _ := redis.Get(key).Result()
1926
-
1927
-	if len(dialysis_prescribe_last_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
1928
-		err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1  AND mode_id = ?  AND record_date < ?", patientID, orgID, mode_id,recordDate).Last(&record).Error
1929
-		if err != nil {
1930
-			if err == gorm.ErrRecordNotFound {
1931
-				return nil, nil
1932
-			} else {
1933
-				return nil, err
1934
-			}
1921
+	err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1  AND mode_id = ?", patientID, orgID, mode_id).Last(&record).Error
1922
+	if err != nil {
1923
+		if err == gorm.ErrRecordNotFound {
1924
+			return nil, nil
1935 1925
 		} else {
1936
-			if record.ID > 0 {
1937
-				//缓存数据
1938
-				dialysis_prescribe_last_str, err := json.Marshal(record)
1939
-				if err == nil {
1940
-					redis.Set(key, dialysis_prescribe_last_str, time.Second*60*60*18)
1941
-				}
1942
-			} else {
1943
-				redis.Set(key, " ", time.Second*60*60*18)
1944
-			}
1945
-			return &record, nil
1926
+			return nil, err
1946 1927
 		}
1947
-	} else { //缓存数据了数据,将redis缓存的json字符串转为map
1948
-		json.Unmarshal([]byte(dialysis_prescribe_last_str), &record)
1949
-		return &record, nil
1950 1928
 	}
1929
+	return &record, nil
1951 1930
 }
1952 1931
 
1932
+//func MobileGetLastDialysisPrescribeByModeId(orgID int64, patientID int64, recordDate int64,mode_id int64) (*models.DialysisPrescription, error) {
1933
+//	var record models.DialysisPrescription
1934
+//	redis := RedisClient()
1935
+//	defer redis.Close()
1936
+//
1937
+//	// cur_date := time.Now().Format("2006-01-02")
1938
+//	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(patientID, 10) +  ":" + strconv.FormatInt(recordDate, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe_last"
1939
+//	dialysis_prescribe_last_str, _ := redis.Get(key).Result()
1940
+//
1941
+//	if len(dialysis_prescribe_last_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
1942
+//		err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1  AND mode_id = ?  AND record_date < ?", patientID, orgID, mode_id,recordDate).Last(&record).Error
1943
+//		if err != nil {
1944
+//			if err == gorm.ErrRecordNotFound {
1945
+//				return nil, nil
1946
+//			} else {
1947
+//				return nil, err
1948
+//			}
1949
+//		} else {
1950
+//			if record.ID > 0 {
1951
+//				//缓存数据
1952
+//				dialysis_prescribe_last_str, err := json.Marshal(record)
1953
+//				if err == nil {
1954
+//					redis.Set(key, dialysis_prescribe_last_str, time.Second*60*60*18)
1955
+//				}
1956
+//			} else {
1957
+//				redis.Set(key, " ", time.Second*60*60*18)
1958
+//			}
1959
+//			return &record, nil
1960
+//		}
1961
+//	} else { //缓存数据了数据,将redis缓存的json字符串转为map
1962
+//		json.Unmarshal([]byte(dialysis_prescribe_last_str), &record)
1963
+//		return &record, nil
1964
+//	}
1965
+//}
1966
+
1953 1967
 func GetAllAvaildDeviceNumbers(orgID int64, record_date int64, schedule_type int) ([]*DeviceNumberViewModel, error) {
1954 1968
 	var vms []*DeviceNumberViewModel = make([]*DeviceNumberViewModel, 0)
1955 1969
 	rows, err := readDb.Raw("SELECT n.*, z.name as zone_name, g.name as group_name FROM xt_device_number as n join xt_device_zone as z on z.id = n.zone_id join xt_device_group as g on g.id = n.group_id  WHERE (n.org_id = ? AND n.status = 1) AND NOT EXISTS (Select * FROM xt_schedule as s Where s.`schedule_date` = ?  AND  s.user_org_id = n.org_id AND s.`bed_id` = n.id  AND s.`schedule_type` = ? AND s.status = 1 )", orgID, record_date, schedule_type).Rows()
@@ -2453,7 +2467,7 @@ func GetAssessmentBefor(orgid int64, patientid int64, recorddate int64) (*models
2453 2467
 func GetAllHisDoctorAdvice(orgid int64, patientid int64, recorddate int64) (his []*models.HisDoctorAdviceInfo, err error) {
2454 2468
 	redis := RedisClient()
2455 2469
 	defer redis.Close()
2456
-	key := strconv.FormatInt(orgid, 10) + ":"+ strconv.FormatInt(patientid, 10) + ":"+ strconv.FormatInt(recorddate, 10) + ":his_doctor_advice" 
2470
+	key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patientid, 10) + ":" + strconv.FormatInt(recorddate, 10) + ":his_doctor_advice"
2457 2471
 	his_doctor_advice_str, _ := redis.Get(key).Result()
2458 2472
 
2459 2473
 	if len(his_doctor_advice_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis

+ 21 - 20
service/patient_service.go View File

@@ -2,11 +2,11 @@ package service
2 2
 
3 3
 import (
4 4
 	"XT_New/models"
5
+	"encoding/json"
6
+	"fmt"
5 7
 	"strconv"
6 8
 	"strings"
7 9
 	"time"
8
-	"encoding/json"
9
-	"fmt"
10 10
 
11 11
 	"github.com/jinzhu/gorm"
12 12
 )
@@ -84,7 +84,7 @@ func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, e
84 84
 func GetAllPatientListByList(orgID int64) (patients []*models.MSchedualPatientList, err error) {
85 85
 	redis := RedisClient()
86 86
 	defer redis.Close()
87
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":patient_list_all" 
87
+	key := strconv.FormatInt(orgID, 10) + ":" + ":patient_list_all"
88 88
 	patient_info_str, _ := redis.Get(key).Result()
89 89
 
90 90
 	if len(patient_info_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -114,7 +114,7 @@ func GetAllPatientListByList(orgID int64) (patients []*models.MSchedualPatientLi
114 114
 func GetAllDevicetByList(orgID int64) (devices []*models.MDeviceNumberForList, err error) {
115 115
 	redis := RedisClient()
116 116
 	defer redis.Close()
117
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":device_list_all" 
117
+	key := strconv.FormatInt(orgID, 10) + ":" + ":device_list_all"
118 118
 	device_list_str, _ := redis.Get(key).Result()
119 119
 
120 120
 	if len(device_list_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -141,10 +141,10 @@ func GetAllDevicetByList(orgID int64) (devices []*models.MDeviceNumberForList, e
141 141
 	}
142 142
 }
143 143
 
144
-func GetAllAdvicestByList(orgID int64,scheduleDate int64) (advices []models.VMDoctorAdviceForList, err error) {
144
+func GetAllAdvicestByList(orgID int64, scheduleDate int64) (advices []models.VMDoctorAdviceForList, err error) {
145 145
 	redis := RedisClient()
146 146
 	defer redis.Close()
147
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":advice_list_all" 
147
+	key := strconv.FormatInt(orgID, 10) + ":" + ":advice_list_all"
148 148
 	advice_list_str, _ := redis.Get(key).Result()
149 149
 
150 150
 	if len(advice_list_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -171,10 +171,10 @@ func GetAllAdvicestByList(orgID int64,scheduleDate int64) (advices []models.VMDo
171 171
 	}
172 172
 }
173 173
 
174
-func GetAllPrescriptionsByList(orgID int64,scheduleDate int64) (prescriptions []*models.DialysisPrescriptionList, err error) {
174
+func GetAllPrescriptionsByList(orgID int64, scheduleDate int64) (prescriptions []*models.DialysisPrescriptionList, err error) {
175 175
 	redis := RedisClient()
176 176
 	defer redis.Close()
177
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":prescriptions_list_all" 
177
+	key := strconv.FormatInt(orgID, 10) + ":" + ":prescriptions_list_all"
178 178
 	prescriptions_list_all, _ := redis.Get(key).Result()
179 179
 
180 180
 	if len(prescriptions_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -201,14 +201,14 @@ func GetAllPrescriptionsByList(orgID int64,scheduleDate int64) (prescriptions []
201 201
 	}
202 202
 }
203 203
 
204
-func GetAllAssessmentBeforesByList(orgID int64,scheduleDate int64) (assessmentBefores []*models.PredialysisEvaluationList, err error) {
204
+func GetAllAssessmentBeforesByList(orgID int64, scheduleDate int64) (assessmentBefores []*models.PredialysisEvaluationList, err error) {
205 205
 	redis := RedisClient()
206 206
 	defer redis.Close()
207
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":assessment_befores_list_all" 
207
+	key := strconv.FormatInt(orgID, 10) + ":" + ":assessment_befores_list_all"
208 208
 	assessment_befores_list_all, _ := redis.Get(key).Result()
209 209
 
210 210
 	if len(assessment_befores_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
211
-		err = readDb.Model(&models.PredialysisEvaluationList{}).Where( "status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).Find(&assessmentBefores).Error
211
+		err = readDb.Model(&models.PredialysisEvaluationList{}).Where("status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).Find(&assessmentBefores).Error
212 212
 		if err != nil {
213 213
 			if err == gorm.ErrRecordNotFound {
214 214
 				return nil, nil
@@ -231,10 +231,10 @@ func GetAllAssessmentBeforesByList(orgID int64,scheduleDate int64) (assessmentBe
231 231
 	}
232 232
 }
233 233
 
234
-func GetAllDialysisOrdersByList(orgID int64,scheduleDate int64) (dialysisOrders []*models.MDialysisOrderForList, err error) {
234
+func GetAllDialysisOrdersByList(orgID int64, scheduleDate int64) (dialysisOrders []*models.MDialysisOrderForList, err error) {
235 235
 	redis := RedisClient()
236 236
 	defer redis.Close()
237
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":dialysis_orders_list_all" 
237
+	key := strconv.FormatInt(orgID, 10) + ":" + ":dialysis_orders_list_all"
238 238
 	dialysis_orders_list_all, _ := redis.Get(key).Result()
239 239
 
240 240
 	if len(dialysis_orders_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -261,10 +261,10 @@ func GetAllDialysisOrdersByList(orgID int64,scheduleDate int64) (dialysisOrders
261 261
 	}
262 262
 }
263 263
 
264
-func GetAllTreatmentSummarysByList(orgID int64,scheduleDate int64) (treatmentSummarys []*models.VMTreatmentSummaryForList, err error) {
264
+func GetAllTreatmentSummarysByList(orgID int64, scheduleDate int64) (treatmentSummarys []*models.VMTreatmentSummaryForList, err error) {
265 265
 	redis := RedisClient()
266 266
 	defer redis.Close()
267
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":treatment_summarys_list_all" 
267
+	key := strconv.FormatInt(orgID, 10) + ":" + ":treatment_summarys_list_all"
268 268
 	treatment_summarys_all, _ := redis.Get(key).Result()
269 269
 
270 270
 	if len(treatment_summarys_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -291,10 +291,10 @@ func GetAllTreatmentSummarysByList(orgID int64,scheduleDate int64) (treatmentSum
291 291
 	}
292 292
 }
293 293
 
294
-func GetAllAssessmentAfterDislysisByList(orgID int64,scheduleDate int64) (assessmentAfterDislysis []*models.VMAssessmentAfterDislysis, err error) {
294
+func GetAllAssessmentAfterDislysisByList(orgID int64, scheduleDate int64) (assessmentAfterDislysis []*models.VMAssessmentAfterDislysis, err error) {
295 295
 	redis := RedisClient()
296 296
 	defer redis.Close()
297
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":assessment_after_dislysis_list_all" 
297
+	key := strconv.FormatInt(orgID, 10) + ":" + ":assessment_after_dislysis_list_all"
298 298
 	assessment_after_dislysis__all, _ := redis.Get(key).Result()
299 299
 
300 300
 	if len(assessment_after_dislysis__all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -321,10 +321,10 @@ func GetAllAssessmentAfterDislysisByList(orgID int64,scheduleDate int64) (assess
321 321
 	}
322 322
 }
323 323
 
324
-func GetAllHisAdvicesByList(orgID int64,scheduleDate int64) (hisAdvices []VMHisDoctorAdviceInfo, err error) {
324
+func GetAllHisAdvicesByList(orgID int64, scheduleDate int64) (hisAdvices []VMHisDoctorAdviceInfo, err error) {
325 325
 	redis := RedisClient()
326 326
 	defer redis.Close()
327
-	key := strconv.FormatInt(orgID, 10) + ":"+ ":his_advices_list_all" 
327
+	key := strconv.FormatInt(orgID, 10) + ":" + ":his_advices_list_all"
328 328
 	his_advices_all, _ := redis.Get(key).Result()
329 329
 
330 330
 	if len(his_advices_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -429,7 +429,8 @@ func FindPatientByIdTwo(orgID int64, id int64) (patient models.XtPatientsNew, er
429 429
 func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
430 430
 	redis := RedisClient()
431 431
 	defer redis.Close()
432
-	key := strconv.FormatInt(orgID, 10) + ":"+ strconv.FormatInt(id, 10) + ":patient_info" 
432
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(id, 10) + ":patient_info"
433
+	fmt.Println("keyw233223322332332233232323232323223233", key)
433 434
 	patient_info_str, _ := redis.Get(key).Result()
434 435
 
435 436
 	if len(patient_info_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis

+ 1 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go View File

@@ -267,7 +267,7 @@ type AssessmentBeforeDislysisVM struct {
267 267
 	DuctusArantii                  string  `gorm:"column:ductus_arantii" json:"ductus_arantii"`
268 268
 	EmergencyTreatment             int64   `gorm:"column:emergency_treatment" json:"emergency_treatment"`
269 269
 	EmergencyTreatmentOther        string  `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other"`
270
-	DialysisCount                  int64   `gorm:"column:dialysis_count" json:"dialysis_count"`
270
+	DialysisCount                  string  `gorm:"column:dialysis_count" json:"dialysis_count"`
271 271
 	AssessmentDoctor               int64   `gorm:"column:assessment_doctor" json:"assessment_doctor"`
272 272
 	AssessmentTime                 int64   `gorm:"column:assessment_time" json:"assessment_time"`
273 273
 	MachineType                    string  `gorm:"column:machine_type" json:"machine_type"`