|
@@ -2086,6 +2086,86 @@ func (c *DialysisAPIController) Finish() {
|
2086
|
2086
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorDialysisOrderNoEND)
|
2087
|
2087
|
return
|
2088
|
2088
|
}
|
|
2089
|
+
|
|
2090
|
+ //下机完自动消毒,针对长沙南雅
|
|
2091
|
+ if dialysisOrder.Stage == 1 {
|
|
2092
|
+ if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
2093
|
+ //根据床位号获取设备型号
|
|
2094
|
+ unitType, _ := service.GetUnitType(dialysisOrder.BedID, dialysisOrder.UserOrgId)
|
|
2095
|
+ //查询使用消毒最后一条消毒记录
|
|
2096
|
+ _, err := service.GetLaseDeviceInfomation(dialysisOrder.UserOrgId, dialysisOrder.BedID, dialysisOrder.DialysisDate, dialysisOrder.SchedualType)
|
|
2097
|
+ fmt.Println("err", err)
|
|
2098
|
+ if err == gorm.ErrRecordNotFound {
|
|
2099
|
+ //查找排班
|
|
2100
|
+ scheduleByPatient, _ := service.GetScheduleByPatient(dialysisOrder.PatientId, dialysisOrder.DialysisDate, dialysisOrder.UserOrgId)
|
|
2101
|
+ //查询改设备是否有消毒计划
|
|
2102
|
+ plan, errcode := service.GetDisInfectionTime(dialysisOrder.UserOrgId, unitType.UnitType, dialysisOrder.SchedualType, scheduleByPatient.ScheduleWeek)
|
|
2103
|
+
|
|
2104
|
+ //根据床位号获取设备id
|
|
2105
|
+ addmacher, _ := service.GetEquimentIDTwo(dialysisOrder.BedID, dialysisOrder.UserOrgId)
|
|
2106
|
+
|
|
2107
|
+ //查询病人信息
|
|
2108
|
+ patients, _ := service.GetPatientInfoMation(dialysisOrder.PatientId)
|
|
2109
|
+ var con = ""
|
|
2110
|
+ if patients.IsInfectious == 0 {
|
|
2111
|
+ con = ""
|
|
2112
|
+ }
|
|
2113
|
+ if patients.IsInfectious == 1 {
|
|
2114
|
+ con = "无"
|
|
2115
|
+ }
|
|
2116
|
+ if patients.IsInfectious == 2 {
|
|
2117
|
+ con = "有"
|
|
2118
|
+ }
|
|
2119
|
+
|
|
2120
|
+ //如果没有消毒计划,去查询该设备的上次消毒时间
|
|
2121
|
+ if errcode == gorm.ErrRecordNotFound {
|
|
2122
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2123
|
+ return
|
|
2124
|
+ }
|
|
2125
|
+ if errcode == nil {
|
|
2126
|
+ var end_time int64
|
|
2127
|
+ end_time = endDate.Unix() + plan.DisinfecTime*60
|
|
2128
|
+ //新增消毒
|
|
2129
|
+ information := models.DeviceInformation{
|
|
2130
|
+ Date: dialysisOrder.DialysisDate,
|
|
2131
|
+ Zone: dialysisOrder.ZoneId,
|
|
2132
|
+ Class: dialysisOrder.SchedualType,
|
|
2133
|
+ BedNumber: dialysisOrder.BedID,
|
|
2134
|
+ PatientId: dialysisOrder.PatientId,
|
|
2135
|
+ DialysisMode: scheduleByPatient.ModeId,
|
|
2136
|
+ LongTime: strconv.FormatInt(plan.DisinfecTime, 10),
|
|
2137
|
+ Disinfection: 1,
|
|
2138
|
+ DialysisConcentration: 1,
|
|
2139
|
+ DisinfectionStatus: 1,
|
|
2140
|
+ Move: 1,
|
|
2141
|
+ UserOrgId: dialysisOrder.UserOrgId,
|
|
2142
|
+ DisinfectType: plan.Way,
|
|
2143
|
+ DisinfectantType: plan.MachineDisinfectant,
|
|
2144
|
+ FluidPath: plan.DisinfectanWay, //液路消毒方式
|
|
2145
|
+ Disinfectant: plan.Disinfectant,
|
|
2146
|
+ Ctime: time.Now().Unix(),
|
|
2147
|
+ Status: 1,
|
|
2148
|
+ SignName: dialysisOrder.FinishNurse,
|
|
2149
|
+ EquimentId: addmacher.ID,
|
|
2150
|
+ DisinfectionResidue: 2,
|
|
2151
|
+ Bed: addmacher.BedNumber,
|
|
2152
|
+ StartTime: dialysisOrder.StartTime,
|
|
2153
|
+ EndTime: dialysisOrder.EndTime,
|
|
2154
|
+ Contagion: con,
|
|
2155
|
+ WeightLoss: 0,
|
|
2156
|
+ Hyperfiltratio: 0,
|
|
2157
|
+ DialysisHour: "",
|
|
2158
|
+ MachineRun: 1,
|
|
2159
|
+ DisinfecStartime: endDate.Unix(),
|
|
2160
|
+ DisinfecEndtime: end_time,
|
|
2161
|
+ }
|
|
2162
|
+ err := service.CreateInformationTwo(&information)
|
|
2163
|
+ fmt.Println("报错", err)
|
|
2164
|
+ }
|
|
2165
|
+ }
|
|
2166
|
+ }
|
|
2167
|
+ }
|
|
2168
|
+
|
2089
|
2169
|
if dialysisOrder.Stage == 1 {
|
2090
|
2170
|
err := service.ModifyDialysisRecord(dialysisOrder.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id, puncture_point_haematoma, internal_fistula, catheter, cruor, mission)
|
2091
|
2171
|
|
|
@@ -2126,6 +2206,7 @@ func (c *DialysisAPIController) Finish() {
|
2126
|
2206
|
}
|
2127
|
2207
|
|
2128
|
2208
|
}
|
|
2209
|
+
|
2129
|
2210
|
}
|
2130
|
2211
|
|
2131
|
2212
|
func (c *DialysisAPIController) GetAllZone() {
|
|
@@ -2188,6 +2269,8 @@ func (this *DialysisAPIController) StartDialysis() {
|
2188
|
2269
|
nuclein_date_str := this.GetString("nuclein_date_str")
|
2189
|
2270
|
schedule_remark := this.GetString("schedule_remark")
|
2190
|
2271
|
order_remark := this.GetString("order_remark")
|
|
2272
|
+ catheter_operation := this.GetString("catheter_operation")
|
|
2273
|
+
|
2191
|
2274
|
if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
|
2192
|
2275
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
2193
|
2276
|
return
|
|
@@ -2389,6 +2472,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2389
|
2472
|
NucleinDate: theNucleinDate,
|
2390
|
2473
|
ScheduleRemark: schedule_remark,
|
2391
|
2474
|
OrderRemark: order_remark,
|
|
2475
|
+ CatheterOperation: catheter_operation,
|
2392
|
2476
|
}
|
2393
|
2477
|
//查询该床位是否有人用了
|
2394
|
2478
|
_, errorscode := service.GetDialysisOrderByBedId(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
|
|
@@ -3246,6 +3330,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
3246
|
3330
|
nuclein_date_str := this.GetString("nuclein_date_str")
|
3247
|
3331
|
order_remark := this.GetString("order_remark")
|
3248
|
3332
|
schedule_remark := this.GetString("schedule_remark")
|
|
3333
|
+ catheter_operation := this.GetString("catheter_operation")
|
3249
|
3334
|
if record_id == 0 {
|
3250
|
3335
|
this.ErrorLog("id:%v", record_id)
|
3251
|
3336
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -3410,6 +3495,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
3410
|
3495
|
NucleinDate: theNucleinDate,
|
3411
|
3496
|
OrderRemark: order_remark,
|
3412
|
3497
|
ScheduleRemark: schedule_remark,
|
|
3498
|
+ CatheterOperation: catheter_operation,
|
3413
|
3499
|
}
|
3414
|
3500
|
|
3415
|
3501
|
//修改床位号需要重新消毒
|