|
@@ -1053,6 +1053,47 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
1053
|
1053
|
|
1054
|
1054
|
}
|
1055
|
1055
|
|
|
1056
|
+ //针对溪康
|
|
1057
|
+ if adminUserInfo.Org.Id == 10721 {
|
|
1058
|
+
|
|
1059
|
+ adviceInfoList, _ := service.GetHisDoctorAdviceList(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1060
|
+ if len(adviceInfoList) > 0 {
|
|
1061
|
+ for _, item := range adviceInfoList {
|
|
1062
|
+
|
|
1063
|
+ service.UpdateHisAdviceList(item.ID, creater)
|
|
1064
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.PatientId, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":doctor_advices"
|
|
1065
|
+ redis := service.RedisClient()
|
|
1066
|
+ //清空key 值
|
|
1067
|
+ redis.Set(key, "", time.Second)
|
|
1068
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":advice_list_all"
|
|
1069
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1070
|
+ theTime := time.Now()
|
|
1071
|
+ recordDate := theTime.Format("2006-01-02")
|
|
1072
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1073
|
+ redis.Set(keyFour, "", time.Second)
|
|
1074
|
+ defer redis.Close()
|
|
1075
|
+ }
|
|
1076
|
+ }
|
|
1077
|
+
|
|
1078
|
+ adviceList, _ := service.GetMobileDoctorAdviceList(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1079
|
+ if len(adviceList) > 0 {
|
|
1080
|
+ for _, item := range adviceList {
|
|
1081
|
+ service.UpdateAdviceList(item.ID, creater)
|
|
1082
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.PatientId, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":doctor_advices"
|
|
1083
|
+ redis := service.RedisClient()
|
|
1084
|
+ //清空key 值
|
|
1085
|
+ redis.Set(key, "", time.Second)
|
|
1086
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":advice_list_all"
|
|
1087
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1088
|
+ theTime := time.Now()
|
|
1089
|
+ recordDate := theTime.Format("2006-01-02")
|
|
1090
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1091
|
+ redis.Set(keyFour, "", time.Second)
|
|
1092
|
+ defer redis.Close()
|
|
1093
|
+ }
|
|
1094
|
+ }
|
|
1095
|
+ }
|
|
1096
|
+
|
1056
|
1097
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":double_check"
|
1057
|
1098
|
redis := service.RedisClient()
|
1058
|
1099
|
//清空key 值
|
|
@@ -1112,6 +1153,48 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
1112
|
1153
|
}
|
1113
|
1154
|
}
|
1114
|
1155
|
}
|
|
1156
|
+
|
|
1157
|
+ //针对溪康
|
|
1158
|
+ if adminUserInfo.Org.Id == 10721 {
|
|
1159
|
+
|
|
1160
|
+ adviceInfoList, _ := service.GetHisDoctorAdviceList(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1161
|
+ if len(adviceInfoList) > 0 {
|
|
1162
|
+ for _, item := range adviceInfoList {
|
|
1163
|
+
|
|
1164
|
+ service.UpdateHisAdviceList(item.ID, creater)
|
|
1165
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.PatientId, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":doctor_advices"
|
|
1166
|
+ redis := service.RedisClient()
|
|
1167
|
+ //清空key 值
|
|
1168
|
+ redis.Set(key, "", time.Second)
|
|
1169
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":advice_list_all"
|
|
1170
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1171
|
+ theTime := time.Now()
|
|
1172
|
+ recordDate := theTime.Format("2006-01-02")
|
|
1173
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1174
|
+ redis.Set(keyFour, "", time.Second)
|
|
1175
|
+ defer redis.Close()
|
|
1176
|
+ }
|
|
1177
|
+ }
|
|
1178
|
+
|
|
1179
|
+ adviceList, _ := service.GetMobileDoctorAdviceList(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1180
|
+ if len(adviceList) > 0 {
|
|
1181
|
+ for _, item := range adviceList {
|
|
1182
|
+ service.UpdateAdviceList(item.ID, creater)
|
|
1183
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.PatientId, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":doctor_advices"
|
|
1184
|
+ redis := service.RedisClient()
|
|
1185
|
+ //清空key 值
|
|
1186
|
+ redis.Set(key, "", time.Second)
|
|
1187
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(item.AdviceDate, 10) + ":advice_list_all"
|
|
1188
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1189
|
+ theTime := time.Now()
|
|
1190
|
+ recordDate := theTime.Format("2006-01-02")
|
|
1191
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1192
|
+ redis.Set(keyFour, "", time.Second)
|
|
1193
|
+ defer redis.Close()
|
|
1194
|
+ }
|
|
1195
|
+ }
|
|
1196
|
+ }
|
|
1197
|
+
|
1115
|
1198
|
err := service.UpdateDoubleCheck(&doubleCheck)
|
1116
|
1199
|
|
1117
|
1200
|
//针对长沙南雅
|
|
@@ -2046,6 +2129,25 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2046
|
2129
|
service.ModifyScheduleMode(mode_id, id, recordDate.Unix(), adminUserInfo.Org.Id, str)
|
2047
|
2130
|
}
|
2048
|
2131
|
|
|
2132
|
+ goodList, _ := service.GetMobileGoodList(adminUserInfo.Org.Id)
|
|
2133
|
+
|
|
2134
|
+ var dialysis_dialyszers_id int64
|
|
2135
|
+ var dialysis_strainer_id int64
|
|
2136
|
+ var dialysis_irrigation_id int64
|
|
2137
|
+ if len(goodList) > 0 {
|
|
2138
|
+ for _, item := range goodList {
|
|
2139
|
+ if item.SpecificationName == dialysis_dialyszers {
|
|
2140
|
+ dialysis_dialyszers_id = item.ID
|
|
2141
|
+ }
|
|
2142
|
+ if item.SpecificationName == dialysis_irrigation {
|
|
2143
|
+ dialysis_irrigation_id = item.ID
|
|
2144
|
+ }
|
|
2145
|
+ if item.SpecificationName == dialysis_strainer {
|
|
2146
|
+ dialysis_strainer_id = item.ID
|
|
2147
|
+ }
|
|
2148
|
+ }
|
|
2149
|
+ }
|
|
2150
|
+
|
2049
|
2151
|
//TODO 需要根据角色去判断
|
2050
|
2152
|
|
2051
|
2153
|
prescription := models.DialysisPrescription{
|
|
@@ -2157,6 +2259,9 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2157
|
2259
|
BloodAccessPartId: blood_access_part_id,
|
2158
|
2260
|
AnticoagulantWeichiHour: anticoagulant_weichi_hour,
|
2159
|
2261
|
Dialyzate: dialyzate,
|
|
2262
|
+ DialysisDialyszersId: dialysis_dialyszers_id,
|
|
2263
|
+ DialysisIrrigationId: dialysis_irrigation_id,
|
|
2264
|
+ DialysisStrainerId: dialysis_strainer_id,
|
2160
|
2265
|
}
|
2161
|
2266
|
|
2162
|
2267
|
//查询最近透析准备表里是否存在 透析器 灌流器
|
|
@@ -4150,6 +4255,25 @@ func (c *DialysisAPIController) PostSolution() {
|
4150
|
4255
|
}
|
4151
|
4256
|
}
|
4152
|
4257
|
|
|
4258
|
+ goodList, _ := service.GetMobileGoodList(adminUserInfo.Org.Id)
|
|
4259
|
+
|
|
4260
|
+ var dialysis_dialyszers_id int64
|
|
4261
|
+ var dialysis_strainer_id int64
|
|
4262
|
+ var dialysis_irrigation_id int64
|
|
4263
|
+ if len(goodList) > 0 {
|
|
4264
|
+ for _, item := range goodList {
|
|
4265
|
+ if item.SpecificationName == dialysis_dialyszers {
|
|
4266
|
+ dialysis_dialyszers_id = item.ID
|
|
4267
|
+ }
|
|
4268
|
+ if item.SpecificationName == dialysis_irrigation {
|
|
4269
|
+ dialysis_irrigation_id = item.ID
|
|
4270
|
+ }
|
|
4271
|
+ if item.SpecificationName == dialysis_strainer {
|
|
4272
|
+ dialysis_strainer_id = item.ID
|
|
4273
|
+ }
|
|
4274
|
+ }
|
|
4275
|
+ }
|
|
4276
|
+
|
4153
|
4277
|
prescription := models.DialysisPrescription{
|
4154
|
4278
|
|
4155
|
4279
|
UserOrgId: adminUserInfo.Org.Id,
|
|
@@ -4260,6 +4384,9 @@ func (c *DialysisAPIController) PostSolution() {
|
4260
|
4384
|
BloodAccessPartId: blood_access_part_id,
|
4261
|
4385
|
AnticoagulantWeichiHour: anticoagulant_weichi_hour,
|
4262
|
4386
|
Dialyzate: dialyzate,
|
|
4387
|
+ DialysisDialyszersId: dialysis_dialyszers_id,
|
|
4388
|
+ DialysisIrrigationId: dialysis_irrigation_id,
|
|
4389
|
+ DialysisStrainerId: dialysis_strainer_id,
|
4263
|
4390
|
}
|
4264
|
4391
|
|
4265
|
4392
|
_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
@@ -4389,6 +4516,9 @@ func (c *DialysisAPIController) PostSolution() {
|
4389
|
4516
|
BloodAccessPartId: blood_access_part_id,
|
4390
|
4517
|
AnticoagulantWeichiHour: anticoagulant_weichi_hour,
|
4391
|
4518
|
Dialyzate: dialyzate,
|
|
4519
|
+ DialysisDialyszersId: dialysis_dialyszers_id,
|
|
4520
|
+ DialysisIrrigationId: dialysis_irrigation_id,
|
|
4521
|
+ DialysisStrainerId: dialysis_strainer_id,
|
4392
|
4522
|
}
|
4393
|
4523
|
|
4394
|
4524
|
//针对河间咸的
|
|
@@ -11066,21 +11196,33 @@ func (c *DialysisAPIController) ExMobileChangeSch() {
|
11066
|
11196
|
|
11067
|
11197
|
err := service.UpdateScheduleThree(sch, sch_two)
|
11068
|
11198
|
|
11069
|
|
- order, _ := service.GetOneDialysisOrderOne(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
|
|
11199
|
+ order, _ := service.GetOneDialysisOrderOne(sch.UserOrgId, sch.ScheduleDate, sch.PatientId)
|
11070
|
11200
|
if order.ID > 0 {
|
11071
|
|
- //查询该患者的排班机位
|
11072
|
|
- pSchedule, _ := service.GetPscheduleDate(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
|
11073
|
|
- service.UpdateDialysiOrderByPatientId(id_two, pSchedule.ScheduleType, pSchedule.PartitionId, pSchedule.BedId)
|
|
11201
|
+ scheduleObj, _ := service.GetPatientScheduleByPatientId(sch.PatientId, sch.UserOrgId, sch.ScheduleDate)
|
|
11202
|
+ service.UpdateDialysiOrderByPatientId(order.ID, scheduleObj.ScheduleType, scheduleObj.PartitionId, scheduleObj.BedId)
|
|
11203
|
+ redis := service.RedisClient()
|
|
11204
|
+ key := strconv.FormatInt(sch.UserOrgId, 10) + ":" + strconv.FormatInt(sch.PatientId, 10) + ":" + strconv.FormatInt(sch.ScheduleDate, 10) + ":dialysis_order"
|
|
11205
|
+ redis.Set(key, "", time.Second)
|
|
11206
|
+ keyOne := strconv.FormatInt(sch.UserOrgId, 10) + ":" + strconv.FormatInt(sch.ScheduleDate, 10) + ":dialysis_orders_list_all"
|
|
11207
|
+
|
|
11208
|
+ //清空key 值
|
|
11209
|
+ redis.Set(keyOne, "", time.Second)
|
|
11210
|
+
|
|
11211
|
+ }
|
|
11212
|
+
|
|
11213
|
+ orderOne, _ := service.GetOneDialysisOrderOne(sch_two.UserOrgId, sch_two.ScheduleDate, sch_two.PatientId)
|
|
11214
|
+ if orderOne.ID > 0 {
|
|
11215
|
+ scheduleObj, _ := service.GetPatientScheduleByPatientId(sch_two.PatientId, sch_two.UserOrgId, sch_two.ScheduleDate)
|
|
11216
|
+ service.UpdateDialysiOrderByPatientId(orderOne.ID, scheduleObj.ScheduleType, scheduleObj.PartitionId, scheduleObj.BedId)
|
11074
|
11217
|
redis := service.RedisClient()
|
11075
|
11218
|
key := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.PatientId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_order"
|
11076
|
11219
|
redis.Set(key, "", time.Second)
|
11077
|
11220
|
keyOne := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_orders_list_all"
|
11078
|
|
-
|
11079
|
11221
|
//清空key 值
|
11080
|
11222
|
redis.Set(keyOne, "", time.Second)
|
11081
|
|
- //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientDialysisOrderOne)
|
11082
|
|
- //return
|
|
11223
|
+
|
11083
|
11224
|
}
|
|
11225
|
+
|
11084
|
11226
|
if err == nil {
|
11085
|
11227
|
|
11086
|
11228
|
//去除当天患者排班中重复数据,保留最后一条数据
|
|
@@ -11123,21 +11265,6 @@ func (c *DialysisAPIController) MobileCoverSch() {
|
11123
|
11265
|
}
|
11124
|
11266
|
sch_two, _ := service.GetScheduleTen(c.GetMobileAdminUserInfo().Org.Id, id_two)
|
11125
|
11267
|
|
11126
|
|
- order, _ := service.GetOneDialysisOrderOne(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
|
11127
|
|
- if order.ID > 0 {
|
11128
|
|
-
|
11129
|
|
- service.UpdateDialysiOrderByPatientId(id_two, sch_two.ScheduleType, sch_two.PartitionId, sch_two.BedId)
|
11130
|
|
- redis := service.RedisClient()
|
11131
|
|
- key := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.PatientId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_order"
|
11132
|
|
- redis.Set(key, "", time.Second)
|
11133
|
|
- keyOne := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_orders_list_all"
|
11134
|
|
-
|
11135
|
|
- //清空key 值
|
11136
|
|
- redis.Set(keyOne, "", time.Second)
|
11137
|
|
-
|
11138
|
|
- //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientDialysisOrderTwo)
|
11139
|
|
- //return
|
11140
|
|
- }
|
11141
|
11268
|
//替换者和被替换的排班日期不是同一天,则进行一个患者一天不能有多个排班提醒
|
11142
|
11269
|
if sch.ScheduleDate != sch_two.ScheduleDate && sch.PatientId != sch_two.PatientId {
|
11143
|
11270
|
count, _ := service.GetScheduleCountByDate(c.GetMobileAdminUserInfo().Org.Id, sch_two.ScheduleDate, sch.PatientId)
|
|
@@ -11160,6 +11287,34 @@ func (c *DialysisAPIController) MobileCoverSch() {
|
11160
|
11287
|
//生成新的排班
|
11161
|
11288
|
if err == nil {
|
11162
|
11289
|
err2 := service.SaveSch(&new_sch)
|
|
11290
|
+
|
|
11291
|
+ order, _ := service.GetOneDialysisOrderOne(sch.UserOrgId, sch.ScheduleDate, sch.PatientId)
|
|
11292
|
+ if order.ID > 0 {
|
|
11293
|
+ scheduleObj, _ := service.GetPatientScheduleByPatientId(sch.PatientId, sch.UserOrgId, sch.ScheduleDate)
|
|
11294
|
+ service.UpdateDialysiOrderByPatientId(order.ID, scheduleObj.ScheduleType, scheduleObj.PartitionId, scheduleObj.BedId)
|
|
11295
|
+ redis := service.RedisClient()
|
|
11296
|
+ key := strconv.FormatInt(sch.UserOrgId, 10) + ":" + strconv.FormatInt(sch.PatientId, 10) + ":" + strconv.FormatInt(sch.ScheduleDate, 10) + ":dialysis_order"
|
|
11297
|
+ redis.Set(key, "", time.Second)
|
|
11298
|
+ keyOne := strconv.FormatInt(sch.UserOrgId, 10) + ":" + strconv.FormatInt(sch.ScheduleDate, 10) + ":dialysis_orders_list_all"
|
|
11299
|
+
|
|
11300
|
+ //清空key 值
|
|
11301
|
+ redis.Set(keyOne, "", time.Second)
|
|
11302
|
+
|
|
11303
|
+ }
|
|
11304
|
+
|
|
11305
|
+ orderOne, _ := service.GetOneDialysisOrderOne(sch_two.UserOrgId, sch_two.ScheduleDate, sch_two.PatientId)
|
|
11306
|
+ if orderOne.ID > 0 {
|
|
11307
|
+ scheduleObj, _ := service.GetPatientScheduleByPatientId(sch_two.PatientId, sch_two.UserOrgId, sch_two.ScheduleDate)
|
|
11308
|
+ service.UpdateDialysiOrderByPatientId(orderOne.ID, scheduleObj.ScheduleType, scheduleObj.PartitionId, scheduleObj.BedId)
|
|
11309
|
+ redis := service.RedisClient()
|
|
11310
|
+ key := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.PatientId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_order"
|
|
11311
|
+ redis.Set(key, "", time.Second)
|
|
11312
|
+ keyOne := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_orders_list_all"
|
|
11313
|
+ //清空key 值
|
|
11314
|
+ redis.Set(keyOne, "", time.Second)
|
|
11315
|
+
|
|
11316
|
+ }
|
|
11317
|
+
|
11163
|
11318
|
if err2 == nil {
|
11164
|
11319
|
//去除当天患者排班中重复数据,保留最后一条数据
|
11165
|
11320
|
service.UpdateRepeatSchStatus(sch.UserOrgId, sch.ScheduleDate)
|