|
@@ -90,8 +90,7 @@ func (c *HisApiController) Check3101() {
|
90
|
90
|
his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
91
|
91
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
92
|
92
|
record_time := c.GetString("record_time")
|
93
|
|
-
|
94
|
|
- trig_scen := "1"
|
|
93
|
+ trig_scen := c.GetString("trig_scen")
|
95
|
94
|
|
96
|
95
|
timeLayout := "2006-01-02"
|
97
|
96
|
loc, _ := time.LoadLocation("Local")
|
|
@@ -189,10 +188,10 @@ func (c *HisApiController) Check3101() {
|
189
|
188
|
} else {
|
190
|
189
|
fed.MedType = "9933"
|
191
|
190
|
}
|
|
191
|
+ var orders []*models.FsiOrderDtos
|
192
|
192
|
|
193
|
193
|
if trig_scen == "2" {
|
194
|
194
|
|
195
|
|
- var orders []*models.FsiOrderDtos
|
196
|
195
|
for _, item := range prescriptions {
|
197
|
196
|
for _, subItem := range item.HisDoctorAdviceInfo {
|
198
|
197
|
var order models.FsiOrderDtos
|
|
@@ -310,6 +309,42 @@ func (c *HisApiController) Check3101() {
|
310
|
309
|
fed.ReimFlag = "0"
|
311
|
310
|
fed.OutSetlFlag = "0"
|
312
|
311
|
|
|
312
|
+ var fopd []*models.FsiOperationDtosData
|
|
313
|
+ data := make(map[string]interface{})
|
|
314
|
+ data["fed"] = fed
|
|
315
|
+ data["fdd"] = fdds
|
|
316
|
+ data["fod"] = orders
|
|
317
|
+ data["pd"] = pd
|
|
318
|
+ data["pp"] = pp
|
|
319
|
+ data["fopd"] = fopd
|
|
320
|
+ data["trig_scen"] = trig_scen
|
|
321
|
+ fmt.Println(data)
|
|
322
|
+ fmt.Println(fed)
|
|
323
|
+ fmt.Println(fdds)
|
|
324
|
+ fmt.Println(orders)
|
|
325
|
+ fmt.Println(pd)
|
|
326
|
+ fmt.Println(pp)
|
|
327
|
+ fmt.Println(fopd)
|
|
328
|
+
|
|
329
|
+ client := &http.Client{}
|
|
330
|
+ bytesData, _ := json.Marshal(data)
|
|
331
|
+ var req *http.Request
|
|
332
|
+ req, _ = http.NewRequest("POST", "http://192.168.3.111:9532/"+"jsyb/3101", bytes.NewReader(bytesData))
|
|
333
|
+ resp, _ := client.Do(req)
|
|
334
|
+ defer resp.Body.Close()
|
|
335
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
336
|
+ if ioErr != nil {
|
|
337
|
+ utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
338
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
339
|
+ return
|
|
340
|
+ }
|
|
341
|
+ var respJSON map[string]interface{}
|
|
342
|
+ if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
|
|
343
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
344
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
345
|
+ return
|
|
346
|
+ }
|
|
347
|
+
|
313
|
348
|
|
314
|
349
|
|
315
|
350
|
|
|
@@ -317,15 +352,17 @@ func (c *HisApiController) Check3101() {
|
317
|
352
|
|
318
|
353
|
func (c *HisApiController) Check3102() {
|
319
|
354
|
patient_id, _ := c.GetInt64("patient_id")
|
|
355
|
+ order_id, _ := c.GetInt64("order_id")
|
320
|
356
|
his_patient_id, _ := c.GetInt64("his_patient_id")
|
321
|
357
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
358
|
+ trig_scen := c.GetString("trig_scen")
|
|
359
|
+
|
322
|
360
|
adminUser := c.GetAdminUserInfo()
|
323
|
361
|
roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
324
|
362
|
his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
325
|
363
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
326
|
364
|
record_time := c.GetString("record_time")
|
327
|
|
-
|
328
|
|
- trig_scen := "1"
|
|
365
|
+ order, _ := service.GetHisOrderByID(order_id)
|
329
|
366
|
|
330
|
367
|
timeLayout := "2006-01-02"
|
331
|
368
|
loc, _ := time.LoadLocation("Local")
|
|
@@ -344,7 +381,7 @@ func (c *HisApiController) Check3102() {
|
344
|
381
|
department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
345
|
382
|
doctor_info, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
|
346
|
383
|
|
347
|
|
- diagnosis_ids := strings.Split(patientPrescription.Diagnosis, ",")
|
|
384
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
348
|
385
|
|
349
|
386
|
prescriptions, _ := service.GetNewHisPrescriptionTen(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
|
350
|
387
|
|
|
@@ -418,17 +455,44 @@ func (c *HisApiController) Check3102() {
|
418
|
455
|
fed.DscgDeptCodg = strconv.FormatInt(department.ID, 10)
|
419
|
456
|
fed.DscgDeptName = department.Name
|
420
|
457
|
fed.MedMdtrtType = ""
|
421
|
|
- if his.Insutype == "390" {
|
422
|
|
- fed.MedType = "1402"
|
423
|
|
- } else {
|
424
|
|
- fed.MedType = "9933"
|
425
|
|
- }
|
426
|
458
|
|
427
|
|
- if trig_scen == "2" {
|
428
|
|
-
|
429
|
|
- var orders []*models.FsiOrderDtos
|
430
|
|
- for _, item := range prescriptions {
|
431
|
|
- for _, subItem := range item.HisDoctorAdviceInfo {
|
|
459
|
+ fed.MedType = order.MedType
|
|
460
|
+
|
|
461
|
+ var orders []*models.FsiOrderDtos
|
|
462
|
+ for _, item := range prescriptions {
|
|
463
|
+ for _, subItem := range item.HisDoctorAdviceInfo {
|
|
464
|
+ var order models.FsiOrderDtos
|
|
465
|
+ order.RxID = strconv.FormatInt(item.ID, 10)
|
|
466
|
+ order.Rxno = strconv.FormatInt(item.ID, 10)
|
|
467
|
+ order.LongDrordFlag = "0"
|
|
468
|
+ order.HilistType = "1"
|
|
469
|
+ order.ChrgType = "1"
|
|
470
|
+ order.DrordBhvr = "-"
|
|
471
|
+ order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
|
|
472
|
+ order.HosplistName = subItem.BaseDrugLib.DrugName
|
|
473
|
+ order.HilistLv = "1"
|
|
474
|
+ order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
|
475
|
+ order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
|
|
476
|
+ order.HosplistName = subItem.BaseDrugLib.DrugName
|
|
477
|
+ order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
|
|
478
|
+ order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
|
479
|
+ order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
|
|
480
|
+ order.OwnpayAmt = ""
|
|
481
|
+ order.SelfpayAmt = ""
|
|
482
|
+ order.Spec = ""
|
|
483
|
+ order.SpecUnt = ""
|
|
484
|
+ order.DrordBegnDate = s_tm
|
|
485
|
+ order.DrordStopDate = ""
|
|
486
|
+ order.DrordDrCodg = "1"
|
|
487
|
+ order.DrordDeptName = department.Name
|
|
488
|
+ order.DrordDrCodg = "1"
|
|
489
|
+ order.DrordDrName = doctor_info.UserName
|
|
490
|
+ order.DrordDrProfttl = ""
|
|
491
|
+ order.CurrDrordFlag = "1"
|
|
492
|
+ orders = append(orders, &order)
|
|
493
|
+ }
|
|
494
|
+ for _, subItem := range item.HisPrescriptionProject {
|
|
495
|
+ if subItem.Type == 2 {
|
432
|
496
|
var order models.FsiOrderDtos
|
433
|
497
|
order.RxID = strconv.FormatInt(item.ID, 10)
|
434
|
498
|
order.Rxno = strconv.FormatInt(item.ID, 10)
|
|
@@ -436,15 +500,17 @@ func (c *HisApiController) Check3102() {
|
436
|
500
|
order.HilistType = "1"
|
437
|
501
|
order.ChrgType = "1"
|
438
|
502
|
order.DrordBhvr = "-"
|
439
|
|
- order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
|
440
|
|
- order.HosplistName = subItem.BaseDrugLib.DrugName
|
|
503
|
+ order.HilistCode = subItem.HisProject.MedicalCode
|
|
504
|
+ order.HosplistName = subItem.HisProject.ProjectName
|
441
|
505
|
order.HilistLv = "1"
|
442
|
506
|
order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
443
|
|
- order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
|
444
|
|
- order.HosplistName = subItem.BaseDrugLib.DrugName
|
445
|
|
- order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
|
|
507
|
+ order.HosplistCode = subItem.HisProject.MedicalCode
|
|
508
|
+ order.HosplistName = subItem.HisProject.ProjectName
|
|
509
|
+ order.Cnt = subItem.Count
|
|
510
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
511
|
+
|
446
|
512
|
order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
447
|
|
- order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
|
|
513
|
+ order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
|
448
|
514
|
order.OwnpayAmt = ""
|
449
|
515
|
order.SelfpayAmt = ""
|
450
|
516
|
order.Spec = ""
|
|
@@ -458,93 +524,94 @@ func (c *HisApiController) Check3102() {
|
458
|
524
|
order.DrordDrProfttl = ""
|
459
|
525
|
order.CurrDrordFlag = "1"
|
460
|
526
|
orders = append(orders, &order)
|
461
|
|
- }
|
462
|
|
- for _, subItem := range item.HisPrescriptionProject {
|
463
|
|
- if subItem.Type == 2 {
|
464
|
|
- var order models.FsiOrderDtos
|
465
|
|
- order.RxID = strconv.FormatInt(item.ID, 10)
|
466
|
|
- order.Rxno = strconv.FormatInt(item.ID, 10)
|
467
|
|
- order.LongDrordFlag = "0"
|
468
|
|
- order.HilistType = "1"
|
469
|
|
- order.ChrgType = "1"
|
470
|
|
- order.DrordBhvr = "-"
|
471
|
|
- order.HilistCode = subItem.HisProject.MedicalCode
|
472
|
|
- order.HosplistName = subItem.HisProject.ProjectName
|
473
|
|
- order.HilistLv = "1"
|
474
|
|
- order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
475
|
|
- order.HosplistCode = subItem.HisProject.MedicalCode
|
476
|
|
- order.HosplistName = subItem.HisProject.ProjectName
|
477
|
|
- order.Cnt = subItem.Count
|
478
|
|
- cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
479
|
|
-
|
480
|
|
- order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
481
|
|
- order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
|
482
|
|
- order.OwnpayAmt = ""
|
483
|
|
- order.SelfpayAmt = ""
|
484
|
|
- order.Spec = ""
|
485
|
|
- order.SpecUnt = ""
|
486
|
|
- order.DrordBegnDate = s_tm
|
487
|
|
- order.DrordStopDate = ""
|
488
|
|
- order.DrordDrCodg = "1"
|
489
|
|
- order.DrordDeptName = department.Name
|
490
|
|
- order.DrordDrCodg = "1"
|
491
|
|
- order.DrordDrName = doctor_info.UserName
|
492
|
|
- order.DrordDrProfttl = ""
|
493
|
|
- order.CurrDrordFlag = "1"
|
494
|
|
- orders = append(orders, &order)
|
495
|
527
|
|
496
|
|
- }
|
497
|
|
- if subItem.Type == 3 {
|
|
528
|
+ }
|
|
529
|
+ if subItem.Type == 3 {
|
498
|
530
|
|
499
|
|
- var order models.FsiOrderDtos
|
500
|
|
- order.RxID = strconv.FormatInt(item.ID, 10)
|
501
|
|
- order.Rxno = strconv.FormatInt(item.ID, 10)
|
502
|
|
- order.LongDrordFlag = "0"
|
503
|
|
- order.HilistType = "1"
|
504
|
|
- order.ChrgType = "1"
|
505
|
|
- order.DrordBhvr = "-"
|
506
|
|
- order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
|
507
|
|
- order.HosplistName = subItem.GoodInfo.GoodName
|
508
|
|
- order.HilistLv = "1"
|
509
|
|
- order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
510
|
|
- order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
|
511
|
|
- order.HosplistName = subItem.GoodInfo.GoodName
|
512
|
|
- order.Cnt = subItem.Count
|
513
|
|
- cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
514
|
|
- order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
515
|
|
- order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
|
516
|
|
- order.OwnpayAmt = ""
|
517
|
|
- order.SelfpayAmt = ""
|
518
|
|
- order.Spec = ""
|
519
|
|
- order.SpecUnt = ""
|
520
|
|
- order.DrordBegnDate = s_tm
|
521
|
|
- order.DrordStopDate = ""
|
522
|
|
- order.DrordDrCodg = "1"
|
523
|
|
- order.DrordDeptName = department.Name
|
524
|
|
- order.DrordDrCodg = "1"
|
525
|
|
- order.DrordDrName = doctor_info.UserName
|
526
|
|
- order.DrordDrProfttl = ""
|
527
|
|
- order.CurrDrordFlag = "1"
|
528
|
|
- orders = append(orders, &order)
|
|
531
|
+ var order models.FsiOrderDtos
|
|
532
|
+ order.RxID = strconv.FormatInt(item.ID, 10)
|
|
533
|
+ order.Rxno = strconv.FormatInt(item.ID, 10)
|
|
534
|
+ order.LongDrordFlag = "0"
|
|
535
|
+ order.HilistType = "1"
|
|
536
|
+ order.ChrgType = "1"
|
|
537
|
+ order.DrordBhvr = "-"
|
|
538
|
+ order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
|
|
539
|
+ order.HosplistName = subItem.GoodInfo.GoodName
|
|
540
|
+ order.HilistLv = "1"
|
|
541
|
+ order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
|
542
|
+ order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
|
|
543
|
+ order.HosplistName = subItem.GoodInfo.GoodName
|
|
544
|
+ order.Cnt = subItem.Count
|
|
545
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
546
|
+ order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
|
|
547
|
+ order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
|
|
548
|
+ order.OwnpayAmt = ""
|
|
549
|
+ order.SelfpayAmt = ""
|
|
550
|
+ order.Spec = ""
|
|
551
|
+ order.SpecUnt = ""
|
|
552
|
+ order.DrordBegnDate = s_tm
|
|
553
|
+ order.DrordStopDate = ""
|
|
554
|
+ order.DrordDrCodg = "1"
|
|
555
|
+ order.DrordDeptName = department.Name
|
|
556
|
+ order.DrordDrCodg = "1"
|
|
557
|
+ order.DrordDrName = doctor_info.UserName
|
|
558
|
+ order.DrordDrProfttl = ""
|
|
559
|
+ order.CurrDrordFlag = "1"
|
|
560
|
+ orders = append(orders, &order)
|
529
|
561
|
|
530
|
|
- }
|
531
|
562
|
}
|
532
|
563
|
}
|
533
|
|
-
|
534
|
564
|
}
|
|
565
|
+
|
535
|
566
|
fed.MatnStas = "0"
|
536
|
|
- fed.MedfeeSumamt = "0"
|
537
|
|
- fed.OwnpayAmt = "0"
|
538
|
|
- fed.SelfpayAmt = "0"
|
539
|
|
- fed.AcctPayamt = "0"
|
540
|
|
- fed.MaAmt = "0"
|
541
|
|
- fed.HifpPayamt = "0"
|
542
|
|
- fed.SetlTotlnum = "0"
|
|
567
|
+ fed.MedfeeSumamt = strconv.FormatFloat(order.MedfeeSumamt, 'E', -1, 64)
|
|
568
|
+ fed.OwnpayAmt = strconv.FormatFloat(order.FulamtOwnpayAmt, 'E', -1, 64)
|
|
569
|
+ fed.SelfpayAmt = strconv.FormatFloat(order.PreselfpayAmt, 'E', -1, 64)
|
|
570
|
+ fed.AcctPayamt = strconv.FormatFloat(order.AcctPay, 'E', -1, 64)
|
|
571
|
+ fed.MaAmt = strconv.FormatFloat(order.MafPay, 'E', -1, 64)
|
|
572
|
+ fed.HifpPayamt = strconv.FormatFloat(order.HifpPay, 'E', -1, 64)
|
|
573
|
+ fed.SetlTotlnum = "1"
|
543
|
574
|
fed.Insutype = his.Insutype
|
544
|
575
|
fed.ReimFlag = "0"
|
545
|
576
|
fed.OutSetlFlag = "0"
|
546
|
577
|
|
|
578
|
+ var fopd []*models.FsiOperationDtosData
|
|
579
|
+ data := make(map[string]interface{})
|
|
580
|
+ data["fed"] = fed
|
|
581
|
+ data["fdd"] = fdds
|
|
582
|
+ data["fod"] = orders
|
|
583
|
+ data["pd"] = pd
|
|
584
|
+ data["pp"] = pp
|
|
585
|
+ data["fopd"] = fopd
|
|
586
|
+ data["trig_scen"] = trig_scen
|
|
587
|
+
|
|
588
|
+ fmt.Println(data)
|
|
589
|
+ fmt.Println(fed)
|
|
590
|
+ fmt.Println(fdds)
|
|
591
|
+ fmt.Println(orders)
|
|
592
|
+ fmt.Println(pd)
|
|
593
|
+ fmt.Println(pp)
|
|
594
|
+ fmt.Println(fopd)
|
|
595
|
+ client := &http.Client{}
|
|
596
|
+ bytesData, _ := json.Marshal(data)
|
|
597
|
+ var req *http.Request
|
|
598
|
+ req, _ = http.NewRequest("POST", "http://192.168.3.111:9532/"+"jsyb/3102", bytes.NewReader(bytesData))
|
|
599
|
+ resp, _ := client.Do(req)
|
|
600
|
+ defer resp.Body.Close()
|
|
601
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
602
|
+ if ioErr != nil {
|
|
603
|
+ utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
604
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
605
|
+ return
|
|
606
|
+ }
|
|
607
|
+ var respJSON map[string]interface{}
|
|
608
|
+ if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
|
|
609
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
610
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
611
|
+ return
|
|
612
|
+ }
|
547
|
613
|
|
|
614
|
+
|
548
|
615
|
|
549
|
616
|
|
550
|
617
|
}
|