Browse Source

Merge branch '20220812' of http://git.shengws.com/csx/XT_New into 20220812

test_user 2 years ago
parent
commit
ad3df79651

+ 20 - 8
controllers/dialysis_api_controller.go View File

@@ -448,6 +448,9 @@ func (c *DialysisApiController) PostPrescription() {
448 448
 
449 449
 	//长沙南雅医院,自动生成抗凝剂的临时处方
450 450
 	if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 10340 {
451
+		if prescribing_number == 0 {
452
+			prescribing_number = 1
453
+		}
451 454
 		advice := models.DoctorAdvice{
452 455
 			UserOrgId:             adminUserInfo.CurrentOrgId,
453 456
 			PatientId:             patient,
@@ -455,8 +458,8 @@ func (c *DialysisApiController) PostPrescription() {
455 458
 			AdviceType:            2,
456 459
 			RecordDate:            recordDate.Unix(),
457 460
 			AdviceDate:            recordDate.Unix(),
458
-			StartTime:             recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
459
-			AdviceName:            "",                          // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
461
+			StartTime:             recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
462
+			AdviceName:            "",                            // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
460 463
 			AdviceDesc:            "",
461 464
 			ReminderDate:          0,
462 465
 			SingleDose:            5000,
@@ -472,12 +475,15 @@ func (c *DialysisApiController) PostPrescription() {
472 475
 			CreatedTime:           time.Now().Unix(),
473 476
 			UpdatedTime:           time.Now().Unix(),
474 477
 			IsPrescription:        1,
478
+			ExecutionState:        2,
479
+			StopState:             2,
480
+			IsSettle:              2,
475 481
 		}
476 482
 		// 查询排班信息
477 483
 		schedulePatient, _ := service.GetScheduleByPatient(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
478 484
 		if schedulePatient.ID > 0 {
479 485
 			if schedulePatient.ScheduleType == 1 {
480
-				advice.StartTime = recordDate.Unix() + 7*60*60
486
+				advice.StartTime = recordDate.Unix() + 6.5*60*60
481 487
 			}
482 488
 
483 489
 			if schedulePatient.ScheduleType == 2 {
@@ -525,7 +531,7 @@ func (c *DialysisApiController) PostPrescription() {
525 531
 		}
526 532
 		//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
527 533
 
528
-		if appRole.UserType == 2 || appRole.UserType == 1 {
534
+		if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 {
529 535
 			advice.AdviceDoctor = appRole.AdminUserId
530 536
 		}
531 537
 
@@ -1162,6 +1168,9 @@ func (c *DialysisApiController) PostSoulution() {
1162 1168
 
1163 1169
 	//长沙南雅医院,自动生成抗凝剂的临时处方
1164 1170
 	if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 10340 {
1171
+		if prescribing_number == 0 {
1172
+			prescribing_number = 1
1173
+		}
1165 1174
 		advice := models.DoctorAdvice{
1166 1175
 			UserOrgId:             adminUserInfo.CurrentOrgId,
1167 1176
 			PatientId:             patient,
@@ -1169,8 +1178,8 @@ func (c *DialysisApiController) PostSoulution() {
1169 1178
 			AdviceType:            2,
1170 1179
 			RecordDate:            recordDate.Unix(),
1171 1180
 			AdviceDate:            recordDate.Unix(),
1172
-			StartTime:             recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
1173
-			AdviceName:            "",                          // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
1181
+			StartTime:             recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
1182
+			AdviceName:            "",                            // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
1174 1183
 			AdviceDesc:            "",
1175 1184
 			ReminderDate:          0,
1176 1185
 			SingleDose:            5000,
@@ -1186,12 +1195,15 @@ func (c *DialysisApiController) PostSoulution() {
1186 1195
 			CreatedTime:           time.Now().Unix(),
1187 1196
 			UpdatedTime:           time.Now().Unix(),
1188 1197
 			IsPrescription:        1,
1198
+			ExecutionState:        2,
1199
+			StopState:             2,
1200
+			IsSettle:              2,
1189 1201
 		}
1190 1202
 		// 查询排班信息
1191 1203
 		schedulePatient, _ := service.GetScheduleByPatient(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
1192 1204
 		if schedulePatient.ID > 0 {
1193 1205
 			if schedulePatient.ScheduleType == 1 {
1194
-				advice.StartTime = recordDate.Unix() + 7*60*60
1206
+				advice.StartTime = recordDate.Unix() + 6.5*60*60
1195 1207
 			}
1196 1208
 
1197 1209
 			if schedulePatient.ScheduleType == 2 {
@@ -1238,7 +1250,7 @@ func (c *DialysisApiController) PostSoulution() {
1238 1250
 			break
1239 1251
 		}
1240 1252
 		//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
1241
-		if appRole.UserType == 2 || appRole.UserType == 1 {
1253
+		if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 {
1242 1254
 			advice.AdviceDoctor = appRole.AdminUserId
1243 1255
 		}
1244 1256
 

+ 2 - 2
controllers/dialysis_record_api_controller.go View File

@@ -1385,7 +1385,7 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1385 1385
 		}
1386 1386
 
1387 1387
 		//针对蓬安
1388
-		if adminUserInfo.CurrentOrgId == 9829 {
1388
+		if adminUserInfo.CurrentOrgId == 9829 || adminUserInfo.CurrentOrgId == 10440 {
1389 1389
 			tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
1390 1390
 			tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
1391 1391
 		}
@@ -1472,7 +1472,7 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1472 1472
 
1473 1473
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
1474 1474
 
1475
-	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 9829 {
1475
+	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 9829 || adminUserInfo.CurrentOrgId == 10440 {
1476 1476
 
1477 1477
 		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1478 1478
 		if evaluation.SystolicBloodPressure == 0 {

+ 4 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -269,7 +269,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
269 269
 
270 270
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
271 271
 
272
-	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 || template.TemplateId == 32 || template.TemplateId == 36 || template.TemplateId == 40 || template.TemplateId == 38 || template.TemplateId == 43 || template.TemplateId == 46 || template.TemplateId == 53 || template.TemplateId == 48 || adminUserInfo.Org.Id == 10345 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10138 || adminUserInfo.Org.Id == 10278 || adminUserInfo.Org.Id == 9829 {
272
+	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 || template.TemplateId == 32 || template.TemplateId == 36 || template.TemplateId == 40 || template.TemplateId == 38 || template.TemplateId == 43 || template.TemplateId == 46 || template.TemplateId == 53 || template.TemplateId == 48 || adminUserInfo.Org.Id == 10345 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10138 || adminUserInfo.Org.Id == 10278 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10440 {
273 273
 		if adminUserInfo.Org.Id != 10447 {
274 274
 			dewater_amount = dewater_amount * 1000
275 275
 		}
@@ -684,6 +684,9 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
684 684
 				if adminUserInfo.Org.Id == 9829 {
685 685
 					evaluation.PulseFrequency = 80
686 686
 				}
687
+				if adminUserInfo.Org.Id == 10440 {
688
+					evaluation.Temperature = 36.5
689
+				}
687 690
 			}
688 691
 		} else {
689 692
 			evaluation.UpdatedTime = time.Now().Unix()

+ 63 - 12
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -841,6 +841,8 @@ func (c *DialysisAPIController) PostDoubleCheck() {
841 841
 
842 842
 		//针对长沙南雅
843 843
 		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
844
+			fmt.Println("-----------------------", adminUserInfo.Org.Id)
845
+			fmt.Println("modifier----------------", modifier)
844 846
 			//查询未核对的医嘱
845 847
 			doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
846 848
 			if len(doctorList) > 0 && modifier > 0 {
@@ -883,6 +885,29 @@ func (c *DialysisAPIController) PostDoubleCheck() {
883 885
 		doubleCheck.ID = check.ID
884 886
 		doubleCheck.EmployeeNumber = employee_number
885 887
 		err := service.UpdateDoubleCheck(&doubleCheck)
888
+		//针对长沙南雅
889
+		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
890
+			//查询未核对的医嘱
891
+			doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
892
+			if len(doctorList) > 0 && modifier > 0 {
893
+				for _, advice := range doctorList {
894
+					service.UpdateDoctorAdviceList(advice.ID, modifier)
895
+					key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
896
+					redis := service.RedisClient()
897
+					//清空key 值
898
+					redis.Set(key, "", time.Second)
899
+					keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":advice_list_all"
900
+					redis.Set(keyTwo, "", time.Second)
901
+					theTime := time.Now()
902
+					recordDate := theTime.Format("2006-01-02")
903
+					keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
904
+					redis.Set(keyFour, "", time.Second)
905
+					defer redis.Close()
906
+				}
907
+			}
908
+
909
+		}
910
+
886 911
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":double_check"
887 912
 		redis := service.RedisClient()
888 913
 		defer redis.Close()
@@ -1658,6 +1683,9 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1658 1683
 		//长沙南雅医院,自动生成抗凝剂的临时处方
1659 1684
 		if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
1660 1685
 
1686
+			if prescribing_number == 0 {
1687
+				prescribing_number = 1
1688
+			}
1661 1689
 			advice := models.DoctorAdvice{
1662 1690
 				UserOrgId:             adminUserInfo.Org.Id,
1663 1691
 				PatientId:             id,
@@ -1665,8 +1693,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1665 1693
 				AdviceType:            2,
1666 1694
 				RecordDate:            recordDate.Unix(),
1667 1695
 				AdviceDate:            recordDate.Unix(),
1668
-				StartTime:             recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
1669
-				AdviceName:            "",                          // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
1696
+				StartTime:             recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
1697
+				AdviceName:            "",                            // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
1670 1698
 				AdviceDesc:            "",
1671 1699
 				ReminderDate:          0,
1672 1700
 				SingleDose:            5000,
@@ -1682,12 +1710,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1682 1710
 				CreatedTime:           time.Now().Unix(),
1683 1711
 				UpdatedTime:           time.Now().Unix(),
1684 1712
 				IsPrescription:        1,
1713
+				ExecutionState:        2,
1714
+				StopState:             2,
1715
+				IsSettle:              2,
1685 1716
 			}
1686 1717
 			// 查询排班信息
1687 1718
 			schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
1688 1719
 			if schedulePatient.ID > 0 {
1689 1720
 				if schedulePatient.ScheduleType == 1 {
1690
-					advice.StartTime = recordDate.Unix() + 7*60*60
1721
+					advice.StartTime = recordDate.Unix() + 6.5*60*60
1691 1722
 				}
1692 1723
 
1693 1724
 				if schedulePatient.ScheduleType == 2 {
@@ -1735,7 +1766,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1735 1766
 			}
1736 1767
 			//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
1737 1768
 
1738
-			if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
1769
+			if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 || appRole.UserType == 4 {
1739 1770
 				advice.AdviceDoctor = appRole.AdminUserId
1740 1771
 			}
1741 1772
 
@@ -2062,7 +2093,7 @@ func (c *DialysisAPIController) Finish() {
2062 2093
 
2063 2094
 	}
2064 2095
 
2065
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 {
2096
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 {
2066 2097
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
2067 2098
 		if evaluation.SystolicBloodPressure == 0 {
2068 2099
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
@@ -2719,7 +2750,7 @@ func (this *DialysisAPIController) StartDialysis() {
2719 2750
 
2720 2751
 			//针对肇庆三鹤血液透析中心
2721 2752
 
2722
-			if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 {
2753
+			if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10440 {
2723 2754
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
2724 2755
 			}
2725 2756
 
@@ -3233,6 +3264,9 @@ func (c *DialysisAPIController) PostSolution() {
3233 3264
 
3234 3265
 	//长沙南雅医院,自动生成抗凝剂的临时处方
3235 3266
 	if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
3267
+		if prescribing_number == 0 {
3268
+			prescribing_number = 1
3269
+		}
3236 3270
 		advice := models.DoctorAdvice{
3237 3271
 			UserOrgId:             adminUserInfo.Org.Id,
3238 3272
 			PatientId:             id,
@@ -3240,8 +3274,8 @@ func (c *DialysisAPIController) PostSolution() {
3240 3274
 			AdviceType:            2,
3241 3275
 			RecordDate:            recordDate.Unix(),
3242 3276
 			AdviceDate:            recordDate.Unix(),
3243
-			StartTime:             recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
3244
-			AdviceName:            "",                          // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
3277
+			StartTime:             recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
3278
+			AdviceName:            "",                            // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
3245 3279
 			AdviceDesc:            "",
3246 3280
 			ReminderDate:          0,
3247 3281
 			SingleDose:            5000,
@@ -3257,12 +3291,15 @@ func (c *DialysisAPIController) PostSolution() {
3257 3291
 			CreatedTime:           time.Now().Unix(),
3258 3292
 			UpdatedTime:           time.Now().Unix(),
3259 3293
 			IsPrescription:        1,
3294
+			ExecutionState:        2,
3295
+			StopState:             2,
3296
+			IsSettle:              2,
3260 3297
 		}
3261 3298
 		// 查询排班信息
3262 3299
 		schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
3263 3300
 		if schedulePatient.ID > 0 {
3264 3301
 			if schedulePatient.ScheduleType == 1 {
3265
-				advice.StartTime = recordDate.Unix() + 7*60*60
3302
+				advice.StartTime = recordDate.Unix() + 6.5*60*60
3266 3303
 			}
3267 3304
 
3268 3305
 			if schedulePatient.ScheduleType == 2 {
@@ -3309,7 +3346,7 @@ func (c *DialysisAPIController) PostSolution() {
3309 3346
 			break
3310 3347
 		}
3311 3348
 		//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
3312
-		if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
3349
+		if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 || appRole.UserType == 4 {
3313 3350
 			advice.AdviceDoctor = appRole.AdminUserId
3314 3351
 		}
3315 3352
 
@@ -3547,7 +3584,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
3547 3584
 				record.UltrafiltrationRate = ultrafiltration_rate
3548 3585
 			}
3549 3586
 
3550
-			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 {
3587
+			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 || adminInfo.Org.Id == 10440 {
3551 3588
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
3552 3589
 				record.UltrafiltrationRate = ultrafiltration_rate
3553 3590
 			}
@@ -3792,8 +3829,22 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
3792 3829
 	}
3793 3830
 
3794 3831
 	//修改床位号需要重新消毒
3795
-	if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 {
3832
+	if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 3877 {
3796 3833
 		service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
3834
+
3835
+		//查询第一条监测
3836
+		firstMonitor, _ := service.GetFirstMonitor(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
3837
+
3838
+		service.UpdateFirstMonitor(firstMonitor.ID, catheter_operation)
3839
+
3840
+		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(tempDialysisRecord.PatientId, 10) + ":" + strconv.FormatInt(tempDialysisRecord.DialysisDate, 10) + ":monitor_records"
3841
+		redis := service.RedisClient()
3842
+		//清空key 值
3843
+		redis.Set(key, "", time.Second)
3844
+		keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(tempDialysisRecord.DialysisDate, 10) + ":monitor_record_list_all"
3845
+		redis.Set(keyOne, "", time.Second)
3846
+		defer redis.Close()
3847
+
3797 3848
 	}
3798 3849
 
3799 3850
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

+ 14 - 0
service/mobile_dialysis_service.go View File

@@ -5257,3 +5257,17 @@ func MobileGetDoubleCheckSix(orgID int64, patientID int64, recordDate int64) (mo
5257 5257
 
5258 5258
 	return record, err
5259 5259
 }
5260
+
5261
+func GetFirstMonitor(patient_id int64, monit_date int64) (models.MonitoringRecord, error) {
5262
+
5263
+	record := models.MonitoringRecord{}
5264
+	err := XTReadDB().Where("patient_id = ? and monitoring_date = ? and status=1", patient_id, monit_date).First(&record).Error
5265
+	return record, err
5266
+}
5267
+
5268
+func UpdateFirstMonitor(id int64, catheter_operation string) (models.MonitoringRecord, error) {
5269
+
5270
+	record := models.MonitoringRecord{}
5271
+	err := XTWriteDB().Model(&record).Where("id = ? and status= 1", id).Updates(map[string]interface{}{"dispose": catheter_operation}).Error
5272
+	return record, err
5273
+}