|
@@ -1,6 +1,5 @@
|
1
|
1
|
package controllers
|
2
|
2
|
|
3
|
|
-import "C"
|
4
|
3
|
import (
|
5
|
4
|
"XT_New/enums"
|
6
|
5
|
"XT_New/models"
|
|
@@ -93,6 +92,10 @@ func HisManagerApiRegistRouters() {
|
93
|
92
|
beego.Router("/api/bailin/export", &PublicApiController{}, "get:GetBaiLinExportData")
|
94
|
93
|
beego.Router("/api/his/gethistdoctoradviceinfo", &HisApiController{}, "get:GetHisDoctorAdviceInfo")
|
95
|
94
|
|
|
95
|
+ beego.Router("/api/his/gethistdoctoradviceinfo", &HisApiController{}, "get:GetHisDoctorAdviceInfo")
|
|
96
|
+
|
|
97
|
+ beego.Router("/api/monthcharge/list", &HisApiController{}, "get:GetHisMonthChargePatientList")
|
|
98
|
+
|
96
|
99
|
}
|
97
|
100
|
|
98
|
101
|
func (c *PublicApiController) GetBaiLinExportData() {
|
|
@@ -168,6 +171,7 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
168
|
171
|
his_hospital, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
169
|
172
|
|
170
|
173
|
orderInfos, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
|
|
174
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
171
|
175
|
|
172
|
176
|
//var config []*models.HisXtDiagnoseConfig
|
173
|
177
|
|
|
@@ -199,6 +203,45 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
199
|
203
|
}
|
200
|
204
|
}
|
201
|
205
|
|
|
206
|
+ var bedCostTotal float64 = 0 //床位总费
|
|
207
|
+ //var bedCostSelfTotal float64 = 0 //床位自费
|
|
208
|
+ var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
|
|
209
|
+
|
|
210
|
+ var operationCostTotal float64 = 0 //手术费
|
|
211
|
+ //var operationCostSelfTotal float64 = 0 //手术费
|
|
212
|
+ var operationCostPartSelfTotal float64 = 0 //手术费
|
|
213
|
+
|
|
214
|
+ var otherCostTotal float64 = 0 //其他费用
|
|
215
|
+ //var otherCostSelfTotal float64 = 0 //其他费用
|
|
216
|
+ var otherCostPartSelfTotal float64 = 0 //其他费用
|
|
217
|
+
|
|
218
|
+ var materialCostTotal float64 = 0 //材料费
|
|
219
|
+ //var materialCostSelfTotal float64 = 0 //材料费
|
|
220
|
+ var materialCostPartSelfTotal float64 = 0 //材料费
|
|
221
|
+
|
|
222
|
+ var westernMedicineCostTotal float64 = 0 //西药费
|
|
223
|
+ //var westernMedicineCostSelfTotal float64 = 0 //西药费
|
|
224
|
+ var westernMedicineCostPartSelfTotal float64 = 0 //西药费
|
|
225
|
+
|
|
226
|
+ var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
|
|
227
|
+ //var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
|
|
228
|
+ var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
|
|
229
|
+
|
|
230
|
+ var checkCostTotal float64 = 0 //检查费
|
|
231
|
+ //var checkCostSelfTotal float64 = 0 //检查费
|
|
232
|
+ var checkCostPartSelfTotal float64 = 0 //检查费
|
|
233
|
+
|
|
234
|
+ var laboratoryCostTotal float64 = 0 //化验费
|
|
235
|
+ //var laboratoryCostSelfTotal float64 = 0 //化验费
|
|
236
|
+ var laboratoryCostPartSelfTotal float64 = 0 //化验费
|
|
237
|
+
|
|
238
|
+ var treatCostTotal float64 = 0 //治疗费用
|
|
239
|
+ //var treatCostSelfTotal float64 = 0 //治疗费用
|
|
240
|
+ var treatCostPartSelfTotal float64 = 0 //治疗费用
|
|
241
|
+
|
|
242
|
+ var zhenChaCostTotal float64 = 0 //其他费用
|
|
243
|
+ //var zhenChaCostPartSelfTotal float64 = 0 //其他费用
|
|
244
|
+
|
202
|
245
|
decimal.DivisionPrecision = 2
|
203
|
246
|
|
204
|
247
|
for _, item := range orderInfos {
|
|
@@ -209,7 +252,12 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
209
|
252
|
if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
210
|
253
|
if item.HisPrescriptionProject.Type == 2 {
|
211
|
254
|
if c.GetAdminUserInfo().CurrentOrgId == 10215 {
|
|
255
|
+ fmt.Println("CostClassify")
|
|
256
|
+ fmt.Println(item.HisPrescriptionProject.VMHisProject.CostClassify)
|
212
|
257
|
switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
258
|
+ case 0:
|
|
259
|
+ item.MedChrgitmType = "0"
|
|
260
|
+ break
|
213
|
261
|
case 1:
|
214
|
262
|
item.MedChrgitmType = "14"
|
215
|
263
|
break
|
|
@@ -218,11 +266,11 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
218
|
266
|
|
219
|
267
|
break
|
220
|
268
|
case 3:
|
221
|
|
- item.MedChrgitmType = "04"
|
|
269
|
+ item.MedChrgitmType = "03"
|
222
|
270
|
|
223
|
271
|
break
|
224
|
272
|
case 4:
|
225
|
|
- item.MedChrgitmType = "14"
|
|
273
|
+ item.MedChrgitmType = "03"
|
226
|
274
|
|
227
|
275
|
break
|
228
|
276
|
case 5:
|
|
@@ -231,9 +279,11 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
231
|
279
|
break
|
232
|
280
|
case 6:
|
233
|
281
|
item.MedChrgitmType = "14"
|
|
282
|
+
|
234
|
283
|
break
|
235
|
284
|
case 7:
|
236
|
285
|
item.MedChrgitmType = "14"
|
|
286
|
+
|
237
|
287
|
break
|
238
|
288
|
case 8:
|
239
|
289
|
item.MedChrgitmType = "03"
|
|
@@ -241,18 +291,136 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
241
|
291
|
case 9:
|
242
|
292
|
item.MedChrgitmType = "14"
|
243
|
293
|
break
|
|
294
|
+ case 10:
|
|
295
|
+ item.MedChrgitmType = "14"
|
|
296
|
+ break
|
|
297
|
+ case 11:
|
|
298
|
+ item.MedChrgitmType = "06"
|
|
299
|
+ break
|
|
300
|
+ case 12:
|
|
301
|
+ item.MedChrgitmType = "12"
|
|
302
|
+ break
|
|
303
|
+ case 13:
|
|
304
|
+ item.MedChrgitmType = "01"
|
|
305
|
+ break
|
|
306
|
+ case 14:
|
|
307
|
+ item.MedChrgitmType = "04"
|
|
308
|
+ break
|
|
309
|
+ case 15:
|
|
310
|
+ item.MedChrgitmType = "14"
|
|
311
|
+ break
|
244
|
312
|
|
245
|
313
|
}
|
246
|
314
|
|
247
|
|
- }
|
|
315
|
+ } else {
|
|
316
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
317
|
+ case 1:
|
|
318
|
+ item.MedChrgitmType = "14"
|
|
319
|
+ break
|
|
320
|
+ case 2:
|
|
321
|
+ item.MedChrgitmType = "05"
|
|
322
|
+
|
|
323
|
+ break
|
|
324
|
+ case 3:
|
|
325
|
+ item.MedChrgitmType = "04"
|
248
|
326
|
|
|
327
|
+ break
|
|
328
|
+ case 4:
|
|
329
|
+ item.MedChrgitmType = "14"
|
|
330
|
+
|
|
331
|
+ break
|
|
332
|
+ case 5:
|
|
333
|
+ item.MedChrgitmType = "08"
|
|
334
|
+
|
|
335
|
+ break
|
|
336
|
+ case 6:
|
|
337
|
+ item.MedChrgitmType = "14"
|
|
338
|
+ break
|
|
339
|
+ case 7:
|
|
340
|
+ item.MedChrgitmType = "14"
|
|
341
|
+ break
|
|
342
|
+ case 8:
|
|
343
|
+ item.MedChrgitmType = "03"
|
|
344
|
+ break
|
|
345
|
+ case 9:
|
|
346
|
+ item.MedChrgitmType = "14"
|
|
347
|
+ break
|
|
348
|
+ }
|
|
349
|
+ }
|
249
|
350
|
} else if item.HisPrescriptionProject.Type == 3 {
|
250
|
351
|
item.MedChrgitmType = "08"
|
251
|
352
|
}
|
252
|
353
|
}
|
253
|
354
|
}
|
|
355
|
+
|
254
|
356
|
order.PsnCashPay = order.MedfeeSumamt
|
255
|
357
|
|
|
358
|
+ for _, item := range orderInfos {
|
|
359
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
360
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
361
|
+ //bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
362
|
+ //bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
363
|
+ }
|
|
364
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
365
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
366
|
+ //zhenChaCostSelfTotal = zhenChaCostTotal
|
|
367
|
+ }
|
|
368
|
+
|
|
369
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
370
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
371
|
+ //checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
372
|
+ //checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
373
|
+ }
|
|
374
|
+
|
|
375
|
+ if item.MedChrgitmType == "02" { //检查费
|
|
376
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
377
|
+ //checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
378
|
+ //checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
379
|
+ }
|
|
380
|
+
|
|
381
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
382
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
383
|
+ //laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
384
|
+ //laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
385
|
+ }
|
|
386
|
+
|
|
387
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
388
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
389
|
+ //treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
390
|
+ //treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
391
|
+ }
|
|
392
|
+
|
|
393
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
394
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
395
|
+ //operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
396
|
+ //operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
397
|
+ }
|
|
398
|
+
|
|
399
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
400
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
401
|
+ //materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
402
|
+ //materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
403
|
+ }
|
|
404
|
+
|
|
405
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
406
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
407
|
+ //westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
408
|
+ //westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
409
|
+ }
|
|
410
|
+
|
|
411
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
412
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
413
|
+ //chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
414
|
+ //chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
415
|
+ }
|
|
416
|
+
|
|
417
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
|
|
418
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
419
|
+ //otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
420
|
+ //otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
421
|
+ }
|
|
422
|
+ }
|
|
423
|
+
|
256
|
424
|
org, _ := service.GetOrgById(adminUser.CurrentOrgId)
|
257
|
425
|
printor_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
258
|
426
|
charge_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, order.Creator)
|
|
@@ -260,16 +428,48 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
|
260
|
428
|
patient, _ := service.GetPatientByID(order.UserOrgId, order.PatientId)
|
261
|
429
|
|
262
|
430
|
c.ServeSuccessJSON(map[string]interface{}{
|
263
|
|
- "org_name": org.OrgName,
|
264
|
|
- "name": patient.Name,
|
265
|
|
- "order_infos": orderInfos,
|
266
|
|
- "number": order.MdtrtId,
|
267
|
|
- "date": order.SettleAccountsDate,
|
268
|
|
- "charge_admin": charge_admin,
|
269
|
|
- "printor_admin": printor_admin,
|
270
|
|
- "info": order,
|
271
|
|
- "his_hospital": his_hospital,
|
272
|
|
- "his": his,
|
|
431
|
+ "patient": patient,
|
|
432
|
+ "order_infos": orderInfos,
|
|
433
|
+ "diagnosis": name,
|
|
434
|
+ "bedCostTotal": bedCostTotal,
|
|
435
|
+ "bedCostSelfTotal": bedCostTotal,
|
|
436
|
+ "bedCostPartSelfTotal": bedCostPartSelfTotal,
|
|
437
|
+ "operationCostTotal": operationCostTotal,
|
|
438
|
+ "operationCostSelfTotal": operationCostTotal,
|
|
439
|
+ "operationCostPartSelfTotal": operationCostPartSelfTotal,
|
|
440
|
+ "otherCostTotal": otherCostTotal,
|
|
441
|
+ "otherCostSelfTotal": otherCostTotal,
|
|
442
|
+ "otherCostPartSelfTotal": otherCostPartSelfTotal,
|
|
443
|
+ "materialCostTotal": materialCostTotal,
|
|
444
|
+ "materialCostSelfTotal": materialCostTotal,
|
|
445
|
+ "materialCostPartSelfTotal": materialCostPartSelfTotal,
|
|
446
|
+ "westernMedicineCostTotal": westernMedicineCostTotal,
|
|
447
|
+ "westernMedicineCostSelfTotal": westernMedicineCostTotal,
|
|
448
|
+ "westernMedicineCostPartSelfTotal": westernMedicineCostPartSelfTotal,
|
|
449
|
+ "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
|
|
450
|
+ "chineseTraditionalMedicineCostSelfTotal": chineseTraditionalMedicineCostTotal,
|
|
451
|
+ "chineseTraditionalMedicineCostPartSelfTotal": chineseTraditionalMedicineCostPartSelfTotal,
|
|
452
|
+ "checkCostTotal": checkCostTotal,
|
|
453
|
+ "checkCostSelfTotal": checkCostTotal,
|
|
454
|
+ "zhenChaCostTotal": zhenChaCostTotal,
|
|
455
|
+ "zhenChaCostSelfTotal": zhenChaCostTotal,
|
|
456
|
+ "checkCostPartSelfTotal": checkCostPartSelfTotal,
|
|
457
|
+ "laboratoryCostTotal": laboratoryCostTotal,
|
|
458
|
+ "laboratoryCostSelfTotal": laboratoryCostTotal,
|
|
459
|
+ "laboratoryCostPartSelfTotal": laboratoryCostPartSelfTotal,
|
|
460
|
+ "treatCostTotal": treatCostTotal,
|
|
461
|
+ "treatCostSelfTotal": treatCostTotal,
|
|
462
|
+ "treatCostPartSelfTotal": treatCostPartSelfTotal,
|
|
463
|
+ "charge_admin": charge_admin,
|
|
464
|
+ "printor_admin": printor_admin,
|
|
465
|
+ "org_name": org.OrgName,
|
|
466
|
+ "org_code": miConfig.Code,
|
|
467
|
+ "name": patient.Name,
|
|
468
|
+ "number": order.MdtrtId,
|
|
469
|
+ "date": order.SettleAccountsDate,
|
|
470
|
+ "info": order,
|
|
471
|
+ "his_hospital": his_hospital,
|
|
472
|
+ "his": his,
|
273
|
473
|
})
|
274
|
474
|
|
275
|
475
|
}
|
|
@@ -4390,6 +4590,8 @@ func (c *HisApiController) GetUploadInfo() {
|
4390
|
4590
|
reg_type = 11
|
4391
|
4591
|
}
|
4392
|
4592
|
|
|
4593
|
+ tm := time.Unix(time.Now().Unix(), 0)
|
|
4594
|
+
|
4393
|
4595
|
allTotal := fmt.Sprintf("%.4f", total)
|
4394
|
4596
|
totals, _ := strconv.ParseFloat(allTotal, 64)
|
4395
|
4597
|
order := &models.HisOrder{
|
|
@@ -4421,7 +4623,7 @@ func (c *HisApiController) GetUploadInfo() {
|
4421
|
4623
|
FaPiaoNumber: fapiao_number,
|
4422
|
4624
|
Diagnosis: diagnosis_id,
|
4423
|
4625
|
PType: 2,
|
4424
|
|
- //SetlTime: t
|
|
4626
|
+ SetlTime: tm.Format("2006-01-02 15:04:05"),
|
4425
|
4627
|
}
|
4426
|
4628
|
err = service.CreateOrder(order)
|
4427
|
4629
|
if err != nil {
|
|
@@ -4769,9 +4971,29 @@ func (this *HisApiController) GetHisDayPrescription() {
|
4769
|
4971
|
|
4770
|
4972
|
}
|
4771
|
4973
|
|
|
4974
|
+ var settle_total float64
|
|
4975
|
+ for _, item := range dayHisPrescription {
|
|
4976
|
+ if len(item.HisPrescriptionProject) > 0 {
|
|
4977
|
+ for _, subItem := range item.HisPrescriptionProject {
|
|
4978
|
+ count, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
4979
|
+ total, _ := decimal.NewFromFloat(count * subItem.Price).Round(2).Float64()
|
|
4980
|
+ settle_total = settle_total + total
|
|
4981
|
+ }
|
|
4982
|
+ }
|
|
4983
|
+ if len(item.HisDoctorAdviceInfo) > 0 {
|
|
4984
|
+ for _, subItem := range item.HisDoctorAdviceInfo {
|
|
4985
|
+ total, _ := decimal.NewFromFloat(subItem.PrescribingNumber * subItem.Price).Round(2).Float64()
|
|
4986
|
+ settle_total = settle_total + total
|
|
4987
|
+ }
|
|
4988
|
+ }
|
|
4989
|
+
|
|
4990
|
+ }
|
|
4991
|
+ settle_total, _ = decimal.NewFromFloat(settle_total).Round(2).Float64()
|
|
4992
|
+
|
4772
|
4993
|
if err == nil {
|
4773
|
4994
|
this.ServeSuccessJSON(map[string]interface{}{
|
4774
|
4995
|
"day_prescription": dayHisPrescription,
|
|
4996
|
+ "settle_total": settle_total,
|
4775
|
4997
|
})
|
4776
|
4998
|
return
|
4777
|
4999
|
} else {
|
|
@@ -4901,6 +5123,7 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
4901
|
5123
|
xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
|
4902
|
5124
|
|
4903
|
5125
|
var prescriptions []*models.HisPrescription
|
|
5126
|
+ //var unChargeMonthPrescriptions []*models.HisPrescription
|
4904
|
5127
|
|
4905
|
5128
|
order, _ := service.GetHisOrderByID(order_id)
|
4906
|
5129
|
|
|
@@ -4908,15 +5131,9 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
4908
|
5131
|
prescriptions, _ = service.GetUnChargeHisPrescriptionFive(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime, p_type)
|
4909
|
5132
|
} else if order_status == 2 {
|
4910
|
5133
|
prescriptions, _ = service.GetChargeHisPrescriptionSeven(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
|
5134
|
+ //unChargeMonthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
4911
|
5135
|
}
|
4912
|
5136
|
|
4913
|
|
- //var monthPrescriptions []*models.HisPrescription
|
4914
|
|
- //if order_status == 1 || order_status == 0 {
|
4915
|
|
- // monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
4916
|
|
- //} else if order_status == 2 {
|
4917
|
|
- // monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
4918
|
|
- //}
|
4919
|
|
-
|
4920
|
5137
|
case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
4921
|
5138
|
patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
|
4922
|
5139
|
|
|
@@ -4933,13 +5150,11 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
4933
|
5150
|
"case_history": case_history,
|
4934
|
5151
|
"info": patientPrescriptionInfo,
|
4935
|
5152
|
"last_info": lastPatientPrescriptionInfo,
|
4936
|
|
- //"month_prescriptions": monthPrescriptions,
|
4937
|
|
- "order": order,
|
4938
|
|
- "doctors": doctors,
|
4939
|
|
- "department": department,
|
|
5153
|
+ "order": order,
|
|
5154
|
+ "doctors": doctors,
|
|
5155
|
+ "department": department,
|
4940
|
5156
|
})
|
4941
|
5157
|
return
|
4942
|
|
-
|
4943
|
5158
|
}
|
4944
|
5159
|
|
4945
|
5160
|
func (c *HisApiController) GetAllOrderDetail() {
|
|
@@ -4981,13 +5196,121 @@ func (c *HisApiController) GetAllOrderDetailCollect() {
|
4981
|
5196
|
//his, _ := service.Get(order.UserOrgId, order.MdtrtId)
|
4982
|
5197
|
record, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
4983
|
5198
|
|
|
5199
|
+ var bedCostTotal float64 = 0 //床位总费
|
|
5200
|
+ //var bedCostSelfTotal float64 = 0 //床位自费
|
|
5201
|
+
|
|
5202
|
+ var operationCostTotal float64 = 0 //手术费
|
|
5203
|
+ //var operationCostSelfTotal float64 = 0 //手术费
|
|
5204
|
+
|
|
5205
|
+ var otherCostTotal float64 = 0 //其他费用
|
|
5206
|
+ //var otherCostSelfTotal float64 = 0 //其他费用
|
|
5207
|
+
|
|
5208
|
+ var materialCostTotal float64 = 0 //材料费
|
|
5209
|
+ //var materialCostSelfTotal float64 = 0 //材料费
|
|
5210
|
+
|
|
5211
|
+ var westernMedicineCostTotal float64 = 0 //西药费
|
|
5212
|
+ //var westernMedicineCostSelfTotal float64 = 0 //西药费
|
|
5213
|
+
|
|
5214
|
+ var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
|
|
5215
|
+ //var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
|
|
5216
|
+
|
|
5217
|
+ var checkCostTotal float64 = 0 //检查费
|
|
5218
|
+ //var checkCostSelfTotal float64 = 0 //检查费
|
|
5219
|
+
|
|
5220
|
+ var laboratoryCostTotal float64 = 0 //化验费
|
|
5221
|
+ //var laboratoryCostSelfTotal float64 = 0 //化验费
|
|
5222
|
+
|
|
5223
|
+ var treatCostTotal float64 = 0 //治疗费用
|
|
5224
|
+ //var treatCostSelfTotal float64 = 0 //治疗费用
|
|
5225
|
+
|
|
5226
|
+ var zhenChaCostTotal float64 = 0 //其他费用
|
|
5227
|
+ //var zhenChaCostPartSelfTotal float64 = 0 //其他费用
|
|
5228
|
+
|
|
5229
|
+ decimal.DivisionPrecision = 2
|
|
5230
|
+
|
4984
|
5231
|
if his.BalanceAccountsType != 2 {
|
|
5232
|
+ for _, item := range order_info {
|
|
5233
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
5234
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5235
|
+ //bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5236
|
+ //bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5237
|
+ }
|
|
5238
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
5239
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5240
|
+ //zhenChaCostSelfTotal = zhenChaCostTotal
|
|
5241
|
+ }
|
|
5242
|
+
|
|
5243
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
5244
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5245
|
+ //checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5246
|
+ //checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5247
|
+ }
|
|
5248
|
+
|
|
5249
|
+ if item.MedChrgitmType == "02" { //检查费
|
|
5250
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5251
|
+ //checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5252
|
+ //checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5253
|
+ }
|
|
5254
|
+
|
|
5255
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
5256
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5257
|
+ //laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5258
|
+ //laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5259
|
+ }
|
|
5260
|
+
|
|
5261
|
+ if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
|
|
5262
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5263
|
+ //treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5264
|
+ //treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5265
|
+ }
|
|
5266
|
+
|
|
5267
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
5268
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5269
|
+ //operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5270
|
+ //operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5271
|
+ }
|
|
5272
|
+
|
|
5273
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
5274
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5275
|
+ //materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5276
|
+ //materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5277
|
+ }
|
|
5278
|
+
|
|
5279
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
5280
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5281
|
+ //westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5282
|
+ //westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5283
|
+ }
|
|
5284
|
+
|
|
5285
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
5286
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5287
|
+ //chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5288
|
+ //chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5289
|
+ }
|
|
5290
|
+
|
|
5291
|
+ if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
|
|
5292
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5293
|
+ //otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
5294
|
+ //otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
5295
|
+ }
|
|
5296
|
+ }
|
|
5297
|
+
|
4985
|
5298
|
c.ServeSuccessJSON(map[string]interface{}{
|
4986
|
|
- "order": order,
|
4987
|
|
- "order_info": order_info,
|
4988
|
|
- "patient": patient,
|
4989
|
|
- "admin_info": adminInfo,
|
4990
|
|
- "his_hospital": record,
|
|
5299
|
+ "order": order,
|
|
5300
|
+ "order_info": order_info,
|
|
5301
|
+ "patient": patient,
|
|
5302
|
+ "admin_info": adminInfo,
|
|
5303
|
+ "his_hospital": record,
|
|
5304
|
+ "bedCostTotal": bedCostTotal,
|
|
5305
|
+ "operationCostTotal": operationCostTotal,
|
|
5306
|
+ "otherCostTotal": otherCostTotal,
|
|
5307
|
+ "materialCostTotal": materialCostTotal,
|
|
5308
|
+ "westernMedicineCostTotal": westernMedicineCostTotal,
|
|
5309
|
+ "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
|
|
5310
|
+ "checkCostTotal": checkCostTotal,
|
|
5311
|
+ "zhenChaCostTotal": zhenChaCostTotal,
|
|
5312
|
+ "laboratoryCostTotal": laboratoryCostTotal,
|
|
5313
|
+ "treatCostTotal": treatCostTotal,
|
4991
|
5314
|
})
|
4992
|
5315
|
} else {
|
4993
|
5316
|
|
|
@@ -4999,58 +5322,128 @@ func (c *HisApiController) GetAllOrderDetailCollect() {
|
4999
|
5322
|
}
|
5000
|
5323
|
if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
5001
|
5324
|
if item.HisPrescriptionProject.Type == 2 {
|
5002
|
|
- switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
5003
|
|
-
|
5004
|
|
- case 1:
|
5005
|
|
- item.MedChrgitmType = "14"
|
5006
|
|
- break
|
5007
|
|
- case 2:
|
5008
|
|
- item.MedChrgitmType = "05"
|
5009
|
|
-
|
5010
|
|
- break
|
5011
|
|
- case 3:
|
5012
|
|
- item.MedChrgitmType = "04"
|
5013
|
|
-
|
5014
|
|
- break
|
5015
|
|
- case 4:
|
5016
|
|
- item.MedChrgitmType = "14"
|
5017
|
|
-
|
5018
|
|
- break
|
5019
|
|
- case 5:
|
5020
|
|
- item.MedChrgitmType = "08"
|
5021
|
|
-
|
5022
|
|
- break
|
5023
|
|
- case 6:
|
5024
|
|
- item.MedChrgitmType = "14"
|
|
5325
|
+ if c.GetAdminUserInfo().CurrentOrgId == 10215 {
|
|
5326
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
5327
|
+ case 0:
|
|
5328
|
+ item.MedChrgitmType = "0"
|
|
5329
|
+ break
|
|
5330
|
+ case 1:
|
|
5331
|
+ item.MedChrgitmType = "14"
|
|
5332
|
+ break
|
|
5333
|
+ case 2:
|
|
5334
|
+ item.MedChrgitmType = "05"
|
|
5335
|
+
|
|
5336
|
+ break
|
|
5337
|
+ case 3:
|
|
5338
|
+ item.MedChrgitmType = "03"
|
|
5339
|
+
|
|
5340
|
+ break
|
|
5341
|
+ case 4:
|
|
5342
|
+ item.MedChrgitmType = "03"
|
|
5343
|
+
|
|
5344
|
+ break
|
|
5345
|
+ case 5:
|
|
5346
|
+ item.MedChrgitmType = "08"
|
|
5347
|
+
|
|
5348
|
+ break
|
|
5349
|
+ case 6:
|
|
5350
|
+ item.MedChrgitmType = "14"
|
|
5351
|
+
|
|
5352
|
+ break
|
|
5353
|
+ case 7:
|
|
5354
|
+ item.MedChrgitmType = "14"
|
|
5355
|
+
|
|
5356
|
+ break
|
|
5357
|
+ case 8:
|
|
5358
|
+ item.MedChrgitmType = "03"
|
|
5359
|
+ break
|
|
5360
|
+ case 9:
|
|
5361
|
+ item.MedChrgitmType = "14"
|
|
5362
|
+ break
|
|
5363
|
+ case 10:
|
|
5364
|
+ item.MedChrgitmType = "14"
|
|
5365
|
+ break
|
|
5366
|
+ case 11:
|
|
5367
|
+ item.MedChrgitmType = "06"
|
|
5368
|
+ break
|
|
5369
|
+ case 12:
|
|
5370
|
+ item.MedChrgitmType = "12"
|
|
5371
|
+ break
|
|
5372
|
+ case 13:
|
|
5373
|
+ item.MedChrgitmType = "01"
|
|
5374
|
+ break
|
|
5375
|
+ case 14:
|
|
5376
|
+ item.MedChrgitmType = "04"
|
|
5377
|
+ break
|
|
5378
|
+ case 15:
|
|
5379
|
+ item.MedChrgitmType = "14"
|
|
5380
|
+ break
|
5025
|
5381
|
|
5026
|
|
- break
|
5027
|
|
- case 7:
|
5028
|
|
- item.MedChrgitmType = "14"
|
|
5382
|
+ }
|
5029
|
5383
|
|
5030
|
|
- break
|
5031
|
|
- case 8:
|
5032
|
|
- item.MedChrgitmType = "03"
|
5033
|
|
- break
|
5034
|
|
- case 9:
|
5035
|
|
- item.MedChrgitmType = "14"
|
5036
|
|
- break
|
|
5384
|
+ } else {
|
|
5385
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
5386
|
+
|
|
5387
|
+ case 1:
|
|
5388
|
+ item.MedChrgitmType = "14"
|
|
5389
|
+ break
|
|
5390
|
+ case 2:
|
|
5391
|
+ item.MedChrgitmType = "05"
|
|
5392
|
+
|
|
5393
|
+ break
|
|
5394
|
+ case 3:
|
|
5395
|
+ item.MedChrgitmType = "04"
|
|
5396
|
+
|
|
5397
|
+ break
|
|
5398
|
+ case 4:
|
|
5399
|
+ item.MedChrgitmType = "14"
|
|
5400
|
+
|
|
5401
|
+ break
|
|
5402
|
+ case 5:
|
|
5403
|
+ item.MedChrgitmType = "08"
|
|
5404
|
+
|
|
5405
|
+ break
|
|
5406
|
+ case 6:
|
|
5407
|
+ item.MedChrgitmType = "14"
|
|
5408
|
+
|
|
5409
|
+ break
|
|
5410
|
+ case 7:
|
|
5411
|
+ item.MedChrgitmType = "14"
|
|
5412
|
+
|
|
5413
|
+ break
|
|
5414
|
+ case 8:
|
|
5415
|
+ item.MedChrgitmType = "03"
|
|
5416
|
+ break
|
|
5417
|
+ case 9:
|
|
5418
|
+ item.MedChrgitmType = "14"
|
|
5419
|
+ break
|
|
5420
|
+ }
|
5037
|
5421
|
}
|
5038
|
5422
|
} else if item.HisPrescriptionProject.Type == 3 {
|
5039
|
5423
|
item.MedChrgitmType = "08"
|
5040
|
5424
|
}
|
5041
|
5425
|
}
|
5042
|
5426
|
}
|
|
5427
|
+
|
5043
|
5428
|
c.ServeSuccessJSON(map[string]interface{}{
|
5044
|
|
- "order": order,
|
5045
|
|
- "order_info": order_info,
|
5046
|
|
- "patient": patient,
|
5047
|
|
- "admin_info": adminInfo,
|
5048
|
|
- "his_hospital": record,
|
|
5429
|
+ "order": order,
|
|
5430
|
+ "order_info": order_info,
|
|
5431
|
+ "patient": patient,
|
|
5432
|
+ "admin_info": adminInfo,
|
|
5433
|
+ "his_hospital": record,
|
|
5434
|
+ "bedCostTotal": bedCostTotal,
|
|
5435
|
+ "operationCostTotal": operationCostTotal,
|
|
5436
|
+ "otherCostTotal": otherCostTotal,
|
|
5437
|
+ "materialCostTotal": materialCostTotal,
|
|
5438
|
+ "westernMedicineCostTotal": westernMedicineCostTotal,
|
|
5439
|
+ "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
|
|
5440
|
+ "checkCostTotal": checkCostTotal,
|
|
5441
|
+ "zhenChaCostTotal": zhenChaCostTotal,
|
|
5442
|
+ "laboratoryCostTotal": laboratoryCostTotal,
|
|
5443
|
+ "treatCostTotal": treatCostTotal,
|
5049
|
5444
|
})
|
5050
|
5445
|
|
5051
|
5446
|
}
|
5052
|
|
-
|
5053
|
|
- return
|
5054
|
5447
|
}
|
5055
|
5448
|
|
5056
|
5449
|
func (c *HisApiController) GetMedicalInsuranceCostCompareList() {
|
|
@@ -5165,6 +5558,7 @@ func (c *HisApiController) GetFaPiaoData() {
|
5165
|
5558
|
his, _ := service.GetHisPatientInfoThree(adminUser.CurrentOrgId, number)
|
5166
|
5559
|
|
5167
|
5560
|
his_hospital_record, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
5561
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
5168
|
5562
|
|
5169
|
5563
|
//prescriptions, _ := service.GetHisPrescriptionThree(adminUser.CurrentOrgId, patient_id, order.Number)
|
5170
|
5564
|
|
|
@@ -5211,50 +5605,124 @@ func (c *HisApiController) GetFaPiaoData() {
|
5211
|
5605
|
decimal.DivisionPrecision = 2
|
5212
|
5606
|
orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
|
5213
|
5607
|
|
5214
|
|
- if his.BalanceAccountsType == 2 {
|
|
5608
|
+ var balanceAccountsType int64
|
|
5609
|
+ if his.ID > 0 {
|
|
5610
|
+
|
|
5611
|
+ balanceAccountsType = his.BalanceAccountsType
|
|
5612
|
+ } else {
|
|
5613
|
+
|
|
5614
|
+ balanceAccountsType = his_hospital_record.BalanceAccountsType
|
|
5615
|
+ }
|
|
5616
|
+
|
|
5617
|
+ if balanceAccountsType == 2 {
|
5215
|
5618
|
//orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
|
5216
|
5619
|
for _, item := range orderInfos_two {
|
5217
|
5620
|
item.FulamtOwnpayAmt = item.DetItemFeeSumamt
|
5218
|
5621
|
if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
|
5219
|
5622
|
item.MedChrgitmType = "09"
|
5220
|
5623
|
}
|
|
5624
|
+
|
5221
|
5625
|
if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
|
5222
|
5626
|
if item.HisPrescriptionProject.Type == 2 {
|
5223
|
|
- switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
5224
|
|
-
|
5225
|
|
- case 1:
|
5226
|
|
- item.MedChrgitmType = "14"
|
5227
|
|
- break
|
5228
|
|
- case 2:
|
5229
|
|
- item.MedChrgitmType = "05"
|
5230
|
|
-
|
5231
|
|
- break
|
5232
|
|
- case 3:
|
5233
|
|
- item.MedChrgitmType = "04"
|
|
5627
|
+ if c.GetAdminUserInfo().CurrentOrgId == 10215 {
|
|
5628
|
+ fmt.Println("CostClassify")
|
|
5629
|
+ fmt.Println(item.HisPrescriptionProject.VMHisProject.CostClassify)
|
|
5630
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
5631
|
+ case 0:
|
|
5632
|
+ item.MedChrgitmType = "0"
|
|
5633
|
+ break
|
|
5634
|
+ case 1:
|
|
5635
|
+ item.MedChrgitmType = "14"
|
|
5636
|
+ break
|
|
5637
|
+ case 2:
|
|
5638
|
+ item.MedChrgitmType = "05"
|
|
5639
|
+
|
|
5640
|
+ break
|
|
5641
|
+ case 3:
|
|
5642
|
+ item.MedChrgitmType = "03"
|
|
5643
|
+
|
|
5644
|
+ break
|
|
5645
|
+ case 4:
|
|
5646
|
+ item.MedChrgitmType = "03"
|
|
5647
|
+
|
|
5648
|
+ break
|
|
5649
|
+ case 5:
|
|
5650
|
+ item.MedChrgitmType = "08"
|
|
5651
|
+
|
|
5652
|
+ break
|
|
5653
|
+ case 6:
|
|
5654
|
+ item.MedChrgitmType = "14"
|
|
5655
|
+
|
|
5656
|
+ break
|
|
5657
|
+ case 7:
|
|
5658
|
+ item.MedChrgitmType = "14"
|
|
5659
|
+
|
|
5660
|
+ break
|
|
5661
|
+ case 8:
|
|
5662
|
+ item.MedChrgitmType = "03"
|
|
5663
|
+ break
|
|
5664
|
+ case 9:
|
|
5665
|
+ item.MedChrgitmType = "14"
|
|
5666
|
+ break
|
|
5667
|
+ case 10:
|
|
5668
|
+ item.MedChrgitmType = "14"
|
|
5669
|
+ break
|
|
5670
|
+ case 11:
|
|
5671
|
+ item.MedChrgitmType = "06"
|
|
5672
|
+ break
|
|
5673
|
+ case 12:
|
|
5674
|
+ item.MedChrgitmType = "12"
|
|
5675
|
+ break
|
|
5676
|
+ case 13:
|
|
5677
|
+ item.MedChrgitmType = "01"
|
|
5678
|
+ break
|
|
5679
|
+ case 14:
|
|
5680
|
+ item.MedChrgitmType = "04"
|
|
5681
|
+ break
|
|
5682
|
+ case 15:
|
|
5683
|
+ item.MedChrgitmType = "02"
|
|
5684
|
+ break
|
5234
|
5685
|
|
5235
|
|
- break
|
5236
|
|
- case 4:
|
5237
|
|
- item.MedChrgitmType = "14"
|
5238
|
|
-
|
5239
|
|
- break
|
5240
|
|
- case 5:
|
5241
|
|
- item.MedChrgitmType = "08"
|
5242
|
|
-
|
5243
|
|
- break
|
5244
|
|
- case 6:
|
5245
|
|
- item.MedChrgitmType = "14"
|
|
5686
|
+ }
|
5246
|
5687
|
|
5247
|
|
- break
|
5248
|
|
- case 7:
|
5249
|
|
- item.MedChrgitmType = "14"
|
|
5688
|
+ } else {
|
|
5689
|
+ switch item.HisPrescriptionProject.VMHisProject.CostClassify {
|
|
5690
|
+
|
|
5691
|
+ case 1:
|
|
5692
|
+ item.MedChrgitmType = "14"
|
|
5693
|
+ break
|
|
5694
|
+ case 2:
|
|
5695
|
+ item.MedChrgitmType = "05"
|
|
5696
|
+
|
|
5697
|
+ break
|
|
5698
|
+ case 3:
|
|
5699
|
+ item.MedChrgitmType = "03"
|
|
5700
|
+
|
|
5701
|
+ break
|
|
5702
|
+ case 4:
|
|
5703
|
+ item.MedChrgitmType = "03"
|
|
5704
|
+
|
|
5705
|
+ break
|
|
5706
|
+ case 5:
|
|
5707
|
+ item.MedChrgitmType = "08"
|
|
5708
|
+
|
|
5709
|
+ break
|
|
5710
|
+ case 6:
|
|
5711
|
+ item.MedChrgitmType = "14"
|
|
5712
|
+
|
|
5713
|
+ break
|
|
5714
|
+ case 7:
|
|
5715
|
+ item.MedChrgitmType = "14"
|
|
5716
|
+
|
|
5717
|
+ break
|
|
5718
|
+ case 8:
|
|
5719
|
+ item.MedChrgitmType = "03"
|
|
5720
|
+ break
|
|
5721
|
+ case 9:
|
|
5722
|
+ item.MedChrgitmType = "14"
|
|
5723
|
+ break
|
5250
|
5724
|
|
5251
|
|
- break
|
5252
|
|
- case 8:
|
5253
|
|
- item.MedChrgitmType = "03"
|
5254
|
|
- break
|
5255
|
|
- case 9:
|
5256
|
|
- item.MedChrgitmType = "14"
|
5257
|
|
- break
|
|
5725
|
+ }
|
5258
|
5726
|
|
5259
|
5727
|
}
|
5260
|
5728
|
|
|
@@ -5265,11 +5733,17 @@ func (c *HisApiController) GetFaPiaoData() {
|
5265
|
5733
|
}
|
5266
|
5734
|
|
5267
|
5735
|
for _, item := range orderInfos_two {
|
|
5736
|
+ fmt.Println(item.MedChrgitmType)
|
5268
|
5737
|
if item.MedChrgitmType == "01" { //床位费
|
5269
|
5738
|
bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
5270
|
5739
|
bedCostSelfTotal = bedCostTotal
|
5271
|
5740
|
}
|
5272
|
5741
|
|
|
5742
|
+ if item.MedChrgitmType == "02" { //诊察费
|
|
5743
|
+ zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
5744
|
+ zhenChaCostSelfTotal = zhenChaCostTotal
|
|
5745
|
+ }
|
|
5746
|
+
|
5273
|
5747
|
if item.MedChrgitmType == "03" { //检查费
|
5274
|
5748
|
checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
5275
|
5749
|
checkCostSelfTotal = checkCostTotal
|
|
@@ -5426,6 +5900,7 @@ func (c *HisApiController) GetFaPiaoData() {
|
5426
|
5900
|
"zhenChaCostSelfTotal": zhenChaCostSelfTotal,
|
5427
|
5901
|
"zhenChaCostPartSelfTotal": zhenChaCostPartSelfTotal,
|
5428
|
5902
|
"his_hospital_record": his_hospital_record,
|
|
5903
|
+ "org_name": miConfig.OrgName,
|
5429
|
5904
|
})
|
5430
|
5905
|
|
5431
|
5906
|
}
|
|
@@ -6591,6 +7066,7 @@ func (c *HisApiController) GetHisMonthChargePatientInfo() {
|
6591
|
7066
|
}
|
6592
|
7067
|
|
6593
|
7068
|
}
|
|
7069
|
+ settle_total, _ = decimal.NewFromFloat(settle_total).Round(2).Float64()
|
6594
|
7070
|
|
6595
|
7071
|
case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
6596
|
7072
|
patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
|
|
@@ -6650,6 +7126,25 @@ func (c *HisApiController) GetHisMonthPatientInfo() {
|
6650
|
7126
|
count, _ := service.GetHisPatientCount(admin.CurrentOrgId, patient_id, recordDateTime)
|
6651
|
7127
|
|
6652
|
7128
|
monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
|
7129
|
+ var settle_total float64
|
|
7130
|
+ for _, item := range monthPrescriptions {
|
|
7131
|
+ if len(item.HisPrescriptionProject) > 0 {
|
|
7132
|
+ for _, subItem := range item.HisPrescriptionProject {
|
|
7133
|
+ count, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
7134
|
+ total, _ := decimal.NewFromFloat(count * subItem.Price).Round(2).Float64()
|
|
7135
|
+ settle_total = settle_total + total
|
|
7136
|
+ }
|
|
7137
|
+ }
|
|
7138
|
+ if len(item.HisDoctorAdviceInfo) > 0 {
|
|
7139
|
+ for _, subItem := range item.HisDoctorAdviceInfo {
|
|
7140
|
+ total, _ := decimal.NewFromFloat(subItem.PrescribingNumber * subItem.Price).Round(2).Float64()
|
|
7141
|
+ settle_total = settle_total + total
|
|
7142
|
+ }
|
|
7143
|
+ }
|
|
7144
|
+
|
|
7145
|
+ }
|
|
7146
|
+ settle_total, _ = decimal.NewFromFloat(settle_total).Round(2).Float64()
|
|
7147
|
+
|
6653
|
7148
|
case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
6654
|
7149
|
patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
|
6655
|
7150
|
lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
@@ -6672,6 +7167,7 @@ func (c *HisApiController) GetHisMonthPatientInfo() {
|
6672
|
7167
|
"count": count,
|
6673
|
7168
|
"drugStockConfig": drugStockConfig,
|
6674
|
7169
|
"last_info": lastPatientPrescriptionInfo,
|
|
7170
|
+ "settle_total": settle_total,
|
6675
|
7171
|
})
|
6676
|
7172
|
return
|
6677
|
7173
|
|
|
@@ -6942,3 +7438,45 @@ func (c *HisApiController) GetHisDoctorAdviceInfo() {
|
6942
|
7438
|
})
|
6943
|
7439
|
return
|
6944
|
7440
|
}
|
|
7441
|
+
|
|
7442
|
+func (c *HisApiController) GetHisMonthChargePatientList() {
|
|
7443
|
+ record_date := c.GetString("record_date")
|
|
7444
|
+ start_time := c.GetString("start_time")
|
|
7445
|
+ end_time := c.GetString("end_time")
|
|
7446
|
+ timeLayout := "2006-01-02"
|
|
7447
|
+ loc, _ := time.LoadLocation("Local")
|
|
7448
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
7449
|
+ if err != nil {
|
|
7450
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
7451
|
+ return
|
|
7452
|
+ }
|
|
7453
|
+
|
|
7454
|
+ if err != nil {
|
|
7455
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
7456
|
+ return
|
|
7457
|
+ }
|
|
7458
|
+ recordDateTime := theTime.Unix()
|
|
7459
|
+ startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
7460
|
+ if err != nil {
|
|
7461
|
+
|
|
7462
|
+ }
|
|
7463
|
+ startRecordDateTime := startTime.Unix()
|
|
7464
|
+ endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
7465
|
+ if err != nil {
|
|
7466
|
+
|
|
7467
|
+ }
|
|
7468
|
+ endRecordDateTime := endTime.Unix()
|
|
7469
|
+ adminInfo := c.GetAdminUserInfo()
|
|
7470
|
+ var tempMonthChargePatients []*service.MonthChargePatients
|
|
7471
|
+ tempPatients, _ := service.GetMonthUnChargeHisPatientList(adminInfo.CurrentOrgId, recordDateTime, startRecordDateTime, endRecordDateTime)
|
|
7472
|
+ for _, item := range tempPatients {
|
|
7473
|
+ //过滤没有处方的
|
|
7474
|
+ if len(item.HisPrescription) == 0 {
|
|
7475
|
+ tempMonthChargePatients = append(tempMonthChargePatients, item)
|
|
7476
|
+ }
|
|
7477
|
+ }
|
|
7478
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
7479
|
+ "list": tempMonthChargePatients,
|
|
7480
|
+ })
|
|
7481
|
+
|
|
7482
|
+}
|