Browse Source

Merge branch 'master' of http://git.shengws.com/csx/XT_New into 20200710_xt_api_new_branch

csx 4 years ago
parent
commit
8b64e1946f

+ 7 - 10
controllers/base_api_controller.go View File

4
 	"XT_New/enums"
4
 	"XT_New/enums"
5
 	"XT_New/models"
5
 	"XT_New/models"
6
 
6
 
7
+	//"XT_New/models"
8
+
7
 	//"XT_New/models"
9
 	//"XT_New/models"
8
 	"XT_New/service"
10
 	"XT_New/service"
9
 	"fmt"
11
 	"fmt"
97
 
99
 
98
 		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
100
 		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
99
 		//this.StopRun()
101
 		//this.StopRun()
102
+
100
 	}
103
 	}
101
 
104
 
102
 	adminUserInfo := this.GetAdminUserInfo()
105
 	adminUserInfo := this.GetAdminUserInfo()
136
 			allPermission, _ := service.GetAllFunctionPurview()
139
 			allPermission, _ := service.GetAllFunctionPurview()
137
 
140
 
138
 			for _, item := range allPermission {
141
 			for _, item := range allPermission {
139
-				fmt.Println(len(strings.Split(item.Urlfor, ",")))
142
+				// fmt.Println(len(strings.Split(item.Urlfor, ",")))
140
 
143
 
141
-				fmt.Println(strings.Split(item.Urlfor, ","))
144
+				// fmt.Println(strings.Split(item.Urlfor, ","))
142
 				//fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
145
 				//fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
143
 
146
 
144
 				//判断当前路由是否在权限路由列表里面
147
 				//判断当前路由是否在权限路由列表里面
147
 					//获取该角色的所有权限
150
 					//获取该角色的所有权限
148
 					for _, items := range userRolePurviewsArr {
151
 					for _, items := range userRolePurviewsArr {
149
 						id, _ := strconv.ParseInt(items, 10, 64)
152
 						id, _ := strconv.ParseInt(items, 10, 64)
150
-						fmt.Println(id)
151
-						fmt.Println(item.ID)
152
-
153
 						if id == item.ID {
153
 						if id == item.ID {
154
 							isPermission = true
154
 							isPermission = true
155
 						}
155
 						}
204
 			allPermission, _ := service.GetAllFunctionPurview()
204
 			allPermission, _ := service.GetAllFunctionPurview()
205
 
205
 
206
 			for _, item := range allPermission {
206
 			for _, item := range allPermission {
207
-				fmt.Println(strings.Split(item.Urlfor, ",")[2])
208
-				fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
207
+				// fmt.Println(strings.Split(item.Urlfor, ",")[2])
208
+				// fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
209
 
209
 
210
 				//判断当前路由是否在权限路由列表里面
210
 				//判断当前路由是否在权限路由列表里面
211
 				if strings.Split(item.Urlfor, ",")[2] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {
211
 				if strings.Split(item.Urlfor, ",")[2] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {
213
 					//获取该角色的所有权限
213
 					//获取该角色的所有权限
214
 					for _, items := range userRolePurviewsArr {
214
 					for _, items := range userRolePurviewsArr {
215
 						id, _ := strconv.ParseInt(items, 10, 64)
215
 						id, _ := strconv.ParseInt(items, 10, 64)
216
-						fmt.Println(id)
217
-						fmt.Println(item.ID)
218
-
219
 						if id == item.ID {
216
 						if id == item.ID {
220
 							isPermission = true
217
 							isPermission = true
221
 						}
218
 						}

+ 9 - 16
controllers/data_api_controller.go View File

69
 	var dataconfig models.Dataconfig
69
 	var dataconfig models.Dataconfig
70
 	var resultConfig models.ConfigViewModel
70
 	var resultConfig models.ConfigViewModel
71
 	code := configFormData(&dataconfig, c.Ctx.Input.RequestBody)
71
 	code := configFormData(&dataconfig, c.Ctx.Input.RequestBody)
72
-	fmt.Println("code----------", code)
73
 	if code > 0 {
72
 	if code > 0 {
74
 		c.ServeFailJSONWithSGJErrorCode(code)
73
 		c.ServeFailJSONWithSGJErrorCode(code)
75
 		return
74
 		return
76
 	}
75
 	}
77
 	// 验证关键字段的值是否重复
76
 	// 验证关键字段的值是否重复
78
-	// if (dataconfig.Module == "education" || dataconfig.Module == "summary") {
79
-	// 	thisConfig,_:=service.FindConfigByTitle(dataconfig.Module, dataconfig.FieldName,dataconfig.OrgId)
80
-	// 	if thisConfig.ID >0 {
81
-	// 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeFieldExist)
82
-	// 		return
83
-	// 	}
84
-	// } else {
85
-	// 	thisConfig,_:=service.FindConfigByFieldname(dataconfig.Module, dataconfig.FieldName,dataconfig.OrgId)
86
-	// 	if thisConfig.ID >0 {
87
-	// 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeFieldExist)
88
-	// 		return
89
-	// 	}
90
-	// }
91
-	// fieldValue:=service.GetChildValue(dataconfig.Module, dataconfig.ParentId)
92
-	// dataconfig.Value = fieldValue+1
77
+
78
+	thisConfig, _ := service.FindConfigByTitle(dataconfig.Module, dataconfig.FieldName, adminUserInfo.CurrentOrgId)
79
+	if thisConfig.ID > 0 {
80
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeFieldExist)
81
+		return
82
+	}
83
+
84
+	fieldValue := service.GetChildValue(dataconfig.Module, dataconfig.ParentId, adminUserInfo.CurrentOrgId)
85
+	dataconfig.Value = fieldValue + 1
93
 
86
 
94
 	dataBody := make(map[string]interface{}, 0)
87
 	dataBody := make(map[string]interface{}, 0)
95
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
88
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)

+ 51 - 36
controllers/dialysis_api_controller.go View File

138
 	safe_package, _ := c.GetInt64("package", 0)
138
 	safe_package, _ := c.GetInt64("package", 0)
139
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
139
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
140
 
140
 
141
-	var prescription_doctor int64
141
+	// var prescription_doctor int64
142
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
142
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
143
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
143
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
144
 
144
 
155
 	//	}
155
 	//	}
156
 	//}
156
 	//}
157
 
157
 
158
-	if appRole.UserType == 2 || appRole.UserType == 1 {
159
-		prescription_doctor = appRole.AdminUserId
160
-	} else {
161
-		prescription_doctor = 0
162
-	}
163
-
164
 	prescription := models.DialysisPrescription{
158
 	prescription := models.DialysisPrescription{
165
 		UserOrgId:                 adminUserInfo.CurrentOrgId,
159
 		UserOrgId:                 adminUserInfo.CurrentOrgId,
166
 		PatientId:                 patient,
160
 		PatientId:                 patient,
190
 		DialysateTemperature:       dialysate_temperature,
184
 		DialysateTemperature:       dialysate_temperature,
191
 		Conductivity:               conductivity,
185
 		Conductivity:               conductivity,
192
 		Remark:                     remark,
186
 		Remark:                     remark,
193
-		PrescriptionDoctor:         prescription_doctor,
194
 		Status:                     1,
187
 		Status:                     1,
195
 		CreatedTime:                time.Now().Unix(),
188
 		CreatedTime:                time.Now().Unix(),
196
 		UpdatedTime:                time.Now().Unix(),
189
 		UpdatedTime:                time.Now().Unix(),
223
 		ALiquid:                    a_liquid,
216
 		ALiquid:                    a_liquid,
224
 	}
217
 	}
225
 
218
 
219
+	if appRole.UserType == 2 || appRole.UserType == 1 {
220
+		prescription.PrescriptionDoctor = appRole.AdminUserId
221
+	}
222
+
226
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
223
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
227
 	if dialysisPrescription.ID == 0 { //新增
224
 	if dialysisPrescription.ID == 0 { //新增
228
 		if mode_id > 0 {
225
 		if mode_id > 0 {
3069
 	assessment.CvcA = data.CvcA
3066
 	assessment.CvcA = data.CvcA
3070
 	assessment.CvcV = data.CvcV
3067
 	assessment.CvcV = data.CvcV
3071
 	assessment.Channel = data.Channel
3068
 	assessment.Channel = data.Channel
3069
+	assessment.ReturnBlood = data.ReturnBlood
3070
+	assessment.RehydrationVolume = data.RehydrationVolume
3071
+	assessment.DialysisDuring = data.DialysisDuring
3072
+	assessment.StrokeVolume = data.StrokeVolume
3073
+	assessment.BloodFlow = data.BloodFlow
3074
+	assessment.SealingFluidDispose = data.SealingFluidDispose
3075
+	assessment.SealingFluidSpecial = data.SealingFluidSpecial
3072
 
3076
 
3073
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
3077
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
3074
 
3078
 
3183
 	ductus_arantii_other := c.GetString("ductus_arantii_other")
3187
 	ductus_arantii_other := c.GetString("ductus_arantii_other")
3184
 	machine_type := c.GetString("machine_type")
3188
 	machine_type := c.GetString("machine_type")
3185
 	puncture_needle := c.GetString("puncture_needle")
3189
 	puncture_needle := c.GetString("puncture_needle")
3190
+	humor_excessive_symptom, _ := c.GetInt64("humor_excessive_symptom", 0)
3186
 
3191
 
3187
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
3192
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
3188
 		DialysisCount:                  dialysis_count,
3193
 		DialysisCount:                  dialysis_count,
3233
 		DuctusArantiiOther:             ductus_arantii_other,
3238
 		DuctusArantiiOther:             ductus_arantii_other,
3234
 		MachineType:                    machine_type,
3239
 		MachineType:                    machine_type,
3235
 		PunctureNeedle:                 puncture_needle,
3240
 		PunctureNeedle:                 puncture_needle,
3241
+		HumorExcessiveSymptom:          humor_excessive_symptom,
3236
 	}
3242
 	}
3237
 
3243
 
3238
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
3244
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
3308
 		var mode_id int64
3314
 		var mode_id int64
3309
 		if schedual != nil {
3315
 		if schedual != nil {
3310
 			dialysisPrescribe, _ = service.MobileGetDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, recordDate.Unix(), schedual.ModeId)
3316
 			dialysisPrescribe, _ = service.MobileGetDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, recordDate.Unix(), schedual.ModeId)
3317
+			if dialysisPrescribe == nil {
3318
+				dialysisPrescribe, _ = service.MobileGetDialysisPrescribe(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
3319
+			}
3311
 			lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
3320
 			lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
3312
 			// 获取透析模版
3321
 			// 获取透析模版
3313
 			dialysisSolution, _ = service.MobileGetDialysisSolutionByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
3322
 			dialysisSolution, _ = service.MobileGetDialysisSolutionByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
3948
 	displacement_flow_quantity, _ := c.GetFloat("displacement_flow_quantity", 0)
3957
 	displacement_flow_quantity, _ := c.GetFloat("displacement_flow_quantity", 0)
3949
 
3958
 
3950
 	heparin, _ := c.GetFloat("heparin", 0)
3959
 	heparin, _ := c.GetFloat("heparin", 0)
3960
+	dialysate_flow, _ := c.GetFloat("dialysate_flow", 0)
3951
 
3961
 
3952
 	ktv, _ := c.GetFloat("ktv", 0)
3962
 	ktv, _ := c.GetFloat("ktv", 0)
3953
 	symptom := c.GetString("symptom")
3963
 	symptom := c.GetString("symptom")
4005
 		Conductivity:              conductivity,
4015
 		Conductivity:              conductivity,
4006
 		DisplacementFlowQuantity:  displacement_flow_quantity,
4016
 		DisplacementFlowQuantity:  displacement_flow_quantity,
4007
 		Heparin:                   heparin,
4017
 		Heparin:                   heparin,
4018
+		DialysateFlow:             dialysate_flow,
4008
 	}
4019
 	}
4009
 
4020
 
4010
 	err := service.CreateMonitor(&monitorRecord)
4021
 	err := service.CreateMonitor(&monitorRecord)
4296
 	if AssessmentAfterDislysis.Modifier > 0 {
4307
 	if AssessmentAfterDislysis.Modifier > 0 {
4297
 		operatorIDs = append(operatorIDs, AssessmentAfterDislysis.Modifier)
4308
 		operatorIDs = append(operatorIDs, AssessmentAfterDislysis.Modifier)
4298
 	}
4309
 	}
4310
+	//上次透前评估
4311
+	lastPredialysisEvaluation, _ := service.GetLastTimePredialysisEvaluation(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4312
+
4299
 	//透析处方
4313
 	//透析处方
4300
 	dialysisPrescription, _ := service.FindPatientPrescribeWidyDevideById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4314
 	dialysisPrescription, _ := service.FindPatientPrescribeWidyDevideById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4301
 	if dialysisPrescription.PrescriptionDoctor > 0 {
4315
 	if dialysisPrescription.PrescriptionDoctor > 0 {
4358
 	operators, err := service.GetAdminUserEsOne(adminUserInfo.CurrentOrgId)
4372
 	operators, err := service.GetAdminUserEsOne(adminUserInfo.CurrentOrgId)
4359
 	templateInfo, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
4373
 	templateInfo, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
4360
 	c.ServeSuccessJSON(map[string]interface{}{
4374
 	c.ServeSuccessJSON(map[string]interface{}{
4361
-		"xtdate":                  xtdate,
4362
-		"users":                   adminUser,
4363
-		"patientInfo":             patientInfo,
4364
-		"PredialysisEvaluation":   PredialysisEvaluation,
4365
-		"AssessmentAfterDislysis": AssessmentAfterDislysis,
4366
-		"dialysisPrescription":    dialysisPrescription,
4367
-		"advices":                 DoctorAdvice,
4368
-		"monitors":                Record,
4369
-		"summary":                 TreatmentSummary,
4370
-		"receiverTreatmentAccess": receiverTreatmentAccess,
4371
-		"dialysisOrder":           dialysisOrder,
4372
-		"operators":               operators,
4373
-		"org_template_info":       templateInfo,
4374
-		"check":                   check,
4375
-		"schedule":                schedule,
4376
-		"dialysisway":             dialysisway,
4377
-		"order":                   order,
4378
-		"doctorAdvice":            doctorAdvice,
4379
-		"doctor":                  doctor,
4380
-		"nurse":                   nurse,
4381
-		"doctorAdevieInfo":        doctorAdevieInfo,
4382
-		"total":                   total,
4383
-		"startNuse":               startNuse,
4384
-		"DoctorName":              DoctorName,
4385
-		"monitor":                 monitor,
4386
-		"assessmentAfterDislysis": assessmentAfterDislysis,
4387
-		"predialysName":           predialysName,
4388
-		"FinishNuse":              FinishNuse,
4375
+		"xtdate":                    xtdate,
4376
+		"users":                     adminUser,
4377
+		"patientInfo":               patientInfo,
4378
+		"PredialysisEvaluation":     PredialysisEvaluation,
4379
+		"AssessmentAfterDislysis":   AssessmentAfterDislysis,
4380
+		"dialysisPrescription":      dialysisPrescription,
4381
+		"advices":                   DoctorAdvice,
4382
+		"monitors":                  Record,
4383
+		"summary":                   TreatmentSummary,
4384
+		"receiverTreatmentAccess":   receiverTreatmentAccess,
4385
+		"dialysisOrder":             dialysisOrder,
4386
+		"operators":                 operators,
4387
+		"org_template_info":         templateInfo,
4388
+		"check":                     check,
4389
+		"schedule":                  schedule,
4390
+		"dialysisway":               dialysisway,
4391
+		"order":                     order,
4392
+		"doctorAdvice":              doctorAdvice,
4393
+		"doctor":                    doctor,
4394
+		"nurse":                     nurse,
4395
+		"doctorAdevieInfo":          doctorAdevieInfo,
4396
+		"total":                     total,
4397
+		"startNuse":                 startNuse,
4398
+		"DoctorName":                DoctorName,
4399
+		"monitor":                   monitor,
4400
+		"assessmentAfterDislysis":   assessmentAfterDislysis,
4401
+		"predialysName":             predialysName,
4402
+		"FinishNuse":                FinishNuse,
4403
+		"lastPredialysisEvaluation": lastPredialysisEvaluation,
4389
 	})
4404
 	})
4390
 
4405
 
4391
 }
4406
 }

+ 3 - 0
controllers/dialysis_record_api_controller.go View File

392
 	DisplacementFlowQuantity float64 `json:"displacement_flow_quantity"`
392
 	DisplacementFlowQuantity float64 `json:"displacement_flow_quantity"`
393
 	BloodOxygenSaturation    string  `gorm:"column:blood_oxygen_saturation" json:"blood_oxygen_saturation" form:"blood_oxygen_saturation"`
393
 	BloodOxygenSaturation    string  `gorm:"column:blood_oxygen_saturation" json:"blood_oxygen_saturation" form:"blood_oxygen_saturation"`
394
 	Heparin                  float64 `gorm:"column:heparin" json:"heparin" form:"heparin"`
394
 	Heparin                  float64 `gorm:"column:heparin" json:"heparin" form:"heparin"`
395
+	DialysateFlow            float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
395
 }
396
 }
396
 
397
 
397
 // /api/dislysis/monitor/edit [post]
398
 // /api/dislysis/monitor/edit [post]
496
 			BloodOxygenSaturation: monitorParam.BloodOxygenSaturation,
497
 			BloodOxygenSaturation: monitorParam.BloodOxygenSaturation,
497
 			Creator:               adminUserInfo.AdminUser.Id,
498
 			Creator:               adminUserInfo.AdminUser.Id,
498
 			Heparin:               monitorParam.Heparin,
499
 			Heparin:               monitorParam.Heparin,
500
+			DialysateFlow:         monitorParam.DialysateFlow,
499
 		}
501
 		}
500
 		createErr := service.CreateMonitor(&monitor)
502
 		createErr := service.CreateMonitor(&monitor)
501
 		if createErr != nil {
503
 		if createErr != nil {
556
 		monitor.Modify = adminUserInfo.AdminUser.Id
558
 		monitor.Modify = adminUserInfo.AdminUser.Id
557
 		monitor.BloodOxygenSaturation = monitorParam.BloodOxygenSaturation
559
 		monitor.BloodOxygenSaturation = monitorParam.BloodOxygenSaturation
558
 		monitor.Heparin = monitorParam.Heparin
560
 		monitor.Heparin = monitorParam.Heparin
561
+		monitor.DialysateFlow = monitorParam.DialysateFlow
559
 		updateErr := service.UpdateMonitor(monitor)
562
 		updateErr := service.UpdateMonitor(monitor)
560
 		if updateErr != nil {
563
 		if updateErr != nil {
561
 			this.ErrorLog("修改透析监测记录失败:%v", updateErr)
564
 			this.ErrorLog("修改透析监测记录失败:%v", updateErr)

+ 5 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go View File

196
 			// 获取干体重,先从干体重配置里去读,如果没有,则读取上一次透前评估的干体重
196
 			// 获取干体重,先从干体重配置里去读,如果没有,则读取上一次透前评估的干体重
197
 			weight, err := service.FindLastDryWeightAdjust(adminUserInfo.Org.Id, id)
197
 			weight, err := service.FindLastDryWeightAdjust(adminUserInfo.Org.Id, id)
198
 			if err == gorm.ErrRecordNotFound {
198
 			if err == gorm.ErrRecordNotFound {
199
-				evaluation.DryWeight = lastPredialysisEvaluation.DryWeight
199
+				if lastPredialysisEvaluation != nil {
200
+					evaluation.DryWeight = lastPredialysisEvaluation.DryWeight
201
+				} else {
202
+					evaluation.DryWeight = 0
203
+				}
200
 			} else {
204
 			} else {
201
 				evaluation.DryWeight = weight.DryWeight
205
 				evaluation.DryWeight = weight.DryWeight
202
 			}
206
 			}

+ 19 - 7
controllers/mobile_api_controllers/dialysis_api_controller.go View File

799
 	cvc_a, _ := c.GetFloat("cvc_a", 0)
799
 	cvc_a, _ := c.GetFloat("cvc_a", 0)
800
 	cvc_v, _ := c.GetFloat("cvc_v", 0)
800
 	cvc_v, _ := c.GetFloat("cvc_v", 0)
801
 	channels, _ := c.GetInt64("channel", 0)
801
 	channels, _ := c.GetInt64("channel", 0)
802
+	return_blood, _ := c.GetInt64("return_blood", 0)
803
+	rehydration_volume, _ := c.GetInt64("rehydration_volume", 0)
804
+	dialysis_during, _ := c.GetInt64("dialysis_during", 0)
805
+	stroke_volume, _ := c.GetInt64("stroke_volume", 0)
806
+	blood_flow, _ := c.GetInt64("blood_flow", 0)
807
+	sealing_fluid_dispose, _ := c.GetInt64("sealing_fluid_dispose", 0)
808
+	sealing_fluid_special := c.GetString("sealing_fluid_special")
802
 
809
 
803
 	if id <= 0 {
810
 	if id <= 0 {
804
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
811
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
879
 		CvcA:                         cvc_a,
886
 		CvcA:                         cvc_a,
880
 		CvcV:                         cvc_v,
887
 		CvcV:                         cvc_v,
881
 		Channel:                      channels,
888
 		Channel:                      channels,
889
+		ReturnBlood:                  return_blood,
890
+		RehydrationVolume:            rehydration_volume,
891
+		DialysisDuring:               dialysis_during,
892
+		StrokeVolume:                 stroke_volume,
893
+		BloodFlow:                    blood_flow,
894
+		SealingFluidDispose:          sealing_fluid_dispose,
895
+		SealingFluidSpecial:          sealing_fluid_special,
882
 	}
896
 	}
883
 
897
 
884
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
898
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
973
 	calcium, _ := c.GetFloat("calcium", 0)
987
 	calcium, _ := c.GetFloat("calcium", 0)
974
 	bicarbonate, _ := c.GetFloat("bicarbonate", 0)
988
 	bicarbonate, _ := c.GetFloat("bicarbonate", 0)
975
 	glucose, _ := c.GetFloat("glucose", 0)
989
 	glucose, _ := c.GetFloat("glucose", 0)
976
-	prescription_doctor, _ := c.GetInt64("prescription_doctor", 0)
990
+	// prescription_doctor, _ := c.GetInt64("prescription_doctor", 0)
977
 
991
 
978
 	// dry_weight, _ := c.GetFloat("dry_weight", 0)
992
 	// dry_weight, _ := c.GetFloat("dry_weight", 0)
979
 	dialysate_flow, _ := c.GetFloat("dialysate_flow", 0)
993
 	dialysate_flow, _ := c.GetFloat("dialysate_flow", 0)
1052
 		Bicarbonate:               bicarbonate,
1066
 		Bicarbonate:               bicarbonate,
1053
 		Glucose:                   glucose,
1067
 		Glucose:                   glucose,
1054
 		// DryWeight:                 dry_weight,
1068
 		// DryWeight:                 dry_weight,
1055
-		DialysateFlow:              dialysate_flow,
1056
-		DialysateTemperature:       dialysate_temperature,
1057
-		PrescriptionDoctor:         prescription_doctor,
1069
+		DialysateFlow:        dialysate_flow,
1070
+		DialysateTemperature: dialysate_temperature,
1071
+		// PrescriptionDoctor:         prescription_doctor,
1058
 		ReplacementTotal:           replacement_total,
1072
 		ReplacementTotal:           replacement_total,
1059
 		Conductivity:               conductivity,
1073
 		Conductivity:               conductivity,
1060
 		Remark:                     remark,
1074
 		Remark:                     remark,
1096
 		//	//service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
1110
 		//	//service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
1097
 		//}
1111
 		//}
1098
 		if appRole.UserType == 2 || appRole.UserType == 1 {
1112
 		if appRole.UserType == 2 || appRole.UserType == 1 {
1099
-			prescription_doctor = adminUserInfo.AdminUser.Id
1100
-		} else {
1101
-			prescription_doctor = 0
1113
+			prescription.PrescriptionDoctor = adminUserInfo.AdminUser.Id
1102
 		}
1114
 		}
1103
 
1115
 
1104
 		prescription.Creater = adminUserInfo.AdminUser.Id
1116
 		prescription.Creater = adminUserInfo.AdminUser.Id

+ 4 - 0
controllers/mobile_api_controllers/dialysis_api_controller_extend.go View File

87
 	result := this.GetString("result")
87
 	result := this.GetString("result")
88
 	monitoringNurse, _ := this.GetInt64("monitoring_nurse")
88
 	monitoringNurse, _ := this.GetInt64("monitoring_nurse")
89
 	heparin, _ := this.GetFloat("heparin")
89
 	heparin, _ := this.GetFloat("heparin")
90
+	dialysate_flow, _ := this.GetFloat("dialysate_flow")
90
 
91
 
91
 	adminInfo := this.GetMobileAdminUserInfo()
92
 	adminInfo := this.GetMobileAdminUserInfo()
92
 	patient, getPatientErr := service.MobileGetPatientById(adminInfo.Org.Id, patientID)
93
 	patient, getPatientErr := service.MobileGetPatientById(adminInfo.Org.Id, patientID)
138
 		Creator:                   adminInfo.AdminUser.Id,
139
 		Creator:                   adminInfo.AdminUser.Id,
139
 		Modify:                    0,
140
 		Modify:                    0,
140
 		Heparin:                   heparin,
141
 		Heparin:                   heparin,
142
+		DialysateFlow:             dialysate_flow,
141
 	}
143
 	}
142
 
144
 
143
 	err := service.CreateMonitor(&record)
145
 	err := service.CreateMonitor(&record)
227
 	conductivity, _ := this.GetFloat("conductivity")
229
 	conductivity, _ := this.GetFloat("conductivity")
228
 	displacement_flow_quantity, _ := this.GetFloat("displacement_flow_quantity")
230
 	displacement_flow_quantity, _ := this.GetFloat("displacement_flow_quantity")
229
 	heparin, _ := this.GetFloat("heparin")
231
 	heparin, _ := this.GetFloat("heparin")
232
+	dialysate_flow, _ := this.GetFloat("dialysate_flow")
230
 
233
 
231
 	adminInfo := this.GetMobileAdminUserInfo()
234
 	adminInfo := this.GetMobileAdminUserInfo()
232
 
235
 
283
 	monitor.BloodOxygenSaturation = blood_oxygen_saturation
286
 	monitor.BloodOxygenSaturation = blood_oxygen_saturation
284
 	monitor.Modify = adminInfo.AdminUser.Id
287
 	monitor.Modify = adminInfo.AdminUser.Id
285
 	monitor.Heparin = heparin
288
 	monitor.Heparin = heparin
289
+	monitor.DialysateFlow = dialysate_flow
286
 
290
 
287
 	err = service.UpdateMonitor(monitor)
291
 	err = service.UpdateMonitor(monitor)
288
 	if err != nil {
292
 	if err != nil {

+ 2 - 2
controllers/mobile_api_controllers/mobile_api_base_controller.go View File

135
 			allPermission, _ := service.GetAllFunctionPurview()
135
 			allPermission, _ := service.GetAllFunctionPurview()
136
 
136
 
137
 			for _, item := range allPermission {
137
 			for _, item := range allPermission {
138
-				fmt.Println(strings.Split(item.Urlfor, ",")[0])
139
-				fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
138
+				// fmt.Println(strings.Split(item.Urlfor, ",")[0])
139
+				// fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
140
 
140
 
141
 				//判断当前路由是否在权限路由列表里面
141
 				//判断当前路由是否在权限路由列表里面
142
 				if strings.Split(item.Urlfor, ",")[0] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {
142
 				if strings.Split(item.Urlfor, ",")[0] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {

+ 5 - 0
controllers/mobile_api_controllers/patient_api_controller.go View File

1652
 		evaluation.PunctureNeedle = punctureNeedle
1652
 		evaluation.PunctureNeedle = punctureNeedle
1653
 	}
1653
 	}
1654
 
1654
 
1655
+	if dataBody["humor_excessive_symptom"] != nil && reflect.TypeOf(dataBody["humor_excessive_symptom"]).String() == "float64" {
1656
+		humor_excessive_symptom := int64(dataBody["humor_excessive_symptom"].(float64))
1657
+		evaluation.HumorExcessiveSymptom = humor_excessive_symptom
1658
+	}
1659
+
1655
 	return
1660
 	return
1656
 }
1661
 }
1657
 
1662
 

+ 81 - 81
controllers/patient_api_controller.go View File

252
 	//获取老表的最后一条数据
252
 	//获取老表的最后一条数据
253
 	patients, err := service.GetLastPatientData(adminUserInfo.CurrentOrgId)
253
 	patients, err := service.GetLastPatientData(adminUserInfo.CurrentOrgId)
254
 	patientsNew := models.XtPatientsNew{
254
 	patientsNew := models.XtPatientsNew{
255
-		UserOrgId:                    adminUserInfo.CurrentOrgId,
256
-		UserId:                       0,
257
-		Avatar:                       patients.Avatar,
258
-		PatientType:                  patients.PatientType,
259
-		DialysisNo:                   patients.DialysisNo,
260
-		AdmissionNumber:              patients.AdmissionNumber,
261
-		Source:                       patients.Source,
262
-		Lapseto:                      patients.Lapseto,
263
-		PartitionId:                  patients.PartitionId,
264
-		BedId:                        patients.BedId,
265
-		Name:                         patients.Name,
266
-		Alias:                        patients.Alias,
267
-		Gender:                       patients.Gender,
268
-		MaritalStatus:                patients.MaritalStatus,
269
-		IdCardNo:                     patients.IdCardNo,
270
-		Birthday:                     patients.Birthday,
271
-		ReimbursementWayId:           patients.ReimbursementWayId,
272
-		HealthCareType:               patients.HealthCareType,
273
-		HealthCareNo:                 patients.HealthCareNo,
274
-		HealthCareDueDate:            patients.HealthCareDueDate,
275
-		Height:                       patients.Height,
276
-		BloodType:                    patients.BloodType,
277
-		Rh:                           patients.Rh,
255
+		UserOrgId:          adminUserInfo.CurrentOrgId,
256
+		UserId:             0,
257
+		Avatar:             patients.Avatar,
258
+		PatientType:        patients.PatientType,
259
+		DialysisNo:         patients.DialysisNo,
260
+		AdmissionNumber:    patients.AdmissionNumber,
261
+		Source:             patients.Source,
262
+		Lapseto:            patients.Lapseto,
263
+		PartitionId:        patients.PartitionId,
264
+		BedId:              patients.BedId,
265
+		Name:               patients.Name,
266
+		Alias:              patients.Alias,
267
+		Gender:             patients.Gender,
268
+		MaritalStatus:      patients.MaritalStatus,
269
+		IdCardNo:           patients.IdCardNo,
270
+		Birthday:           patients.Birthday,
271
+		ReimbursementWayId: patients.ReimbursementWayId,
272
+		HealthCareType:     patients.HealthCareType,
273
+		HealthCareNo:       patients.HealthCareNo,
274
+		HealthCareDueDate:  patients.HealthCareDueDate,
275
+		Height:             patients.Height,
276
+		BloodType:          patients.BloodType,
277
+		Rh:                 patients.Rh,
278
 		HealthCareDueAlertDate:       patients.HealthCareDueAlertDate,
278
 		HealthCareDueAlertDate:       patients.HealthCareDueAlertDate,
279
 		EducationLevel:               patients.EducationLevel,
279
 		EducationLevel:               patients.EducationLevel,
280
 		Profession:                   patients.Profession,
280
 		Profession:                   patients.Profession,
320
 		Nation:                       patients.Nation,
320
 		Nation:                       patients.Nation,
321
 		NativePlace:                  patients.NativePlace,
321
 		NativePlace:                  patients.NativePlace,
322
 		Age:                          patients.Age,
322
 		Age:                          patients.Age,
323
-		InfectiousNextRecordTime:     patients.InfectiousNextRecordTime,
324
-		IsInfectious:                 patients.IsInfectious,
325
-		RemindCycle:                  patients.RemindCycle,
326
-		ResponseResult:               patients.ResponseResult,
327
-		IsOpenRemind:                 patients.IsOpenRemind,
328
-		FirstTreatmentDate:           patients.FirstTreatmentDate,
329
-		DialysisAge:                  patients.DialysisAge,
330
-		ExpenseKind:                  patients.ExpenseKind,
331
-		TellPhone:                    patients.TellPhone,
332
-		ContactName:                  patients.ContactName,
333
-		BloodPatients:                1,
334
-		SlowPatients:                 0,
335
-		MemberPatients:               0,
336
-		EcommerPatients:              "",
337
-		BloodId:                      patients.ID,
338
-		SlowId:                       0,
339
-		MemberId:                     0,
340
-		MemberFistdate:               0,
341
-		MemberPatienttype:            0,
342
-		MemberTreatement:             0,
343
-		EquitmentId:                  "",
344
-		UserSysBeforeCount:           patient.UserSysBeforeCount,
323
+		InfectiousNextRecordTime: patients.InfectiousNextRecordTime,
324
+		IsInfectious:             patients.IsInfectious,
325
+		RemindCycle:              patients.RemindCycle,
326
+		ResponseResult:           patients.ResponseResult,
327
+		IsOpenRemind:             patients.IsOpenRemind,
328
+		FirstTreatmentDate:       patients.FirstTreatmentDate,
329
+		DialysisAge:              patients.DialysisAge,
330
+		ExpenseKind:              patients.ExpenseKind,
331
+		TellPhone:                patients.TellPhone,
332
+		ContactName:              patients.ContactName,
333
+		BloodPatients:            1,
334
+		SlowPatients:             0,
335
+		MemberPatients:           0,
336
+		EcommerPatients:          "",
337
+		BloodId:                  patients.ID,
338
+		SlowId:                   0,
339
+		MemberId:                 0,
340
+		MemberFistdate:           0,
341
+		MemberPatienttype:        0,
342
+		MemberTreatement:         0,
343
+		EquitmentId:              "",
344
+		UserSysBeforeCount:       patient.UserSysBeforeCount,
345
 	}
345
 	}
346
 
346
 
347
 	err = service.CreatePatientsNew(&patientsNew)
347
 	err = service.CreatePatientsNew(&patientsNew)
480
 		return
480
 		return
481
 	}
481
 	}
482
 	patientsNew := models.XtPatientsNew{
482
 	patientsNew := models.XtPatientsNew{
483
-		UserOrgId:                 patient.UserOrgId,
484
-		UserId:                    patient.UserId,
485
-		Avatar:                    patient.Avatar,
486
-		PatientType:               patient.PatientType,
487
-		DialysisNo:                patient.DialysisNo,
488
-		AdmissionNumber:           patient.AdmissionNumber,
489
-		Source:                    patient.Source,
490
-		PartitionId:               patient.PartitionId,
491
-		BedId:                     patient.BedId,
492
-		Name:                      patient.Name,
493
-		Alias:                     patient.Alias,
494
-		Gender:                    patient.Gender,
495
-		MaritalStatus:             patient.MaritalStatus,
496
-		IdCardNo:                  patient.IdCardNo,
497
-		Birthday:                  patient.Birthday,
498
-		ReimbursementWayId:        patient.ReimbursementWayId,
499
-		HealthCareType:            patient.HealthCareType,
500
-		HealthCareNo:              patient.HealthCareNo,
501
-		HealthCareDueDate:         patient.HealthCareDueDate,
502
-		Height:                    patient.Height,
503
-		BloodType:                 patient.BloodType,
504
-		Rh:                        patient.Rh,
483
+		UserOrgId:          patient.UserOrgId,
484
+		UserId:             patient.UserId,
485
+		Avatar:             patient.Avatar,
486
+		PatientType:        patient.PatientType,
487
+		DialysisNo:         patient.DialysisNo,
488
+		AdmissionNumber:    patient.AdmissionNumber,
489
+		Source:             patient.Source,
490
+		PartitionId:        patient.PartitionId,
491
+		BedId:              patient.BedId,
492
+		Name:               patient.Name,
493
+		Alias:              patient.Alias,
494
+		Gender:             patient.Gender,
495
+		MaritalStatus:      patient.MaritalStatus,
496
+		IdCardNo:           patient.IdCardNo,
497
+		Birthday:           patient.Birthday,
498
+		ReimbursementWayId: patient.ReimbursementWayId,
499
+		HealthCareType:     patient.HealthCareType,
500
+		HealthCareNo:       patient.HealthCareNo,
501
+		HealthCareDueDate:  patient.HealthCareDueDate,
502
+		Height:             patient.Height,
503
+		BloodType:          patient.BloodType,
504
+		Rh:                 patient.Rh,
505
 		HealthCareDueAlertDate:    patient.HealthCareDueAlertDate,
505
 		HealthCareDueAlertDate:    patient.HealthCareDueAlertDate,
506
 		EducationLevel:            patient.EducationLevel,
506
 		EducationLevel:            patient.EducationLevel,
507
 		Profession:                patient.Profession,
507
 		Profession:                patient.Profession,
543
 		Nation:                    patient.Nation,
543
 		Nation:                    patient.Nation,
544
 		NativePlace:               patient.NativePlace,
544
 		NativePlace:               patient.NativePlace,
545
 		Age:                       patient.Age,
545
 		Age:                       patient.Age,
546
-		InfectiousNextRecordTime:  patient.InfectiousNextRecordTime,
547
-		IsInfectious:              patient.IsInfectious,
548
-		RemindCycle:               patient.RemindCycle,
549
-		ResponseResult:            patient.ResponseResult,
550
-		IsOpenRemind:              patient.IsOpenRemind,
551
-		FirstTreatmentDate:        patient.FirstTreatmentDate,
552
-		DialysisAge:               patient.DialysisAge,
553
-		ExpenseKind:               patient.ExpenseKind,
554
-		TellPhone:                 patient.TellPhone,
555
-		ContactName:               patient.ContactName,
556
-		UpdatedTime:               time.Now().Unix(),
546
+		InfectiousNextRecordTime: patient.InfectiousNextRecordTime,
547
+		IsInfectious:             patient.IsInfectious,
548
+		RemindCycle:              patient.RemindCycle,
549
+		ResponseResult:           patient.ResponseResult,
550
+		IsOpenRemind:             patient.IsOpenRemind,
551
+		FirstTreatmentDate:       patient.FirstTreatmentDate,
552
+		DialysisAge:              patient.DialysisAge,
553
+		ExpenseKind:              patient.ExpenseKind,
554
+		TellPhone:                patient.TellPhone,
555
+		ContactName:              patient.ContactName,
556
+		UpdatedTime:              time.Now().Unix(),
557
 	}
557
 	}
558
 	//	//更新病人ID获取新表病人ID
558
 	//	//更新病人ID获取新表病人ID
559
 	err = service.UpdatepatientTwo(&patientsNew, id)
559
 	err = service.UpdatepatientTwo(&patientsNew, id)
628
 
628
 
629
 func (c *PatientApiController) EditLapseto() {
629
 func (c *PatientApiController) EditLapseto() {
630
 	id, _ := c.GetInt64("id", 0)
630
 	id, _ := c.GetInt64("id", 0)
631
-	fmt.Println("id===========", id)
632
 	if id <= 0 {
631
 	if id <= 0 {
633
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
632
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
634
 		return
633
 		return
3497
 
3496
 
3498
 					//需要判断该号码是否已经在系统内存在了,存在了则生成一条导入错误日志
3497
 					//需要判断该号码是否已经在系统内存在了,存在了则生成一条导入错误日志
3499
 					count := service.FindPatientPhoneIsExist(phone, c.GetAdminUserInfo().CurrentOrgId)
3498
 					count := service.FindPatientPhoneIsExist(phone, c.GetAdminUserInfo().CurrentOrgId)
3500
-					if count > 1 {
3499
+					if count >= 1 {
3501
 						err_log := models.ExportErrLog{
3500
 						err_log := models.ExportErrLog{
3502
 							LogType:    1,
3501
 							LogType:    1,
3503
 							UserOrgId:  c.GetAdminUserInfo().CurrentOrgId,
3502
 							UserOrgId:  c.GetAdminUserInfo().CurrentOrgId,
3555
 					//	}
3554
 					//	}
3556
 					//}
3555
 					//}
3557
 					count := service.FindPatientIdCardNoIsExist(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
3556
 					count := service.FindPatientIdCardNoIsExist(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
3558
-					if count > 1 {
3557
+					if count >= 1 {
3559
 						//if tempPatient != nil && tempPatient.ID > 0 {
3558
 						//if tempPatient != nil && tempPatient.ID > 0 {
3560
 						err_log := models.ExportErrLog{
3559
 						err_log := models.ExportErrLog{
3561
 							LogType:    1,
3560
 							LogType:    1,
3807
 			patient.CreatedTime = time.Now().Unix()
3806
 			patient.CreatedTime = time.Now().Unix()
3808
 			patient.UpdatedTime = time.Now().Unix()
3807
 			patient.UpdatedTime = time.Now().Unix()
3809
 			patient.Status = 1
3808
 			patient.Status = 1
3809
+			patient.Avatar = "https://images.shengws.com/201809182128111.png"
3810
 			patient.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
3810
 			patient.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
3811
 			patient.IsExcelExport = 1
3811
 			patient.IsExcelExport = 1
3812
 			patient.PatientType = 1
3812
 			patient.PatientType = 1

+ 86 - 73
models/dialysis.go View File

83
 }
83
 }
84
 
84
 
85
 type SchedualPatient2 struct {
85
 type SchedualPatient2 struct {
86
-	ID                      int64            `gorm:"column:id" json:"id" form:"id"`
87
-	UserOrgId               int64            `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
88
-	UserId                  int64            `gorm:"column:user_id" json:"user_id" form:"user_id"`
89
-	PatientType             int64            `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
90
-	Avatar                  string           `gorm:"column:avatar" json:"avatar" form:"avatar"`
91
-	DialysisNo              string           `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
92
-	AdmissionNumber         string           `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
93
-	Source                  int64            `gorm:"column:source" json:"source" form:"source"`
94
-	Lapseto                 int64            `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
95
-	PartitionId             int64            `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
96
-	BedId                   int64            `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
97
-	Name                    string           `gorm:"column:name" json:"name" form:"name"`
98
-	Alias                   string           `gorm:"column:alias" json:"alias" form:"alias"`
99
-	Gender                  int64            `gorm:"column:gender" json:"gender" form:"gender"`
100
-	Nation                  string           `gorm:"column:nation" json:"nation" form:"nation"`
101
-	NativePlace             string           `gorm:"column:native_place" json:"native_place" form:"native_place"`
102
-	MaritalStatus           int64            `gorm:"column:marital_status" json:"marital_status" form:"marital_status"`
103
-	IdCardNo                string           `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
104
-	Birthday                int64            `gorm:"column:birthday" json:"birthday" form:"birthday"`
105
-	ReimbursementWayId      int64            `gorm:"column:reimbursement_way_id" json:"reimbursement_way_id" form:"reimbursement_way_id"`
106
-	HealthCareType          int64            `gorm:"column:health_care_type" json:"health_care_type" form:"health_care_type"`
107
-	HealthCareNo            string           `gorm:"column:health_care_no" json:"health_care_no" form:"health_care_no"`
108
-	HealthCareDueDate       int64            `gorm:"column:health_care_due_date" json:"health_care_due_date" form:"health_care_due_date"`
109
-	Height                  int64            `gorm:"column:height" json:"height" form:"height"`
110
-	BloodType               int64            `gorm:"column:blood_type" json:"blood_type" form:"blood_type"`
111
-	Rh                      int64            `gorm:"column:rh" json:"rh" form:"rh"`
112
-	HealthCareDueAlertDate  int64            `gorm:"column:health_care_due_alert_date" json:"health_care_due_alert_date" form:"health_care_due_alert_date"`
113
-	EducationLevel          int64            `gorm:"column:education_level" json:"education_level" form:"education_level"`
114
-	Profession              int64            `gorm:"column:profession" json:"profession" form:"profession"`
115
-	Phone                   string           `gorm:"column:phone" json:"phone" form:"phone"`
116
-	HomeTelephone           string           `gorm:"column:home_telephone" json:"home_telephone" form:"home_telephone"`
117
-	RelativePhone           string           `gorm:"column:relative_phone" json:"relative_phone" form:"relative_phone"`
118
-	RelativeRelations       string           `gorm:"column:relative_relations" json:"relative_relations" form:"relative_relations"`
119
-	HomeAddress             string           `gorm:"column:home_address" json:"home_address" form:"home_address"`
120
-	WorkUnit                string           `gorm:"column:work_unit" json:"work_unit" form:"work_unit"`
121
-	UnitAddress             string           `gorm:"column:unit_address" json:"unit_address" form:"unit_address"`
122
-	Children                int64            `gorm:"column:children" json:"children" form:"children"`
123
-	ReceivingDate           int64            `gorm:"column:receiving_date" json:"receiving_date" form:"receiving_date"`
124
-	IsHospitalFirstDialysis int64            `gorm:"column:is_hospital_first_dialysis" json:"is_hospital_first_dialysis" form:"is_hospital_first_dialysis"`
125
-	FirstDialysisDate       int64            `gorm:"column:first_dialysis_date" json:"first_dialysis_date" form:"first_dialysis_date"`
126
-	FirstDialysisHospital   string           `gorm:"column:first_dialysis_hospital" json:"first_dialysis_hospital" form:"first_dialysis_hospital"`
127
-	InductionPeriod         int64            `gorm:"column:induction_period" json:"induction_period" form:"induction_period"`
128
-	InitialDialysis         int64            `gorm:"column:initial_dialysis" json:"initial_dialysis" form:"initial_dialysis"`
129
-	TotalDialysis           int64            `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
130
-	AttendingDoctorId       int64            `gorm:"column:attending_doctor_id" json:"attending_doctor_id" form:"attending_doctor_id"`
131
-	HeadNurseId             int64            `gorm:"column:head_nurse_id" json:"head_nurse_id" form:"head_nurse_id"`
132
-	Evaluate                string           `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
133
-	Diagnose                string           `gorm:"column:diagnose" json:"diagnose" form:"diagnose"`
134
-	Remark                  string           `gorm:"column:remark" json:"remark" form:"remark"`
135
-	RegistrarsId            int64            `gorm:"column:registrars_id" json:"registrars_id" form:"registrars_id"`
136
-	Registrars              string           `gorm:"column:registrars" json:"registrars" form:"registrars"`
137
-	QrCode                  string           `gorm:"column:qr_code" json:"qr_code" form:"qr_code"`
138
-	BindingState            int64            `gorm:"column:binding_state" json:"binding_state" form:"binding_state"`
139
-	PatientComplains        string           `gorm:"column:patient_complains" json:"patient_complains"` // 主诉
140
-	PresentHistory          string           `gorm:"column:present_history" json:"present_history"`     // 现病史
141
-	PastHistory             string           `gorm:"column:past_history" json:"past_history"`           // 既往史
142
-	Temperature             float64          `gorm:"column:temperature" json:"temperature"`             // 体格检查-体温
143
-	Pulse                   int64            `gorm:"column:pulse" json:"pulse"`                         // 体格检查-脉搏
144
-	Respiratory             int64            `gorm:"column:respiratory" json:"respiratory"`             // 体格检查-呼吸频率
145
-	SBP                     int64            `gorm:"column:sbp" json:"sbp"`                             // 体格检查-收缩压
146
-	DBP                     int64            `gorm:"column:dbp" json:"dbp"`                             // 体格检查-舒张压
147
-	Status                  int64            `gorm:"column:status" json:"status" form:"status"`
148
-	CreatedTime             int64            `gorm:"column:created_time" json:"created_time" form:"created_time"`
149
-	UpdatedTime             int64            `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
150
-	DialysisSchedule        DialysisSchedule `gorm:"ForeignKey:PatientId"`
151
-	Age                     int64            `gorm:"column:age" json:"age"`
152
-	IsOpenRemind            int64            `gorm:"column:is_open_remind" json:"is_open_remind"`
153
-	DialysisAge             int64            `gorm:"column:dialysis_age" json:"dialysis_age" form:"dialysis_age"`
154
-	ExpenseKind             int64            `gorm:"column:expense_kind" json:"expense_kind" form:"expense_kind"`
155
-	TellPhone               string           `gorm:"column:tell_phone" json:"tell_phone" form:"tell_phone"`
156
-	FirstTreatmentDate      int64            `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
157
-	ContactName             string           `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
158
-	UserSysBeforeCount      int64            `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
86
+	ID                      int64                `gorm:"column:id" json:"id" form:"id"`
87
+	UserOrgId               int64                `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
88
+	UserId                  int64                `gorm:"column:user_id" json:"user_id" form:"user_id"`
89
+	PatientType             int64                `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
90
+	Avatar                  string               `gorm:"column:avatar" json:"avatar" form:"avatar"`
91
+	DialysisNo              string               `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
92
+	AdmissionNumber         string               `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
93
+	Source                  int64                `gorm:"column:source" json:"source" form:"source"`
94
+	Lapseto                 int64                `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
95
+	PartitionId             int64                `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
96
+	BedId                   int64                `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
97
+	Name                    string               `gorm:"column:name" json:"name" form:"name"`
98
+	Alias                   string               `gorm:"column:alias" json:"alias" form:"alias"`
99
+	Gender                  int64                `gorm:"column:gender" json:"gender" form:"gender"`
100
+	Nation                  string               `gorm:"column:nation" json:"nation" form:"nation"`
101
+	NativePlace             string               `gorm:"column:native_place" json:"native_place" form:"native_place"`
102
+	MaritalStatus           int64                `gorm:"column:marital_status" json:"marital_status" form:"marital_status"`
103
+	IdCardNo                string               `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
104
+	Birthday                int64                `gorm:"column:birthday" json:"birthday" form:"birthday"`
105
+	ReimbursementWayId      int64                `gorm:"column:reimbursement_way_id" json:"reimbursement_way_id" form:"reimbursement_way_id"`
106
+	HealthCareType          int64                `gorm:"column:health_care_type" json:"health_care_type" form:"health_care_type"`
107
+	HealthCareNo            string               `gorm:"column:health_care_no" json:"health_care_no" form:"health_care_no"`
108
+	HealthCareDueDate       int64                `gorm:"column:health_care_due_date" json:"health_care_due_date" form:"health_care_due_date"`
109
+	Height                  int64                `gorm:"column:height" json:"height" form:"height"`
110
+	BloodType               int64                `gorm:"column:blood_type" json:"blood_type" form:"blood_type"`
111
+	Rh                      int64                `gorm:"column:rh" json:"rh" form:"rh"`
112
+	HealthCareDueAlertDate  int64                `gorm:"column:health_care_due_alert_date" json:"health_care_due_alert_date" form:"health_care_due_alert_date"`
113
+	EducationLevel          int64                `gorm:"column:education_level" json:"education_level" form:"education_level"`
114
+	Profession              int64                `gorm:"column:profession" json:"profession" form:"profession"`
115
+	Phone                   string               `gorm:"column:phone" json:"phone" form:"phone"`
116
+	HomeTelephone           string               `gorm:"column:home_telephone" json:"home_telephone" form:"home_telephone"`
117
+	RelativePhone           string               `gorm:"column:relative_phone" json:"relative_phone" form:"relative_phone"`
118
+	RelativeRelations       string               `gorm:"column:relative_relations" json:"relative_relations" form:"relative_relations"`
119
+	HomeAddress             string               `gorm:"column:home_address" json:"home_address" form:"home_address"`
120
+	WorkUnit                string               `gorm:"column:work_unit" json:"work_unit" form:"work_unit"`
121
+	UnitAddress             string               `gorm:"column:unit_address" json:"unit_address" form:"unit_address"`
122
+	Children                int64                `gorm:"column:children" json:"children" form:"children"`
123
+	ReceivingDate           int64                `gorm:"column:receiving_date" json:"receiving_date" form:"receiving_date"`
124
+	IsHospitalFirstDialysis int64                `gorm:"column:is_hospital_first_dialysis" json:"is_hospital_first_dialysis" form:"is_hospital_first_dialysis"`
125
+	FirstDialysisDate       int64                `gorm:"column:first_dialysis_date" json:"first_dialysis_date" form:"first_dialysis_date"`
126
+	FirstDialysisHospital   string               `gorm:"column:first_dialysis_hospital" json:"first_dialysis_hospital" form:"first_dialysis_hospital"`
127
+	InductionPeriod         int64                `gorm:"column:induction_period" json:"induction_period" form:"induction_period"`
128
+	InitialDialysis         int64                `gorm:"column:initial_dialysis" json:"initial_dialysis" form:"initial_dialysis"`
129
+	TotalDialysis           int64                `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
130
+	AttendingDoctorId       int64                `gorm:"column:attending_doctor_id" json:"attending_doctor_id" form:"attending_doctor_id"`
131
+	HeadNurseId             int64                `gorm:"column:head_nurse_id" json:"head_nurse_id" form:"head_nurse_id"`
132
+	Evaluate                string               `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
133
+	Diagnose                string               `gorm:"column:diagnose" json:"diagnose" form:"diagnose"`
134
+	Remark                  string               `gorm:"column:remark" json:"remark" form:"remark"`
135
+	RegistrarsId            int64                `gorm:"column:registrars_id" json:"registrars_id" form:"registrars_id"`
136
+	Registrars              string               `gorm:"column:registrars" json:"registrars" form:"registrars"`
137
+	QrCode                  string               `gorm:"column:qr_code" json:"qr_code" form:"qr_code"`
138
+	BindingState            int64                `gorm:"column:binding_state" json:"binding_state" form:"binding_state"`
139
+	PatientComplains        string               `gorm:"column:patient_complains" json:"patient_complains"` // 主诉
140
+	PresentHistory          string               `gorm:"column:present_history" json:"present_history"`     // 现病史
141
+	PastHistory             string               `gorm:"column:past_history" json:"past_history"`           // 既往史
142
+	Temperature             float64              `gorm:"column:temperature" json:"temperature"`             // 体格检查-体温
143
+	Pulse                   int64                `gorm:"column:pulse" json:"pulse"`                         // 体格检查-脉搏
144
+	Respiratory             int64                `gorm:"column:respiratory" json:"respiratory"`             // 体格检查-呼吸频率
145
+	SBP                     int64                `gorm:"column:sbp" json:"sbp"`                             // 体格检查-收缩压
146
+	DBP                     int64                `gorm:"column:dbp" json:"dbp"`                             // 体格检查-舒张压
147
+	Status                  int64                `gorm:"column:status" json:"status" form:"status"`
148
+	CreatedTime             int64                `gorm:"column:created_time" json:"created_time" form:"created_time"`
149
+	UpdatedTime             int64                `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
150
+	DialysisSchedule        DialysisSchedule     `gorm:"ForeignKey:PatientId"`
151
+	InfectiousDiseases      []InfectiousDiseases `gorm:"ForeignKey:PatientId"`
152
+	Age                     int64                `gorm:"column:age" json:"age"`
153
+	IsOpenRemind            int64                `gorm:"column:is_open_remind" json:"is_open_remind"`
154
+	DialysisAge             int64                `gorm:"column:dialysis_age" json:"dialysis_age" form:"dialysis_age"`
155
+	ExpenseKind             int64                `gorm:"column:expense_kind" json:"expense_kind" form:"expense_kind"`
156
+	TellPhone               string               `gorm:"column:tell_phone" json:"tell_phone" form:"tell_phone"`
157
+	FirstTreatmentDate      int64                `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
158
+	ContactName             string               `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
159
+	UserSysBeforeCount      int64                `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
159
 }
160
 }
160
 
161
 
161
 func (SchedualPatient2) TableName() string {
162
 func (SchedualPatient2) TableName() string {
265
 	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other"`
266
 	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other"`
266
 	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other"`
267
 	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other"`
267
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other"`
268
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other"`
269
+	HumorExcessiveSymptom          int64   `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom"`
268
 }
270
 }
269
 
271
 
270
 func (PredialysisEvaluation) TableName() string {
272
 func (PredialysisEvaluation) TableName() string {
278
 	AssessmentDate              int64   `gorm:"column:assessment_date" json:"assessment_date"`
280
 	AssessmentDate              int64   `gorm:"column:assessment_date" json:"assessment_date"`
279
 	DialysisOrderId             int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id"`
281
 	DialysisOrderId             int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id"`
280
 	DryWeight                   float64 `gorm:"column:dry_weight" json:"dry_weight"`
282
 	DryWeight                   float64 `gorm:"column:dry_weight" json:"dry_weight"`
283
+	SystolicBloodPressure       float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
284
+	DiastolicBloodPressure      float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure"`
281
 	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency"`
285
 	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency"`
282
 	WeighingWay                 string  `gorm:"column:weighing_way" json:"weighing_way"`
286
 	WeighingWay                 string  `gorm:"column:weighing_way" json:"weighing_way"`
283
 	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
287
 	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
285
 	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
289
 	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
286
 	Evaluator                   int64   `gorm:"column:evaluator" json:"evaluator"`
290
 	Evaluator                   int64   `gorm:"column:evaluator" json:"evaluator"`
287
 	Creater                     int64   `gorm:"column:creater" json:"creater"`
291
 	Creater                     int64   `gorm:"column:creater" json:"creater"`
292
+	CreatedTime                 int64   `gorm:"column:created_time" json:"created_time"`
288
 }
293
 }
289
 
294
 
290
 func (PredialysisEvaluationList) TableName() string {
295
 func (PredialysisEvaluationList) TableName() string {
550
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
555
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
551
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
556
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
552
 	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
557
 	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
558
+	ReturnBlood                     int64   `gorm:"column:return_blood" json:"return_blood" form:"return_blood"`
559
+	RehydrationVolume               int64   `gorm:"column:rehydration_volume" json:"rehydration_volume" form:"rehydration_volume"`
560
+	DialysisDuring                  int64   `gorm:"column:dialysis_during" json:"dialysis_during" form:"dialysis_during"`
561
+	StrokeVolume                    int64   `gorm:"column:stroke_volume" json:"stroke_volume" form:"stroke_volume"`
553
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
562
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
563
+	BloodFlow                       int64   `gorm:"column:blood_flow" json:"blood_flow" form:"blood_flow"`
564
+	SealingFluidDispose             int64   `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
565
+	SealingFluidSpecial             string  `gorm:"column:sealing_fluid_special" json:"sealing_fluid_special" form:"sealing_fluid_special"`
554
 }
566
 }
555
 
567
 
556
 func (AssessmentAfterDislysis) TableName() string {
568
 func (AssessmentAfterDislysis) TableName() string {
647
 	Creator                   int64   `gorm:"column:creator" json:"creator" form:"creator"`
659
 	Creator                   int64   `gorm:"column:creator" json:"creator" form:"creator"`
648
 	Modify                    int64   `gorm:"column:modify" json:"modify" form:"modify"`
660
 	Modify                    int64   `gorm:"column:modify" json:"modify" form:"modify"`
649
 	Heparin                   float64 `gorm:"column:heparin" json:"heparin" form:"heparin"`
661
 	Heparin                   float64 `gorm:"column:heparin" json:"heparin" form:"heparin"`
662
+	DialysateFlow             float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
650
 }
663
 }
651
 
664
 
652
 func (MonitoringRecord) TableName() string {
665
 func (MonitoringRecord) TableName() string {

+ 3 - 0
service/dialysis_service.go View File

610
 		// Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
610
 		// Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
611
 		Preload("TreatmentMode", "status = 1").
611
 		Preload("TreatmentMode", "status = 1").
612
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
612
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
613
+		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ?", orgID).
614
+		Preload("Prescription", "status = 1 AND user_org_id = ?", orgID).
615
+		Preload("TreatmentSummary", "status = 1 AND user_org_id = ?", orgID).
613
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
616
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
614
 		Where("status = 1 AND user_org_id = ?", orgID)
617
 		Where("status = 1 AND user_org_id = ?", orgID)
615
 	if scheduleDate != 0 {
618
 	if scheduleDate != 0 {

+ 4 - 2
service/mobile_dialysis_service.go View File

89
 	DeviceZone               *models.DeviceZone                `gorm:"ForeignKey:PartitionId" json:"device_zone"`
89
 	DeviceZone               *models.DeviceZone                `gorm:"ForeignKey:PartitionId" json:"device_zone"`
90
 	TreatmentMode            *models.TreatmentMode             `gorm:"ForeignKey:ModeId" json:"treatment_mode"`
90
 	TreatmentMode            *models.TreatmentMode             `gorm:"ForeignKey:ModeId" json:"treatment_mode"`
91
 	DialysisOrder            *MDialysisOrderVMList             `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
91
 	DialysisOrder            *MDialysisOrderVMList             `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
92
-	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
93
-	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
92
+	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"prescription"`
93
+	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"assessment_before_dislysis"`
94
+	TreatmentSummary         *models.TreatmentSummary          `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"treatment_summary"`
94
 	Advices                  []*models.DoctorAdvice            `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
95
 	Advices                  []*models.DoctorAdvice            `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
95
 }
96
 }
96
 
97
 
113
 	UserOrgId          int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
114
 	UserOrgId          int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
114
 	UserId             int64  `gorm:"column:user_id" json:"user_id" form:"user_id"`
115
 	UserId             int64  `gorm:"column:user_id" json:"user_id" form:"user_id"`
115
 	PatientType        int64  `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
116
 	PatientType        int64  `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
117
+	DialysisNo         string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
116
 	Avatar             string `gorm:"column:avatar" json:"avatar" form:"avatar"`
118
 	Avatar             string `gorm:"column:avatar" json:"avatar" form:"avatar"`
117
 	Gender             int64  `gorm:"column:gender" json:"gender" form:"gender"`
119
 	Gender             int64  `gorm:"column:gender" json:"gender" form:"gender"`
118
 	Birthday           int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
120
 	Birthday           int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`

+ 2 - 2
service/patient_service.go View File

139
 		return db.Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
139
 		return db.Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
140
 			Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
140
 			Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
141
 			Where("user_org_id = ? AND schedule_date = ? ", orgID, time)
141
 			Where("user_org_id = ? AND schedule_date = ? ", orgID, time)
142
-	}).Where("user_org_id=? and dialysis_no = ? and status=1", orgID, no).First(&patient).Error
142
+	}).Preload("InfectiousDiseases", "status = 1").Where("user_org_id=? and dialysis_no = ? and status=1", orgID, no).First(&patient).Error
143
 	return
143
 	return
144
 }
144
 }
145
 
145
 
329
 		utx.Rollback()
329
 		utx.Rollback()
330
 		return
330
 		return
331
 	}
331
 	}
332
-	if len(contagions) > 0 {
332
+	if len(contagions) > 0 && patient.IsInfectious == 2 {
333
 		thisSQL := "INSERT INTO xt_patients_infectious_diseases (patient_id, disease_id, status, created_time, updated_time) VALUES "
333
 		thisSQL := "INSERT INTO xt_patients_infectious_diseases (patient_id, disease_id, status, created_time, updated_time) VALUES "
334
 		insertParams := make([]string, 0)
334
 		insertParams := make([]string, 0)
335
 		insertData := make([]interface{}, 0)
335
 		insertData := make([]interface{}, 0)

+ 7 - 1
service/patientmanage_service.go View File

1050
 	if projectid > 0 {
1050
 	if projectid > 0 {
1051
 		db = db.Where("x.project_id = ?", projectid)
1051
 		db = db.Where("x.project_id = ?", projectid)
1052
 	}
1052
 	}
1053
-	err = db.Group("x.id").Select("x.id,x.patient_id,x.org_id,x.project_id,x.item_id,x.item_name,x.project_name,x.inspect_type,x.inspect_value,x.inspect_date,x.status,x.created_time,x.updated_time,r.range_type,r.range_min,r.range_max,r.range_value,r.range_options,r.unit").Joins("left join xt_inspection_reference as r on r.item_id = x.item_id ").Scan(&inspection).Error
1053
+	err = db.Group("x.id").Select("x.id,x.patient_id,x.org_id,x.project_id,x.item_id,x.item_name,x.project_name,x.inspect_type,x.inspect_value,x.inspect_date,x.status,x.created_time,x.updated_time,r.range_type,r.range_min,r.range_max,r.range_value,r.range_options,r.unit").Joins("left join xt_inspection_reference as r on (r.item_id = x.item_id AND r.org_id > 0) OR ( x.item_id = r.id AND r.org_id = 0)   ").Scan(&inspection).Error
1054
 	return inspection, err
1054
 	return inspection, err
1055
 }
1055
 }
1056
 
1056
 
1444
 	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id =? and org_id = ?", id, orgid).Update(map[string]interface{}{"user_name": role.UserName, "mtime": time.Now().Unix()}).Error
1444
 	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id =? and org_id = ?", id, orgid).Update(map[string]interface{}{"user_name": role.UserName, "mtime": time.Now().Unix()}).Error
1445
 	return err
1445
 	return err
1446
 }
1446
 }
1447
+
1448
+func AddPatientLapseto(lapseto *models.PatientLapseto) error {
1449
+
1450
+	err := XTWriteDB().Create(&lapseto).Error
1451
+	return err
1452
+}

+ 94 - 0
数据变更脚本.sql View File

1
+--2020-06-17 author 张保健 --
2
+--透前评估添加体液过多症状字段--
3
+ALTER TABLE `sgj_xt`.`xt_assessment_before_dislysis`     ADD COLUMN `humor_excessive_symptom` SMALLINT(2) DEFAULT '0' NULL COMMENT '体液过多症状' AFTER `dialysis_intakes_unit`;
4
+--数据字典表里添加体液过多症状--
5
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '0','hemodialysis','0','体液过多症状','humor_excessive_symptom','0','2020-06-17 16:56:00','2020-06-17 16:56:00','0','1',NULL,'0',NULL,NULL,'0');
6
+--数据字典表里添加体液过多症状配置项,parent_id为上条语句的id--
7
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','无',NULL,'1','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
8
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿+',NULL,'2','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
9
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿++',NULL,'3','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
10
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿+++',NULL,'4','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
11
+--显示配置里添加体液过程症状--
12
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','3','humor_excessive_symptom','体液过多症状','2',NULL,NULL,'0');
13
+--添加显示体液过程症状的机构 org_id为要显示的机构--
14
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '9883','3','humor_excessive_symptom','体液过多症状','1',NULL,NULL,'0');
15
+
16
+
17
+--2020-06-19 author 张保健 --
18
+--透后评估添加回血字段--
19
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `return_blood` INT(8) DEFAULT '0' NULL COMMENT '回血' AFTER `channel`;
20
+--显示配置里添加回血--
21
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','return_blood','回血','2',NULL,NULL,'0');
22
+--添加显示回血的机构 org_id为要显示的机构--
23
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','return_blood','回血','1',NULL,NULL,'0');
24
+
25
+--透后评估添加补液量字段--
26
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `rehydration_volume` INT(8) DEFAULT '0' NULL COMMENT '补液量' AFTER `return_blood`;
27
+--显示配置里添加补液量--
28
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','rehydration_volume','补液量','2',NULL,NULL,'0');
29
+--添加显示补液量的机构 org_id为要显示的机构--
30
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','rehydration_volume','补液量','1',NULL,NULL,'0');
31
+
32
+--透后评估添加透析中进食字段--
33
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `dialysis_during` INT(8) DEFAULT '0' NULL COMMENT '透析中进食' AFTER `rehydration_volume`;
34
+--显示配置里添加透析中进食--
35
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','dialysis_during','透析中进食','2',NULL,NULL,'0');
36
+--添加显示透析中进食的机构 org_id为要显示的机构--
37
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','dialysis_during','透析中进食','1',NULL,NULL,'0');
38
+
39
+--透后评估添加出量字段--
40
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `stroke_volume` INT(8) DEFAULT '0' NULL COMMENT '出量' AFTER `dialysis_during`;
41
+--显示配置里添加出量--
42
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','stroke_volume','出量','2',NULL,NULL,'0');
43
+--添加显示出量的机构 org_id为要显示的机构--
44
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','stroke_volume','出量','1',NULL,NULL,'0');
45
+
46
+
47
+--2020-06-22 author 张保健 --
48
+--透后评估添加血流量字段--
49
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `blood_flow` TINYINT(3) DEFAULT '0' NULL COMMENT '血流量' AFTER `stroke_volume`;
50
+--数据字典表里添加血流量--
51
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '0','hemodialysis','0','血流量','blood_flow','0','2020-06-17 16:56:00','2020-06-17 16:56:00','0','1',NULL,'0',NULL,NULL,'0');
52
+--数据字典表里添加血流量配置项,parent_id为上条语句的id--
53
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '2006','hemodialysis','0','充足',NULL,'1','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
54
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '2006','hemodialysis','0','一般',NULL,'2','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
55
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '2006','hemodialysis','0','差',NULL,'3','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
56
+--显示配置里添加血流量--
57
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','blood_flow','血流量','2',NULL,NULL,'0');
58
+--添加显示血流量的机构 org_id为要显示的机构--
59
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','blood_flow','血流量','1',NULL,NULL,'0');
60
+
61
+
62
+--2020-06-23 author 张保健 --
63
+--透后评估添加封管液配置和封管液特殊字段--
64
+ALTER TABLE `sgj_xt`.`xt_assessment_after_dislysis`     ADD COLUMN `sealing_fluid_dispose` TINYINT(3) DEFAULT '0' NULL COMMENT '封管液配置' AFTER `blood_flow`,     ADD COLUMN `sealing_fluid_special` VARCHAR(100) NULL COMMENT '封管液特殊' AFTER `sealing_fluid_dispose`;
65
+
66
+--数据字典表里添加封管液配置--
67
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '0','hemodialysis','0','封管液配置','sealing_fluid_dispose','0','2020-06-17 16:56:00','2020-06-17 16:56:00','0','1',NULL,'0',NULL,NULL,'0');
68
+--数据字典表里添加体液过多症状配置项,parent_id为上条语句的id--
69
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '2010','hemodialysis','0','常规(肝素/NS)1:1',NULL,'1','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
70
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '2010','hemodialysis','0','特殊',NULL,'2','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
71
+--显示配置里添加封管液配置和封管液特殊--
72
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','sealing_fluid_dispose','封管液配置','2',NULL,NULL,'0');
73
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','5','sealing_fluid_special','封管液特殊','2',NULL,NULL,'0');
74
+--添加显示封管液配置和封管液特殊的机构 org_id为要显示的机构--
75
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','sealing_fluid_dispose','封管液配置','1',NULL,NULL,'0');
76
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','5','sealing_fluid_special','封管液特殊','1',NULL,NULL,'0');
77
+
78
+--2020-06-28 author 张保健 --
79
+--透中监测添加透析液流量字段--
80
+ALTER TABLE `sgj_xt`.`xt_monitoring_record`     ADD COLUMN `dialysate_flow` DECIMAL(10,2) DEFAULT '0.00' NULL COMMENT '透析液流量(ml/min)' AFTER `heparin`;
81
+--显示配置里添加出量--
82
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','4','dialysate_flow','透析液流量','2',NULL,NULL,'0');
83
+--添加显示出量的机构 org_id为要显示的机构--
84
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','4','dialysate_flow','透析液流量','1',NULL,NULL,'0');
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+