XMLWAN vor 2 Jahren
Ursprung
Commit
af2b242bf1

+ 13 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go Datei anzeigen

@@ -297,6 +297,19 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
297 297
 			dialysisSolution, _ = service.MobileGetDialysisSolutionByModeIdSix(adminUserInfo.Org.Id, id, schedual.ModeId)
298 298
 			system_dialysisPrescribe, _ = service.MobileGetSystemDialysisPrescribeByModeIdSix(adminUserInfo.Org.Id, schedual.ModeId)
299 299
 			lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeIdSix(adminUserInfo.Org.Id, id, schedual.ModeId)
300
+
301
+			//判断透析模式,针对河间咸的
302
+			if adminUserInfo.Org.Id == 10090 {
303
+				if dialysisSolution.ModeId != 2 && dialysisSolution.ModeId != 5 && dialysisSolution.ModeId != 12 {
304
+					dialysisSolution.DisplaceLiquiPart = 0
305
+					dialysisSolution.DisplaceLiquiValue = 0
306
+				}
307
+				if lastDialysisPrescribe.ModeId != 2 && lastDialysisPrescribe.ModeId != 5 && lastDialysisPrescribe.ModeId != 12 {
308
+					dialysisSolution.DisplaceLiquiPart = 0
309
+					dialysisSolution.DisplaceLiquiValue = 0
310
+				}
311
+			}
312
+
300 313
 			mode_id = schedual.ModeId
301 314
 		} else {
302 315
 			// 获取透析模版

+ 103 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Datei anzeigen

@@ -87,7 +87,7 @@ func (this *DialysisAPIController) Scheduals() {
87 87
 	defer redis.Close()
88 88
 
89 89
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
90
-
90
+	fmt.Println("key22332323232232323", key)
91 91
 	scheduals_json_str, _ := redis.Get(key).Result()
92 92
 	redis.Set(key, "", time.Second)
93 93
 	patients, _ := service.GetAllPatientListSix(orgID)
@@ -1535,6 +1535,17 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1535 1535
 		}
1536 1536
 
1537 1537
 		prescription.Creater = adminUserInfo.AdminUser.Id
1538
+
1539
+		//针对河间咸得
1540
+		if adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 10090 || adminUserInfo.Org.Id == 3877 {
1541
+
1542
+			if prescription.ModeId != 2 && prescription.ModeId != 5 && prescription.ModeId != 12 {
1543
+
1544
+				prescription.DisplaceLiquiPart = 0
1545
+				prescription.DisplaceLiquiValue = 0
1546
+			}
1547
+		}
1548
+
1538 1549
 		err := service.AddSigleRecord(&prescription)
1539 1550
 
1540 1551
 		//获取key,清空redis
@@ -2721,6 +2732,21 @@ func (c *DialysisAPIController) PostSolution() {
2721 2732
 		MaxUltrafiltrationRate:     max_ultrafiltration_rate,
2722 2733
 		PreImpulse:                 impulse,
2723 2734
 	}
2735
+
2736
+	//针对河间咸的
2737
+	if adminUserInfo.Org.Id == 10090 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 3877 {
2738
+
2739
+		if solution.ModeId != 2 && solution.ModeId != 5 && solution.ModeId != 12 {
2740
+			solution.DisplaceLiquiPart = 0
2741
+			solution.DisplaceLiquiValue = 0
2742
+		}
2743
+
2744
+		if prescription.ModeId != 2 && prescription.ModeId != 5 && prescription.ModeId != 12 {
2745
+			prescription.DisplaceLiquiPart = 0
2746
+			prescription.DisplaceLiquiValue = 0
2747
+		}
2748
+	}
2749
+
2724 2750
 	service.SavePrescriptionAndCreateSolution(&solution, &prescription)
2725 2751
 
2726 2752
 	//获取key,清空redis
@@ -5924,3 +5950,79 @@ func (this *DialysisAPIController) GetRoleList() {
5924 5950
 	})
5925 5951
 	return
5926 5952
 }
5953
+
5954
+func (this *DialysisAPIController) SavePatientSign() {
5955
+
5956
+	adminUserInfo := this.GetMobileAdminUserInfo()
5957
+	patient_id, _ := this.GetInt64("patient_id")
5958
+	dialysis_date, _ := this.GetInt64("dialysis_date")
5959
+	orgid := adminUserInfo.Org.Id
5960
+
5961
+	var esdata models.DialysisOrder
5962
+	var err error
5963
+	if err = json.Unmarshal(this.Ctx.Input.RequestBody, &esdata); err != nil {
5964
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5965
+		return
5966
+	}
5967
+
5968
+	esdata.Hash = esdata.Hash
5969
+	esdata.Url = beego.AppConfig.String("qiniu_domain") + esdata.Hash
5970
+
5971
+	order := models.DialysisOrder{
5972
+		Hash: esdata.Hash,
5973
+		Url:  esdata.Url,
5974
+	}
5975
+	err = service.UpdatePatientSign(patient_id, dialysis_date, order, orgid)
5976
+	redis := service.RedisClient()
5977
+
5978
+	key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":dialysis_order"
5979
+	redis.Set(key, "", time.Second)
5980
+	keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":dialysis_orders_list_all"
5981
+
5982
+	//清空key 值
5983
+	redis.Set(keyOne, "", time.Second)
5984
+	//scheduleDateStartOne := startDate.Format("2006-01-02")
5985
+	//keyTwo := "scheduals_" + scheduleDateStartOne + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
5986
+
5987
+	//redis.Set(keyTwo, "", time.Second)
5988
+
5989
+	keyThree := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":doctor_advices"
5990
+	redis.Set(keyThree, "", time.Second)
5991
+	keyFour := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":monitor_records"
5992
+	redis.Set(keyFour, "", time.Second)
5993
+
5994
+	keyFive := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":patient_info"
5995
+	redis.Set(keyFive, "", time.Second)
5996
+
5997
+	keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":his_doctor_advice"
5998
+	redis.Set(keySix, "", time.Second)
5999
+
6000
+	keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + ":device_list_all"
6001
+	redis.Set(keySeven, "", time.Second)
6002
+	if err != nil {
6003
+		fmt.Println(err)
6004
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
6005
+		return
6006
+	}
6007
+	this.ServeSuccessJSON(map[string]interface{}{
6008
+		"electronic_signature": esdata,
6009
+	})
6010
+}
6011
+
6012
+func (this *DialysisAPIController) GetPatientSign() {
6013
+
6014
+	patient_id, _ := this.GetInt64("patient_id")
6015
+
6016
+	dialysis_date, _ := this.GetInt64("dialysis_date")
6017
+	adminUserInfo := this.GetMobileAdminUserInfo()
6018
+	orgId := adminUserInfo.Org.Id
6019
+	dialysisOrder, err := service.GetPatientSign(patient_id, dialysis_date, orgId)
6020
+	if err != nil {
6021
+		fmt.Println(err)
6022
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
6023
+		return
6024
+	}
6025
+	this.ServeSuccessJSON(map[string]interface{}{
6026
+		"dialysisOrder": dialysisOrder,
6027
+	})
6028
+}

+ 3 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Datei anzeigen

@@ -168,4 +168,7 @@ func MobileAPIControllersRegisterRouters() {
168 168
 
169 169
 	beego.Router("/m/api/getrolelist", &DialysisAPIController{}, "Get:GetRoleList")
170 170
 
171
+	beego.Router("/m/api/savepatientsign", &DialysisAPIController{}, "Post:SavePatientSign")
172
+	beego.Router("/m/api/getpatientsign", &DialysisAPIController{}, "Get:GetPatientSign")
173
+
171 174
 }