28169 10 mesi fa
parent
commit
b994686a1e

+ 15 - 4
controllers/dialysis_api_controller.go Vedi File

2668
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2668
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2669
 				newprescribe.Status = 1
2669
 				newprescribe.Status = 1
2670
 
2670
 
2671
+				if adminUserInfo.CurrentOrgId == 10579 {
2672
+					newprescribe.Modifier = 0
2673
+				}
2671
 				err := service.AddSigleRecord(&newprescribe)
2674
 				err := service.AddSigleRecord(&newprescribe)
2672
 
2675
 
2673
 				//记录日志
2676
 				//记录日志
2743
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2746
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2744
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2747
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2745
 					newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2748
 					newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2746
-
2749
+					if adminUserInfo.CurrentOrgId == 10579 {
2750
+						newprescribe.Modifier = 0
2751
+					}
2747
 					err := service.AddSigleRecord(&newprescribe)
2752
 					err := service.AddSigleRecord(&newprescribe)
2748
 					//记录日志
2753
 					//记录日志
2749
 					byterequest, _ := json.Marshal(newprescribe)
2754
 					byterequest, _ := json.Marshal(newprescribe)
2786
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2791
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2787
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2792
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2788
 					newprescribe.Modifier = adminUserInfo.AdminUser.Id
2793
 					newprescribe.Modifier = adminUserInfo.AdminUser.Id
2789
-
2794
+					if adminUserInfo.CurrentOrgId == 10579 {
2795
+						newprescribe.Modifier = 0
2796
+					}
2790
 					err := service.AddSigleRecord(&newprescribe)
2797
 					err := service.AddSigleRecord(&newprescribe)
2791
 					//记录日志
2798
 					//记录日志
2792
 					byterequest, _ := json.Marshal(newprescribe)
2799
 					byterequest, _ := json.Marshal(newprescribe)
2975
 			newprescribe.TargetUltrafiltration = dewater_amount
2982
 			newprescribe.TargetUltrafiltration = dewater_amount
2976
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2983
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2977
 			newprescribe.Status = 1
2984
 			newprescribe.Status = 1
2978
-
2985
+			if adminUserInfo.CurrentOrgId == 10579 {
2986
+				newprescribe.Modifier = 0
2987
+			}
2979
 			err := service.AddSigleRecord(&newprescribe)
2988
 			err := service.AddSigleRecord(&newprescribe)
2980
 			//记录日志
2989
 			//记录日志
2981
 			byterequest, _ := json.Marshal(newprescribe)
2990
 			byterequest, _ := json.Marshal(newprescribe)
3048
 				newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
3057
 				newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
3049
 				newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
3058
 				newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
3050
 				newprescribe.Status = 1
3059
 				newprescribe.Status = 1
3051
-
3060
+				if adminUserInfo.CurrentOrgId == 10579 {
3061
+					newprescribe.Modifier = 0
3062
+				}
3052
 				err := service.AddSigleRecord(&newprescribe)
3063
 				err := service.AddSigleRecord(&newprescribe)
3053
 				//记录日志
3064
 				//记录日志
3054
 				byterequest, _ := json.Marshal(newprescribe)
3065
 				byterequest, _ := json.Marshal(newprescribe)

+ 15 - 12
controllers/his_api_controller.go Vedi File

211
 	fmt.Println(count)
211
 	fmt.Println(count)
212
 	var zero string
212
 	var zero string
213
 	number := count + 1
213
 	number := count + 1
214
-	if number >= 1000 {
215
-		zero = "0000" + strconv.FormatInt(number, 10)
216
-	} else if number >= 10000 {
217
-		zero = "000" + strconv.FormatInt(number, 10)
218
-	} else if number >= 100000 {
219
-		zero = "00" + strconv.FormatInt(number, 10)
220
-	} else if number >= 1000000 {
221
-		zero = "0" + strconv.FormatInt(number, 10)
222
-	} else {
223
-		zero = strconv.FormatInt(number, 10)
224
-	}
214
+
215
+	//if number >= 1000 {
216
+	//        zero = "0000" + strconv.FormatInt(number, 10)
217
+	//} else if number >= 10000 {
218
+	//        zero = "000" + strconv.FormatInt(number, 10)
219
+	//} else if number >= 100000 {
220
+	//        zero = "00" + strconv.FormatInt(number, 10)
221
+	//} else if number >= 1000000 {
222
+	//        zero = "0" + strconv.FormatInt(number, 10)
223
+	//} else {
224
+	zero = "0" + strconv.FormatInt(number, 10)
225
+	//}
226
+
225
 	c.ServeSuccessJSON(map[string]interface{}{
227
 	c.ServeSuccessJSON(map[string]interface{}{
226
 		"fapiao_number": zero,
228
 		"fapiao_number": zero,
227
 	})
229
 	})
228
 	return
230
 	return
229
 }
231
 }
232
+
230
 func (c *HisApiController) ChangeOrderDesc() {
233
 func (c *HisApiController) ChangeOrderDesc() {
231
 	id, _ := c.GetInt64("id")
234
 	id, _ := c.GetInt64("id")
232
 	desc := c.GetString("desc")
235
 	desc := c.GetString("desc")
3172
 	var adviceList []models.HisDoctorAdviceInfo
3175
 	var adviceList []models.HisDoctorAdviceInfo
3173
 	var projectList []models.HisPrescriptionProject
3176
 	var projectList []models.HisPrescriptionProject
3174
 
3177
 
3175
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 9504 {
3178
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10598 {
3176
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3179
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3177
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3180
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3178
 
3181
 

+ 23 - 6
controllers/his_export_data_controller.go Vedi File

113
 	var treatCostSelfTotal float64 = 0     //治疗费用
113
 	var treatCostSelfTotal float64 = 0     //治疗费用
114
 	var treatCostPartSelfTotal float64 = 0 //治疗费用
114
 	var treatCostPartSelfTotal float64 = 0 //治疗费用
115
 
115
 
116
+	var hiliCostTotal float64 = 0         //护理费
117
+	var hiliCostSelfTotal float64 = 0     //护理费
118
+	var hiliCostPartSelfTotal float64 = 0 //护理费
119
+
116
 	decimal.DivisionPrecision = 2
120
 	decimal.DivisionPrecision = 2
117
 
121
 
118
 	for _, item := range orderInfos {
122
 	for _, item := range orderInfos {
122
 			bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
126
 			bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
123
 		}
127
 		}
124
 
128
 
129
+		if item.MedChrgitmType == "07" { //床位费
130
+			hiliCostTotal, _ = decimal.NewFromFloat(hiliCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
131
+			hiliCostSelfTotal, _ = decimal.NewFromFloat(hiliCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
132
+			hiliCostPartSelfTotal, _ = decimal.NewFromFloat(hiliCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
133
+
134
+			//hiliCostSelfTotal = hiliCostTotal
135
+		}
136
+
125
 		if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
137
 		if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
126
 			if item.MedChrgitmType == "03" { //检查费
138
 			if item.MedChrgitmType == "03" { //检查费
127
 				laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
139
 				laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
217
 		"treatCostTotal":                              treatCostTotal,
229
 		"treatCostTotal":                              treatCostTotal,
218
 		"treatCostSelfTotal":                          treatCostSelfTotal,
230
 		"treatCostSelfTotal":                          treatCostSelfTotal,
219
 		"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
231
 		"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
220
-		"patient":                                     patient,
221
-		"org_name":                                    miConfig.OrgName,
222
-		"org_code":                                    miConfig.Code,
223
-		"num":                                         len(orders),
224
-		"f_time":                                      strings.Split(orders[0].SetlTime, " ")[0],
225
-		"l_time":                                      strings.Split(orders[len(orders)-1].SetlTime, " ")[0],
232
+
233
+		"hiliCostTotal":         hiliCostTotal,
234
+		"hiliCostSelfTotal":     hiliCostSelfTotal,
235
+		"hiliCostPartSelfTotal": hiliCostPartSelfTotal,
236
+
237
+		"patient":  patient,
238
+		"org_name": miConfig.OrgName,
239
+		"org_code": miConfig.Code,
240
+		"num":      len(orders),
241
+		"f_time":   strings.Split(orders[0].SetlTime, " ")[0],
242
+		"l_time":   strings.Split(orders[len(orders)-1].SetlTime, " ")[0],
226
 	})
243
 	})
227
 
244
 
228
 }
245
 }

+ 5 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go Vedi File

3404
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3404
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3405
 			}
3405
 			}
3406
 
3406
 
3407
-			if adminUserInfo.Org.Id == 10597 { //adminUserInfo.Org.Id == 9538
3407
+			if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10679 { //adminUserInfo.Org.Id == 9538
3408
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
3408
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
3409
 			}
3409
 			}
3410
 
3410
 
4443
 
4443
 
4444
 			}
4444
 			}
4445
 
4445
 
4446
-			if adminInfo.Org.Id == 10597 {
4446
+			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10679 {
4447
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
4447
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
4448
 				record.UltrafiltrationRate = ultrafiltration_rate
4448
 				record.UltrafiltrationRate = ultrafiltration_rate
4449
 			}
4449
 			}
4519
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4519
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4520
 			}
4520
 			}
4521
 
4521
 
4522
-			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10599 {
4522
+			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10599 || adminInfo.Org.Id == 10679 {
4523
 				record.UltrafiltrationRate = 0
4523
 				record.UltrafiltrationRate = 0
4524
 			}
4524
 			}
4525
 			//if template.TemplateId == 47 {
4525
 			//if template.TemplateId == 47 {
4547
 		}
4547
 		}
4548
 	}
4548
 	}
4549
 
4549
 
4550
-	if adminInfo.Org.Id == 10597 {
4550
+	if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10679 {
4551
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4551
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4552
 		record.UltrafiltrationVolume = ultrafiltration_volume
4552
 		record.UltrafiltrationVolume = ultrafiltration_volume
4553
 	}
4553
 	}
5602
 			service.CreateDialysisFinish(finish)
5602
 			service.CreateDialysisFinish(finish)
5603
 		}
5603
 		}
5604
 
5604
 
5605
-		if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9671 {
5605
+		if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10164 {
5606
 			list, err := service.CreateMGroupAdviceOne(adminUserInfo.Org.Id, advices, groupNo)
5606
 			list, err := service.CreateMGroupAdviceOne(adminUserInfo.Org.Id, advices, groupNo)
5607
 			for _, item := range advices {
5607
 			for _, item := range advices {
5608
 				byterequest, _ := json.Marshal(item)
5608
 				byterequest, _ := json.Marshal(item)

+ 25 - 5
controllers/mobile_api_controllers/patient_api_controller.go Vedi File

2722
 		newprescribe.ID = dialysisPrescription.ID
2722
 		newprescribe.ID = dialysisPrescription.ID
2723
 
2723
 
2724
 		if dialysisPrescription.ID == 0 {
2724
 		if dialysisPrescription.ID == 0 {
2725
-			if adminUserInfo.Org.Id == 10340 {
2725
+			if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
2726
 				newprescribe.Sodium = 138
2726
 				newprescribe.Sodium = 138
2727
 				newprescribe.Bicarbonate = 31.1
2727
 				newprescribe.Bicarbonate = 31.1
2728
 				newprescribe.DialysateFlow = 500
2728
 				newprescribe.DialysateFlow = 500
2729
 				newprescribe.PrescribingNumber = 1
2729
 				newprescribe.PrescribingNumber = 1
2730
 
2730
 
2731
 			}
2731
 			}
2732
+			if adminUserInfo.Org.Id == 10579 {
2733
+				newprescribe.Modifier = 0
2734
+			}
2732
 			err := service.AddSigleRecord(&newprescribe)
2735
 			err := service.AddSigleRecord(&newprescribe)
2733
 			//记录日志
2736
 			//记录日志
2734
 			byterequest, _ := json.Marshal(newprescribe)
2737
 			byterequest, _ := json.Marshal(newprescribe)
2887
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
2890
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
2888
 			newprescribe.ID = dialysisPrescription.ID
2891
 			newprescribe.ID = dialysisPrescription.ID
2889
 			if dialysisPrescription.ID == 0 {
2892
 			if dialysisPrescription.ID == 0 {
2890
-				if adminUserInfo.Org.Id == 10340 {
2893
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
2891
 					newprescribe.Sodium = 138
2894
 					newprescribe.Sodium = 138
2892
 					newprescribe.Bicarbonate = 31.1
2895
 					newprescribe.Bicarbonate = 31.1
2893
 					newprescribe.DialysateFlow = 500
2896
 					newprescribe.DialysateFlow = 500
2894
 				}
2897
 				}
2898
+				if adminUserInfo.Org.Id == 10579 {
2899
+					newprescribe.Modifier = 0
2900
+				}
2895
 				err := service.AddSigleRecord(&newprescribe)
2901
 				err := service.AddSigleRecord(&newprescribe)
2896
 
2902
 
2897
 				//记录日志
2903
 				//记录日志
2937
 				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2943
 				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2938
 				//
2944
 				//
2939
 				if appRole.UserType == 2 || appRole.UserType == 1 {
2945
 				if appRole.UserType == 2 || appRole.UserType == 1 {
2940
-					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2946
+					if adminUserInfo.Org.Id == 10579 {
2947
+						newprescribe.Modifier = 0
2948
+					} else {
2949
+						newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2950
+					}
2951
+
2941
 					if adminUserInfo.Org.Id == 9882 {
2952
 					if adminUserInfo.Org.Id == 9882 {
2942
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
2953
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
2943
 					}
2954
 					}
3042
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3053
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3043
 			newprescribe.ID = dialysisPrescription.ID
3054
 			newprescribe.ID = dialysisPrescription.ID
3044
 			if dialysisPrescription.ID == 0 {
3055
 			if dialysisPrescription.ID == 0 {
3045
-				if adminUserInfo.Org.Id == 10340 {
3056
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
3046
 					newprescribe.Sodium = 138
3057
 					newprescribe.Sodium = 138
3047
 					newprescribe.Bicarbonate = 31.1
3058
 					newprescribe.Bicarbonate = 31.1
3048
 					newprescribe.DialysateFlow = 500
3059
 					newprescribe.DialysateFlow = 500
3049
 				}
3060
 				}
3061
+				if adminUserInfo.Org.Id == 10579 {
3062
+					newprescribe.Modifier = 0
3063
+				}
3050
 				err := service.AddSigleRecord(&newprescribe)
3064
 				err := service.AddSigleRecord(&newprescribe)
3051
 				//记录日志
3065
 				//记录日志
3052
 				byterequest, _ := json.Marshal(newprescribe)
3066
 				byterequest, _ := json.Marshal(newprescribe)
3162
 			}
3176
 			}
3163
 
3177
 
3164
 			if dialysisPrescription.ID == 0 {
3178
 			if dialysisPrescription.ID == 0 {
3165
-				if adminUserInfo.Org.Id == 10340 {
3179
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
3166
 					newprescribe.Sodium = 138
3180
 					newprescribe.Sodium = 138
3167
 					newprescribe.Bicarbonate = 31.1
3181
 					newprescribe.Bicarbonate = 31.1
3168
 					newprescribe.DialysateFlow = 500
3182
 					newprescribe.DialysateFlow = 500
3169
 				}
3183
 				}
3184
+				if adminUserInfo.Org.Id == 10579 {
3185
+					newprescribe.Modifier = 0
3186
+				}
3170
 				err := service.AddSigleRecord(&newprescribe)
3187
 				err := service.AddSigleRecord(&newprescribe)
3171
 
3188
 
3172
 				//获取key,清空redis
3189
 				//获取key,清空redis
3206
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
3223
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
3207
 					}
3224
 					}
3208
 				}
3225
 				}
3226
+				if adminUserInfo.Org.Id == 10579 {
3227
+					newprescribe.Modifier = 0
3228
+				}
3209
 				err := service.UpDateDialysisPrescription(&newprescribe)
3229
 				err := service.UpDateDialysisPrescription(&newprescribe)
3210
 
3230
 
3211
 				//记录日志
3231
 				//记录日志