Browse Source

添加新字段

csx 4 years ago
parent
commit
a3a589b715

+ 22 - 1
controllers/dialysis_api_controller.go View File

@@ -139,6 +139,10 @@ func (c *DialysisApiController) PostPrescription() {
139 139
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
140 140
 	preImpules, _ := c.GetFloat("pre_impulse", 0)
141 141
 	fmt.Println("========================================================", preImpules)
142
+
143
+	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
144
+	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
145
+
142 146
 	// var prescription_doctor int64
143 147
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
144 148
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
@@ -216,6 +220,8 @@ func (c *DialysisApiController) PostPrescription() {
216 220
 		Package:                    safe_package,
217 221
 		ALiquid:                    a_liquid,
218 222
 		PreImpulse:                 preImpules,
223
+		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
224
+		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
219 225
 	}
220 226
 
221 227
 	if appRole.UserType == 2 || appRole.UserType == 1 {
@@ -1481,6 +1487,9 @@ func (c *DialysisApiController) PostSoulution() {
1481 1487
 	safe_package, _ := c.GetInt64("package", 0)
1482 1488
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
1483 1489
 
1490
+	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1491
+	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1492
+
1484 1493
 	var prescription_doctor int64
1485 1494
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1486 1495
 
@@ -1569,6 +1578,9 @@ func (c *DialysisApiController) PostSoulution() {
1569 1578
 		TubingHemodialysis:         tubing_hemodialysis,
1570 1579
 		Package:                    safe_package,
1571 1580
 		ALiquid:                    a_liquid,
1581
+
1582
+		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
1583
+		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
1572 1584
 	}
1573 1585
 
1574 1586
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
@@ -3198,6 +3210,11 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3198 3210
 	humor_excessive_symptom, _ := c.GetInt64("humor_excessive_symptom", 0)
3199 3211
 	phinholing := c.GetString("pinholing")
3200 3212
 
3213
+	catheter_suture := c.GetString("catheter_suture")
3214
+	catheter_suture_other := c.GetString("catheter_suture_other")
3215
+	edema := c.GetString("edema")
3216
+	urine_volume, _ := c.GetFloat("urine_volume", 0)
3217
+
3201 3218
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
3202 3219
 		DialysisCount:                  dialysis_count,
3203 3220
 		EmergencyTreatment:             emergency_treatment,
@@ -3249,6 +3266,10 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3249 3266
 		PunctureNeedle:                 puncture_needle,
3250 3267
 		HumorExcessiveSymptom:          humor_excessive_symptom,
3251 3268
 		Phinholing:                     phinholing,
3269
+		CatheterSuture:                 catheter_suture,
3270
+		CatheterSutureOther:            catheter_suture_other,
3271
+		Edema:                          edema,
3272
+		UrineVolume:                    urine_volume,
3252 3273
 	}
3253 3274
 
3254 3275
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
@@ -3311,7 +3332,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3311 3332
 		dewater_amount = 0
3312 3333
 		if evaluation.DryWeight > 0 {
3313 3334
 			dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
3314
-			if templateInfo.TemplateId == 17 && templateInfo.TemplateId == 22 {
3335
+			if templateInfo.TemplateId == 17 && templateInfo.TemplateId == 22 && templateInfo.TemplateId == 21 {
3315 3336
 				dewater_amount = dewater_amount * 1000
3316 3337
 			}
3317 3338
 			if dewater_amount <= 0 {

+ 15 - 9
controllers/dialysis_record_api_controller.go View File

@@ -499,15 +499,15 @@ func (this *DialysisRecordAPIController) EditMonitor() {
499 499
 			MonitoringNurse:           adminUserInfo.AdminUser.Id,
500 500
 			Conductivity:              monitorParam.Conductivity,
501 501
 			DisplacementFlowQuantity:  monitorParam.DisplacementFlowQuantity,
502
-			Status:                    1,
503
-			CreatedTime:               time.Now().Unix(),
504
-			UpdatedTime:               time.Now().Unix(),
505
-			BloodOxygenSaturation:     monitorParam.BloodOxygenSaturation,
506
-			Creator:                   adminUserInfo.AdminUser.Id,
507
-			Heparin:                   monitorParam.Heparin,
508
-			DialysateFlow:             monitorParam.DialysateFlow,
509
-			Urr:                       monitorParam.Urr,
510
-			BloodSugar:                monitorParam.BloodSugar,
502
+			Status:                1,
503
+			CreatedTime:           time.Now().Unix(),
504
+			UpdatedTime:           time.Now().Unix(),
505
+			BloodOxygenSaturation: monitorParam.BloodOxygenSaturation,
506
+			Creator:               adminUserInfo.AdminUser.Id,
507
+			Heparin:               monitorParam.Heparin,
508
+			DialysateFlow:         monitorParam.DialysateFlow,
509
+			Urr:                   monitorParam.Urr,
510
+			BloodSugar:            monitorParam.BloodSugar,
511 511
 		}
512 512
 		createErr := service.CreateMonitor(&monitor)
513 513
 		if createErr != nil {
@@ -600,6 +600,8 @@ func (this *DialysisRecordAPIController) StartDialysis() {
600 600
 	blood_drawing, _ := this.GetInt64("blood_drawing")
601 601
 	schedual_type, _ := this.GetInt64("schedual_type")
602 602
 
603
+	washpipe_nurse, _ := this.GetInt64("washpipe_nurse")
604
+
603 605
 	bedID, _ := this.GetInt64("bed")
604 606
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
605 607
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -2141,6 +2143,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
2141 2143
 		Creator:       adminUserInfo.AdminUser.Id,
2142 2144
 		Modifier:      adminUserInfo.AdminUser.Id,
2143 2145
 		SchedualType:  schedual_type,
2146
+		WashpipeNurse: washpipe_nurse,
2144 2147
 	}
2145 2148
 
2146 2149
 	createErr := service.MobileCreateDialysisOrder(adminUserInfo.CurrentOrgId, patientID, dialysisRecord)
@@ -2431,6 +2434,8 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
2431 2434
 	puncture_nurse, _ := this.GetInt64("puncture_nurse")
2432 2435
 	bedID, _ := this.GetInt64("bed")
2433 2436
 	start_time := this.GetString("start_time")
2437
+	washpipe_nurse, _ := this.GetInt64("washpipe_nurse")
2438
+
2434 2439
 	schedual_type, _ := this.GetInt64("schedual_type")
2435 2440
 
2436 2441
 	if record_id == 0 {
@@ -2560,6 +2565,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
2560 2565
 		Creator:       adminUserInfo.AdminUser.Id,
2561 2566
 		Modifier:      adminUserInfo.AdminUser.Id,
2562 2567
 		SchedualType:  schedual_type,
2568
+		WashpipeNurse: washpipe_nurse,
2563 2569
 	}
2564 2570
 
2565 2571
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

+ 36 - 22
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1033,6 +1033,9 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1033 1033
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
1034 1034
 	pre_impulse, parseDateErr := c.GetFloat("pre_impulse", 0)
1035 1035
 	fmt.Println("预冲量====", pre_impulse)
1036
+	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1037
+	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1038
+
1036 1039
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1037 1040
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
1038 1041
 	//
@@ -1113,6 +1116,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1113 1116
 		ALiquid:                    a_liquid,
1114 1117
 		TargetKtv:                  target_ktv,
1115 1118
 		PreImpulse:                 pre_impulse,
1119
+		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
1120
+		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
1116 1121
 	}
1117 1122
 
1118 1123
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -2563,6 +2568,7 @@ func (this *DialysisAPIController) StartDialysis() {
2563 2568
 
2564 2569
 	bedID, _ := this.GetInt64("bed")
2565 2570
 	start_time := this.GetString("start_time")
2571
+	washpipe_nurse, _ := this.GetInt64("washpipe_nurse")
2566 2572
 
2567 2573
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
2568 2574
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -2740,6 +2746,7 @@ func (this *DialysisAPIController) StartDialysis() {
2740 2746
 		Creator:       adminUserInfo.AdminUser.Id,
2741 2747
 		Modifier:      adminUserInfo.AdminUser.Id,
2742 2748
 		SchedualType:  schedual_type,
2749
+		WashpipeNurse: washpipe_nurse,
2743 2750
 	}
2744 2751
 
2745 2752
 	createErr := service.MobileCreateDialysisOrder(adminUserInfo.Org.Id, patientID, dialysisRecord)
@@ -4254,6 +4261,9 @@ func (c *DialysisAPIController) PostSolution() {
4254 4261
 	safe_package, _ := c.GetInt64("package", 0)
4255 4262
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
4256 4263
 
4264
+	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
4265
+	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
4266
+
4257 4267
 	if mode_id > 0 {
4258 4268
 		service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
4259 4269
 	}
@@ -4322,28 +4332,30 @@ func (c *DialysisAPIController) PostSolution() {
4322 4332
 		DialyzerPerfusionApparatus: dialyzerPerfusionApparatus,
4323 4333
 		BodyFluid:                  body_fluid,
4324 4334
 
4325
-		SpecialMedicine:      special_medicine,
4326
-		SpecialMedicineOther: special_medicine_other,
4327
-		DisplaceLiquiPart:    displace_liqui_part,
4328
-		DisplaceLiquiValue:   displace_liqui_value,
4329
-		BloodAccess:          blood_access,
4330
-		Ultrafiltration:      ultrafiltration,
4331
-		BodyFluidOther:       body_fluid_other,
4332
-		ReplacementTotal:     replacement_total,
4333
-		Niprocart:            niprocart,
4334
-		Jms:                  jms,
4335
-		FistulaNeedleSet:     fistula_needle_set,
4336
-		FistulaNeedleSet16:   fistula_needle_set_16,
4337
-		Hemoperfusion:        hemoperfusion,
4338
-		DialyserSterilised:   dialyser_sterilised,
4339
-		Filtryzer:            filtryzer,
4340
-		TargetKtv:            target_ktv,
4341
-		Dialyzers:            dialyzers,
4342
-		Injector:             injector,
4343
-		Bloodlines:           bloodlines,
4344
-		TubingHemodialysis:   tubing_hemodialysis,
4345
-		Package:              safe_package,
4346
-		ALiquid:              a_liquid,
4335
+		SpecialMedicine:           special_medicine,
4336
+		SpecialMedicineOther:      special_medicine_other,
4337
+		DisplaceLiquiPart:         displace_liqui_part,
4338
+		DisplaceLiquiValue:        displace_liqui_value,
4339
+		BloodAccess:               blood_access,
4340
+		Ultrafiltration:           ultrafiltration,
4341
+		BodyFluidOther:            body_fluid_other,
4342
+		ReplacementTotal:          replacement_total,
4343
+		Niprocart:                 niprocart,
4344
+		Jms:                       jms,
4345
+		FistulaNeedleSet:          fistula_needle_set,
4346
+		FistulaNeedleSet16:        fistula_needle_set_16,
4347
+		Hemoperfusion:             hemoperfusion,
4348
+		DialyserSterilised:        dialyser_sterilised,
4349
+		Filtryzer:                 filtryzer,
4350
+		TargetKtv:                 target_ktv,
4351
+		Dialyzers:                 dialyzers,
4352
+		Injector:                  injector,
4353
+		Bloodlines:                bloodlines,
4354
+		TubingHemodialysis:        tubing_hemodialysis,
4355
+		Package:                   safe_package,
4356
+		ALiquid:                   a_liquid,
4357
+		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
4358
+		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
4347 4359
 	}
4348 4360
 
4349 4361
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -5657,6 +5669,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
5657 5669
 	bedID, _ := this.GetInt64("bed")
5658 5670
 	start_time := this.GetString("start_time")
5659 5671
 	schedual_type, _ := this.GetInt64("schedual_type")
5672
+	washpipe_nurse, _ := this.GetInt64("washpipe_nurse")
5660 5673
 
5661 5674
 	if record_id == 0 {
5662 5675
 		this.ErrorLog("id:%v", record_id)
@@ -5784,6 +5797,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
5784 5797
 		PunctureNurse: puncture_nurse,
5785 5798
 		Creator:       adminUserInfo.AdminUser.Id,
5786 5799
 		Modifier:      adminUserInfo.AdminUser.Id,
5800
+		WashpipeNurse: washpipe_nurse,
5787 5801
 		SchedualType:  schedual_type,
5788 5802
 	}
5789 5803
 

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

@@ -32,8 +32,8 @@ func (this *LoginAPIController) LoginByPwd() {
32 32
 		return
33 33
 	}
34 34
 	ip := utils.GetIP(this.Ctx.Request)
35
-	//ssoDomain := beego.AppConfig.String("sso_domain")
36
-	ssoDomain := "http://localhost:8091"
35
+	ssoDomain := beego.AppConfig.String("sso_domain")
36
+	//ssoDomain := "http://localhost:8091"
37 37
 	api := ssoDomain + "/m/login/pwd"
38 38
 	values := make(url.Values)
39 39
 	values.Set("mobile", mobile)

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

@@ -886,7 +886,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
886 886
 	if evaluation.DryWeight > 0 {
887 887
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
888 888
 
889
-		if template.TemplateId == 17 || template.TemplateId == 22 {
889
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 {
890 890
 			dewater_amount = dewater_amount * 1000
891 891
 
892 892
 		}
@@ -1664,6 +1664,27 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
1664 1664
 		pinholing := dataBody["pinholing"].(string)
1665 1665
 		evaluation.Phinholing = pinholing
1666 1666
 	}
1667
+
1668
+	if dataBody["catheter_suture"] != nil && reflect.TypeOf(dataBody["catheter_suture"]).String() == "string" {
1669
+		catheter_suture := dataBody["catheter_suture"].(string)
1670
+		evaluation.CatheterSuture = catheter_suture
1671
+	}
1672
+
1673
+	if dataBody["catheter_suture_other"] != nil && reflect.TypeOf(dataBody["catheter_suture_other"]).String() == "string" {
1674
+		catheter_suture_other := dataBody["catheter_suture_other"].(string)
1675
+		evaluation.CatheterSutureOther = catheter_suture_other
1676
+	}
1677
+
1678
+	if dataBody["urine_volume"] != nil && reflect.TypeOf(dataBody["urine_volume"]).String() == "string" {
1679
+		urine_volume, _ := strconv.ParseFloat(dataBody["urine_volume"].(string), 64)
1680
+		evaluation.UrineVolume = urine_volume
1681
+	}
1682
+
1683
+	if dataBody["edema"] != nil && reflect.TypeOf(dataBody["edema"]).String() == "string" {
1684
+		edema := dataBody["edema"].(string)
1685
+		evaluation.Edema = edema
1686
+	}
1687
+
1667 1688
 	return
1668 1689
 }
1669 1690
 

+ 31 - 1
controllers/schedule_api_controller.go View File

@@ -36,6 +36,10 @@ func ScheduleApiRegistRouters() {
36 36
 	beego.Router("/api/schedule/export", &ScheduleApiController{}, "post:ExportSchedule")
37 37
 	beego.Router("/api/schedule_template/export", &ScheduleApiController{}, "post:ExportScheduleTemplate")
38 38
 
39
+	beego.Router("/api/schedule_template/search", &ScheduleApiController{}, "get:SearchTemplateSchedulePatients")
40
+
41
+	beego.Router("/api/schedule_template/cancel", &ScheduleApiController{}, "post:CancelScheduleTemplate")
42
+
39 43
 }
40 44
 
41 45
 func (c *ScheduleApiController) GetWeekPanels() {
@@ -1280,7 +1284,7 @@ func (this *ScheduleApiController) ExportSchedule() {
1280 1284
 		if len(schedules) > 0 {
1281 1285
 			schedule_date := time.Now().Format("2006-01-02")
1282 1286
 			date, _ := utils.ParseTimeStringToTime("2006-01-02", schedule_date)
1283
-			clear_schedule_date := date.Unix() //根据日期去清除,该日期以及未来的排班数据
1287
+			clear_schedule_date := date.Unix() //根据日期去清除,该日期未来的排班数据
1284 1288
 			err := service.UpdateScheduleStatus(clear_schedule_date, this.GetAdminUserInfo().CurrentOrgId)
1285 1289
 			if err == nil {
1286 1290
 				for _, item := range schedules {
@@ -1858,3 +1862,29 @@ func GetWeekString(week string) string {
1858 1862
 	}
1859 1863
 	return weekStr
1860 1864
 }
1865
+
1866
+func (c *ScheduleApiController) SearchTemplateSchedulePatients() {
1867
+	template_id, _ := c.GetInt64("template_id", 0)
1868
+	keywords := c.GetString("keywords")
1869
+	adminInfo := c.GetAdminUserInfo()
1870
+	scheduleItems, _ := service.GetTemplateSchedualPatientsByKeywords(keywords, adminInfo.CurrentOrgId, template_id)
1871
+	c.ServeSuccessJSON(map[string]interface{}{
1872
+		"schdules": scheduleItems,
1873
+	})
1874
+}
1875
+
1876
+func (c *ScheduleApiController) CancelScheduleTemplate() {
1877
+	item_id, _ := c.GetInt64("id")
1878
+	adminInfo := c.GetAdminUserInfo()
1879
+	err := service.UpdateNewScheduleTemplateStatus(item_id, adminInfo.CurrentOrgId)
1880
+
1881
+	if err == nil {
1882
+		c.ServeSuccessJSON(map[string]interface{}{
1883
+			"msg": "取消成功",
1884
+		})
1885
+		return
1886
+	} else {
1887
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExportError)
1888
+		return
1889
+	}
1890
+}

+ 3 - 0
models/common_models.go View File

@@ -100,6 +100,7 @@ type SgjDialysisOrder struct {
100 100
 	SchedualType   int64  `gorm:"column:schedual_type" json:"schedual_type" form:"schedual_type"`
101 101
 	Number         int64  `gorm:"column:number" json:"number" form:"number"`
102 102
 	UserName       int64  `gorm:"column:user_name" json:"user_name" form:"user_name"`
103
+	WashpipeNurse  int64  `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
103 104
 }
104 105
 
105 106
 func (SgjDialysisOrder) TableName() string {
@@ -284,6 +285,8 @@ type BloodDialysisPrescription struct {
284 285
 	IdCardNo                   string  `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
285 286
 	TotalDialysis              int64   `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
286 287
 	UserSysBeforeCount         int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
288
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
289
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
287 290
 }
288 291
 
289 292
 func (BloodDialysisPrescription) TableName() string {

+ 6 - 0
models/dialysis.go View File

@@ -268,6 +268,10 @@ type PredialysisEvaluation struct {
268 268
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other"`
269 269
 	HumorExcessiveSymptom          int64   `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom"`
270 270
 	Phinholing                     string  `gorm:"column:pinholing" json:"pinholing" form:"pinholing"`
271
+	CatheterSuture                 string  `gorm:"column:catheter_suture" json:"catheter_suture" form:"catheter_suture"`
272
+	CatheterSutureOther            string  `gorm:"column:catheter_suture_other" json:"catheter_suture_other" form:"catheter_suture_other"`
273
+	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
274
+	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
271 275
 }
272 276
 
273 277
 func (PredialysisEvaluation) TableName() string {
@@ -718,6 +722,7 @@ type DialysisOrder struct {
718 722
 	FinishModifier int64         `gorm:"column:finish_modifier" json:"finish_modifier"`
719 723
 	SchedualType   int64         `gorm:"column:schedual_type" json:"schedual_type"`
720 724
 	UserAdminRole  UserAdminRole `json:"role" gorm:"foreignkey:AdminUserId;AssociationForeignKey:StartNurse;"`
725
+	WashpipeNurse  int64         `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
721 726
 }
722 727
 
723 728
 func (DialysisOrder) TableName() string {
@@ -748,6 +753,7 @@ type XtDialysisOrder struct {
748 753
 	SchedualType   int64  `gorm:"column:schedual_type" json:"schedual_type" form:"schedual_type"`
749 754
 	Number         int64  `gorm:"column:number" json:"number" form:"number"`
750 755
 	UserName       int64  `gorm:"column:user_name" json:"user_name" form:"user_name"`
756
+	WashpipeNurse  int64  `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
751 757
 }
752 758
 
753 759
 func (XtDialysisOrder) TableName() string {

+ 1 - 0
models/monitor_models.go View File

@@ -133,6 +133,7 @@ type MonitorDialysisOrder struct {
133 133
 	FinishCreator  int64        `gorm:"column:finish_creator" json:"finish_creator"`
134 134
 	FinishModifier int64        `gorm:"column:finish_modifier" json:"finish_modifier"`
135 135
 	SchedualType   int64        `gorm:"column:schedual_type" json:"schedual_type"`
136
+	WashpipeNurse  int64        `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
136 137
 }
137 138
 
138 139
 func (MonitorDialysisOrder) TableName() string {

+ 2 - 0
models/patient_models.go View File

@@ -221,6 +221,8 @@ type DialysisPrescription struct {
221 221
 	ALiquid                    int64         `gorm:"column:a_liquid" json:"a_liquid"`
222 222
 	UserAdminRole              UserAdminRole `json:"role" gorm:"foreignkey:AdminUserId;AssociationForeignKey:Creater;"`
223 223
 	PreImpulse                 float64       `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
224
+	AnticoagulantStopTimeMin   int64         `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
225
+	AnticoagulantStopTimeHour  int64         `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
224 226
 }
225 227
 
226 228
 func (DialysisPrescription) TableName() string {

+ 4 - 0
models/user_models.go View File

@@ -189,6 +189,8 @@ type XtDialysisPrescription struct {
189 189
 	TubingHemodialysis         int64   `gorm:"column:tubing_hemodialysis" json:"tubing_hemodialysis" form:"tubing_hemodialysis"`
190 190
 	Package                    int64   `gorm:"column:package" json:"package" form:"package"`
191 191
 	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid" form:"a_liquid"`
192
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
193
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
192 194
 }
193 195
 
194 196
 func (XtDialysisPrescription) TableName() string {
@@ -267,6 +269,8 @@ type XtDialysisPrescriptions struct {
267 269
 	Package                    int64   `gorm:"column:package" json:"package" form:"package"`
268 270
 	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid" form:"a_liquid"`
269 271
 	UserName                   string  `gorm:"column:user_name" json:"user_name" form:"user_name"`
272
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
273
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
270 274
 }
271 275
 
272 276
 type XtDialysisSolution struct {

+ 7 - 5
service/mobile_dialysis_service.go View File

@@ -237,6 +237,7 @@ type MDialysisOrderVM struct {
237 237
 	FinishCreator     int64                      `gorm:"column:finish_creator" json:"finish_creator"`
238 238
 	FinishModifier    int64                      `gorm:"column:finish_modifier" json:"finish_modifier"`
239 239
 	SchedualType      int64                      `gorm:"column:schedual_type" json:"schedual_type"`
240
+	WashpipeNurse     int64                      `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
240 241
 }
241 242
 
242 243
 func (MDialysisOrderVM) TableName() string {
@@ -251,11 +252,12 @@ type MDialysisOrderVMList struct {
251 252
 	// PrescriptionId int64  `gorm:"column:prescription_id" json:"prescription_id"`
252 253
 	Stage int64 `gorm:"column:stage" json:"stage"`
253 254
 	// Remark         string `gorm:"column:remark" json:"remark"`
254
-	BedID        int64            `gorm:"column:bed_id" json:"bed_id"`
255
-	StartNurse   int64            `gorm:"column:start_nurse" json:"start_nurse"`
256
-	Status       int64            `gorm:"column:status" json:"status"`
257
-	DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
258
-	Creator      int64            `gorm:"column:creator" json:"creator"`
255
+	BedID         int64            `gorm:"column:bed_id" json:"bed_id"`
256
+	StartNurse    int64            `gorm:"column:start_nurse" json:"start_nurse"`
257
+	Status        int64            `gorm:"column:status" json:"status"`
258
+	DeviceNumber  *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
259
+	Creator       int64            `gorm:"column:creator" json:"creator"`
260
+	WashpipeNurse int64            `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
259 261
 }
260 262
 
261 263
 func (MDialysisOrderVMList) TableName() string {

+ 7 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go View File

@@ -99,6 +99,7 @@ type DialysisOrderVM struct {
99 99
 	FinishCreator  int64           `gorm:"column:finish_creator" json:"finish_creator"`
100 100
 	FinishModifier int64           `gorm:"column:finish_modifier" json:"finish_modifier"`
101 101
 	SchedualType   int64           `gorm:"column:schedual_type" json:"schedual_type"`
102
+	WashpipeNurse  int64           `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
102 103
 }
103 104
 
104 105
 func (DialysisOrderVM) TableName() string {
@@ -189,6 +190,8 @@ type PrescriptionVM struct {
189 190
 	TubingHemodialysis         int64   `gorm:"column:tubing_hemodialysis" json:"tubing_hemodialysis"`
190 191
 	Package                    int64   `gorm:"column:package" json:"package"`
191 192
 	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid"`
193
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
194
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
192 195
 }
193 196
 
194 197
 func (PrescriptionVM) TableName() string {
@@ -256,6 +259,10 @@ type AssessmentBeforeDislysisVM struct {
256 259
 	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other"`
257 260
 	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other"`
258 261
 	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other"`
262
+	CatheterSuture                 string  `gorm:"column:catheter_suture" json:"catheter_suture" form:"catheter_suture"`
263
+	CatheterSutureOther            string  `gorm:"column:catheter_suture_other" json:"catheter_suture_other" form:"catheter_suture_other"`
264
+	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
265
+	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
259 266
 }
260 267
 
261 268
 func (AssessmentBeforeDislysisVM) TableName() string {

+ 63 - 0
service/schedule_service.go View File

@@ -415,3 +415,66 @@ func GetDialysisOrderByBedId(orgID, start, bed_id int64, schedule_type int64) (s
415 415
 	err = readDb.Model(&models.DialysisOrder{}).Where("user_org_id=?  and dialysis_date=? and bed_id=? and status=1 AND schedual_type = ?", orgID, start, bed_id, schedule_type).First(&schedule).Error
416 416
 	return
417 417
 }
418
+
419
+type VMDeviceNumber struct {
420
+	ID         int64             `gorm:"column:id" json:"id"`
421
+	OrgID      int64             `gorm:"column:org_id" json:"-"`
422
+	Number     string            `gorm:"column:number" json:"number"`
423
+	GroupID    int64             `gorm:"column:group_id" json:"group_id"`
424
+	ZoneID     int64             `gorm:"column:zone_id" json:"zone_id"`
425
+	Status     int8              `json:"-"`
426
+	CreateTime int64             `gorm:"column:ctime" json:"-"`
427
+	ModifyTime int64             `gorm:"column:mtime" json:"-"`
428
+	DeviceZone models.DeviceZone `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:ZoneID;"`
429
+}
430
+
431
+func (VMDeviceNumber) TableName() string {
432
+	return "xt_device_number"
433
+}
434
+
435
+type VMPatientScheduleTemplateItem struct {
436
+	ID             int64 `gorm:"column:id" json:"id" form:"id"`
437
+	OrgID          int64 `gorm:"column:org_id" json:"-" form:"org_id"`
438
+	TemplateID     int64 `gorm:"column:template_id" json:"template_id" form:"template_id"`
439
+	DeviceNumberID int64 `gorm:"column:device_number_id" json:"device_number_id" form:"device_number_id"`
440
+	PatientID      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
441
+	TreatMode      int64 `gorm:"column:treat_mode" json:"treat_mode" form:"treat_mode"` // 治疗模式
442
+	Weekday        int8  `gorm:"column  :weekday" json:"weekday" form:"weekday"`        // 周一-周日 1-7
443
+	TimeType       int8  `gorm:"column:time_type" json:"time_type" form:"time_type"`    // 上下晚 123
444
+	Status         int8  `gorm:"column:status" json:"status" form:"status"`
445
+	CreateTime     int64 `gorm:"column:ctime" json:"-" form:"ctime"`
446
+	ModifyTime     int64 `gorm:"column:mtime" json:"-" form:"mtime"`
447
+	IsExport       int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
448
+
449
+	Patient      string         `gorm:"-" json:"patient" form:"patient"`
450
+	DeviceNumber VMDeviceNumber `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:DeviceNumberID;"`
451
+
452
+	PatientInfectiousDiseases []*models.InfectiousDiseases `json:"patient_contagions" gorm:"foreignkey:PatientId;AssociationForeignKey:PatientId;"`
453
+}
454
+
455
+func (VMPatientScheduleTemplateItem) TableName() string {
456
+	return "xt_patient_schedule_template_item"
457
+}
458
+
459
+func GetTemplateSchedualPatientsByKeywords(keywords string, org_id int64, template_id int64) (schedule []*VMPatientScheduleTemplateItem, err error) {
460
+	likeKey := "%" + keywords + "%"
461
+
462
+	err = readDb.
463
+		Table("xt_patient_schedule_template_item as s").
464
+		Preload("PatientInfectiousDiseases", "status = 1 ").
465
+		Preload("DeviceNumber", func(db *gorm.DB) *gorm.DB {
466
+			return db.Where("org_id = ? AND status = 1", org_id).Preload("DeviceZone", "org_id = ? AND status = 1", org_id)
467
+		}).
468
+		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ?)", likeKey, likeKey).
469
+		Where("s.template_id = ? AND s.org_id=?  and s.status=1", template_id, org_id).
470
+		Select("s.id, s.org_id, s.template_id, s.device_number_id, s.patient_id, s.treat_mode, s.weekday, s.time_type, s.status, s.ctime, s.mtime, p.name as patient").
471
+		Order("weekday asc").
472
+		Find(&schedule).Error
473
+	return
474
+
475
+}
476
+
477
+func UpdateNewScheduleTemplateStatus(id int64, org_id int64) (err error) {
478
+	err = readDb.Model(&models.PatientScheduleTemplateItem{}).Where("org_id = ? AND id = ?", org_id, id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
479
+	return
480
+}

+ 2 - 0
service/statistics_service/index_models.go View File

@@ -16,6 +16,8 @@ type VMDialysisPrescription struct {
16 16
 	DialysisDurationMinute     int64   `gorm:"column:dialysis_duration_minute" json:"dialysis_duration_minute"`
17 17
 	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration"`
18 18
 	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus"`
19
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
20
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
19 21
 }
20 22
 
21 23
 func (VMDialysisPrescription) TableName() string {