Browse Source

添加字段

张保健 4 years ago
parent
commit
1a68e6ff84

+ 0 - 6
controllers/base_api_controller.go View File

147
 					//获取该角色的所有权限
147
 					//获取该角色的所有权限
148
 					for _, items := range userRolePurviewsArr {
148
 					for _, items := range userRolePurviewsArr {
149
 						id, _ := strconv.ParseInt(items, 10, 64)
149
 						id, _ := strconv.ParseInt(items, 10, 64)
150
-						fmt.Println(id)
151
-						fmt.Println(item.ID)
152
-
153
 						if id == item.ID {
150
 						if id == item.ID {
154
 							isPermission = true
151
 							isPermission = true
155
 						}
152
 						}
213
 					//获取该角色的所有权限
210
 					//获取该角色的所有权限
214
 					for _, items := range userRolePurviewsArr {
211
 					for _, items := range userRolePurviewsArr {
215
 						id, _ := strconv.ParseInt(items, 10, 64)
212
 						id, _ := strconv.ParseInt(items, 10, 64)
216
-						fmt.Println(id)
217
-						fmt.Println(item.ID)
218
-
219
 						if id == item.ID {
213
 						if id == item.ID {
220
 							isPermission = true
214
 							isPermission = true
221
 						}
215
 						}

+ 6 - 0
controllers/dialysis_api_controller.go View File

3960
 	displacement_flow_quantity, _ := c.GetFloat("displacement_flow_quantity", 0)
3960
 	displacement_flow_quantity, _ := c.GetFloat("displacement_flow_quantity", 0)
3961
 
3961
 
3962
 	heparin, _ := c.GetFloat("heparin", 0)
3962
 	heparin, _ := c.GetFloat("heparin", 0)
3963
+	dialysate_flow, _ := c.GetFloat("dialysate_flow", 0)
3963
 
3964
 
3964
 	ktv, _ := c.GetFloat("ktv", 0)
3965
 	ktv, _ := c.GetFloat("ktv", 0)
3965
 	symptom := c.GetString("symptom")
3966
 	symptom := c.GetString("symptom")
4017
 		Conductivity:              conductivity,
4018
 		Conductivity:              conductivity,
4018
 		DisplacementFlowQuantity:  displacement_flow_quantity,
4019
 		DisplacementFlowQuantity:  displacement_flow_quantity,
4019
 		Heparin:                   heparin,
4020
 		Heparin:                   heparin,
4021
+		DialysateFlow:             dialysate_flow,
4020
 	}
4022
 	}
4021
 
4023
 
4022
 	err := service.CreateMonitor(&monitorRecord)
4024
 	err := service.CreateMonitor(&monitorRecord)
4308
 	if AssessmentAfterDislysis.Modifier > 0 {
4310
 	if AssessmentAfterDislysis.Modifier > 0 {
4309
 		operatorIDs = append(operatorIDs, AssessmentAfterDislysis.Modifier)
4311
 		operatorIDs = append(operatorIDs, AssessmentAfterDislysis.Modifier)
4310
 	}
4312
 	}
4313
+	//上次透前评估
4314
+	lastPredialysisEvaluation, _ := service.GetLastTimePredialysisEvaluation(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4315
+	
4311
 	//透析处方
4316
 	//透析处方
4312
 	dialysisPrescription, _ := service.FindPatientPrescribeWidyDevideById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4317
 	dialysisPrescription, _ := service.FindPatientPrescribeWidyDevideById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4313
 	if dialysisPrescription.PrescriptionDoctor > 0 {
4318
 	if dialysisPrescription.PrescriptionDoctor > 0 {
4398
 		"assessmentAfterDislysis": assessmentAfterDislysis,
4403
 		"assessmentAfterDislysis": assessmentAfterDislysis,
4399
 		"predialysName":           predialysName,
4404
 		"predialysName":           predialysName,
4400
 		"FinishNuse":              FinishNuse,
4405
 		"FinishNuse":              FinishNuse,
4406
+		"lastPredialysisEvaluation": lastPredialysisEvaluation,
4401
 	})
4407
 	})
4402
 
4408
 
4403
 }
4409
 }

+ 9 - 6
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]
490
 			MonitoringNurse:          adminUserInfo.AdminUser.Id,
491
 			MonitoringNurse:          adminUserInfo.AdminUser.Id,
491
 			Conductivity:             monitorParam.Conductivity,
492
 			Conductivity:             monitorParam.Conductivity,
492
 			DisplacementFlowQuantity: monitorParam.DisplacementFlowQuantity,
493
 			DisplacementFlowQuantity: monitorParam.DisplacementFlowQuantity,
493
-			Status:                1,
494
-			CreatedTime:           time.Now().Unix(),
495
-			UpdatedTime:           time.Now().Unix(),
496
-			BloodOxygenSaturation: monitorParam.BloodOxygenSaturation,
497
-			Creator:               adminUserInfo.AdminUser.Id,
498
-			Heparin:               monitorParam.Heparin,
494
+			Status:                	  1,
495
+			CreatedTime:           	  time.Now().Unix(),
496
+			UpdatedTime:              time.Now().Unix(),
497
+			BloodOxygenSaturation:    monitorParam.BloodOxygenSaturation,
498
+			Creator:                  adminUserInfo.AdminUser.Id,
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
 			}

+ 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 {

+ 5 - 0
models/dialysis.go View File

148
 	CreatedTime             int64            `gorm:"column:created_time" json:"created_time" form:"created_time"`
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"`
149
 	UpdatedTime             int64            `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
150
 	DialysisSchedule        DialysisSchedule `gorm:"ForeignKey:PatientId"`
150
 	DialysisSchedule        DialysisSchedule `gorm:"ForeignKey:PatientId"`
151
+	InfectiousDiseases      []InfectiousDiseases `gorm:"ForeignKey:PatientId"`
151
 	Age                     int64            `gorm:"column:age" json:"age"`
152
 	Age                     int64            `gorm:"column:age" json:"age"`
152
 	IsOpenRemind            int64            `gorm:"column:is_open_remind" json:"is_open_remind"`
153
 	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
 	DialysisAge             int64            `gorm:"column:dialysis_age" json:"dialysis_age" form:"dialysis_age"`
279
 	AssessmentDate              int64   `gorm:"column:assessment_date" json:"assessment_date"`
280
 	AssessmentDate              int64   `gorm:"column:assessment_date" json:"assessment_date"`
280
 	DialysisOrderId             int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id"`
281
 	DialysisOrderId             int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id"`
281
 	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"`
282
 	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"`
283
 	WeighingWay                 string  `gorm:"column:weighing_way" json:"weighing_way"`
286
 	WeighingWay                 string  `gorm:"column:weighing_way" json:"weighing_way"`
284
 	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
287
 	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
286
 	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
289
 	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
287
 	Evaluator                   int64   `gorm:"column:evaluator" json:"evaluator"`
290
 	Evaluator                   int64   `gorm:"column:evaluator" json:"evaluator"`
288
 	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"`
289
 }
293
 }
290
 
294
 
291
 func (PredialysisEvaluationList) TableName() string {
295
 func (PredialysisEvaluationList) TableName() string {
655
 	Creator                   int64   `gorm:"column:creator" json:"creator" form:"creator"`
659
 	Creator                   int64   `gorm:"column:creator" json:"creator" form:"creator"`
656
 	Modify                    int64   `gorm:"column:modify" json:"modify" form:"modify"`
660
 	Modify                    int64   `gorm:"column:modify" json:"modify" form:"modify"`
657
 	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"`
658
 }
663
 }
659
 
664
 
660
 func (MonitoringRecord) TableName() string {
665
 func (MonitoringRecord) TableName() string {

+ 1 - 0
service/dialysis_service.go View File

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).
613
 		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ?", orgID).
614
 		Preload("Prescription", "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).
615
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
616
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
616
 		Where("status = 1 AND user_org_id = ?", orgID)
617
 		Where("status = 1 AND user_org_id = ?", orgID)
617
 	if scheduleDate != 0 {
618
 	if scheduleDate != 0 {

+ 1 - 0
service/mobile_dialysis_service.go View File

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"`
92
 	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
93
 	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
93
 	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
94
+	TreatmentSummary 		 *models.TreatmentSummary 		   `gorm:"ForeignKey:PatientId;AssociationForeignKey: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
 

+ 1 - 1
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
 

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

74
 --添加显示封管液配置和封管液特殊的机构 org_id为要显示的机构--
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');
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');
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
+