|
@@ -96,6 +96,162 @@ func HisManagerApiRegistRouters() {
|
96
|
96
|
|
97
|
97
|
beego.Router("/api/refunddetail/post", &HisApiController{}, "post:RefudDetail")
|
98
|
98
|
|
|
99
|
+ beego.Router("/api/privateexpensesorder/get", &HisApiController{}, "get:GetPrivateExpensesOrder")
|
|
100
|
+
|
|
101
|
+ beego.Router("/api/uncharge/list", &HisApiController{}, "get:GetHisUnChargePatientList")
|
|
102
|
+
|
|
103
|
+}
|
|
104
|
+
|
|
105
|
+func (c *HisApiController) GetHisUnChargePatientList() {
|
|
106
|
+ record_date := c.GetString("record_date")
|
|
107
|
+ timeLayout := "2006-01-02"
|
|
108
|
+ loc, _ := time.LoadLocation("Local")
|
|
109
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
110
|
+ if err != nil {
|
|
111
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
112
|
+ return
|
|
113
|
+ }
|
|
114
|
+ recordDateTime := theTime.Unix()
|
|
115
|
+ adminInfo := c.GetAdminUserInfo()
|
|
116
|
+ var tempPatients []*service.NewTempPatients
|
|
117
|
+
|
|
118
|
+ tempPatients, _ = service.GetNewAllUnChargeHisPatientList(adminInfo.CurrentOrgId, "", recordDateTime)
|
|
119
|
+ var patients []*service.NewTempPatients
|
|
120
|
+ var patients_two []*service.NewTempPatients
|
|
121
|
+
|
|
122
|
+ for _, item := range tempPatients {
|
|
123
|
+
|
|
124
|
+ if len(item.HisPatient) > 0 || len(item.HisPrescription) > 0 {
|
|
125
|
+ patients = append(patients, item)
|
|
126
|
+ }
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+ if len(item.HisPatient) > 0 {
|
|
130
|
+ patients_two = append(patients_two, item)
|
|
131
|
+ }
|
|
132
|
+ }
|
|
133
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
134
|
+ "list": patients,
|
|
135
|
+ "list_two": patients_two,
|
|
136
|
+ })
|
|
137
|
+}
|
|
138
|
+
|
|
139
|
+func (c *HisApiController) GetPrivateExpensesOrder() {
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+ order_id, _ := c.GetInt64("order_id")
|
|
143
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+ adminUser := c.GetAdminUserInfo()
|
|
155
|
+ order, _ := service.GetHisOrderByID(order_id)
|
|
156
|
+ his, _ := service.GetHisPatientInfoThree(adminUser.CurrentOrgId, order.MdtrtId)
|
|
157
|
+
|
|
158
|
+ orderInfos, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
|
|
159
|
+
|
|
160
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+ var name string
|
|
164
|
+ for _, item := range diagnosis_ids {
|
|
165
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
166
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
167
|
+ if len(name) == 0 {
|
|
168
|
+ name = diagnosisConfig.ClassName
|
|
169
|
+
|
|
170
|
+ } else {
|
|
171
|
+ name = name + "," + diagnosisConfig.ClassName
|
|
172
|
+ }
|
|
173
|
+ }
|
|
174
|
+
|
|
175
|
+ decimal.DivisionPrecision = 2
|
|
176
|
+
|
|
177
|
+ for _, item := range orderInfos {
|
|
178
|
+ item.FulamtOwnpayAmt = item.DetItemFeeSumamt
|
|
179
|
+ if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 {
|
|
180
|
+ item.MedChrgitmType = "09"
|
|
181
|
+
|
|
182
|
+ }
|
|
183
|
+ if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
|
184
|
+ if item.HisPrescriptionProject.Type == 2 {
|
|
185
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
186
|
+
|
|
187
|
+ case 1:
|
|
188
|
+ item.MedChrgitmType = "14"
|
|
189
|
+ break
|
|
190
|
+ case 2:
|
|
191
|
+ item.MedChrgitmType = "05"
|
|
192
|
+
|
|
193
|
+ break
|
|
194
|
+ case 3:
|
|
195
|
+ item.MedChrgitmType = "04"
|
|
196
|
+
|
|
197
|
+ break
|
|
198
|
+ case 4:
|
|
199
|
+ item.MedChrgitmType = "14"
|
|
200
|
+
|
|
201
|
+ break
|
|
202
|
+ case 5:
|
|
203
|
+ item.MedChrgitmType = "08"
|
|
204
|
+
|
|
205
|
+ break
|
|
206
|
+ case 6:
|
|
207
|
+ item.MedChrgitmType = "14"
|
|
208
|
+
|
|
209
|
+ break
|
|
210
|
+ case 7:
|
|
211
|
+ item.MedChrgitmType = "14"
|
|
212
|
+
|
|
213
|
+ break
|
|
214
|
+ case 8:
|
|
215
|
+ item.MedChrgitmType = "03"
|
|
216
|
+ break
|
|
217
|
+ case 9:
|
|
218
|
+ item.MedChrgitmType = "14"
|
|
219
|
+ break
|
|
220
|
+
|
|
221
|
+ }
|
|
222
|
+
|
|
223
|
+ } else if item.HisPrescriptionProject.Type == 3 {
|
|
224
|
+ item.MedChrgitmType = "08"
|
|
225
|
+ }
|
|
226
|
+ }
|
|
227
|
+ }
|
|
228
|
+ order.PsnCashPay = order.MedfeeSumamt
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+ org, _ := service.GetOrgById(adminUser.CurrentOrgId)
|
|
239
|
+ printor_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
240
|
+ charge_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, order.Creator)
|
|
241
|
+
|
|
242
|
+ patient, _ := service.GetPatientByID(order.UserOrgId, order.PatientId)
|
|
243
|
+
|
|
244
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
245
|
+ "org_name": org.OrgName,
|
|
246
|
+ "name": patient.Name,
|
|
247
|
+ "order_infos": orderInfos,
|
|
248
|
+ "number": order.MdtrtId,
|
|
249
|
+ "date": order.SettleAccountsDate,
|
|
250
|
+ "charge_admin": charge_admin,
|
|
251
|
+ "printor_admin": printor_admin,
|
|
252
|
+ "info": order,
|
|
253
|
+ })
|
|
254
|
+
|
99
|
255
|
}
|
100
|
256
|
|
101
|
257
|
func (c *HisApiController) RefudDetail() {
|
|
@@ -2696,7 +2852,9 @@ func (c *HisApiController) GetRegisterInfo() {
|
2696
|
2852
|
SickType: sick_type,
|
2697
|
2853
|
}
|
2698
|
2854
|
service.CreateHisPatient(&hisPatient)
|
|
2855
|
+
|
2699
|
2856
|
service.UpdateHisPrescriptionHisID(hisPatient.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
|
|
2857
|
+
|
2700
|
2858
|
c.ServeSuccessJSON(map[string]interface{}{
|
2701
|
2859
|
"his_info": hisPatient,
|
2702
|
2860
|
})
|
|
@@ -2736,16 +2894,14 @@ func (c *HisApiController) GetRegisterInfo() {
|
2736
|
2894
|
}
|
2737
|
2895
|
service.CreateHisPatient(&hisPatient)
|
2738
|
2896
|
|
|
2897
|
+ service.UpdateHisPrescriptionHisID(hisPatient.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
|
|
2898
|
+
|
2739
|
2899
|
c.ServeSuccessJSON(map[string]interface{}{
|
2740
|
2900
|
"his_info": hisPatient,
|
2741
|
2901
|
})
|
2742
|
2902
|
|
2743
|
2903
|
}
|
2744
|
2904
|
|
2745
|
|
-
|
2746
|
|
-
|
2747
|
|
-
|
2748
|
|
-
|
2749
|
2905
|
}
|
2750
|
2906
|
|
2751
|
2907
|
|
|
@@ -2823,10 +2979,6 @@ func (c *HisApiController) GetUploadInfo() {
|
2823
|
2979
|
prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime, reg_type)
|
2824
|
2980
|
}
|
2825
|
2981
|
|
2826
|
|
- fmt.Println("~~~~~~~~~")
|
2827
|
|
- fmt.Println(his.Number)
|
2828
|
|
- fmt.Println("~~~~~~~~~")
|
2829
|
|
-
|
2830
|
2982
|
timestamp := time.Now().Unix()
|
2831
|
2983
|
tempTime := time.Unix(timestamp, 0)
|
2832
|
2984
|
timeFormat := tempTime.Format("20060102150405")
|
|
@@ -2899,7 +3051,6 @@ func (c *HisApiController) GetUploadInfo() {
|
2899
|
3051
|
|
2900
|
3052
|
var customs []*Custom
|
2901
|
3053
|
for _, item := range prescriptions {
|
2902
|
|
-
|
2903
|
3054
|
if item.Type == 1 {
|
2904
|
3055
|
for _, subItem := range item.HisDoctorAdviceInfo {
|
2905
|
3056
|
cus := &Custom{
|
|
@@ -2915,10 +3066,8 @@ func (c *HisApiController) GetUploadInfo() {
|
2915
|
3066
|
customs = append(customs, cus)
|
2916
|
3067
|
}
|
2917
|
3068
|
}
|
2918
|
|
-
|
2919
|
3069
|
if item.Type == 2 {
|
2920
|
3070
|
for _, subItem := range item.HisPrescriptionProject {
|
2921
|
|
-
|
2922
|
3071
|
cus := &Custom{
|
2923
|
3072
|
AdviceId: 0,
|
2924
|
3073
|
ProjectId: subItem.ID,
|
|
@@ -2929,11 +3078,9 @@ func (c *HisApiController) GetUploadInfo() {
|
2929
|
3078
|
MedListCodg: subItem.MedListCodg,
|
2930
|
3079
|
Type: 2,
|
2931
|
3080
|
}
|
2932
|
|
-
|
2933
|
3081
|
customs = append(customs, cus)
|
2934
|
3082
|
}
|
2935
|
3083
|
}
|
2936
|
|
-
|
2937
|
3084
|
for _, item := range item.HisAdditionalCharge {
|
2938
|
3085
|
cus := &Custom{
|
2939
|
3086
|
ItemId: item.ID,
|
|
@@ -2946,12 +3093,9 @@ func (c *HisApiController) GetUploadInfo() {
|
2946
|
3093
|
MedListCodg: item.XtHisAddtionConfig.Code,
|
2947
|
3094
|
Type: 3,
|
2948
|
3095
|
}
|
2949
|
|
-
|
2950
|
3096
|
customs = append(customs, cus)
|
2951
|
3097
|
}
|
2952
|
|
-
|
2953
|
3098
|
}
|
2954
|
|
-
|
2955
|
3099
|
for _, item := range customs {
|
2956
|
3100
|
var advice_id int64 = 0
|
2957
|
3101
|
var project_id int64 = 0
|
|
@@ -2973,11 +3117,9 @@ func (c *HisApiController) GetUploadInfo() {
|
2973
|
3117
|
item_id = item.ItemId
|
2974
|
3118
|
project_id = 0
|
2975
|
3119
|
}
|
2976
|
|
-
|
2977
|
3120
|
detItemFeeSumamt, _ := strconv.ParseFloat(item.DetItemFeeSumamt, 32)
|
2978
|
3121
|
cut, _ := strconv.ParseFloat(item.Cut, 32)
|
2979
|
3122
|
pric, _ := strconv.ParseFloat(item.Price, 32)
|
2980
|
|
-
|
2981
|
3123
|
info := &models.HisOrderInfo{
|
2982
|
3124
|
OrderNumber: order.Number,
|
2983
|
3125
|
UploadDate: time.Now().Unix(),
|
|
@@ -3002,7 +3144,6 @@ func (c *HisApiController) GetUploadInfo() {
|
3002
|
3144
|
his.SickType = sick_type
|
3003
|
3145
|
his.RegisterType = reg_type
|
3004
|
3146
|
his.MedicalTreatmentType = reg_type
|
3005
|
|
-
|
3006
|
3147
|
service.UpdataHisPateint(&his)
|
3007
|
3148
|
err = service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
|
3008
|
3149
|
err = service.UpDateHisPrescriptionInfoNumber(adminUser.CurrentOrgId, id, chrg_bchno, recordDateTime, his_patient_id)
|
|
@@ -3012,13 +3153,10 @@ func (c *HisApiController) GetUploadInfo() {
|
3012
|
3153
|
"msg": "结算成功",
|
3013
|
3154
|
})
|
3014
|
3155
|
}
|
3015
|
|
-
|
3016
|
3156
|
} else {
|
3017
|
3157
|
if tempOrder.IsPre > 0 {
|
3018
|
|
-
|
3019
|
3158
|
allTotal := fmt.Sprintf("%.2f", tempOrder.MedfeeSumamt)
|
3020
|
3159
|
totals, _ := strconv.ParseFloat(allTotal, 64)
|
3021
|
|
-
|
3022
|
3160
|
tempOrder.OrderStatus = 2
|
3023
|
3161
|
tempOrder.PayWay = pay_way
|
3024
|
3162
|
tempOrder.PayPrice = pay_price
|
|
@@ -3034,7 +3172,6 @@ func (c *HisApiController) GetUploadInfo() {
|
3034
|
3172
|
tempOrder.PType = 2
|
3035
|
3173
|
tempOrder.MedfeeSumamt = totals
|
3036
|
3174
|
tempOrder.Diagnosis = diagnosis_id
|
3037
|
|
-
|
3038
|
3175
|
err = service.SaveHisOrder(&tempOrder)
|
3039
|
3176
|
err = service.UpdataOrderStatusTwo(tempOrder.Number, adminUser.CurrentOrgId)
|
3040
|
3177
|
if err != nil {
|
|
@@ -3046,10 +3183,8 @@ func (c *HisApiController) GetUploadInfo() {
|
3046
|
3183
|
"msg": "结算成功",
|
3047
|
3184
|
})
|
3048
|
3185
|
}
|
3049
|
|
-
|
3050
|
3186
|
}
|
3051
|
3187
|
}
|
3052
|
|
-
|
3053
|
3188
|
}
|
3054
|
3189
|
|
3055
|
3190
|
|
|
@@ -3448,16 +3583,81 @@ func (c *HisApiController) GetAllOrderDetailCollect() {
|
3448
|
3583
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
|
3449
|
3584
|
return
|
3450
|
3585
|
}
|
|
3586
|
+
|
3451
|
3587
|
org_id := c.GetAdminUserInfo().CurrentOrgId
|
3452
|
3588
|
adminInfo, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
3453
|
3589
|
order_info, _ := service.GetHisOrderDetailByNumber(order.Number, org_id)
|
3454
|
3590
|
patient, _ := service.GetPatientByID(org_id, order.PatientId)
|
3455
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
3456
|
|
- "order": order,
|
3457
|
|
- "order_info": order_info,
|
3458
|
|
- "patient": patient,
|
3459
|
|
- "admin_info": adminInfo,
|
3460
|
|
- })
|
|
3591
|
+
|
|
3592
|
+ his, _ := service.GetHisPatientInfoThree(order.UserOrgId, order.MdtrtId)
|
|
3593
|
+
|
|
3594
|
+ if his.BalanceAccountsType != 2 {
|
|
3595
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3596
|
+ "order": order,
|
|
3597
|
+ "order_info": order_info,
|
|
3598
|
+ "patient": patient,
|
|
3599
|
+ "admin_info": adminInfo,
|
|
3600
|
+ })
|
|
3601
|
+ } else {
|
|
3602
|
+
|
|
3603
|
+ for _, item := range order_info {
|
|
3604
|
+ item.FulamtOwnpayAmt = item.DetItemFeeSumamt
|
|
3605
|
+ if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 {
|
|
3606
|
+ item.MedChrgitmType = "09"
|
|
3607
|
+
|
|
3608
|
+ }
|
|
3609
|
+ if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
|
3610
|
+ if item.HisPrescriptionProject.Type == 2 {
|
|
3611
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
3612
|
+
|
|
3613
|
+ case 1:
|
|
3614
|
+ item.MedChrgitmType = "14"
|
|
3615
|
+ break
|
|
3616
|
+ case 2:
|
|
3617
|
+ item.MedChrgitmType = "05"
|
|
3618
|
+
|
|
3619
|
+ break
|
|
3620
|
+ case 3:
|
|
3621
|
+ item.MedChrgitmType = "04"
|
|
3622
|
+
|
|
3623
|
+ break
|
|
3624
|
+ case 4:
|
|
3625
|
+ item.MedChrgitmType = "14"
|
|
3626
|
+
|
|
3627
|
+ break
|
|
3628
|
+ case 5:
|
|
3629
|
+ item.MedChrgitmType = "08"
|
|
3630
|
+
|
|
3631
|
+ break
|
|
3632
|
+ case 6:
|
|
3633
|
+ item.MedChrgitmType = "14"
|
|
3634
|
+
|
|
3635
|
+ break
|
|
3636
|
+ case 7:
|
|
3637
|
+ item.MedChrgitmType = "14"
|
|
3638
|
+
|
|
3639
|
+ break
|
|
3640
|
+ case 8:
|
|
3641
|
+ item.MedChrgitmType = "03"
|
|
3642
|
+ break
|
|
3643
|
+ case 9:
|
|
3644
|
+ item.MedChrgitmType = "14"
|
|
3645
|
+ break
|
|
3646
|
+ }
|
|
3647
|
+ } else if item.HisPrescriptionProject.Type == 3 {
|
|
3648
|
+ item.MedChrgitmType = "08"
|
|
3649
|
+ }
|
|
3650
|
+ }
|
|
3651
|
+ }
|
|
3652
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3653
|
+ "order": order,
|
|
3654
|
+ "order_info": order_info,
|
|
3655
|
+ "patient": patient,
|
|
3656
|
+ "admin_info": adminInfo,
|
|
3657
|
+ })
|
|
3658
|
+
|
|
3659
|
+ }
|
|
3660
|
+
|
3461
|
3661
|
return
|
3462
|
3662
|
}
|
3463
|
3663
|
|
|
@@ -3569,7 +3769,7 @@ func (c *HisApiController) GetFaPiaoData() {
|
3569
|
3769
|
|
3570
|
3770
|
his, _ := service.GetHisPatientInfoThree(adminUser.CurrentOrgId, number)
|
3571
|
3771
|
|
3572
|
|
- prescriptions, _ := service.GetHisPrescriptionThree(adminUser.CurrentOrgId, patient_id, order.Number)
|
|
3772
|
+
|
3573
|
3773
|
|
3574
|
3774
|
var bedCostTotal float64 = 0
|
3575
|
3775
|
var bedCostSelfTotal float64 = 0
|
|
@@ -3610,22 +3810,109 @@ func (c *HisApiController) GetFaPiaoData() {
|
3610
|
3810
|
decimal.DivisionPrecision = 2
|
3611
|
3811
|
|
3612
|
3812
|
if his.BalanceAccountsType == 2 {
|
3613
|
|
- for _, item := range prescriptions {
|
3614
|
|
- if item.Type == 1 {
|
3615
|
|
- for _, subItem := range item.HisDoctorAdviceInfo {
|
3616
|
|
- westernMedicineCostTotal = westernMedicineCostTotal + (subItem.PrescribingNumber * subItem.Price)
|
3617
|
|
- }
|
3618
|
3813
|
|
3619
|
|
- } else {
|
3620
|
|
- for _, subItem := range item.HisPrescriptionProject {
|
3621
|
|
- if subItem.Type == 2 {
|
3622
|
|
- treatCostTotal = treatCostTotal + (float64(subItem.Count) * subItem.Price)
|
3623
|
|
- } else {
|
3624
|
|
- materialCostTotal = materialCostTotal + (float64(subItem.Count) * subItem.Price)
|
|
3814
|
+ orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
|
|
3815
|
+
|
|
3816
|
+ for _, item := range orderInfos_two {
|
|
3817
|
+ item.FulamtOwnpayAmt = item.DetItemFeeSumamt
|
|
3818
|
+ if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 {
|
|
3819
|
+ item.MedChrgitmType = "09"
|
|
3820
|
+
|
|
3821
|
+ }
|
|
3822
|
+ if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
|
3823
|
+ if item.HisPrescriptionProject.Type == 2 {
|
|
3824
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
3825
|
+
|
|
3826
|
+ case 1:
|
|
3827
|
+ item.MedChrgitmType = "14"
|
|
3828
|
+ break
|
|
3829
|
+ case 2:
|
|
3830
|
+ item.MedChrgitmType = "05"
|
|
3831
|
+
|
|
3832
|
+ break
|
|
3833
|
+ case 3:
|
|
3834
|
+ item.MedChrgitmType = "04"
|
|
3835
|
+
|
|
3836
|
+ break
|
|
3837
|
+ case 4:
|
|
3838
|
+ item.MedChrgitmType = "14"
|
|
3839
|
+
|
|
3840
|
+ break
|
|
3841
|
+ case 5:
|
|
3842
|
+ item.MedChrgitmType = "08"
|
|
3843
|
+
|
|
3844
|
+ break
|
|
3845
|
+ case 6:
|
|
3846
|
+ item.MedChrgitmType = "14"
|
|
3847
|
+
|
|
3848
|
+ break
|
|
3849
|
+ case 7:
|
|
3850
|
+ item.MedChrgitmType = "14"
|
|
3851
|
+
|
|
3852
|
+ break
|
|
3853
|
+ case 8:
|
|
3854
|
+ item.MedChrgitmType = "03"
|
|
3855
|
+ break
|
|
3856
|
+ case 9:
|
|
3857
|
+ item.MedChrgitmType = "14"
|
|
3858
|
+ break
|
|
3859
|
+
|
3625
|
3860
|
}
|
|
3861
|
+
|
|
3862
|
+ } else if item.HisPrescriptionProject.Type == 3 {
|
|
3863
|
+ item.MedChrgitmType = "08"
|
3626
|
3864
|
}
|
3627
|
3865
|
}
|
3628
|
3866
|
}
|
|
3867
|
+
|
|
3868
|
+ for _, item := range orderInfos_two {
|
|
3869
|
+ if item.MedChrgitmType == "01" {
|
|
3870
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3871
|
+ bedCostSelfTotal = bedCostTotal
|
|
3872
|
+ }
|
|
3873
|
+
|
|
3874
|
+ if item.MedChrgitmType == "03" {
|
|
3875
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3876
|
+ checkCostSelfTotal = checkCostTotal
|
|
3877
|
+ }
|
|
3878
|
+
|
|
3879
|
+ if item.MedChrgitmType == "04" {
|
|
3880
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3881
|
+ laboratoryCostSelfTotal = laboratoryCostTotal
|
|
3882
|
+ }
|
|
3883
|
+
|
|
3884
|
+ if item.MedChrgitmType == "05" {
|
|
3885
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3886
|
+ treatCostSelfTotal = treatCostTotal
|
|
3887
|
+ }
|
|
3888
|
+
|
|
3889
|
+ if item.MedChrgitmType == "06" {
|
|
3890
|
+ treatCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3891
|
+ operationCostSelfTotal = treatCostTotal
|
|
3892
|
+ }
|
|
3893
|
+
|
|
3894
|
+ if item.MedChrgitmType == "08" {
|
|
3895
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3896
|
+ materialCostSelfTotal = materialCostTotal
|
|
3897
|
+ }
|
|
3898
|
+
|
|
3899
|
+ if item.MedChrgitmType == "09" {
|
|
3900
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3901
|
+ westernMedicineCostSelfTotal = westernMedicineCostTotal
|
|
3902
|
+ }
|
|
3903
|
+
|
|
3904
|
+ if item.MedChrgitmType == "11" {
|
|
3905
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3906
|
+ chineseTraditionalMedicineCostSelfTotal = chineseTraditionalMedicineCostTotal
|
|
3907
|
+ }
|
|
3908
|
+
|
|
3909
|
+ if item.MedChrgitmType == "14" {
|
|
3910
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
3911
|
+ otherCostSelfTotal = otherCostTotal
|
|
3912
|
+ }
|
|
3913
|
+
|
|
3914
|
+ }
|
|
3915
|
+
|
3629
|
3916
|
} else {
|
3630
|
3917
|
for _, item := range orderInfos {
|
3631
|
3918
|
if item.MedChrgitmType == "01" {
|
|
@@ -4516,6 +4803,10 @@ func (c *HisApiController) PreSettle() {
|
4516
|
4803
|
prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime, reg_type)
|
4517
|
4804
|
}
|
4518
|
4805
|
|
|
4806
|
+ if reg_type == 1111 || reg_type == 1112 {
|
|
4807
|
+ reg_type = 11
|
|
4808
|
+ }
|
|
4809
|
+
|
4519
|
4810
|
timestamp := time.Now().Unix()
|
4520
|
4811
|
tempTime := time.Unix(timestamp, 0)
|
4521
|
4812
|
timeFormat := tempTime.Format("20060102150405")
|