test_user 1 year ago
parent
commit
0973f4f320

File diff suppressed because it is too large
+ 2028 - 607
controllers/coordinate/coordinate_controller.go


+ 78 - 0
controllers/hb/hbyb_controller.go View File

30
 	beego.Router("/hbyb/3202", &HBybController{}, "post:Post3202a")
30
 	beego.Router("/hbyb/3202", &HBybController{}, "post:Post3202a")
31
 	beego.Router("/hbyb/4101", &HBybController{}, "post:Post4101")
31
 	beego.Router("/hbyb/4101", &HBybController{}, "post:Post4101")
32
 
32
 
33
+	beego.Router("/hbyb/5262", &HBybController{}, "post:Post5262")
34
+	beego.Router("/hbyb/5267", &HBybController{}, "post:Post5267")
35
+
36
+
37
+}
38
+func (c *HBybController)Post5262(){
39
+	body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
40
+	var respJSON map[string]interface{}
41
+	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
42
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
43
+		return
44
+	}
45
+	userJSONBytes, _ := json.Marshal(respJSON["bps"])
46
+	var bps models.BusinessParams5262
47
+	if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
48
+		utils.ErrorLog("解析失败:%v", err)
49
+		return
50
+	}
51
+
52
+	var baseParams models.BaseParams
53
+	baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
54
+	baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
55
+	baseParams.OrgName = respJSON["org_name"].(string)
56
+	baseParams.Doctor = respJSON["doctor"].(string)
57
+	baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
58
+	page := respJSON["page"].(string)
59
+	limit := respJSON["limit"].(string)
60
+
61
+
62
+	result := service.Hbyb5262(baseParams, bps,page,limit)
63
+	var dat map[string]interface{}
64
+	if err := json.Unmarshal([]byte(result), &dat); err == nil {
65
+		fmt.Println(dat)
66
+	} else {
67
+		fmt.Println(err)
68
+	}
69
+	c.ServeSuccessJSON(map[string]interface{}{
70
+		"pre": dat,
71
+	})
72
+
73
+
33
 }
74
 }
75
+func (c *HBybController)Post5267(){
76
+	body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
77
+	var respJSON map[string]interface{}
78
+	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
79
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
80
+		return
81
+	}
82
+	userJSONBytes, _ := json.Marshal(respJSON["bps"])
83
+	var bps models.BusinessParams5262
84
+	if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
85
+		utils.ErrorLog("解析失败:%v", err)
86
+		return
87
+	}
88
+
89
+	var baseParams models.BaseParams
90
+	baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
91
+	baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
92
+	baseParams.OrgName = respJSON["org_name"].(string)
93
+	baseParams.Doctor = respJSON["doctor"].(string)
94
+	baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
95
+	page := respJSON["page"].(string)
96
+	limit := respJSON["limit"].(string)
97
+
98
+	result := service.Hbyb5267(baseParams, bps,page,limit)
99
+	var dat map[string]interface{}
100
+	if err := json.Unmarshal([]byte(result), &dat); err == nil {
101
+		fmt.Println(dat)
102
+	} else {
103
+		fmt.Println(err)
104
+	}
105
+	c.ServeSuccessJSON(map[string]interface{}{
106
+		"pre": dat,
107
+	})
108
+
109
+}
110
+
111
+
34
 func (c *HBybController) Post3202a() {
112
 func (c *HBybController) Post3202a() {
35
 
113
 
36
 	body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
114
 	body, _ := ioutil.ReadAll(c.Ctx.Request.Body)

+ 389 - 1
controllers/js/jsyb_controller.go View File

53
 	beego.Router("/jsyb/4101", &JSybController{}, "post:Get4101")
53
 	beego.Router("/jsyb/4101", &JSybController{}, "post:Get4101")
54
 	beego.Router("/jsyb/readcard", &JSybController{}, "get:ReadCard")
54
 	beego.Router("/jsyb/readcard", &JSybController{}, "get:ReadCard")
55
 
55
 
56
+
57
+	beego.Router("/jsyb/readcardcharge", &JSybController{}, "get:Readcardcharge")
58
+	beego.Router("/jsyb/readcardchargeother", &JSybController{}, "get:Readcardchargeother")
59
+
56
 	beego.Router("/jsyb/3260", &JSybController{}, "get:Get3260")
60
 	beego.Router("/jsyb/3260", &JSybController{}, "get:Get3260")
57
 	beego.Router("/jsyb/3261", &JSybController{}, "get:Get3261")
61
 	beego.Router("/jsyb/3261", &JSybController{}, "get:Get3261")
58
 	beego.Router("/jsyb/3262", &JSybController{}, "post:Get3262")
62
 	beego.Router("/jsyb/3262", &JSybController{}, "post:Get3262")
1685
 	Message string `json:"message"`
1689
 	Message string `json:"message"`
1686
 }
1690
 }
1687
 
1691
 
1692
+func (c *JSybController) Readcardcharge() {
1693
+	fixmedins_code := c.GetString("fixmedins_code")
1694
+	secret_key := c.GetString("secret_key")
1695
+	ak := c.GetString("ak")
1696
+	org_name := c.GetString("org_name")
1697
+	doctor := c.GetString("doctor")
1698
+	insuplc_admdvs := c.GetString("insuplc_admdvs")
1699
+	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
1700
+	url := c.GetString("url")
1701
+	cainfo := c.GetString("cainfo")
1702
+	id_card_type := c.GetString("id_card_type")
1703
+	operator_id := c.GetString("operator_id")
1704
+	operator := c.GetString("operator")
1705
+
1706
+	//result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
1707
+	//fmt.Println(request)
1708
+	//fmt.Println(result)
1709
+
1710
+	c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
1711
+	switch id_card_type {
1712
+	case "1":
1713
+		pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
1714
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1715
+		pCardInfo = Remove0000(pCardInfo)
1716
+		fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
1717
+
1718
+		fmt.Println(pBusiCardInfo)
1719
+		fmt.Println(pCardInfo)
1720
+		bas := strings.Split(pCardInfo, "|")
1721
+		basNumber := bas[2]
1722
+		id_card_no := bas[1]
1723
+		card_sn := bas[3]
1724
+
1725
+		id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
1726
+
1727
+		if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
1728
+			result, _ := service.Jsyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, pBusiCardInfo, id_card_no, cainfo)
1729
+			var dat map[string]interface{}
1730
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1731
+				fmt.Println(dat)
1732
+			} else {
1733
+				fmt.Println(err)
1734
+			}
1735
+			c.ServeSuccessJSON(map[string]interface{}{
1736
+				"status":         "0",
1737
+				"card_info":      pCardInfo,
1738
+				"busi_card_info": pBusiCardInfo,
1739
+				"result":         dat,
1740
+				"type":           "1",
1741
+			})
1742
+		} else {
1743
+			c.ServeSuccessJSON(map[string]interface{}{
1744
+				"status": "-1",
1745
+			})
1746
+
1747
+		}
1748
+		break
1749
+	case "3": //电子社保卡
1750
+		_, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
1751
+		//fmt.Println(pCardInfo)
1752
+		fmt.Println(pBusiCardInfo)
1753
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1754
+		//pCardInfo = Remove0000(pCardInfo)
1755
+		var ele ELeData
1756
+		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
1757
+		if err != nil {
1758
+			utils.ErrorLog("解析失败:%v", err)
1759
+		}
1760
+		token := ele.Data.EcCardToken
1761
+		if len(token) > 0 {
1762
+			result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
1763
+			var dat map[string]interface{}
1764
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1765
+				fmt.Println(dat)
1766
+			} else {
1767
+				fmt.Println(err)
1768
+			}
1769
+			c.ServeSuccessJSON(map[string]interface{}{
1770
+				"status": "0",
1771
+				//"card_info":      pCardInfo,
1772
+				"busi_card_info": pBusiCardInfo,
1773
+				"token":          token,
1774
+				"result":         dat,
1775
+				"type":           "2",
1776
+			})
1777
+		} else {
1778
+			c.ServeSuccessJSON(map[string]interface{}{
1779
+				"status": "-1",
1780
+			})
1781
+
1782
+		}
1783
+		break
1784
+	case "4": //电子凭证
1785
+		fmt.Println(operator_id)
1786
+		fmt.Println(operator)
1787
+		_, pBusiCardInfo := c.GetELeCertInfoThree(fixmedins_code, operator_id, operator)
1788
+		fmt.Println(pBusiCardInfo)
1789
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1790
+		var ele ELeCertData
1791
+		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
1792
+		if err != nil {
1793
+			utils.ErrorLog("解析失败:%v", err)
1794
+		}
1795
+		token := ele.Data.EcToken
1796
+		fmt.Println(token)
1797
+		if len(token) > 0 {
1798
+			userName := ele.Data.UserName
1799
+			fmt.Println(userName)
1800
+			userName = Remove0000(userName)
1801
+			userName = DeleteExtraSpace(userName)
1802
+			fmt.Println(userName)
1803
+			enc := mahonia.NewEncoder("gbk")
1804
+			fmt.Println(enc.ConvertString(userName))
1805
+			result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
1806
+			var dat map[string]interface{}
1807
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1808
+				fmt.Println(dat)
1809
+			} else {
1810
+				fmt.Println(err)
1811
+			}
1812
+			c.ServeSuccessJSON(map[string]interface{}{
1813
+				"status":         "0",
1814
+				"card_info":      "",
1815
+				"busi_card_info": pBusiCardInfo,
1816
+				"token":          token,
1817
+				"result":         dat,
1818
+			})
1819
+		} else {
1820
+			c.ServeSuccessJSON(map[string]interface{}{
1821
+				"status": "-1",
1822
+			})
1823
+
1824
+		}
1825
+		break
1826
+	}
1827
+
1828
+}
1829
+func (c *JSybController) Readcardchargeother() {
1830
+	fixmedins_code := c.GetString("fixmedins_code")
1831
+	secret_key := c.GetString("secret_key")
1832
+	ak := c.GetString("ak")
1833
+	org_name := c.GetString("org_name")
1834
+	doctor := c.GetString("doctor")
1835
+	insuplc_admdvs := c.GetString("insuplc_admdvs")
1836
+	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
1837
+	url := c.GetString("url")
1838
+	cainfo := c.GetString("cainfo")
1839
+	id_card_type := c.GetString("id_card_type")
1840
+	operator_id := c.GetString("operator_id")
1841
+	operator := c.GetString("operator")
1842
+
1843
+	//result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
1844
+	//fmt.Println(request)
1845
+	//fmt.Println(result)
1846
+
1847
+	c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
1848
+	switch id_card_type {
1849
+	case "1":
1850
+		pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
1851
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1852
+		pCardInfo = Remove0000(pCardInfo)
1853
+		fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
1854
+
1855
+		fmt.Println(pBusiCardInfo)
1856
+		fmt.Println(pCardInfo)
1857
+		bas := strings.Split(pCardInfo, "|")
1858
+		basNumber := bas[2]
1859
+		id_card_no := bas[1]
1860
+		card_sn := bas[3]
1861
+
1862
+		id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
1863
+
1864
+		if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
1865
+			result, _ := service.Jsyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, pBusiCardInfo, id_card_no, cainfo)
1866
+			var dat map[string]interface{}
1867
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1868
+				fmt.Println(dat)
1869
+			} else {
1870
+				fmt.Println(err)
1871
+			}
1872
+			c.ServeSuccessJSON(map[string]interface{}{
1873
+				"status":         "0",
1874
+				"card_info":      pCardInfo,
1875
+				"busi_card_info": pBusiCardInfo,
1876
+				"result":         dat,
1877
+				"type":           "1",
1878
+			})
1879
+		} else {
1880
+			c.ServeSuccessJSON(map[string]interface{}{
1881
+				"status": "-1",
1882
+			})
1883
+
1884
+		}
1885
+		break
1886
+	case "3": //电子社保卡
1887
+		_, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
1888
+		//fmt.Println(pCardInfo)
1889
+		fmt.Println(pBusiCardInfo)
1890
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1891
+		//pCardInfo = Remove0000(pCardInfo)
1892
+		var ele ELeData
1893
+		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
1894
+		if err != nil {
1895
+			utils.ErrorLog("解析失败:%v", err)
1896
+		}
1897
+		token := ele.Data.EcCardToken
1898
+		if len(token) > 0 {
1899
+			result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
1900
+			var dat map[string]interface{}
1901
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1902
+				fmt.Println(dat)
1903
+			} else {
1904
+				fmt.Println(err)
1905
+			}
1906
+			c.ServeSuccessJSON(map[string]interface{}{
1907
+				"status": "0",
1908
+				//"card_info":      pCardInfo,
1909
+				"busi_card_info": pBusiCardInfo,
1910
+				"token":          token,
1911
+				"result":         dat,
1912
+				"type":           "2",
1913
+			})
1914
+		} else {
1915
+			c.ServeSuccessJSON(map[string]interface{}{
1916
+				"status": "-1",
1917
+			})
1918
+
1919
+		}
1920
+		break
1921
+	case "4": //电子凭证
1922
+		fmt.Println(operator_id)
1923
+		fmt.Println(operator)
1924
+		_, pBusiCardInfo := c.GetELeCertInfoFour(fixmedins_code, operator_id, operator)
1925
+		fmt.Println(pBusiCardInfo)
1926
+		pBusiCardInfo = Remove0000(pBusiCardInfo)
1927
+		var ele ELeCertData
1928
+		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
1929
+		if err != nil {
1930
+			utils.ErrorLog("解析失败:%v", err)
1931
+		}
1932
+		token := ele.Data.EcToken
1933
+		fmt.Println(token)
1934
+		if len(token) > 0 {
1935
+			userName := ele.Data.UserName
1936
+			fmt.Println(userName)
1937
+			userName = Remove0000(userName)
1938
+			userName = DeleteExtraSpace(userName)
1939
+			fmt.Println(userName)
1940
+			enc := mahonia.NewEncoder("gbk")
1941
+			fmt.Println(enc.ConvertString(userName))
1942
+			result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
1943
+			var dat map[string]interface{}
1944
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1945
+				fmt.Println(dat)
1946
+			} else {
1947
+				fmt.Println(err)
1948
+			}
1949
+			c.ServeSuccessJSON(map[string]interface{}{
1950
+				"status":         "0",
1951
+				"card_info":      "",
1952
+				"busi_card_info": pBusiCardInfo,
1953
+				"token":          token,
1954
+				"result":         dat,
1955
+			})
1956
+		} else {
1957
+			c.ServeSuccessJSON(map[string]interface{}{
1958
+				"status": "-1",
1959
+			})
1960
+
1961
+		}
1962
+		break
1963
+	}
1964
+
1965
+}
1966
+
1688
 func (c *JSybController) ReadCard() {
1967
 func (c *JSybController) ReadCard() {
1689
 	fixmedins_code := c.GetString("fixmedins_code")
1968
 	fixmedins_code := c.GetString("fixmedins_code")
1690
 	secret_key := c.GetString("secret_key")
1969
 	secret_key := c.GetString("secret_key")
1919
 	}
2198
 	}
1920
 	return DeleteExtraSpace(""), DeleteExtraSpace(string(pBusiCardInfo))
2199
 	return DeleteExtraSpace(""), DeleteExtraSpace(string(pBusiCardInfo))
1921
 }
2200
 }
2201
+func (c *JSybController) GetELeCertInfoFour1(code string, operator_id string, operator_name string) (string, string) {
2202
+	DllDef := syscall.MustLoadDLL("NationEcCode.dll")
2203
+	readCard := DllDef.MustFindProc("EcQuery")
2204
+
2205
+	pCardInfo := make([]byte, 8192)
2206
+	pBusiCardInfo := make([]byte, 8192)
2207
+	data := make(map[string]interface{})
2208
+
2209
+	inputData := make(map[string]interface{})
2210
+	inputData["orgId"] = code
2211
+	inputData["businessType"] = "01301"
2212
+	inputData["operatorId"] = operator_id
2213
+	inputData["operatorName"] = operator_name
2214
+	inputData["officeId"] = "001"
2215
+	inputData["officeName"] = "xuetou"
2216
+	data["data"] = inputData
2217
+	data["transType"] = "ec.query"
2218
+	data["orgId"] = code
2219
+	bytesData, _ := json.Marshal(data)
2220
+	pCardInfo = bytesData
2221
+	pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
2222
+
2223
+	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
2224
+	fmt.Println(ret2)
2225
+	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
2226
+	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
2227
+	if ret2 != 0 {
2228
+		return "", ""
2229
+	}
2230
+	return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
2231
+}
1922
 
2232
 
1923
-func (c *JSybController) GetELeCertInfo(code string, operator_id string, operator_name string) (string, string) {
2233
+func (c *JSybController) GetELeCertInfoFour(code string, operator_id string, operator_name string) (string, string) {
2234
+	DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
2235
+	readCard := DllDef.MustFindProc("GetPersonInfo")
2236
+
2237
+	pCardInfo := make([]byte, 8192)
2238
+	pBusiCardInfo := make([]byte, 8192)
2239
+	data := make(map[string]interface{})
2240
+
2241
+	inputData := make(map[string]interface{})
2242
+	inputData["orgId"] = code
2243
+	inputData["businessType"] = "01301"
2244
+	inputData["operatorId"] = operator_id
2245
+	inputData["operatorName"] = operator_name
2246
+	inputData["officeId"] = "001"
2247
+	inputData["officeName"] = "xuetou"
2248
+	data["data"] = inputData
2249
+	data["transType"] = "ec.query"
2250
+	data["orgId"] = code
2251
+	bytesData, _ := json.Marshal(data)
2252
+	pCardInfo = bytesData
2253
+	pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
2254
+
2255
+	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
2256
+	fmt.Println(ret2)
2257
+	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
2258
+	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
2259
+	if ret2 != 0 {
2260
+		return "", ""
2261
+	}
2262
+	return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
2263
+}
2264
+func (c *JSybController) GetELeCertInfoFour2223(code string, operator_id string, operator_name string) (string, string) {
1924
 	DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
2265
 	DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
1925
 	readCard := DllDef.MustFindProc("GetPersonInfo")
2266
 	readCard := DllDef.MustFindProc("GetPersonInfo")
1926
 
2267
 
1999
 
2340
 
2000
 	return "", string(receivedMessage)
2341
 	return "", string(receivedMessage)
2001
 }
2342
 }
2343
+func (c *JSybController) GetELeCertInfoThree(code string, operator_id string, operator_name string) (string, string) {
2344
+	// WebSocket服务器地址
2345
+	serverURL := "ws://127.0.0.1:8899"
2346
+
2347
+	// 解析WebSocket服务器地址
2348
+	u, err := url.Parse(serverURL)
2349
+	if err != nil {
2350
+		log.Fatal(err)
2351
+	}
2352
+
2353
+	// 建立WebSocket连接
2354
+	conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
2355
+	if err != nil {
2356
+		log.Fatal(err)
2357
+	}
2358
+	defer conn.Close()
2359
+	input2 := make(map[string]interface{})
2360
+
2361
+	input := make(map[string]interface{})
2362
+	inputData := make(map[string]interface{})
2363
+	inputData["orgId"] = code
2364
+	inputData["businessType"] = "01301"
2365
+	inputData["operatorId"] = operator_id
2366
+	inputData["operatorName"] = operator_name
2367
+	inputData["officeId"] = "001"
2368
+	inputData["officeName"] = "血透室"
2369
+	inputData["deviceType"] = ""
2370
+	input["data"] = inputData
2371
+	input["orgId"] = code
2372
+	input["transType"] = "ec.query"
2373
+	input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
2374
+	input2["indata"] = input
2375
+
2376
+	bytesData, _ := json.Marshal(input2)
2377
+	err = conn.WriteMessage(websocket.TextMessage, bytesData)
2378
+	if err != nil {
2379
+		fmt.Println(err)
2380
+	}
2381
+
2382
+	// 接收消息
2383
+	_, receivedMessage, err := conn.ReadMessage()
2384
+	if err != nil {
2385
+		fmt.Println(err)
2386
+	}
2387
+
2388
+	return "", string(receivedMessage)
2389
+}
2002
 
2390
 
2003
 func GetELeCertInfoSettle(code string, operator_id string, operator_name string) (string, string) {
2391
 func GetELeCertInfoSettle(code string, operator_id string, operator_name string) (string, string) {
2004
 	DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
2392
 	DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")

+ 40 - 0
controllers/nm/nm_controller.go View File

846
 		SetlId:  setl_id,
846
 		SetlId:  setl_id,
847
 	}
847
 	}
848
 	result := service.ZHyb4103(bp, bps)
848
 	result := service.ZHyb4103(bp, bps)
849
+	result2 := service.ZHyb4104(bp, bps)
850
+
849
 	saveJsLog(result, "", "4103", "查询结算清单", org_name)
851
 	saveJsLog(result, "", "4103", "查询结算清单", org_name)
852
+	saveJsLog(result2, "", "4104", "指控结算清单", org_name)
853
+
850
 	var dat map[string]interface{}
854
 	var dat map[string]interface{}
851
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
855
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
852
 
856
 
857
 		"pre": dat,
861
 		"pre": dat,
858
 	})
862
 	})
859
 }
863
 }
864
+func (c *NmController) Post4104() {
865
+	org_name := c.GetString("org_name")
866
+	doctor := c.GetString("doctor")
867
+	fixmedins_code := c.GetString("fixmedins_code")
868
+	insuplc_admdvs := c.GetString("insuplc_admdvs")
869
+	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
870
+	secret_key := c.GetString("secret_key")
871
+	psn_no := c.GetString("psn_no")
872
+	mdtrt_id := c.GetString("mdtrt_id")
873
+	setl_id := c.GetString("setl_id")
874
+	bp := models.BaseParams{
875
+		SecretKey:      secret_key,
876
+		FixmedinsCode:  fixmedins_code,
877
+		InsuplcAdmdvs:  insuplc_admdvs,
878
+		MdtrtareaAdmvs: mdtrtarea_admvs,
879
+		OrgName:        org_name,
880
+		Doctor:         doctor,
881
+	}
882
+	bps := models.BusinessParams{
883
+		PsnNo:   psn_no,
884
+		MdtrtId: mdtrt_id,
885
+		SetlId:  setl_id,
886
+	}
887
+	result := service.ZHyb4104(bp, bps)
888
+	saveJsLog(result, "", "4104", "质控结算清单结果", org_name)
889
+	var dat map[string]interface{}
890
+	if err := json.Unmarshal([]byte(result), &dat); err == nil {
891
+
892
+	} else {
893
+
894
+	}
895
+	c.ServeSuccessJSON(map[string]interface{}{
896
+		"pre": dat,
897
+	})
898
+}
899
+
860
 
900
 
861
 func (c *NmController) Post1101() {
901
 func (c *NmController) Post1101() {
862
 	certNo := c.GetString("cert_no")
902
 	certNo := c.GetString("cert_no")

File diff suppressed because it is too large
+ 5071 - 2315
controllers/sg/his_api_controller.go


File diff suppressed because it is too large
+ 1387 - 16
controllers/zh/zh_his_api_controller.go


BIN
gdyb View File


File diff suppressed because it is too large
+ 3403 - 2829
main.go


+ 26 - 0
models/cfyljg.go View File

163
 	PharChkTime     string `json:"phar_chk_time"`
163
 	PharChkTime     string `json:"phar_chk_time"`
164
 	RxFile          string `json:"rx_file"`
164
 	RxFile          string `json:"rx_file"`
165
 	SignDigest      string `json:"sign_digest"`
165
 	SignDigest      string `json:"sign_digest"`
166
+	EcToken      string `json:"ec_token"`
167
+
166
 }
168
 }
167
 
169
 
168
 type CFYLJG004 struct {
170
 type CFYLJG004 struct {
202
 	PsnNo         string `json:"psn_no"`
204
 	PsnNo         string `json:"psn_no"`
203
 	PsnCertType   string `json:"psn_cert_type"`
205
 	PsnCertType   string `json:"psn_cert_type"`
204
 	Certno        string `json:"certno"`
206
 	Certno        string `json:"certno"`
207
+	PsnName       string `json:"psn_name"`
208
+
209
+
210
+}
211
+
212
+type MedinsProdInvChgDDTO struct {
213
+	MedListCodg  string  `json:"medListCodg"`
214
+	Cnt          float64 `json:"cnt"`
205
 }
215
 }
206
 
216
 
217
+type CFYLJG008 struct {
218
+	PageNum      int                  `json:"pageNum"`
219
+	PageSize     int                  `json:"pageSize"`
220
+	OrderType    string               `json:"orderType"`
221
+	PoolareaNo   string               `json:"poolareaNo"`
222
+	FixmedinsName string              `json:"fixmedinsName"`
223
+	Lng          string               `json:"lng"`
224
+	Lat          string               `json:"lat"`
225
+	MedList      []MedinsProdInvChgDDTO `json:"medinsProdInvChgDDTOList"`
226
+}
227
+
228
+
207
 type HisPrescriptionFlow struct {
229
 type HisPrescriptionFlow struct {
208
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
230
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
209
 	RxTraceCode    string `gorm:"column:rx_trace_code" json:"rx_trace_code" form:"rx_trace_code"`
231
 	RxTraceCode    string `gorm:"column:rx_trace_code" json:"rx_trace_code" form:"rx_trace_code"`
221
 	SignCertSn     string `gorm:"column:sign_cert_sn" json:"sign_cert_sn" form:"sign_cert_sn"`
243
 	SignCertSn     string `gorm:"column:sign_cert_sn" json:"sign_cert_sn" form:"sign_cert_sn"`
222
 	SignCertDn     string `gorm:"column:sign_cert_dn" json:"sign_cert_dn" form:"sign_cert_dn"`
244
 	SignCertDn     string `gorm:"column:sign_cert_dn" json:"sign_cert_dn" form:"sign_cert_dn"`
223
 	MID            string `gorm:"column:m_id" json:"m_id" form:"m_id"`
245
 	MID            string `gorm:"column:m_id" json:"m_id" form:"m_id"`
246
+	DCode            string `gorm:"column:m_id" json:"m_id" form:"m_id"`
247
+	DID           int64 `gorm:"column:d_id" json:"d_id" form:"d_id"`
248
+
249
+
224
 }
250
 }
225
 
251
 
226
 func (HisPrescriptionFlow) TableName() string {
252
 func (HisPrescriptionFlow) TableName() string {

+ 5 - 0
models/drug.go View File

69
 	DrugDay   string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
69
 	DrugDay   string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
70
 	MinPrice  float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
70
 	MinPrice  float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
71
 	IsUser    int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
71
 	IsUser    int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
72
+	ZuobiaoId             string    `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
73
+	Bck01b             string    `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
74
+	Bby01             string    `gorm:"column:bby01" json:"bby01" form:"bby01"`
75
+
76
+
72
 
77
 
73
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
78
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
74
 }
79
 }

+ 8 - 0
models/good_models.go View File

73
 	IsUser             int64     `gorm:"column:is_user" json:"is_user" form:"is_user"`
73
 	IsUser             int64     `gorm:"column:is_user" json:"is_user" form:"is_user"`
74
 	PackingUnit        string    `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
74
 	PackingUnit        string    `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
75
 	Number             string    `gorm:"column:number" json:"number" form:"number"`
75
 	Number             string    `gorm:"column:number" json:"number" form:"number"`
76
+	ZuobiaoId             string    `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
77
+	Bck01b             string    `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
78
+	Bby01             string    `gorm:"column:bby01" json:"bby01" form:"bby01"`
79
+
80
+
81
+
82
+
83
+
76
 }
84
 }
77
 
85
 
78
 func (GoodInfo) TableName() string {
86
 func (GoodInfo) TableName() string {

+ 266 - 4
models/his_models.go View File

1
 package models
1
 package models
2
 
2
 
3
-import "time"
3
+import (
4
+	"encoding/xml"
5
+	"fmt"
6
+	"time"
7
+)
4
 
8
 
5
 type XtHisProject struct {
9
 type XtHisProject struct {
6
 	ID                        int64   `gorm:"column:id" json:"id" form:"id"`
10
 	ID                        int64   `gorm:"column:id" json:"id" form:"id"`
333
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
337
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
334
 	VMHisPrescriptionInfo  HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
338
 	VMHisPrescriptionInfo  HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
335
 	MedType                string                    `gorm:"column:med_type" json:"med_type" form:"med_type"`
339
 	MedType                string                    `gorm:"column:med_type" json:"med_type" form:"med_type"`
340
+	Cbm01                string                    `gorm:"column:cbm01" json:"cbm01" form:"cbm01"`
341
+	Cbm07                string                    `gorm:"column:cbm07" json:"cbm07" form:"cbm07"`
342
+
343
+
344
+
336
 }
345
 }
337
 
346
 
338
 func (HisPrescription) TableName() string {
347
 func (HisPrescription) TableName() string {
368
 	Status                    int64   `gorm:"column:status" json:"status" form:"status"`
377
 	Status                    int64   `gorm:"column:status" json:"status" form:"status"`
369
 	CreatedTime               int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
378
 	CreatedTime               int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
370
 	UpdatedTime               int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
379
 	UpdatedTime               int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
380
+	ZuobiaoId             string    `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
381
+	Bck01b	 string    `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
382
+	Bby01             string    `gorm:"column:bby01" json:"bby01" form:"bby01"`
383
+
371
 }
384
 }
372
 
385
 
373
 func (HisProject) TableName() string {
386
 func (HisProject) TableName() string {
507
 	DeliveryWay        string           `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
520
 	DeliveryWay        string           `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
508
 	ExecutionFrequency string           `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
521
 	ExecutionFrequency string           `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
509
 	Day                string           `gorm:"column:day" json:"day" form:"day"`
522
 	Day                string           `gorm:"column:day" json:"day" form:"day"`
523
+	StartTime                int64           `gorm:"column:start_time" json:"start_time" form:"start_time"`
524
+
525
+
510
 	HisProject         HisProject       `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
526
 	HisProject         HisProject       `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
511
 	GoodInfo           GoodInfo         `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
527
 	GoodInfo           GoodInfo         `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
512
 	Type               int64            `gorm:"column:type" json:"type" form:"type"`
528
 	Type               int64            `gorm:"column:type" json:"type" form:"type"`
877
 	MdtrtareaAdmvs string `gorm:"column:mdtrtarea_admvs" json:"mdtrtarea_admvs" form:"mdtrtarea_admvs"`
893
 	MdtrtareaAdmvs string `gorm:"column:mdtrtarea_admvs" json:"mdtrtarea_admvs" form:"mdtrtarea_admvs"`
878
 	InsuplcAdmdvs  string `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
894
 	InsuplcAdmdvs  string `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
879
 	SecretKey      string `gorm:"column:secret_key" json:"secret_key" form:"secret_key"`
895
 	SecretKey      string `gorm:"column:secret_key" json:"secret_key" form:"secret_key"`
880
-	Url            string `gorm:"column:url" json:"url" form:"url"`
896
+Url            string `gorm:"column:url" json:"url" form:"url"`
881
 	AccessKey      string `gorm:"column:access_key" json:"access_key" form:"access_key"`
897
 	AccessKey      string `gorm:"column:access_key" json:"access_key" form:"access_key"`
882
 	Cainfo         string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
898
 	Cainfo         string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
883
 	AppSecret      string `gorm:"column:app_secret" json:"app_secret" form:"app_secret"`
899
 	AppSecret      string `gorm:"column:app_secret" json:"app_secret" form:"app_secret"`
1049
 	MdtrtId          string
1065
 	MdtrtId          string
1050
 	SetlId           string
1066
 	SetlId           string
1051
 	StasType         string
1067
 	StasType         string
1068
+
1052
 }
1069
 }
1053
 
1070
 
1054
 type BusinessParamsTwo struct {
1071
 type BusinessParamsTwo struct {
1069
 	SetlId           string
1086
 	SetlId           string
1070
 }
1087
 }
1071
 
1088
 
1089
+
1090
+type BusinessParams5262 struct {
1091
+	RefdSetlFlag         string
1092
+	QBegntime         	 string
1093
+	QEndtime      		 string
1094
+	MedType   			 string
1095
+	PageNum     		 string
1096
+	PageSize      		 string
1097
+	Certno     			 string
1098
+	Psnno    			 string
1099
+
1100
+}
1101
+
1102
+
1072
 type Custom struct {
1103
 type Custom struct {
1073
 	DetItemFeeSumamt string
1104
 	DetItemFeeSumamt string
1074
 	Cut              string
1105
 	Cut              string
1661
 	Type             int64
1692
 	Type             int64
1662
 	AdviceId         int64
1693
 	AdviceId         int64
1663
 	ProjectId        int64
1694
 	ProjectId        int64
1664
-	ItemId           int64
1695
+	ItemId           string
1696
+	StartTime        string
1697
+	Content string
1698
+	Bby01             string
1699
+
1665
 }
1700
 }
1666
 
1701
 
1702
+type ChargeList struct {
1703
+	Bby01 			string
1704
+	Vaj25              string
1705
+	Bbx01              string
1706
+	Vaf21              string
1707
+	Vaf22              string
1708
+	Vaf42              string
1709
+
1710
+
1711
+}
1712
+
1713
+
1714
+type ChargeListtwo struct {
1715
+	Bby01 			string
1716
+	Vaj25              string
1717
+
1718
+}
1667
 type UploadInfo struct {
1719
 type UploadInfo struct {
1668
 	Bce02a   string `json:"bce02a"`
1720
 	Bce02a   string `json:"bce02a"`
1721
+	Acf01   int64 `json:"acf01"`
1722
+	Bce01   string `json:"bce01"`
1723
+	Bck01   string `json:"bck01"`
1724
+	ChargeList []ChargeList `json:"chargeList"`
1725
+	ChargeListtwo []ChargeListtwo `json:"chargeList"`
1726
+
1727
+	Bce01a   string `json:"bce01a"`
1728
+
1669
 	Bck01c   string `json:"bck01c"`
1729
 	Bck01c   string `json:"bck01c"`
1730
+	Bck01a   string `json:"bck01a"`
1731
+
1670
 	Diag     []*Diag
1732
 	Diag     []*Diag
1671
 	Fasong   string `json:"fasong"`
1733
 	Fasong   string `json:"fasong"`
1672
 	PresInfo []*PresInfo
1734
 	PresInfo []*PresInfo
1673
-	Vaa01    int64 `json:"vaa01"`
1735
+	Vaa01    int64 `json:"bby01"`
1674
 	Vaa07    int64 `json:"vaa07"`
1736
 	Vaa07    int64 `json:"vaa07"`
1737
+	Vaa05    string `json:"vaa05"`
1738
+
1739
+
1675
 }
1740
 }
1676
 
1741
 
1677
 type Diag struct {
1742
 type Diag struct {
1830
 func (NewHisOrder111) TableName() string {
1895
 func (NewHisOrder111) TableName() string {
1831
 	return "his_order"
1896
 	return "his_order"
1832
 }
1897
 }
1898
+
1899
+
1900
+type Root2 struct {
1901
+	XMLName    xml.Name   `xml:"Root"`
1902
+	TradeInfo  TradeInfo  `xml:"tradeinfo"`
1903
+
1904
+	VAF1       VAF10       `xml:"VAF1"`
1905
+
1906
+}
1907
+
1908
+
1909
+type Root struct {
1910
+	XMLName    xml.Name   `xml:"Root"`
1911
+	TradeInfo  TradeInfo  `xml:"tradeinfo"`
1912
+	CBM1       CBM1       `xml:"CBM1"`
1913
+	VAF1       VAF1       `xml:"VAF1"`
1914
+	VAO1       VAO1       `xml:"VAO1"`
1915
+	VBQ1       VBQ1       `xml:"VBQ1"`
1916
+}
1917
+
1918
+type TradeInfo struct {
1919
+	Type      int    `xml:"type"`
1920
+	PatSource int    `xml:"pat_source"`
1921
+	Detpid    string `xml:"detpid"`
1922
+	Empid     string `xml:"empid"`
1923
+	Empno     string `xml:"empno"`
1924
+	Empname   string `xml:"empname"`
1925
+}
1926
+
1927
+type CBM1 struct {
1928
+	Ie []IEone `xml:"Ie"`
1929
+}
1930
+
1931
+type VAF1 struct {
1932
+	Ie []IEtwo `xml:"Ie"`
1933
+}
1934
+
1935
+type VAO1 struct {
1936
+	Ie []IEthree `xml:"Ie"`
1937
+}
1938
+
1939
+type VBQ1 struct {
1940
+	Ie []IEfour `xml:"Ie"`
1941
+}
1942
+
1943
+type VAF10 struct {
1944
+	Ie []IEfive `xml:"Ie"`
1945
+}
1946
+
1947
+type IEone struct {
1948
+	CBMID  string `xml:"CBMID,attr"`
1949
+	VAA01  string `xml:"VAA01,attr"`
1950
+	VAA07  string `xml:"VAA07,attr"`
1951
+	ACF01  string `xml:"ACF01,attr"`
1952
+	CBM06  string `xml:"CBM06,attr"`
1953
+	CBM07  string `xml:"CBM07,attr"`
1954
+	BCK01A string `xml:"BCK01A,attr"`
1955
+	BCK01B string `xml:"BCK01B,attr"`
1956
+	BCK01C string `xml:"BCK01C,attr"`
1957
+	CBM19  string `xml:"CBM19,attr"`
1958
+
1959
+}
1960
+type IEtwo struct {
1961
+	CBMID  string `xml:"CBMID,attr"`
1962
+	VAF04  string `xml:"VAF04,attr"`
1963
+	VAA01  string `xml:"VAA01,attr"`
1964
+	VAF06  string `xml:"VAF06,attr"`
1965
+	BCK01A string `xml:"BCK01A,attr"`
1966
+	ROWNR  string `xml:"ROWNR,attr"`
1967
+	VAF10  string `xml:"VAF10,attr"`
1968
+	VAF11  string `xml:"VAF11,attr"`
1969
+	BDA01  string `xml:"BDA01,attr"`
1970
+	BBX01  string `xml:"BBX01,attr"`
1971
+	VAF14  string `xml:"VAF14,attr"`
1972
+	VAF15  string `xml:"VAF15,attr"`
1973
+	BBY01  string `xml:"BBY01,attr"`
1974
+	VAF17  string `xml:"VAF17,attr"`
1975
+	VAF18  string `xml:"VAF18,attr"`
1976
+	VAF19  string `xml:"VAF19,attr"`
1977
+	VAF20  string `xml:"VAF20,attr"`
1978
+	VAF21  string `xml:"VAF21,attr"`
1979
+	VAF22  string `xml:"VAF22,attr"`
1980
+	Crypt  string `xml:"Crypt,attr"`
1981
+	VAF23  string `xml:"VAF23,attr"`
1982
+	BCK01B string `xml:"BCK01B,attr"`
1983
+	VAF26  string `xml:"VAF26,attr"`
1984
+	VAF27  string `xml:"VAF27,attr"`
1985
+	VAF28  string `xml:"VAF28,attr"`
1986
+	VAF29  string `xml:"VAF29,attr"`
1987
+	VAF30  string `xml:"VAF30,attr"`
1988
+	VAF31  string `xml:"VAF31,attr"`
1989
+	VAF32  string `xml:"VAF32,attr"`
1990
+	VAF33  string `xml:"VAF33,attr"`
1991
+	VAF34  string `xml:"VAF34,attr"`
1992
+	VAF35  string `xml:"VAF35,attr"`
1993
+	VAF36  string `xml:"VAF36,attr"`
1994
+	VAF37  string `xml:"VAF37,attr"`
1995
+	BCE02A  string `xml:"BCE02A,attr"`
1996
+	BCE03A  string `xml:"BCE03A,attr"`
1997
+	BCE03B  string `xml:"BCE03B,attr"`
1998
+	VAF53  string `xml:"VAF53,attr"`
1999
+	VAF55  string `xml:"VAF55,attr"`
2000
+	BCK01D  string `xml:"BCK01D,attr"`
2001
+	VAF58  string `xml:"VAF58,attr"`
2002
+	VAF59  string `xml:"VAF59,attr"`
2003
+	VAF60  string `xml:"VAF60,attr"`
2004
+	VAF61  string `xml:"VAF61,attr"`
2005
+	VAF62  string `xml:"VAF62,attr"`
2006
+	LSign  string `xml:"lSign,attr"`
2007
+	BDA01A  string `xml:"BDA01A,attr"`
2008
+	LRoute  string `xml:"lRoute,attr"`
2009
+	BCE01A  string `xml:"BCE01A,attr"`
2010
+	BCE01B  string `xml:"BCE01B,attr"`
2011
+	VAF01B  string `xml:"VAF01B,attr"`
2012
+	VCO01  string `xml:"VCO01,attr"`
2013
+	BCE01H  string `xml:"BCE01H,attr"`
2014
+	BCE03H  string `xml:"BCE03H,attr"`
2015
+	BIW02  string `xml:"BIW02,attr"`
2016
+	RCurrent  string `xml:"rCurrent,attr"`
2017
+	FCheck  string `xml:"FCheck,attr"`
2018
+	UnameA  string `xml:"UnameA,attr"`
2019
+	VEH02  string `xml:"VEH02,attr"`
2020
+	BCK01C  string `xml:"BCK01C,attr"`
2021
+
2022
+
2023
+
2024
+
2025
+}
2026
+type IEthree struct {
2027
+	CBMID  string `xml:"CBMID,attr"`
2028
+	VAA01  string `xml:"VAA01,attr"`
2029
+	VAA07  string `xml:"VAA07,attr"`
2030
+	ACF01  string `xml:"ACF01,attr"`
2031
+
2032
+	VAO06  string `xml:"VAO06,attr"`
2033
+	VAO07  string `xml:"VAO07,attr"`
2034
+	VAO10  string `xml:"VAO10,attr"`
2035
+	VAO11  string `xml:"VAO11,attr"`
2036
+	BAK01A  string `xml:"BAK01A,attr"`
2037
+	CAM01  string `xml:"CAM01,attr"`
2038
+	VAO15  string `xml:"VAO15,attr"`
2039
+	VAO18  string `xml:"VAO18,attr"`
2040
+	VAO22  string `xml:"VAO22,attr"`
2041
+	IAA01  string `xml:"IAA01,attr"`
2042
+	IAD03  string `xml:"IAD03,attr"`
2043
+	BAK01B  string `xml:"BAK01B,attr"`
2044
+	VAO26  string `xml:"VAO26,attr"`
2045
+	IAD04  string `xml:"IAD04,attr"`
2046
+	IAD01  string `xml:"IAD01,attr"`
2047
+	VAO25  string `xml:"VAO25,attr"`
2048
+	VAO35  string `xml:"VAO35,attr"`
2049
+
2050
+
2051
+}
2052
+type IEfour struct {
2053
+	VBQ01  string `xml:"VBQ01,attr"`
2054
+	VAA01  string `xml:"VAA01,attr"`
2055
+	VAA07  string `xml:"VAA07,attr"`
2056
+	ACF01  string `xml:"ACF01,attr"`
2057
+	VAP01  string `xml:"VAP01,attr"`
2058
+	VBQ07  string `xml:"VBQ07,attr"`
2059
+	BCK01A string `xml:"BCK01A,attr"`
2060
+	BCK01B string `xml:"BCK01B,attr"`
2061
+	BCE03A  string `xml:"BCE03A,attr"`
2062
+	BCE01A  string `xml:"BCE01A,attr"`
2063
+	VBQ27  string `xml:"VBQ27,attr"`
2064
+	VBQ28  string `xml:"VBQ28,attr"`
2065
+	VBQ29  string `xml:"VBQ29,attr"`
2066
+	VBQ30  string `xml:"VBQ30,attr"`
2067
+
2068
+
2069
+}
2070
+type IEfive struct {
2071
+	VAF01  string `xml:"VAF01,attr"`
2072
+
2073
+}
2074
+
2075
+
2076
+func main() {
2077
+	data := `YOUR_XML_CONTENT_HERE`
2078
+
2079
+	var root Root
2080
+	err := xml.Unmarshal([]byte(data), &root)
2081
+	if err != nil {
2082
+		fmt.Println("错误:", err)
2083
+		return
2084
+	}
2085
+
2086
+	fmt.Printf("%+v\n", root)
2087
+}
2088
+
2089
+
2090
+
2091
+
2092
+
2093
+
2094
+

+ 25 - 0
models/zuobiao_models.go View File

1
+package models
2
+
3
+
4
+
5
+
6
+type HisZuobiaoAdvice struct {
7
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
8
+	AdviceRequestLog string `gorm:"column:advice_request_log" json:"advice_request_log" form:"advice_request_log"`
9
+	AdviceResultLog string `gorm:"column:advice_result_log" json:"advice_result_log" form:"advice_result_log"`
10
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
11
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
12
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
13
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
14
+	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
15
+	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
16
+	SettleRequestLog string `gorm:"column:settle_request_log" json:"settle_request_log" form:"settle_request_log"`
17
+	SettleResultLog string `gorm:"column:settle_result_log" json:"settle_result_log" form:"settle_result_log"`
18
+	Cbm01 string `gorm:"column:cbm01" json:"cbm01" form:"cbm01"`
19
+	AdiviceIds string `gorm:"column:adivice_ids" json:"adivice_ids" form:"adivice_ids"`
20
+}
21
+
22
+
23
+func (HisZuobiaoAdvice) TableName() string {
24
+	return "his_zuobiao_advice"
25
+}

File diff suppressed because it is too large
+ 931 - 31
service/coordinate_service.go


+ 110 - 19
service/dianzichufang.go View File

12
 	"time"
12
 	"time"
13
 )
13
 )
14
 
14
 
15
-func GetCFYLJG001(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG001 models.CFYLJG001) (string, string) {
15
+func GetCFYLJG001(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG001 models.CFYLJG001,isu string) (string, string) {
16
 	//生成签名
16
 	//生成签名
17
 	nonce := GetRandomString(32)
17
 	nonce := GetRandomString(32)
18
 	timestamp := time.Now().Unix()
18
 	timestamp := time.Now().Unix()
94
 
94
 
95
 		rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
95
 		rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
96
 		rxdrug["hosp_appr_flag"] = item.HospApprFlag
96
 		rxdrug["hosp_appr_flag"] = item.HospApprFlag
97
-		rxdrug["extras"] = item.Extras
97
+		//rxdrug["extras"] = ""
98
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
98
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
99
 	}
99
 	}
100
 	inputData["rxdrugdetail"] = rxdrugdetail
100
 	inputData["rxdrugdetail"] = rxdrugdetail
145
 	mdtrtinfo["rgst_fee"] = cFYLJG001.Mdtrtinfo.RgstFee
145
 	mdtrtinfo["rgst_fee"] = cFYLJG001.Mdtrtinfo.RgstFee
146
 	mdtrtinfo["medfee_sumamt"] = cFYLJG001.Mdtrtinfo.MedfeeSumamt
146
 	mdtrtinfo["medfee_sumamt"] = cFYLJG001.Mdtrtinfo.MedfeeSumamt
147
 	mdtrtinfo["fstdiag_flag"] = cFYLJG001.Mdtrtinfo.FstdiagFlag
147
 	mdtrtinfo["fstdiag_flag"] = cFYLJG001.Mdtrtinfo.FstdiagFlag
148
-	mdtrtinfo["extras"] = cFYLJG001.Mdtrtinfo.Extras
148
+	type MyData struct {
149
+		Insutype string `json:"insutype"`
150
+	}
151
+	data := MyData{
152
+		Insutype: isu,
153
+	}
154
+
155
+	mdtrtinfo["extras"] = data
149
 	inputData["mdtrtinfo"] = mdtrtinfo
156
 	inputData["mdtrtinfo"] = mdtrtinfo
150
 
157
 
151
 	diseinfos := make([]map[string]interface{}, 0)
158
 	diseinfos := make([]map[string]interface{}, 0)
228
 	//生成输入报文
235
 	//生成输入报文
229
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
236
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
230
 	inputData := make(map[string]interface{})
237
 	inputData := make(map[string]interface{})
231
-	//inputData := makemap[string]interface{})
238
+	inputDatas := make(map[string]interface{})
232
 
239
 
233
 	inputMessage["infno"] = "CFYLJG002"
240
 	inputMessage["infno"] = "CFYLJG002"
234
 	inputData["fixmedins_code"] = fixmedins_code
241
 	inputData["fixmedins_code"] = fixmedins_code
235
 	inputData["original_value"] = original_value
242
 	inputData["original_value"] = original_value
236
 	inputData["original_rx_file"] = original_rx_file
243
 	inputData["original_rx_file"] = original_rx_file
237
 	inputData["extras"] = extras
244
 	inputData["extras"] = extras
238
-	inputMessage["rx_sign_info"] = inputData
245
+	inputDatas["rx_sign_info"] = inputData
246
+	inputMessage["input"] = inputDatas
239
 
247
 
240
 	var inputLog string
248
 	var inputLog string
241
 	bytesData, err := json.Marshal(inputMessage)
249
 	bytesData, err := json.Marshal(inputMessage)
295
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
303
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
296
 	//input := make(map[string]interface{})
304
 	//input := make(map[string]interface{})
297
 	inputData := make(map[string]interface{})
305
 	inputData := make(map[string]interface{})
306
+	inputData2 := make(map[string]interface{})
298
 
307
 
299
 	inputMessage["infno"] = "CFYLJG003"
308
 	inputMessage["infno"] = "CFYLJG003"
300
 
309
 
321
 	inputData["phar_chk_time"] = cFYLJG003.PharChkTime
330
 	inputData["phar_chk_time"] = cFYLJG003.PharChkTime
322
 	inputData["rx_file"] = cFYLJG003.RxFile
331
 	inputData["rx_file"] = cFYLJG003.RxFile
323
 	inputData["sign_digest"] = cFYLJG003.SignDigest
332
 	inputData["sign_digest"] = cFYLJG003.SignDigest
324
-	inputMessage["rx_upload_info"] = inputData
333
+	inputData2["rx_upload_info"] = inputData
334
+	inputMessage["input"] = inputData2
325
 	var inputLog string
335
 	var inputLog string
326
 	bytesData, err := json.Marshal(inputMessage)
336
 	bytesData, err := json.Marshal(inputMessage)
327
 	inputLog = string(bytesData)
337
 	inputLog = string(bytesData)
379
 	//生成输入报文
389
 	//生成输入报文
380
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
390
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
381
 	inputData := make(map[string]interface{})
391
 	inputData := make(map[string]interface{})
382
-	//inputDatas := make([]map[string]interface{}, 0)
392
+	inputData1 := make(map[string]interface{})
383
 
393
 
394
+	//inputDatas := make([]map[string]interface{}, 0)
384
 	inputMessage["infno"] = "CFYLJG004"
395
 	inputMessage["infno"] = "CFYLJG004"
385
-
386
 	inputData["hi_rxno"] = cFYLJG004.HiRxno
396
 	inputData["hi_rxno"] = cFYLJG004.HiRxno
387
 	inputData["undo_dr_code"] = cFYLJG004.UndoDrCode
397
 	inputData["undo_dr_code"] = cFYLJG004.UndoDrCode
388
 	inputData["undo_dr_name"] = cFYLJG004.UndoDrName
398
 	inputData["undo_dr_name"] = cFYLJG004.UndoDrName
391
 	inputData["undo_rea"] = cFYLJG004.UndoRea
401
 	inputData["undo_rea"] = cFYLJG004.UndoRea
392
 	inputData["undo_time"] = cFYLJG004.UndoTime
402
 	inputData["undo_time"] = cFYLJG004.UndoTime
393
 	inputData["fixmedins_code"] = cFYLJG004.FixmedinsCode
403
 	inputData["fixmedins_code"] = cFYLJG004.FixmedinsCode
394
-
395
-	inputMessage["rx_cancel_info"] = inputData
404
+	inputData1["rx_cancel_info"] = inputData
405
+	inputMessage["input"] = inputData1
396
 	var inputLog string
406
 	var inputLog string
397
 	bytesData, err := json.Marshal(inputMessage)
407
 	bytesData, err := json.Marshal(inputMessage)
398
 	inputLog = string(bytesData)
408
 	inputLog = string(bytesData)
449
 	signature := setSignature(timestamp, nonce, secret_key)
459
 	signature := setSignature(timestamp, nonce, secret_key)
450
 	//生成输入报文
460
 	//生成输入报文
451
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
461
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
462
+
463
+
452
 	inputData := make(map[string]interface{})
464
 	inputData := make(map[string]interface{})
465
+
466
+	inputData2 := make(map[string]interface{})
453
 	//inputDatas := make([]map[string]interface{}, 0)
467
 	//inputDatas := make([]map[string]interface{}, 0)
454
 
468
 
455
 	inputMessage["infno"] = "CFYLJG005"
469
 	inputMessage["infno"] = "CFYLJG005"
456
 
470
 
457
-	inputData["fixmedins_code"] = cFYLJG005.FixmedinsCode
471
+	inputData["fixmedins_code"] = fixmedins_code
458
 
472
 
459
 	inputData["hi_rxno"] = cFYLJG005.HiRxno
473
 	inputData["hi_rxno"] = cFYLJG005.HiRxno
460
 	inputData["mdtrt_id"] = cFYLJG005.MdtrtID
474
 	inputData["mdtrt_id"] = cFYLJG005.MdtrtID
462
 	inputData["psn_name"] = cFYLJG005.PsnName
476
 	inputData["psn_name"] = cFYLJG005.PsnName
463
 	inputData["psn_cert_type"] = cFYLJG005.PsnCertType
477
 	inputData["psn_cert_type"] = cFYLJG005.PsnCertType
464
 	inputData["certno"] = cFYLJG005.Certno
478
 	inputData["certno"] = cFYLJG005.Certno
465
-
466
-	inputMessage["rx_detl_query"] = inputData
479
+	inputData2["rx_detl_query"]  = inputData
480
+	inputMessage["input"] = inputData2
467
 	var inputLog string
481
 	var inputLog string
468
 	bytesData, err := json.Marshal(inputMessage)
482
 	bytesData, err := json.Marshal(inputMessage)
469
 	inputLog = string(bytesData)
483
 	inputLog = string(bytesData)
512
 	return str, inputLog
526
 	return str, inputLog
513
 
527
 
514
 }
528
 }
515
-
516
 func GetCFYLJG006(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG006 models.CFYLJG006) (string, string) {
529
 func GetCFYLJG006(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG006 models.CFYLJG006) (string, string) {
517
 	//生成签名
530
 	//生成签名
518
 	nonce := GetRandomString(32)
531
 	nonce := GetRandomString(32)
522
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
535
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
523
 	inputData := make(map[string]interface{})
536
 	inputData := make(map[string]interface{})
524
 	//inputDatas := make([]map[string]interface{}, 0)
537
 	//inputDatas := make([]map[string]interface{}, 0)
538
+	inputData2 := make(map[string]interface{})
525
 
539
 
526
 	inputMessage["infno"] = "CFYLJG006"
540
 	inputMessage["infno"] = "CFYLJG006"
527
 
541
 
528
-	inputData["fixmedins_code"] = cFYLJG006.FixmedinsCode
542
+	inputData["fixmedins_code"] = fixmedins_code
529
 	inputData["hi_rxno"] = cFYLJG006.HiRxno
543
 	inputData["hi_rxno"] = cFYLJG006.HiRxno
530
 	inputData["mdtrt_id"] = cFYLJG006.MdtrtID
544
 	inputData["mdtrt_id"] = cFYLJG006.MdtrtID
531
 	inputData["psn_cert_type"] = cFYLJG006.PsnCertType
545
 	inputData["psn_cert_type"] = cFYLJG006.PsnCertType
532
 	inputData["certno"] = cFYLJG006.Certno
546
 	inputData["certno"] = cFYLJG006.Certno
533
 	inputData["psn_name"] = cFYLJG006.PsnName
547
 	inputData["psn_name"] = cFYLJG006.PsnName
534
-
535
-	inputMessage["rx_chk_info"] = inputData
548
+	inputData2["rx_chk_info"] =inputData
549
+	inputMessage["input"] = inputData2
536
 	var inputLog string
550
 	var inputLog string
537
 	bytesData, err := json.Marshal(inputMessage)
551
 	bytesData, err := json.Marshal(inputMessage)
538
 	inputLog = string(bytesData)
552
 	inputLog = string(bytesData)
589
 	//生成输入报文
603
 	//生成输入报文
590
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
604
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
591
 	inputData := make(map[string]interface{})
605
 	inputData := make(map[string]interface{})
606
+	inputData2 := make(map[string]interface{})
607
+
592
 	//inputDatas := make([]map[string]interface{}, 0)
608
 	//inputDatas := make([]map[string]interface{}, 0)
593
 
609
 
594
 	inputMessage["infno"] = "CFYLJG007"
610
 	inputMessage["infno"] = "CFYLJG007"
595
 
611
 
596
-	inputData["fixmedins_code"] = cFYLJG007.FixmedinsCode
612
+	inputData["fixmedins_code"] = fixmedins_code
597
 	inputData["hi_rxno"] = cFYLJG007.HiRxno
613
 	inputData["hi_rxno"] = cFYLJG007.HiRxno
598
 	inputData["mdtrt_id"] = cFYLJG007.MdtrtID
614
 	inputData["mdtrt_id"] = cFYLJG007.MdtrtID
599
 	inputData["psn_no"] = cFYLJG007.PsnNo
615
 	inputData["psn_no"] = cFYLJG007.PsnNo
600
 	inputData["psn_cert_type"] = cFYLJG007.PsnCertType
616
 	inputData["psn_cert_type"] = cFYLJG007.PsnCertType
601
 	inputData["certno"] = cFYLJG007.Certno
617
 	inputData["certno"] = cFYLJG007.Certno
618
+	inputData["psn_name"] = cFYLJG007.PsnName
619
+
620
+	inputData2["rx_setl_query"] = inputData
621
+
622
+	inputMessage["input"] = inputData2
623
+	var inputLog string
624
+	bytesData, err := json.Marshal(inputMessage)
625
+	inputLog = string(bytesData)
626
+	fmt.Println(string(bytesData))
627
+	if err != nil {
628
+		fmt.Println(err.Error())
629
+		return err.Error(), ""
630
+	}
631
+	reader := bytes.NewReader(bytesData)
632
+	gdyb_url := beego.AppConfig.String("gdyb_url")
633
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
602
 
634
 
603
-	inputMessage["rx_setl_query"] = inputData
635
+	var url string
636
+	if fixmedins_code == "H15049901371" {
637
+		url = gdyb_url
638
+	} else {
639
+		url = gdyb_url + "CFYLJG007"
640
+	}
641
+
642
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
643
+	request, err := http.NewRequest("POST", url, reader)
644
+	if err != nil {
645
+		fmt.Println(err.Error())
646
+		return err.Error(), ""
647
+	}
648
+
649
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
650
+	request.Header.Set("x-tif-paasid", gdyb_paasid)
651
+	request.Header.Set("x-tif-signature", signature)
652
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
653
+	request.Header.Set("x-tif-nonce", nonce)
654
+
655
+	client := http.Client{}
656
+	resp, err := client.Do(request)
657
+	if err != nil {
658
+		fmt.Println(err.Error())
659
+		return err.Error(), ""
660
+	}
661
+	respBytes, err := ioutil.ReadAll(resp.Body)
662
+	if err != nil {
663
+		fmt.Println(err.Error())
664
+		return err.Error(), ""
665
+	}
666
+	fmt.Println(string(respBytes))
667
+	str := string(respBytes)
668
+	return str, inputLog
669
+
670
+}
671
+func GetCFYLJG008(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG008 models.CFYLJG008) (string, string) {
672
+	//生成签名
673
+	nonce := GetRandomString(32)
674
+	timestamp := time.Now().Unix()
675
+	signature := setSignature(timestamp, nonce, secret_key)
676
+	//生成输入报文
677
+	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
678
+	inputData := make(map[string]interface{})
679
+	//inputData2 := make(map[string]interface{})
680
+
681
+	//inputDatas := make([]map[string]interface{}, 0)
682
+
683
+	inputMessage["infno"] = "CFYLJG008"
684
+
685
+	inputData["pageNum"] = cFYLJG008.PageNum
686
+	inputData["pageSize"] = cFYLJG008.PageSize
687
+	inputData["orderType"] = cFYLJG008.OrderType
688
+	inputData["poolareaNo"] = cFYLJG008.PoolareaNo
689
+	inputData["fixmedinsName"] = cFYLJG008.FixmedinsName
690
+	inputData["lng"] = cFYLJG008.Lng
691
+	inputData["lat"] = cFYLJG008.Lat
692
+	inputData["medinsProdInvChgDDTOList"] = cFYLJG008.MedList
693
+
694
+	inputMessage["input"] = inputData
604
 	var inputLog string
695
 	var inputLog string
605
 	bytesData, err := json.Marshal(inputMessage)
696
 	bytesData, err := json.Marshal(inputMessage)
606
 	inputLog = string(bytesData)
697
 	inputLog = string(bytesData)

+ 209 - 0
service/fj_service.go View File

1842
 	return str
1842
 	return str
1843
 }
1843
 }
1844
 
1844
 
1845
+func Fjyb4101(struct4101 Struct4101, params models.PublicParams) (string, string, string) {
1846
+	timestamp := time.Now().Unix()
1847
+	inputMessage := SetHnInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
1848
+	// 生成输入报文
1849
+	input := make(map[string]interface{})
1850
+	inputData := make(map[string]interface{})
1851
+	inputMessage["infno"] = "4101A" // 交易编码
1852
+	year := time.Now().Format("2006")
1853
+	month := time.Now().Format("01")
1854
+	day := time.Now().Format("02")
1855
+
1856
+	inputData["mdtrt_id"] = struct4101.MdtrtId // 就诊 ID  必填(来自2201接口返回)
1857
+	inputData["setl_id"] = struct4101.SetlId   // 结算 ID  必填
1858
+	inputData["psn_no"] = struct4101.PsnNo     // 结算 ID  必填
1859
+
1860
+	inputData["fixmedins_name"] = params.FixmedinsName      // 定点医药机构名称  必填
1861
+	inputData["fixmedins_code"] = params.FixmedinsCode      // 定点医药机构编码  必填
1862
+	inputData["hi_setl_lv"] = ""                            // 医保结算等级
1863
+	inputData["hi_no"] = struct4101.PsnNo                   // 医保编号
1864
+	inputData["medcasno"] = struct4101.PsnNo                // 病案号  必填
1865
+	inputData["dcla_time"] = year + "-" + month + "-" + day // 申报时间  必填
1866
+	inputData["psn_name"] = struct4101.PsnName              // 人员姓名  必填
1867
+	inputData["gend"] = struct4101.Gend                     // 性别  必填
1868
+	inputData["brdy"] = struct4101.Brdy                     // 出生日期  必填
1869
+	inputData["age"] = struct4101.Age                       // 年龄  必填
1870
+	inputData["ntly"] = struct4101.Ntly                     // 国籍  必填
1871
+
1872
+
1873
+	inputData["nwb_age"] = ""                                 // 年龄  必填
1874
+	inputData["naty"] = struct4101.Naty                       // 民族  必填
1875
+	inputData["patn_cert_type"] = struct4101.PatnCertType     // 患者证件类别  必填
1876
+	inputData["certno"] = struct4101.Certno                   // 证件号码  必填
1877
+	inputData["prfs"] = struct4101.Prfs                       // 职业  必填
1878
+	inputData["curr_addr"] = ""                               // 现住址  必填
1879
+	inputData["emp_name"] = ""                                // 单位名称  必填
1880
+	inputData["emp_addr"] = ""                                // 单位地址  必填
1881
+	inputData["emp_tel"] = ""                                 // 单位电话  必填
1882
+	inputData["poscode"] = ""                                 // 邮编  必填
1883
+	inputData["coner_name"] = ""           // 联系人姓名  必填
1884
+	inputData["patn_rlts"] = ""              // 与患者关系  必填
1885
+	inputData["coner_addr"] = ""            // 联系人地址  必填
1886
+	inputData["coner_tel"] = ""              // 联系人电话  必填
1887
+	inputData["hi_type"] = struct4101.HiType                  // 医保类型  必填
1888
+	inputData["insuplc"] = struct4101.Insuplc                 // 参保地  必填
1889
+	inputData["sp_psn_type"] = ""                             // 特殊人员类型  必填
1890
+	inputData["nwb_adm_type"] = ""                            // 新生儿入院类型  必填
1891
+	inputData["nwb_bir_wt"] = ""                              // 新生儿出生体重  必填
1892
+	inputData["nwb_adm_wt"] = ""                              // 新生儿入院体重  必填
1893
+	inputData["opsp_diag_caty"] = ""                          // 门诊慢特病诊断  必填
1894
+	inputData["opsp_mdtrt_date"] = ""                         // 门诊慢特病就诊日期  必填
1895
+	inputData["ipt_med_type"] = struct4101.IptMedType         // 住院医疗类型  必填
1896
+	inputData["adm_way"] = ""                                 // 入院途径  必填
1897
+	inputData["trt_type"] = ""                                // 治疗类别  必填
1898
+	inputData["adm_time"] = struct4101.AdmTime                // 入院时间  必填
1899
+	inputData["adm_caty"] = struct4101.AdmCaty                // 入院科别  必填
1900
+	inputData["refldept_dept"] = ""                           // 转科科别  必填
1901
+	inputData["dscg_time"] = struct4101.AdmEndTime            // 出院时间  必填
1902
+	inputData["dscg_caty"] = struct4101.AdmCaty               // 出院科别  必填
1903
+	inputData["act_ipt_days"] = ""                            // 实际住院天数  必填
1904
+	inputData["otp_wm_dise"] = ""                             // 门(急) 诊西医诊断  必填
1905
+	inputData["wm_dise_code"] = ""                            // 门(急) 诊中医诊断  必填
1906
+	inputData["otp_tcm_dise"] = ""                            // 西医诊断疾病代码  必填
1907
+	inputData["tcm_dise_code"] = ""                           // 中医诊断代码  必填
1908
+	inputData["oprn_oprt_code_cnt"] = ""                      // 手术操作代码计数  必填
1909
+	inputData["vent_used_dura"] = ""                          // 呼吸机使用时长  必填
1910
+	inputData["pwcry_bfadm_coma_dura"] = ""                   // 颅脑损伤患者入院前昏迷时长  必填
1911
+	inputData["pwcry_afadm_coma_dura"] = ""                   // 颅脑损伤患者入院后昏迷时长  必填
1912
+	inputData["bld_cat"] = ""                                 // 输血品种  必填
1913
+	inputData["bld_amt"] = ""                                 // 输血量  必填
1914
+	inputData["bld_unt"] = ""                                 // 输血计量单位  必填
1915
+	inputData["spga_nurscare_days"] = ""                      // 特级护理天数  必填
1916
+	inputData["lv1_nurscare_days"] = ""                       // 一级护理天数  必填
1917
+	inputData["scd_nurscare_days"] = ""                       // 二级护理天数  必填
1918
+	inputData["lv3_nurscare_days"] = ""                       // 三级护理天数  必填
1919
+	inputData["acp_medins_name"] = ""                         // 拟接收机构名称  必填
1920
+	inputData["acp_optins_code"] = ""                         // 拟接收机构代码  必填
1921
+	inputData["bill_code"] = struct4101.BillCode              // 票据代码  必填
1922
+	inputData["bill_no"] = struct4101.BillNo                  // 票据号码  必填
1923
+	inputData["biz_sn"] = struct4101.BizSn                    // 业务流水号  必填
1924
+	inputData["days_rinp_flag_31"] = ""                       // 出院 31 天内再住院计划标志  必填
1925
+	inputData["days_rinp_pup_31"] = ""                        // 出院 31 天内再住院目的  必填
1926
+	inputData["chfpdr_name"] = struct4101.DoctorName          // 主诊医师姓名  必填
1927
+	inputData["chfpdr_code"] = struct4101.DoctorCode          // 主诊医师代码  必填
1928
+	inputData["setl_begn_date"] = struct4101.SetlBegnDate     // 结算开始日期  必填
1929
+	inputData["setl_end_date"] = struct4101.SetlEndDate       // 结算结束日期  必填
1930
+	inputData["psn_selfpay"] = struct4101.PsnSelfPay          // 个人自付  必填
1931
+	inputData["psn_ownpay"] = struct4101.PsnOwnPay            // 个人自费  必填
1932
+	inputData["acct_pay"] = struct4101.AcctPay                // 个人账户支出  必填
1933
+	inputData["hi_paymtd"] = struct4101.HiPaymtd              // 医保支付方式  必填
1934
+	inputData["hsorg"] = struct4101.Hsorg                     // 医保机构  必填
1935
+	inputData["hsorg_opter"] = struct4101.HsorgOpter          // 医保机构经办人  必填
1936
+	inputData["medins_fill_dept"] = struct4101.MedinsFillDept // 医疗机构填报部门  必填
1937
+	inputData["medins_fill_psn"] = struct4101.MedinsFillPsn   // 医疗机构填报人  必填
1938
+	inputData["psn_cashpay"] = struct4101.PsnCashpay          // 医疗机构填报人  必填
1939
+
1940
+	payinfo := make([]map[string]interface{}, 0) // 基金支付信息
1941
+	for _, item := range struct4101.CustomStruct {
1942
+		payinfotemp := make(map[string]interface{})
1943
+		if item.FundPayType == "310100" || item.FundPayType == "310200" || item.FundPayType == "320100" || item.FundPayType == "330100" || item.FundPayType == "340100" || item.FundPayType == "350100" || item.FundPayType == "370100" || item.FundPayType == "390100" || item.FundPayType == "610100" || item.FundPayType == "640100" || item.FundPayType == "620100" {
1944
+			payinfotemp["fund_pay_type"] = item.FundPayType // 基金支付类型  必填
1945
+			payinfotemp["fund_payamt"] = item.FundPayamt    // 基金支付金额
1946
+			payinfo = append(payinfo, payinfotemp)
1947
+		}
1948
+	}
1949
+	opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
1950
+
1951
+	opspdiseinfotemp := make(map[string]interface{})
1952
+	opspdiseinfotemp["diag_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName      // 诊断名称  必填
1953
+	opspdiseinfotemp["diag_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode      // 诊断代码 必填
1954
+	opspdiseinfotemp["oprn_oprt_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName // 手术操作名称 必填
1955
+	opspdiseinfotemp["oprn_oprt_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode // 手术操作代码 必填
1956
+	opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
1957
+
1958
+	diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
1959
+	for _, item := range struct4101.Diseinfo {
1960
+		diseinfotemp := make(map[string]interface{})
1961
+		diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
1962
+		diseinfotemp["diag_type"] = item.DiagType         // 诊断类别  必填
1963
+		diseinfotemp["diag_code"] = item.DiagCode         // 诊断代码 必填
1964
+		diseinfotemp["diag_name"] = item.DiagName         // 诊断名称 必填
1965
+		diseinfotemp["adm_cond_type"] = "3"               // 入院病情类型 必填
1966
+		diseinfo = append(diseinfo, diseinfotemp)
1967
+	}
1968
+
1969
+	iteminfo := make([]map[string]interface{}, 0)
1970
+	for _, item := range struct4101.IteminfoStruct {
1971
+		iteminfotemp := make(map[string]interface{})
1972
+		iteminfotemp["med_chrgitm"] = item.MedChrgitm            // 医疗收费项目  必填
1973
+		iteminfotemp["amt"] = item.Amt                           // 金额 必填
1974
+		iteminfotemp["claa_sumfee"] = item.ClaaSumfee            // 甲类费用合计 必填
1975
+		iteminfotemp["clab_amt"] = item.ClabAmt                  // 乙类金额 必填
1976
+		iteminfotemp["fulamt_ownpay_amt"] = item.FulamtOwnpayAmt // 全自费金额 必填
1977
+		iteminfotemp["oth_amt"] = item.OthAmt                    // 其他金额 必填
1978
+		iteminfo = append(iteminfo, iteminfotemp)
1979
+	}
1980
+
1981
+	oprninfo := make([]map[string]interface{}, 0) // 手术操作信息
1982
+	oprninfotemp := make(map[string]interface{})
1983
+	oprninfotemp["oprn_oprt_type"] = "" // 手术操作类别  必填
1984
+	oprninfotemp["oprn_oprt_name"] = "" // 手术操作名称 必填
1985
+	oprninfotemp["oprn_oprt_code"] = "" // 手术操作代码 必填
1986
+	oprninfotemp["oprn_oprt_date"] = "" // 手术操作日期 必填
1987
+	oprninfotemp["anst_way"] = ""       // 麻醉方式 必填
1988
+	oprninfotemp["oper_dr_name"] = ""   // 术者医师姓名 必填
1989
+	oprninfotemp["oper_dr_code"] = ""   // 术者医师代码 必填
1990
+	oprninfotemp["anst_dr_name"] = ""   // 麻醉医师姓名 必填
1991
+	oprninfotemp["anst_dr_code"] = ""   // 麻醉医师代码 必填
1992
+	oprninfo = append(oprninfo, oprninfotemp)
1993
+
1994
+	icuinfo := make([]map[string]interface{}, 0) // 重症监护信息
1995
+	icuinfotemp := make(map[string]interface{})
1996
+	icuinfotemp["scs_cutd_ward_type"] = ""   // 重症监护病房类型  必填
1997
+	icuinfotemp["scs_cutd_inpool_time"] = "" // 重症监护进入时间 必填
1998
+	icuinfotemp["scs_cutd_exit_time"] = ""   // 重症监护退出时间 必填
1999
+	icuinfotemp["scs_cutd_sum_dura"] = ""    // 重症监护合计时长 必填
2000
+	icuinfo = append(icuinfo, icuinfotemp)
2001
+	input["setlinfo"] = inputData
2002
+	input["payinfo"] = payinfo
2003
+	input["opspdiseinfo"] = opspdiseinfo
2004
+	input["diseinfo"] = diseinfo
2005
+	input["iteminfo"] = iteminfo
2006
+
2007
+	inputMessage["input"] = input //交易输入
2008
+	bytesData, _ := json.Marshal(inputMessage)
2009
+	fmt.Println(string(bytesData))
2010
+	if err != nil {
2011
+		fmt.Println(err.Error())
2012
+		return err.Error(), "", ""
2013
+	}
2014
+
2015
+	var requestLog string
2016
+	requestLog = string(bytesData)
2017
+	enc := mahonia.NewEncoder("gbk")
2018
+	output, err_msg := GetFjBusinessHandleInfo([]byte(enc.ConvertString(string(bytesData))))
2019
+	return output, requestLog, err_msg
2020
+}
2021
+
2022
+func Fjyb4102(psn_no string,SetlId string, params models.PublicParams,stas_type string) (string, string, string) {
2023
+	timestamp := time.Now().Unix()
2024
+	inputMessage := SetHnInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
2025
+	// 生成输入报文
2026
+	input := make(map[string]interface{})
2027
+	input2 := make(map[string]interface{})
2028
+
2029
+	inputData := make(map[string]interface{})
2030
+	inputMessage["infno"] = "4102" // 交易编码
2031
+
2032
+
2033
+	inputData["setl_id"] = SetlId   // 结算 ID  必填
2034
+	inputData["psn_no"] = psn_no     // 结算 ID  必填
2035
+	inputData["stas_type"] = stas_type     // 结算 ID  必填
2036
+	input2["stastinfo"] = inputData
2037
+	input["data"] = input2
2038
+	inputMessage["input"] = input //交易输入
2039
+	bytesData, _ := json.Marshal(inputMessage)
2040
+	fmt.Println(string(bytesData))
2041
+	if err != nil {
2042
+		fmt.Println(err.Error())
2043
+		return err.Error(), "", ""
2044
+	}
2045
+
2046
+	var requestLog string
2047
+	requestLog = string(bytesData)
2048
+	enc := mahonia.NewEncoder("gbk")
2049
+	output, err_msg := GetFjBusinessHandleInfo([]byte(enc.ConvertString(string(bytesData))))
2050
+	return output, requestLog, err_msg
2051
+}
2052
+
2053
+
1845
 //
2054
 //
1846
 //func Hbyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string) string {
2055
 //func Hbyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string) string {
1847
 //	// 生成签名
2056
 //	// 生成签名

+ 411 - 18
service/gdyb_service.go View File

1753
 	inputMessage["infno"] = "3201"                                    // 交易编码
1753
 	inputMessage["infno"] = "3201"                                    // 交易编码
1754
 	inputData["insutype"] = businessParams.Insutype                   // 险种
1754
 	inputData["insutype"] = businessParams.Insutype                   // 险种
1755
 	inputData["clr_type"] = businessParams.ClrType                    // 就诊 ID(来自2201接口返回)
1755
 	inputData["clr_type"] = businessParams.ClrType                    // 就诊 ID(来自2201接口返回)
1756
+
1756
 	inputData["setl_optins"] = businessParams.SetlOptins              // 结算经办机构
1757
 	inputData["setl_optins"] = businessParams.SetlOptins              // 结算经办机构
1757
 	inputData["stmt_begndate"] = businessParams.StmtBegndate          // 对帐开始时间
1758
 	inputData["stmt_begndate"] = businessParams.StmtBegndate          // 对帐开始时间
1758
 	inputData["stmt_enddate"] = businessParams.StmtEnddate            //对帐结束时间
1759
 	inputData["stmt_enddate"] = businessParams.StmtEnddate            //对帐结束时间
2214
 	return str
2215
 	return str
2215
 }
2216
 }
2216
 
2217
 
2217
-func Gdyb3301(baseParams *models.BaseParams, name string, codg string, list_type_code string, start_time string, ent_time string, list_type string) string {
2218
+func Gdyb3301(baseParams models.BaseParams, name string, codg string, list_type_code string, start_time string, ent_time string, list_type string) string {
2218
 	// 生成签名
2219
 	// 生成签名
2219
 	nonce := GetRandomString(32)
2220
 	nonce := GetRandomString(32)
2220
 	timestamp := time.Now().Unix()
2221
 	timestamp := time.Now().Unix()
2923
 	inputData["ntly"] = struct4101.Ntly                     // 国籍  必填
2924
 	inputData["ntly"] = struct4101.Ntly                     // 国籍  必填
2924
 	inputData["nwb_age"] = ""                               // 年龄  必填
2925
 	inputData["nwb_age"] = ""                               // 年龄  必填
2925
 	inputData["naty"] = struct4101.Naty                     // 民族  必填
2926
 	inputData["naty"] = struct4101.Naty                     // 民族  必填
2926
-	if org_id == 10138 {
2927
-		inputData["dscg_way"] = "9" // 民族  必填
2928
 
2927
 
2929
-		inputData["resp_nurs_code"] = "N441623001432" // 民族  必填
2928
+	inputData["dscg_way"] = "9" // 民族  必填
2929
+
2930
+		//inputData["resp_nurs_code"] = "N441623001432" // 民族  必填
2931
+
2930
 
2932
 
2931
-	}
2932
 
2933
 
2933
 	inputData["patn_cert_type"] = struct4101.PatnCertType     // 患者证件类别  必填
2934
 	inputData["patn_cert_type"] = struct4101.PatnCertType     // 患者证件类别  必填
2934
 	inputData["certno"] = struct4101.Certno                   // 证件号码  必填
2935
 	inputData["certno"] = struct4101.Certno                   // 证件号码  必填
3008
 	opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
3009
 	opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
3009
 
3010
 
3010
 	opspdiseinfotemp := make(map[string]interface{})
3011
 	opspdiseinfotemp := make(map[string]interface{})
3011
-	opspdiseinfotemp["diag_name"] = struct4101.Diseinfo[len(struct4101.Diseinfo)-1].DiagName // 诊断名称  必填
3012
-	opspdiseinfotemp["diag_code"] = struct4101.Diseinfo[len(struct4101.Diseinfo)-1].DiagCode // 诊断代码 必填
3012
+	opspdiseinfotemp["diag_name"] = "慢性肾功能不全(血透治疗)" // 诊断名称  必填
3013
+	opspdiseinfotemp["diag_code"] ="N18.904" // 诊断代码 必填
3013
 	opspdiseinfotemp["oprn_oprt_name"] = "血液透析"                                              // 手术操作名称 必填
3014
 	opspdiseinfotemp["oprn_oprt_name"] = "血液透析"                                              // 手术操作名称 必填
3014
 	opspdiseinfotemp["oprn_oprt_code"] = "39.9500"                                           // 手术操作代码 必填
3015
 	opspdiseinfotemp["oprn_oprt_code"] = "39.9500"                                           // 手术操作代码 必填
3015
 	opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
3016
 	opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
3016
 
3017
 
3017
 	diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
3018
 	diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
3018
-	//for _, item := range struct4101.Diseinfo {
3019
-	//	diseinfotemp := make(map[string]interface{})
3020
-	//	diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
3021
-	//	diseinfotemp["diag_type"] = item.DiagType         // 诊断类别  必填
3022
-	//	diseinfotemp["diag_code"] = item.DiagCode         // 诊断代码 必填
3023
-	//	diseinfotemp["diag_name"] = item.DiagName         // 诊断名称 必填
3024
-	//	diseinfotemp["adm_cond_type"] = "3"               // 入院病情类型 必填
3025
-	//	diseinfo = append(diseinfo, diseinfotemp)
3026
-	//}
3019
+	for _, item := range struct4101.Diseinfo {
3020
+		diseinfotemp := make(map[string]interface{})
3021
+		diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
3022
+		diseinfotemp["diag_type"] = item.DiagType         // 诊断类别  必填
3023
+		diseinfotemp["diag_code"] = item.DiagCode         // 诊断代码 必填
3024
+		diseinfotemp["diag_name"] = item.DiagName         // 诊断名称 必填
3025
+		diseinfotemp["adm_cond_type"] = "3"               // 入院病情类型 必填
3026
+		diseinfo = append(diseinfo, diseinfotemp)
3027
+	}
3027
 
3028
 
3028
 	iteminfo := make([]map[string]interface{}, 0)
3029
 	iteminfo := make([]map[string]interface{}, 0)
3029
 	for _, item := range struct4101.IteminfoStruct {
3030
 	for _, item := range struct4101.IteminfoStruct {
4962
 
4963
 
4963
 		}
4964
 		}
4964
 		//for _, item := range result3260.Output.Data[start-1 : stop] {
4965
 		//for _, item := range result3260.Output.Data[start-1 : stop] {
4966
+		//	if item.MdtrtId == "out202306301104036" {
4967
+		//		feedetailInfo := make(map[string]interface{})
4968
+		//		feedetailInfo["certno"] = item.Certno
4969
+		//		feedetailInfo["mdtrt_id"] = item.MdtrtId                  // 就诊 ID(来自2201接口返回)
4970
+		//		feedetailInfo["mdtrt_setl_time"] = item.MdtrtSetlTime     // 人员编号 (来自1101接口返回)
4971
+		//		feedetailInfo["setl_sn"] = item.SetlSn                    // 收费批次号
4972
+		//		feedetailInfo["medfee_sumamt"] = item.MedfeeSumamt        // 病种编码
4973
+		//		feedetailInfo["optins_pay_sumamt"] = item.OptinsPaySumamt // 处方号
4974
+		//		feedetailInfo["cnfm_flag"] = "0"                          // 处方号
4975
+		//		feedetail = append(feedetail, feedetailInfo)
4976
+		//	}
4977
+		//
4978
+		//}
4979
+		//for _, item := range result3260.Output.Data[start-1 : stop] {
4965
 		//	if item.MdtrtId == "out20230418732788" {
4980
 		//	if item.MdtrtId == "out20230418732788" {
4966
 		//		feedetailInfo := make(map[string]interface{})
4981
 		//		feedetailInfo := make(map[string]interface{})
4967
 		//		feedetailInfo["certno"] = item.Certno
4982
 		//		feedetailInfo["certno"] = item.Certno
4989
 		//	}
5004
 		//	}
4990
 		//
5005
 		//
4991
 		//}
5006
 		//}
5007
+		if  fixmedins_code == "H44030501364"{
5008
+
5009
+			inputData["totalrow"] = result3260.Output.Totalrow - 2// 人员姓名
5010
+
5011
+
5012
+		}else{
5013
+
5014
+			inputData["totalrow"] = result3260.Output.Totalrow // 人员姓名
5015
+
5016
+
5017
+		}
4992
 
5018
 
4993
-		inputData["totalrow"] = 174 // 人员姓名
4994
 
5019
 
4995
 		// 创建一个新的 Excel 文件
5020
 		// 创建一个新的 Excel 文件
4996
 		//f := excelize.NewFile()
5021
 		//f := excelize.NewFile()
5082
 	inputMessage["infno"] = "3262" // 交易编码
5107
 	inputMessage["infno"] = "3262" // 交易编码
5083
 
5108
 
5084
 	inputData["trt_year"] = year  // 就诊凭证编号
5109
 	inputData["trt_year"] = year  // 就诊凭证编号
5085
-	inputData["trt_month"] = "07" // 开始时间
5110
+	inputData["trt_month"] = month // 开始时间
5086
 	inputData["otransid"] = "0"   // 开始时间
5111
 	inputData["otransid"] = "0"   // 开始时间
5087
 
5112
 
5088
 	input["data"] = inputData
5113
 	input["data"] = inputData
6134
 	inputMessage["sign_no"] = "" //交易签到流水号
6159
 	inputMessage["sign_no"] = "" //交易签到流水号
6135
 	return inputMessage
6160
 	return inputMessage
6136
 }
6161
 }
6162
+
6163
+func Gdyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
6164
+
6165
+	nonce := GetRandomString(32)
6166
+	timestamp := time.Now().Unix()
6167
+	signature := setSignature(timestamp, nonce, params.SecretKey)
6168
+
6169
+	// 生成输入报文
6170
+	inputMessage := SetGdInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
6171
+
6172
+	//inputMessage := SetJSInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
6173
+	input := make(map[string]interface{})
6174
+	inputData := make(map[string]interface{})
6175
+	patientDtosinputData := make(map[string]interface{})
6176
+	fisEncounterDtosData := make(map[string]interface{})
6177
+	fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
6178
+
6179
+	fsiOrderDtosDatas := make([]map[string]interface{}, 0)
6180
+
6181
+	fsiOperationDtosData := make(map[string]interface{})
6182
+	fsiOperationDtosDatas := make([]map[string]interface{}, 0)
6183
+
6184
+	//就诊信息
6185
+	fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
6186
+	fisEncounterDtosData["medins_id"] = fed.MedinsID
6187
+	fisEncounterDtosData["medins_name"] = fed.MedinsName
6188
+	fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
6189
+	fisEncounterDtosData["medins_type"] = fed.MedinsType
6190
+	fisEncounterDtosData["medins_lv"] = fed.MedinsLv
6191
+	fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
6192
+	fisEncounterDtosData["wardno"] = fed.Wardno
6193
+	fisEncounterDtosData["bedno"] = fed.Bedno
6194
+	fisEncounterDtosData["adm_date"] = fed.AdmDate
6195
+	fisEncounterDtosData["dscg_date"] = fed.DscgDate
6196
+	fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
6197
+	fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
6198
+
6199
+	for _, fdd := range fdds {
6200
+		fsiDiagnoseDtosData := make(map[string]interface{})
6201
+		//诊断集合
6202
+		fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
6203
+		fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
6204
+		fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
6205
+		fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
6206
+		fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
6207
+		fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
6208
+		fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
6209
+		fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
6210
+	}
6211
+
6212
+	fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
6213
+
6214
+	fisEncounterDtosData["dr_codg"] = fed.DrCodg
6215
+	fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
6216
+	fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
6217
+	fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
6218
+	fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
6219
+	fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
6220
+	fisEncounterDtosData["med_type"] = fed.MedType
6221
+
6222
+	for _, fod := range fods {
6223
+		fsiOrderDtosData := make(map[string]interface{})
6224
+		//医嘱集合
6225
+		fsiOrderDtosData["rx_id"] = fod.RxID
6226
+		fsiOrderDtosData["rxno"] = fod.Rxno
6227
+		fsiOrderDtosData["grpno"] = fod.Grpno
6228
+		fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
6229
+		fsiOrderDtosData["hilist_type"] = fod.HilistType
6230
+		fsiOrderDtosData["chrg_type"] = fod.ChrgType
6231
+		fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
6232
+		fsiOrderDtosData["hilist_code"] = fod.HilistCode
6233
+		fsiOrderDtosData["hilist_name"] = fod.HosplistName
6234
+		fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
6235
+		fsiOrderDtosData["hilist_lv"] = fod.HilistLv
6236
+		fsiOrderDtosData["hilist_pric"] = fod.HilistPric
6237
+		fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
6238
+		fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
6239
+		fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
6240
+		fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
6241
+		fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
6242
+		fsiOrderDtosData["hosplist_name"] = fod.HosplistName
6243
+		fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
6244
+		fsiOrderDtosData["cnt"] = fod.Cnt
6245
+		fsiOrderDtosData["pric"] = fod.Pric
6246
+		fsiOrderDtosData["sumamt"] = fod.Sumamt
6247
+		fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
6248
+		fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
6249
+		fsiOrderDtosData["spec"] = fod.Spec
6250
+		fsiOrderDtosData["spec_unt"] = fod.SpecUnt
6251
+		fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
6252
+		fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
6253
+		fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
6254
+		fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
6255
+		fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
6256
+		fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
6257
+		fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
6258
+		fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
6259
+		fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
6260
+	}
6261
+	fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
6262
+
6263
+	fisEncounterDtosData["matn_stas"] = fed.MatnStas
6264
+	fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
6265
+	fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
6266
+	fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
6267
+	fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
6268
+	fisEncounterDtosData["ma_amt"] = fed.MaAmt
6269
+	fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
6270
+	fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
6271
+	fisEncounterDtosData["insutype"] = fed.Insutype
6272
+	fisEncounterDtosData["reim_flag"] = fed.ReimFlag
6273
+	fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
6274
+
6275
+	//手术操作
6276
+	for _, fopd := range fopds {
6277
+		fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
6278
+		fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
6279
+		fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
6280
+		fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
6281
+		fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
6282
+		fsiOperationDtosData["anst_way"] = fopd.Anst_way
6283
+		fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
6284
+		fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
6285
+		fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
6286
+		fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
6287
+		fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
6288
+	}
6289
+	fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
6290
+
6291
+	patientDtosinputData["patn_id"] = pd.PatnID
6292
+	patientDtosinputData["patn_name"] = pd.PatnName
6293
+	patientDtosinputData["gend"] = pd.Gend
6294
+	patientDtosinputData["brdy"] = pd.Brdy
6295
+	patientDtosinputData["poolarea"] = pd.Poolarea
6296
+	patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
6297
+	patientDtosinputData["fsi_his_data_dto"] = ""
6298
+	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
6299
+	inputData["syscode"] = "LinkDialysis"
6300
+	inputData["trig_scen"] = trig_scen
6301
+	inputData["rule_ids"] = ""
6302
+	inputData["task_id"] = ""
6303
+
6304
+	inputData["patient_dtos"] = patientDtosinputData
6305
+	input["data"] = inputData
6306
+	inputMessage["infno"] = "3101"
6307
+	inputMessage["input"] = input //交易输入
6308
+	bytesData, err := json.Marshal(inputMessage)
6309
+	fmt.Println(string(bytesData))
6310
+	if err != nil {
6311
+		fmt.Println(err.Error())
6312
+		return err.Error(), ""
6313
+	}
6314
+	reader := bytes.NewReader(bytesData)
6315
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
6316
+	gdyb_url := beego.AppConfig.String("gdyb_url")
6317
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
6318
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
6319
+	url := gdyb_url + "3101"
6320
+	request, err := http.NewRequest("POST", url, reader)
6321
+	if err != nil {
6322
+		fmt.Println(err.Error())
6323
+		return err.Error(),""
6324
+	}
6325
+
6326
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
6327
+	request.Header.Set("x-tif-paasid", gdyb_paasid)
6328
+	request.Header.Set("x-tif-signature", signature)
6329
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
6330
+	request.Header.Set("x-tif-nonce", nonce)
6331
+
6332
+	client := http.Client{}
6333
+	resp, err := client.Do(request)
6334
+	if err != nil {
6335
+		fmt.Println(err.Error())
6336
+		return err.Error(),""
6337
+	}
6338
+	respBytes, err := ioutil.ReadAll(resp.Body)
6339
+	if err != nil {
6340
+		fmt.Println(err.Error())
6341
+		return err.Error(),""
6342
+	}
6343
+	str := string(respBytes)
6344
+	fmt.Println(str)
6345
+	return str,string(bytesData)
6346
+}
6347
+func  Gdyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
6348
+	nonce := GetRandomString(32)
6349
+	timestamp := time.Now().Unix()
6350
+	signature := setSignature(timestamp, nonce, params.SecretKey)
6351
+
6352
+	// 生成输入报文
6353
+	inputMessage := SetGdInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
6354
+
6355
+	input := make(map[string]interface{})
6356
+	inputData := make(map[string]interface{})
6357
+	patientDtosinputData := make(map[string]interface{})
6358
+	fisEncounterDtosData := make(map[string]interface{})
6359
+	fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
6360
+
6361
+	fsiOrderDtosDatas := make([]map[string]interface{}, 0)
6362
+
6363
+	fsiOperationDtosData := make(map[string]interface{})
6364
+	fsiOperationDtosDatas := make([]map[string]interface{}, 0)
6365
+
6366
+	//就诊信息
6367
+	fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
6368
+	fisEncounterDtosData["medins_id"] = fed.MedinsID
6369
+	fisEncounterDtosData["medins_name"] = fed.MedinsName
6370
+	fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
6371
+	fisEncounterDtosData["medins_type"] = fed.MedinsType
6372
+	fisEncounterDtosData["medins_lv"] = fed.MedinsLv
6373
+	fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
6374
+	fisEncounterDtosData["wardno"] = fed.Wardno
6375
+	fisEncounterDtosData["bedno"] = fed.Bedno
6376
+	fisEncounterDtosData["adm_date"] = fed.AdmDate
6377
+	fisEncounterDtosData["dscg_date"] = fed.DscgDate
6378
+	fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
6379
+	fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
6380
+
6381
+	for _, fdd := range fdds {
6382
+		fsiDiagnoseDtosData := make(map[string]interface{})
6383
+		//诊断集合
6384
+		fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
6385
+		fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
6386
+		fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
6387
+		fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
6388
+		fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
6389
+		fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
6390
+		fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
6391
+		fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
6392
+	}
6393
+
6394
+	fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
6395
+
6396
+	fisEncounterDtosData["dr_codg"] = fed.DrCodg
6397
+	fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
6398
+	fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
6399
+	fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
6400
+	fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
6401
+	fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
6402
+	fisEncounterDtosData["med_type"] = fed.MedType
6403
+
6404
+	for _, fod := range fods {
6405
+		fsiOrderDtosData := make(map[string]interface{})
6406
+		//医嘱集合
6407
+		fsiOrderDtosData["rx_id"] = fod.RxID
6408
+		fsiOrderDtosData["rxno"] = fod.Rxno
6409
+		fsiOrderDtosData["grpno"] = fod.Grpno
6410
+		fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
6411
+		fsiOrderDtosData["hilist_type"] = fod.HilistType
6412
+		fsiOrderDtosData["chrg_type"] = fod.ChrgType
6413
+		fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
6414
+		fsiOrderDtosData["hilist_code"] =  fod.HosplistCode
6415
+		fsiOrderDtosData["hilist_name"] = fod.HosplistName
6416
+		fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
6417
+		fsiOrderDtosData["hilist_lv"] = fod.HilistLv
6418
+		fsiOrderDtosData["hilist_pric"] = fod.HilistPric
6419
+		fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
6420
+		fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
6421
+		fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
6422
+		fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
6423
+		fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
6424
+		fsiOrderDtosData["hosplist_name"] = fod.HosplistName
6425
+		fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
6426
+		fsiOrderDtosData["cnt"] = fod.Cnt
6427
+		fsiOrderDtosData["pric"] = fod.Pric
6428
+		fsiOrderDtosData["sumamt"] = fod.Sumamt
6429
+		fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
6430
+		fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
6431
+		fsiOrderDtosData["spec"] = fod.Spec
6432
+		fsiOrderDtosData["spec_unt"] = fod.SpecUnt
6433
+		fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
6434
+		fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
6435
+		fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
6436
+		fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
6437
+		fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
6438
+		fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
6439
+		fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
6440
+		fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
6441
+		fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
6442
+	}
6443
+
6444
+	fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
6445
+
6446
+	fisEncounterDtosData["matn_stas"] = fed.MatnStas
6447
+	fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
6448
+	fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
6449
+	fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
6450
+	fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
6451
+	fisEncounterDtosData["ma_amt"] = fed.MaAmt
6452
+	fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
6453
+	fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
6454
+	fisEncounterDtosData["insutype"] = fed.Insutype
6455
+	fisEncounterDtosData["reim_flag"] = fed.ReimFlag
6456
+	fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
6457
+
6458
+	//手术操作
6459
+	for _, fopd := range fopds {
6460
+		fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
6461
+		fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
6462
+		fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
6463
+		fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
6464
+		fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
6465
+		fsiOperationDtosData["anst_way"] = fopd.Anst_way
6466
+		fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
6467
+		fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
6468
+		fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
6469
+		fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
6470
+		fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
6471
+	}
6472
+	fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
6473
+
6474
+	patientDtosinputData["patn_id"] = pd.PatnID
6475
+	patientDtosinputData["patn_name"] = pd.PatnName
6476
+	patientDtosinputData["gend"] = pd.Gend
6477
+	patientDtosinputData["brdy"] = pd.Brdy
6478
+	patientDtosinputData["poolarea"] = pd.Poolarea
6479
+	patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
6480
+	patientDtosinputData["fsi_his_data_dto"] = ""
6481
+	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
6482
+	inputData["syscode"] = "LinkDialysis"
6483
+	inputData["trig_scen"] = trig_scen
6484
+	inputData["rule_ids"] = ""
6485
+	inputData["task_id"] = ""
6486
+	inputData["patient_dtos"] = patientDtosinputData
6487
+	input["data"] = inputData
6488
+	inputMessage["infno"] = "3102"
6489
+	inputMessage["input"] = input //交易输入
6490
+	bytesData, err := json.Marshal(inputMessage)
6491
+	fmt.Println(string(bytesData))
6492
+	if err != nil {
6493
+		fmt.Println(err.Error())
6494
+		return err.Error(), ""
6495
+	}
6496
+	reader := bytes.NewReader(bytesData)
6497
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
6498
+	gdyb_url := beego.AppConfig.String("gdyb_url")
6499
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
6500
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
6501
+	url := gdyb_url + "3102"
6502
+	request, err := http.NewRequest("POST", url, reader)
6503
+	if err != nil {
6504
+		fmt.Println(err.Error())
6505
+		return err.Error(),""
6506
+	}
6507
+
6508
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
6509
+	request.Header.Set("x-tif-paasid", gdyb_paasid)
6510
+	request.Header.Set("x-tif-signature", signature)
6511
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
6512
+	request.Header.Set("x-tif-nonce", nonce)
6513
+
6514
+	client := http.Client{}
6515
+	resp, err := client.Do(request)
6516
+	if err != nil {
6517
+		fmt.Println(err.Error())
6518
+		return err.Error(),""
6519
+	}
6520
+	respBytes, err := ioutil.ReadAll(resp.Body)
6521
+	if err != nil {
6522
+		fmt.Println(err.Error())
6523
+		return err.Error(),""
6524
+	}
6525
+	str := string(respBytes)
6526
+	fmt.Println(str)
6527
+	return str,string(bytesData)
6528
+}
6529
+

+ 83 - 0
service/hbyb_service.go View File

922
 
922
 
923
 }
923
 }
924
 
924
 
925
+
926
+func Hbyb5262(baseParams models.BaseParams, businessParams models.BusinessParams5262, page string , limit string) string {
927
+
928
+	fmt.Println(baseParams)
929
+	fmt.Println(businessParams)
930
+	// 生成签名
931
+	nonce := GetRandomString(32)
932
+	timestamp := time.Now().Unix()
933
+
934
+	// 生成输入报文
935
+	inputMessage := SetInputMessage(nonce, timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs)
936
+	input := make(map[string]interface{})
937
+	//inputDatas := []make(map[string]interface{})
938
+
939
+	inputMessage["infno"] = "5262" // 交易编码
940
+	inputData := make(map[string]interface{})
941
+	inputData["refd_setl_flag"] = businessParams.RefdSetlFlag
942
+	inputData["q_begntime"] = businessParams.QBegntime
943
+	inputData["q_endtime"] = businessParams.QEndtime
944
+	inputData["med_type"] =   businessParams.MedType
945
+	inputData["page_num"] = page
946
+	inputData["page_size"] = limit
947
+	inputData["certno"] = businessParams.Certno
948
+	inputData["psnno"] = businessParams.Psnno
949
+	input["data"] = inputData
950
+	inputMessage["input"] = input //交易输入
951
+
952
+	bytesData, err := json.Marshal(inputMessage)
953
+	fmt.Println(string(bytesData))
954
+	if err != nil {
955
+		fmt.Println(err.Error())
956
+		return err.Error()
957
+	}
958
+	var json2 string
959
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "5262", string(bytesData), json2)
960
+	out, err := cmd.Output()
961
+	if err != nil {
962
+		fmt.Println("error:", err.Error())
963
+	}
964
+	fmt.Println(string(out))
965
+	return ConvertToString(string(out), "gbk", "utf-8")
966
+}
967
+
968
+func Hbyb5267(baseParams models.BaseParams, businessParams models.BusinessParams5262, page string , limit string) string {
969
+
970
+	fmt.Println(baseParams)
971
+	fmt.Println(businessParams)
972
+	// 生成签名
973
+	nonce := GetRandomString(32)
974
+	timestamp := time.Now().Unix()
975
+
976
+	// 生成输入报文
977
+	inputMessage := SetInputMessage(nonce, timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs)
978
+	input := make(map[string]interface{})
979
+	//inputDatas := []make(map[string]interface{})
980
+
981
+	inputMessage["infno"] = "5267" // 交易编码
982
+	inputData := make(map[string]interface{})
983
+	inputData["refd_setl_flag"] = businessParams.RefdSetlFlag
984
+	inputData["q_begntime"] = businessParams.QBegntime
985
+	inputData["q_endtime"] = businessParams.QEndtime
986
+	inputData["med_type"] =   businessParams.MedType
987
+	inputData["page_num"] = page
988
+	inputData["page_size"] = limit
989
+	input["data"] = inputData
990
+	inputMessage["input"] = input //交易输入
991
+
992
+	bytesData, err := json.Marshal(inputMessage)
993
+	fmt.Println(string(bytesData))
994
+	if err != nil {
995
+		fmt.Println(err.Error())
996
+		return err.Error()
997
+	}
998
+	var json2 string
999
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "5267", string(bytesData), json2)
1000
+	out, err := cmd.Output()
1001
+	if err != nil {
1002
+		fmt.Println("error:", err.Error())
1003
+	}
1004
+	fmt.Println(string(out))
1005
+	return ConvertToString(string(out), "gbk", "utf-8")
1006
+}
1007
+
925
 //文件上传
1008
 //文件上传
926
 
1009
 
927
 //文件上传
1010
 //文件上传

+ 28 - 0
service/his_project_service.go View File

715
 
715
 
716
 	return drug, err
716
 	return drug, err
717
 }
717
 }
718
+func GetBatchDrugListtw(org_id int64) (drug []*models.BaseDrugList, err error) {
719
+
720
+	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1")
721
+	table := XTReadDB().Table("xt_manufacturer as m")
722
+	fmt.Print(table)
723
+
724
+		db = db.Where("x.org_id = ?", org_id)
725
+
726
+	err = db.Select("x.id,x.medical_insurance_number,x.code,x.drug_name,x.drug_spec,x.drug_type,x.min_unit,x.last_price,x.retail_price,x.limit_remark,x.drug_dosage_form,x.social_security_directory_code,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&drug).Error
727
+
728
+	return drug, err
729
+}
730
+
731
+
718
 
732
 
719
 func GetBatchGoodInformationList(idss []int64) (good []*models.GoodInformation, err error) {
733
 func GetBatchGoodInformationList(idss []int64) (good []*models.GoodInformation, err error) {
720
 
734
 
729
 	err = db.Select("x.id,x.social_security_directory_code,x.good_name,x.specification_name,x.production_type,x.special_medical,x.good_unit,x.buy_price,x.sell_price,x.remark,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&good).Error
743
 	err = db.Select("x.id,x.social_security_directory_code,x.good_name,x.specification_name,x.production_type,x.special_medical,x.good_unit,x.buy_price,x.sell_price,x.remark,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&good).Error
730
 	return good, err
744
 	return good, err
731
 }
745
 }
746
+
747
+
748
+func GetBatchGoodInformationListtwo(org_id int64) (good []*models.GoodInformation, err error) {
749
+
750
+	db := XTReadDB().Table("xt_good_information as x").Where("x.status=1")
751
+	table := XTReadDB().Table("xt_manufacturer as m")
752
+	fmt.Println(table)
753
+
754
+		db = db.Where("x.org_id = ?", org_id)
755
+
756
+	err = db.Select("x.id,x.social_security_directory_code,x.good_name,x.specification_name,x.production_type,x.special_medical,x.good_unit,x.buy_price,x.sell_price,x.remark,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&good).Error
757
+	return good, err
758
+}
759
+

+ 51 - 1
service/his_service.go View File

526
 	return
526
 	return
527
 }
527
 }
528
 
528
 
529
+func FindLastPatientPrescriptionInfoTwo1(org_id int64, patient_id int64) (info models.HisPrescriptionInfo, err error) {
530
+	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND patient_id = ? and p_type = 1", org_id, patient_id).Last(&info).Error
531
+	return
532
+}
533
+
534
+func FindLastPatientPrescriptionInfoTwo2(org_id int64, patient_id int64,start_time string, end_time string) (info []models.HisPrescriptionInfo, err error) {
535
+	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND patient_id = ? and p_type = 1 and FROM_UNIXTIME(record_date) >= ? and FROM_UNIXTIME(record_date) <= ?", org_id, patient_id,start_time,end_time).Find(&info).Error
536
+	return
537
+}
538
+
529
 func SavePatientPrescriptionInfo(info models.HisPrescriptionInfo) (err error) {
539
 func SavePatientPrescriptionInfo(info models.HisPrescriptionInfo) (err error) {
530
 	err = writeDb.Save(&info).Error
540
 	err = writeDb.Save(&info).Error
531
 	return
541
 	return
1072
 	return dealer, err
1082
 	return dealer, err
1073
 }
1083
 }
1074
 
1084
 
1085
+func FindDiagnoseByIdtwo(id string) (models.HisXtDiagnoseConfig, error) {
1086
+	dealer := models.HisXtDiagnoseConfig{}
1087
+	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id = ?", id).First(&dealer).Error
1088
+	return dealer, err
1089
+}
1090
+
1075
 func FindDiagnoseByIds(ids []string) ([]*models.HisXtDiagnoseConfig, error) {
1091
 func FindDiagnoseByIds(ids []string) ([]*models.HisXtDiagnoseConfig, error) {
1076
 	dealer := []*models.HisXtDiagnoseConfig{}
1092
 	dealer := []*models.HisXtDiagnoseConfig{}
1077
 	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id IN (?) AND status = 1", ids).Find(&dealer).Error
1093
 	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id IN (?) AND status = 1", ids).Find(&dealer).Error
1289
 
1305
 
1290
 	return project, err
1306
 	return project, err
1291
 }
1307
 }
1308
+func GetBathchMyPorjecgListtwo(org_id int64) (project []*models.MyHisProject, err error) {
1309
+	db := XTReadDB().Table("xt_his_project")
1310
+
1311
+	err = db.Where("status = 1 and user_org_id = ?", org_id).Find(&project).Error
1292
 
1312
 
1313
+
1314
+	return project, err
1315
+}
1293
 func GetBatchDoctorList(idss []int64) (role []*models.SgjUserAdminRole, err error) {
1316
 func GetBatchDoctorList(idss []int64) (role []*models.SgjUserAdminRole, err error) {
1294
 
1317
 
1295
 	db := UserReadDB().Table("sgj_user_admin_role as x").Where("x.status =1")
1318
 	db := UserReadDB().Table("sgj_user_admin_role as x").Where("x.status =1")
1485
 }
1508
 }
1486
 
1509
 
1487
 func GetAllHisOrder10106(org_id int64) (his []*models.HisOrder, err error) {
1510
 func GetAllHisOrder10106(org_id int64) (his []*models.HisOrder, err error) {
1488
-	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10106  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND med_type = '14' AND setl_time >= '2023-07-01 00:00:00' AND setl_time <= '2023-07-31 23:59:00'").Order("setl_time asc").Find(&his).Error
1511
+	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10106  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND med_type = '14' AND setl_time >= '2023-08-01 00:00:00' AND setl_time <= '2023-08-31 23:59:00'").Order("setl_time asc").Find(&his).Error
1489
 	fmt.Println(err)
1512
 	fmt.Println(err)
1490
 	return
1513
 	return
1491
 }
1514
 }
1506
 	return
1529
 	return
1507
 }
1530
 }
1508
 
1531
 
1532
+
1533
+func GetAllHisOrder10265() (his []*models.HisOrder, err error) {
1534
+	err = readDb.Model(&models.HisOrder{}).Where(" user_org_id = 10265  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND setl_time >= '2023-09-01 00:00:00'").Order("setl_time asc").Find(&his).Error
1535
+	fmt.Println(err)
1536
+	return
1537
+}
1538
+
1539
+
1509
 //	func GetAllHisOrder2(org_id int64) (his []models.HisOrder, err error) {
1540
 //	func GetAllHisOrder2(org_id int64) (his []models.HisOrder, err error) {
1510
 //		err = readDb.Model(&models.HisOrder{}).Where("id = 180753").Order("setl_time asc").First(&his).Error
1541
 //		err = readDb.Model(&models.HisOrder{}).Where("id = 180753").Order("setl_time asc").First(&his).Error
1511
 //		return
1542
 //		return
1608
 }
1639
 }
1609
 
1640
 
1610
 //
1641
 //
1642
+func Saveflow(flow models.HisPrescriptionFlow){
1643
+	writeDb.Save(&flow)
1644
+}
1645
+
1646
+
1647
+
1648
+func GetNewHisPrescriptionTenone(org_id int64,number string) (prescription []*models.HisPrescriptionTen, err error) {
1649
+	err = readDb.Model(&models.HisPrescriptionTen{}).
1650
+		Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1651
+			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisOrderInfo", "status = 1").Preload("BaseDrugLib", "status=1")
1652
+		}).
1653
+		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1654
+			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisOrderInfo", "status = 1").Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
1655
+		}).
1656
+		Where("user_org_id = ? AND status = 1 AND batch_number = ? and order_status = 4 ", org_id, number).
1657
+		Find(&prescription).Error
1658
+	return
1659
+}
1660
+

+ 84 - 1
service/hn_service.go View File

532
 		feedetailInfo["rx_circ_flag"] = "0"                          // 外购处方标志
532
 		feedetailInfo["rx_circ_flag"] = "0"                          // 外购处方标志
533
 		feedetailInfo["fee_ocur_time"] = item.FeeOcurTime            // 费用发生时间
533
 		feedetailInfo["fee_ocur_time"] = item.FeeOcurTime            // 费用发生时间
534
 		feedetailInfo["med_list_codg"] = item.MedListCodg            // 医疗目录编码
534
 		feedetailInfo["med_list_codg"] = item.MedListCodg            // 医疗目录编码
535
-		feedetailInfo["medins_list_codg"] = fixmedins_code           // 医药机构目录编码
535
+		feedetailInfo["medins_list_codg"] =  item.MedListCodg          // 医药机构目录编码
536
 		feedetailInfo["det_item_fee_sumamt"] = item.DetItemFeeSumamt // 明细项目费用总额
536
 		feedetailInfo["det_item_fee_sumamt"] = item.DetItemFeeSumamt // 明细项目费用总额
537
 		feedetailInfo["cnt"] = item.Cut                              // 数量
537
 		feedetailInfo["cnt"] = item.Cut                              // 数量
538
 		feedetailInfo["pric"] = item.Price                           // 单价
538
 		feedetailInfo["pric"] = item.Price                           // 单价
2036
 	return HNHttpRequest(struct3507.RequestUrl, struct3507.AccessKey, struct3507.SecretKey, timestamp, string(bytesData), "3507"), string(bytesData)
2036
 	return HNHttpRequest(struct3507.RequestUrl, struct3507.AccessKey, struct3507.SecretKey, timestamp, string(bytesData), "3507"), string(bytesData)
2037
 
2037
 
2038
 }
2038
 }
2039
+
2040
+
2041
+
2042
+func Hnyb3301(org_name string,opera string,fixmedins_code string,insuplc_admdvs string,mdtrtarea_admvs string,cainfo string, name string, codg string, list_type string,start_time string, ent_time string, request_url string,access_key string,secret_key string) (string,string) {
2043
+	// 生成签名
2044
+	//nonce := GetRandomString(32)
2045
+	// 生成签名
2046
+	timestamp := time.Now().Unix()
2047
+	//tempTime := time.Unix(timestamp, 0)
2048
+	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
2049
+	inputMessage := SetHnInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
2050
+
2051
+	// 生成输入报文
2052
+	//inputMessage := SetHnInputMessage(timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs, baseParams.Cainfo)
2053
+
2054
+	//inputMessage := SetInputMessage(nonce, timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs)
2055
+	input := make(map[string]interface{})
2056
+	inputData := make(map[string]interface{})
2057
+	inputMessage["infno"] = "3301" // 交易编码
2058
+	inputData["fixmedins_hilist_id"] = codg
2059
+	inputData["fixmedins_hilist_name"] = name
2060
+	inputData["list_type"] = list_type
2061
+	inputData["med_list_codg"] = codg
2062
+	inputData["begndate"] = start_time
2063
+	inputData["enddate"] = ent_time
2064
+
2065
+	inputData["aprvno"] = ""
2066
+	inputData["dosform"] = ""
2067
+	inputData["exct_cont"] = ""
2068
+	inputData["item_cont"] = ""
2069
+	inputData["prcunt"] = ""
2070
+	inputData["spec"] = ""
2071
+	inputData["pacspec"] = ""
2072
+	inputData["memo"] = ""
2073
+
2074
+	input["data"] = inputData
2075
+	inputMessage["input"] = input //交易输入
2076
+	bytesData, err := json.Marshal(inputMessage)
2077
+	fmt.Println(string(bytesData))
2078
+	if err != nil {
2079
+		fmt.Println(err.Error())
2080
+		return err.Error(),""
2081
+	}
2082
+
2083
+	request_url = request_url + "3301"
2084
+	timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
2085
+	return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "3301"), string(bytesData)
2086
+
2087
+}
2088
+func Hnyb3302(org_name string,opera string,fixmedins_code string,insuplc_admdvs string,mdtrtarea_admvs string,cainfo string, name string, codg string, list_type string,start_time string, ent_time string, request_url string,access_key string,secret_key string) (string,string) {
2089
+	// 生成签名
2090
+	//nonce := GetRandomString(32)
2091
+	// 生成签名
2092
+	timestamp := time.Now().Unix()
2093
+	//tempTime := time.Unix(timestamp, 0)
2094
+	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
2095
+	inputMessage := SetHnInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
2096
+
2097
+	// 生成输入报文
2098
+	//inputMessage := SetHnInputMessage(timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs, baseParams.Cainfo)
2099
+
2100
+	//inputMessage := SetInputMessage(nonce, timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs)
2101
+	input := make(map[string]interface{})
2102
+	inputData := make(map[string]interface{})
2103
+	inputMessage["infno"] = "3302" // 交易编码
2104
+	inputData["fixmedins_code"] = fixmedins_code
2105
+	inputData["fixmedins_hilist_id"] = codg
2106
+	inputData["list_type"] = list_type
2107
+	inputData["med_list_codg"] = codg
2108
+	input["data"] = inputData
2109
+	inputMessage["input"] = input //交易输入
2110
+	bytesData, err := json.Marshal(inputMessage)
2111
+	fmt.Println(string(bytesData))
2112
+	if err != nil {
2113
+		fmt.Println(err.Error())
2114
+		return err.Error(),""
2115
+	}
2116
+
2117
+	request_url = request_url + "3302"
2118
+	timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
2119
+	return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "3302"), string(bytesData)
2120
+
2121
+}

+ 5 - 13
service/jsyb_service.go View File

613
 		feedetailInfo["bilg_dept_codg"] = dept_code                  // 开单科室编码
613
 		feedetailInfo["bilg_dept_codg"] = dept_code                  // 开单科室编码
614
 		feedetailInfo["bilg_dept_name"] = dept                       // 开单科室名称
614
 		feedetailInfo["bilg_dept_name"] = dept                       // 开单科室名称
615
 
615
 
616
-		if fixmedins_code == "H32092103007" {
617
-			feedetailInfo["bilg_dr_codg"] = "D320923012139"   // 开单医生编码
618
-			feedetailInfo["bilg_dr_name"] = "王曙光"             // 开单医师姓名
619
-			feedetailInfo["acord_dept_codg"] = ""             // 受单科室编码
620
-			feedetailInfo["acord_dept_name"] = ""             // 受单科室名称
621
-			feedetailInfo["orders_dr_code"] = "D320923012139" // 受单医生编码
622
-			feedetailInfo["orders_dr_name"] = "王曙光"           // 受单医生姓名
623
 
616
 
624
-		} else {
625
-			feedetailInfo["bilg_dr_codg"] = "D371621008686"   // 开单医生编码
626
-			feedetailInfo["bilg_dr_name"] = "王云刚"             // 开单医师姓名
617
+			feedetailInfo["bilg_dr_codg"] = item.DoctorNumber   // 开单医生编码
618
+			feedetailInfo["bilg_dr_name"] = item.DoctorName             // 开单医师姓名
627
 			feedetailInfo["acord_dept_codg"] = ""             // 受单科室编码
619
 			feedetailInfo["acord_dept_codg"] = ""             // 受单科室编码
628
 			feedetailInfo["acord_dept_name"] = ""             // 受单科室名称
620
 			feedetailInfo["acord_dept_name"] = ""             // 受单科室名称
629
-			feedetailInfo["orders_dr_code"] = "D371621008686" // 受单医生编码
630
-			feedetailInfo["orders_dr_name"] = "王云刚"           // 受单医生姓名
621
+			feedetailInfo["orders_dr_code"] = item.DoctorNumber  // 受单医生编码
622
+			feedetailInfo["orders_dr_name"] = item.DoctorName            // 受单医生姓名
623
+
631
 
624
 
632
-		}
633
 
625
 
634
 		if balance_accounts_type == "8" {
626
 		if balance_accounts_type == "8" {
635
 			feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
627
 			feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志

+ 1 - 0
service/nm_service.go View File

995
 	fmt.Println(str)
995
 	fmt.Println(str)
996
 	return str
996
 	return str
997
 }
997
 }
998
+

+ 65 - 0
service/zh_his_service.go View File

1735
 	fmt.Println(str)
1735
 	fmt.Println(str)
1736
 	return str
1736
 	return str
1737
 }
1737
 }
1738
+func ZHyb4104(baseParams models.BaseParams, businessParams models.BusinessParams) string {
1739
+	// 生成签名
1740
+	nonce := GetRandomString(32)
1741
+	timestamp := time.Now().Unix()
1742
+	signature := setSignature(timestamp, nonce, baseParams.SecretKey)
1743
+
1744
+	// 生成输入报文
1745
+	inputMessage := SetInputMessage(nonce, timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs)
1746
+	input := make(map[string]interface{})
1747
+	inputData := make(map[string]interface{})
1748
+	inputMessage["infno"] = "4104" // 交易编码
1749
+	inputData["setl_ym"] = "202309"
1750
+	inputData["page_num"] = "1"
1751
+	inputData["page_size"] = "100"
1752
+	input["data"] = inputData
1753
+	inputMessage["input"] = input //交易输入
1754
+	bytesData, err := json.Marshal(inputMessage)
1755
+	fmt.Println(string(bytesData))
1756
+	fmt.Println(string(bytesData))
1757
+	if err != nil {
1758
+		fmt.Println(err.Error())
1759
+		return err.Error()
1760
+	}
1761
+	reader := bytes.NewReader(bytesData)
1762
+	gdyb_url := beego.AppConfig.String("gdyb_url")
1763
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
1764
+
1765
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
1766
+	//url := gdyb_url + "5203"
1767
+	var url string
1768
+	if baseParams.FixmedinsCode == "H15049901371" {
1769
+		url = gdyb_url
1770
+	} else {
1771
+		url = gdyb_url + "4103"
1772
+	}
1773
+
1774
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5203"
1775
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/5203"
1776
+
1777
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/5203"
1778
+	request, err := http.NewRequest("POST", url, reader)
1779
+	if err != nil {
1780
+		fmt.Println(err.Error())
1781
+		return err.Error()
1782
+	}
1783
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1784
+	request.Header.Set("x-tif-paasid", gdyb_paasid)
1785
+	request.Header.Set("x-tif-signature", signature)
1786
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1787
+	request.Header.Set("x-tif-nonce", nonce)
1788
+	client := http.Client{}
1789
+	resp, err := client.Do(request)
1790
+	if err != nil {
1791
+		fmt.Println(err.Error())
1792
+		return err.Error()
1793
+	}
1794
+	respBytes, err := ioutil.ReadAll(resp.Body)
1795
+	if err != nil {
1796
+		fmt.Println(err.Error())
1797
+		return err.Error()
1798
+	}
1799
+	str := string(respBytes)
1800
+	fmt.Println(str)
1801
+	return str
1802
+}

BIN
simkai.ttf View File