|
@@ -4,6 +4,7 @@ import (
|
4
|
4
|
"XT_New/enums"
|
5
|
5
|
"XT_New/service"
|
6
|
6
|
"github.com/astaxie/beego"
|
|
7
|
+ "github.com/shopspring/decimal"
|
7
|
8
|
"time"
|
8
|
9
|
)
|
9
|
10
|
|
|
@@ -15,7 +16,7 @@ func HisSummaryApiRegistRouters() {
|
15
|
16
|
|
16
|
17
|
beego.Router("/api/gethissummarydetaillist", &HisSummaryApiController{}, "Get:GetHisSummaryDetailList")
|
17
|
18
|
beego.Router("/api/his/getgatherdetailist", &HisSummaryApiController{}, "Get:GetGatherDetaiList")
|
18
|
|
-
|
|
19
|
+ beego.Router("/api/his/getdetailpatients", &HisSummaryApiController{}, "Get:GetDetailPatients")
|
19
|
20
|
}
|
20
|
21
|
|
21
|
22
|
func (this *HisSummaryApiController) GetHisSummaryDetailList() {
|
|
@@ -42,9 +43,18 @@ func (this *HisSummaryApiController) GetHisSummaryDetailList() {
|
42
|
43
|
endRecordDateTime := endTime.Unix()
|
43
|
44
|
|
44
|
45
|
list, err := service.GetHisSummaryDetailList(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
|
|
46
|
+ patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
|
|
47
|
+
|
|
48
|
+ his_patient, _ := service.GetHisSummaryPatientInfo(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
|
|
49
|
+
|
|
50
|
+ //获取所有的科室
|
|
51
|
+ hisDepatment, _ := service.GetHisDepatment(adminUser.CurrentOrgId)
|
45
|
52
|
if err == nil {
|
46
|
53
|
this.ServeSuccessJSON(map[string]interface{}{
|
47
|
|
- "list": list,
|
|
54
|
+ "list": list,
|
|
55
|
+ "patient": patient,
|
|
56
|
+ "his_patient": his_patient,
|
|
57
|
+ "hisDepatment": hisDepatment,
|
48
|
58
|
})
|
49
|
59
|
return
|
50
|
60
|
} else {
|
|
@@ -77,13 +87,446 @@ func (this *HisSummaryApiController) GetGatherDetaiList() {
|
77
|
87
|
}
|
78
|
88
|
endRecordDateTime := endTime.Unix()
|
79
|
89
|
|
80
|
|
- list, err := service.GetAdviceGatherDetaiList(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
|
|
90
|
+ //查询该病人这段时间的记录单号
|
|
91
|
+ orderInfo, _ := service.GetGatherHisOrder(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
|
|
92
|
+
|
|
93
|
+ org_id := this.GetAdminUserInfo().CurrentOrgId
|
|
94
|
+ appid := this.GetAdminUserInfo().CurrentAppId
|
|
95
|
+ var order_info []*service.HisOrderInfo
|
|
96
|
+
|
|
97
|
+ var MdtrtId string
|
|
98
|
+
|
|
99
|
+ patient, _ := service.GetPatientByID(org_id, patient_id)
|
|
100
|
+ for _, item := range orderInfo {
|
|
101
|
+ orderinfo, _ := service.GetHisOrderDetailByNumber(item.Number, org_id)
|
|
102
|
+ //number = item.Number
|
|
103
|
+ MdtrtId = item.MdtrtId
|
|
104
|
+ for _, it := range orderinfo {
|
|
105
|
+
|
|
106
|
+ order_info = append(order_info, it)
|
|
107
|
+ }
|
|
108
|
+ }
|
|
109
|
+ his, _ := service.GetHisPatientInfoFive(org_id, patient_id, startRecordDateTime, endRecordDateTime)
|
|
110
|
+
|
|
111
|
+ record, _ := service.GetInHospitalRecordByNumber(MdtrtId)
|
|
112
|
+
|
|
113
|
+ //获取所有客户
|
|
114
|
+ adminInfo, _ := service.GetAllDoctorSix(org_id, appid)
|
|
115
|
+
|
|
116
|
+ var bedCostTotal float64 = 0 //床位总费
|
|
117
|
+
|
|
118
|
+ var operationCostTotal float64 = 0 //手术费
|
|
119
|
+
|
|
120
|
+ var otherCostTotal float64 = 0 //其他费用
|
|
121
|
+
|
|
122
|
+ var materialCostTotal float64 = 0 //材料费
|
|
123
|
+
|
|
124
|
+ var westernMedicineCostTotal float64 = 0 //西药费
|
|
125
|
+
|
|
126
|
+ var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
|
|
127
|
+
|
|
128
|
+ var checkCostTotal float64 = 0 //检查费
|
|
129
|
+
|
|
130
|
+ var laboratoryCostTotal float64 = 0 //化验费
|
|
131
|
+
|
|
132
|
+ var treatCostTotal float64 = 0 //治疗费用
|
|
133
|
+
|
|
134
|
+ var zhenChaCostTotal float64 = 0 //其他费用
|
|
135
|
+
|
|
136
|
+ decimal.DivisionPrecision = 2
|
|
137
|
+ var BalanceAccountsType int64
|
|
138
|
+ if his.ID > 0 {
|
|
139
|
+ BalanceAccountsType = his.BalanceAccountsType
|
|
140
|
+ } else {
|
|
141
|
+ BalanceAccountsType = record.BalanceAccountsType
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ his_patient, _ := service.GetHisSummaryPatientInfo(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
|
|
145
|
+
|
|
146
|
+ //获取所有的科室
|
|
147
|
+ hisDepatment, _ := service.GetHisDepatment(adminUser.CurrentOrgId)
|
|
148
|
+
|
|
149
|
+ //统计
|
|
150
|
+ prescription, _ := service.GetHisPrescriptionTenty(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, keyword, item_type)
|
|
151
|
+
|
|
152
|
+ var medicalInsuranceLevel = "医保等级"
|
|
153
|
+ medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
|
|
154
|
+ medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, adminUser.CurrentOrgId)
|
|
155
|
+ if BalanceAccountsType != 2 && BalanceAccountsType > 0 {
|
|
156
|
+ for _, item := range order_info {
|
|
157
|
+ if org_id == 10215 {
|
|
158
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
159
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
160
|
+ }
|
|
161
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
162
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
163
|
+
|
|
164
|
+ }
|
|
165
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
166
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
167
|
+
|
|
168
|
+ }
|
|
169
|
+
|
|
170
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
171
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
172
|
+ }
|
|
173
|
+
|
|
174
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
175
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
176
|
+
|
|
177
|
+ }
|
|
178
|
+
|
|
179
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
180
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
181
|
+ }
|
|
182
|
+
|
|
183
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
184
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
185
|
+ }
|
|
186
|
+
|
|
187
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
188
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
189
|
+ }
|
|
190
|
+
|
|
191
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
192
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
193
|
+ }
|
|
194
|
+
|
|
195
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
|
|
196
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
197
|
+ }
|
|
198
|
+
|
|
199
|
+ } else if org_id == 10188 || org_id == 10217 {
|
|
200
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
201
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
202
|
+
|
|
203
|
+ }
|
|
204
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
205
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
206
|
+ }
|
|
207
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
208
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
209
|
+ }
|
|
210
|
+
|
|
211
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
212
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
213
|
+ }
|
|
214
|
+
|
|
215
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
216
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
217
|
+ }
|
|
218
|
+
|
|
219
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
220
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
221
|
+ }
|
|
222
|
+
|
|
223
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
224
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
225
|
+ }
|
|
226
|
+
|
|
227
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
228
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
229
|
+ }
|
|
230
|
+
|
|
231
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
232
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
233
|
+ }
|
|
234
|
+
|
|
235
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
|
|
236
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
237
|
+ }
|
|
238
|
+
|
|
239
|
+ } else {
|
|
240
|
+
|
|
241
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
242
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
243
|
+
|
|
244
|
+ }
|
|
245
|
+
|
|
246
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
247
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
248
|
+ }
|
|
249
|
+
|
|
250
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
251
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
252
|
+
|
|
253
|
+ }
|
|
254
|
+
|
|
255
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
256
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
257
|
+ }
|
|
258
|
+
|
|
259
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
260
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
261
|
+ }
|
81
|
262
|
|
82
|
|
- detailList, _ := service.GetProjectGatherDetailList(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
|
|
263
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
264
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
265
|
+ }
|
|
266
|
+
|
|
267
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
268
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
269
|
+ }
|
|
270
|
+
|
|
271
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
272
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
273
|
+ }
|
|
274
|
+
|
|
275
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
|
|
276
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
277
|
+
|
|
278
|
+ }
|
|
279
|
+
|
|
280
|
+ }
|
|
281
|
+ }
|
|
282
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
283
|
+ "order": orderInfo,
|
|
284
|
+ "order_info": order_info,
|
|
285
|
+ "patient": patient,
|
|
286
|
+ "admin_info": adminInfo,
|
|
287
|
+ "his_hospital": record,
|
|
288
|
+ "bedCostTotal": bedCostTotal,
|
|
289
|
+ "operationCostTotal": operationCostTotal,
|
|
290
|
+ "otherCostTotal": otherCostTotal,
|
|
291
|
+ "materialCostTotal": materialCostTotal,
|
|
292
|
+ "westernMedicineCostTotal": westernMedicineCostTotal,
|
|
293
|
+ "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
|
|
294
|
+ "checkCostTotal": checkCostTotal,
|
|
295
|
+ "zhenChaCostTotal": zhenChaCostTotal,
|
|
296
|
+ "laboratoryCostTotal": laboratoryCostTotal,
|
|
297
|
+ "treatCostTotal": treatCostTotal,
|
|
298
|
+ "his_patient": his_patient,
|
|
299
|
+ "hisDepatment": hisDepatment,
|
|
300
|
+ })
|
|
301
|
+ } else {
|
|
302
|
+ for _, item := range order_info {
|
|
303
|
+
|
|
304
|
+ item.FulamtOwnpayAmt = item.DetItemFeeSumamt
|
|
305
|
+ if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
|
|
306
|
+ item.MedChrgitmType = "09"
|
|
307
|
+ }
|
|
308
|
+ if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
|
309
|
+ if item.HisPrescriptionProject.Type == 2 {
|
|
310
|
+ if this.GetAdminUserInfo().CurrentOrgId == 10215 {
|
|
311
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
312
|
+ case 0:
|
|
313
|
+ item.MedChrgitmType = "0"
|
|
314
|
+ break
|
|
315
|
+ case 1:
|
|
316
|
+ item.MedChrgitmType = "14"
|
|
317
|
+ break
|
|
318
|
+ case 2:
|
|
319
|
+ item.MedChrgitmType = "05"
|
|
320
|
+
|
|
321
|
+ break
|
|
322
|
+ case 3:
|
|
323
|
+ item.MedChrgitmType = "03"
|
|
324
|
+
|
|
325
|
+ break
|
|
326
|
+ case 4:
|
|
327
|
+ item.MedChrgitmType = "03"
|
|
328
|
+
|
|
329
|
+ break
|
|
330
|
+ case 5:
|
|
331
|
+ item.MedChrgitmType = "08"
|
|
332
|
+
|
|
333
|
+ break
|
|
334
|
+ case 6:
|
|
335
|
+ item.MedChrgitmType = "14"
|
|
336
|
+
|
|
337
|
+ break
|
|
338
|
+ case 7:
|
|
339
|
+ item.MedChrgitmType = "14"
|
|
340
|
+
|
|
341
|
+ break
|
|
342
|
+ case 8:
|
|
343
|
+ item.MedChrgitmType = "03"
|
|
344
|
+ break
|
|
345
|
+ case 9:
|
|
346
|
+ item.MedChrgitmType = "14"
|
|
347
|
+ break
|
|
348
|
+ case 10:
|
|
349
|
+ item.MedChrgitmType = "14"
|
|
350
|
+ break
|
|
351
|
+ case 11:
|
|
352
|
+ item.MedChrgitmType = "06"
|
|
353
|
+ break
|
|
354
|
+ case 12:
|
|
355
|
+ item.MedChrgitmType = "12"
|
|
356
|
+ break
|
|
357
|
+ case 13:
|
|
358
|
+ item.MedChrgitmType = "01"
|
|
359
|
+ break
|
|
360
|
+ case 14:
|
|
361
|
+ item.MedChrgitmType = "04"
|
|
362
|
+ break
|
|
363
|
+ case 15:
|
|
364
|
+ item.MedChrgitmType = "14"
|
|
365
|
+ break
|
|
366
|
+
|
|
367
|
+ }
|
|
368
|
+
|
|
369
|
+ } else {
|
|
370
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
371
|
+
|
|
372
|
+ case 1:
|
|
373
|
+ item.MedChrgitmType = "14"
|
|
374
|
+ break
|
|
375
|
+ case 2:
|
|
376
|
+ item.MedChrgitmType = "05"
|
|
377
|
+
|
|
378
|
+ break
|
|
379
|
+ case 3:
|
|
380
|
+ item.MedChrgitmType = "04"
|
|
381
|
+
|
|
382
|
+ break
|
|
383
|
+ case 4:
|
|
384
|
+ item.MedChrgitmType = "14"
|
|
385
|
+
|
|
386
|
+ break
|
|
387
|
+ case 5:
|
|
388
|
+ item.MedChrgitmType = "08"
|
|
389
|
+
|
|
390
|
+ break
|
|
391
|
+ case 6:
|
|
392
|
+ item.MedChrgitmType = "14"
|
|
393
|
+
|
|
394
|
+ break
|
|
395
|
+ case 7:
|
|
396
|
+ item.MedChrgitmType = "14"
|
|
397
|
+
|
|
398
|
+ break
|
|
399
|
+ case 8:
|
|
400
|
+ item.MedChrgitmType = "03"
|
|
401
|
+ break
|
|
402
|
+ case 9:
|
|
403
|
+ item.MedChrgitmType = "14"
|
|
404
|
+ break
|
|
405
|
+ }
|
|
406
|
+ }
|
|
407
|
+ } else if item.HisPrescriptionProject.Type == 3 {
|
|
408
|
+ item.MedChrgitmType = "08"
|
|
409
|
+ }
|
|
410
|
+ }
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ for _, item := range order_info {
|
|
414
|
+ if org_id == 10215 {
|
|
415
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
416
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
417
|
+ }
|
|
418
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
419
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
420
|
+ }
|
|
421
|
+
|
|
422
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
423
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
424
|
+ }
|
|
425
|
+
|
|
426
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
427
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
428
|
+ }
|
|
429
|
+
|
|
430
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
431
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
432
|
+ }
|
|
433
|
+
|
|
434
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
435
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
436
|
+ }
|
|
437
|
+
|
|
438
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
439
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
440
|
+ }
|
|
441
|
+
|
|
442
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
443
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
444
|
+ }
|
|
445
|
+
|
|
446
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
447
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
448
|
+ }
|
|
449
|
+
|
|
450
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
|
|
451
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
452
|
+ }
|
|
453
|
+
|
|
454
|
+ } else {
|
|
455
|
+
|
|
456
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
457
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
458
|
+ }
|
|
459
|
+
|
|
460
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
461
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
462
|
+ }
|
|
463
|
+
|
|
464
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
465
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
466
|
+ }
|
|
467
|
+
|
|
468
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
469
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
470
|
+ }
|
|
471
|
+
|
|
472
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
473
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
474
|
+ }
|
|
475
|
+
|
|
476
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
477
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
478
|
+ }
|
|
479
|
+
|
|
480
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
481
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
482
|
+ }
|
|
483
|
+
|
|
484
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
485
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
486
|
+ }
|
|
487
|
+
|
|
488
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
|
|
489
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
490
|
+ }
|
|
491
|
+
|
|
492
|
+ }
|
|
493
|
+
|
|
494
|
+ }
|
|
495
|
+
|
|
496
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
497
|
+ "order": orderInfo,
|
|
498
|
+ "order_info": order_info,
|
|
499
|
+ "patient": patient,
|
|
500
|
+ "admin_info": adminInfo,
|
|
501
|
+ "his_hospital": record,
|
|
502
|
+ "bedCostTotal": bedCostTotal,
|
|
503
|
+ "operationCostTotal": operationCostTotal,
|
|
504
|
+ "otherCostTotal": otherCostTotal,
|
|
505
|
+ "materialCostTotal": materialCostTotal,
|
|
506
|
+ "westernMedicineCostTotal": westernMedicineCostTotal,
|
|
507
|
+ "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
|
|
508
|
+ "checkCostTotal": checkCostTotal,
|
|
509
|
+ "zhenChaCostTotal": zhenChaCostTotal,
|
|
510
|
+ "laboratoryCostTotal": laboratoryCostTotal,
|
|
511
|
+ "treatCostTotal": treatCostTotal,
|
|
512
|
+ "his_patient": his_patient,
|
|
513
|
+ "hisDepatment": hisDepatment,
|
|
514
|
+ "prescription": prescription,
|
|
515
|
+ "balanceAccountsType": BalanceAccountsType,
|
|
516
|
+ "medicalInsuranceLevelList": medicalInsuranceLevelList,
|
|
517
|
+ })
|
|
518
|
+
|
|
519
|
+ }
|
|
520
|
+}
|
|
521
|
+
|
|
522
|
+func (this *HisSummaryApiController) GetDetailPatients() {
|
|
523
|
+
|
|
524
|
+ keyword := this.GetString("keyword")
|
|
525
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
526
|
+ patients, err := service.GetDetailPatients(keyword, orgId)
|
83
|
527
|
if err == nil {
|
84
|
528
|
this.ServeSuccessJSON(map[string]interface{}{
|
85
|
|
- "detailList": detailList,
|
86
|
|
- "list": list,
|
|
529
|
+ "patient": patients,
|
87
|
530
|
})
|
88
|
531
|
return
|
89
|
532
|
} else {
|