Browse Source

历史排班

28169 1 year ago
parent
commit
97259ecb00

+ 5 - 0
controllers/dialysis_api_controller.go View File

@@ -362,6 +362,7 @@ func (c *DialysisApiController) PostPrescription() {
362 362
 	chaptalization := c.GetString("chaptalization")
363 363
 	washing_time := c.GetString("washing_time")
364 364
 	warsh_count := c.GetString("warsh_count")
365
+	blood_access_part_id := c.GetString("blood_access_part_id")
365 366
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
366 367
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
367 368
 
@@ -482,6 +483,7 @@ func (c *DialysisApiController) PostPrescription() {
482 483
 		Chaptalization:             chaptalization,
483 484
 		WarshCount:                 warsh_count,
484 485
 		WashingTime:                washing_time,
486
+		BloodAccessPartId:          blood_access_part_id,
485 487
 	}
486 488
 
487 489
 	//长沙南雅医院,自动生成抗凝剂的临时处方
@@ -1009,6 +1011,7 @@ func (c *DialysisApiController) PostSoulution() {
1009 1011
 	chaptalization := c.GetString("chaptalization")
1010 1012
 	warsh_count := c.GetString("warsh_count")
1011 1013
 	washing_time := c.GetString("washing_time")
1014
+	blood_access_part_id := c.GetString("blood_access_part_id")
1012 1015
 	var prescription_doctor int64
1013 1016
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1014 1017
 
@@ -1179,6 +1182,7 @@ func (c *DialysisApiController) PostSoulution() {
1179 1182
 		Chaptalization:             chaptalization,
1180 1183
 		WarshCount:                 warsh_count,
1181 1184
 		WashingTime:                washing_time,
1185
+		BloodAccessPartId:          blood_access_part_id,
1182 1186
 	}
1183 1187
 
1184 1188
 	if prescription.Anticoagulant == 0 {
@@ -1387,6 +1391,7 @@ func (c *DialysisApiController) PostSoulution() {
1387 1391
 		Chaptalization:             chaptalization,
1388 1392
 		WarshCount:                 warsh_count,
1389 1393
 		WashingTime:                washing_time,
1394
+		BloodAccessPartId:          blood_access_part_id,
1390 1395
 	}
1391 1396
 
1392 1397
 	if solution.Anticoagulant == 0 {

+ 5 - 2
controllers/gobal_config_api_controller.go View File

@@ -1125,6 +1125,11 @@ func defaultSystemSolutionFormData(solution *models.SystemPrescription, data []b
1125 1125
 		solution.DialysisIrrigation = dialysisIrrigation
1126 1126
 	}
1127 1127
 
1128
+	if dataBody["blood_access_part_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_id"]).String() == "string" {
1129
+		blood_access_part_id := dataBody["blood_access_part_id"].(string)
1130
+		solution.BloodAccessPartId = blood_access_part_id
1131
+	}
1132
+
1128 1133
 	return
1129 1134
 }
1130 1135
 
@@ -1136,8 +1141,6 @@ func (c *GobalConfigApiController) GetPrintInfo() {
1136 1141
 	idsInters := dataBody["ids"].([]interface{})
1137 1142
 	advice_type, _ := c.GetInt64("advice_type")
1138 1143
 	stop_type, _ := c.GetInt64("stop_type")
1139
-	fmt.Println("advcie_type23323232322332", advice_type)
1140
-	fmt.Println("stop_type33332323223232323", stop_type)
1141 1144
 	if len(idsInters) == 0 {
1142 1145
 		if err != nil {
1143 1146
 			c.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除会员失败:(没有选择会员)")

+ 56 - 12
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1814,6 +1814,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1814 1814
 	chaptalization := c.GetString("chaptalization")
1815 1815
 	washing_time := c.GetString("washing_time")
1816 1816
 	warsh_count := c.GetString("warsh_count")
1817
+	blood_access_part_id := c.GetString("blood_access_part_id")
1818
+
1817 1819
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1818 1820
 
1819 1821
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
@@ -1976,6 +1978,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1976 1978
 		Chaptalization:             chaptalization,
1977 1979
 		WashingTime:                washing_time,
1978 1980
 		WarshCount:                 warsh_count,
1981
+		BloodAccessPartId:          blood_access_part_id,
1979 1982
 	}
1980 1983
 
1981 1984
 	//查询最近透析准备表里是否存在 透析器 灌流器
@@ -3699,6 +3702,7 @@ func (c *DialysisAPIController) PostSolution() {
3699 3702
 	chaptalization := c.GetString("chaptalization")
3700 3703
 	washing_time := c.GetString("washing_time")
3701 3704
 	warsh_count := c.GetString("warsh_count")
3705
+	blood_access_part_id := c.GetString("blood_access_part_id")
3702 3706
 	if mode_id > 0 {
3703 3707
 
3704 3708
 		var str string
@@ -3859,6 +3863,7 @@ func (c *DialysisAPIController) PostSolution() {
3859 3863
 		Chaptalization:             chaptalization,
3860 3864
 		WashingTime:                washing_time,
3861 3865
 		WarshCount:                 warsh_count,
3866
+		BloodAccessPartId:          blood_access_part_id,
3862 3867
 	}
3863 3868
 
3864 3869
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -3985,6 +3990,7 @@ func (c *DialysisAPIController) PostSolution() {
3985 3990
 		Chaptalization:             chaptalization,
3986 3991
 		WashingTime:                washing_time,
3987 3992
 		WarshCount:                 warsh_count,
3993
+		BloodAccessPartId:          blood_access_part_id,
3988 3994
 	}
3989 3995
 
3990 3996
 	//针对河间咸的
@@ -8106,21 +8112,59 @@ func (c *DialysisAPIController) GetPatientDialysisRecordList() {
8106 8112
 
8107 8113
 	timeLayout := "2006-01-02"
8108 8114
 	loc, _ := time.LoadLocation("Local")
8109
-	start_time := time.Now().Format("2006-01-02")
8115
+	//start_time := time.Now().Format("2006-01-02")
8110 8116
 
8111
-	startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
8117
+	start_time := c.GetString("start_time")
8112 8118
 
8113
-	nowTime := time.Now()
8114
-	endTime := nowTime.AddDate(-2, 0, 0)
8115
-	endTimes := endTime.Format("2006-01-02")
8116
-	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", endTimes+" 00:00:00", loc)
8119
+	end_time := c.GetString("end_time")
8120
+
8121
+	fmt.Println("start_timeo2o2o2o2o2o", start_time)
8122
+	fmt.Println("end_Time2o2o2o2ooo22", end_time)
8123
+	var startdateunix int64
8124
+	if len(start_time) > 0 {
8125
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
8126
+		fmt.Println("theTim3333333333333333333333e", theTime)
8127
+		if err != nil {
8128
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8129
+			return
8130
+		}
8131
+		startdateunix = theTime.Unix()
8132
+	}
8133
+	var enddateunix int64
8134
+	if len(end_time) > 0 {
8135
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
8136
+		if err != nil {
8137
+			utils.ErrorLog(err.Error())
8138
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8139
+			return
8140
+		}
8141
+		enddateunix = theTime.Unix()
8142
+	}
8143
+
8144
+	//startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
8145
+
8146
+	//nowTime := time.Now()
8147
+
8148
+	//endTime := nowTime.AddDate(-30, 0, 0)
8149
+	//endTimes := endTime.Format("2006-01-02")
8150
+	//endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
8151
+
8152
+	org_id := c.GetMobileAdminUserInfo().Org.Id
8153
+
8154
+	if org_id == 10579 {
8155
+		list, _ := service.GetPatientDialysisRecordListOne(id, startdateunix, enddateunix)
8156
+		c.ServeSuccessJSON(map[string]interface{}{
8157
+			"list": list,
8158
+		})
8159
+		return
8160
+	} else {
8161
+		list, _ := service.GetPatientDialysisRecordList(id, startdateunix, enddateunix)
8162
+		c.ServeSuccessJSON(map[string]interface{}{
8163
+			"list": list,
8164
+		})
8165
+		return
8166
+	}
8117 8167
 
8118
-	list, _ := service.GetPatientDialysisRecordList(id, endtime.Unix(), startime.Unix())
8119
-	fmt.Println("endtime232332322332322323232332", endTime.Unix())
8120
-	c.ServeSuccessJSON(map[string]interface{}{
8121
-		"list": list,
8122
-	})
8123
-	return
8124 8168
 }
8125 8169
 
8126 8170
 func (c *DialysisAPIController) BathDeleteAdviceList() {

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

@@ -23,6 +23,7 @@ type PatientApiController struct {
23 23
 
24 24
 func (c *PatientApiController) GetPatientInfoWithDiseases() {
25 25
 	id, _ := c.GetInt64("patient", 0)
26
+
26 27
 	if id <= 0 {
27 28
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
28 29
 		return

+ 5 - 0
controllers/patient_api_controller.go View File

@@ -1033,6 +1033,7 @@ func (c *PatientApiController) UpdateDialysisSolution() {
1033 1033
 			Amylaceum:                  solution.Amylaceum,
1034 1034
 			DialysisStrainer:           solution.DialysisStrainer,
1035 1035
 			Chaptalization:             solution.Chaptalization,
1036
+			BloodAccessPartId:          solution.BloodAccessPartId,
1036 1037
 		}
1037 1038
 		service.UpdatePatientDialysisSolutionOne(solution.PatientId, adminUserInfo.CurrentOrgId, &prescription, todayTime.Unix())
1038 1039
 	}
@@ -4629,6 +4630,10 @@ func childSolutionFormData(solution *models.DialysisSolution, data []byte, metho
4629 4630
 	}
4630 4631
 	solution.Doctor = doctor
4631 4632
 
4633
+	if dataBody["blood_access_part_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_id"]).String() == "string" {
4634
+		blood_access_part_id, _ := dataBody["blood_access_part_id"].(string)
4635
+		solution.BloodAccessPartId = blood_access_part_id
4636
+	}
4632 4637
 	return
4633 4638
 }
4634 4639
 

+ 79 - 81
controllers/sign_api_controller.go View File

@@ -8,7 +8,6 @@ import (
8 8
 	"fmt"
9 9
 	"github.com/astaxie/beego"
10 10
 	"github.com/jung-kurt/gofpdf"
11
-	"github.com/mozillazg/go-pinyin"
12 11
 	"io/ioutil"
13 12
 	"time"
14 13
 )
@@ -659,81 +658,80 @@ func (this *SignApiController) GetEnterPriseDetail() {
659 658
 func (this *SignApiController) UploadPrintOrder() {
660 659
 
661 660
 	fmt.Println("WOOWOWOWOWOWOWOWOWOWOWWOOWOWWO")
662
-	list, _ := service.GetAllPatientNew(10579)
663
-	for _, item := range list {
664
-
665
-		hans := item.Name // 要转换的汉字字符串
666
-		// 创建一个拼音转换器
667
-
668
-		p := pinyin.NewArgs()
669
-
670
-		// 将汉字转为拼音
671
-		pinyinSlice := pinyin.Pinyin(hans, p)
672
-
673
-		// 输出拼音
674
-		fmt.Println("Pinyin:", pinyinSlice)
675
-
676
-		// 获取首字母
677
-		firstLetter := ""
678
-		for _, py := range pinyinSlice {
679
-			if len(py) > 0 {
680
-				firstLetter += string(py[0][0])
681
-			}
682
-		}
683
-
684
-		item.FirstLetter = firstLetter
685
-		service.UpdatePatientNew(item.ID, item.FirstLetter)
686
-		// 输出首字母
687
-		//fmt.Println("First Letter:", firstLetter)
688
-	}
689
-
690
-	//pdf := gofpdf.New("P", "mm", "A4", "")
691
-	//pdf.AddPage()
692
-	//pdf.Text(5, 10, "血液净化治疗记录单")
661
+	//list, _ := service.GetAllPatientNew(10188)
662
+	//for _, item := range list {
693 663
 	//
694
-	//pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
695
-	//pdf.SetFont("simfang", "", 20)
696
-	//var title = "血液透析(滤过)记录表单"
697
-	////表格居中显示
698
-	//pdf.Text(70, 10, title)
699
-	//wd := pdf.GetStringWidth(title) + 100
700
-	//fmt.Println("wd", wd)
701
-	//pdf.SetY(100)            //先要设置 Y,然后再设置 X。否则,会导致 X 失效
702
-	//pdf.SetX((210 - wd) / 2) //水平居中的算法
703
-	//var numuber = "张三"
704
-	////表格居中显示
705
-	//pdf.SetFont("", "", 14) // 设置加粗字体和字号
706
-	//pdf.Text(10, 20, "姓名:"+numuber)
707
-	//pdf.SetFont("", "", 14) // 设置加粗字体和字号
708
-	//pdf.Text(35, 20, "性别:"+"男")
709
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
710
-	//pdf.Text(60, 20, "年龄:"+"18")
711
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
712
-	//pdf.Text(90, 20, "门诊:"+"住院")
713
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
714
-	//pdf.Text(120, 20, "病区:"+"A区")
715
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
716
-	//pdf.Text(150, 20, "床号:"+"1号")
717
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
718
-	//pdf.Text(180, 20, "透析号:")
719
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
720
-	//pdf.Text(210, 20, "住院号/门诊号:")
721
-	//pdf.SetFont("", "", 14) // 设置正常字体和字号
722
-	////表格居中显示
723
-	//pdf.SetFont("", "", 14) // 设置加粗字体和字号
724
-	//pdf.Text(10, 30, "入科方式:"+numuber)
725
-	//pdf.SetFont("", "", 14) // 设置加粗字体和字号
726
-	//pdf.Text(60, 30, "诊断:")
664
+	//	hans := item.Name // 要转换的汉字字符串
665
+	//	// 创建一个拼音转换器
666
+	//	p := pinyin.NewArgs()
727 667
 	//
728
-	//pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
729
-	//pdf.SetFont("simfang", "", 16) // 设置字体、字号
730
-	//pdf.SetFillColor(200, 200, 200)
731
-	////// 设置起始位置
732
-	//var x = 10.0
733
-	//var y = 40.0
734
-	//pdf.SetXY(x, y)
735
-	//// 设置填充颜色
736
-	//pdf.CellFormat(200, 15, "透析前情况", "1", 0, "CM", false, 0, "") // 使用CellFormat()方法创建表格单元格
668
+	//	// 将汉字转为拼音
669
+	//	pinyinSlice := pinyin.Pinyin(hans, p)
670
+	//
671
+	//	// 输出拼音
672
+	//	fmt.Println("Pinyin:", pinyinSlice)
673
+	//
674
+	//	// 获取首字母
675
+	//	firstLetter := ""
676
+	//	for _, py := range pinyinSlice {
677
+	//		if len(py) > 0 {
678
+	//			firstLetter += string(py[0][0])
679
+	//		}
680
+	//	}
681
+	//
682
+	//	item.FirstLetter = firstLetter
683
+	//	service.UpdatePatientNew(item.ID, item.FirstLetter)
684
+	//	// 输出首字母
685
+	//	//fmt.Println("First Letter:", firstLetter)
686
+	//}
687
+
688
+	pdf := gofpdf.New("P", "mm", "A4", "")
689
+	pdf.AddPage()
690
+	pdf.Text(5, 10, "血液净化治疗记录单")
691
+
692
+	pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
693
+	pdf.SetFont("simfang", "", 20)
694
+	var title = "血液透析(滤过)记录表单"
695
+	//表格居中显示
696
+	pdf.Text(70, 10, title)
697
+	wd := pdf.GetStringWidth(title) + 100
698
+	fmt.Println("wd", wd)
699
+	pdf.SetY(100)            //先要设置 Y,然后再设置 X。否则,会导致 X 失效
700
+	pdf.SetX((210 - wd) / 2) //水平居中的算法
701
+	var numuber = "张三"
702
+	//表格居中显示
703
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
704
+	pdf.Text(10, 20, "姓名:"+numuber)
705
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
706
+	pdf.Text(35, 20, "性别:"+"男")
707
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
708
+	pdf.Text(60, 20, "年龄:"+"18")
709
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
710
+	pdf.Text(90, 20, "门诊:"+"住院")
711
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
712
+	pdf.Text(120, 20, "病区:"+"A区")
713
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
714
+	pdf.Text(150, 20, "床号:"+"1号")
715
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
716
+	pdf.Text(180, 20, "透析号:")
717
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
718
+	pdf.Text(210, 20, "住院号/门诊号:")
719
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
720
+	//表格居中显示
721
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
722
+	pdf.Text(10, 30, "入科方式:"+numuber)
723
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
724
+	pdf.Text(60, 30, "诊断:")
725
+
726
+	pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
727
+	pdf.SetFont("simfang", "", 16) // 设置字体、字号
728
+	pdf.SetFillColor(200, 200, 200)
729
+	//// 设置起始位置
730
+	var x = 10.0
731
+	var y = 40.0
732
+	pdf.SetXY(x, y)
733
+	// 设置填充颜色
734
+	pdf.CellFormat(200, 15, "透析前情况", "1", 0, "CM", false, 0, "") // 使用CellFormat()方法创建表格单元格
737 735
 
738 736
 	//param1: 单元格的宽,为0时表示一行,单位根据new()里面设置的来
739 737
 	//param2: 单元格的高,不能为0,单位根据new()里面设置的来
@@ -792,18 +790,18 @@ func (this *SignApiController) UploadPrintOrder() {
792 790
 	//
793 791
 	//pdf.Ln(2)
794 792
 
795
-	//if err := pdf.OutputFileAndClose("6.pdf"); err != nil {
796
-	//	panic(err.Error())
797
-	//}
793
+	if err := pdf.OutputFileAndClose("6.pdf"); err != nil {
794
+		panic(err.Error())
795
+	}
798 796
 
799 797
 	// 此处可以继续绘制表格的其他部分,例如内容行等。
800 798
 	// ...
801 799
 
802 800
 	// 保存PDF文档到文件
803
-	//err := pdf.OutputFileAndClose("treatment_sheet_with_header.pdf")
804
-	//if err != nil {
805
-	//	panic(err)
806
-	//}
801
+	err := pdf.OutputFileAndClose("treatment_sheet_with_header.pdf")
802
+	if err != nil {
803
+		panic(err)
804
+	}
807 805
 
808 806
 	this.ServeSuccessJSON(map[string]interface{}{
809 807
 		//"sign":      information,

+ 9 - 3
controllers/sign_weigh_api_controller.go View File

@@ -40,7 +40,6 @@ type SignWeighAPIController struct {
40 40
 // /api/sign/patients [get]
41 41
 func (c *SignWeighAPIController) GetPatients() {
42 42
 	keywrods := c.GetString("keywords")
43
-	fmt.Println("关键字" + keywrods)
44 43
 	scheduleType, _ := c.GetInt64("schedule_type", 0)
45 44
 	needScheduleType, _ := c.GetInt64("need_schedule_type", 0)
46 45
 	nowDateTime := time.Now()
@@ -314,7 +313,6 @@ func (c *SignWeighAPIController) EditPatientSign() {
314 313
 
315 314
 func (c *SignWeighAPIController) GetPatientList() {
316 315
 	patientID, _ := c.GetInt64("patient_id", 0)
317
-	fmt.Println("patientID是设么", patientID)
318 316
 	adminUserInfo := c.GetAdminUserInfo()
319 317
 	nowDateTime := time.Now()
320 318
 	nowDate := nowDateTime.Format("2006-01-02")
@@ -325,8 +323,10 @@ func (c *SignWeighAPIController) GetPatientList() {
325 323
 	datetime := theTime.Unix()
326 324
 
327 325
 	list := service.GetPatientInformationList(adminUserInfo.CurrentOrgId, patientID, datetime)
326
+	dryWeight, _ := service.GetPatientLastDryWeight(patientID, adminUserInfo.CurrentOrgId)
328 327
 	c.ServeSuccessJSON(map[string]interface{}{
329 328
 		"patientlist": list,
329
+		"dryWeight":   dryWeight,
330 330
 	})
331 331
 	return
332 332
 }
@@ -473,10 +473,16 @@ func (c *SignWeighAPIController) Sighdata() {
473 473
 
474 474
 	} else if errord == nil {
475 475
 		service.Updatesignweigh(&sighForm, patientID, adminUserInfo.CurrentOrgId)
476
+		c.ServeSuccessJSON(map[string]interface{}{
477
+			"signs": sighForm,
478
+		})
476 479
 	} else {
477 480
 
478 481
 		service.Updatesignweigh(&sighForm, patientID, adminUserInfo.CurrentOrgId)
479
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
482
+
483
+		c.ServeSuccessJSON(map[string]interface{}{
484
+			"signs": sighForm,
485
+		})
480 486
 	}
481 487
 	return
482 488
 }

+ 18 - 0
models/dialysis.go View File

@@ -903,6 +903,24 @@ func (XtDialysisOrder) TableName() string {
903 903
 	return "xt_dialysis_order"
904 904
 }
905 905
 
906
+type XtScheduleSixTy struct {
907
+	ID                  int64  `gorm:"column:id" json:"id" form:"id"`
908
+	UserOrgId           int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
909
+	PartitionId         int64  `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
910
+	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
911
+	PatientId           int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
912
+	ScheduleDate        int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
913
+	ScheduleType        int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
914
+	ScheduleWeek        int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
915
+	ModeId              int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
916
+	Status              int64  `gorm:"column:status" json:"status" form:"status"`
917
+	CreatedTime         int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
918
+	UpdatedTime         int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
919
+	IsExport            int64  `gorm:"column:is_export" json:"is_export" form:"is_export"`
920
+	DialysisMachineName string `gorm:"column:dialysis_machine_name" json:"dialysis_machine_name" form:"dialysis_machine_name"`
921
+	Remark              string `gorm:"column:remark" json:"remark" form:"remark"`
922
+}
923
+
906 924
 type XtDialysisOrders struct {
907 925
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
908 926
 	DialysisDate   int64  `gorm:"column:dialysis_date" json:"dialysis_date" form:"dialysis_date"`

+ 1 - 0
models/gobal_models.go View File

@@ -84,6 +84,7 @@ type SystemPrescription struct {
84 84
 	TargetKtv                  float64 `gorm:"column:target_ktv" json:"target_ktv" form:"target_ktv"`
85 85
 	DialysisDialyszers         string  `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
86 86
 	DialysisIrrigation         string  `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
87
+	BloodAccessPartId          string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
87 88
 }
88 89
 
89 90
 func (SystemPrescription) TableName() string {

+ 2 - 0
models/patient_models.go View File

@@ -379,6 +379,7 @@ type DialysisPrescription struct {
379 379
 	Chaptalization             string        `gorm:"column:chaptalization" json:"chaptalization" form:"chaptalization"`
380 380
 	WarshCount                 string        `gorm:"column:warsh_count" json:"warsh_count" form:"warsh_count"`
381 381
 	WashingTime                string        `gorm:"column:washing_time" json:"washing_time" form:"washing_time"`
382
+	BloodAccessPartId          string        `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
382 383
 }
383 384
 
384 385
 func (DialysisPrescription) TableName() string {
@@ -599,6 +600,7 @@ type DialysisSolution struct {
599 600
 	Chaptalization             string  `gorm:"column:chaptalization" json:"chaptalization" form:"chaptalization"`
600 601
 	WarshCount                 string  `gorm:"column:warsh_count" json:"warsh_count" form:"warsh_count"`
601 602
 	WashingTime                string  `gorm:"column:washing_time" json:"washing_time" form:"washing_time"`
603
+	BloodAccessPartId          string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
602 604
 }
603 605
 
604 606
 func (DialysisSolution) TableName() string {

+ 21 - 0
service/mobile_dialysis_service.go View File

@@ -192,6 +192,7 @@ type MSchedualPatientVMList struct {
192 192
 	TrobleShoot        int64  `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
193 193
 	SchRemark          string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
194 194
 	ScheduleRemark     string `gorm:"column:schedule_remark" json:"schedule_remark" form:"schedule_remark"`
195
+	FirstLetter        string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
195 196
 }
196 197
 
197 198
 func (MSchedualPatientVMList) TableName() string {
@@ -269,6 +270,7 @@ type MSchedualPatientVM struct {
269 270
 	FirstTreatmentDate      int64   `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
270 271
 	ContactName             string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
271 272
 	UserSysBeforeCount      int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
273
+	FirstLetter             string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
272 274
 }
273 275
 
274 276
 func (MSchedualPatientVM) TableName() string {
@@ -4020,6 +4022,25 @@ func GetPatientDialysisRecordList(patientid int64, startime int64, endtime int64
4020 4022
 	return order, err
4021 4023
 }
4022 4024
 
4025
+func GetPatientDialysisRecordListOne(patientid int64, startime int64, endtime int64) (order []*models.XtScheduleSixTy, err error) {
4026
+
4027
+	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
4028
+	//table := XTReadDB().Table("xt_schedule as s")
4029
+	//fmt.Println(table)
4030
+	if patientid > 0 {
4031
+		db = db.Where("x.patient_id = ?", patientid)
4032
+	}
4033
+	if startime > 0 {
4034
+		db = db.Where("x.schedule_date>=?", startime)
4035
+	}
4036
+	if endtime > 0 {
4037
+		db = db.Where("x.schedule_date <= ?", endtime)
4038
+	}
4039
+
4040
+	err = db.Select("x.id,x.schedule_date,x.schedule_type,x.mode_id").Find(&order).Error
4041
+	return order, err
4042
+}
4043
+
4023 4044
 func BatchDeleteAdvice(ids []string) (err error) {
4024 4045
 
4025 4046
 	if len(ids) == 1 {

+ 2 - 2
service/patient_service.go View File

@@ -21,7 +21,7 @@ func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bind
21 21
 
22 22
 	if len(keywords) > 0 {
23 23
 		likeKey := "%" + keywords + "%"
24
-		db = db.Where("p.name LIKE ? OR p.dialysis_no LIKE ?", likeKey, likeKey)
24
+		db = db.Where("p.name LIKE ? OR p.dialysis_no LIKE ? OR p.first_letter LIKE ?", likeKey, likeKey, likeKey)
25 25
 	}
26 26
 
27 27
 	if schedulType > 0 {
@@ -2020,7 +2020,7 @@ func GetDialysisCount(orgid int64, partitionid int64) (order []*models.BloodDial
2020 2020
 
2021 2021
 func UpdatePatientDialysisSolutionOne(patientid int64, orgid int64, prescription *models.DialysisPrescription, timenow int64) error {
2022 2022
 
2023
-	err = XTWriteDB().Model(&prescription).Where("patient_id = ? and user_org_id = ? and record_date = ? ", patientid, orgid, timenow).Updates(map[string]interface{}{"dialyzer": prescription.Dialyzer, "anticoagulant": prescription.Anticoagulant, "mode_id": prescription.ModeId, "dialysis_duration_hour": prescription.DialysisDurationHour, "anticoagulant_shouji": prescription.AnticoagulantShouji, "anticoagulant_weichi": prescription.AnticoagulantWeichi, "anticoagulant_zongliang": prescription.AnticoagulantZongliang, "kalium": prescription.Kalium, "sodium": prescription.Sodium, "calcium": prescription.Calcium, "dialyzer_perfusion_apparatus": prescription.DialyzerPerfusionApparatus, "blood_access": prescription.BloodAccess, "dialysate_flow": prescription.DialysateFlow, "dialysate_temperature": prescription.DialysateTemperature, "dialysis_dialyszers": prescription.DialysisDialyszers, "dialysis_irrigation": prescription.DialysisIrrigation, "plasma_separator": prescription.PlasmaSeparator, "bilirubin_adsorption_column": prescription.BilirubinAdsorptionColumn, "oxygen_uptake": prescription.OxygenUptake, "oxygen_flow": prescription.OxygenFlow, "oxygen_time": prescription.OxygenTime, "dialysis_strainer": prescription.DialysisStrainer, "chaptalization": prescription.Chaptalization}).Error
2023
+	err = XTWriteDB().Model(&prescription).Where("patient_id = ? and user_org_id = ? and record_date = ? ", patientid, orgid, timenow).Updates(map[string]interface{}{"dialyzer": prescription.Dialyzer, "anticoagulant": prescription.Anticoagulant, "mode_id": prescription.ModeId, "dialysis_duration_hour": prescription.DialysisDurationHour, "anticoagulant_shouji": prescription.AnticoagulantShouji, "anticoagulant_weichi": prescription.AnticoagulantWeichi, "anticoagulant_zongliang": prescription.AnticoagulantZongliang, "kalium": prescription.Kalium, "sodium": prescription.Sodium, "calcium": prescription.Calcium, "dialyzer_perfusion_apparatus": prescription.DialyzerPerfusionApparatus, "blood_access": prescription.BloodAccess, "dialysate_flow": prescription.DialysateFlow, "dialysate_temperature": prescription.DialysateTemperature, "dialysis_dialyszers": prescription.DialysisDialyszers, "dialysis_irrigation": prescription.DialysisIrrigation, "plasma_separator": prescription.PlasmaSeparator, "bilirubin_adsorption_column": prescription.BilirubinAdsorptionColumn, "oxygen_uptake": prescription.OxygenUptake, "oxygen_flow": prescription.OxygenFlow, "oxygen_time": prescription.OxygenTime, "dialysis_strainer": prescription.DialysisStrainer, "chaptalization": prescription.Chaptalization, "blood_access_part_id": prescription.BloodAccessPartId}).Error
2024 2024
 	return err
2025 2025
 }
2026 2026
 

+ 1 - 1
service/schedule_service.go View File

@@ -689,7 +689,7 @@ func GetSchedualPatientsByKeywords(keywords string, org_id int64, startime int64
689 689
 		Preload("DeviceZone", "status = 1 ").
690 690
 		Preload("DeviceNumber", "status = 1 ").
691 691
 		Preload("TreatmentMode", "status = 1 ").
692
-		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ?)", likeKey, likeKey).
692
+		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ? OR p.first_letter LIKE ?)", likeKey, likeKey, likeKey).
693 693
 		Where("s.user_org_id=? and s.schedule_date >= ? and s.schedule_date <= ? and s.status=1", org_id, startime, endtime).
694 694
 		Select("s.id, s.user_org_id, s.partition_id, s.bed_id, s.patient_id, s.schedule_date, s.schedule_type, s.schedule_week, s.mode_id, s.status, s.created_time, s.updated_time, p.name as patient").
695 695
 		Order("schedule_date asc").

+ 9 - 1
service/sign_weigh_service.go View File

@@ -15,7 +15,7 @@ func GetSignPatients(orgId int64, keywords string, dateTime, schedule_type int64
15 15
 		Preload("PredialysisEvaluation", "user_org_id = ? and  assessment_date = ?", orgId, dateTime)
16 16
 	if len(keywords) > 0 {
17 17
 		likekey := "%" + keywords + "%"
18
-		db = db.Where("p.name LIKE ? OR p.dialysis_no LIKE ? ", likekey, likekey)
18
+		db = db.Where("p.name LIKE ? OR p.dialysis_no LIKE ? OR first_letter LIKE ?", likekey, likekey, likekey)
19 19
 	}
20 20
 	db = db.Where("p.status=1")
21 21
 
@@ -149,6 +149,14 @@ func GetPatientInformationList(orgid, patientId int64, datetime int64) *models.P
149 149
 	return &pre
150 150
 }
151 151
 
152
+func GetPatientLastDryWeight(patient_id int64, org_id int64) (models.SgjPatientDryweight, error) {
153
+
154
+	dryweight := models.SgjPatientDryweight{}
155
+	err := readDb.Model(&models.SgjPatientDryweight{}).Where("patient_id = ? and user_org_id = ? and status =1", patient_id, org_id).Last(&dryweight).Error
156
+
157
+	return dryweight, err
158
+}
159
+
152 160
 func GetInforByPatient(orgid, patientId int64, datetime int64) *models.AssessmentAfterDislysis {
153 161
 	var ass models.AssessmentAfterDislysis
154 162
 	err := readDb.Model(&models.AssessmentAfterDislysis{}).Where("patient_id=? and user_org_id=? and assessment_date=?", patientId, orgid, datetime).First(&ass).Error