csx 4 år sedan
förälder
incheckning
be58163bd3

+ 1 - 1
conf/app.conf Visa fil

@@ -124,7 +124,7 @@ redisdb = 0
124 124
 
125 125
 
126 126
 
127
-                niprocart =  63
127
+niprocart =  63
128 128
 jms = 58
129 129
 fistula_needle_set = 65
130 130
 fistula_needle_set_16 = 64

+ 0 - 2
controllers/dialysis_api_controller.go Visa fil

@@ -4373,9 +4373,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
4373 4373
 
4374 4374
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4375 4375
 	dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4376
-	fmt.Println(dialysis_count)
4377 4376
 	patientInfo.TotalDialysis = dialysis_count
4378
-	fmt.Println(patientInfo.TotalDialysis)
4379 4377
 
4380 4378
 	//相关操作对应的操作人
4381 4379
 	//operators, _ := service.GetAdminUserES(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, operatorIDs)

+ 3 - 0
controllers/mobile_api_controllers/patient_api_controller.go Visa fil

@@ -2134,6 +2134,9 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
2134 2134
 		operatorIDs = append(operatorIDs, dialysisPrescription.PrescriptionDoctor)
2135 2135
 	}
2136 2136
 
2137
+	dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.Org.Id, patientInfo.ID, xttime)
2138
+	patientInfo.TotalDialysis = dialysis_count
2139
+
2137 2140
 	//临时医嘱
2138 2141
 	DoctorAdvice, _ := service.FindDoctorAdviceOrderById(adminUserInfo.Org.Id, patientInfo.ID, xttime)
2139 2142
 

+ 13 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Visa fil

@@ -4,6 +4,7 @@ import (
4 4
 	"XT_New/models"
5 5
 	p_service "XT_New/service"
6 6
 	"XT_New/utils"
7
+	"fmt"
7 8
 	"time"
8 9
 
9 10
 	"github.com/jinzhu/gorm"
@@ -47,6 +48,13 @@ func GetSchedules(orgID int64, schIDs []string) ([]*ScheduleVM, error) {
47 48
 	if err != nil {
48 49
 		return nil, err
49 50
 	}
51
+	for _, item := range schedules {
52
+		dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
53
+		fmt.Println(dialysis_count)
54
+		item.Patient.TotalDialysis = dialysis_count
55
+		fmt.Println(item.Patient.TotalDialysis)
56
+
57
+	}
50 58
 	return schedules, nil
51 59
 }
52 60
 
@@ -173,3 +181,8 @@ func GetOrgInfoTemplate(orgID int64) (models.GobalTemplate, error) {
173 181
 	err = p_service.XTReadDB().Model(&models.GobalTemplate{}).Where("org_id=? and status=1", orgID).First(&templateInfo).Error
174 182
 	return templateInfo, err
175 183
 }
184
+
185
+func GetDialysisOrderCount(orgID int64, patient_id int64, recordDate int64) (count int64, err error) {
186
+	err = p_service.XTReadDB().Model(&models.DialysisOrder{}).Where("dialysis_date <= ? AND status = 1 AND stage = 2 AND user_org_id = ? AND patient_id = ?", recordDate, orgID, patient_id).Count(&count).Error
187
+	return
188
+}