28169 2 年之前
父節點
當前提交
f8826b3852

+ 1 - 1
controllers/dialysis_api_controller.go 查看文件

5141
 	var ids []string
5141
 	var ids []string
5142
 
5142
 
5143
 	ids = strings.Split(partion_type, ",")
5143
 	ids = strings.Split(partion_type, ",")
5144
-	fmt.Println("ids------------------------", ids)
5144
+
5145
 	timeLayout := "2006-01-02"
5145
 	timeLayout := "2006-01-02"
5146
 	loc, _ := time.LoadLocation("Local")
5146
 	loc, _ := time.LoadLocation("Local")
5147
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
5147
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)

+ 61 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

843
 			order, _ := service.GetDialysisOrder(recordDate.Unix(), id, adminUserInfo.Org.Id)
843
 			order, _ := service.GetDialysisOrder(recordDate.Unix(), id, adminUserInfo.Org.Id)
844
 			doubleCheck.Creater = order.StartNurse
844
 			doubleCheck.Creater = order.StartNurse
845
 		}
845
 		}
846
+
847
+		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
848
+			//查询未核对的医嘱
849
+			doctorList, err := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
850
+			for _, advice := range doctorList {
851
+				if advice.ExecutionStaff == modifier {
852
+
853
+					c.ErrorLog("医嘱核对人不能和执行人为同一人!", err)
854
+					c.ServeFailJSONWithSGJErrorCode(enums.AdviceCodeParamWrong)
855
+					return
856
+				}
857
+			}
858
+		}
846
 		err := service.AddSigleDoubleCheck(&doubleCheck)
859
 		err := service.AddSigleDoubleCheck(&doubleCheck)
847
 
860
 
848
 		//针对长沙南雅
861
 		//针对长沙南雅
851
 			doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
864
 			doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
852
 			if len(doctorList) > 0 && modifier > 0 {
865
 			if len(doctorList) > 0 && modifier > 0 {
853
 				for _, advice := range doctorList {
866
 				for _, advice := range doctorList {
867
+
854
 					service.UpdateDoctorAdviceList(advice.ID, modifier)
868
 					service.UpdateDoctorAdviceList(advice.ID, modifier)
855
 					key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
869
 					key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
856
 					redis := service.RedisClient()
870
 					redis := service.RedisClient()
890
 		doubleCheck.EmployeeNumber = employee_number
904
 		doubleCheck.EmployeeNumber = employee_number
891
 		doubleCheck.NeedleBatchNumber = needle_batch_number
905
 		doubleCheck.NeedleBatchNumber = needle_batch_number
892
 		doubleCheck.DialyzerBatchNumber = dialyzer_batch_number
906
 		doubleCheck.DialyzerBatchNumber = dialyzer_batch_number
907
+
908
+		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
909
+			//查询未核对的医嘱
910
+			doctorList, err := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
911
+			for _, advice := range doctorList {
912
+				if advice.ExecutionStaff == modifier {
913
+
914
+					c.ErrorLog("医嘱核对人不能和执行人为同一人!", err)
915
+					c.ServeFailJSONWithSGJErrorCode(enums.AdviceCodeParamWrong)
916
+					return
917
+				}
918
+			}
919
+		}
893
 		err := service.UpdateDoubleCheck(&doubleCheck)
920
 		err := service.UpdateDoubleCheck(&doubleCheck)
921
+
894
 		//针对长沙南雅
922
 		//针对长沙南雅
895
 		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
923
 		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
896
 			//查询未核对的医嘱
924
 			//查询未核对的医嘱
1701
 			if prescribing_number == 0 {
1729
 			if prescribing_number == 0 {
1702
 				prescribing_number = 1
1730
 				prescribing_number = 1
1703
 			}
1731
 			}
1732
+			if prescribing_number == 0 && id == 14682 {
1733
+				prescribing_number = 2
1734
+			}
1735
+
1736
+			if prescribing_number == 0 && id == 18560 {
1737
+				prescribing_number = 2
1738
+			}
1704
 			advice := models.DoctorAdvice{
1739
 			advice := models.DoctorAdvice{
1705
 				UserOrgId:             adminUserInfo.Org.Id,
1740
 				UserOrgId:             adminUserInfo.Org.Id,
1706
 				PatientId:             id,
1741
 				PatientId:             id,
3294
 		}
3329
 		}
3295
 	}
3330
 	}
3296
 
3331
 
3332
+	if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10340 {
3333
+
3334
+		if solution.PrescribingNumber == 0 {
3335
+			solution.PrescribingNumber = 1
3336
+		}
3337
+		if prescription.PrescribingNumber == 0 {
3338
+			prescription.PrescribingNumber = 1
3339
+		}
3340
+
3341
+		if solution.PrescribingNumber == 0 && id == 14682 {
3342
+			solution.PrescribingNumber = 2
3343
+		}
3344
+
3345
+		if solution.PrescribingNumber == 0 && id == 18560 {
3346
+			solution.PrescribingNumber = 2
3347
+		}
3348
+
3349
+		if prescription.PrescribingNumber == 0 && id == 14682 {
3350
+			prescription.PrescribingNumber = 2
3351
+		}
3352
+
3353
+		if prescription.PrescribingNumber == 0 && id == 18560 {
3354
+			prescription.PrescribingNumber = 2
3355
+		}
3356
+	}
3357
+
3297
 	service.SavePrescriptionAndCreateSolution(&solution, &prescription)
3358
 	service.SavePrescriptionAndCreateSolution(&solution, &prescription)
3298
 	//获取最新1条
3359
 	//获取最新1条
3299
 	dialysisSolution, _ := service.GetLastPatientDialysisSolution(id, adminUserInfo.Org.Id)
3360
 	dialysisSolution, _ := service.GetLastPatientDialysisSolution(id, adminUserInfo.Org.Id)

+ 3 - 0
enums/error_code.go 查看文件

275
 	ErrorCodeDelScheduleFailByDialysisTwo = 60000003
275
 	ErrorCodeDelScheduleFailByDialysisTwo = 60000003
276
 
276
 
277
 	ErrorCodeSyncWrong = 60000006
277
 	ErrorCodeSyncWrong = 60000006
278
+
279
+	AdviceCodeParamWrong = 600000007
278
 )
280
 )
279
 
281
 
280
 var ErrCodeMsgs = map[int]string{
282
 var ErrCodeMsgs = map[int]string{
533
 	ErrorCodePatientDialysisOrderTwo:      "被替换的患者已经上机,无法替换排班",
535
 	ErrorCodePatientDialysisOrderTwo:      "被替换的患者已经上机,无法替换排班",
534
 	ErrorCodePatientScheduleRepeat:        "一天只能存在一次排班",
536
 	ErrorCodePatientScheduleRepeat:        "一天只能存在一次排班",
535
 	ErrorCodeDelScheduleFailByDialysisTwo: "已经上机透析,不能操作排班",
537
 	ErrorCodeDelScheduleFailByDialysisTwo: "已经上机透析,不能操作排班",
538
+	AdviceCodeParamWrong:                  "医嘱核对人和执行人不能为同一人,请更换第二核对人!",
536
 }
539
 }
537
 
540
 
538
 type SGJError struct {
541
 type SGJError struct {

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

203
 	//if partition_id > 0 {
203
 	//if partition_id > 0 {
204
 	//	db = db.Where("partition_id = ?", partition_id)
204
 	//	db = db.Where("partition_id = ?", partition_id)
205
 	//}
205
 	//}
206
-	fmt.Println("len-------------", len(partition_id))
206
+
207
 	if len(partition_id) > 0 {
207
 	if len(partition_id) > 0 {
208
 		db = db.Where("partition_id in(?)", partition_id)
208
 		db = db.Where("partition_id in(?)", partition_id)
209
 	}
209
 	}