|
@@ -20,14 +20,14 @@ const (
|
20
|
20
|
)
|
21
|
21
|
|
22
|
22
|
// 人员基本信息
|
23
|
|
-func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code string) string {
|
|
23
|
+func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
24
|
24
|
// 生成签名
|
25
|
25
|
nonce := GetRandomString(32)
|
26
|
26
|
timestamp := time.Now().Unix()
|
27
|
|
- signature := setSignature(timestamp, nonce)
|
|
27
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
28
|
28
|
|
29
|
29
|
// 生成输入报文
|
30
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code)
|
|
30
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
31
|
31
|
input := make(map[string]interface{})
|
32
|
32
|
inputData := make(map[string]interface{})
|
33
|
33
|
inputMessage["infno"] = "1101" // 交易编码
|
|
@@ -79,16 +79,16 @@ func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
|
79
|
79
|
}
|
80
|
80
|
|
81
|
81
|
// 门诊挂号
|
82
|
|
-func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doctor string, ipt_otp_no string, dept string, fixmedins_code string) string {
|
|
82
|
+func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doctor string, ipt_otp_no string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
83
|
83
|
// 生成签名
|
84
|
84
|
nonce := GetRandomString(32)
|
85
|
85
|
timestamp := time.Now().Unix()
|
86
|
|
- signature := setSignature(timestamp, nonce)
|
|
86
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
87
|
87
|
tempTime := time.Unix(timestamp, 0)
|
88
|
88
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
89
|
89
|
|
90
|
90
|
// 生成输入报文
|
91
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code)
|
|
91
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
92
|
92
|
input := make(map[string]interface{})
|
93
|
93
|
inputData := make(map[string]interface{})
|
94
|
94
|
inputMessage["infno"] = "2201" // 交易编码
|
|
@@ -98,9 +98,9 @@ func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doc
|
98
|
98
|
inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
|
99
|
99
|
inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
|
100
|
100
|
inputData["ipt_otp_no"] = ipt_otp_no // 住院/门诊号
|
101
|
|
- inputData["atddr_no"] = "1002" // 医师编码
|
|
101
|
+ inputData["atddr_no"] = doctor_id // 医师编码
|
102
|
102
|
inputData["dr_name"] = doctor // 医师姓名
|
103
|
|
- inputData["dept_code"] = "3002" // 科室编码
|
|
103
|
+ inputData["dept_code"] = dept_code // 科室编码
|
104
|
104
|
inputData["dept_name"] = dept // 科室名称
|
105
|
105
|
inputData["caty"] = "A03.06" // 科别
|
106
|
106
|
|
|
@@ -145,14 +145,14 @@ func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doc
|
145
|
145
|
}
|
146
|
146
|
|
147
|
147
|
// 门诊挂号撤销
|
148
|
|
-func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string, doctor string) string {
|
|
148
|
+func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
149
|
149
|
// 生成签名
|
150
|
150
|
nonce := GetRandomString(32)
|
151
|
151
|
timestamp := time.Now().Unix()
|
152
|
|
- signature := setSignature(timestamp, nonce)
|
|
152
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
153
|
153
|
|
154
|
154
|
// 生成输入报文
|
155
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
|
155
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "", insuplc_admdvs, mdtrtarea_admvs)
|
156
|
156
|
input := make(map[string]interface{})
|
157
|
157
|
inputData := make(map[string]interface{})
|
158
|
158
|
inputMessage["infno"] = "2202" // 交易编码
|
|
@@ -201,16 +201,16 @@ func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string,
|
201
|
201
|
}
|
202
|
202
|
|
203
|
203
|
// 门诊就诊信息上传
|
204
|
|
-func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, diag string, org_name string, med_type string, doctor_id int64, fixmedins_code string) string {
|
|
204
|
+func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, diag string, org_name string, med_type string, doctor_id int64, fixmedins_code string, diag_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
205
|
205
|
// 生成签名
|
206
|
206
|
nonce := GetRandomString(32)
|
207
|
207
|
timestamp := time.Now().Unix()
|
208
|
|
- signature := setSignature(timestamp, nonce)
|
|
208
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
209
|
209
|
tempTime := time.Unix(timestamp, 0)
|
210
|
210
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
211
|
211
|
|
212
|
212
|
// 生成输入报文
|
213
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code)
|
|
213
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
214
|
214
|
input := make(map[string]interface{})
|
215
|
215
|
inputData := make(map[string]interface{})
|
216
|
216
|
diseinfo := make([]map[string]interface{}, 0)
|
|
@@ -229,7 +229,7 @@ func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, di
|
229
|
229
|
diseinfo_sun := make(map[string]interface{})
|
230
|
230
|
diseinfo_sun["diag_type"] = "1" // 诊断类别
|
231
|
231
|
diseinfo_sun["diag_srt_no"] = "1" // 诊断排序号
|
232
|
|
- diseinfo_sun["diag_code"] = "A04.902" // 诊断代码
|
|
232
|
+ diseinfo_sun["diag_code"] = diag_code // 诊断代码
|
233
|
233
|
diseinfo_sun["diag_name"] = diag // 诊断名称
|
234
|
234
|
diseinfo_sun["diag_dept"] = department // 诊断科室
|
235
|
235
|
diseinfo_sun["dise_dor_no"] = doctor_id // 诊断医生编码
|
|
@@ -334,11 +334,11 @@ type Result struct {
|
334
|
334
|
}
|
335
|
335
|
|
336
|
336
|
// 门诊费用明细信息上传
|
337
|
|
-func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string) string {
|
|
337
|
+func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
338
|
338
|
// 生成签名
|
339
|
339
|
nonce := GetRandomString(32)
|
340
|
340
|
timestamp := time.Now().Unix()
|
341
|
|
- signature := setSignature(timestamp, nonce)
|
|
341
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
342
|
342
|
tempTime := time.Unix(timestamp, 0)
|
343
|
343
|
//timeFormat := tempTime.Format("20060102150405")
|
344
|
344
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
|
@@ -398,7 +398,7 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
398
|
398
|
}
|
399
|
399
|
|
400
|
400
|
// 生成输入报文
|
401
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code)
|
|
401
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
402
|
402
|
input := make(map[string]interface{})
|
403
|
403
|
feedetail := make([]map[string]interface{}, 0)
|
404
|
404
|
inputMessage["infno"] = "2204" // 交易编码
|
|
@@ -423,9 +423,9 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
423
|
423
|
feedetailInfo["used_frqu_dscr"] = "" // 使用频次描述
|
424
|
424
|
feedetailInfo["prd_days"] = "0" // 周期天数
|
425
|
425
|
feedetailInfo["medc_way_dscr"] = "" // 用药途径描述
|
426
|
|
- feedetailInfo["bilg_dept_codg"] = "3002" // 开单科室编码
|
|
426
|
+ feedetailInfo["bilg_dept_codg"] = dept_code // 开单科室编码
|
427
|
427
|
feedetailInfo["bilg_dept_name"] = dept // 开单科室名称
|
428
|
|
- feedetailInfo["bilg_dr_codg"] = "1002" // 开单医生编码
|
|
428
|
+ feedetailInfo["bilg_dr_codg"] = doctor_id // 开单医生编码
|
429
|
429
|
feedetailInfo["bilg_dr_name"] = doctor // 开单医师姓名
|
430
|
430
|
feedetailInfo["acord_dept_codg"] = "" // 受单科室编码
|
431
|
431
|
feedetailInfo["acord_dept_name"] = "" // 受单科室名称
|
|
@@ -484,14 +484,14 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
484
|
484
|
}
|
485
|
485
|
|
486
|
486
|
// 门诊费用明细信息撤销
|
487
|
|
-func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, doctor string) string {
|
|
487
|
+func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
488
|
488
|
// 生成签名
|
489
|
489
|
nonce := GetRandomString(32)
|
490
|
490
|
timestamp := time.Now().Unix()
|
491
|
|
- signature := setSignature(timestamp, nonce)
|
|
491
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
492
|
492
|
|
493
|
493
|
// 生成输入报文
|
494
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
|
494
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "", insuplc_admdvs, mdtrtarea_admvs)
|
495
|
495
|
input := make(map[string]interface{})
|
496
|
496
|
inputData := make(map[string]interface{})
|
497
|
497
|
inputMessage["infno"] = "2205" // 交易编码
|
|
@@ -544,14 +544,14 @@ func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, d
|
544
|
544
|
}
|
545
|
545
|
|
546
|
546
|
// 门诊预结算
|
547
|
|
-func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string) string {
|
|
547
|
+func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, secret_key string) string {
|
548
|
548
|
// 生成签名
|
549
|
549
|
nonce := GetRandomString(32)
|
550
|
550
|
timestamp := time.Now().Unix()
|
551
|
|
- signature := setSignature(timestamp, nonce)
|
|
551
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
552
|
552
|
|
553
|
553
|
// 生成输入报文
|
554
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
|
554
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "", "", "")
|
555
|
555
|
input := make(map[string]interface{})
|
556
|
556
|
inputData := make(map[string]interface{})
|
557
|
557
|
inputMessage["infno"] = "2206" // 交易编码
|
|
@@ -608,14 +608,14 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
608
|
608
|
}
|
609
|
609
|
|
610
|
610
|
// 门诊结算
|
611
|
|
-func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string) string {
|
|
611
|
+func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
|
612
|
612
|
// 生成签名
|
613
|
613
|
nonce := GetRandomString(32)
|
614
|
614
|
timestamp := time.Now().Unix()
|
615
|
|
- signature := setSignature(timestamp, nonce)
|
|
615
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
616
|
616
|
|
617
|
617
|
// 生成输入报文
|
618
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code)
|
|
618
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
|
619
|
619
|
input := make(map[string]interface{})
|
620
|
620
|
inputData := make(map[string]interface{})
|
621
|
621
|
inputMessage["infno"] = "2207" // 交易编码
|
|
@@ -673,14 +673,14 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
673
|
673
|
}
|
674
|
674
|
|
675
|
675
|
// 门诊结算撤销
|
676
|
|
-func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doctor string) string {
|
|
676
|
+func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doctor string, secret_key string) string {
|
677
|
677
|
// 生成签名
|
678
|
678
|
nonce := GetRandomString(32)
|
679
|
679
|
timestamp := time.Now().Unix()
|
680
|
|
- signature := setSignature(timestamp, nonce)
|
|
680
|
+ signature := setSignature(timestamp, nonce, secret_key)
|
681
|
681
|
|
682
|
682
|
// 生成输入报文
|
683
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
|
683
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "", "", "")
|
684
|
684
|
input := make(map[string]interface{})
|
685
|
685
|
inputData := make(map[string]interface{})
|
686
|
686
|
inputMessage["infno"] = "2208" // 交易编码
|
|
@@ -924,8 +924,8 @@ func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doct
|
924
|
924
|
//}
|
925
|
925
|
|
926
|
926
|
// 生成签名
|
927
|
|
-func setSignature(timestamp int64, nonce string) string {
|
928
|
|
- str := strconv.FormatInt(timestamp, 10) + SceretKey + nonce + strconv.FormatInt(timestamp, 10)
|
|
927
|
+func setSignature(timestamp int64, nonce string, secret_key string) string {
|
|
928
|
+ str := strconv.FormatInt(timestamp, 10) + secret_key + nonce + strconv.FormatInt(timestamp, 10)
|
929
|
929
|
hash := sha256.New()
|
930
|
930
|
//输入数据
|
931
|
931
|
hash.Write([]byte(str))
|
|
@@ -950,7 +950,7 @@ func GetRandomString(l int) string {
|
950
|
950
|
}
|
951
|
951
|
|
952
|
952
|
// 生成基础报文
|
953
|
|
-func SetInputMessage(nonce string, timestamp int64, org_name string, doctor string, fixmedins_code string) map[string]interface{} {
|
|
953
|
+func SetInputMessage(nonce string, timestamp int64, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string) map[string]interface{} {
|
954
|
954
|
// 生成签名
|
955
|
955
|
tempTime := time.Unix(timestamp, 0)
|
956
|
956
|
timeFormat := tempTime.Format("20060102150405")
|
|
@@ -962,8 +962,8 @@ func SetInputMessage(nonce string, timestamp int64, org_name string, doctor stri
|
962
|
962
|
|
963
|
963
|
inputMessage["infno"] = "1101" // 交易编码
|
964
|
964
|
inputMessage["msgid"] = fixmedins_code + timeFormat + strconv.FormatInt(int64(randNum), 10) // 发送方报文 ID
|
965
|
|
- inputMessage["mdtrtarea_admvs"] = "440200" // 就医地医保区划
|
966
|
|
- inputMessage["insuplc_admdvs"] = "440200" // 参保地医保区划
|
|
965
|
+ inputMessage["mdtrtarea_admvs"] = mdtrtarea_admvs // 就医地医保区划
|
|
966
|
+ inputMessage["insuplc_admdvs"] = insuplc_admdvs // 参保地医保区划
|
967
|
967
|
inputMessage["recer_sys_code"] = "01" // 接收方系统代码
|
968
|
968
|
inputMessage["dev_no"] = "" // 设备编号
|
969
|
969
|
inputMessage["dev_safe_info"] = "" // 设备安全信息
|
|
@@ -971,7 +971,7 @@ func SetInputMessage(nonce string, timestamp int64, org_name string, doctor stri
|
971
|
971
|
inputMessage["signtype"] = "" // 签名类型
|
972
|
972
|
inputMessage["infver"] = "V1.1" // 接收方系统代码
|
973
|
973
|
inputMessage["opter_type"] = "1" // 经办人类别
|
974
|
|
- inputMessage["opter"] = "mockuser" // 经办人
|
|
974
|
+ inputMessage["opter"] = doctor // 经办人
|
975
|
975
|
inputMessage["opter_name"] = doctor // 经办人姓名
|
976
|
976
|
inputMessage["inf_time"] = timeFormatOne // 交易时间
|
977
|
977
|
inputMessage["fixmedins_code"] = fixmedins_code // 定点医药机构编号
|
|
@@ -980,57 +980,57 @@ func SetInputMessage(nonce string, timestamp int64, org_name string, doctor stri
|
980
|
980
|
return inputMessage
|
981
|
981
|
}
|
982
|
982
|
|
983
|
|
-func Gdyb1201(psnNo string, org_name string, doctor string) string {
|
984
|
|
- // 生成签名
|
985
|
|
- nonce := GetRandomString(32)
|
986
|
|
- timestamp := time.Now().Unix()
|
987
|
|
- signature := setSignature(timestamp, nonce)
|
988
|
|
-
|
989
|
|
- // 生成输入报文
|
990
|
|
- inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
991
|
|
- input := make(map[string]interface{})
|
992
|
|
- inputData := make(map[string]interface{})
|
993
|
|
- inputMessage["infno"] = "1201" // 交易编码
|
994
|
|
- inputData["fixmedins_type"] = psnNo // 人员编号 (来自1101接口返回)
|
995
|
|
- inputData["fixmedins_name"] = org_name // 人员编号 (来自1101接口返回)
|
996
|
|
- inputData["fixmedins_code"] = "" // 人员编号 (来自1101接口返回)
|
997
|
|
-
|
998
|
|
- input["medinsinfo"] = inputData
|
999
|
|
- inputMessage["input"] = input //交易输入
|
1000
|
|
-
|
1001
|
|
- bytesData, err := json.Marshal(inputMessage)
|
1002
|
|
- fmt.Println(string(bytesData))
|
1003
|
|
- if err != nil {
|
1004
|
|
- fmt.Println(err.Error())
|
1005
|
|
- return err.Error()
|
1006
|
|
- }
|
1007
|
|
- reader := bytes.NewReader(bytesData)
|
1008
|
|
-
|
1009
|
|
- url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1201"
|
1010
|
|
- request, err := http.NewRequest("POST", url, reader)
|
1011
|
|
- if err != nil {
|
1012
|
|
- fmt.Println(err.Error())
|
1013
|
|
- return err.Error()
|
1014
|
|
- }
|
1015
|
|
-
|
1016
|
|
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
1017
|
|
- request.Header.Set("x-tif-paasid", "test_hosp")
|
1018
|
|
- request.Header.Set("x-tif-signature", signature)
|
1019
|
|
- request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
|
1020
|
|
- request.Header.Set("x-tif-nonce", nonce)
|
1021
|
|
-
|
1022
|
|
- client := http.Client{}
|
1023
|
|
- resp, err := client.Do(request)
|
1024
|
|
- if err != nil {
|
1025
|
|
- fmt.Println(err.Error())
|
1026
|
|
- return err.Error()
|
1027
|
|
- }
|
1028
|
|
- respBytes, err := ioutil.ReadAll(resp.Body)
|
1029
|
|
- if err != nil {
|
1030
|
|
- fmt.Println(err.Error())
|
1031
|
|
- return err.Error()
|
1032
|
|
- }
|
1033
|
|
- str := string(respBytes)
|
1034
|
|
- fmt.Println(str)
|
1035
|
|
- return str
|
1036
|
|
-}
|
|
983
|
+//func Gdyb1201(psnNo string, org_name string, doctor string) string {
|
|
984
|
+// // 生成签名
|
|
985
|
+// nonce := GetRandomString(32)
|
|
986
|
+// timestamp := time.Now().Unix()
|
|
987
|
+// signature := setSignature(timestamp, nonce)
|
|
988
|
+//
|
|
989
|
+// // 生成输入报文
|
|
990
|
+// inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, "")
|
|
991
|
+// input := make(map[string]interface{})
|
|
992
|
+// inputData := make(map[string]interface{})
|
|
993
|
+// inputMessage["infno"] = "1201" // 交易编码
|
|
994
|
+// inputData["fixmedins_type"] = psnNo // 人员编号 (来自1101接口返回)
|
|
995
|
+// inputData["fixmedins_name"] = org_name // 人员编号 (来自1101接口返回)
|
|
996
|
+// inputData["fixmedins_code"] = "" // 人员编号 (来自1101接口返回)
|
|
997
|
+//
|
|
998
|
+// input["medinsinfo"] = inputData
|
|
999
|
+// inputMessage["input"] = input //交易输入
|
|
1000
|
+//
|
|
1001
|
+// bytesData, err := json.Marshal(inputMessage)
|
|
1002
|
+// fmt.Println(string(bytesData))
|
|
1003
|
+// if err != nil {
|
|
1004
|
+// fmt.Println(err.Error())
|
|
1005
|
+// return err.Error()
|
|
1006
|
+// }
|
|
1007
|
+// reader := bytes.NewReader(bytesData)
|
|
1008
|
+//
|
|
1009
|
+// url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1201"
|
|
1010
|
+// request, err := http.NewRequest("POST", url, reader)
|
|
1011
|
+// if err != nil {
|
|
1012
|
+// fmt.Println(err.Error())
|
|
1013
|
+// return err.Error()
|
|
1014
|
+// }
|
|
1015
|
+//
|
|
1016
|
+// request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
1017
|
+// request.Header.Set("x-tif-paasid", "test_hosp")
|
|
1018
|
+// request.Header.Set("x-tif-signature", signature)
|
|
1019
|
+// request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
|
|
1020
|
+// request.Header.Set("x-tif-nonce", nonce)
|
|
1021
|
+//
|
|
1022
|
+// client := http.Client{}
|
|
1023
|
+// resp, err := client.Do(request)
|
|
1024
|
+// if err != nil {
|
|
1025
|
+// fmt.Println(err.Error())
|
|
1026
|
+// return err.Error()
|
|
1027
|
+// }
|
|
1028
|
+// respBytes, err := ioutil.ReadAll(resp.Body)
|
|
1029
|
+// if err != nil {
|
|
1030
|
+// fmt.Println(err.Error())
|
|
1031
|
+// return err.Error()
|
|
1032
|
+// }
|
|
1033
|
+// str := string(respBytes)
|
|
1034
|
+// fmt.Println(str)
|
|
1035
|
+// return str
|
|
1036
|
+//}
|