Browse Source

2024/6/17

28169 1 month ago
parent
commit
77fc28e1d7

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10164 //机构id
86
+		subscibe.OrgId = 10318 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10318 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 12627 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10164 //机构id小英9675或4
332
+		subscibe.OrgId = 10318 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10318 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 12627 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 3 - 3
controllers/dialysis_api_controller.go View File

@@ -2573,13 +2573,13 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2573 2573
 			service.CreateDialysisFinish(finish)
2574 2574
 		}
2575 2575
 
2576
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 {
2576
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 || adminUserInfo.CurrentOrgId == 10723 {
2577 2577
 			var dewater_amount float64
2578 2578
 			dewater_amount = 0
2579 2579
 			if dry_weight > 0 {
2580 2580
 				dewater_amount = weight_before - dry_weight - additional_weight
2581 2581
 
2582
-				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 && adminUserInfo.CurrentOrgId != 10585 && adminUserInfo.CurrentOrgId != 10344 && adminUserInfo.CurrentOrgId != 10622 && adminUserInfo.CurrentOrgId != 10702 && adminUserInfo.CurrentOrgId != 10635 {
2582
+				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 && adminUserInfo.CurrentOrgId != 10585 && adminUserInfo.CurrentOrgId != 10344 && adminUserInfo.CurrentOrgId != 10622 && adminUserInfo.CurrentOrgId != 10702 && adminUserInfo.CurrentOrgId != 10635 && adminUserInfo.CurrentOrgId != 10723 {
2583 2583
 					dewater_amount = dewater_amount * 1000
2584 2584
 				}
2585 2585
 
@@ -3178,7 +3178,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3178 3178
 		}
3179 3179
 
3180 3180
 		//针对孝昌康桥超滤率计算问题
3181
-		if adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 {
3181
+		if adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 || adminUserInfo.CurrentOrgId == 10723 {
3182 3182
 			if assessmentBeforeDislysis.ID == 0 {
3183 3183
 				dialysisPrescribeOne, _ := service.MobileGetDialysisPrescribeOne(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
3184 3184
 				if dialysisPrescribeOne.ID > 0 && assessmentBeforeDislysis.ID > 0 {

+ 1 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -952,7 +952,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
952 952
 		}
953 953
 
954 954
 		//针对患者称重两次没有数据的问题
955
-		if adminUserInfo.Org.Id == 10702 {
955
+		if adminUserInfo.Org.Id == 10702 || adminUserInfo.Org.Id == 10723 {
956 956
 
957 957
 			dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
958 958
 			lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)

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

@@ -3741,6 +3741,11 @@ func (this *DialysisAPIController) StartDialysis() {
3741 3741
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3742 3742
 			}
3743 3743
 
3744
+			if adminUserInfo.Org.Id == 10723 {
3745
+				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
3746
+				ultrafiltration_rate = ultrafiltration_rate / 1000
3747
+			}
3748
+
3744 3749
 		}
3745 3750
 	}
3746 3751
 

+ 21 - 27
controllers/pharmacy_controller.go View File

@@ -185,8 +185,17 @@ func (this *PharmacyController) IssuedDrug() {
185 185
 		etime = stime + 86399
186 186
 	}
187 187
 
188
+	var patientsId []int64
189
+
190
+	patient, _ := service.GetPatientKeyWord(keyword, orgid)
191
+	if len(patient) > 0 {
192
+		for _, item := range patient {
193
+			patientsId = append(patientsId, item.ID)
194
+		}
195
+	}
196
+
188 197
 	//获取排班班次
189
-	schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
198
+	schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition, patientsId)
190 199
 
191 200
 	var ids []int64
192 201
 	for _, item := range schedule {
@@ -262,34 +271,19 @@ func (this *PharmacyController) WaitingDrug() {
262 271
 		etime = stime + 86399
263 272
 	}
264 273
 
265
-	//if orgid != 9671 && orgid != 10188 && orgid != 10217 && orgid != 3877 && orgid != 10164 && orgid != 10387 && orgid != 10375 && orgid != 10480 && orgid != 10344 {
266
-	//	//查询表里当天的数据
267
-	//	var flist []*models.TmpPatient
268
-	//	flist, err = service.GetTodayDrug(stime, etime, orgid, 0, keyword)
269
-	//
270
-	//	if err != nil {
271
-	//		utils.ErrorLog(err.Error())
272
-	//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
273
-	//		return
274
-	//	}
275
-	//	listt, err := service.PartitionAndLayout(stime, etime, orgid, shift, partition, flist)
276
-	//
277
-	//	if err != nil {
278
-	//		utils.ErrorLog(err.Error())
279
-	//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
280
-	//		return
281
-	//	}
282
-	//	baseList, _ := service.GetAllBaseDrugListTwo(orgid)
283
-	//	this.ServeSuccessJSON(map[string]interface{}{
284
-	//		"list":     listt,
285
-	//		"baseList": baseList,
286
-	//	})
287
-	//	return
288
-	//}
289
-	fmt.Println(keyword)
274
+	var patientsId []int64
275
+
276
+	patient, _ := service.GetPatientKeyWord(keyword, orgid)
277
+	fmt.Println("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", patient)
278
+	if len(patient) > 0 {
279
+		for _, item := range patient {
280
+			patientsId = append(patientsId, item.ID)
281
+		}
282
+	}
283
+
290 284
 	//当未发药的人数
291 285
 	//获取排班班次
292
-	schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
286
+	schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition, patientsId)
293 287
 	var ids []int64
294 288
 	for _, item := range schedule {
295 289
 		ids = append(ids, item.PatientId)

+ 27 - 1
service/pharmacy_service.go View File

@@ -97,7 +97,24 @@ func GetTodayAdviceCount(stime, etime, orgid, is_medicine int64) (num int, err e
97 97
 	return len(tmp), err
98 98
 }
99 99
 
100
-func GetSchedulePatientId(start_time int64, end_time int64, org_id int64, class_type int64, partion_type int64) (schedule []*models.XtSchedules, err error) {
100
+func GetPatientKeyWord(keywword string, org_id int64) (patient []*models.XtPatients, err error) {
101
+
102
+	db := XTReadDB().Model(&patient).Where("status=1")
103
+
104
+	likeKey := "%" + keywword + "%"
105
+	if len(keywword) > 0 {
106
+		db = db.Where("name like ? or first_letter like ?", likeKey, likeKey)
107
+	}
108
+	if org_id > 0 {
109
+		db = db.Where("user_org_id = ?", org_id)
110
+	}
111
+
112
+	err = db.Find(&patient).Error
113
+
114
+	return patient, err
115
+}
116
+
117
+func GetSchedulePatientId(start_time int64, end_time int64, org_id int64, class_type int64, partion_type int64, patientsId []int64) (schedule []*models.XtSchedules, err error) {
101 118
 
102 119
 	db := XTReadDB().Model(&schedule).Where("status = 1")
103 120
 
@@ -118,6 +135,15 @@ func GetSchedulePatientId(start_time int64, end_time int64, org_id int64, class_
118 135
 	if partion_type > 0 {
119 136
 		db = db.Where("partition_id = ?", partion_type)
120 137
 	}
138
+
139
+	if len(patientsId) == 0 {
140
+		db = db.Where("patient_id in(?)", patientsId)
141
+	}
142
+
143
+	if len(patientsId) > 0 {
144
+		db = db.Where("patient_id in(?)", patientsId)
145
+	}
146
+
121 147
 	err = db.Find(&schedule).Error
122 148
 
123 149
 	return schedule, err