coordinate_service.go 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. package service
  2. import (
  3. "bytes"
  4. "encoding/json"
  5. "fmt"
  6. "io/ioutil"
  7. "net/http"
  8. )
  9. func SavePatientMessageInfo() (string, string) {
  10. //input := make(map[string]interface{})
  11. inputData := make(map[string]interface{})
  12. inputData["patType"] = "1" // 就诊凭证编号
  13. inputData["patIdNo"] = "441701195808152845" // 开始时间
  14. inputData["patName"] = "罗秀云" // 人员姓名
  15. inputData["patMobile"] = "13535547901" // 人员姓名
  16. inputData["patSex"] = "M" // 人员姓名
  17. inputData["patMarriage"] = "1" // 人员姓名
  18. inputData["birthday"] = "1992-10-23" // 人员姓名
  19. inputData["patAddress"] = "11111" // 人员姓名
  20. inputData["thirdPartyID"] = "16" // 人员姓名
  21. inputData["patAge"] = "11" // 人员姓名
  22. //input["req"] = inputData
  23. var inputLog string
  24. bytesData, err := json.Marshal(inputData)
  25. inputLog = string(bytesData)
  26. fmt.Println(string(bytesData))
  27. if err != nil {
  28. fmt.Println(err.Error())
  29. return err.Error(), ""
  30. }
  31. reader := bytes.NewReader(bytesData)
  32. var url string
  33. gdyb_url := "http://218.104.146.179:9091/esb/listener/savePatientMessageInfo"
  34. url = gdyb_url
  35. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
  36. request, err := http.NewRequest("GET", url, reader)
  37. if err != nil {
  38. fmt.Println(err.Error())
  39. return err.Error(), ""
  40. }
  41. request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  42. request.Header.Set("code", "Xmrjyy")
  43. client := http.Client{}
  44. resp, err := client.Do(request)
  45. if err != nil {
  46. fmt.Println(err.Error())
  47. return err.Error(), ""
  48. }
  49. respBytes, err := ioutil.ReadAll(resp.Body)
  50. if err != nil {
  51. fmt.Println(err.Error())
  52. return err.Error(), ""
  53. }
  54. fmt.Println(string(respBytes))
  55. str := string(respBytes)
  56. return str, inputLog
  57. }
  58. func SaveReg() (string, string) {
  59. //input := make(map[string]interface{})
  60. inputData := make(map[string]interface{})
  61. inputData["deptId"] = "01" // 就诊凭证编号
  62. inputData["clinicUnitId"] = "" // 开始时间
  63. inputData["healthCardNo"] = "" // 人员姓名
  64. inputData["patientId"] = "701822660170096645" // 人员姓名
  65. inputData["patientName"] = "罗秀云" // 人员姓名
  66. inputData["idCardNo"] = "" // 人员姓名
  67. inputData["phone"] = "" // 人员姓名
  68. inputData["doctorId"] = "01" // 人员姓名
  69. inputData["doctorLevelCode"] = "" // 人员姓名
  70. inputData["regDate"] = "2022-05-10" // 人员姓名
  71. inputData["shiftCode"] = "" // 人员姓名
  72. inputData["startTime"] = "" // 人员姓名
  73. inputData["endTime"] = "" // 人员姓名
  74. inputData["scheduleId"] = "" // 人员姓名
  75. inputData["periodId"] = "" // 人员姓名
  76. inputData["svObjectId"] = "" // 人员姓名
  77. inputData["diseaseId"] = "" // 人员姓名
  78. inputData["regFee"] = "0.00" // 人员姓名
  79. inputData["treatFee"] = "0.00" // 人员姓名
  80. inputData["operatorId"] = "admin" // 人员姓名
  81. inputData["remark"] = "" // 人员姓名
  82. inputData["orderType"] = "" // 人员姓名
  83. inputData["clinicCode"] = "" // 人员姓名
  84. inputData["infoSeq"] = "" // 人员姓名
  85. //input["Request"] = inputData
  86. var inputLog string
  87. bytesData, err := json.Marshal(inputData)
  88. inputLog = string(bytesData)
  89. fmt.Println(string(bytesData))
  90. if err != nil {
  91. fmt.Println(err.Error())
  92. return err.Error(), ""
  93. }
  94. reader := bytes.NewReader(bytesData)
  95. var url string
  96. gdyb_url := "http://218.104.146.179:9091/esb/listener/saveReg"
  97. url = gdyb_url
  98. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
  99. request, err := http.NewRequest("POST", url, reader)
  100. if err != nil {
  101. fmt.Println(err.Error())
  102. return err.Error(), ""
  103. }
  104. request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  105. request.Header.Set("code", "Xmrjyy")
  106. client := http.Client{}
  107. resp, err := client.Do(request)
  108. if err != nil {
  109. fmt.Println(err.Error())
  110. return err.Error(), ""
  111. }
  112. respBytes, err := ioutil.ReadAll(resp.Body)
  113. if err != nil {
  114. fmt.Println(err.Error())
  115. return err.Error(), ""
  116. }
  117. fmt.Println(string(respBytes))
  118. str := string(respBytes)
  119. return str, inputLog
  120. }
  121. func GetWaitPayDetail() (string, string) {
  122. //input := make(map[string]interface{})
  123. inputData := make(map[string]interface{})
  124. inputData["clinicSeq"] = "30445" // 就诊凭证编号
  125. inputData["prescriptionId"] = "" // 开始时间
  126. inputData["patientId"] = "701822660170096645" // 人员姓名
  127. var inputLog string
  128. bytesData, err := json.Marshal(inputData)
  129. inputLog = string(bytesData)
  130. fmt.Println(string(bytesData))
  131. if err != nil {
  132. fmt.Println(err.Error())
  133. return err.Error(), ""
  134. }
  135. reader := bytes.NewReader(bytesData)
  136. var url string
  137. gdyb_url := "http://218.104.146.179:9091/esb/listener/getWaitPayDetail"
  138. url = gdyb_url
  139. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
  140. request, err := http.NewRequest("POST", url, reader)
  141. if err != nil {
  142. fmt.Println(err.Error())
  143. return err.Error(), ""
  144. }
  145. request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  146. request.Header.Set("code", "Xmrjyy")
  147. client := http.Client{}
  148. resp, err := client.Do(request)
  149. if err != nil {
  150. fmt.Println(err.Error())
  151. return err.Error(), ""
  152. }
  153. respBytes, err := ioutil.ReadAll(resp.Body)
  154. if err != nil {
  155. fmt.Println(err.Error())
  156. return err.Error(), ""
  157. }
  158. fmt.Println(string(respBytes))
  159. str := string(respBytes)
  160. return str, inputLog
  161. }
  162. func OpKeepAccounts() (string, string) {
  163. inputData := make(map[string]interface{})
  164. inputData["inNo"] = "30445" // 就诊凭证编号
  165. inputData["itemCode"] = "240300013-000" // 开始时间
  166. inputData["num"] = "1" // 人员姓名
  167. var inputLog string
  168. bytesData, err := json.Marshal(inputData)
  169. inputLog = string(bytesData)
  170. fmt.Println(string(bytesData))
  171. if err != nil {
  172. fmt.Println(err.Error())
  173. return err.Error(), ""
  174. }
  175. reader := bytes.NewReader(bytesData)
  176. var url string
  177. gdyb_url := "http://218.104.146.179:9091/esb/listener/opKeepAccounts"
  178. url = gdyb_url
  179. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
  180. request, err := http.NewRequest("POST", url, reader)
  181. if err != nil {
  182. fmt.Println(err.Error())
  183. return err.Error(), ""
  184. }
  185. request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  186. request.Header.Set("code", "Xmrjyy")
  187. client := http.Client{}
  188. resp, err := client.Do(request)
  189. if err != nil {
  190. fmt.Println(err.Error())
  191. return err.Error(), ""
  192. }
  193. respBytes, err := ioutil.ReadAll(resp.Body)
  194. if err != nil {
  195. fmt.Println(err.Error())
  196. return err.Error(), ""
  197. }
  198. fmt.Println(string(respBytes))
  199. str := string(respBytes)
  200. return str, inputLog
  201. }
  202. func OpCancelKeepAccounts() (string, string) {
  203. input := make(map[string]interface{})
  204. inputData := make(map[string]interface{})
  205. inputData["docId"] = "" // 就诊凭证编号
  206. inputData["operCode"] = "" // 开始时间
  207. inputData["operName"] = "" // 人员姓名
  208. input["req"] = inputData
  209. var inputLog string
  210. bytesData, err := json.Marshal(input)
  211. inputLog = string(bytesData)
  212. fmt.Println(string(bytesData))
  213. if err != nil {
  214. fmt.Println(err.Error())
  215. return err.Error(), ""
  216. }
  217. reader := bytes.NewReader(bytesData)
  218. var url string
  219. gdyb_url := "http://218.104.146.179:9091/esb/listener/opCancelKeepAccounts"
  220. url = gdyb_url
  221. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
  222. request, err := http.NewRequest("POST", url, reader)
  223. if err != nil {
  224. fmt.Println(err.Error())
  225. return err.Error(), ""
  226. }
  227. request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  228. request.Header.Set("code", "Xmrjyy")
  229. client := http.Client{}
  230. resp, err := client.Do(request)
  231. if err != nil {
  232. fmt.Println(err.Error())
  233. return err.Error(), ""
  234. }
  235. respBytes, err := ioutil.ReadAll(resp.Body)
  236. if err != nil {
  237. fmt.Println(err.Error())
  238. return err.Error(), ""
  239. }
  240. fmt.Println(string(respBytes))
  241. str := string(respBytes)
  242. return str, inputLog
  243. }