|
@@ -17,18 +17,18 @@ import (
|
17
|
17
|
|
18
|
18
|
const (
|
19
|
19
|
SceretKey = "RhaDw4H0RUbWYyTxmRKM1eSeN0qyGLds" // secretKey 私钥
|
20
|
|
- FixmedinsCOde = "H44020500197" // 定点医药机构编号
|
|
20
|
+ FixmedinsCOde = "H44022900158" // 定点医药机构编号
|
21
|
21
|
)
|
22
|
22
|
|
23
|
23
|
// 人员基本信息
|
24
|
|
-func Gdyb1101(certNo string) string {
|
|
24
|
+func Gdyb1101(certNo string, org_name string, doctor string) string {
|
25
|
25
|
// 生成签名
|
26
|
26
|
nonce := GetRandomString(32)
|
27
|
27
|
timestamp := time.Now().Unix()
|
28
|
28
|
signature := setSignature(timestamp, nonce)
|
29
|
29
|
|
30
|
30
|
// 生成输入报文
|
31
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
31
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
32
|
32
|
input := make(map[string]interface{})
|
33
|
33
|
inputData := make(map[string]interface{})
|
34
|
34
|
inputMessage["infno"] = "1101" // 交易编码
|
|
@@ -80,7 +80,7 @@ func Gdyb1101(certNo string) string {
|
80
|
80
|
}
|
81
|
81
|
|
82
|
82
|
// 门诊挂号
|
83
|
|
-func Gdyb2201(psnNo string, insutype string, certNo string) string {
|
|
83
|
+func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doctor string, ipt_otp_no string, dept string) string {
|
84
|
84
|
// 生成签名
|
85
|
85
|
nonce := GetRandomString(32)
|
86
|
86
|
timestamp := time.Now().Unix()
|
|
@@ -89,7 +89,7 @@ func Gdyb2201(psnNo string, insutype string, certNo string) string {
|
89
|
89
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
90
|
90
|
|
91
|
91
|
// 生成输入报文
|
92
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
92
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
93
|
93
|
input := make(map[string]interface{})
|
94
|
94
|
inputData := make(map[string]interface{})
|
95
|
95
|
inputMessage["infno"] = "2201" // 交易编码
|
|
@@ -98,11 +98,11 @@ func Gdyb2201(psnNo string, insutype string, certNo string) string {
|
98
|
98
|
inputData["begntime"] = timeFormatOne // 开始时间
|
99
|
99
|
inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
|
100
|
100
|
inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
|
101
|
|
- inputData["ipt_otp_no"] = "10000110" // 住院/门诊号
|
|
101
|
+ inputData["ipt_otp_no"] = ipt_otp_no // 住院/门诊号
|
102
|
102
|
inputData["atddr_no"] = "1002" // 医师编码
|
103
|
|
- inputData["dr_name"] = "刘志刚" // 医师姓名
|
|
103
|
+ inputData["dr_name"] = doctor // 医师姓名
|
104
|
104
|
inputData["dept_code"] = "3002" // 科室编码
|
105
|
|
- inputData["dept_name"] = "血透中心" // 科室名称
|
|
105
|
+ inputData["dept_name"] = dept // 科室名称
|
106
|
106
|
inputData["caty"] = "A03.06" // 科别
|
107
|
107
|
|
108
|
108
|
input["data"] = inputData
|
|
@@ -146,20 +146,20 @@ func Gdyb2201(psnNo string, insutype string, certNo string) string {
|
146
|
146
|
}
|
147
|
147
|
|
148
|
148
|
// 门诊挂号撤销
|
149
|
|
-func Gdyb2202(psnNo string, mdtrtId string) string {
|
|
149
|
+func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string, doctor string) string {
|
150
|
150
|
// 生成签名
|
151
|
151
|
nonce := GetRandomString(32)
|
152
|
152
|
timestamp := time.Now().Unix()
|
153
|
153
|
signature := setSignature(timestamp, nonce)
|
154
|
154
|
|
155
|
155
|
// 生成输入报文
|
156
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
156
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
157
|
157
|
input := make(map[string]interface{})
|
158
|
158
|
inputData := make(map[string]interface{})
|
159
|
159
|
inputMessage["infno"] = "2202" // 交易编码
|
160
|
160
|
inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
|
161
|
161
|
inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
|
162
|
|
- inputData["ipt_otp_no"] = "10000110" // 住院/门诊号
|
|
162
|
+ inputData["ipt_otp_no"] = ipt_otp_no // 住院/门诊号
|
163
|
163
|
|
164
|
164
|
input["data"] = inputData
|
165
|
165
|
inputMessage["input"] = input //交易输入
|
|
@@ -202,7 +202,7 @@ func Gdyb2202(psnNo string, mdtrtId string) string {
|
202
|
202
|
}
|
203
|
203
|
|
204
|
204
|
// 门诊就诊信息上传
|
205
|
|
-func Gdyb2203(psnNo string, mdtrtId string) string {
|
|
205
|
+func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, diag string, org_name string) string {
|
206
|
206
|
// 生成签名
|
207
|
207
|
nonce := GetRandomString(32)
|
208
|
208
|
timestamp := time.Now().Unix()
|
|
@@ -211,7 +211,7 @@ func Gdyb2203(psnNo string, mdtrtId string) string {
|
211
|
211
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
212
|
212
|
|
213
|
213
|
// 生成输入报文
|
214
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
214
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
215
|
215
|
input := make(map[string]interface{})
|
216
|
216
|
inputData := make(map[string]interface{})
|
217
|
217
|
diseinfo := make([]map[string]interface{}, 0)
|
|
@@ -231,10 +231,10 @@ func Gdyb2203(psnNo string, mdtrtId string) string {
|
231
|
231
|
diseinfo_sun["diag_type"] = "1" // 诊断类别
|
232
|
232
|
diseinfo_sun["diag_srt_no"] = "1" // 诊断排序号
|
233
|
233
|
diseinfo_sun["diag_code"] = "A04.902" // 诊断代码
|
234
|
|
- diseinfo_sun["diag_name"] = "细菌性腹泻" // 诊断名称
|
235
|
|
- diseinfo_sun["diag_dept"] = "肾内科" // 诊断科室
|
|
234
|
+ diseinfo_sun["diag_name"] = diag // 诊断名称
|
|
235
|
+ diseinfo_sun["diag_dept"] = department // 诊断科室
|
236
|
236
|
diseinfo_sun["dise_dor_no"] = "1002" // 诊断医生编码
|
237
|
|
- diseinfo_sun["dise_dor_name"] = "马桂平" // 诊断医生姓名
|
|
237
|
+ diseinfo_sun["dise_dor_name"] = doctor // 诊断医生姓名
|
238
|
238
|
diseinfo_sun["diag_time"] = timeFormatOne // 诊断时间
|
239
|
239
|
diseinfo_sun["vali_flag"] = "1" // 有效标志
|
240
|
240
|
|
|
@@ -335,7 +335,7 @@ type Result struct {
|
335
|
335
|
}
|
336
|
336
|
|
337
|
337
|
// 门诊费用明细信息上传
|
338
|
|
-func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string) string {
|
|
338
|
+func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string) string {
|
339
|
339
|
// 生成签名
|
340
|
340
|
nonce := GetRandomString(32)
|
341
|
341
|
timestamp := time.Now().Unix()
|
|
@@ -374,6 +374,7 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
374
|
374
|
Cut: fmt.Sprintf("%.2f", float64(subItem.Count)),
|
375
|
375
|
FeedetlSn: subItem.FeedetlSn,
|
376
|
376
|
Price: fmt.Sprintf("%.2f", float64(subItem.Price)),
|
|
377
|
+ MedListCodg: subItem.MedListCodg,
|
377
|
378
|
}
|
378
|
379
|
fmt.Println(cus.FeedetlSn)
|
379
|
380
|
|
|
@@ -385,7 +386,7 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
385
|
386
|
fmt.Println(customs)
|
386
|
387
|
|
387
|
388
|
// 生成输入报文
|
388
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
389
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
389
|
390
|
input := make(map[string]interface{})
|
390
|
391
|
feedetail := make([]map[string]interface{}, 0)
|
391
|
392
|
inputMessage["infno"] = "2204" // 交易编码
|
|
@@ -411,9 +412,9 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
411
|
412
|
feedetailInfo["prd_days"] = "0" // 周期天数
|
412
|
413
|
feedetailInfo["medc_way_dscr"] = "" // 用药途径描述
|
413
|
414
|
feedetailInfo["bilg_dept_codg"] = "3002" // 开单科室编码
|
414
|
|
- feedetailInfo["bilg_dept_name"] = "血透中心" // 开单科室名称
|
|
415
|
+ feedetailInfo["bilg_dept_name"] = dept // 开单科室名称
|
415
|
416
|
feedetailInfo["bilg_dr_codg"] = "1002" // 开单医生编码
|
416
|
|
- feedetailInfo["bilg_dr_name"] = "刘志刚" // 开单医师姓名
|
|
417
|
+ feedetailInfo["bilg_dr_name"] = doctor // 开单医师姓名
|
417
|
418
|
feedetailInfo["acord_dept_codg"] = "" // 受单科室编码
|
418
|
419
|
feedetailInfo["acord_dept_name"] = "" // 受单科室名称
|
419
|
420
|
feedetailInfo["orders_dr_code"] = "" // 受单医生编码
|
|
@@ -471,14 +472,14 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
|
471
|
472
|
}
|
472
|
473
|
|
473
|
474
|
// 门诊费用明细信息撤销
|
474
|
|
-func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string) string {
|
|
475
|
+func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, doctor string) string {
|
475
|
476
|
// 生成签名
|
476
|
477
|
nonce := GetRandomString(32)
|
477
|
478
|
timestamp := time.Now().Unix()
|
478
|
479
|
signature := setSignature(timestamp, nonce)
|
479
|
480
|
|
480
|
481
|
// 生成输入报文
|
481
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
482
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
482
|
483
|
input := make(map[string]interface{})
|
483
|
484
|
inputData := make(map[string]interface{})
|
484
|
485
|
inputMessage["infno"] = "2205" // 交易编码
|
|
@@ -531,20 +532,20 @@ func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string) string {
|
531
|
532
|
}
|
532
|
533
|
|
533
|
534
|
// 门诊预结算
|
534
|
|
-func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string) string {
|
|
535
|
+func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string) string {
|
535
|
536
|
// 生成签名
|
536
|
537
|
nonce := GetRandomString(32)
|
537
|
538
|
timestamp := time.Now().Unix()
|
538
|
539
|
signature := setSignature(timestamp, nonce)
|
539
|
540
|
|
540
|
541
|
// 生成输入报文
|
541
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
542
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
542
|
543
|
input := make(map[string]interface{})
|
543
|
544
|
inputData := make(map[string]interface{})
|
544
|
545
|
inputMessage["infno"] = "2206" // 交易编码
|
545
|
546
|
|
546
|
547
|
inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
|
547
|
|
- inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
|
|
548
|
+ inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型,
|
548
|
549
|
inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
|
549
|
550
|
inputData["med_type"] = "11" // 医疗类别 11 普通门诊 12 门诊挂号
|
550
|
551
|
inputData["medfee_sumamt"] = total // 医疗费总额
|
|
@@ -595,14 +596,14 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
595
|
596
|
}
|
596
|
597
|
|
597
|
598
|
// 门诊结算
|
598
|
|
-func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string) string {
|
|
599
|
+func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string) string {
|
599
|
600
|
// 生成签名
|
600
|
601
|
nonce := GetRandomString(32)
|
601
|
602
|
timestamp := time.Now().Unix()
|
602
|
603
|
signature := setSignature(timestamp, nonce)
|
603
|
604
|
|
604
|
605
|
// 生成输入报文
|
605
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
606
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
606
|
607
|
input := make(map[string]interface{})
|
607
|
608
|
inputData := make(map[string]interface{})
|
608
|
609
|
inputMessage["infno"] = "2207" // 交易编码
|
|
@@ -660,14 +661,14 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
|
660
|
661
|
}
|
661
|
662
|
|
662
|
663
|
// 门诊结算撤销
|
663
|
|
-func Gdyb2208(psnNo string, mdtrtId string, setlId string) string {
|
|
664
|
+func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doctor string) string {
|
664
|
665
|
// 生成签名
|
665
|
666
|
nonce := GetRandomString(32)
|
666
|
667
|
timestamp := time.Now().Unix()
|
667
|
668
|
signature := setSignature(timestamp, nonce)
|
668
|
669
|
|
669
|
670
|
// 生成输入报文
|
670
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
671
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
671
|
672
|
input := make(map[string]interface{})
|
672
|
673
|
inputData := make(map[string]interface{})
|
673
|
674
|
inputMessage["infno"] = "2208" // 交易编码
|
|
@@ -743,7 +744,7 @@ func GetRandomString(l int) string {
|
743
|
744
|
}
|
744
|
745
|
|
745
|
746
|
// 生成基础报文
|
746
|
|
-func SetInputMessage(nonce string, timestamp int64) map[string]interface{} {
|
|
747
|
+func SetInputMessage(nonce string, timestamp int64, org_name string, doctor string) map[string]interface{} {
|
747
|
748
|
// 生成签名
|
748
|
749
|
tempTime := time.Unix(timestamp, 0)
|
749
|
750
|
timeFormat := tempTime.Format("20060102150405")
|
|
@@ -765,10 +766,10 @@ func SetInputMessage(nonce string, timestamp int64) map[string]interface{} {
|
765
|
766
|
inputMessage["infver"] = "V1.1" // 接收方系统代码
|
766
|
767
|
inputMessage["opter_type"] = "1" // 经办人类别
|
767
|
768
|
inputMessage["opter"] = "mockuser" // 经办人
|
768
|
|
- inputMessage["opter_name"] = "测试用户" // 经办人姓名
|
|
769
|
+ inputMessage["opter_name"] = doctor // 经办人姓名
|
769
|
770
|
inputMessage["inf_time"] = timeFormatOne // 交易时间
|
770
|
771
|
inputMessage["fixmedins_code"] = FixmedinsCOde // 定点医药机构编号
|
771
|
|
- inputMessage["fixmedins_name"] = "韶关市曲江区小坑镇卫生院" //定点医药机构名称
|
|
772
|
+ inputMessage["fixmedins_name"] = org_name //定点医药机构名称
|
772
|
773
|
inputMessage["sign_no"] = "" //交易签到流水号
|
773
|
774
|
return inputMessage
|
774
|
775
|
}
|
|
@@ -780,20 +781,20 @@ func FindHisRegisterRecord(record_time int64, patient_id int64, org_id int64) (t
|
780
|
781
|
return
|
781
|
782
|
}
|
782
|
783
|
|
783
|
|
-func Gdyb1201(psnNo string) string {
|
|
784
|
+func Gdyb1201(psnNo string, org_name string, doctor string) string {
|
784
|
785
|
// 生成签名
|
785
|
786
|
nonce := GetRandomString(32)
|
786
|
787
|
timestamp := time.Now().Unix()
|
787
|
788
|
signature := setSignature(timestamp, nonce)
|
788
|
789
|
|
789
|
790
|
// 生成输入报文
|
790
|
|
- inputMessage := SetInputMessage(nonce, timestamp)
|
|
791
|
+ inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor)
|
791
|
792
|
input := make(map[string]interface{})
|
792
|
793
|
inputData := make(map[string]interface{})
|
793
|
|
- inputMessage["infno"] = "1201" // 交易编码
|
794
|
|
- inputData["fixmedins_type"] = psnNo // 人员编号 (来自1101接口返回)
|
795
|
|
- inputData["fixmedins_name"] = "韶关" // 人员编号 (来自1101接口返回)
|
796
|
|
- inputData["fixmedins_code"] = "" // 人员编号 (来自1101接口返回)
|
|
794
|
+ inputMessage["infno"] = "1201" // 交易编码
|
|
795
|
+ inputData["fixmedins_type"] = psnNo // 人员编号 (来自1101接口返回)
|
|
796
|
+ inputData["fixmedins_name"] = "翁源沅胜血液透析中心" // 人员编号 (来自1101接口返回)
|
|
797
|
+ inputData["fixmedins_code"] = "" // 人员编号 (来自1101接口返回)
|
797
|
798
|
|
798
|
799
|
input["medinsinfo"] = inputData
|
799
|
800
|
inputMessage["input"] = input //交易输入
|