张保健 il y a 4 ans
Parent
révision
1a68e6ff84

+ 0 - 6
controllers/base_api_controller.go Voir le fichier

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

+ 6 - 0
controllers/dialysis_api_controller.go Voir le fichier

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

+ 9 - 6
controllers/dialysis_record_api_controller.go Voir le fichier

@@ -392,6 +392,7 @@ type EditMonitorParamObject struct {
392 392
 	DisplacementFlowQuantity float64 `json:"displacement_flow_quantity"`
393 393
 	BloodOxygenSaturation    string  `gorm:"column:blood_oxygen_saturation" json:"blood_oxygen_saturation" form:"blood_oxygen_saturation"`
394 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 398
 // /api/dislysis/monitor/edit [post]
@@ -490,12 +491,13 @@ func (this *DialysisRecordAPIController) EditMonitor() {
490 491
 			MonitoringNurse:          adminUserInfo.AdminUser.Id,
491 492
 			Conductivity:             monitorParam.Conductivity,
492 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 502
 		createErr := service.CreateMonitor(&monitor)
501 503
 		if createErr != nil {
@@ -556,6 +558,7 @@ func (this *DialysisRecordAPIController) EditMonitor() {
556 558
 		monitor.Modify = adminUserInfo.AdminUser.Id
557 559
 		monitor.BloodOxygenSaturation = monitorParam.BloodOxygenSaturation
558 560
 		monitor.Heparin = monitorParam.Heparin
561
+		monitor.DialysateFlow = monitorParam.DialysateFlow
559 562
 		updateErr := service.UpdateMonitor(monitor)
560 563
 		if updateErr != nil {
561 564
 			this.ErrorLog("修改透析监测记录失败:%v", updateErr)

+ 5 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go Voir le fichier

@@ -196,7 +196,11 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
196 196
 			// 获取干体重,先从干体重配置里去读,如果没有,则读取上一次透前评估的干体重
197 197
 			weight, err := service.FindLastDryWeightAdjust(adminUserInfo.Org.Id, id)
198 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 204
 			} else {
201 205
 				evaluation.DryWeight = weight.DryWeight
202 206
 			}

+ 4 - 0
controllers/mobile_api_controllers/dialysis_api_controller_extend.go Voir le fichier

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

+ 5 - 0
models/dialysis.go Voir le fichier

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

+ 1 - 0
service/dialysis_service.go Voir le fichier

@@ -612,6 +612,7 @@ func GetDialysisScheduals(orgID int64, scheduleDate int64) ([]*MDialysisSchedule
612 612
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
613 613
 		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ?", orgID).
614 614
 		Preload("Prescription", "status = 1 AND user_org_id = ?", orgID).
615
+		Preload("TreatmentSummary", "status = 1 AND user_org_id = ?", orgID).
615 616
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
616 617
 		Where("status = 1 AND user_org_id = ?", orgID)
617 618
 	if scheduleDate != 0 {

+ 1 - 0
service/mobile_dialysis_service.go Voir le fichier

@@ -91,6 +91,7 @@ type MDialysisScheduleVM struct {
91 91
 	DialysisOrder            *MDialysisOrderVMList             `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
92 92
 	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
93 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 95
 	Advices                  []*models.DoctorAdvice            `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
95 96
 }
96 97
 

+ 1 - 1
service/patient_service.go Voir le fichier

@@ -139,7 +139,7 @@ func FindPatientWithDeviceByNo(orgID int64, no string, time int64) (patient mode
139 139
 		return db.Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
140 140
 			Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
141 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 143
 	return
144 144
 }
145 145
 

+ 18 - 0
数据变更脚本.sql Voir le fichier

@@ -74,3 +74,21 @@ INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_nam
74 74
 --添加显示封管液配置和封管液特殊的机构 org_id为要显示的机构--
75 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 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
+