|
@@ -5,6 +5,7 @@ import (
|
5
|
5
|
"encoding/json"
|
6
|
6
|
"fmt"
|
7
|
7
|
"gdyb/models"
|
|
8
|
+ "github.com/astaxie/beego"
|
8
|
9
|
"io/ioutil"
|
9
|
10
|
"math/rand"
|
10
|
11
|
"net/http"
|
|
@@ -627,10 +628,8 @@ func msToTime(ms int64) string {
|
627
|
628
|
func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedrug *models.DrugDetail) string {
|
628
|
629
|
//生成输入报文
|
629
|
630
|
inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
630
|
|
-
|
631
|
631
|
inputData := make(map[string]interface{})
|
632
|
632
|
inputMessage["transType"] = "JY003" // 交易编码
|
633
|
|
-
|
634
|
633
|
inputData["listsize"] = 1
|
635
|
634
|
inputMessage["transType"] = "ML008" // 交易编码S
|
636
|
635
|
feedetail := make([]map[string]interface{}, 0)
|
|
@@ -641,13 +640,12 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
|
641
|
640
|
feedetailInfo["ake006"] = basedrug.DrugName
|
642
|
641
|
feedetailInfo["aka074"] = basedrug.DrugSpec
|
643
|
642
|
feedetailInfo["aka070"] = basedrug.DrugDosageName
|
644
|
|
- //feedetailInfo["aka070"] = "片"
|
645
|
643
|
feedetailInfo["aka067"] = basedrug.MinUnit
|
646
|
644
|
feedetailInfo["bka053"] = basedrug.ManufacturerName
|
647
|
645
|
feedetailInfo["aka064"] = "1"
|
648
|
646
|
feedetailInfo["bka505"] = basedrug.LastPrice
|
649
|
647
|
feedetailInfo["bka506"] = basedrug.RetailPrice
|
650
|
|
- feedetailInfo["aae030"] = 20210406
|
|
648
|
+ feedetailInfo["aae030"], _ = strconv.ParseInt(basedrug.RecordDate, 10, 64)
|
651
|
649
|
feedetailInfo["aae013"] = basedrug.LimitRemark
|
652
|
650
|
feedetail = append(feedetail, feedetailInfo)
|
653
|
651
|
|
|
@@ -661,9 +659,8 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
|
661
|
659
|
return err.Error()
|
662
|
660
|
}
|
663
|
661
|
reader := bytes.NewReader(bytesData)
|
664
|
|
- //url := "http://192.168.1.99:10000"
|
665
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
666
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
662
|
+
|
|
663
|
+ url := beego.AppConfig.String("url")
|
667
|
664
|
|
668
|
665
|
request, err := http.NewRequest("POST", url, reader)
|
669
|
666
|
if err != nil {
|
|
@@ -729,6 +726,9 @@ func SetSZDrugMessage(doctor string, doctor_code string, fixmedins_code string)
|
729
|
726
|
}
|
730
|
727
|
|
731
|
728
|
func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *models.MyHisProject) string {
|
|
729
|
+ timeLayout := "20060102"
|
|
730
|
+ record_date := time.Unix(pro.RecordDate, 0).Format(timeLayout)
|
|
731
|
+ recordDate, _ := strconv.ParseInt(record_date, 10, 64)
|
732
|
732
|
//生成输入报文
|
733
|
733
|
inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
734
|
734
|
|
|
@@ -738,17 +738,16 @@ func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *mo
|
738
|
738
|
feedetail := make([]map[string]interface{}, 0)
|
739
|
739
|
|
740
|
740
|
feedetailInfo := make(map[string]interface{})
|
741
|
|
- feedetailInfo["ake001"] = pro.MedicalCode //社保目录编码
|
742
|
|
- feedetailInfo["ake005"] = pro.MedicalCode //协议机构内部目录编码
|
743
|
|
- feedetailInfo["ake006"] = pro.ProjectName // 协议机构内部目录名称
|
744
|
|
- feedetailInfo["bkf131"] = pro.Category //协议机构项目类别
|
745
|
|
- feedetailInfo["bkm062"] = "0" // 门诊特检项目标识
|
746
|
|
- feedetailInfo["bka506"] = pro.Price // 协议机构内部项目收费价格
|
747
|
|
- feedetailInfo["aae030"] = 20210407 // 备案日期
|
748
|
|
- feedetailInfo["aae013"] = pro.Remark // 备注
|
|
741
|
+ feedetailInfo["ake001"] = pro.SocialSecurityDirectoryCode //社保目录编码
|
|
742
|
+ feedetailInfo["ake005"] = pro.SocialSecurityDirectoryCode //协议机构内部目录编码
|
|
743
|
+ feedetailInfo["ake006"] = pro.ProjectName // 协议机构内部目录名称
|
|
744
|
+ feedetailInfo["bkf131"] = pro.Category //协议机构项目类别
|
|
745
|
+ feedetailInfo["bkm062"] = strconv.FormatInt(pro.SpecailProject, 10) // 门诊特检项目标识
|
|
746
|
+ feedetailInfo["bka506"] = pro.Price // 协议机构内部项目收费价格
|
|
747
|
+ feedetailInfo["aae030"] = recordDate // 备案日期
|
|
748
|
+ feedetailInfo["aae013"] = pro.Remark // 备注
|
749
|
749
|
feedetail = append(feedetail, feedetailInfo)
|
750
|
750
|
|
751
|
|
- fmt.Println("feeedDetal2333333333", feedetail)
|
752
|
751
|
inputData["inputlist"] = feedetail
|
753
|
752
|
inputMessage["transBody"] = inputData
|
754
|
753
|
|
|
@@ -759,9 +758,7 @@ func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *mo
|
759
|
758
|
return err.Error()
|
760
|
759
|
}
|
761
|
760
|
reader := bytes.NewReader(bytesData)
|
762
|
|
- //url := "http://192.168.1.99:10000"
|
763
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
764
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
761
|
+ url := beego.AppConfig.String("url")
|
765
|
762
|
|
766
|
763
|
request, err := http.NewRequest("POST", url, reader)
|
767
|
764
|
if err != nil {
|
|
@@ -877,9 +874,7 @@ func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas [
|
877
|
874
|
return err.Error()
|
878
|
875
|
}
|
879
|
876
|
reader := bytes.NewReader(bytesData)
|
880
|
|
- //url := "http://192.168.1.99:10000"
|
881
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
882
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
877
|
+ url := beego.AppConfig.String("url")
|
883
|
878
|
|
884
|
879
|
request, err := http.NewRequest("POST", url, reader)
|
885
|
880
|
if err != nil {
|
|
@@ -966,9 +961,7 @@ func SzybYS001(doctor string, doctor_code string, fixmedins_code string, doc *mo
|
966
|
961
|
return err.Error()
|
967
|
962
|
}
|
968
|
963
|
reader := bytes.NewReader(bytesData)
|
969
|
|
- //url := "http://192.168.1.99:10000"
|
970
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
971
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
964
|
+ url := beego.AppConfig.String("url")
|
972
|
965
|
|
973
|
966
|
request, err := http.NewRequest("POST", url, reader)
|
974
|
967
|
if err != nil {
|
|
@@ -1112,9 +1105,7 @@ func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas *
|
1112
|
1105
|
return err.Error()
|
1113
|
1106
|
}
|
1114
|
1107
|
reader := bytes.NewReader(bytesData)
|
1115
|
|
- //url := "http://192.168.1.99:10000"
|
1116
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
1117
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
1108
|
+ url := beego.AppConfig.String("url")
|
1118
|
1109
|
|
1119
|
1110
|
request, err := http.NewRequest("POST", url, reader)
|
1120
|
1111
|
if err != nil {
|
|
@@ -1205,9 +1196,7 @@ func SzybYS003(doctor string, doctor_code string, fixmedins_code string, datas [
|
1205
|
1196
|
return err.Error()
|
1206
|
1197
|
}
|
1207
|
1198
|
reader := bytes.NewReader(bytesData)
|
1208
|
|
- //url := "http://192.168.1.99:10000"
|
1209
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
1210
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
1199
|
+ url := beego.AppConfig.String("url")
|
1211
|
1200
|
|
1212
|
1201
|
request, err := http.NewRequest("POST", url, reader)
|
1213
|
1202
|
if err != nil {
|
|
@@ -1268,9 +1257,7 @@ func SzybYML007(doctor string, doctor_code string, fixmedins_code string, infor
|
1268
|
1257
|
return err.Error()
|
1269
|
1258
|
}
|
1270
|
1259
|
reader := bytes.NewReader(bytesData)
|
1271
|
|
- //url := "http://192.168.1.99:10000"
|
1272
|
|
- //url := "http://192.168.1.228:17001/szsi-portal/transData"
|
1273
|
|
- url := "http://192.168.1.88:6666/szsi-portal/transData"
|
|
1260
|
+ url := beego.AppConfig.String("url")
|
1274
|
1261
|
|
1275
|
1262
|
request, err := http.NewRequest("POST", url, reader)
|
1276
|
1263
|
if err != nil {
|