|
@@ -217,7 +217,7 @@ func Gdyb1101A(certNo string, org_name string, doctor string, fixmedins_code str
|
217
|
217
|
|
218
|
218
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
219
|
219
|
|
220
|
|
- {
|
|
220
|
+ {
|
221
|
221
|
request, err := http.NewRequest("POST", url, reader)
|
222
|
222
|
if err != nil {
|
223
|
223
|
fmt.Println(err.Error())
|
|
@@ -307,7 +307,7 @@ func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, ope
|
307
|
307
|
url = gdyb_url + "2201"
|
308
|
308
|
}
|
309
|
309
|
|
310
|
|
- {
|
|
310
|
+ {
|
311
|
311
|
request, err := http.NewRequest("POST", url, reader)
|
312
|
312
|
if err != nil {
|
313
|
313
|
fmt.Println(err.Error())
|
|
@@ -413,7 +413,7 @@ func Gdyb2201A(psnNo string, insutype string, certNo string, org_name string, op
|
413
|
413
|
url = gdyb_url + "2201"
|
414
|
414
|
}
|
415
|
415
|
|
416
|
|
- {
|
|
416
|
+ {
|
417
|
417
|
fmt.Println(url)
|
418
|
418
|
fmt.Println(gdyb_paasid)
|
419
|
419
|
fmt.Println(secret_key)
|
|
@@ -734,7 +734,7 @@ func Gdyb2203c(psnNo string, mdtrtId string, doctor string, department string, o
|
734
|
734
|
} else {
|
735
|
735
|
url = gdyb_url + "2203"
|
736
|
736
|
}
|
737
|
|
- {
|
|
737
|
+ {
|
738
|
738
|
request, err := http.NewRequest("POST", url, reader)
|
739
|
739
|
if err != nil {
|
740
|
740
|
fmt.Println(err.Error())
|
|
@@ -843,7 +843,7 @@ func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, o
|
843
|
843
|
url = gdyb_url + "2203"
|
844
|
844
|
}
|
845
|
845
|
|
846
|
|
- {
|
|
846
|
+ {
|
847
|
847
|
|
848
|
848
|
request, err := http.NewRequest("POST", url, reader)
|
849
|
849
|
if err != nil {
|
|
@@ -942,7 +942,7 @@ func Gdyb2203d(psnNo string, mdtrtId string, doctor string, department string, o
|
942
|
942
|
var url string
|
943
|
943
|
|
944
|
944
|
url = gdyb_url + "2203"
|
945
|
|
-{
|
|
945
|
+ {
|
946
|
946
|
|
947
|
947
|
request, err := http.NewRequest("POST", url, reader)
|
948
|
948
|
if err != nil {
|
|
@@ -1242,7 +1242,7 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
1242
|
1242
|
|
1243
|
1243
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2204"
|
1244
|
1244
|
|
1245
|
|
- {
|
|
1245
|
+ {
|
1246
|
1246
|
|
1247
|
1247
|
request, err := http.NewRequest("POST", url, reader)
|
1248
|
1248
|
if err != nil {
|
|
@@ -1551,7 +1551,7 @@ func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, d
|
1551
|
1551
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2205"
|
1552
|
1552
|
|
1553
|
1553
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2205"
|
1554
|
|
-{
|
|
1554
|
+ {
|
1555
|
1555
|
request, err := http.NewRequest("POST", url, reader)
|
1556
|
1556
|
fmt.Println(err)
|
1557
|
1557
|
|
|
@@ -1626,7 +1626,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
1626
|
1626
|
inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
|
1627
|
1627
|
}
|
1628
|
1628
|
}
|
1629
|
|
- {
|
|
1629
|
+ {
|
1630
|
1630
|
inputData["med_type"] = med_type // 医疗类别 11 普通门诊 12 门诊挂号
|
1631
|
1631
|
}
|
1632
|
1632
|
|
|
@@ -1671,7 +1671,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
1671
|
1671
|
|
1672
|
1672
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2206"
|
1673
|
1673
|
|
1674
|
|
- {
|
|
1674
|
+ {
|
1675
|
1675
|
request, err := http.NewRequest("POST", url, reader)
|
1676
|
1676
|
if err != nil {
|
1677
|
1677
|
fmt.Println(err.Error())
|
|
@@ -1743,7 +1743,7 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
1743
|
1743
|
if med_type == "1111" || med_type == "1112" {
|
1744
|
1744
|
med_type = "11"
|
1745
|
1745
|
}
|
1746
|
|
- {
|
|
1746
|
+ {
|
1747
|
1747
|
inputData["med_type"] = med_type // 医疗类别 11 普通门诊 12 门诊挂号
|
1748
|
1748
|
}
|
1749
|
1749
|
inputData["medfee_sumamt"] = total // 医疗费总额
|
|
@@ -1786,7 +1786,7 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
1786
|
1786
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2207"
|
1787
|
1787
|
|
1788
|
1788
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2207"
|
1789
|
|
- {
|
|
1789
|
+ {
|
1790
|
1790
|
|
1791
|
1791
|
request, err := http.NewRequest("POST", url, reader)
|
1792
|
1792
|
if err != nil {
|
|
@@ -1893,7 +1893,7 @@ func Gdyb2207A(psnNo string, mdtrtId string, chrgBchno string, certNo string, in
|
1893
|
1893
|
|
1894
|
1894
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2207"
|
1895
|
1895
|
|
1896
|
|
- {
|
|
1896
|
+ {
|
1897
|
1897
|
|
1898
|
1898
|
request, err := http.NewRequest("POST", url, reader)
|
1899
|
1899
|
if err != nil {
|
|
@@ -1982,7 +1982,7 @@ func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doct
|
1982
|
1982
|
|
1983
|
1983
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2208"
|
1984
|
1984
|
|
1985
|
|
- {
|
|
1985
|
+ {
|
1986
|
1986
|
request, err := http.NewRequest("POST", url, reader)
|
1987
|
1987
|
if err != nil {
|
1988
|
1988
|
fmt.Println(err.Error())
|
|
@@ -5795,7 +5795,7 @@ func Gdyb3260(org_name string, doctor string, fixmedins_code string, insuplc_adm
|
5795
|
5795
|
} else {
|
5796
|
5796
|
url = gdyb_url + "3260"
|
5797
|
5797
|
}
|
5798
|
|
- {
|
|
5798
|
+ {
|
5799
|
5799
|
|
5800
|
5800
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
5801
|
5801
|
request, err := http.NewRequest("POST", url, reader)
|
|
@@ -6237,7 +6237,7 @@ func Gdyb3262(org_name string, doctor string, fixmedins_code string, insuplc_adm
|
6237
|
6237
|
url = gdyb_url + "3262"
|
6238
|
6238
|
}
|
6239
|
6239
|
|
6240
|
|
- {
|
|
6240
|
+ {
|
6241
|
6241
|
|
6242
|
6242
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
6243
|
6243
|
request, err := http.NewRequest("POST", url, reader)
|
|
@@ -6329,7 +6329,7 @@ func Gdyb9001(org_name string, doctor string, fixmedins_code string, insuplc_adm
|
6329
|
6329
|
url = gdyb_url + "9001"
|
6330
|
6330
|
}
|
6331
|
6331
|
|
6332
|
|
- {
|
|
6332
|
+ {
|
6333
|
6333
|
|
6334
|
6334
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
6335
|
6335
|
|
|
@@ -6414,7 +6414,7 @@ func Gdyb9001Two(org_name string, doctor string, fixmedins_code string, insuplc_
|
6414
|
6414
|
url = gdyb_url + "9001"
|
6415
|
6415
|
}
|
6416
|
6416
|
|
6417
|
|
- {
|
|
6417
|
+ {
|
6418
|
6418
|
|
6419
|
6419
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
6420
|
6420
|
|
|
@@ -6578,7 +6578,7 @@ func Gdyb1101D(certNo string, org_name string, doctor string, fixmedins_code str
|
6578
|
6578
|
url = gdyb_url + "1101"
|
6579
|
6579
|
}
|
6580
|
6580
|
|
6581
|
|
- {
|
|
6581
|
+ {
|
6582
|
6582
|
|
6583
|
6583
|
//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
|
6584
|
6584
|
request, err := http.NewRequest("POST", url, reader)
|
|
@@ -6747,7 +6747,6 @@ func Gdyb3501(struct3501 models.Struct3501, secret_key string) (string, string)
|
6747
|
6747
|
input["invinfo"] = inputData
|
6748
|
6748
|
inputMessage["input"] = input //交易输入
|
6749
|
6749
|
|
6750
|
|
-
|
6751
|
6750
|
bytesData, err := json.Marshal(inputMessage)
|
6752
|
6751
|
fmt.Println(string(bytesData))
|
6753
|
6752
|
if err != nil {
|
|
@@ -7063,12 +7062,12 @@ func Gdyb3505(struct3505 models.Struct3505, secret_key string) (string, string)
|
7063
|
7062
|
inputData["rxno"] = struct3505.Rxno // 人员编号 (来自1101接口返回)
|
7064
|
7063
|
inputData["rx_circ_flag"] = struct3505.RxCircFlag // 人员编号 (来自1101接口返回)
|
7065
|
7064
|
|
7066
|
|
- inputData["rtal_docno"] = struct3505.RtalDocno // 人员编号 (来自1101接口返回)
|
7067
|
|
- inputData["stoout_no"] = struct3505.StooutNo // 人员编号 (来自1101接口返回)
|
|
7065
|
+ inputData["rtal_docno"] = struct3505.RtalDocno // 人员编号 (来自1101接口返回)
|
|
7066
|
+ inputData["stoout_no"] = struct3505.StooutNo // 人员编号 (来自1101接口返回)
|
7068
|
7067
|
inputData["MDTRT_SETL_TYPE"] = struct3505.MdtrtSetlType // 人员编号 (来自1101接口返回)
|
7069
|
7068
|
|
7070
|
7069
|
inputData["bchno"] = struct3505.Bchno // 人员编号 (来自1101接口返回)
|
7071
|
|
- inputData["drug_trac_codg"] = "--" // 人员编号 (来自1101接口返回)
|
|
7070
|
+ inputData["drug_trac_codg"] = "--" // 人员编号 (来自1101接口返回)
|
7072
|
7071
|
inputData["drug_prod_barc"] = struct3505.DrugProdBarc // 人员编号 (来自1101接口返回)
|
7073
|
7072
|
inputData["shelf_posi"] = struct3505.ShelfPosi // 人员编号 (来自1101接口返回)
|
7074
|
7073
|
inputData["sel_retn_cnt"] = struct3505.SelRetnCnt // 人员编号 (来自1101接口返回)
|
|
@@ -7214,9 +7213,9 @@ func Gdyb3507(struct3507 models.Struct3507, secret_key string) (string, string)
|
7214
|
7213
|
inputMessage := SetGdInputMessage(timestamp, struct3507.OrgName, struct3507.Opter, struct3507.FixmedinsCode, struct3507.InsuplcAdmdvs, struct3507.MdtrtareaAdmvs, struct3507.Cainfo)
|
7215
|
7214
|
input := make(map[string]interface{})
|
7216
|
7215
|
inputData := make(map[string]interface{})
|
7217
|
|
- inputMessage["infno"] = "3507" // 交易编码
|
|
7216
|
+ inputMessage["infno"] = "3507" // 交易编码
|
7218
|
7217
|
inputData["fixmedins_bchno"] = struct3507.FixmedinsBchno // 人员编号 (来自1101接口返回)
|
7219
|
|
- inputData["inv_data_type"] = struct3507.InvDataType // 人员编号 (来自1101接口返回)
|
|
7218
|
+ inputData["inv_data_type"] = struct3507.InvDataType // 人员编号 (来自1101接口返回)
|
7220
|
7219
|
|
7221
|
7220
|
input["data"] = inputData
|
7222
|
7221
|
inputMessage["input"] = input //交易输入
|
|
@@ -8538,7 +8537,7 @@ func Gzyb3505(struct3505 models.Struct3505, secret_key string) (string, string)
|
8538
|
8537
|
inputData["bchno"] = struct3505.Bchno // 人员编号 (来自1101接口返回)
|
8539
|
8538
|
codes := strings.Split(struct3505.DrugTracCodg, ",")
|
8540
|
8539
|
|
8541
|
|
- inputData["drug_trac_codg"] = codes[0] // 人员编号 (来自1101接口返回)
|
|
8540
|
+ inputData["drug_trac_codg"] = codes[0] // 人员编号 (来自1101接口返回)
|
8542
|
8541
|
inputData["drug_prod_barc"] = struct3505.DrugProdBarc // 人员编号 (来自1101接口返回)
|
8543
|
8542
|
inputData["shelf_posi"] = struct3505.ShelfPosi // 人员编号 (来自1101接口返回)
|
8544
|
8543
|
inputData["sel_retn_cnt"] = struct3505.SelRetnCnt // 人员编号 (来自1101接口返回)
|
|
@@ -8550,7 +8549,7 @@ func Gzyb3505(struct3505 models.Struct3505, secret_key string) (string, string)
|
8550
|
8549
|
|
8551
|
8550
|
//codes = strings.Split(struct3505.DrugTracCodg, ",")
|
8552
|
8551
|
for _, item := range codes {
|
8553
|
|
- if len(item) > 0{
|
|
8552
|
+ if len(item) > 0 {
|
8554
|
8553
|
druginputData := make(map[string]interface{})
|
8555
|
8554
|
druginputData["drug_trac_codg"] = item
|
8556
|
8555
|
feedetail = append(feedetail, druginputData)
|
|
@@ -9311,3 +9310,82 @@ func SetGZInputMessage(nonce string, timestamp int64, org_name string, doctor st
|
9311
|
9310
|
//inputMessage["sign_no"] = "GZYBCS4101A20220202"
|
9312
|
9311
|
return inputMessage
|
9313
|
9312
|
}
|
|
9313
|
+
|
|
9314
|
+func Gdyb3103(org_name string, opera string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, warm_type int64, ids string, dspo_way int64, desc string) (string, string) {
|
|
9315
|
+ fmt.Println(opera)
|
|
9316
|
+
|
|
9317
|
+ // 生成签名
|
|
9318
|
+ nonce := GetRandomString(32)
|
|
9319
|
+ timestamp := time.Now().Unix()
|
|
9320
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
|
9321
|
+
|
|
9322
|
+ // 生成输入报文
|
|
9323
|
+ inputMessage := SetInputMessagenosign(nonce, timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
|
9324
|
+ input := make(map[string]interface{})
|
|
9325
|
+ inputData := make(map[string]interface{})
|
|
9326
|
+ inputMessage["infno"] = "3103" // 交易编码
|
|
9327
|
+
|
|
9328
|
+ inputData["warn_type"] = warm_type // 人员编号 (来自1101接口返回)
|
|
9329
|
+
|
|
9330
|
+ id_arr := strings.Split(ids, "~")
|
|
9331
|
+ feedetail := make([]map[string]interface{}, 0)
|
|
9332
|
+ for _, item := range id_arr {
|
|
9333
|
+ feedetailInfo := make(map[string]interface{})
|
|
9334
|
+ feedetailInfo["warn_rslt_id"] = item
|
|
9335
|
+ feedetailInfo["dspo_way"] = dspo_way // 就诊 ID(来自2201接口返回)
|
|
9336
|
+ feedetailInfo["dspo_way_rea"] = desc // 人员编号 (来自1101接口返回)
|
|
9337
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
9338
|
+ }
|
|
9339
|
+ inputData["warns"] = feedetail
|
|
9340
|
+ input["data"] = inputData
|
|
9341
|
+ inputMessage["input"] = input //交易输入
|
|
9342
|
+
|
|
9343
|
+ var requestLog string
|
|
9344
|
+ bytesData, err := json.Marshal(inputMessage)
|
|
9345
|
+ requestLog = string(bytesData)
|
|
9346
|
+ fmt.Println(string(bytesData))
|
|
9347
|
+ if err != nil {
|
|
9348
|
+ fmt.Println(err.Error())
|
|
9349
|
+ return err.Error(), ""
|
|
9350
|
+ }
|
|
9351
|
+ reader := bytes.NewReader(bytesData)
|
|
9352
|
+ //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/2201"
|
|
9353
|
+ //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2201"
|
|
9354
|
+
|
|
9355
|
+ gdyb_url := beego.AppConfig.String("gdyb_url")
|
|
9356
|
+ gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
|
|
9357
|
+
|
|
9358
|
+ var url string
|
|
9359
|
+
|
|
9360
|
+ url = gdyb_url + "3103"
|
|
9361
|
+
|
|
9362
|
+ {
|
|
9363
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
9364
|
+ if err != nil {
|
|
9365
|
+ fmt.Println(err.Error())
|
|
9366
|
+ return err.Error(), ""
|
|
9367
|
+ }
|
|
9368
|
+
|
|
9369
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
9370
|
+ request.Header.Set("x-tif-paasid", gdyb_paasid)
|
|
9371
|
+ request.Header.Set("x-tif-signature", signature)
|
|
9372
|
+ request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
|
|
9373
|
+ request.Header.Set("x-tif-nonce", nonce)
|
|
9374
|
+
|
|
9375
|
+ client := http.Client{}
|
|
9376
|
+ resp, err := client.Do(request)
|
|
9377
|
+ if err != nil {
|
|
9378
|
+ fmt.Println(err.Error())
|
|
9379
|
+ return err.Error(), ""
|
|
9380
|
+ }
|
|
9381
|
+ respBytes, err := ioutil.ReadAll(resp.Body)
|
|
9382
|
+ if err != nil {
|
|
9383
|
+ fmt.Println(err.Error())
|
|
9384
|
+ return err.Error(), ""
|
|
9385
|
+ }
|
|
9386
|
+ str := string(respBytes)
|
|
9387
|
+ fmt.Println(str)
|
|
9388
|
+ return str, requestLog
|
|
9389
|
+
|
|
9390
|
+ }
|
|
9391
|
+}
|