Browse Source

耗材参数

XMLWAN 4 years ago
parent
commit
d2810e08cc

+ 7 - 1
controllers/dialysis_api_controller.go View File

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

+ 99 - 47
controllers/his_api_controller.go View File

@@ -9,6 +9,7 @@ import (
9 9
 	"encoding/json"
10 10
 	"fmt"
11 11
 	"github.com/astaxie/beego"
12
+	"github.com/jinzhu/gorm"
12 13
 	"io/ioutil"
13 14
 	"math/rand"
14 15
 	"net/http"
@@ -36,10 +37,10 @@ func HisManagerApiRegistRouters() {
36 37
 
37 38
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
38 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 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 45
 	beego.Router("/api/register/get", &HisApiController{}, "get:GetRegisterInfo")
45 46
 	beego.Router("/api/upload/get", &HisApiController{}, "get:GetUploadInfo")
@@ -449,25 +450,50 @@ func (c *HisApiController) CreateHisAdditionalCharge() {
449 450
 }
450 451
 
451 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 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 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 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 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 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 497
 	timeLayout := "2006-01-02"
472 498
 	loc, _ := time.LoadLocation("Local")
473 499
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
@@ -484,14 +510,15 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
484 510
 	sickTimes := sickTime.Unix()
485 511
 	ctime := time.Now().Unix()
486 512
 	caseHistory := models.HisPatientCaseHistory{
487
-		HisPatientId:            patient_id,
513
+		HisPatientId:            his_patient_id,
514
+		PatientId:               patient_id,
488 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 522
 		SickType:                sick_type,
496 523
 		Symptom:                 symptom,
497 524
 		SickDate:                sickTimes,
@@ -508,13 +535,26 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
508 535
 		Ctime:                   ctime,
509 536
 		Mtime:                   ctime,
510 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 559
 func (c *HisApiController) GetHisPatientCaseHistoryList() {
520 560
 	patient_id, _ := c.GetInt64("patient_id", 0)
@@ -539,25 +579,27 @@ func (c *HisApiController) GetHisPatientCaseHistory() {
539 579
 }
540 580
 func (c *HisApiController) CreateCaseHistoryTemplate() {
541 581
 	template_name := c.GetString("template_name")
582
+	fmt.Println("template_name22222222222222", template_name)
542 583
 	template_remark := c.GetString("template_remark")
543 584
 	doctor := c.GetAdminUserInfo().AdminUser.Id
544 585
 	diagnostic := c.GetString("diagnostic")
545
-	chief_conplaint := c.GetString("chief_conplaint")
586
+	chief_conplaint := c.GetString("chief_conplain")
546 587
 	history_of_present_illness := c.GetString("history_of_present_illness")
547 588
 	past_history := c.GetString("past_history")
548 589
 	personal_history := c.GetString("personal_history")
549 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 604
 	ctime := time.Now().Unix()
563 605
 
@@ -572,14 +614,15 @@ func (c *HisApiController) CreateCaseHistoryTemplate() {
572 614
 		Status:                  1,
573 615
 		Ctime:                   ctime,
574 616
 		Mtime:                   ctime,
575
-		RecordDate:              recordDateTime,
617
+		RecordDate:              time.Now().Unix(),
576 618
 		TemplateName:            template_name,
577 619
 		TemplateRemark:          template_remark,
578 620
 		Creator:                 doctor,
579 621
 		Modifier:                doctor,
622
+		UserName:                user_name,
580 623
 	}
581 624
 
582
-	err = service.SaveHisPatientCaseHistoryTemplate(template)
625
+	err := service.SaveHisPatientCaseHistoryTemplate(template)
583 626
 
584 627
 	if err == nil {
585 628
 		c.ServeSuccessJSON(map[string]interface{}{
@@ -593,10 +636,19 @@ func (c *HisApiController) CreateCaseHistoryTemplate() {
593 636
 
594 637
 }
595 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 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 649
 	c.ServeSuccessJSON(map[string]interface{}{
599 650
 		"template": template,
651
+		"history":  history,
600 652
 	})
601 653
 
602 654
 }
@@ -797,9 +849,9 @@ func (c *HisApiController) GetRegisterInfo() {
797 849
 
798 850
 }
799 851
 
800
-func (c *HisApiController) GetPrintHisPatientCaseHistory() {
801
-
802
-}
852
+//func (c *HisApiController) GetPrintHisPatientCaseHistory() {
853
+//
854
+//}
803 855
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
804 856
 
805 857
 	if json["drug_name"] == nil || reflect.TypeOf(json["drug_name"]).String() != "string" {

+ 77 - 1
controllers/his_project_api_controller.go View File

@@ -55,6 +55,10 @@ func HisProjectRouters() {
55 55
 	beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
56 56
 	beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
57 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 64
 func (this *HisProjectApiController) SaveProject() {
@@ -138,7 +142,7 @@ func (this *HisProjectApiController) SaveProject() {
138 142
 		})
139 143
 		return
140 144
 	} else if errcode == nil {
141
-		fmt.Println("3333")
145
+
142 146
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
143 147
 		return
144 148
 	}
@@ -151,7 +155,9 @@ func (this *HisProjectApiController) GetProjectList() {
151 155
 	limit, _ := this.GetInt64("limit")
152 156
 	page, _ := this.GetInt64("page")
153 157
 	is_charge, _ := this.GetInt64("is_charge")
158
+	fmt.Println("is_charge====================", is_charge)
154 159
 	is_start, _ := this.GetInt64("is_start")
160
+	fmt.Println("is_start--------------------", is_start)
155 161
 	keyword := this.GetString("keyword")
156 162
 	projecList, total, err := service.GetHisProjectList(orgId, limit, page, is_charge, is_start, keyword)
157 163
 	fmt.Println("err", err)
@@ -918,3 +924,73 @@ func (this *HisProjectApiController) ChangePatient() {
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 View File

@@ -336,7 +336,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
336 336
 
337 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 340
 		dewater_amount = dewater_amount * 1000
341 341
 
342 342
 		if dewater_amount < 0 {

+ 6 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go View File

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

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

@@ -2245,6 +2245,11 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2245 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 2253
 	return
2249 2254
 }
2250 2255
 

+ 15 - 14
models/dialysis.go View File

@@ -275,6 +275,7 @@ type PredialysisEvaluation struct {
275 275
 	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
276 276
 	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
277 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 281
 func (PredialysisEvaluation) TableName() string {
@@ -572,6 +573,7 @@ type AssessmentAfterDislysis struct {
572 573
 	SettingPressure                 string  `gorm:"column:setting_pressure" json:"setting_pressure" form:"setting_pressure"`
573 574
 	SupineDiastolicBloodPressure    string  `gorm:"column:supine_diastolic_blood_pressure" json:"supine_diastolic_blood_pressure" form:"supine_diastolic_blood_pressure"`
574 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 579
 func (AssessmentAfterDislysis) TableName() string {
@@ -957,20 +959,19 @@ func (DialysisBeforePrepare) TableName() string {
957 959
 }
958 960
 
959 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 977
 func (QueueCallConfig) TableName() string {

+ 6 - 1
models/his_models.go View File

@@ -138,10 +138,11 @@ type HisCaseHistoryTemplate struct {
138 138
 	TemplateRemark          string `gorm:"column:template_remark" json:"template_remark" form:"template_remark"`
139 139
 	Creator                 int64  `gorm:"column:creator" json:"creator" form:"creator"`
140 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 144
 func (HisCaseHistoryTemplate) TableName() string {
144
-	return "his_patient"
145
+	return "his_case_history_template"
145 146
 }
146 147
 
147 148
 type HisDoctorAdviceInfo struct {
@@ -232,6 +233,10 @@ type HisPatientCaseHistory struct {
232 233
 	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
233 234
 	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
234 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 242
 func (HisPatientCaseHistory) TableName() string {

+ 1 - 0
models/patient_models.go View File

@@ -224,6 +224,7 @@ type DialysisPrescription struct {
224 224
 	PreImpulse                 float64       `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
225 225
 	AnticoagulantStopTimeMin   int64         `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
226 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 230
 func (DialysisPrescription) TableName() string {

+ 35 - 2
service/his_project_service.go View File

@@ -36,10 +36,10 @@ func GetHisProjectList(orgid int64, limit int64, page int64, start int64, charge
36 36
 		db = db.Where("x.user_org_id = ?", orgid)
37 37
 	}
38 38
 	if start > 0 {
39
-		db = db.Where("x.medical_status = ?", start)
39
+		db = db.Where("x.medical_status = ?", charge)
40 40
 	}
41 41
 	if charge > 0 {
42
-		db = db.Where("x.is_charge = ? ", charge)
42
+		db = db.Where("x.is_charge = ? ", start)
43 43
 	}
44 44
 	if len(keyword) > 0 {
45 45
 		db = db.Where("x.project_name like ?", likeKey)
@@ -333,3 +333,36 @@ func UpdatedHisPatient(hispatientid int64, orgid int64, recorddate int64) error
333 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 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 View File

@@ -96,17 +96,46 @@ func GetHisPatientCaseHistoryList(org_id int64, patient_id int64) (caseHistorys
96 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 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 111
 	err = db.Find(&caseHistorys).Error
102 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 121
 func SaveHisPatientCaseHistoryTemplate(template models.HisCaseHistoryTemplate) (err error) {
106 122
 	err = writeDb.Create(&template).Error
107 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 139
 func SaveHisPatientCaseHistory(caseHistory models.HisPatientCaseHistory) (err error) {
111 140
 	err = writeDb.Create(&caseHistory).Error
112 141
 	return

+ 1 - 1
service/mobile_dialysis_service.go View File

@@ -1073,7 +1073,7 @@ func BatchUpdateMonitors(monitors []*models.MonitoringRecord) error {
1073 1073
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
1074 1074
 	tx := writeDb.Begin()
1075 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 1077
 	if err != nil {
1078 1078
 		tx.Rollback()
1079 1079
 		return err