XMLWAN 2 years ago
parent
commit
9f196d066d

+ 5 - 3
controllers/data_api_controller.go View File

@@ -1411,16 +1411,18 @@ func (this *DataApiController) ModifyTemplateName() {
1411 1411
 func (this *DataApiController) ModifyFiledIsShow() {
1412 1412
 	id, _ := this.GetInt64("id", 0)
1413 1413
 	is_show, _ := this.GetInt("is_show", 0)
1414
+	is_write, _ := this.GetInt("is_write", 0)
1414 1415
 	adminUserInfo := this.GetAdminUserInfo()
1415
-	err := service.ShowFiledConfig(adminUserInfo.CurrentOrgId, is_show, id)
1416
+	err := service.ShowFiledConfig(adminUserInfo.CurrentOrgId, is_show, is_write, id)
1416 1417
 	if err != nil {
1417 1418
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
1418 1419
 		return
1419 1420
 	} else {
1420 1421
 
1421 1422
 		this.ServeSuccessJSON(map[string]interface{}{
1422
-			"id":      id,
1423
-			"is_show": is_show,
1423
+			"id":       id,
1424
+			"is_show":  is_show,
1425
+			"is_write": is_write,
1424 1426
 		})
1425 1427
 	}
1426 1428
 }

+ 3 - 0
controllers/dialysis_api_controller.go View File

@@ -1448,6 +1448,8 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1448 1448
 	blood_pressure_during_dialysis := c.GetString("blood_pressure_during_dialysis")
1449 1449
 	urea_befor := c.GetString("urea_befor")
1450 1450
 	suction := c.GetString("suction")
1451
+	weight_befor_remake := c.GetString("weight_befor_remake")
1452
+
1451 1453
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1452 1454
 		DialysisCount:                  dialysis_count,
1453 1455
 		EmergencyTreatment:             emergency_treatment,
@@ -1516,6 +1518,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1516 1518
 		BloodPressureDuringDialysis:    blood_pressure_during_dialysis,
1517 1519
 		UreaBefor:                      urea_befor,
1518 1520
 		Suction:                        suction,
1521
+		WeightBeforRemake:              weight_befor_remake,
1519 1522
 	}
1520 1523
 
1521 1524
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 73 - 66
controllers/dialysis_record_api_controller.go View File

@@ -1259,6 +1259,13 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1259 1259
 		tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
1260 1260
 		tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
1261 1261
 		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
1262
+		//长沙南雅
1263
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10340 {
1264
+			//获取最后一条透析处方数据
1265
+			prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1266
+			evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1267
+			tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration
1268
+		}
1262 1269
 		if adminUserInfo.CurrentOrgId == 10101 {
1263 1270
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1264 1271
 		} else {
@@ -1348,72 +1355,72 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1348 1355
 
1349 1356
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
1350 1357
 
1351
-	//evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1352
-	//if evaluation.SystolicBloodPressure == 0 {
1353
-	//	evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
1354
-	//
1355
-	//	pre := models.PredialysisEvaluation{
1356
-	//		SystolicBloodPressure: evaluation.SystolicBloodPressure,
1357
-	//	}
1358
-	//	fmt.Println("prew", pre)
1359
-	//	getNurseErr := service.UpdatePredialysisEvaluation(&pre, evaluation.ID)
1360
-	//	key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1361
-	//	keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1362
-	//
1363
-	//	redis := service.RedisClient()
1364
-	//	redis.Set(key, "", time.Second)
1365
-	//	redis.Set(keyOne, "", time.Second)
1366
-	//	defer redis.Close()
1367
-	//	fmt.Println(getNurseErr)
1368
-	//}
1369
-	//if evaluation.DiastolicBloodPressure == 0 {
1370
-	//	evaluation.DiastolicBloodPressure = fmonitorRecords.DiastolicBloodPressure
1371
-	//	pres := models.PredialysisEvaluation{
1372
-	//		DiastolicBloodPressure: evaluation.DiastolicBloodPressure,
1373
-	//	}
1374
-	//	getNurseErr := service.UpdatePredialysisEvaluationTwo(&pres, evaluation.ID)
1375
-	//	key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1376
-	//
1377
-	//	redis := service.RedisClient()
1378
-	//	redis.Set(key, "", time.Second)
1379
-	//
1380
-	//	keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1381
-	//	redis.Set(keyOne, "", time.Second)
1382
-	//	defer redis.Close()
1383
-	//	fmt.Println(getNurseErr)
1384
-	//}
1385
-	//if evaluation.PulseFrequency == 0 {
1386
-	//	evaluation.PulseFrequency = fmonitorRecords.PulseFrequency
1387
-	//	press := models.PredialysisEvaluation{
1388
-	//		PulseFrequency: evaluation.PulseFrequency,
1389
-	//	}
1390
-	//	getNurseErr := service.UpdatePredialysisEvaluationThree(&press, evaluation.ID)
1391
-	//	key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1392
-	//
1393
-	//	redis := service.RedisClient()
1394
-	//	redis.Set(key, "", time.Second)
1395
-	//	keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1396
-	//	redis.Set(keyOne, "", time.Second)
1397
-	//	defer redis.Close()
1398
-	//	fmt.Println(getNurseErr)
1399
-	//}
1400
-	//
1401
-	//if evaluation.Temperature == 0 {
1402
-	//	evaluation.Temperature = fmonitorRecords.Temperature
1403
-	//	press := models.PredialysisEvaluation{
1404
-	//		Temperature: evaluation.Temperature,
1405
-	//	}
1406
-	//	getNurseErr := service.UpdatePredialysisEvaluationFour(&press, evaluation.ID)
1407
-	//	key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1408
-	//
1409
-	//	redis := service.RedisClient()
1410
-	//	redis.Set(key, "", time.Second)
1411
-	//	keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1412
-	//	redis.Set(keyOne, "", time.Second)
1413
-	//	defer redis.Close()
1414
-	//	fmt.Println(getNurseErr)
1415
-	//}
1416
-	//
1358
+	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 {
1359
+		fmt.Println("进来2332233333333333333333333333333333333我的")
1360
+		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1361
+		if evaluation.SystolicBloodPressure == 0 {
1362
+			pre := models.PredialysisEvaluation{
1363
+				SystolicBloodPressure: fmonitorRecords.SystolicBloodPressure,
1364
+			}
1365
+			fmt.Println("prew", pre)
1366
+			getNurseErr := service.UpdatePredialysisEvaluation(&pre, evaluation.ID)
1367
+			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1368
+			keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1369
+
1370
+			redis := service.RedisClient()
1371
+			redis.Set(key, "", time.Second)
1372
+			redis.Set(keyOne, "", time.Second)
1373
+			defer redis.Close()
1374
+			fmt.Println(getNurseErr)
1375
+		}
1376
+		if evaluation.DiastolicBloodPressure == 0 {
1377
+			pres := models.PredialysisEvaluation{
1378
+				DiastolicBloodPressure: fmonitorRecords.DiastolicBloodPressure,
1379
+			}
1380
+			getNurseErr := service.UpdatePredialysisEvaluationTwo(&pres, evaluation.ID)
1381
+			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1382
+
1383
+			redis := service.RedisClient()
1384
+			redis.Set(key, "", time.Second)
1385
+
1386
+			keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1387
+			redis.Set(keyOne, "", time.Second)
1388
+			defer redis.Close()
1389
+			fmt.Println(getNurseErr)
1390
+		}
1391
+		if evaluation.PulseFrequency == 0 {
1392
+			evaluation.PulseFrequency = fmonitorRecords.PulseFrequency
1393
+			press := models.PredialysisEvaluation{
1394
+				PulseFrequency: evaluation.PulseFrequency,
1395
+			}
1396
+			getNurseErr := service.UpdatePredialysisEvaluationThree(&press, evaluation.ID)
1397
+			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1398
+
1399
+			redis := service.RedisClient()
1400
+			redis.Set(key, "", time.Second)
1401
+			keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1402
+			redis.Set(keyOne, "", time.Second)
1403
+			defer redis.Close()
1404
+			fmt.Println(getNurseErr)
1405
+		}
1406
+
1407
+		if evaluation.Temperature == 0 {
1408
+			evaluation.Temperature = fmonitorRecords.Temperature
1409
+			press := models.PredialysisEvaluation{
1410
+				Temperature: evaluation.Temperature,
1411
+			}
1412
+			getNurseErr := service.UpdatePredialysisEvaluationFour(&press, evaluation.ID)
1413
+			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1414
+
1415
+			redis := service.RedisClient()
1416
+			redis.Set(key, "", time.Second)
1417
+			keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_befores_list_all"
1418
+			redis.Set(keyOne, "", time.Second)
1419
+			defer redis.Close()
1420
+			fmt.Println(getNurseErr)
1421
+		}
1422
+	}
1423
+
1417 1424
 	if err != nil {
1418 1425
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1419 1426
 		return

+ 10 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -412,6 +412,7 @@ func (this *DialysisAPIController) DialysisRecord() {
412 412
 
413 413
 	go func() {
414 414
 		doctorAdvices, _ = service.MobileGetDoctorAdvicesByGroups(adminInfo.Org.Id, patientID, date.Unix())
415
+
415 416
 		ch <- struct{}{}
416 417
 	}()
417 418
 
@@ -573,7 +574,7 @@ func (this *DialysisAPIController) DialysisRecord() {
573 574
 	if is_advice_open.IsAdviceOpen == 1 {
574 575
 		his_advices, _ = service.GetAllHisDoctorAdvice(adminInfo.Org.Id, patientID, date.Unix())
575 576
 	}
576
-
577
+	fmt.Println("doctorAdvices23344334344433434334343434wode", doctorAdvices)
577 578
 	returnData := map[string]interface{}{
578 579
 		"patient":                        patient,
579 580
 		"schedual":                       schedual,
@@ -1756,6 +1757,14 @@ func (c *DialysisAPIController) Finish() {
1756 1757
 		tempassessmentAfterDislysis.UserOrgId = adminUserInfo.Org.Id
1757 1758
 	}
1758 1759
 
1760
+	//长沙南雅
1761
+	if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10340 {
1762
+		//获取最后一条透析处方数据
1763
+		prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1764
+		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1765
+		tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration
1766
+	}
1767
+
1759 1768
 	if dialysisOrder.Stage == 1 {
1760 1769
 		temp_time := (float64(endDate.Unix()) - float64(dialysisOrder.StartTime)) / 3600
1761 1770
 		value, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", temp_time), 64)

+ 6 - 1
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2740,6 +2740,11 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2740 2740
 
2741 2741
 		evaluation.Suction = suction
2742 2742
 	}
2743
+	if dataBody["weight_befor_remake"] != nil && reflect.TypeOf(dataBody["weight_befor_remake"]).String() == "string" {
2744
+		weight_befor_remake := dataBody["weight_befor_remake"].(string)
2745
+
2746
+		evaluation.WeightBeforRemake = weight_befor_remake
2747
+	}
2743 2748
 	return
2744 2749
 }
2745 2750
 
@@ -3357,7 +3362,7 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
3357 3362
 
3358 3363
 	//临时医嘱
3359 3364
 	DoctorAdvice, _ := service.FindDoctorAdviceOrderById(adminUserInfo.Org.Id, patientInfo.ID, xttime)
3360
-
3365
+	fmt.Println("DoctorAdvice3223323323232323223323323223332232332wode", DoctorAdvice)
3361 3366
 	hisAdvice, err := service.GetHisDoctorPatientById(adminUserInfo.Org.Id, patientInfo.ID, xttime)
3362 3367
 	config, err := service.GetHisDoctorConfig(adminUserInfo.Org.Id)
3363 3368
 

+ 1 - 0
models/data_models.go View File

@@ -152,6 +152,7 @@ type FiledConfig struct {
152 152
 	CreateTime  int64  `gorm:"column:create_time" json:"create_time"`
153 153
 	UpdateTime  int64  `gorm:"column:update_time" json:"update_time"`
154 154
 	SysModule   int64  `gorm:"column:sys_module" json:"sys_module" form:"sys_module"`
155
+	IsWrite     int64  `gorm:"column:is_write" json:"is_write" form:"is_write"`
155 156
 }
156 157
 
157 158
 func (FiledConfig) TableName() string {

+ 1 - 1
models/device_models.go View File

@@ -107,9 +107,9 @@ type DeviceZone struct {
107 107
 	OrgID      int64  `gorm:"column:org_id" json:"-"`
108 108
 	Name       string `json:"name"`
109 109
 	Type       int    `json:"type"`
110
-	Status     int8   `json:"-"`
111 110
 	CreateTime int64  `gorm:"column:ctime" json:"-"`
112 111
 	ModifyTime int64  `gorm:"column:mtime" json:"-"`
112
+	Status     int64  `gorm:"column:status" json:"status" form:"status"`
113 113
 }
114 114
 
115 115
 func (DeviceZone) TableName() string {

+ 1 - 0
models/dialysis.go View File

@@ -320,6 +320,7 @@ type PredialysisEvaluation struct {
320 320
 	BloodPressureDuringDialysis    string  `gorm:"column:blood_pressure_during_dialysis" json:"blood_pressure_during_dialysis" form:"blood_pressure_during_dialysis"`
321 321
 	UreaBefor                      string  `gorm:"column:urea_befor" json:"urea_befor" form:"urea_befor"`
322 322
 	Suction                        string  `gorm:"column:suction" json:"suction" form:"suction"`
323
+	WeightBeforRemake              string  `gorm:"column:weight_befor_remake" json:"weight_befor_remake" form:"weight_befor_remake"`
323 324
 }
324 325
 
325 326
 func (PredialysisEvaluation) TableName() string {