|
@@ -309,6 +309,7 @@ func (c *PatientApiController) EditDoctorAdvice() {
|
309
|
309
|
//2.一组医嘱内有多条医嘱(不包括子医嘱)的情况下,需要为修改的那条医嘱重新分配组号,并修改医嘱开始时间
|
310
|
310
|
var err error
|
311
|
311
|
var isChangeGroup bool
|
|
312
|
+
|
312
|
313
|
if advice.ParentId == 0 {
|
313
|
314
|
adviceSlice, _ := service.FindAdviceByGoroupNo(adminUserInfo.Org.Id, advice.GroupNo)
|
314
|
315
|
sourceAdvice, _ := service.FindOldDoctorAdvice(adminUserInfo.Org.Id, advice.ID)
|
|
@@ -360,6 +361,8 @@ func (c *PatientApiController) EditDoctorAdvice() {
|
360
|
361
|
keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(doc_advice_date, 10) + ":advice_list_all"
|
361
|
362
|
redis.Set(keyOne, "", time.Second)
|
362
|
363
|
}
|
|
364
|
+ } else {
|
|
365
|
+ err = service.UpdateDoctorAdvice(&advice)
|
363
|
366
|
}
|
364
|
367
|
|
365
|
368
|
} else if len(adviceSlice) > 1 {
|
|
@@ -414,6 +417,8 @@ func (c *PatientApiController) EditDoctorAdvice() {
|
414
|
417
|
isChangeGroup = true
|
415
|
418
|
|
416
|
419
|
}
|
|
420
|
+ } else {
|
|
421
|
+ err = service.UpdateDoctorAdvice(&advice)
|
417
|
422
|
}
|
418
|
423
|
|
419
|
424
|
}
|
|
@@ -687,6 +692,24 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
687
|
692
|
|
688
|
693
|
for _, item := range advices {
|
689
|
694
|
|
|
695
|
+ if item.ExecutionState == 1 {
|
|
696
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
|
|
697
|
+ return
|
|
698
|
+ }
|
|
699
|
+
|
|
700
|
+ if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
|
|
701
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
|
|
702
|
+ return
|
|
703
|
+ }
|
|
704
|
+
|
|
705
|
+ //针对普宁
|
|
706
|
+ if adminUserInfo.Org.Id != 10599 {
|
|
707
|
+
|
|
708
|
+ if item.StartTime > theTime.Unix() {
|
|
709
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
|
|
710
|
+ return
|
|
711
|
+ }
|
|
712
|
+ }
|
690
|
713
|
//自备药
|
691
|
714
|
selfPrescriptionOutOpenOne, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
|
692
|
715
|
|
|
@@ -1143,6 +1166,25 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1143
|
1166
|
advicesOne, _ := service.FindDoctorAdviceByIdsOne(adminUserInfo.Org.Id, ids)
|
1144
|
1167
|
for _, item := range advicesOne {
|
1145
|
1168
|
|
|
1169
|
+ if item.ExecutionState == 1 {
|
|
1170
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
|
|
1171
|
+ return
|
|
1172
|
+ }
|
|
1173
|
+
|
|
1174
|
+ if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
|
|
1175
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
|
|
1176
|
+ return
|
|
1177
|
+ }
|
|
1178
|
+
|
|
1179
|
+ //针对普宁
|
|
1180
|
+ if adminUserInfo.Org.Id != 10599 {
|
|
1181
|
+
|
|
1182
|
+ if item.StartTime > theTime.Unix() {
|
|
1183
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
|
|
1184
|
+ return
|
|
1185
|
+ }
|
|
1186
|
+ }
|
|
1187
|
+
|
1146
|
1188
|
//自备药
|
1147
|
1189
|
selfPrescriptionOutOpen, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
|
1148
|
1190
|
|