|
@@ -1347,119 +1347,117 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
|
1347
|
1347
|
|
1348
|
1348
|
err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
|
1349
|
1349
|
|
1350
|
|
- if adminUserInfo.CurrentOrgId == 10101 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10215 || adminUserInfo.CurrentOrgId == 10233 || adminUserInfo.CurrentOrgId == 10223 || adminUserInfo.CurrentOrgId == 10243 || adminUserInfo.CurrentOrgId == 10340 {
|
1351
|
|
-
|
1352
|
|
- //evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
|
1353
|
|
- //if evaluation.SystolicBloodPressure == 0 {
|
1354
|
|
- // evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
|
1355
|
|
- //
|
1356
|
|
- // pre := models.PredialysisEvaluation{
|
1357
|
|
- // SystolicBloodPressure: evaluation.SystolicBloodPressure,
|
1358
|
|
- // }
|
1359
|
|
- // fmt.Println("prew", pre)
|
1360
|
|
- // getNurseErr := service.UpdatePredialysisEvaluation(&pre, evaluation.ID)
|
1361
|
|
- // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
1362
|
|
- // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
1363
|
|
- //
|
1364
|
|
- // redis := service.RedisClient()
|
1365
|
|
- // redis.Set(key, "", time.Second)
|
1366
|
|
- // redis.Set(keyOne, "", time.Second)
|
1367
|
|
- // defer redis.Close()
|
1368
|
|
- // fmt.Println(getNurseErr)
|
1369
|
|
- //}
|
1370
|
|
- //if evaluation.DiastolicBloodPressure == 0 {
|
1371
|
|
- // evaluation.DiastolicBloodPressure = fmonitorRecords.DiastolicBloodPressure
|
1372
|
|
- // pres := models.PredialysisEvaluation{
|
1373
|
|
- // DiastolicBloodPressure: evaluation.DiastolicBloodPressure,
|
1374
|
|
- // }
|
1375
|
|
- // getNurseErr := service.UpdatePredialysisEvaluationTwo(&pres, evaluation.ID)
|
1376
|
|
- // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
1377
|
|
- //
|
1378
|
|
- // redis := service.RedisClient()
|
1379
|
|
- // redis.Set(key, "", time.Second)
|
1380
|
|
- //
|
1381
|
|
- // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
1382
|
|
- // redis.Set(keyOne, "", time.Second)
|
1383
|
|
- // defer redis.Close()
|
1384
|
|
- // fmt.Println(getNurseErr)
|
1385
|
|
- //}
|
1386
|
|
- //if evaluation.PulseFrequency == 0 {
|
1387
|
|
- // evaluation.PulseFrequency = fmonitorRecords.PulseFrequency
|
1388
|
|
- // press := models.PredialysisEvaluation{
|
1389
|
|
- // PulseFrequency: evaluation.PulseFrequency,
|
1390
|
|
- // }
|
1391
|
|
- // getNurseErr := service.UpdatePredialysisEvaluationThree(&press, evaluation.ID)
|
1392
|
|
- // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
1393
|
|
- //
|
1394
|
|
- // redis := service.RedisClient()
|
1395
|
|
- // redis.Set(key, "", time.Second)
|
1396
|
|
- // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
1397
|
|
- // redis.Set(keyOne, "", time.Second)
|
1398
|
|
- // defer redis.Close()
|
1399
|
|
- // fmt.Println(getNurseErr)
|
1400
|
|
- //}
|
1401
|
|
- //
|
1402
|
|
- //if evaluation.Temperature == 0 {
|
1403
|
|
- // evaluation.Temperature = fmonitorRecords.Temperature
|
1404
|
|
- // press := models.PredialysisEvaluation{
|
1405
|
|
- // Temperature: evaluation.Temperature,
|
1406
|
|
- // }
|
1407
|
|
- // getNurseErr := service.UpdatePredialysisEvaluationFour(&press, evaluation.ID)
|
1408
|
|
- // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
1409
|
|
- //
|
1410
|
|
- // redis := service.RedisClient()
|
1411
|
|
- // redis.Set(key, "", time.Second)
|
1412
|
|
- // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
1413
|
|
- // redis.Set(keyOne, "", time.Second)
|
1414
|
|
- // defer redis.Close()
|
1415
|
|
- // fmt.Println(getNurseErr)
|
1416
|
|
- //}
|
1417
|
|
- //
|
1418
|
|
- if err != nil {
|
1419
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1420
|
|
- return
|
1421
|
|
- }
|
|
1350
|
+ //evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
|
|
1351
|
+ //if evaluation.SystolicBloodPressure == 0 {
|
|
1352
|
+ // evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
|
|
1353
|
+ //
|
|
1354
|
+ // pre := models.PredialysisEvaluation{
|
|
1355
|
+ // SystolicBloodPressure: evaluation.SystolicBloodPressure,
|
|
1356
|
+ // }
|
|
1357
|
+ // fmt.Println("prew", pre)
|
|
1358
|
+ // getNurseErr := service.UpdatePredialysisEvaluation(&pre, evaluation.ID)
|
|
1359
|
+ // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
|
1360
|
+ // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
|
1361
|
+ //
|
|
1362
|
+ // redis := service.RedisClient()
|
|
1363
|
+ // redis.Set(key, "", time.Second)
|
|
1364
|
+ // redis.Set(keyOne, "", time.Second)
|
|
1365
|
+ // defer redis.Close()
|
|
1366
|
+ // fmt.Println(getNurseErr)
|
|
1367
|
+ //}
|
|
1368
|
+ //if evaluation.DiastolicBloodPressure == 0 {
|
|
1369
|
+ // evaluation.DiastolicBloodPressure = fmonitorRecords.DiastolicBloodPressure
|
|
1370
|
+ // pres := models.PredialysisEvaluation{
|
|
1371
|
+ // DiastolicBloodPressure: evaluation.DiastolicBloodPressure,
|
|
1372
|
+ // }
|
|
1373
|
+ // getNurseErr := service.UpdatePredialysisEvaluationTwo(&pres, evaluation.ID)
|
|
1374
|
+ // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
|
1375
|
+ //
|
|
1376
|
+ // redis := service.RedisClient()
|
|
1377
|
+ // redis.Set(key, "", time.Second)
|
|
1378
|
+ //
|
|
1379
|
+ // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
|
1380
|
+ // redis.Set(keyOne, "", time.Second)
|
|
1381
|
+ // defer redis.Close()
|
|
1382
|
+ // fmt.Println(getNurseErr)
|
|
1383
|
+ //}
|
|
1384
|
+ //if evaluation.PulseFrequency == 0 {
|
|
1385
|
+ // evaluation.PulseFrequency = fmonitorRecords.PulseFrequency
|
|
1386
|
+ // press := models.PredialysisEvaluation{
|
|
1387
|
+ // PulseFrequency: evaluation.PulseFrequency,
|
|
1388
|
+ // }
|
|
1389
|
+ // getNurseErr := service.UpdatePredialysisEvaluationThree(&press, evaluation.ID)
|
|
1390
|
+ // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
|
1391
|
+ //
|
|
1392
|
+ // redis := service.RedisClient()
|
|
1393
|
+ // redis.Set(key, "", time.Second)
|
|
1394
|
+ // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
|
1395
|
+ // redis.Set(keyOne, "", time.Second)
|
|
1396
|
+ // defer redis.Close()
|
|
1397
|
+ // fmt.Println(getNurseErr)
|
|
1398
|
+ //}
|
|
1399
|
+ //
|
|
1400
|
+ //if evaluation.Temperature == 0 {
|
|
1401
|
+ // evaluation.Temperature = fmonitorRecords.Temperature
|
|
1402
|
+ // press := models.PredialysisEvaluation{
|
|
1403
|
+ // Temperature: evaluation.Temperature,
|
|
1404
|
+ // }
|
|
1405
|
+ // getNurseErr := service.UpdatePredialysisEvaluationFour(&press, evaluation.ID)
|
|
1406
|
+ // key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
|
1407
|
+ //
|
|
1408
|
+ // redis := service.RedisClient()
|
|
1409
|
+ // redis.Set(key, "", time.Second)
|
|
1410
|
+ // keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
|
|
1411
|
+ // redis.Set(keyOne, "", time.Second)
|
|
1412
|
+ // defer redis.Close()
|
|
1413
|
+ // fmt.Println(getNurseErr)
|
|
1414
|
+ //}
|
|
1415
|
+ //
|
|
1416
|
+ if err != nil {
|
|
1417
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1418
|
+ return
|
|
1419
|
+ }
|
1422
|
1420
|
|
1423
|
|
- go func() {
|
1424
|
|
- ssoDomain := beego.AppConfig.String("call_domain")
|
1425
|
|
- api := ssoDomain + "/index/downpatient"
|
1426
|
|
- values := make(url.Values)
|
1427
|
|
- values.Set("org_id", strconv.FormatInt(adminUserInfo.CurrentOrgId, 10))
|
1428
|
|
- values.Set("admin_user_id", strconv.FormatInt(nurseID, 10))
|
1429
|
|
- values.Set("patient_id", strconv.FormatInt(patientID, 10))
|
1430
|
|
- http.PostForm(api, values)
|
1431
|
|
- }()
|
|
1421
|
+ go func() {
|
|
1422
|
+ ssoDomain := beego.AppConfig.String("call_domain")
|
|
1423
|
+ api := ssoDomain + "/index/downpatient"
|
|
1424
|
+ values := make(url.Values)
|
|
1425
|
+ values.Set("org_id", strconv.FormatInt(adminUserInfo.CurrentOrgId, 10))
|
|
1426
|
+ values.Set("admin_user_id", strconv.FormatInt(nurseID, 10))
|
|
1427
|
+ values.Set("patient_id", strconv.FormatInt(patientID, 10))
|
|
1428
|
+ http.PostForm(api, values)
|
|
1429
|
+ }()
|
1432
|
1430
|
|
1433
|
|
- //执行下机
|
1434
|
|
- updateErr := service.ModifyDialysisRecord(dialysisRecord.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id, puncture_point_haematoma, internal_fistula, catheter, cruor)
|
1435
|
|
- key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":dialysis_order"
|
1436
|
|
- redis := service.RedisClient()
|
1437
|
|
- defer redis.Close()
|
1438
|
|
- //清空key 值
|
1439
|
|
- redis.Set(key, "", time.Second)
|
|
1431
|
+ //执行下机
|
|
1432
|
+ updateErr := service.ModifyDialysisRecord(dialysisRecord.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id, puncture_point_haematoma, internal_fistula, catheter, cruor)
|
|
1433
|
+ key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":dialysis_order"
|
|
1434
|
+ redis := service.RedisClient()
|
|
1435
|
+ defer redis.Close()
|
|
1436
|
+ //清空key 值
|
|
1437
|
+ redis.Set(key, "", time.Second)
|
1440
|
1438
|
|
1441
|
|
- keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":dialysis_orders_list_all"
|
1442
|
|
- redis.Set(keyOne, "", time.Second)
|
|
1439
|
+ keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":dialysis_orders_list_all"
|
|
1440
|
+ redis.Set(keyOne, "", time.Second)
|
1443
|
1441
|
|
1444
|
|
- if updateErr != nil {
|
1445
|
|
- this.ErrorLog("下机失败:%v", updateErr)
|
1446
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1447
|
|
- return
|
1448
|
|
- } else {
|
1449
|
|
- dialysisRecord.Stage = 2
|
1450
|
|
- dialysisRecord.FinishNurse = nurseID
|
1451
|
|
- dialysisRecord.FinishCreator = adminUserInfo.AdminUser.Id
|
1452
|
|
- dialysisRecord.FinishModifier = adminUserInfo.AdminUser.Id
|
1453
|
|
- dialysisRecord.EndTime = endDate.Unix()
|
1454
|
|
- // 结束时候透析次数加1
|
1455
|
|
- service.UpdateSolutionByPatientId(patientID)
|
|
1442
|
+ if updateErr != nil {
|
|
1443
|
+ this.ErrorLog("下机失败:%v", updateErr)
|
|
1444
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1445
|
+ return
|
|
1446
|
+ } else {
|
|
1447
|
+ dialysisRecord.Stage = 2
|
|
1448
|
+ dialysisRecord.FinishNurse = nurseID
|
|
1449
|
+ dialysisRecord.FinishCreator = adminUserInfo.AdminUser.Id
|
|
1450
|
+ dialysisRecord.FinishModifier = adminUserInfo.AdminUser.Id
|
|
1451
|
+ dialysisRecord.EndTime = endDate.Unix()
|
|
1452
|
+ // 结束时候透析次数加1
|
|
1453
|
+ service.UpdateSolutionByPatientId(patientID)
|
1456
|
1454
|
|
1457
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
1458
|
|
- "dialysis_order": dialysisRecord,
|
1459
|
|
- "assessmentAfterDislysis": tempassessmentAfterDislysis,
|
1460
|
|
- })
|
1461
|
|
- }
|
|
1455
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1456
|
+ "dialysis_order": dialysisRecord,
|
|
1457
|
+ "assessmentAfterDislysis": tempassessmentAfterDislysis,
|
|
1458
|
+ })
|
1462
|
1459
|
}
|
|
1460
|
+
|
1463
|
1461
|
}
|
1464
|
1462
|
|
1465
|
1463
|
func (this *DialysisRecordAPIController) ModifyStartDialysis() {
|