28169 2 years ago
parent
commit
f8826b3852

+ 1 - 1
controllers/dialysis_api_controller.go View File

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

+ 61 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -843,6 +843,19 @@ func (c *DialysisAPIController) PostDoubleCheck() {
843 843
 			order, _ := service.GetDialysisOrder(recordDate.Unix(), id, adminUserInfo.Org.Id)
844 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 859
 		err := service.AddSigleDoubleCheck(&doubleCheck)
847 860
 
848 861
 		//针对长沙南雅
@@ -851,6 +864,7 @@ func (c *DialysisAPIController) PostDoubleCheck() {
851 864
 			doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
852 865
 			if len(doctorList) > 0 && modifier > 0 {
853 866
 				for _, advice := range doctorList {
867
+
854 868
 					service.UpdateDoctorAdviceList(advice.ID, modifier)
855 869
 					key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
856 870
 					redis := service.RedisClient()
@@ -890,7 +904,21 @@ func (c *DialysisAPIController) PostDoubleCheck() {
890 904
 		doubleCheck.EmployeeNumber = employee_number
891 905
 		doubleCheck.NeedleBatchNumber = needle_batch_number
892 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 920
 		err := service.UpdateDoubleCheck(&doubleCheck)
921
+
894 922
 		//针对长沙南雅
895 923
 		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
896 924
 			//查询未核对的医嘱
@@ -1701,6 +1729,13 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1701 1729
 			if prescribing_number == 0 {
1702 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 1739
 			advice := models.DoctorAdvice{
1705 1740
 				UserOrgId:             adminUserInfo.Org.Id,
1706 1741
 				PatientId:             id,
@@ -3294,6 +3329,32 @@ func (c *DialysisAPIController) PostSolution() {
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 3358
 	service.SavePrescriptionAndCreateSolution(&solution, &prescription)
3298 3359
 	//获取最新1条
3299 3360
 	dialysisSolution, _ := service.GetLastPatientDialysisSolution(id, adminUserInfo.Org.Id)

+ 3 - 0
enums/error_code.go View File

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

+ 1 - 1
service/dialysis_solution_service.go View File

@@ -203,7 +203,7 @@ func GetDialysisGoodTotalCount(orgID int64, schedule_type int64, partition_id []
203 203
 	//if partition_id > 0 {
204 204
 	//	db = db.Where("partition_id = ?", partition_id)
205 205
 	//}
206
-	fmt.Println("len-------------", len(partition_id))
206
+
207 207
 	if len(partition_id) > 0 {
208 208
 		db = db.Where("partition_id in(?)", partition_id)
209 209
 	}