|
@@ -395,11 +395,11 @@ func (c *HisApiController) ReadCard() {
|
395
|
395
|
var api string
|
396
|
396
|
if miConfig.MdtrtareaAdmvs == "320921" {
|
397
|
397
|
api = "http://192.168.3.111:9532/" + "jsyb/readcard?" + "fixmedins_code=" + miConfig.Code + "&secret_key=" + miConfig.SecretKey + "&ak=" + miConfig.AccessKey + "&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName +
|
398
|
|
- "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&cainfo=" + miConfig.Cainfo
|
|
398
|
+ "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&cainfo=" + miConfig.Cainfo + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "operator_id=" + strconv.FormatInt(admin_user_id, 10) + "operator=" + roles.UserName
|
399
|
399
|
|
400
|
400
|
} else {
|
401
|
401
|
api = "http://192.168.5.251:9532/" + "jsyb/readcard?" + "fixmedins_code=" + miConfig.Code + "&secret_key=" + miConfig.SecretKey + "&ak=" + miConfig.AccessKey + "&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName +
|
402
|
|
- "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&cainfo=" + miConfig.Cainfo
|
|
402
|
+ "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&cainfo=" + miConfig.Cainfo + "&id_card_type=" + strconv.FormatInt(id_card_type, 10)
|
403
|
403
|
}
|
404
|
404
|
|
405
|
405
|
resp, requestErr := http.Get(api)
|
|
@@ -422,32 +422,59 @@ func (c *HisApiController) ReadCard() {
|
422
|
422
|
}
|
423
|
423
|
var status string
|
424
|
424
|
status = respJSON["data"].(map[string]interface{})["status"].(string)
|
|
425
|
+ card_type := respJSON["data"].(map[string]interface{})["type"].(string)
|
|
426
|
+
|
|
427
|
+ var token string
|
|
428
|
+ var res ResultTwo
|
|
429
|
+ var res10265 ResultTwo10265
|
|
430
|
+ var card_info string
|
|
431
|
+ var busi_card_info string
|
|
432
|
+
|
|
433
|
+ card_info = respJSON["data"].(map[string]interface{})["card_info"].(string)
|
|
434
|
+ busi_card_info = respJSON["data"].(map[string]interface{})["busi_card_info"].(string)
|
425
|
435
|
|
426
|
436
|
if status == "0" {
|
427
|
|
- var card_info string
|
428
|
|
- var busi_card_info string
|
429
|
|
- var res ResultTwo
|
430
|
|
- var res10265 ResultTwo10265
|
|
437
|
+ if card_type == "1" {
|
431
|
438
|
|
432
|
|
- card_info = respJSON["data"].(map[string]interface{})["card_info"].(string)
|
433
|
|
- busi_card_info = respJSON["data"].(map[string]interface{})["busi_card_info"].(string)
|
|
439
|
+ respJSON = respJSON["data"].(map[string]interface{})["result"].(map[string]interface{})
|
|
440
|
+ result, _ := json.Marshal(respJSON)
|
434
|
441
|
|
435
|
|
- fmt.Println(card_info)
|
436
|
|
- fmt.Println(busi_card_info)
|
|
442
|
+ if err := json.Unmarshal([]byte(result), &res10265); err != nil {
|
|
443
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
444
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
445
|
+ return
|
|
446
|
+ }
|
|
447
|
+ res.ErrMsg = res10265.ErrMsg
|
|
448
|
+ infocode, _ := strconv.ParseInt(res10265.Infcode, 10, 64)
|
|
449
|
+ res.Infcode = infocode
|
|
450
|
+ res.Output = res10265.Output
|
|
451
|
+ res.InfRefmsgid = res10265.InfRefmsgid
|
437
|
452
|
|
438
|
|
- respJSON = respJSON["data"].(map[string]interface{})["result"].(map[string]interface{})
|
439
|
|
- result, _ := json.Marshal(respJSON)
|
|
453
|
+ } else {
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+ token = respJSON["data"].(map[string]interface{})["token"].(string)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+ respJSON = respJSON["data"].(map[string]interface{})["result"].(map[string]interface{})
|
|
464
|
+ result, _ := json.Marshal(respJSON)
|
|
465
|
+
|
|
466
|
+ if err := json.Unmarshal([]byte(result), &res10265); err != nil {
|
|
467
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
468
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
469
|
+ return
|
|
470
|
+ }
|
|
471
|
+ res.ErrMsg = res10265.ErrMsg
|
|
472
|
+ infocode, _ := strconv.ParseInt(res10265.Infcode, 10, 64)
|
|
473
|
+ res.Infcode = infocode
|
|
474
|
+ res.Output = res10265.Output
|
|
475
|
+ res.InfRefmsgid = res10265.InfRefmsgid
|
440
|
476
|
|
441
|
|
- if err := json.Unmarshal([]byte(result), &res10265); err != nil {
|
442
|
|
- utils.ErrorLog("解析失败:%v", err)
|
443
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
444
|
|
- return
|
445
|
477
|
}
|
446
|
|
- res.ErrMsg = res10265.ErrMsg
|
447
|
|
- infocode, _ := strconv.ParseInt(res10265.Infcode, 10, 64)
|
448
|
|
- res.Infcode = infocode
|
449
|
|
- res.Output = res10265.Output
|
450
|
|
- res.InfRefmsgid = res10265.InfRefmsgid
|
451
|
478
|
|
452
|
479
|
if res.Infcode == 0 {
|
453
|
480
|
patient, err := service.GetPatientByIDCard(res.Output.Baseinfo.Certno, c.GetAdminUserInfo().CurrentOrgId)
|
|
@@ -460,34 +487,61 @@ func (c *HisApiController) ReadCard() {
|
460
|
487
|
|
461
|
488
|
} else {
|
462
|
489
|
|
463
|
|
- bas := strings.Split(card_info, "|")
|
464
|
|
- basNumber := bas[2]
|
465
|
|
-
|
466
|
|
- Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
467
|
|
- Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
468
|
|
- infoStr := string(Iinfos)
|
469
|
|
- idetinfoStr := string(Idetinfos)
|
470
|
|
- psn := &models.HisPsn{
|
471
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
472
|
|
- Age: res.Output.Baseinfo.Age,
|
473
|
|
- PatientId: patient.ID,
|
474
|
|
- Certno: res.Output.Baseinfo.Certno,
|
475
|
|
- Brdy: res.Output.Baseinfo.Brdy,
|
476
|
|
- Gend: res.Output.Baseinfo.Gend,
|
477
|
|
- Naty: res.Output.Baseinfo.Naty,
|
478
|
|
- PsnCertType: res.Output.Baseinfo.PsnCertType,
|
479
|
|
- PsnName: res.Output.Baseinfo.PsnName,
|
480
|
|
- Idetinfo: idetinfoStr,
|
481
|
|
- Insuinfo: infoStr,
|
482
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
483
|
|
- CardInfo: card_info,
|
484
|
|
- VerifyNumber: busi_card_info,
|
|
490
|
+ if card_type == "1" {
|
|
491
|
+ bas := strings.Split(card_info, "|")
|
|
492
|
+ basNumber := bas[2]
|
|
493
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
494
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
495
|
+ infoStr := string(Iinfos)
|
|
496
|
+ idetinfoStr := string(Idetinfos)
|
|
497
|
+ psn := &models.HisPsn{
|
|
498
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
499
|
+ Age: res.Output.Baseinfo.Age,
|
|
500
|
+ PatientId: patient.ID,
|
|
501
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
502
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
503
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
504
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
505
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
506
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
507
|
+ Idetinfo: idetinfoStr,
|
|
508
|
+ Insuinfo: infoStr,
|
|
509
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
510
|
+ CardInfo: card_info,
|
|
511
|
+ VerifyNumber: busi_card_info,
|
|
512
|
+ }
|
|
513
|
+ service.CreateHisPsn(psn)
|
|
514
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
515
|
+ "patient": patient,
|
|
516
|
+ "number": basNumber,
|
|
517
|
+ })
|
|
518
|
+ } else {
|
|
519
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
520
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
521
|
+ infoStr := string(Iinfos)
|
|
522
|
+ idetinfoStr := string(Idetinfos)
|
|
523
|
+ psn := &models.HisPsn{
|
|
524
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
525
|
+ Age: res.Output.Baseinfo.Age,
|
|
526
|
+ PatientId: patient.ID,
|
|
527
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
528
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
529
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
530
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
531
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
532
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
533
|
+ Idetinfo: idetinfoStr,
|
|
534
|
+ Insuinfo: infoStr,
|
|
535
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
536
|
+ CardInfo: card_info,
|
|
537
|
+ VerifyNumber: token,
|
|
538
|
+ }
|
|
539
|
+ service.CreateHisPsn(psn)
|
|
540
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
541
|
+ "patient": patient,
|
|
542
|
+ "number": token,
|
|
543
|
+ })
|
485
|
544
|
}
|
486
|
|
- service.CreateHisPsn(psn)
|
487
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
488
|
|
- "patient": patient,
|
489
|
|
- "number": basNumber,
|
490
|
|
- })
|
491
|
545
|
}
|
492
|
546
|
} else {
|
493
|
547
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
@@ -7934,6 +7988,7 @@ func (c *HisApiController) GetCheckAccount() {
|
7934
|
7988
|
PsnPay: acct_pay,
|
7935
|
7989
|
Creator: admin_user_id,
|
7936
|
7990
|
Ctime: time.Now().Unix(),
|
|
7991
|
+ ClrType: clr_type,
|
7937
|
7992
|
}
|
7938
|
7993
|
err := service.CreateMedicalInsuranceCostCompareRecord(micc)
|
7939
|
7994
|
if err == nil {
|
|
@@ -8296,7 +8351,7 @@ func (c *HisApiController) GetSettleAccounts() {
|
8296
|
8351
|
orderInfos, _ := service.GetHisOrderInfoByNumber(order.Number)
|
8297
|
8352
|
orderInfos_two, _ := service.GetHisOrderInfoByNumberTwo(order.Number)
|
8298
|
8353
|
orderInfos = append(orderInfos, orderInfos_two...)
|
8299
|
|
-
|
|
8354
|
+ his_hospital, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
8300
|
8355
|
|
8301
|
8356
|
|
8302
|
8357
|
|
|
@@ -8516,6 +8571,8 @@ func (c *HisApiController) GetSettleAccounts() {
|
8516
|
8571
|
res.Infcode = infocode
|
8517
|
8572
|
|
8518
|
8573
|
} else {
|
|
8574
|
+
|
|
8575
|
+
|
8519
|
8576
|
result2 := service.Gdyb5204(baseParams, businessParams)
|
8520
|
8577
|
saveLog(result2, "", "5204", "查询")
|
8521
|
8578
|
result := service.Gdyb5203(baseParams, businessParams)
|
|
@@ -8638,7 +8695,9 @@ func (c *HisApiController) GetSettleAccounts() {
|
8638
|
8695
|
"org_name": miConfig.OrgName,
|
8639
|
8696
|
"org_code": miConfig.Code,
|
8640
|
8697
|
"order_number": order.Number,
|
8641
|
|
-
|
|
8698
|
+ "his_hospital": his_hospital,
|
|
8699
|
+ "his": his,
|
|
8700
|
+
|
8642
|
8701
|
|
8643
|
8702
|
})
|
8644
|
8703
|
}
|