XMLWAN hace 4 años
padre
commit
d2810e08cc

+ 7 - 1
controllers/dialysis_api_controller.go Ver fichero

243
 	//push_the_protamine := c.GetString("push_the_protamine")
243
 	//push_the_protamine := c.GetString("push_the_protamine")
244
 	//fmt.Println("下机前推注鱼精蛋白",push_the_protamine)
244
 	//fmt.Println("下机前推注鱼精蛋白",push_the_protamine)
245
 	// var prescription_doctor int64
245
 	// var prescription_doctor int64
246
+	blood := c.GetString("blood")
246
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
247
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
247
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
248
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
248
 
249
 
321
 		PreImpulse:                 preImpules,
322
 		PreImpulse:                 preImpules,
322
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
323
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
323
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
324
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
325
+		Blood:                      blood,
324
 	}
326
 	}
325
 
327
 
326
 	if appRole.UserType == 2 || appRole.UserType == 1 {
328
 	if appRole.UserType == 2 || appRole.UserType == 1 {
486
 
488
 
487
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
489
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
488
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
490
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
489
-
491
+	blood := c.GetString("blood")
490
 	var prescription_doctor int64
492
 	var prescription_doctor int64
491
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
493
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
492
 
494
 
576
 
578
 
577
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
579
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
578
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
580
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
581
+		Blood:                     blood,
579
 	}
582
 	}
580
 
583
 
581
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
584
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
1011
 	assessment.SupineDiastolicBloodPressure = data.SupineDiastolicBloodPressure
1014
 	assessment.SupineDiastolicBloodPressure = data.SupineDiastolicBloodPressure
1012
 	assessment.DiastolicPressure = data.DiastolicPressure
1015
 	assessment.DiastolicPressure = data.DiastolicPressure
1013
 	assessment.AdditionalWeight = data.AdditionalWeight
1016
 	assessment.AdditionalWeight = data.AdditionalWeight
1017
+	assessment.OtherComplication = data.OtherComplication
1014
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1018
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1015
 
1019
 
1016
 	if assessment.ID > 0 {
1020
 	if assessment.ID > 0 {
1135
 	edema := c.GetString("edema")
1139
 	edema := c.GetString("edema")
1136
 	urine_volume, _ := c.GetFloat("urine_volume", 0)
1140
 	urine_volume, _ := c.GetFloat("urine_volume", 0)
1137
 	special_treatment := c.GetString("special_treatment")
1141
 	special_treatment := c.GetString("special_treatment")
1142
+	catheter_maintenance := c.GetString("catheter_maintenance")
1138
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1143
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1139
 		DialysisCount:                  dialysis_count,
1144
 		DialysisCount:                  dialysis_count,
1140
 		EmergencyTreatment:             emergency_treatment,
1145
 		EmergencyTreatment:             emergency_treatment,
1191
 		Edema:                          edema,
1196
 		Edema:                          edema,
1192
 		UrineVolume:                    urine_volume,
1197
 		UrineVolume:                    urine_volume,
1193
 		SpecialTreatment:               special_treatment,
1198
 		SpecialTreatment:               special_treatment,
1199
+		CatheterMaintenance:            catheter_maintenance,
1194
 	}
1200
 	}
1195
 
1201
 
1196
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1202
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 99 - 47
controllers/his_api_controller.go Ver fichero

9
 	"encoding/json"
9
 	"encoding/json"
10
 	"fmt"
10
 	"fmt"
11
 	"github.com/astaxie/beego"
11
 	"github.com/astaxie/beego"
12
+	"github.com/jinzhu/gorm"
12
 	"io/ioutil"
13
 	"io/ioutil"
13
 	"math/rand"
14
 	"math/rand"
14
 	"net/http"
15
 	"net/http"
36
 
37
 
37
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
38
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
38
 	beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
39
 	beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
39
-	beego.Router("/api/doctorworkstation/casehistory/create", &HisApiController{}, "post:CreateHisPatientCaseHistory")
40
-	beego.Router("/api/doctorworkstation/casehistorytemplate/create", &HisApiController{}, "post:CreateCaseHistoryTemplate")
40
+	beego.Router("/api/doctorworkstation/casehistory/create", &HisApiController{}, "get:CreateHisPatientCaseHistory")
41
+	beego.Router("/api/doctorworkstation/casehistorytemplate/create", &HisApiController{}, "get:CreateCaseHistoryTemplate")
41
 	beego.Router("/api/doctorworkstation/casehistorytemplate/get", &HisApiController{}, "get:GetCaseHistoryTemplate")
42
 	beego.Router("/api/doctorworkstation/casehistorytemplate/get", &HisApiController{}, "get:GetCaseHistoryTemplate")
42
-	beego.Router("/api/doctorworkstation/printcasehistory/get", &HisApiController{}, "get:GetPrintHisPatientCaseHistory")
43
+	//beego.Router("/api/doctorworkstation/printcasehistory/get", &HisApiController{}, "get:GetPrintHisPatientCaseHistory")
43
 
44
 
44
 	beego.Router("/api/register/get", &HisApiController{}, "get:GetRegisterInfo")
45
 	beego.Router("/api/register/get", &HisApiController{}, "get:GetRegisterInfo")
45
 	beego.Router("/api/upload/get", &HisApiController{}, "get:GetUploadInfo")
46
 	beego.Router("/api/upload/get", &HisApiController{}, "get:GetUploadInfo")
449
 }
450
 }
450
 
451
 
451
 func (c *HisApiController) CreateHisPatientCaseHistory() {
452
 func (c *HisApiController) CreateHisPatientCaseHistory() {
452
-	diagnostic := c.GetString("diagnostic")
453
-	temperature, _ := c.GetFloat("temperature")
454
-	blood_sugar, _ := c.GetFloat("blood_sugar")
455
-	pulse, _ := c.GetFloat("pulse")
456
-	sbp, _ := c.GetFloat("sbp")
457
-	dbp, _ := c.GetFloat("dbp")
458
-	blood_fat, _ := c.GetFloat("blood_fat")
459
-	height, _ := c.GetFloat("height")
460
-	sick_type, _ := c.GetInt64("sick_type")
461
-	symptom := c.GetString("symptom")
462
-	sick_date := c.GetString("sick_date")
463
-	is_infect, _ := c.GetInt64("is_infect")
453
+
454
+	blood_fat := c.GetString("blood_fat")
455
+	bloodfatfloat, _ := strconv.ParseFloat(blood_fat, 64)
456
+	fmt.Println("33333333", bloodfatfloat)
457
+	blood_sugar := c.GetString("blood_sugar")
458
+	bloodsugarfloat, _ := strconv.ParseFloat(blood_sugar, 64)
459
+	fmt.Println(bloodsugarfloat)
464
 	chief_conplaint := c.GetString("chief_conplaint")
460
 	chief_conplaint := c.GetString("chief_conplaint")
461
+
462
+	dbp := c.GetString("dbp")
463
+	dbpfloat, _ := strconv.ParseFloat(dbp, 64)
464
+	delivery_way, _ := c.GetInt64("delivery_way")
465
+	diagnostic := c.GetString("diagnostic")
466
+	fmt.Println("diagnostic", diagnostic)
467
+	family_history := c.GetString("family_history")
468
+	fmt.Println(family_history)
469
+	height := c.GetString("height")
465
 	history_of_present_illness := c.GetString("history_of_present_illness")
470
 	history_of_present_illness := c.GetString("history_of_present_illness")
471
+	is_infect, _ := c.GetInt64("is_infect")
472
+	fmt.Println("is", is_infect)
466
 	past_history := c.GetString("past_history")
473
 	past_history := c.GetString("past_history")
474
+	patient_id, _ := c.GetInt64("patient_id")
475
+	his_patient_id, _ := c.GetInt64("his_patient_id")
476
+	fmt.Println("patient_id", patient_id)
467
 	personal_history := c.GetString("personal_history")
477
 	personal_history := c.GetString("personal_history")
468
-	family_history := c.GetString("family_history")
478
+	pulse := c.GetString("pulse")
479
+	pulsefloat, _ := strconv.ParseFloat(pulse, 64)
480
+	sbp := c.GetString("sbp")
481
+	sbpfloat, _ := strconv.ParseFloat(sbp, 64)
482
+	heightfloat, _ := strconv.ParseFloat(height, 64)
483
+	sicktype := c.GetString("sick_type")
484
+	fmt.Println("sicketype", sicktype)
485
+	sick_type, _ := strconv.ParseInt(sicktype, 10, 64)
486
+	symptom := c.GetString("symptom")
487
+	sick_date := c.GetString("sick_date")
488
+	temperatures := c.GetString("temperature")
489
+	fmt.Println("temperatures", temperatures)
490
+	temperature, _ := strconv.ParseFloat(temperatures, 64)
469
 	record_date := c.GetString("record_date")
491
 	record_date := c.GetString("record_date")
470
-	patient_id, _ := c.GetInt64("patient_id")
492
+	breathing := c.GetString("breathing")
493
+	doctor_advice := c.GetString("doctor_advice")
494
+	remark := c.GetString("remark")
495
+	breathingfloat, _ := strconv.ParseFloat(breathing, 64)
496
+	fmt.Println("breathingfloat", breathingfloat)
471
 	timeLayout := "2006-01-02"
497
 	timeLayout := "2006-01-02"
472
 	loc, _ := time.LoadLocation("Local")
498
 	loc, _ := time.LoadLocation("Local")
473
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
499
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
484
 	sickTimes := sickTime.Unix()
510
 	sickTimes := sickTime.Unix()
485
 	ctime := time.Now().Unix()
511
 	ctime := time.Now().Unix()
486
 	caseHistory := models.HisPatientCaseHistory{
512
 	caseHistory := models.HisPatientCaseHistory{
487
-		HisPatientId:            patient_id,
513
+		HisPatientId:            his_patient_id,
514
+		PatientId:               patient_id,
488
 		Temperature:             temperature,
515
 		Temperature:             temperature,
489
-		BloodSugar:              blood_sugar,
490
-		Pulse:                   pulse,
491
-		Sbp:                     sbp,
492
-		Dbp:                     dbp,
493
-		Height:                  height,
494
-		BloodFat:                blood_fat,
516
+		BloodSugar:              bloodsugarfloat,
517
+		Pulse:                   pulsefloat,
518
+		Sbp:                     sbpfloat,
519
+		Dbp:                     dbpfloat,
520
+		Height:                  heightfloat,
521
+		BloodFat:                bloodfatfloat,
495
 		SickType:                sick_type,
522
 		SickType:                sick_type,
496
 		Symptom:                 symptom,
523
 		Symptom:                 symptom,
497
 		SickDate:                sickTimes,
524
 		SickDate:                sickTimes,
508
 		Ctime:                   ctime,
535
 		Ctime:                   ctime,
509
 		Mtime:                   ctime,
536
 		Mtime:                   ctime,
510
 		RecordDate:              recordDateTime,
537
 		RecordDate:              recordDateTime,
538
+		DeliveryWay:             delivery_way,
539
+		Breathing:               breathingfloat,
540
+		DoctorAdvice:            doctor_advice,
541
+		Remark:                  remark,
511
 	}
542
 	}
512
-	err = service.SaveHisPatientCaseHistory(caseHistory)
513
-	if err != nil {
514
-		c.ServeSuccessJSON(map[string]interface{}{
515
-			"msg": "保存成功",
516
-		})
543
+
544
+	//查询该患者是否有病历
545
+	_, errcode := service.GetHisPatientCaseHistoryById(his_patient_id)
546
+	if errcode == gorm.ErrRecordNotFound {
547
+		err = service.SaveHisPatientCaseHistory(caseHistory)
548
+		if err != nil {
549
+			c.ServeSuccessJSON(map[string]interface{}{
550
+				"msg": "保存成功",
551
+			})
552
+		}
553
+	} else if errcode == nil {
554
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
555
+		return
517
 	}
556
 	}
557
+
518
 }
558
 }
519
 func (c *HisApiController) GetHisPatientCaseHistoryList() {
559
 func (c *HisApiController) GetHisPatientCaseHistoryList() {
520
 	patient_id, _ := c.GetInt64("patient_id", 0)
560
 	patient_id, _ := c.GetInt64("patient_id", 0)
539
 }
579
 }
540
 func (c *HisApiController) CreateCaseHistoryTemplate() {
580
 func (c *HisApiController) CreateCaseHistoryTemplate() {
541
 	template_name := c.GetString("template_name")
581
 	template_name := c.GetString("template_name")
582
+	fmt.Println("template_name22222222222222", template_name)
542
 	template_remark := c.GetString("template_remark")
583
 	template_remark := c.GetString("template_remark")
543
 	doctor := c.GetAdminUserInfo().AdminUser.Id
584
 	doctor := c.GetAdminUserInfo().AdminUser.Id
544
 	diagnostic := c.GetString("diagnostic")
585
 	diagnostic := c.GetString("diagnostic")
545
-	chief_conplaint := c.GetString("chief_conplaint")
586
+	chief_conplaint := c.GetString("chief_conplain")
546
 	history_of_present_illness := c.GetString("history_of_present_illness")
587
 	history_of_present_illness := c.GetString("history_of_present_illness")
547
 	past_history := c.GetString("past_history")
588
 	past_history := c.GetString("past_history")
548
 	personal_history := c.GetString("personal_history")
589
 	personal_history := c.GetString("personal_history")
549
 	family_history := c.GetString("family_history")
590
 	family_history := c.GetString("family_history")
550
-	record_date := c.GetString("record_date")
551
-
552
-	timeLayout := "2006-01-02"
553
-	loc, _ := time.LoadLocation("Local")
554
-
555
-	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
556
-	if err != nil {
557
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
558
-		return
559
-	}
560
-	recordDateTime := theTime.Unix()
591
+	user_name := c.GetString("user_name")
592
+	//record_date := c.GetString("record_date")
593
+	//fmt.Println("record_date--------",record_date)
594
+	//timeLayout := "2006-01-02"
595
+	//loc, _ := time.LoadLocation("Local")
596
+	//
597
+	//theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
598
+	//if err != nil {
599
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
600
+	//	return
601
+	//}
602
+	//recordDateTime := theTime.Unix()
561
 
603
 
562
 	ctime := time.Now().Unix()
604
 	ctime := time.Now().Unix()
563
 
605
 
572
 		Status:                  1,
614
 		Status:                  1,
573
 		Ctime:                   ctime,
615
 		Ctime:                   ctime,
574
 		Mtime:                   ctime,
616
 		Mtime:                   ctime,
575
-		RecordDate:              recordDateTime,
617
+		RecordDate:              time.Now().Unix(),
576
 		TemplateName:            template_name,
618
 		TemplateName:            template_name,
577
 		TemplateRemark:          template_remark,
619
 		TemplateRemark:          template_remark,
578
 		Creator:                 doctor,
620
 		Creator:                 doctor,
579
 		Modifier:                doctor,
621
 		Modifier:                doctor,
622
+		UserName:                user_name,
580
 	}
623
 	}
581
 
624
 
582
-	err = service.SaveHisPatientCaseHistoryTemplate(template)
625
+	err := service.SaveHisPatientCaseHistoryTemplate(template)
583
 
626
 
584
 	if err == nil {
627
 	if err == nil {
585
 		c.ServeSuccessJSON(map[string]interface{}{
628
 		c.ServeSuccessJSON(map[string]interface{}{
593
 
636
 
594
 }
637
 }
595
 func (c *HisApiController) GetCaseHistoryTemplate() {
638
 func (c *HisApiController) GetCaseHistoryTemplate() {
639
+	timeLayout := "2006-01-02"
640
+	loc, _ := time.LoadLocation("Local")
641
+	keyword := c.GetString("keyword")
642
+	start_time := c.GetString("start_time")
643
+	end_time := c.GetString("end_time")
644
+	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
645
+	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
596
 	admin := c.GetAdminUserInfo()
646
 	admin := c.GetAdminUserInfo()
597
-	template, _ := service.GetHisPatientCaseHistoryTemplate(admin.CurrentOrgId)
647
+	template, _ := service.GetHisPatientCaseHistoryTemplate(admin.CurrentOrgId, startTime.Unix(), endTime.Unix(), keyword)
648
+	history, _ := service.GetHisPatientCaseHistory(admin.CurrentOrgId)
598
 	c.ServeSuccessJSON(map[string]interface{}{
649
 	c.ServeSuccessJSON(map[string]interface{}{
599
 		"template": template,
650
 		"template": template,
651
+		"history":  history,
600
 	})
652
 	})
601
 
653
 
602
 }
654
 }
797
 
849
 
798
 }
850
 }
799
 
851
 
800
-func (c *HisApiController) GetPrintHisPatientCaseHistory() {
801
-
802
-}
852
+//func (c *HisApiController) GetPrintHisPatientCaseHistory() {
853
+//
854
+//}
803
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
855
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
804
 
856
 
805
 	if json["drug_name"] == nil || reflect.TypeOf(json["drug_name"]).String() != "string" {
857
 	if json["drug_name"] == nil || reflect.TypeOf(json["drug_name"]).String() != "string" {

+ 77 - 1
controllers/his_project_api_controller.go Ver fichero

55
 	beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
55
 	beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
56
 	beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
56
 	beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
57
 	beego.Router("/api/patient/changepatient", &HisProjectApiController{}, "Get:ChangePatient")
57
 	beego.Router("/api/patient/changepatient", &HisProjectApiController{}, "Get:ChangePatient")
58
+
59
+	beego.Router("/api/patient/getpatientcasehistory", &HisProjectApiController{}, "Get:GetPatientcaseHistory")
60
+	beego.Router("/api/doctorworkstation/gettemplatedetail", &HisProjectApiController{}, "Get:GetTemplateDetail")
61
+	beego.Router("/api/doctorworkstation/updaterecordtemplate", &HisProjectApiController{}, "Get:UpdateRecordTemplate")
58
 }
62
 }
59
 
63
 
60
 func (this *HisProjectApiController) SaveProject() {
64
 func (this *HisProjectApiController) SaveProject() {
138
 		})
142
 		})
139
 		return
143
 		return
140
 	} else if errcode == nil {
144
 	} else if errcode == nil {
141
-		fmt.Println("3333")
145
+
142
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
146
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
143
 		return
147
 		return
144
 	}
148
 	}
151
 	limit, _ := this.GetInt64("limit")
155
 	limit, _ := this.GetInt64("limit")
152
 	page, _ := this.GetInt64("page")
156
 	page, _ := this.GetInt64("page")
153
 	is_charge, _ := this.GetInt64("is_charge")
157
 	is_charge, _ := this.GetInt64("is_charge")
158
+	fmt.Println("is_charge====================", is_charge)
154
 	is_start, _ := this.GetInt64("is_start")
159
 	is_start, _ := this.GetInt64("is_start")
160
+	fmt.Println("is_start--------------------", is_start)
155
 	keyword := this.GetString("keyword")
161
 	keyword := this.GetString("keyword")
156
 	projecList, total, err := service.GetHisProjectList(orgId, limit, page, is_charge, is_start, keyword)
162
 	projecList, total, err := service.GetHisProjectList(orgId, limit, page, is_charge, is_start, keyword)
157
 	fmt.Println("err", err)
163
 	fmt.Println("err", err)
918
 	}
924
 	}
919
 
925
 
920
 }
926
 }
927
+
928
+func (this *HisProjectApiController) GetPatientcaseHistory() {
929
+
930
+	patient_id, _ := this.GetInt64("patient_id")
931
+	patient, _ := service.GetBloodPatientInfoById(patient_id)
932
+	history, err := service.GetPatientCaseHistory(patient_id)
933
+	hispatient, _ := service.GetHisPatientById(patient_id)
934
+
935
+	if err != nil {
936
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
937
+		return
938
+	}
939
+	this.ServeSuccessJSON(map[string]interface{}{
940
+		"patient":    patient,
941
+		"history":    history,
942
+		"hispatient": hispatient,
943
+	})
944
+}
945
+
946
+func (this *HisProjectApiController) GetTemplateDetail() {
947
+
948
+	id, _ := this.GetInt64("id")
949
+	templateDetail, err := service.GetTemplateDetail(id)
950
+
951
+	if err != nil {
952
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
953
+		return
954
+	}
955
+	this.ServeSuccessJSON(map[string]interface{}{
956
+		"templateDetail": templateDetail,
957
+	})
958
+}
959
+
960
+func (this *HisProjectApiController) UpdateRecordTemplate() {
961
+	id, _ := this.GetInt64("id")
962
+	template_name := this.GetString("template_name")
963
+	fmt.Println("template_name22222222222222", template_name)
964
+	template_remark := this.GetString("template_remark")
965
+
966
+	diagnostic := this.GetString("diagnostic")
967
+	chief_conplaint := this.GetString("chief_conplaint")
968
+	history_of_present_illness := this.GetString("history_of_present_illness")
969
+	past_history := this.GetString("past_history")
970
+	personal_history := this.GetString("personal_history")
971
+	family_history := this.GetString("family_history")
972
+	adminUserInfo := this.GetAdminUserInfo()
973
+	creater := adminUserInfo.AdminUser.Id
974
+	historyTemplate := models.HisCaseHistoryTemplate{
975
+		HistoryOfPresentIllness: history_of_present_illness,
976
+		PastHistory:             past_history,
977
+		ChiefConplaint:          chief_conplaint,
978
+		PersonalHistory:         personal_history,
979
+		FamilyHistory:           family_history,
980
+		Diagnostic:              diagnostic,
981
+		Status:                  1,
982
+		Mtime:                   time.Now().Unix(),
983
+		RecordDate:              time.Now().Unix(),
984
+		TemplateName:            template_name,
985
+		TemplateRemark:          template_remark,
986
+		Modifier:                creater,
987
+	}
988
+	err := service.UpdateCaseHistoryTemplate(&historyTemplate, id)
989
+	if err != nil {
990
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
991
+		return
992
+	}
993
+	this.ServeSuccessJSON(map[string]interface{}{
994
+		"templateDetail": historyTemplate,
995
+	})
996
+}

+ 1 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go Ver fichero

336
 
336
 
337
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
337
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
338
 
338
 
339
-	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 {
339
+	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 {
340
 		dewater_amount = dewater_amount * 1000
340
 		dewater_amount = dewater_amount * 1000
341
 
341
 
342
 		if dewater_amount < 0 {
342
 		if dewater_amount < 0 {

+ 6 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Ver fichero

818
 	setting_pressure := c.GetString("setting_pressure")
818
 	setting_pressure := c.GetString("setting_pressure")
819
 	supine_diastolic_blood_pressure := c.GetString("supine_diastolic_blood_pressure")
819
 	supine_diastolic_blood_pressure := c.GetString("supine_diastolic_blood_pressure")
820
 	diastolic_pressure := c.GetString("diastolic_pressure")
820
 	diastolic_pressure := c.GetString("diastolic_pressure")
821
+	other_complication := c.GetString("other_complication")
821
 	if id <= 0 {
822
 	if id <= 0 {
822
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
823
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
823
 		return
824
 		return
909
 		SupineSystolicBloodPressure:  supine_systolic_blood_pressure,
910
 		SupineSystolicBloodPressure:  supine_systolic_blood_pressure,
910
 		SettingPressure:              setting_pressure,
911
 		SettingPressure:              setting_pressure,
911
 		DiastolicPressure:            diastolic_pressure,
912
 		DiastolicPressure:            diastolic_pressure,
913
+		OtherComplication:            other_complication,
912
 	}
914
 	}
913
 
915
 
914
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
916
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1042
 	fmt.Println("预冲量====", pre_impulse)
1044
 	fmt.Println("预冲量====", pre_impulse)
1043
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1045
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1044
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1046
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1045
-
1047
+	blood := c.GetString("blood")
1046
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1048
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1047
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
1049
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
1048
 	//
1050
 	//
1125
 		PreImpulse:                 pre_impulse,
1127
 		PreImpulse:                 pre_impulse,
1126
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
1128
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
1127
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
1129
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
1130
+		Blood:                      blood,
1128
 	}
1131
 	}
1129
 
1132
 
1130
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
1133
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
1803
 
1806
 
1804
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1807
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1805
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1808
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1806
-
1809
+	blood := c.GetString("blood")
1807
 	if mode_id > 0 {
1810
 	if mode_id > 0 {
1808
 		service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
1811
 		service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
1809
 	}
1812
 	}
1887
 		ALiquid:                   a_liquid,
1890
 		ALiquid:                   a_liquid,
1888
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
1891
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
1889
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
1892
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
1893
+		Blood:                     blood,
1890
 	}
1894
 	}
1891
 
1895
 
1892
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
1896
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)

+ 5 - 0
controllers/mobile_api_controllers/patient_api_controller.go Ver fichero

2245
 		evaluation.SpecialTreatment = specialTreatment
2245
 		evaluation.SpecialTreatment = specialTreatment
2246
 	}
2246
 	}
2247
 
2247
 
2248
+	if dataBody["catheter_maintenance"] != nil && reflect.TypeOf(dataBody["catheter_maintenance"]).String() == "string" {
2249
+		catheter_maintenance := dataBody["catheter_maintenance"].(string)
2250
+		evaluation.CatheterMaintenance = catheter_maintenance
2251
+	}
2252
+
2248
 	return
2253
 	return
2249
 }
2254
 }
2250
 
2255
 

+ 15 - 14
models/dialysis.go Ver fichero

275
 	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
275
 	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
276
 	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
276
 	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
277
 	SpecialTreatment               string  `gorm:"column:special_treatment" json:"special_treatment" form:"special_treatment"`
277
 	SpecialTreatment               string  `gorm:"column:special_treatment" json:"special_treatment" form:"special_treatment"`
278
+	CatheterMaintenance            string  `gorm:"column:catheter_maintenance" json:"catheter_maintenance" form:"catheter_maintenance"`
278
 }
279
 }
279
 
280
 
280
 func (PredialysisEvaluation) TableName() string {
281
 func (PredialysisEvaluation) TableName() string {
572
 	SettingPressure                 string  `gorm:"column:setting_pressure" json:"setting_pressure" form:"setting_pressure"`
573
 	SettingPressure                 string  `gorm:"column:setting_pressure" json:"setting_pressure" form:"setting_pressure"`
573
 	SupineDiastolicBloodPressure    string  `gorm:"column:supine_diastolic_blood_pressure" json:"supine_diastolic_blood_pressure" form:"supine_diastolic_blood_pressure"`
574
 	SupineDiastolicBloodPressure    string  `gorm:"column:supine_diastolic_blood_pressure" json:"supine_diastolic_blood_pressure" form:"supine_diastolic_blood_pressure"`
574
 	DiastolicPressure               string  `gorm:"column:diastolic_pressure" json:"diastolic_pressure" form:"diastolic_pressure"`
575
 	DiastolicPressure               string  `gorm:"column:diastolic_pressure" json:"diastolic_pressure" form:"diastolic_pressure"`
576
+	OtherComplication               string  `gorm:"column:other_complication" json:"other_complication" form:"other_complication"`
575
 }
577
 }
576
 
578
 
577
 func (AssessmentAfterDislysis) TableName() string {
579
 func (AssessmentAfterDislysis) TableName() string {
957
 }
959
 }
958
 
960
 
959
 type QueueCallConfig struct {
961
 type QueueCallConfig struct {
960
-	ID         	int64 `gorm:"column:id" json:"id" form:"id"`
961
-	OrgId     	int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
962
-	Qhsj  		int64 `gorm:"column:qhsj" json:"qhsj" form:"qhsj"`
963
-	Jzdcbbcs	int64 `gorm:"column:jzdcbbcs" json:"jzdcbbcs" form:"jzdcbbcs"`
964
-	Jzbbsy		int64 `gorm:"column:jzbbsy" json:"jzbbsy" form:"jzbbsy"`
965
-	Jzjhyc		int64 `gorm:"column:jzjhyc" json:"jzjhyc" form:"jzjhyc"`
966
-	Sjdcbbcs 	int64 `gorm:"column:sjdcbbcs" json:"sjdcbbcs" form:"sjdcbbcs"`
967
-	Sjbbsy 		int64 `gorm:"column:sjbbsy" json:"sjbbsy" form:"sjbbsy"`
968
-	Sjjhyc		int64 `gorm:"column:sjjhyc" json:"sjjhyc" form:"sjjhyc"`
969
-	Txxqyxs		int64 `gorm:"column:txxqyxs" json:"txxqyxs" form:"txxqyxs"`
970
-	Txglsyxs	int64 `gorm:"column:txglsyxs" json:"txglsyxs" form:"txglsyxs"`
971
-	CreateTime	int64 `gorm:"column:create_time" json:"create_time" form:"create_time"`
972
-	UpdateTime  int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
973
-
962
+	ID         int64 `gorm:"column:id" json:"id" form:"id"`
963
+	OrgId      int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
964
+	Qhsj       int64 `gorm:"column:qhsj" json:"qhsj" form:"qhsj"`
965
+	Jzdcbbcs   int64 `gorm:"column:jzdcbbcs" json:"jzdcbbcs" form:"jzdcbbcs"`
966
+	Jzbbsy     int64 `gorm:"column:jzbbsy" json:"jzbbsy" form:"jzbbsy"`
967
+	Jzjhyc     int64 `gorm:"column:jzjhyc" json:"jzjhyc" form:"jzjhyc"`
968
+	Sjdcbbcs   int64 `gorm:"column:sjdcbbcs" json:"sjdcbbcs" form:"sjdcbbcs"`
969
+	Sjbbsy     int64 `gorm:"column:sjbbsy" json:"sjbbsy" form:"sjbbsy"`
970
+	Sjjhyc     int64 `gorm:"column:sjjhyc" json:"sjjhyc" form:"sjjhyc"`
971
+	Txxqyxs    int64 `gorm:"column:txxqyxs" json:"txxqyxs" form:"txxqyxs"`
972
+	Txglsyxs   int64 `gorm:"column:txglsyxs" json:"txglsyxs" form:"txglsyxs"`
973
+	CreateTime int64 `gorm:"column:create_time" json:"create_time" form:"create_time"`
974
+	UpdateTime int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
974
 }
975
 }
975
 
976
 
976
 func (QueueCallConfig) TableName() string {
977
 func (QueueCallConfig) TableName() string {

+ 6 - 1
models/his_models.go Ver fichero

138
 	TemplateRemark          string `gorm:"column:template_remark" json:"template_remark" form:"template_remark"`
138
 	TemplateRemark          string `gorm:"column:template_remark" json:"template_remark" form:"template_remark"`
139
 	Creator                 int64  `gorm:"column:creator" json:"creator" form:"creator"`
139
 	Creator                 int64  `gorm:"column:creator" json:"creator" form:"creator"`
140
 	Modifier                int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
140
 	Modifier                int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
141
+	UserName                string `gorm:"column:user_name" json:"user_name" form:"user_name"`
141
 }
142
 }
142
 
143
 
143
 func (HisCaseHistoryTemplate) TableName() string {
144
 func (HisCaseHistoryTemplate) TableName() string {
144
-	return "his_patient"
145
+	return "his_case_history_template"
145
 }
146
 }
146
 
147
 
147
 type HisDoctorAdviceInfo struct {
148
 type HisDoctorAdviceInfo struct {
232
 	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
233
 	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
233
 	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
234
 	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
234
 	RecordDate              int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
235
 	RecordDate              int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
236
+	DeliveryWay             int64   `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
237
+	Breathing               float64 `gorm:"column:breathing" json:"breathing" form:"breathing"`
238
+	DoctorAdvice            string  `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
239
+	Remark                  string  `gorm:"column:remark" json:"remark" form:"remark"`
235
 }
240
 }
236
 
241
 
237
 func (HisPatientCaseHistory) TableName() string {
242
 func (HisPatientCaseHistory) TableName() string {

+ 1 - 0
models/patient_models.go Ver fichero

224
 	PreImpulse                 float64       `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
224
 	PreImpulse                 float64       `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
225
 	AnticoagulantStopTimeMin   int64         `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
225
 	AnticoagulantStopTimeMin   int64         `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
226
 	AnticoagulantStopTimeHour  int64         `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
226
 	AnticoagulantStopTimeHour  int64         `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
227
+	Blood                      string        `gorm:"column:blood" json:"blood"`
227
 }
228
 }
228
 
229
 
229
 func (DialysisPrescription) TableName() string {
230
 func (DialysisPrescription) TableName() string {

+ 35 - 2
service/his_project_service.go Ver fichero

36
 		db = db.Where("x.user_org_id = ?", orgid)
36
 		db = db.Where("x.user_org_id = ?", orgid)
37
 	}
37
 	}
38
 	if start > 0 {
38
 	if start > 0 {
39
-		db = db.Where("x.medical_status = ?", start)
39
+		db = db.Where("x.medical_status = ?", charge)
40
 	}
40
 	}
41
 	if charge > 0 {
41
 	if charge > 0 {
42
-		db = db.Where("x.is_charge = ? ", charge)
42
+		db = db.Where("x.is_charge = ? ", start)
43
 	}
43
 	}
44
 	if len(keyword) > 0 {
44
 	if len(keyword) > 0 {
45
 		db = db.Where("x.project_name like ?", likeKey)
45
 		db = db.Where("x.project_name like ?", likeKey)
333
 	err := XTWriteDB().Model(&hisPatient).Where("id = ? and user_org_id = ? and record_date = ?", hispatientid, orgid, recorddate).Updates(map[string]interface{}{"is_return": 3}).Error
333
 	err := XTWriteDB().Model(&hisPatient).Where("id = ? and user_org_id = ? and record_date = ?", hispatientid, orgid, recorddate).Updates(map[string]interface{}{"is_return": 3}).Error
334
 	return err
334
 	return err
335
 }
335
 }
336
+
337
+func GetBloodPatientInfoById(patientid int64) (models.XtPatients, error) {
338
+
339
+	patients := models.XtPatients{}
340
+	err := XTReadDB().Model(&patients).Where("id = ? and status = 1", patientid).Find(&patients).Error
341
+	return patients, err
342
+}
343
+
344
+func GetPatientCaseHistory(patientid int64) (models.HisPatientCaseHistory, error) {
345
+
346
+	history := models.HisPatientCaseHistory{}
347
+	err := XTReadDB().Model(&history).Where("patient_id = ? and status = 1", patientid).Find(&history).Error
348
+	return history, err
349
+}
350
+
351
+func GetHisPatientById(patientid int64) (models.HisPatient, error) {
352
+	patient := models.HisPatient{}
353
+	err := XTReadDB().Model(&patient).Where("patient_id = ? and status = 1", patientid).Find(&patient).Error
354
+	return patient, err
355
+}
356
+
357
+func GetTemplateDetail(id int64) (models.HisCaseHistoryTemplate, error) {
358
+
359
+	template := models.HisCaseHistoryTemplate{}
360
+	err := XTReadDB().Model(&template).Where("id= ? and status = 1", id).Find(&template).Error
361
+	return template, err
362
+}
363
+
364
+func UpdateCaseHistoryTemplate(tem *models.HisCaseHistoryTemplate, id int64) error {
365
+
366
+	err := XTWriteDB().Model(&tem).Where("id = ? ", id).Updates(map[string]interface{}{"history_of_present_illness": tem.HistoryOfPresentIllness, "past_history": tem.PastHistory, "chief_conplaint": tem.ChiefConplaint, "personal_history": tem.PersonalHistory, "family_history": tem.FamilyHistory, "diagnostic": tem.Diagnostic, "template_name": tem.TemplateName, "template_remark": tem.TemplateRemark, "modifier": tem.Modifier}).Error
367
+	return err
368
+}

+ 30 - 1
service/his_service.go Ver fichero

96
 	return
96
 	return
97
 }
97
 }
98
 
98
 
99
-func GetHisPatientCaseHistoryTemplate(org_id int64) (caseHistorys []*models.HisCaseHistoryTemplate, err error) {
99
+func GetHisPatientCaseHistoryTemplate(org_id int64, startime int64, endtime int64, keyword string) (caseHistorys []*models.HisCaseHistoryTemplate, err error) {
100
+	likekey := "%" + keyword + "%"
100
 	db := readDb.Model(&models.HisCaseHistoryTemplate{}).Where("user_org_id = ? AND status = 1", org_id)
101
 	db := readDb.Model(&models.HisCaseHistoryTemplate{}).Where("user_org_id = ? AND status = 1", org_id)
102
+	if startime > 0 {
103
+		db = db.Where("record_date>=?", startime)
104
+	}
105
+	if endtime > 0 {
106
+		db = db.Where("record_date<=?", endtime)
107
+	}
108
+	if len(keyword) > 0 {
109
+		db = db.Where("template_name like ? ", likekey)
110
+	}
101
 	err = db.Find(&caseHistorys).Error
111
 	err = db.Find(&caseHistorys).Error
102
 	return
112
 	return
103
 }
113
 }
104
 
114
 
115
+func GetHisPatientCaseHistory(org_id int64) (caseHistory []*models.HisPatientCaseHistory, err error) {
116
+
117
+	err = readDb.Model(&models.HisPatientCaseHistory{}).Where("user_org_id = ? and status = 1", org_id).Find(&caseHistory).Error
118
+	return caseHistory, err
119
+}
120
+
105
 func SaveHisPatientCaseHistoryTemplate(template models.HisCaseHistoryTemplate) (err error) {
121
 func SaveHisPatientCaseHistoryTemplate(template models.HisCaseHistoryTemplate) (err error) {
106
 	err = writeDb.Create(&template).Error
122
 	err = writeDb.Create(&template).Error
107
 	return
123
 	return
108
 }
124
 }
109
 
125
 
126
+func GetHisPatientCaseHistoryById(hispatientid int64) (*models.HisPatientCaseHistory, error) {
127
+	history := models.HisPatientCaseHistory{}
128
+	err := XTReadDB().Model(&history).Where("his_patient_id = ? and status = 1", hispatientid).Find(&history).Error
129
+	if err != nil {
130
+		if err == gorm.ErrRecordNotFound {
131
+			return nil, err
132
+		} else {
133
+			return nil, err
134
+		}
135
+	}
136
+	return &history, nil
137
+}
138
+
110
 func SaveHisPatientCaseHistory(caseHistory models.HisPatientCaseHistory) (err error) {
139
 func SaveHisPatientCaseHistory(caseHistory models.HisPatientCaseHistory) (err error) {
111
 	err = writeDb.Create(&caseHistory).Error
140
 	err = writeDb.Create(&caseHistory).Error
112
 	return
141
 	return

+ 1 - 1
service/mobile_dialysis_service.go Ver fichero

1073
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
1073
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
1074
 	tx := writeDb.Begin()
1074
 	tx := writeDb.Begin()
1075
 	updateTime := time.Now().Unix()
1075
 	updateTime := time.Now().Unix()
1076
-	err := tx.Model(&models.DialysisOrder{}).Where("user_org_id = ? AND id = ? AND status = 1 ", order.UserOrgId, order.ID).Updates(map[string]interface{}{"start_nurse": order.StartNurse, "updated_time": updateTime, "bed_id": order.BedID, "puncture_nurse": order.PunctureNurse, "start_time": order.StartTime, "modifier": order.Modifier, "schedual_type": order.SchedualType}).Error
1076
+	err := tx.Model(&models.DialysisOrder{}).Where("user_org_id = ? AND id = ? AND status = 1 ", order.UserOrgId, order.ID).Updates(map[string]interface{}{"start_nurse": order.StartNurse, "updated_time": updateTime, "bed_id": order.BedID, "puncture_nurse": order.PunctureNurse, "start_time": order.StartTime, "modifier": order.Modifier, "schedual_type": order.SchedualType, "washpipe_nurse": order.WashpipeNurse}).Error
1077
 	if err != nil {
1077
 	if err != nil {
1078
 		tx.Rollback()
1078
 		tx.Rollback()
1079
 		return err
1079
 		return err