Browse Source

2024/6/17

28169 3 months ago
parent
commit
cbf356e9b7

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

5355
 
5355
 
5356
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
5356
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
5357
 			}
5357
 			}
5358
+
5359
+			//湘潭爱心美白石
5360
+			if adminInfo.Org.Id == 9850 {
5361
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 1000 / float64(totalMin) * 60 * 1000)
5362
+				record.UltrafiltrationRate = ultrafiltration_rate / 1000
5363
+			}
5364
+
5358
 			//if template.TemplateId == 47 {
5365
 			//if template.TemplateId == 47 {
5359
 			//	ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
5366
 			//	ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
5360
 			//	record.UltrafiltrationRate = ultrafiltration_rate
5367
 			//	record.UltrafiltrationRate = ultrafiltration_rate
5547
 		record.DisplacementQuantity = displacement_quantity
5554
 		record.DisplacementQuantity = displacement_quantity
5548
 	}
5555
 	}
5549
 
5556
 
5557
+	if adminInfo.Org.Id == 9850 {
5558
+		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5559
+		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
5560
+	}
5561
+
5550
 	lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
5562
 	lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
5551
 
5563
 
5552
 	this.ServeSuccessJSON(map[string]interface{}{
5564
 	this.ServeSuccessJSON(map[string]interface{}{

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

692
 
692
 
693
 			for _, item := range advices {
693
 			for _, item := range advices {
694
 
694
 
695
+				if item.ExecutionState == 1 {
696
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
697
+					return
698
+				}
699
+
700
+				if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
701
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
702
+					return
703
+				}
704
+
705
+				//针对普宁
706
+				if adminUserInfo.Org.Id != 10599 {
707
+
708
+					if item.StartTime > theTime.Unix() {
709
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
710
+						return
711
+					}
712
+				}
695
 				//自备药
713
 				//自备药
696
 				selfPrescriptionOutOpenOne, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
714
 				selfPrescriptionOutOpenOne, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
697
 
715
 
1148
 			advicesOne, _ := service.FindDoctorAdviceByIdsOne(adminUserInfo.Org.Id, ids)
1166
 			advicesOne, _ := service.FindDoctorAdviceByIdsOne(adminUserInfo.Org.Id, ids)
1149
 			for _, item := range advicesOne {
1167
 			for _, item := range advicesOne {
1150
 
1168
 
1169
+				if item.ExecutionState == 1 {
1170
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
1171
+					return
1172
+				}
1173
+
1174
+				if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
1175
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
1176
+					return
1177
+				}
1178
+
1179
+				//针对普宁
1180
+				if adminUserInfo.Org.Id != 10599 {
1181
+
1182
+					if item.StartTime > theTime.Unix() {
1183
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
1184
+						return
1185
+					}
1186
+				}
1187
+
1151
 				//自备药
1188
 				//自备药
1152
 				selfPrescriptionOutOpen, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
1189
 				selfPrescriptionOutOpen, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
1153
 
1190