jsyb_service.go 127KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620
  1. package service
  2. import (
  3. //"bytes"
  4. "encoding/json"
  5. "fmt"
  6. "gdyb/models"
  7. "gdyb/utils/csbhttp"
  8. //"io/ioutil"
  9. "net"
  10. //"net/http"
  11. "strconv"
  12. "time"
  13. )
  14. func Jsyb2201F() (string, string) {
  15. // 生成签名
  16. timestamp := time.Now().Unix()
  17. tempTime := time.Unix(timestamp, 0)
  18. timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  19. // 生成输入报文
  20. inputMessage := SetJSInputMessage(timestamp, "盐城响水悦达血液透析中心有限公司", "王曙光", "H32092103007", "320921", "320921", "04aaa201baecc02c5f5e67d123810f2442dc04444e60a95ce529708bef8143f2fd3c5af38e21cccf9377c0ae3eef0a05528321f6265101a324802581709e2cdc297d94a3b176ed4112c8bc435d4f4362948720ea989bc58399fd251dd49b41d03356a1b99b6fd2c0bef2c6a2c970b03de9e3ce33499cc52b0c98a508d1eca0e104")
  21. //inputMessage := Se/**/tJSInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  22. input := make(map[string]interface{})
  23. inputData := make(map[string]interface{})
  24. inputMessage["infno"] = "2201" // 交易编码
  25. inputData["psn_no"] = "32090000000000001004606391" // 人员编号 (来自1101接口返回)
  26. inputData["insutype"] = "390" // 险种类型(来自1101接口返回)
  27. inputData["begntime"] = timeFormatOne // 开始时间
  28. //
  29. //if id_card_type == 1 {
  30. // inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  31. // inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
  32. //} else if id_card_type == 3 {
  33. // inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  34. // inputData["mdtrt_cert_no"] = "320822197705194836" + "|" + verify_number // 就诊凭证编号
  35. //} else {
  36. // inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
  37. // inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
  38. //
  39. //}
  40. inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  41. inputData["mdtrt_cert_no"] = "320822197705194836|Y9gJ7nijh+DzGkn2W8El9YxSR0x1/zb2+tcA4a5fsVC4RLNACwi93U4Q9xEJVKKnN6LCbomuiCuxDOI+Skz/wsjlScPKIzyXxBcKl9ZrZjCrr+cRTRRKRdz6JqhoexGR/Cxnipr62JOW2fmrI1X2XA==" // 就诊凭证编号
  42. inputData["ipt_otp_no"] = timeFormatOne // 住院/门诊号
  43. inputData["atddr_no"] = "2484" // 医师编码
  44. inputData["dr_name"] = "王曙光" // 医师姓名
  45. inputData["dept_code"] = "01" // 科室编码
  46. inputData["dept_name"] = "血透室" // 科室名称
  47. inputData["caty"] = "A03.06" // 科别
  48. input["data"] = inputData
  49. inputMessage["input"] = input //交易输入
  50. var requestLog string
  51. bytesData, err := json.Marshal(inputMessage)
  52. requestLog = string(bytesData)
  53. fmt.Println(string(bytesData))
  54. if err != nil {
  55. fmt.Println(err.Error())
  56. return err.Error(), ""
  57. }
  58. request_url := "http://10.72.3.87:8086/CSB/" + "2201"
  59. //request_url = request_url + "2201"
  60. return HttpRequest(request_url, "1781ce9fb73a478289326c16ba8bf2c4", "b5DPOGjc08DAAMJ8FP31pwwNHKo=", timestamp, string(bytesData)), requestLog
  61. }
  62. func Jsyb1101F() (string, string) {
  63. timestamp := time.Now().Unix()
  64. //生成输入报文
  65. inputMessage := SetJSInputMessage(timestamp, "盐城响水悦达血液透析中心有限公司", "王曙光", "H32092103007", "320921", "320921", "04aaa201baecc02c5f5e67d123810f2442dc04444e60a95ce529708bef8143f2fd3c5af38e21cccf9377c0ae3eef0a05528321f6265101a324802581709e2cdc297d94a3b176ed4112c8bc435d4f4362948720ea989bc58399fd251dd49b41d03356a1b99b6fd2c0bef2c6a2c970b03de9e3ce33499cc52b0c98a508d1eca0e104")
  66. input := make(map[string]interface{})
  67. inputData := make(map[string]interface{})
  68. inputMessage["infno"] = "1101" // 交易编码
  69. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  70. inputData["card_sn"] = "" // 卡识别码
  71. inputData["certno"] = "" // 证件号码
  72. inputData["psn_cert_type"] = "01" // 人员证件类型
  73. inputData["mdtrt_cert_no"] = "320926196707111797|" // 就诊凭证编号
  74. inputData["begntime"] = "" // 开始时间
  75. inputData["psn_name"] = "" // 人员姓名
  76. input["data"] = inputData
  77. inputMessage["input"] = input //交易输入
  78. var inputLog string
  79. bytesData, _ := json.Marshal(inputMessage)
  80. inputLog = string(bytesData)
  81. fmt.Println(string(bytesData))
  82. if err != nil {
  83. fmt.Println(err.Error())
  84. return err.Error(), ""
  85. }
  86. request_url := "http://10.72.3.87:8086/CSB/" + "1101"
  87. return HttpRequest(request_url, "1781ce9fb73a478289326c16ba8bf2c4", "b5DPOGjc08DAAMJ8FP31pwwNHKo=", timestamp, string(bytesData)), inputLog
  88. }
  89. // 人员基本信息
  90. func Jsyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, cainfo string) (string, string) {
  91. timestamp := time.Now().Unix()
  92. //生成输入报文
  93. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  94. input := make(map[string]interface{})
  95. inputData := make(map[string]interface{})
  96. inputMessage["infno"] = "1101" // 交易编码
  97. if certificates == "3" {
  98. inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
  99. inputData["certno"] = certNo // 证件号码
  100. inputData["psn_cert_type"] = "99" // 人员证件类型
  101. } else {
  102. if id_card_type == 1 {
  103. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  104. inputData["card_sn"] = card_sn // 卡识别码
  105. inputData["certno"] = certNo // 证件号码
  106. inputData["psn_cert_type"] = "01" // 人员证件类型
  107. } else {
  108. inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
  109. inputData["card_sn"] = "" // 卡识别码
  110. inputData["certno"] = certNo // 证件号码
  111. inputData["psn_cert_type"] = "01" // 人员证件类型
  112. }
  113. }
  114. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  115. inputData["begntime"] = "" // 开始时间
  116. inputData["psn_name"] = "" // 人员姓名
  117. input["data"] = inputData
  118. inputMessage["input"] = input //交易输入
  119. var inputLog string
  120. bytesData, _ := json.Marshal(inputMessage)
  121. inputLog = string(bytesData)
  122. fmt.Println(string(bytesData))
  123. if err != nil {
  124. fmt.Println(err.Error())
  125. return err.Error(), ""
  126. }
  127. request_url = request_url + "1101"
  128. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), inputLog
  129. }
  130. // 人员基本信息版本2
  131. func Jsyb1101A(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, pBusiCardInfo string, id_card_no string, cainfo string) (string, string) {
  132. timestamp := time.Now().Unix()
  133. //生成输入报文
  134. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  135. input := make(map[string]interface{})
  136. inputData := make(map[string]interface{})
  137. inputMessage["infno"] = "1101" // 交易编码
  138. if certificates == "3" {
  139. inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
  140. inputData["certno"] = certNo // 证件号码
  141. inputData["psn_cert_type"] = "99" // 人员证件类型
  142. } else {
  143. if id_card_type == 1 {
  144. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  145. inputData["card_sn"] = card_sn // 卡识别码
  146. inputData["certno"] = id_card_no // 证件号码
  147. inputData["psn_cert_type"] = "01" // 人员证件类型
  148. } else {
  149. inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
  150. inputData["card_sn"] = "" // 卡识别码
  151. inputData["certno"] = certNo // 证件号码
  152. inputData["psn_cert_type"] = "01" // 人员证件类型
  153. }
  154. }
  155. inputData["mdtrt_cert_no"] = certNo + "|" + pBusiCardInfo // 就诊凭证编号
  156. inputData["begntime"] = "" // 开始时间
  157. inputData["psn_name"] = "" // 人员姓名
  158. input["data"] = inputData
  159. inputMessage["input"] = input //交易输入
  160. var inputLog string
  161. bytesData, _ := json.Marshal(inputMessage)
  162. inputLog = string(bytesData)
  163. fmt.Println(string(bytesData))
  164. if err != nil {
  165. fmt.Println(err.Error())
  166. return err.Error(), ""
  167. }
  168. request_url = request_url + "1101"
  169. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), inputLog
  170. }
  171. func Jsyb1101B(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, Token string, cainfo string, id_card_no string) (string, string) {
  172. timestamp := time.Now().Unix()
  173. //生成输入报文
  174. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  175. input := make(map[string]interface{})
  176. inputData := make(map[string]interface{})
  177. inputMessage["infno"] = "1101" // 交易编码
  178. inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  179. inputData["card_sn"] = "" // 卡识别码
  180. inputData["certno"] = "" // 证件号码
  181. inputData["psn_cert_type"] = "01" // 人员证件类型
  182. inputData["mdtrt_cert_no"] = id_card_no + "|" + Token // 就诊凭证编号
  183. inputData["begntime"] = "" // 开始时间
  184. inputData["psn_name"] = "" // 人员姓名
  185. input["data"] = inputData
  186. inputMessage["input"] = input //交易输入
  187. var inputLog string
  188. bytesData, _ := json.Marshal(inputMessage)
  189. inputLog = string(bytesData)
  190. fmt.Println(string(bytesData))
  191. if err != nil {
  192. fmt.Println(err.Error())
  193. return err.Error(), ""
  194. }
  195. request_url = request_url + "1101"
  196. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), inputLog
  197. }
  198. func Jsyb1101ForEleCert(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, Token string, cainfo string, id_card_no string, name string) (string, string) {
  199. timestamp := time.Now().Unix()
  200. //生成输入报文
  201. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  202. input := make(map[string]interface{})
  203. inputData := make(map[string]interface{})
  204. inputMessage["infno"] = "1101" // 交易编码
  205. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  206. inputData["card_sn"] = "" // 卡识别码
  207. inputData["certno"] = id_card_no // 证件号码
  208. inputData["psn_cert_type"] = "1" // 人员证件类型
  209. inputData["mdtrt_cert_no"] = Token // 就诊凭证编号
  210. inputData["begntime"] = "" // 开始时间
  211. inputData["psn_name"] = name // 人员姓名
  212. input["data"] = inputData
  213. inputMessage["input"] = input //交易输入
  214. var inputLog string
  215. bytesData, _ := json.Marshal(inputMessage)
  216. inputLog = string(bytesData)
  217. fmt.Println(string(bytesData))
  218. if err != nil {
  219. fmt.Println(err.Error())
  220. return err.Error(), ""
  221. }
  222. request_url = request_url + "1101"
  223. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), inputLog
  224. }
  225. // 门诊挂号
  226. func Jsyb2201(psnNo string, insutype string, certNo string, org_name string, opera string, ipt_otp_no string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, doctor_name string, request_url string, access_key string, verify_number string, cainfo string) (string, string) {
  227. fmt.Println(opera)
  228. // 生成签名
  229. timestamp := time.Now().Unix()
  230. tempTime := time.Unix(timestamp, 0)
  231. timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  232. // 生成输入报文
  233. inputMessage := SetJSInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  234. input := make(map[string]interface{})
  235. inputData := make(map[string]interface{})
  236. inputMessage["infno"] = "2201" // 交易编码
  237. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  238. inputData["insutype"] = insutype // 险种类型(来自1101接口返回)
  239. inputData["begntime"] = timeFormatOne // 开始时间
  240. if id_card_type == 1 {
  241. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  242. inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
  243. } else if id_card_type == 3 {
  244. inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  245. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  246. } else if id_card_type == 4 {
  247. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  248. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  249. } else {
  250. inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
  251. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  252. }
  253. inputData["ipt_otp_no"] = "11223333" // 住院/门诊号
  254. inputData["atddr_no"] = doctor_id // 医师编码
  255. inputData["dr_name"] = doctor_name // 医师姓名
  256. inputData["dept_code"] = dept_code // 科室编码
  257. inputData["dept_name"] = dept // 科室名称
  258. inputData["caty"] = "A03.06" // 科别
  259. inputData["exp_content"] = "" //
  260. input["data"] = inputData
  261. inputMessage["input"] = input //交易输入
  262. var requestLog string
  263. bytesData, err := json.Marshal(inputMessage)
  264. requestLog = string(bytesData)
  265. fmt.Println(string(bytesData))
  266. if err != nil {
  267. fmt.Println(err.Error())
  268. return err.Error(), ""
  269. }
  270. request_url = request_url + "2201"
  271. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  272. }
  273. // 门诊挂号撤销
  274. func Jsyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, fixmedins_code string, request_url string, access_key string, cainfo string) (string, string) {
  275. // 生成签名
  276. timestamp := time.Now().Unix()
  277. // 生成输入报文
  278. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  279. input := make(map[string]interface{})
  280. inputData := make(map[string]interface{})
  281. inputMessage["infno"] = "2202" // 交易编码
  282. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  283. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  284. inputData["ipt_otp_no"] = ipt_otp_no // 住院/门诊号
  285. //inputData["exp_content"] = "" // 人员编号 (来自1101接口返回)
  286. inputData["exp_content"] = "" //
  287. input["data"] = inputData
  288. inputMessage["input"] = input //交易输入
  289. var requestLog string
  290. bytesData, err := json.Marshal(inputMessage)
  291. fmt.Println(string(bytesData))
  292. requestLog = string(bytesData)
  293. if err != nil {
  294. fmt.Println(err.Error())
  295. return err.Error(), ""
  296. }
  297. request_url = request_url + "2202"
  298. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  299. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  300. }
  301. // 门诊就诊信息上传
  302. func Jsyb2203(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig, request_url string, access_key string, begin_time string, cainfo string) (string, string, int64) {
  303. // 生成签名
  304. timestamp := time.Now().Unix()
  305. tempTime := time.Unix(timestamp, 0)
  306. timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  307. // 生成输入报文
  308. inputMessage := SetJSInputMessage(timestamp, org_name, dept, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  309. input := make(map[string]interface{})
  310. inputData := make(map[string]interface{})
  311. diseinfo := make([]map[string]interface{}, 0)
  312. if med_type == "1111" || med_type == "1112" {
  313. med_type = "11"
  314. }
  315. inputMessage["infno"] = "2203A" // 交易编码
  316. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  317. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  318. inputData["med_type"] = med_type // 医疗类别 16门诊特殊病
  319. inputData["begntime"] = begin_time // 开始时间
  320. inputData["main_cond_dscr"] = "" // 主要病情描述
  321. inputData["dise_codg"] = sick_code // 病种编码
  322. inputData["dise_name"] = sick_name // 病种名称
  323. inputData["birctrl_type"] = "" // 计划生育手术类别
  324. inputData["birctrl_matn_date"] = "" // 计划生育手术或生育日期
  325. for index, item := range config {
  326. diseinfo_sun := make(map[string]interface{})
  327. diseinfo_sun["diag_type"] = "1" // 诊断类别
  328. diseinfo_sun["diag_srt_no"] = index // 诊断排序号
  329. diseinfo_sun["diag_code"] = item.CountryCode // 诊断代码
  330. diseinfo_sun["diag_name"] = item.ClassName // 诊断名称
  331. diseinfo_sun["diag_dept"] = department // 诊断科室
  332. diseinfo_sun["dise_dor_no"] = doctor_id // 诊断医生编码
  333. diseinfo_sun["dise_dor_name"] = doctor // 诊断医生姓名
  334. diseinfo_sun["diag_time"] = timeFormatOne // 诊断时间
  335. diseinfo_sun["vali_flag"] = "1" // 有效标志
  336. diseinfo = append(diseinfo, diseinfo_sun)
  337. }
  338. //inputData["exp_content"] = "" // 人员编号 (来自1101接口返回)
  339. inputData["exp_content"] = "" //
  340. input["diseinfo"] = diseinfo
  341. input["mdtrtinfo"] = inputData
  342. inputMessage["input"] = input //交易输入
  343. var requestLog string
  344. bytesData, err := json.Marshal(inputMessage)
  345. fmt.Println(string(bytesData))
  346. requestLog = string(bytesData)
  347. if err != nil {
  348. fmt.Println(err.Error())
  349. return err.Error(), "", 0
  350. }
  351. request_url = request_url + "2203A"
  352. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  353. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog, timestamp
  354. }
  355. // 门诊就诊信息上传
  356. func Jsyb2203A(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig, request_url string, access_key string, cainfo string) (string, string) {
  357. // 生成签名
  358. timestamp := time.Now().Unix()
  359. tempTime := time.Unix(timestamp, 0)
  360. timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  361. // 生成输入报文
  362. inputMessage := SetJSInputMessage(timestamp, org_name, dept, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  363. input := make(map[string]interface{})
  364. inputData := make(map[string]interface{})
  365. diseinfo := make([]map[string]interface{}, 0)
  366. if med_type == "1111" || med_type == "1112" {
  367. med_type = "11"
  368. }
  369. inputMessage["infno"] = "2203A" // 交易编码
  370. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  371. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  372. inputData["med_type"] = med_type // 医疗类别 16门诊特殊病
  373. inputData["begntime"] = timeFormatOne // 开始时间
  374. inputData["main_cond_dscr"] = "" // 主要病情描述
  375. inputData["dise_codg"] = sick_code // 病种编码
  376. inputData["dise_name"] = sick_name // 病种名称
  377. inputData["birctrl_type"] = "" // 计划生育手术类别
  378. inputData["birctrl_matn_date"] = "" // 计划生育手术或生育日期
  379. inputData["matn_type"] = "" // 生育类别
  380. inputData["geso_val"] = "" // 孕周数
  381. for index, item := range config {
  382. diseinfo_sun := make(map[string]interface{})
  383. diseinfo_sun["diag_type"] = "1" // 诊断类别
  384. diseinfo_sun["diag_srt_no"] = index // 诊断排序号
  385. diseinfo_sun["diag_code"] = item.CountryCode // 诊断代码
  386. diseinfo_sun["diag_name"] = item.ClassName // 诊断名称
  387. diseinfo_sun["diag_dept"] = department // 诊断科室
  388. diseinfo_sun["dise_dor_no"] = doctor_id // 诊断医生编码
  389. diseinfo_sun["dise_dor_name"] = doctor // 诊断医生姓名
  390. diseinfo_sun["diag_time"] = timeFormatOne // 诊断时间
  391. diseinfo_sun["vali_flag"] = "1" // 有效标志
  392. diseinfo = append(diseinfo, diseinfo_sun)
  393. }
  394. input["diseinfo"] = diseinfo
  395. input["mdtrtinfo"] = inputData
  396. inputMessage["input"] = input //交易输入
  397. var requestLog string
  398. bytesData, err := json.Marshal(inputMessage)
  399. fmt.Println(string(bytesData))
  400. requestLog = string(bytesData)
  401. if err != nil {
  402. fmt.Println(err.Error())
  403. return err.Error(), ""
  404. }
  405. request_url = request_url + "2203A"
  406. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  407. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  408. }
  409. // 门诊费用明细信息上传
  410. func Jsyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, balance_accounts_type string, diag_code string, request_url string, access_key string, new_doctor_name string, time_stamp_2203 string, cainfo string) (string, string) {
  411. // 生成签名
  412. //timestamp := time.Now().Unix()
  413. timestamp := time.Now().Unix()
  414. timestamp2 := time.Now().Unix()
  415. //tempTime := time.Unix(timestamp2, 0)
  416. //timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  417. var customs []*Custom
  418. for _, item := range hisPrescription {
  419. tm := time.Unix(item.PreTime, 0)
  420. if item.Type == 1 { //药品
  421. for _, subItem := range item.HisDoctorAdviceInfo {
  422. if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
  423. //var randNum int
  424. //randNum = rand.Intn(10000) + 1000
  425. cus := &Custom{
  426. DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*subItem.PrescribingNumber),
  427. Cut: fmt.Sprintf("%.4f", subItem.PrescribingNumber),
  428. FeedetlSn: subItem.FeedetlSn,
  429. Price: fmt.Sprintf("%.4f", subItem.Price),
  430. MedListCodg: subItem.BaseDrugLib.MedicalInsuranceNumber,
  431. HospApprFlag: subItem.HospApprFlag,
  432. DoctorNumber: doctor_id,
  433. DoctorName: new_doctor_name,
  434. ProvinceDrugMedListCodg: "",
  435. ProvinceGoodMedListCodg: "",
  436. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  437. }
  438. if subItem.BaseDrugLib.DrugClassify == "2" {
  439. cus.ProvinceDrugMedListCodg = subItem.BaseDrugLib.ProvincesCode
  440. }
  441. customs = append(customs, cus)
  442. }
  443. }
  444. }
  445. if item.Type == 2 { //项目
  446. for _, subItem := range item.HisPrescriptionProject {
  447. //var randNum int
  448. //randNum = rand.Intn(10000) + 1000
  449. if subItem.Type == 2 {
  450. if len(subItem.HisProject.MedicalCode) > 0 {
  451. cnt, _ := strconv.ParseFloat(subItem.Count, 64)
  452. cus := &Custom{
  453. DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
  454. Cut: fmt.Sprintf("%.4f", cnt),
  455. FeedetlSn: subItem.FeedetlSn,
  456. Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
  457. MedListCodg: subItem.HisProject.MedicalCode,
  458. DoctorNumber: doctor_id,
  459. DoctorName: new_doctor_name,
  460. HospApprFlag: -1,
  461. ProvinceDrugMedListCodg: "",
  462. ProvinceGoodMedListCodg: "",
  463. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  464. }
  465. customs = append(customs, cus)
  466. }
  467. } else if subItem.Type == 3 {
  468. if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
  469. cnt, _ := strconv.ParseFloat(subItem.Count, 64)
  470. cus := &Custom{
  471. DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
  472. Cut: fmt.Sprintf("%.4f", cnt),
  473. FeedetlSn: subItem.FeedetlSn,
  474. Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
  475. MedListCodg: subItem.GoodInfo.MedicalInsuranceNumber,
  476. HospApprFlag: -1,
  477. DoctorNumber: doctor_id,
  478. DoctorName: new_doctor_name,
  479. ProvinceDrugMedListCodg: "",
  480. ProvinceGoodMedListCodg: subItem.GoodInfo.ProvincesCode,
  481. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  482. }
  483. customs = append(customs, cus)
  484. }
  485. }
  486. }
  487. }
  488. for _, subItem := range item.HisAdditionalCharge {
  489. if len(subItem.XtHisAddtionConfig.Code) > 0 {
  490. cus := &Custom{
  491. DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*float64(subItem.Count)),
  492. Cut: fmt.Sprintf("%.4f", float64(subItem.Count)),
  493. FeedetlSn: subItem.FeedetlSn,
  494. Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
  495. MedListCodg: subItem.XtHisAddtionConfig.Code,
  496. HospApprFlag: -1,
  497. DoctorNumber: doctor_id,
  498. DoctorName: new_doctor_name,
  499. }
  500. customs = append(customs, cus)
  501. }
  502. }
  503. }
  504. // 生成输入报文
  505. inputMessage := SetJSInputMessage(timestamp2, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  506. input := make(map[string]interface{})
  507. feedetail := make([]map[string]interface{}, 0)
  508. inputMessage["infno"] = "2204" // 交易编码
  509. //chrg_bchno := timeFormat + strconv.FormatInt(int64(chrgBchno), 10)
  510. for _, item := range customs {
  511. feedetailInfo := make(map[string]interface{})
  512. subfeedetailInfo := make(map[string]interface{})
  513. feedetailInfo["feedetl_sn"] = item.FeedetlSn
  514. feedetailInfo["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  515. feedetailInfo["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  516. feedetailInfo["chrg_bchno"] = chrg_bchno // 收费批次号
  517. feedetailInfo["dise_codg"] = diag_code // 病种编码
  518. feedetailInfo["rxno"] = "" // 处方号
  519. feedetailInfo["rx_circ_flag"] = "0" // 外购处方标志
  520. feedetailInfo["fee_ocur_time"] = item.FeeOcurTime // 费用发生时间
  521. feedetailInfo["med_list_codg"] = item.MedListCodg // 医疗目录编码
  522. feedetailInfo["medins_list_codg"] = fixmedins_code // 医药机构目录编码
  523. feedetailInfo["det_item_fee_sumamt"] = item.DetItemFeeSumamt // 明细项目费用总额
  524. feedetailInfo["cnt"] = item.Cut // 数量
  525. feedetailInfo["pric"] = item.Price // 单价
  526. feedetailInfo["sin_dos_dscr"] = "" // 单次剂量描述
  527. feedetailInfo["used_frqu_dscr"] = "" // 使用频次描述
  528. feedetailInfo["prd_days"] = "0" // 周期天数
  529. feedetailInfo["medc_way_dscr"] = "" // 用药途径描述
  530. feedetailInfo["bilg_dept_codg"] = dept_code // 开单科室编码
  531. feedetailInfo["bilg_dept_name"] = dept // 开单科室名称
  532. feedetailInfo["bilg_dr_codg"] = item.DoctorNumber // 开单医生编码
  533. feedetailInfo["bilg_dr_name"] = item.DoctorName // 开单医师姓名
  534. feedetailInfo["acord_dept_codg"] = "" // 受单科室编码
  535. feedetailInfo["acord_dept_name"] = "" // 受单科室名称
  536. feedetailInfo["orders_dr_code"] = item.DoctorNumber // 受单医生编码
  537. feedetailInfo["orders_dr_name"] = item.DoctorName // 受单医生姓名
  538. if balance_accounts_type == "8" {
  539. feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
  540. } else {
  541. if item.HospApprFlag != -1 {
  542. if item.HospApprFlag == 1 {
  543. feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
  544. } else if item.HospApprFlag == 2 {
  545. feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
  546. } else if item.HospApprFlag == 3 {
  547. feedetailInfo["hosp_appr_flag"] = "0" // 医院审批标志
  548. } else {
  549. feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
  550. }
  551. } else {
  552. feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
  553. }
  554. }
  555. feedetailInfo["tcmdrug_used_way"] = "" // 中药使用方式
  556. feedetailInfo["etip_flag"] = "" // 外检标志
  557. feedetailInfo["etip_hosp_code"] = "" // 外检医院编码
  558. feedetailInfo["dscg_tkdrug_flag"] = "" // 出院带药标志
  559. feedetailInfo["matn_fee_flag"] = "" // 生育费用标志
  560. subfeedetailInfo["tcmherb_prov_code"] = item.ProvinceDrugMedListCodg
  561. subfeedetailInfo["mcs_prov_code"] = item.ProvinceGoodMedListCodg
  562. feedetailInfo["exp_content"] = subfeedetailInfo
  563. feedetail = append(feedetail, feedetailInfo)
  564. }
  565. input["feedetail"] = feedetail
  566. inputMessage["input"] = input //交易输入
  567. var requestLog string
  568. bytesData, err := json.Marshal(inputMessage)
  569. requestLog = string(bytesData)
  570. fmt.Println(string(bytesData))
  571. if err != nil {
  572. fmt.Println(err.Error())
  573. return "", ""
  574. }
  575. request_url = request_url + "2204"
  576. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  577. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  578. }
  579. // 门诊费用明细信息撤销
  580. func Jsyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, fixmedins_code string, request_url string, access_key string, cainfo string) (string, string) {
  581. timestamp := time.Now().Unix()
  582. // 生成输入报文
  583. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  584. input := make(map[string]interface{})
  585. inputData := make(map[string]interface{})
  586. inputMessage["infno"] = "2205" // 交易编码
  587. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  588. inputData["chrg_bchno"] = "0000" // 收费批次号(来自2204生成的)
  589. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  590. inputData["exp_content"] = "" // 人员编号 (来自1101接口返回)
  591. input["data"] = inputData
  592. inputMessage["input"] = input //交易输入
  593. bytesData, err := json.Marshal(inputMessage)
  594. fmt.Println(string(bytesData))
  595. var requestLog string
  596. requestLog = string(bytesData)
  597. if err != nil {
  598. fmt.Println(err.Error())
  599. return err.Error(), ""
  600. }
  601. request_url = request_url + "2205"
  602. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  603. }
  604. // 门诊预结算
  605. func Jsyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, request_url string, access_key string, verify_number string, cainfo string, mdtrt_grp_type string) (string, string) {
  606. // 生成签名
  607. timestamp := time.Now().Unix() // inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  608. // inputData["mdtrt_cert_no"] = certNo
  609. // 生成输入报文
  610. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  611. input := make(map[string]interface{})
  612. inputData := make(map[string]interface{})
  613. inputMessage["infno"] = "2206" // 交易编码
  614. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  615. if certificates == 3 {
  616. inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
  617. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  618. } else {
  619. if id_card_type == 1 {
  620. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  621. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  622. } else if id_card_type == 3 {
  623. inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  624. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  625. } else if id_card_type == 4 {
  626. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  627. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  628. } else {
  629. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  630. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  631. }
  632. }
  633. if insuplc_admdvs == "421300" {
  634. if med_type == "11" || med_type == "1112" || med_type == "1111" {
  635. inputData["med_type"] = "110104" // 医疗类别 11 普通门诊 12 门诊挂号
  636. } else if med_type == "14" {
  637. inputData["med_type"] = "140110" // 医疗类别 11 普通门诊 12 门诊挂号
  638. }
  639. } else {
  640. inputData["med_type"] = med_type // 医疗类别 11 普通门诊 12 门诊挂号
  641. }
  642. inputData["medfee_sumamt"] = total // 医疗费总额
  643. inputData["psn_setlway"] = "01" // 个人结算方式 01 按项目结 02 按定额结算
  644. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  645. inputData["chrg_bchno"] = chrgBchno // 收费批次号(来自2204生成的)
  646. inputData["acct_used_flag"] = "0" // 个人账户使用标志 0否 1是
  647. inputData["insutype"] = insutype // 险种类型
  648. inputData["invono"] = "" // 发票号
  649. inputData2 := make(map[string]interface{})
  650. inputData2["trum_flag"] = ""
  651. inputData2["rel_ttp_flag"] = ""
  652. inputData2["otp_er_refl_flag"] = ""
  653. inputData2["mdtrt_grp_type"] = mdtrt_grp_type
  654. inputData2["need_ipt_flag"] = ""
  655. inputData["exp_content"] = inputData2
  656. input["data"] = inputData
  657. inputMessage["input"] = input //交易输入
  658. var requestLog string
  659. bytesData, err := json.Marshal(inputMessage)
  660. requestLog = string(bytesData)
  661. fmt.Println(string(bytesData))
  662. if err != nil {
  663. fmt.Println(err.Error())
  664. return err.Error(), ""
  665. }
  666. request_url = request_url + "2206"
  667. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  668. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
  669. }
  670. // 门诊结算
  671. func Jsyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, verify_number string, cainfo string, mdtrt_grp_type string) (string, string) {
  672. // 生成签名
  673. timestamp := time.Now().Unix()
  674. // 生成输入报文
  675. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  676. input := make(map[string]interface{})
  677. inputData := make(map[string]interface{})
  678. inputMessage["infno"] = "2207" // 交易编码
  679. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  680. if certificates == 3 {
  681. inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
  682. inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
  683. } else {
  684. if id_card_type == 1 {
  685. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  686. inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
  687. } else if id_card_type == 3 {
  688. inputData["mdtrt_cert_type"] = "04" // 就诊凭证类型
  689. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  690. } else if id_card_type == 4 {
  691. inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
  692. inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号
  693. } else {
  694. }
  695. }
  696. if med_type == "1111" || med_type == "1112" {
  697. med_type = "11"
  698. }
  699. if insuplc_admdvs == "421300" {
  700. if med_type == "11" {
  701. inputData["med_type"] = "110104" // 医疗类别 11 普通门诊 12 门诊挂号
  702. } else if med_type == "14" {
  703. inputData["med_type"] = "140101" // 医疗类别 11 普通门诊 12 门诊挂号
  704. }
  705. } else {
  706. inputData["med_type"] = med_type // 医疗类别 11 普通门诊 12 门诊挂号
  707. }
  708. inputData["medfee_sumamt"] = total // 医疗费总额
  709. inputData["psn_setlway"] = "01" // 个人结算方式 01 按项目结 02 按定额结算
  710. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  711. inputData["chrg_bchno"] = chrgBchno // 收费批次号(来自2204生成的)
  712. inputData["acct_used_flag"] = acct_used_flag // 个人账户使用标志 0否 1是
  713. inputData["insutype"] = insutype // 险种类型
  714. inputData["invono"] = "" // 发票号
  715. inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt //
  716. inputData["overlmt_selfpay"] = overlmt_selfpay //
  717. inputData["preselfpay_amt"] = preselfpay_amt //
  718. inputData["inscp_scp_amt"] = inscp_scp_amt //
  719. inputData2 := make(map[string]interface{})
  720. inputData2["trum_flag"] = ""
  721. inputData2["rel_ttp_flag"] = ""
  722. inputData2["otp_er_refl_flag"] = ""
  723. inputData2["mdtrt_grp_type"] = mdtrt_grp_type
  724. inputData2["need_ipt_flag"] = ""
  725. inputData["exp_content"] = inputData2
  726. input["data"] = inputData
  727. inputMessage["input"] = input //交易输入
  728. bytesData, err := json.Marshal(inputMessage)
  729. fmt.Println(string(bytesData))
  730. if err != nil {
  731. fmt.Println(err.Error())
  732. return err.Error(), ""
  733. }
  734. request_url = request_url + "2207"
  735. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  736. }
  737. func Jsyb2207A(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, cainfo string) (string, string) {
  738. // 生成签名
  739. timestamp := time.Now().Unix()
  740. // 生成输入报文
  741. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  742. input := make(map[string]interface{})
  743. inputData := make(map[string]interface{})
  744. inputMessage["infno"] = "2207A" // 交易编码
  745. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  746. if certificates == 3 {
  747. inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
  748. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  749. } else {
  750. if id_card_type == 1 {
  751. inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
  752. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  753. } else {
  754. inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
  755. inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
  756. }
  757. }
  758. if med_type == "1111" || med_type == "1112" {
  759. med_type = "11"
  760. }
  761. if insuplc_admdvs == "421300" {
  762. if med_type == "11" {
  763. inputData["med_type"] = "110104" // 医疗类别 11 普通门诊 12 门诊挂号
  764. } else if med_type == "14" {
  765. inputData["med_type"] = "140101" // 医疗类别 11 普通门诊 12 门诊挂号
  766. }
  767. } else {
  768. inputData["med_type"] = med_type // 医疗类别 11 普通门诊 12 门诊挂号
  769. }
  770. inputData["medfee_sumamt"] = total // 医疗费总额
  771. inputData["psn_setlway"] = "01" // 个人结算方式 01 按项目结 02 按定额结算
  772. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  773. inputData["chrg_bchno"] = chrgBchno // 收费批次号(来自2204生成的)
  774. inputData["acct_used_flag"] = acct_used_flag // 个人账户使用标志 0否 1是
  775. inputData["insutype"] = insutype // 险种类型
  776. inputData["invono"] = "" // 发票号
  777. inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt //
  778. inputData["overlmt_selfpay"] = overlmt_selfpay //
  779. inputData["preselfpay_amt"] = preselfpay_amt //
  780. inputData["inscp_scp_amt"] = inscp_scp_amt //
  781. input["data"] = inputData
  782. inputMessage["input"] = input //交易输入
  783. bytesData, err := json.Marshal(inputMessage)
  784. fmt.Println(string(bytesData))
  785. if err != nil {
  786. fmt.Println(err.Error())
  787. return err.Error(), ""
  788. }
  789. request_url = request_url + "2207A"
  790. //fmt.Println(HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)))
  791. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  792. }
  793. // 门诊结算撤销
  794. func Jsyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doctor string, secret_key string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, cainfo string) (string, string) {
  795. timestamp := time.Now().Unix()
  796. // 生成输入报文
  797. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  798. input := make(map[string]interface{})
  799. inputData := make(map[string]interface{})
  800. inputMessage["infno"] = "2208" // 交易编码
  801. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  802. inputData["mdtrt_id"] = mdtrtId // 就诊 ID(来自2201接口返回)
  803. inputData["setl_id"] = setlId // 结算 ID
  804. inputData["exp_content"] = "" // 人员编号 (来自1101接口返回)
  805. input["data"] = inputData
  806. inputMessage["input"] = input //交易输入
  807. bytesData, err := json.Marshal(inputMessage)
  808. fmt.Println(string(bytesData))
  809. if err != nil {
  810. fmt.Println(err.Error())
  811. return err.Error(), ""
  812. }
  813. request_url = request_url + "2208"
  814. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  815. }
  816. func Jsyb5203(baseParams models.BaseParams, businessParams models.BusinessParams) (string, string) {
  817. timestamp := time.Now().Unix()
  818. // 生成输入报文
  819. inputMessage := SetJSInputMessage(timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs, baseParams.Cainfo)
  820. input := make(map[string]interface{})
  821. inputData := make(map[string]interface{})
  822. inputMessage["infno"] = "5203" // 交易编码
  823. inputData["psn_no"] = businessParams.PsnNo
  824. inputData["setl_id"] = businessParams.SetlId
  825. inputData["mdtrt_id"] = businessParams.MdtrtId
  826. input["data"] = inputData
  827. inputMessage["input"] = input //交易输入
  828. bytesData, err := json.Marshal(inputMessage)
  829. fmt.Println(string(bytesData))
  830. if err != nil {
  831. fmt.Println(err.Error())
  832. return err.Error(), ""
  833. }
  834. baseParams.RequestUrl = baseParams.RequestUrl + "5203"
  835. //fmt.Println(HttpRequest(baseParams.RequestUrl, baseParams.AccessKey, baseParams.SecretKey, timestamp, string(bytesData)))
  836. return HttpRequest(baseParams.RequestUrl, baseParams.AccessKey, baseParams.SecretKey, timestamp, string(bytesData)), string(bytesData)
  837. }
  838. // CBS总线
  839. func HttpRequest(url string, ak string, sk string, timestamp int64, json string) string {
  840. fmt.Println(url)
  841. //step 1. 设置请求参数
  842. csbHP := csbhttp.NewHttpParams(url) //设置请求地址及url参数
  843. //设置调用方式 get 或者 post
  844. csbHP.SetMethod("post")
  845. //csbHP.AddParam("input", "")
  846. //设置 调用的服务名和版本
  847. csbHP.SetApi("hssServives")
  848. csbHP.SetVersion("1.0.0")
  849. //添加附加的http请求头 (可以定义多条)
  850. //key := "_api_access_key=" + ak + "&_api_name=" + "hssServives" + "&_api_timestamp=" + strconv.FormatInt(timestamp, 10) + "&_api_version=" + "1.0.0"
  851. csbHP.AddHeader("_api_timestamp", strconv.FormatInt(timestamp, 10))
  852. csbHP.AddHeader("_api_name", "hssServives")
  853. csbHP.AddHeader("_api_version", "1.0.0")
  854. csbHP.AddHeader("_api_access_key", ak)
  855. csbHP.AddHeader("Content-Type", "application/json;charset=UTF-8")
  856. //request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  857. //还可以,设置附加的byte[]或者json请求体
  858. csbHP.SetContentBody(json, nil)
  859. //设置请求的ak和sk
  860. csbHP.SetAK(ak)
  861. csbHP.SetSK(sk)
  862. //打印请求参数信息
  863. csbHP.Print()
  864. //进行调用, 返回的第二项为resonse http headers (map[string][]string类型)
  865. //res, _, err := csbhttp.Invoke(*csbHP, requestByte)
  866. res, _, err := csbhttp.Invoke(*csbHP, strconv.FormatInt(timestamp, 10))
  867. //是否发成错误
  868. if err != nil {
  869. fmt.Println(err)
  870. return ""
  871. }
  872. fmt.Println(res)
  873. return res
  874. }
  875. // 生成基础报文
  876. func SetJSInputMessage(timestamp int64, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, cainfo string) map[string]interface{} {
  877. // 生成签名
  878. tempTime := time.Unix(timestamp, 0)
  879. //timeFormat := tempTime.Format("20060102150405")
  880. timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  881. //randNum := rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000)
  882. month := time.Unix(1557042972, 0).Format("1")
  883. year := time.Now().Format("2006")
  884. month = time.Now().Format("01")
  885. day := time.Now().Format("02")
  886. hour := time.Now().Format("15")
  887. min := time.Now().Format("04")
  888. sec := time.Now().Format("05")
  889. msec := time.Now().Format("000")
  890. // 生成输入报文
  891. inputMessage := make(map[string]interface{})
  892. inputMessage["msgid"] = fixmedins_code + year + month + day + hour + min + sec + msec + "0" // 发送方报文 ID
  893. inputMessage["mdtrtarea_admvs"] = mdtrtarea_admvs // 就医地医保区划
  894. inputMessage["insuplc_admdvs"] = insuplc_admdvs // 参保地医保区划
  895. inputMessage["recer_sys_code"] = "MBS_LOCAL" // 接收方系统代码
  896. inputMessage["dev_no"] = "1" // 设备编号
  897. inputMessage["dev_safe_info"] = "1" // 设备安全信息
  898. inputMessage["cainfo"] = cainfo // 数字签名信息
  899. inputMessage["signtype"] = "SM3" // 签名类型
  900. inputMessage["infver"] = "1.0.0" // 接收方系统代码
  901. inputMessage["opter_type"] = "1" // 经办人类别
  902. if fixmedins_code == "H32090403023" {
  903. inputMessage["opter"] = doctor // 经办人
  904. inputMessage["opter_name"] = doctor // 经办人姓名
  905. } else {
  906. inputMessage["opter"] = doctor // 经办人
  907. inputMessage["opter_name"] = doctor // 经办人姓名
  908. }
  909. inputMessage["inf_time"] = timeFormatOne // 交易时间
  910. inputMessage["fixmedins_code"] = fixmedins_code // 定点医药机构编号
  911. inputMessage["fixmedins_name"] = org_name
  912. inputMessage["fixmedins_soft_fcty"] = "深圳市领透科技有限公司" //定点医药机构名称
  913. //定点医药机构名称
  914. inputMessage["sign_no"] = "" //交易签到流水号
  915. return inputMessage
  916. }
  917. func Jsyb5301(psnNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, cainfo string) (string, string) {
  918. // 生成签名
  919. //nonce := GetRandomString(32)
  920. timestamp := time.Now().Unix()
  921. //signature := setSignature(timestamp, nonce, secret_key)
  922. //tempTime := time.Unix(timestamp, 0)
  923. //timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  924. //timeFormatTwo := tempTime.Format("2006-01-02")
  925. // 生成输入报文
  926. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  927. input := make(map[string]interface{})
  928. inputData := make(map[string]interface{})
  929. inputMessage["infno"] = "5301" // 交易编码
  930. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  931. input["data"] = inputData
  932. inputMessage["input"] = input //交易输入
  933. bytesData, err := json.Marshal(inputMessage)
  934. fmt.Println(string(bytesData))
  935. if err != nil {
  936. fmt.Println(err.Error())
  937. return err.Error(), ""
  938. }
  939. request_url = request_url + "5301"
  940. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  941. }
  942. func Jsyb2503(psnNo string, insutype string, org_name string, doctor string, fixmedins_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_name string, sick_code string, start_time string, end_time string, check_time string, request_url string, access_key string, cainfo string) (string, string) {
  943. timestamp := time.Now().Unix()
  944. // 生成输入报文
  945. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  946. input := make(map[string]interface{})
  947. inputData := make(map[string]interface{})
  948. inputMessage["infno"] = "2503" // 交易编码
  949. inputData["psn_no"] = psnNo // 人员编号 (来自1101接口返回)
  950. inputData["insutype"] = insutype // 险种类型(来自1101接口返回)
  951. inputData["opsp_dise_code"] = sick_code // 险种类型(来自1101接口返回)
  952. inputData["opsp_dise_name"] = sick_name // 险种类型(来自1101接口返回)
  953. inputData["insu_optins"] = insuplc_admdvs // 险种类型(来自1101接口返回)
  954. inputData["ide_fixmedins_no"] = fixmedins_code // 险种类型(来自1101接口返回)
  955. inputData["ide_fixmedins_name"] = org_name // 险种类型(来自1101接口返回)
  956. inputData["hosp_ide_date"] = check_time // 险种类型(来自1101接口返回)
  957. inputData["diag_dr_codg"] = doctor_id // 开始时间
  958. inputData["diag_dr_name"] = doctor // 开始时间
  959. inputData["begndate"] = start_time // 医师编码
  960. inputData["tel"] = "" // 医师编码
  961. inputData["addr"] = "" // 医师编码
  962. inputData["enddate"] = end_time // 医师编码
  963. input["data"] = inputData
  964. inputMessage["input"] = input //交易输入
  965. bytesData, err := json.Marshal(inputMessage)
  966. fmt.Println(string(bytesData))
  967. if err != nil {
  968. fmt.Println(err.Error())
  969. return err.Error(), ""
  970. }
  971. request_url = request_url + "2503"
  972. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  973. }
  974. func Jsyb3201(fixmedins_setl_cnt int64, acct_pay float64, fund_pay_sumamt float64, medfee_sumamt float64, stmt_begndate string, stmt_enddate string, setl_optins string, clr_type string, insutype string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  975. // 生成签名
  976. timestamp := time.Now().Unix()
  977. // 生成输入报文
  978. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  979. input := make(map[string]interface{})
  980. inputData := make(map[string]interface{})
  981. inputMessage["infno"] = "3201" // 交易编码
  982. inputData["insutype"] = insutype // 险种
  983. inputData["clr_type"] = clr_type // 就诊 ID(来自2201接口返回)
  984. inputData["setl_optins"] = setl_optins // 结算经办机构
  985. inputData["stmt_begndate"] = stmt_begndate // 对帐开始时间
  986. inputData["stmt_enddate"] = stmt_enddate //对帐结束时间
  987. inputData["medfee_sumamt"] = medfee_sumamt //医疗费总额
  988. inputData["fund_pay_sumamt"] = fund_pay_sumamt //基金支付总额
  989. inputData["acct_pay"] = acct_pay //个人账户支付金额
  990. inputData["fixmedins_setl_cnt"] = fixmedins_setl_cnt //定点医药机构结算笔数
  991. inputData["refd_setl_flag"] = 0 //
  992. input["data"] = inputData
  993. inputMessage["input"] = input //交易输入
  994. bytesData, err := json.Marshal(inputMessage)
  995. fmt.Println(string(bytesData))
  996. if err != nil {
  997. fmt.Println(err.Error())
  998. return err.Error(), ""
  999. }
  1000. request_url = request_url + "3201"
  1001. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1002. }
  1003. func Jsyb9001(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, admin_user_id int64, request_url string, cainfo string, access_key string) (string, string) {
  1004. // 生成签名
  1005. timestamp := time.Now().Unix()
  1006. // 生成输入报文
  1007. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1008. input := make(map[string]interface{})
  1009. inputData := make(map[string]interface{})
  1010. inputMessage["infno"] = "9001" // 交易编码
  1011. inputData["opter_no"] = admin_user_id
  1012. inputData["mac"] = GetMacTwo() // 开始时间
  1013. inputData["ip"] = GetLocalIpTwo()
  1014. input["signIn"] = inputData
  1015. inputMessage["input"] = input //交易输入
  1016. bytesData, err := json.Marshal(inputMessage)
  1017. fmt.Println(string(bytesData))
  1018. if err != nil {
  1019. fmt.Println(err.Error())
  1020. return err.Error(), ""
  1021. }
  1022. //reader := bytes.NewReader(bytesData)
  1023. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
  1024. //gdyb_url := beego.AppConfig.String("gdyb_url")
  1025. //gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
  1026. //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
  1027. //url := gdyb_url
  1028. //request, err := http.NewRequest("POST", request_url+"9001", reader)
  1029. //if err != nil {
  1030. // fmt.Println(err.Error())
  1031. // return err.Error(), ""
  1032. //}
  1033. //
  1034. //request.Header.Set("Content-Type", "application/json;charset=UTF-8")
  1035. //request.Header.Set("_api_timestamp", strconv.FormatInt(timestamp, 10))
  1036. //request.Header.Set("_api_name", "hssServives")
  1037. //request.Header.Set("_api_version", "1.0.0")
  1038. //request.Header.Set("_api_access_key", access_key)
  1039. //request.Header.Set("_api_signature", "")
  1040. //
  1041. //client := http.Client{}
  1042. //resp, err := client.Do(request)
  1043. //if err != nil {
  1044. // fmt.Println(err.Error())
  1045. // return err.Error(), ""
  1046. //}
  1047. //respBytes, err := ioutil.ReadAll(resp.Body)
  1048. //if err != nil {
  1049. // fmt.Println(err.Error())
  1050. // return err.Error(), ""
  1051. //}
  1052. //str := string(respBytes)
  1053. //fmt.Println(str)
  1054. //return str, ""
  1055. request_url = request_url + "9001"
  1056. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1057. }
  1058. // 获取本机ip
  1059. func GetLocalIpTwo() string {
  1060. addrs, err := net.InterfaceAddrs()
  1061. if err != nil {
  1062. fmt.Println("get local ip failed")
  1063. }
  1064. for _, address := range addrs {
  1065. if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
  1066. if ipnet.IP.To4() != nil {
  1067. return ipnet.IP.String()
  1068. }
  1069. }
  1070. }
  1071. return ""
  1072. }
  1073. // 获取本机Mac
  1074. func GetMacTwo() string {
  1075. interfaces, err := net.Interfaces()
  1076. if err != nil {
  1077. fmt.Println("Get loacl Mac failed")
  1078. }
  1079. for _, inter := range interfaces {
  1080. mac := inter.HardwareAddr
  1081. fmt.Println("+======" + mac.String())
  1082. if mac.String() != "" {
  1083. return mac.String()
  1084. }
  1085. }
  1086. return ""
  1087. }
  1088. func Jsyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
  1089. // 生成签名
  1090. timestamp := time.Now().Unix()
  1091. // 生成输入报文
  1092. inputMessage := SetJSInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
  1093. input := make(map[string]interface{})
  1094. inputData := make(map[string]interface{})
  1095. patientDtosinputData := make(map[string]interface{})
  1096. fisEncounterDtosData := make(map[string]interface{})
  1097. fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
  1098. fsiOrderDtosDatas := make([]map[string]interface{}, 0)
  1099. fsiOperationDtosData := make(map[string]interface{})
  1100. fsiOperationDtosDatas := make([]map[string]interface{}, 0)
  1101. //就诊信息
  1102. fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
  1103. fisEncounterDtosData["medins_id"] = fed.MedinsID
  1104. fisEncounterDtosData["medins_name"] = fed.MedinsName
  1105. fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
  1106. fisEncounterDtosData["medins_type"] = fed.MedinsType
  1107. fisEncounterDtosData["medins_lv"] = fed.MedinsLv
  1108. fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
  1109. fisEncounterDtosData["wardno"] = fed.Wardno
  1110. fisEncounterDtosData["bedno"] = fed.Bedno
  1111. fisEncounterDtosData["adm_date"] = fed.AdmDate
  1112. fisEncounterDtosData["dscg_date"] = fed.DscgDate
  1113. fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
  1114. fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
  1115. for _, fdd := range fdds {
  1116. fsiDiagnoseDtosData := make(map[string]interface{})
  1117. //诊断集合
  1118. fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
  1119. fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
  1120. fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
  1121. fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
  1122. fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
  1123. fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
  1124. fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
  1125. fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
  1126. }
  1127. fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
  1128. fisEncounterDtosData["dr_codg"] = fed.DrCodg
  1129. fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
  1130. fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
  1131. fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
  1132. fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
  1133. fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
  1134. fisEncounterDtosData["med_type"] = fed.MedType
  1135. for _, fod := range fods {
  1136. fsiOrderDtosData := make(map[string]interface{})
  1137. //医嘱集合
  1138. fsiOrderDtosData["rx_id"] = fod.RxID
  1139. fsiOrderDtosData["rxno"] = fod.Rxno
  1140. fsiOrderDtosData["grpno"] = fod.Grpno
  1141. fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
  1142. fsiOrderDtosData["hilist_type"] = fod.HilistType
  1143. fsiOrderDtosData["chrg_type"] = fod.ChrgType
  1144. fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
  1145. fsiOrderDtosData["hilist_code"] = fod.HilistCode
  1146. fsiOrderDtosData["hilist_name"] = fod.HilistName
  1147. fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
  1148. fsiOrderDtosData["hilist_lv"] = fod.HilistLv
  1149. fsiOrderDtosData["hilist_pric"] = fod.HilistPric
  1150. fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
  1151. fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
  1152. fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
  1153. fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
  1154. fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
  1155. fsiOrderDtosData["hosplist_name"] = fod.HosplistName
  1156. fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
  1157. fsiOrderDtosData["cnt"] = fod.Cnt
  1158. fsiOrderDtosData["pric"] = fod.Pric
  1159. fsiOrderDtosData["sumamt"] = fod.Sumamt
  1160. fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
  1161. fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
  1162. fsiOrderDtosData["spec"] = fod.Spec
  1163. fsiOrderDtosData["spec_unt"] = fod.SpecUnt
  1164. fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
  1165. fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
  1166. fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
  1167. fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
  1168. fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
  1169. fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
  1170. fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
  1171. fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
  1172. fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
  1173. }
  1174. fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
  1175. fisEncounterDtosData["matn_stas"] = fed.MatnStas
  1176. fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
  1177. fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
  1178. fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
  1179. fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
  1180. fisEncounterDtosData["ma_amt"] = fed.MaAmt
  1181. fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
  1182. fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
  1183. fisEncounterDtosData["insutype"] = fed.Insutype
  1184. fisEncounterDtosData["reim_flag"] = fed.ReimFlag
  1185. fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
  1186. //手术操作
  1187. for _, fopd := range fopds {
  1188. fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
  1189. fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
  1190. fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
  1191. fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
  1192. fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
  1193. fsiOperationDtosData["anst_way"] = fopd.Anst_way
  1194. fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
  1195. fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
  1196. fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
  1197. fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
  1198. fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
  1199. }
  1200. fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
  1201. patientDtosinputData["patn_id"] = pd.PatnID
  1202. patientDtosinputData["patn_name"] = pd.PatnName
  1203. patientDtosinputData["gend"] = pd.Gend
  1204. patientDtosinputData["brdy"] = pd.Brdy
  1205. patientDtosinputData["poolarea"] = pd.Poolarea
  1206. patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
  1207. patientDtosinputData["fsi_his_data_dto"] = ""
  1208. patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
  1209. inputData["syscode"] = "LinkDialysis"
  1210. inputData["trig_scen"] = trig_scen
  1211. inputData["rule_ids"] = ""
  1212. inputData["task_id"] = ""
  1213. inputData["patient_dtos"] = patientDtosinputData
  1214. input["data"] = inputData
  1215. inputMessage["infno"] = "3101"
  1216. inputMessage["input"] = input //交易输入
  1217. bytesData, err := json.Marshal(inputMessage)
  1218. fmt.Println(string(bytesData))
  1219. if err != nil {
  1220. fmt.Println(err.Error())
  1221. return err.Error(), ""
  1222. }
  1223. params.RequestUrl = params.RequestUrl + "3101"
  1224. return HttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1225. }
  1226. func Jsyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
  1227. // 生成签名
  1228. timestamp := time.Now().Unix()
  1229. // 生成输入报文
  1230. inputMessage := SetJSInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
  1231. input := make(map[string]interface{})
  1232. inputData := make(map[string]interface{})
  1233. patientDtosinputData := make(map[string]interface{})
  1234. fisEncounterDtosData := make(map[string]interface{})
  1235. fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
  1236. fsiOrderDtosDatas := make([]map[string]interface{}, 0)
  1237. fsiOperationDtosData := make(map[string]interface{})
  1238. fsiOperationDtosDatas := make([]map[string]interface{}, 0)
  1239. //就诊信息
  1240. fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
  1241. fisEncounterDtosData["medins_id"] = fed.MedinsID
  1242. fisEncounterDtosData["medins_name"] = fed.MedinsName
  1243. fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
  1244. fisEncounterDtosData["medins_type"] = fed.MedinsType
  1245. fisEncounterDtosData["medins_lv"] = fed.MedinsLv
  1246. fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
  1247. fisEncounterDtosData["wardno"] = fed.Wardno
  1248. fisEncounterDtosData["bedno"] = fed.Bedno
  1249. fisEncounterDtosData["adm_date"] = fed.AdmDate
  1250. fisEncounterDtosData["dscg_date"] = fed.DscgDate
  1251. fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
  1252. fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
  1253. for _, fdd := range fdds {
  1254. fsiDiagnoseDtosData := make(map[string]interface{})
  1255. //诊断集合
  1256. fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
  1257. fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
  1258. fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
  1259. fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
  1260. fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
  1261. fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
  1262. fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
  1263. fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
  1264. }
  1265. fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
  1266. fisEncounterDtosData["dr_codg"] = fed.DrCodg
  1267. fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
  1268. fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
  1269. fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
  1270. fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
  1271. fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
  1272. fisEncounterDtosData["med_type"] = fed.MedType
  1273. for _, fod := range fods {
  1274. fsiOrderDtosData := make(map[string]interface{})
  1275. //医嘱集合
  1276. fsiOrderDtosData["rx_id"] = fod.RxID
  1277. fsiOrderDtosData["rxno"] = fod.Rxno
  1278. fsiOrderDtosData["grpno"] = fod.Grpno
  1279. fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
  1280. fsiOrderDtosData["hilist_type"] = fod.HilistType
  1281. fsiOrderDtosData["chrg_type"] = fod.ChrgType
  1282. fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
  1283. fsiOrderDtosData["hilist_code"] = fod.HilistCode
  1284. fsiOrderDtosData["hilist_name"] = fod.HilistName
  1285. fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
  1286. fsiOrderDtosData["hilist_lv"] = fod.HilistLv
  1287. fsiOrderDtosData["hilist_pric"] = fod.HilistPric
  1288. fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
  1289. fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
  1290. fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
  1291. fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
  1292. fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
  1293. fsiOrderDtosData["hosplist_name"] = fod.HosplistName
  1294. fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
  1295. fsiOrderDtosData["cnt"] = fod.Cnt
  1296. fsiOrderDtosData["pric"] = fod.Pric
  1297. fsiOrderDtosData["sumamt"] = fod.Sumamt
  1298. fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
  1299. fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
  1300. fsiOrderDtosData["spec"] = fod.Spec
  1301. fsiOrderDtosData["spec_unt"] = fod.SpecUnt
  1302. fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
  1303. fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
  1304. fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
  1305. fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
  1306. fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
  1307. fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
  1308. fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
  1309. fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
  1310. fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
  1311. }
  1312. fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
  1313. fisEncounterDtosData["matn_stas"] = fed.MatnStas
  1314. fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
  1315. fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
  1316. fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
  1317. fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
  1318. fisEncounterDtosData["ma_amt"] = fed.MaAmt
  1319. fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
  1320. fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
  1321. fisEncounterDtosData["insutype"] = fed.Insutype
  1322. fisEncounterDtosData["reim_flag"] = fed.ReimFlag
  1323. fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
  1324. //手术操作
  1325. for _, fopd := range fopds {
  1326. fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
  1327. fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
  1328. fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
  1329. fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
  1330. fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
  1331. fsiOperationDtosData["anst_way"] = fopd.Anst_way
  1332. fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
  1333. fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
  1334. fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
  1335. fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
  1336. fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
  1337. }
  1338. fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
  1339. patientDtosinputData["patn_id"] = pd.PatnID
  1340. patientDtosinputData["patn_name"] = pd.PatnName
  1341. patientDtosinputData["gend"] = pd.Gend
  1342. patientDtosinputData["brdy"] = pd.Brdy
  1343. patientDtosinputData["poolarea"] = pd.Poolarea
  1344. patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
  1345. patientDtosinputData["fsi_his_data_dto"] = ""
  1346. patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
  1347. inputData["syscode"] = "LinkDialysis"
  1348. inputData["trig_scen"] = trig_scen
  1349. inputData["rule_ids"] = ""
  1350. inputData["task_id"] = ""
  1351. inputData["patient_dtos"] = patientDtosinputData
  1352. input["data"] = inputData
  1353. inputMessage["infno"] = "3102"
  1354. inputMessage["input"] = input //交易输入
  1355. bytesData, err := json.Marshal(inputMessage)
  1356. fmt.Println(string(bytesData))
  1357. if err != nil {
  1358. fmt.Println(err.Error())
  1359. return err.Error(), ""
  1360. }
  1361. params.RequestUrl = params.RequestUrl + "3102"
  1362. return HttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1363. }
  1364. func Jsyb4101(struct4101 Struct4101, params models.PublicParams) (string, string) {
  1365. timestamp := time.Now().Unix()
  1366. inputMessage := SetJSInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
  1367. // 生成输入报文
  1368. input := make(map[string]interface{})
  1369. inputData := make(map[string]interface{})
  1370. inputMessage["infno"] = "4101A" // 交易编码
  1371. year := time.Now().Format("2006")
  1372. month := time.Now().Format("01")
  1373. day := time.Now().Format("02")
  1374. inputData["mdtrt_id"] = struct4101.MdtrtId // 就诊 ID 必填(来自2201接口返回)
  1375. inputData["setl_id"] = struct4101.SetlId // 结算 ID 必填
  1376. inputData["psn_no"] = struct4101.PsnNo // 结算 ID 必填
  1377. inputData["fixmedins_name"] = params.FixmedinsName // 定点医药机构名称 必填
  1378. inputData["fixmedins_code"] = params.FixmedinsCode // 定点医药机构编码 必填
  1379. inputData["hi_setl_lv"] = "" // 医保结算等级
  1380. inputData["hi_no"] = struct4101.PsnNo // 医保编号
  1381. inputData["medcasno"] = struct4101.PsnNo // 病案号 必填
  1382. inputData["dcla_time"] = year + "-" + month + "-" + day // 申报时间 必填
  1383. inputData["psn_name"] = struct4101.PsnName // 人员姓名 必填
  1384. inputData["gend"] = struct4101.Gend // 性别 必填
  1385. inputData["brdy"] = struct4101.Brdy // 出生日期 必填
  1386. inputData["age"] = struct4101.Age // 年龄 必填
  1387. inputData["ntly"] = struct4101.Ntly // 国籍 必填
  1388. inputData["nwb_age"] = "" // 年龄 必填
  1389. inputData["naty"] = struct4101.Naty // 民族 必填
  1390. inputData["patn_cert_type"] = struct4101.PatnCertType // 患者证件类别 必填
  1391. inputData["certno"] = struct4101.Certno // 证件号码 必填
  1392. inputData["prfs"] = struct4101.Prfs // 职业 必填
  1393. inputData["curr_addr"] = "" // 现住址 必填
  1394. inputData["emp_name"] = "" // 单位名称 必填
  1395. inputData["emp_addr"] = "" // 单位地址 必填
  1396. inputData["emp_tel"] = "" // 单位电话 必填
  1397. inputData["poscode"] = "" // 邮编 必填
  1398. inputData["coner_name"] = struct4101.ConerName // 联系人姓名 必填
  1399. inputData["patn_rlts"] = struct4101.PatnRlts // 与患者关系 必填
  1400. inputData["coner_addr"] = struct4101.ConerAddr // 联系人地址 必填
  1401. inputData["coner_tel"] = struct4101.ConerTel // 联系人电话 必填
  1402. inputData["hi_type"] = struct4101.HiType // 医保类型 必填
  1403. inputData["insuplc"] = struct4101.Insuplc // 参保地 必填
  1404. inputData["sp_psn_type"] = "" // 特殊人员类型 必填
  1405. inputData["nwb_adm_type"] = "" // 新生儿入院类型 必填
  1406. inputData["nwb_bir_wt"] = "" // 新生儿出生体重 必填
  1407. inputData["nwb_adm_wt"] = "" // 新生儿入院体重 必填
  1408. inputData["opsp_diag_caty"] = "" // 门诊慢特病诊断 必填
  1409. inputData["opsp_mdtrt_date"] = "" // 门诊慢特病就诊日期 必填
  1410. inputData["ipt_med_type"] = struct4101.IptMedType // 住院医疗类型 必填
  1411. inputData["adm_way"] = "" // 入院途径 必填
  1412. inputData["trt_type"] = "" // 治疗类别 必填
  1413. inputData["adm_time"] = struct4101.AdmTime // 入院时间 必填
  1414. inputData["adm_caty"] = struct4101.AdmCaty // 入院科别 必填
  1415. inputData["refldept_dept"] = "" // 转科科别 必填
  1416. inputData["dscg_time"] = struct4101.AdmEndTime // 出院时间 必填
  1417. inputData["dscg_caty"] = struct4101.AdmCaty // 出院科别 必填
  1418. inputData["act_ipt_days"] = "" // 实际住院天数 必填
  1419. inputData["otp_wm_dise"] = "" // 门(急) 诊西医诊断 必填
  1420. inputData["wm_dise_code"] = "" // 门(急) 诊中医诊断 必填
  1421. inputData["otp_tcm_dise"] = "" // 西医诊断疾病代码 必填
  1422. inputData["tcm_dise_code"] = "" // 中医诊断代码 必填
  1423. inputData["oprn_oprt_code_cnt"] = "" // 手术操作代码计数 必填
  1424. inputData["vent_used_dura"] = "" // 呼吸机使用时长 必填
  1425. inputData["pwcry_bfadm_coma_dura"] = "" // 颅脑损伤患者入院前昏迷时长 必填
  1426. inputData["pwcry_afadm_coma_dura"] = "" // 颅脑损伤患者入院后昏迷时长 必填
  1427. inputData["bld_cat"] = "" // 输血品种 必填
  1428. inputData["bld_amt"] = "" // 输血量 必填
  1429. inputData["bld_unt"] = "" // 输血计量单位 必填
  1430. inputData["spga_nurscare_days"] = "" // 特级护理天数 必填
  1431. inputData["lv1_nurscare_days"] = "" // 一级护理天数 必填
  1432. inputData["scd_nurscare_days"] = "" // 二级护理天数 必填
  1433. inputData["lv3_nurscare_days"] = "" // 三级护理天数 必填
  1434. inputData["acp_medins_name"] = "" // 拟接收机构名称 必填
  1435. inputData["acp_optins_code"] = "" // 拟接收机构代码 必填
  1436. inputData["bill_code"] = struct4101.BillCode // 票据代码 必填
  1437. inputData["bill_no"] = struct4101.BillNo // 票据号码 必填
  1438. inputData["biz_sn"] = struct4101.BizSn // 业务流水号 必填
  1439. inputData["days_rinp_flag_31"] = "" // 出院 31 天内再住院计划标志 必填
  1440. inputData["days_rinp_pup_31"] = "" // 出院 31 天内再住院目的 必填
  1441. inputData["chfpdr_name"] = "" // 主诊医师姓名 必填
  1442. inputData["chfpdr_code"] = "" // 主诊医师代码 必填
  1443. inputData["setl_begn_date"] = struct4101.SetlBegnDate // 结算开始日期 必填
  1444. inputData["setl_end_date"] = struct4101.SetlEndDate // 结算结束日期 必填
  1445. inputData["psn_selfpay"] = struct4101.PsnSelfPay // 个人自付 必填
  1446. inputData["psn_ownpay"] = struct4101.PsnOwnPay // 个人自费 必填
  1447. inputData["acct_pay"] = struct4101.AcctPay // 个人账户支出 必填
  1448. inputData["hi_paymtd"] = struct4101.HiPaymtd // 医保支付方式 必填
  1449. inputData["hsorg"] = struct4101.Hsorg // 医保机构 必填
  1450. inputData["hsorg_opter"] = struct4101.HsorgOpter // 医保机构经办人 必填
  1451. inputData["medins_fill_dept"] = struct4101.MedinsFillDept // 医疗机构填报部门 必填
  1452. inputData["medins_fill_psn"] = struct4101.MedinsFillPsn // 医疗机构填报人 必填
  1453. inputData["psn_cashpay"] = struct4101.PsnCashpay // 医疗机构填报人 必填
  1454. payinfo := make([]map[string]interface{}, 0) // 基金支付信息
  1455. for _, item := range struct4101.CustomStruct {
  1456. payinfotemp := make(map[string]interface{})
  1457. 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" {
  1458. payinfotemp["fund_pay_type"] = item.FundPayType // 基金支付类型 必填
  1459. payinfotemp["fund_payamt"] = item.FundPayamt // 基金支付金额
  1460. payinfo = append(payinfo, payinfotemp)
  1461. }
  1462. }
  1463. opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
  1464. opspdiseinfotemp := make(map[string]interface{})
  1465. opspdiseinfotemp["diag_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName // 诊断名称 必填
  1466. opspdiseinfotemp["diag_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode // 诊断代码 必填
  1467. opspdiseinfotemp["oprn_oprt_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName // 手术操作名称 必填
  1468. opspdiseinfotemp["oprn_oprt_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode // 手术操作代码 必填
  1469. opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
  1470. diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
  1471. for _, item := range struct4101.Diseinfo {
  1472. diseinfotemp := make(map[string]interface{})
  1473. diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
  1474. diseinfotemp["diag_type"] = item.DiagType // 诊断类别 必填
  1475. diseinfotemp["diag_code"] = item.DiagCode // 诊断代码 必填
  1476. diseinfotemp["diag_name"] = item.DiagName // 诊断名称 必填
  1477. diseinfotemp["adm_cond_type"] = "3" // 入院病情类型 必填
  1478. diseinfo = append(diseinfo, diseinfotemp)
  1479. }
  1480. iteminfo := make([]map[string]interface{}, 0)
  1481. for _, item := range struct4101.IteminfoStruct {
  1482. iteminfotemp := make(map[string]interface{})
  1483. iteminfotemp["med_chrgitm"] = item.MedChrgitm // 医疗收费项目 必填
  1484. iteminfotemp["amt"] = item.Amt // 金额 必填
  1485. iteminfotemp["claa_sumfee"] = item.ClaaSumfee // 甲类费用合计 必填
  1486. iteminfotemp["clab_amt"] = item.ClabAmt // 乙类金额 必填
  1487. iteminfotemp["fulamt_ownpay_amt"] = item.FulamtOwnpayAmt // 全自费金额 必填
  1488. iteminfotemp["oth_amt"] = item.OthAmt // 其他金额 必填
  1489. iteminfo = append(iteminfo, iteminfotemp)
  1490. }
  1491. oprninfo := make([]map[string]interface{}, 0) // 手术操作信息
  1492. oprninfotemp := make(map[string]interface{})
  1493. oprninfotemp["oprn_oprt_type"] = "" // 手术操作类别 必填
  1494. oprninfotemp["oprn_oprt_name"] = "" // 手术操作名称 必填
  1495. oprninfotemp["oprn_oprt_code"] = "" // 手术操作代码 必填
  1496. oprninfotemp["oprn_oprt_date"] = "" // 手术操作日期 必填
  1497. oprninfotemp["anst_way"] = "" // 麻醉方式 必填
  1498. oprninfotemp["oper_dr_name"] = "" // 术者医师姓名 必填
  1499. oprninfotemp["oper_dr_code"] = "" // 术者医师代码 必填
  1500. oprninfotemp["anst_dr_name"] = "" // 麻醉医师姓名 必填
  1501. oprninfotemp["anst_dr_code"] = "" // 麻醉医师代码 必填
  1502. oprninfo = append(oprninfo, oprninfotemp)
  1503. icuinfo := make([]map[string]interface{}, 0) // 重症监护信息
  1504. icuinfotemp := make(map[string]interface{})
  1505. icuinfotemp["scs_cutd_ward_type"] = "" // 重症监护病房类型 必填
  1506. icuinfotemp["scs_cutd_inpool_time"] = "" // 重症监护进入时间 必填
  1507. icuinfotemp["scs_cutd_exit_time"] = "" // 重症监护退出时间 必填
  1508. icuinfotemp["scs_cutd_sum_dura"] = "" // 重症监护合计时长 必填
  1509. icuinfo = append(icuinfo, icuinfotemp)
  1510. input["setlinfo"] = inputData
  1511. input["payinfo"] = payinfo
  1512. input["opspdiseinfo"] = opspdiseinfo
  1513. input["diseinfo"] = diseinfo
  1514. input["iteminfo"] = iteminfo
  1515. inputMessage["input"] = input //交易输入
  1516. bytesData, _ := json.Marshal(inputMessage)
  1517. fmt.Println(string(bytesData))
  1518. params.RequestUrl = params.RequestUrl + "4101A"
  1519. return HttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1520. }
  1521. func Jsyb3501(struct3501 models.Struct3501) (string, string) {
  1522. timestamp := time.Now().Unix()
  1523. // 生成输入报文
  1524. inputMessage := SetJSInputMessage(timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsHilistId, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, struct3501.Cainfo)
  1525. input := make(map[string]interface{})
  1526. inputData := make(map[string]interface{})
  1527. inputMessage["infno"] = "3501" // 交易编码
  1528. inputData["med_list_codg"] = struct3501.MedListCodg // 定点医药机构目录编号
  1529. inputData["fixmedins_hilist_id"] = struct3501.FixmedinsHilistId // 定点医药机构目录编号
  1530. inputData["fixmedins_hilist_name"] = struct3501.OrgName // 定点医药机构目录名称
  1531. inputData["rx_flag"] = struct3501.RxFlag //
  1532. inputData["invdate"] = struct3501.Invdate // 人员编号 (来自1101接口返回)
  1533. inputData["inv_cnt"] = struct3501.InvCnt // 人员编号 (来自1101接口返回)
  1534. inputData["manu_lotnum"] = struct3501.ManuLotnum // 人员编号 (来自1101接口返回)
  1535. inputData["fixmedins_bchno"] = struct3501.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1536. inputData["manu_date"] = struct3501.ManuDate // 人员编号 (来自1101接口返回)
  1537. inputData["expy_end"] = struct3501.ExpyEnd // 人员编号 (来自1101接口返回)
  1538. inputData["memo"] = "" // 人员编号 (来自1101接口返回)
  1539. input["invinfo"] = inputData
  1540. inputMessage["input"] = input //交易输入
  1541. bytesData, err := json.Marshal(inputMessage)
  1542. fmt.Println(string(bytesData))
  1543. if err != nil {
  1544. fmt.Println(err.Error())
  1545. return err.Error(), ""
  1546. }
  1547. struct3501.RequestUrl = struct3501.RequestUrl + "3501"
  1548. return HttpRequest(struct3501.RequestUrl, struct3501.AccessKey, struct3501.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1549. }
  1550. func Jsyb3502(struct3502 models.Struct3502) (string, string) {
  1551. timestamp := time.Now().Unix()
  1552. // 生成输入报文
  1553. inputMessage := SetJSInputMessage(timestamp, struct3502.OrgName, struct3502.Opter, struct3502.FixmedinsCode, struct3502.InsuplcAdmdvs, struct3502.MdtrtareaAdmvs, struct3502.Cainfo)
  1554. input := make(map[string]interface{})
  1555. inputData := make(map[string]interface{})
  1556. inputMessage["infno"] = "3502" // 交易编码
  1557. inputData["med_list_codg"] = struct3502.MedListCodg // 定点医药机构目录编号
  1558. inputData["inv_chg_type"] = struct3502.InvChgType // 定点医药机构目录编号
  1559. inputData["fixmedins_hilist_id"] = struct3502.FixmedinsCode // 定点医药机构目录编号
  1560. inputData["fixmedins_hilist_name"] = struct3502.OrgName // 定点医药机构目录名称
  1561. inputData["fixmedins_bchno"] = struct3502.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1562. inputData["pric"] = struct3502.Pric // 人员编号 (来自1101接口返回)
  1563. inputData["cnt"] = struct3502.Cnt // 人员编号 (来自1101接口返回)
  1564. inputData["rx_flag"] = struct3502.RxFlag //
  1565. inputData["inv_chg_time"] = struct3502.InvChgTime // 人员编号 (来自1101接口返回)
  1566. inputData["inv_chg_opter_name"] = "" // 人员编号 (来自1101接口返回)
  1567. inputData["memo"] = struct3502.Memo // 人员编号 (来自1101接口返回)
  1568. inputData["trdn_flag"] = "" // 人员编号 (来自1101接口返回)
  1569. input["invinfo"] = inputData
  1570. inputMessage["input"] = input //交易输入
  1571. bytesData, err := json.Marshal(inputMessage)
  1572. fmt.Println(string(bytesData))
  1573. if err != nil {
  1574. fmt.Println(err.Error())
  1575. return err.Error(), ""
  1576. }
  1577. struct3502.RequestUrl = struct3502.RequestUrl + "3502"
  1578. return HttpRequest(struct3502.RequestUrl, struct3502.AccessKey, struct3502.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1579. }
  1580. func Jsyb3503(struct3503 models.Struct3503) (string, string) {
  1581. timestamp := time.Now().Unix()
  1582. // 生成输入报文
  1583. fmt.Println(struct3503)
  1584. inputMessage := SetJSInputMessage(timestamp, struct3503.OrgName, struct3503.Opter, struct3503.FixmedinsHilistId, struct3503.InsuplcAdmdvs, struct3503.MdtrtareaAdmvs, struct3503.Cainfo)
  1585. input := make(map[string]interface{})
  1586. inputMessage["infno"] = "3503"
  1587. item := struct3503
  1588. feedetailInfo := make(map[string]interface{})
  1589. feedetailInfo["med_list_codg"] = item.MedListCodg
  1590. feedetailInfo["fixmedins_hilist_id"] = item.FixmedinsHilistId
  1591. feedetailInfo["fixmedins_hilist_name"] = item.FixmedinsHilistName
  1592. feedetailInfo["dynt_no"] = ""
  1593. feedetailInfo["fixmedins_bchno"] = item.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1594. feedetailInfo["spler_name"] = item.SplerName // 人员编号 (来自1101接口返回)
  1595. feedetailInfo["spler_pmtno"] = "" // 人员编号 (来自1101接口返回)
  1596. feedetailInfo["manu_lotnum"] = item.ManuLotnum // 人员编号 (来自1101接口返回)
  1597. feedetailInfo["prodentp_name"] = item.ProdentpName // 人员编号 (来自1101接口返回)
  1598. feedetailInfo["aprvno"] = item.Aprvno // 人员编号 (来自1101接口返回)
  1599. feedetailInfo["manu_date"] = item.ManuDate // 人员编号 (来自1101接口返回)
  1600. feedetailInfo["expy_end"] = item.ExpyEnd // 人员编号 (来自1101接口返回)
  1601. feedetailInfo["finl_trns_pric"] = item.FinlTrnsPric // 人员编号 (来自1101接口返回)
  1602. feedetailInfo["purc_retn_cnt"] = item.PurcRetnCnt // 人员编号 (来自1101接口返回)
  1603. feedetailInfo["purc_invo_codg"] = item.PurcInvoCodg // 人员编号 (来自1101接口返回)
  1604. feedetailInfo["purc_invo_no"] = item.PurcInvoNo // 人员编号 (来自1101接口返回)
  1605. feedetailInfo["rx_flag"] = item.RxFlag // 人员编号 (来自1101接口返回)
  1606. feedetailInfo["purc_retn_stoin_time"] = item.PurcRetnStoinTime // 人员编号 (来自1101接口返回)
  1607. feedetailInfo["purc_retn_opter_name"] = item.PurcRetnOpterName // 人员编号 (来自1101接口返回)
  1608. feedetailInfo["prod_geay_flag"] = "" // 人员编号 (来自1101接口返回)
  1609. feedetailInfo["memo"] = "" // 人员编号 (来自1101接口返回)
  1610. input["purcinfo"] = feedetailInfo
  1611. inputMessage["input"] = input //交易输入
  1612. bytesData, err := json.Marshal(inputMessage)
  1613. fmt.Println(string(bytesData))
  1614. if err != nil {
  1615. fmt.Println(err.Error())
  1616. return err.Error(), ""
  1617. }
  1618. struct3503.RequestUrl = struct3503.RequestUrl + "3503"
  1619. return HttpRequest(struct3503.RequestUrl, struct3503.AccessKey, struct3503.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1620. }
  1621. func Jsyb3504(struct3504 models.Struct3504) (string, string) {
  1622. timestamp := time.Now().Unix()
  1623. // 生成输入报文
  1624. inputMessage := SetJSInputMessage(timestamp, struct3504.OrgName, struct3504.Opter, struct3504.FixmedinsCode, struct3504.InsuplcAdmdvs, struct3504.MdtrtareaAdmvs, struct3504.Cainfo)
  1625. input := make(map[string]interface{})
  1626. inputData := make(map[string]interface{})
  1627. inputMessage["infno"] = "3504" // 交易编码
  1628. inputData["med_list_codg"] = struct3504.MedListCodg // 定点医药机构目录编号
  1629. inputData["fixmedins_hilist_id"] = struct3504.FixmedinsHilistId // 定点医药机构目录编号
  1630. inputData["fixmedins_hilist_name"] = struct3504.FixmedinsHilistName // 定点医药机构目录名称
  1631. inputData["fixmedins_bchno"] = struct3504.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1632. inputData["spler_name"] = struct3504.SplerName // 人员编号 (来自1101接口返回)
  1633. inputData["spler_pmtno"] = "" // 人员编号 (来自1101接口返回)
  1634. inputData["manu_date"] = struct3504.ManuDate // 人员编号 (来自1101接口返回)
  1635. inputData["expy_end"] = struct3504.ExpyEnd // 人员编号 (来自1101接口返回)
  1636. inputData["finl_trns_pric"] = struct3504.FinlTrnsPric // 人员编号 (来自1101接口返回)
  1637. inputData["purc_retn_cnt"] = struct3504.PurcRetnCnt // 人员编号 (来自1101接口返回)
  1638. inputData["purc_invo_codg"] = struct3504.PurcInvoCodg // 人员编号 (来自1101接口返回)
  1639. inputData["purc_invo_no"] = struct3504.PurcInvoNo // 人员编号 (来自1101接口返回)
  1640. inputData["rx_flag"] = struct3504.RxFlag // 人员编号 (来自1101接口返回)
  1641. inputData["purc_retn_stoin_time"] = struct3504.PurcRetnStoinTime // 人员编号 (来自1101接口返回)
  1642. inputData["purc_retn_opter_name"] = struct3504.PurcRetnOpterName // 人员编号 (来自1101接口返回)
  1643. inputData["medins_prod_purc_no"] = "" // 人员编号 (来自1101接口返回)
  1644. inputData["memo"] = "" // 人员编号 (来自1101接口返回)
  1645. input["purcinfo"] = inputData
  1646. inputMessage["input"] = input //交易输入
  1647. bytesData, err := json.Marshal(inputMessage)
  1648. fmt.Println(string(bytesData))
  1649. if err != nil {
  1650. fmt.Println(err.Error())
  1651. return err.Error(), ""
  1652. }
  1653. struct3504.RequestUrl = struct3504.RequestUrl + "3504"
  1654. return HttpRequest(struct3504.RequestUrl, struct3504.AccessKey, struct3504.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1655. }
  1656. func Jsyb3505(struct3505 models.Struct3505) (string, string) {
  1657. timestamp := time.Now().Unix()
  1658. // 生成输入报文
  1659. inputMessage := SetJSInputMessage(timestamp, struct3505.OrgName, struct3505.Opter, struct3505.FixmedinsHilistId, struct3505.InsuplcAdmdvs, struct3505.MdtrtareaAdmvs, struct3505.Cainfo)
  1660. input := make(map[string]interface{})
  1661. inputData := make(map[string]interface{})
  1662. inputMessage["infno"] = "3505" // 交易编码
  1663. inputData["med_list_codg"] = struct3505.MedListCodg // 定点医药机构目录编号
  1664. inputData["fixmedins_hilist_id"] = struct3505.FixmedinsHilistId // 定点医药机构目录编号
  1665. inputData["fixmedins_hilist_name"] = struct3505.OrgName // 定点医药机构目录名称
  1666. inputData["fixmedins_bchno"] = struct3505.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1667. inputData["prsc_dr_cert_type"] = struct3505.PrscDrCertType // 人员编号 (来自1101接口返回)
  1668. inputData["prsc_dr_certno"] = struct3505.PrscDrCertno // 人员编号 (来自1101接口返回)
  1669. inputData["prsc_dr_name"] = struct3505.PrscDrName // 人员编号 (来自1101接口返回)
  1670. inputData["phar_cert_type"] = struct3505.PharCertType // 人员编号 (来自1101接口返回)
  1671. inputData["phar_certno"] = struct3505.PharCertno // 人员编号 (来自1101接口返回)
  1672. inputData["phar_name"] = struct3505.PharName // 人员编号 (来自1101接口返回)
  1673. inputData["phar_prac_cert_no"] = struct3505.PharPracCertNo // 人员编号 (来自1101接口返回)
  1674. inputData["hi_feesetl_type"] = struct3505.HiFeesetlType // 人员编号 (来自1101接口返回)
  1675. inputData["setl_id"] = struct3505.SetlId // 人员编号 (来自1101接口返回)
  1676. inputData["mdtrt_sn"] = struct3505.MdtrtSn // 人员编号 (来自1101接口返回)
  1677. inputData["psn_no"] = struct3505.PsnNo // 人员编号 (来自1101接口返回)
  1678. inputData["psn_cert_type"] = struct3505.PsnCertType // 人员编号 (来自1101接口返回)
  1679. inputData["certno"] = struct3505.CertNo // 人员编号 (来自1101接口返回)
  1680. inputData["psn_name"] = struct3505.PsnName // 人员编号 (来自1101接口返回)
  1681. inputData["manu_lotnum"] = struct3505.ManuLotnum // 人员编号 (来自1101接口返回)
  1682. inputData["manu_date"] = struct3505.ManuDate // 人员编号 (来自1101接口返回)
  1683. inputData["expy_end"] = struct3505.ExpyEnd // 人员编号 (来自1101接口返回)
  1684. inputData["rx_flag"] = struct3505.RxFlag // 人员编号 (来自1101接口返回)
  1685. inputData["trdn_flag"] = struct3505.TrdnFlag // 人员编号 (来自1101接口返回)
  1686. inputData["finl_trns_pric"] = struct3505.FinlTrnsPric // 人员编号 (来自1101接口返回)
  1687. inputData["rxno"] = struct3505.Rxno // 人员编号 (来自1101接口返回)
  1688. inputData["rx_circ_flag"] = struct3505.RxCircFlag // 人员编号 (来自1101接口返回)
  1689. inputData["rtal_docno"] = struct3505.RtalDocno // 人员编号 (来自1101接口返回)
  1690. inputData["stoout_no"] = struct3505.StooutNo // 人员编号 (来自1101接口返回)
  1691. inputData["bchno"] = struct3505.Bchno // 人员编号 (来自1101接口返回)
  1692. inputData["drug_trac_codg"] = struct3505.DrugTracCodg // 人员编号 (来自1101接口返回)
  1693. inputData["drug_prod_barc"] = struct3505.DrugProdBarc // 人员编号 (来自1101接口返回)
  1694. inputData["shelf_posi"] = struct3505.ShelfPosi // 人员编号 (来自1101接口返回)
  1695. inputData["sel_retn_cnt"] = struct3505.SelRetnCnt // 人员编号 (来自1101接口返回)
  1696. inputData["sel_retn_time"] = struct3505.SelRetnTime // 人员编号 (来自1101接口返回)
  1697. inputData["sel_retn_opter_name"] = struct3505.SelRetnOpterName // 人员编号 (来自1101接口返回)
  1698. inputData["memo"] = struct3505.Memo // 人员编号 (来自1101接口返回)
  1699. input["selinfo"] = inputData
  1700. inputMessage["input"] = input //交易输入
  1701. bytesData, err := json.Marshal(inputMessage)
  1702. fmt.Println(string(bytesData))
  1703. if err != nil {
  1704. fmt.Println(err.Error())
  1705. return err.Error(), ""
  1706. }
  1707. struct3505.RequestUrl = struct3505.RequestUrl + "3505"
  1708. return HttpRequest(struct3505.RequestUrl, struct3505.AccessKey, struct3505.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1709. }
  1710. func Jsyb3506(struct3506 models.Struct3506) (string, string) {
  1711. timestamp := time.Now().Unix()
  1712. // 生成输入报文
  1713. inputMessage := SetJSInputMessage(timestamp, struct3506.OrgName, struct3506.Opter, struct3506.FixmedinsCode, struct3506.InsuplcAdmdvs, struct3506.MdtrtareaAdmvs, struct3506.Cainfo)
  1714. input := make(map[string]interface{})
  1715. inputData := make(map[string]interface{})
  1716. inputMessage["infno"] = "3506" // 交易编码
  1717. inputData["med_list_codg"] = struct3506.MedListCodg // 定点医药机构目录编号
  1718. inputData["fixmedins_hilist_id"] = struct3506.FixmedinsHilistId // 定点医药机构目录编号
  1719. inputData["fixmedins_hilist_name"] = struct3506.OrgName // 定点医药机构目录名称
  1720. inputData["fixmedins_bchno"] = struct3506.FixmedinsBchno // 人员编号 (来自1101接口返回)
  1721. inputData["setl_id"] = struct3506.SetlId // 人员编号 (来自1101接口返回)
  1722. inputData["psn_no"] = struct3506.PsnNo // 人员编号 (来自1101接口返回)
  1723. inputData["psn_cert_type"] = struct3506.PsnCertType // 人员编号 (来自1101接口返回)
  1724. inputData["certno"] = struct3506.Certno // 人员编号 (来自1101接口返回)
  1725. inputData["psn_name"] = struct3506.PsnName // 人员编号 (来自1101接口返回)
  1726. inputData["manu_lotnum"] = struct3506.ManuLotnum // 人员编号 (来自1101接口返回)
  1727. inputData["manu_date"] = struct3506.ManuDate // 人员编号 (来自1101接口返回)
  1728. inputData["expy_end"] = struct3506.ExpyEnd // 人员编号 (来自1101接口返回)
  1729. inputData["rx_flag"] = struct3506.RxFlag // 人员编号 (来自1101接口返回)
  1730. inputData["trdn_flag"] = struct3506.TrdnFlag // 人员编号 (来自1101接口返回)
  1731. inputData["finl_trns_pric"] = struct3506.FinlTrnsPric // 人员编号 (来自1101接口返回)
  1732. inputData["sel_retn_cnt"] = struct3506.SelRetnCnt // 人员编号 (来自1101接口返回)
  1733. inputData["sel_retn_time"] = struct3506.SelRetnTime // 人员编号 (来自1101接口返回)
  1734. inputData["sel_retn_opter_name"] = struct3506.SelRetnOpterName // 人员编号 (来自1101接口返回)
  1735. inputData["memo"] = "" // 人员编号 (来自1101接口返回)
  1736. inputData["medins_prod_sel_no"] = "" // 人员编号 (来自1101接口返回)
  1737. input["selinfo"] = inputData
  1738. inputMessage["input"] = input //交易输入
  1739. bytesData, err := json.Marshal(inputMessage)
  1740. fmt.Println(string(bytesData))
  1741. if err != nil {
  1742. fmt.Println(err.Error())
  1743. return err.Error(), ""
  1744. }
  1745. struct3506.RequestUrl = struct3506.RequestUrl + "3506"
  1746. return HttpRequest(struct3506.RequestUrl, struct3506.AccessKey, struct3506.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1747. }
  1748. func Jsyb3507(struct3507 models.Struct3507) (string, string) {
  1749. timestamp := time.Now().Unix()
  1750. // 生成输入报文
  1751. inputMessage := SetJSInputMessage(timestamp, struct3507.OrgName, struct3507.Opter, struct3507.FixmedinsCode, struct3507.InsuplcAdmdvs, struct3507.MdtrtareaAdmvs, struct3507.Cainfo)
  1752. input := make(map[string]interface{})
  1753. inputData := make(map[string]interface{})
  1754. inputMessage["infno"] = "3507" // 交易编码
  1755. inputData["fixmedins_bchno"] = struct3507.FixmedinsCode // 人员编号 (来自1101接口返回)
  1756. inputData["inv_data_type"] = struct3507.InvDataType // 人员编号 (来自1101接口返回)
  1757. input["data"] = inputData
  1758. inputMessage["input"] = input //交易输入
  1759. bytesData, err := json.Marshal(inputMessage)
  1760. fmt.Println(string(bytesData))
  1761. if err != nil {
  1762. fmt.Println(err.Error())
  1763. return err.Error(), ""
  1764. }
  1765. struct3507.RequestUrl = struct3507.RequestUrl + "3507"
  1766. return HttpRequest(struct3507.RequestUrl, struct3507.AccessKey, struct3507.SecretKey, timestamp, string(bytesData)), string(bytesData)
  1767. }
  1768. // 对账权限查询
  1769. func Jxyb3260(setl_optins string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  1770. // 生成签名
  1771. timestamp := time.Now().Unix()
  1772. // 生成输入报文
  1773. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1774. //input := make(map[string]interface{})
  1775. inputData := make(map[string]interface{})
  1776. inputMessage["infno"] = "3260" // 交易编码
  1777. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1778. inputData["fixmedins_name"] = org_name //对帐结束时间
  1779. inputData["fix_blng_admdvs"] = setl_optins //医疗费总额
  1780. //input["data"] = inputData
  1781. inputMessage["input"] = inputData //交易输入
  1782. bytesData, err := json.Marshal(inputMessage)
  1783. fmt.Println(string(bytesData))
  1784. if err != nil {
  1785. fmt.Println(err.Error())
  1786. return err.Error(), ""
  1787. }
  1788. request_url = request_url + "3260"
  1789. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1790. }
  1791. // 月度对账状态查询
  1792. func Jxyb3261(stmt_mon string, setl_optins string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  1793. // 生成签名
  1794. timestamp := time.Now().Unix()
  1795. // 生成输入报文
  1796. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1797. //input := make(map[string]interface{})
  1798. inputData := make(map[string]interface{})
  1799. inputMessage["infno"] = "3261" // 交易编码
  1800. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1801. inputData["fixmedins_name"] = org_name //对帐结束时间
  1802. inputData["fix_blng_admdvs"] = setl_optins //医疗费总额
  1803. inputData["stmt_mon"] = stmt_mon //医疗费总额
  1804. //input["data"] = inputData
  1805. inputMessage["input"] = inputData //交易输入
  1806. bytesData, err := json.Marshal(inputMessage)
  1807. fmt.Println(string(bytesData))
  1808. if err != nil {
  1809. fmt.Println(err.Error())
  1810. return err.Error(), ""
  1811. }
  1812. request_url = request_url + "3261"
  1813. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1814. }
  1815. func Jxyb3262(setl_mon, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, upld_btch string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, hp []models.FixMonRecDetailFileInTwo, funds []models.Fund) (string, string) {
  1816. // 生成签名
  1817. timestamp := time.Now().Unix()
  1818. // 生成输入报文
  1819. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1820. //input := make(map[string]interface{})
  1821. inputData := make(map[string]interface{})
  1822. fixMonRecDetailFileIns := make([]map[string]interface{}, 0)
  1823. fundList := make([]map[string]interface{}, 0)
  1824. inputMessage["infno"] = "3262" // 交易编码
  1825. inputData["fixmedins_code"] = fixmedins_code
  1826. inputData["fixmedins_name"] = org_name
  1827. inputData["fix_fill_dept"] = fix_fill_dept
  1828. inputData["fix_fill_psn_id"] = fix_fill_psn_id
  1829. inputData["fix_fill_psn"] = fix_fill_psn
  1830. inputData["fix_fill_date"] = fix_fill_date
  1831. inputData["stmt_loc"] = stmt_loc
  1832. inputData["upld_btch"] = upld_btch
  1833. inputData["setl_mon"] = setl_mon
  1834. for _, item := range hp {
  1835. fixMonRecDetailFileIn := make(map[string]interface{})
  1836. fixMonRecDetailFileIn["insutype"] = item.Insutype
  1837. fixMonRecDetailFileIn["psn_type"] = item.PsnType
  1838. fixMonRecDetailFileIn["med_type"] = item.MedType
  1839. fixMonRecDetailFileIn["fix_blng_admdvs"] = item.FixBlngAdmdvs
  1840. fixMonRecDetailFileIn["insu_admdvs"] = item.InsuAdmdvs
  1841. fixMonRecDetailFileIn["psn_time"] = item.PsnTime
  1842. fixMonRecDetailFileIn["psn_cnt"] = item.PsnCnt
  1843. fixMonRecDetailFileIn["medfee_sumamt"] = item.MedfeeSumAmt
  1844. fixMonRecDetailFileIn["inscp_amt"] = item.InscpAmt
  1845. fixMonRecDetailFileIn["fund_pay_sumamt"] = item.FundPaySumAmt
  1846. fixMonRecDetailFileIn["fund_key"] = item.FundKey
  1847. fixMonRecDetailFileIns = append(fixMonRecDetailFileIns, fixMonRecDetailFileIn)
  1848. }
  1849. for _, item := range funds {
  1850. fund := make(map[string]interface{})
  1851. fund["fund_key"] = item.FundKey
  1852. fund["fix_blng_admdvs"] = item.FixBlngAdmdvs
  1853. fund["insu_admdvs"] = item.InsuAdmdvs
  1854. fund["fund_code"] = item.FundCode
  1855. fund["fund_name"] = item.FundName
  1856. fund["fund_amt"] = item.FundAmt
  1857. fund["memo"] = ""
  1858. fundList = append(fundList, fund)
  1859. }
  1860. inputData["fixMonRecDetailFileInList"] = fixMonRecDetailFileIns
  1861. inputData["fundList"] = fundList
  1862. //input["data"] = inputData
  1863. inputMessage["input"] = inputData //交易输入
  1864. bytesData, err := json.Marshal(inputMessage)
  1865. fmt.Println(string(bytesData))
  1866. if err != nil {
  1867. fmt.Println(err.Error())
  1868. return err.Error(), ""
  1869. }
  1870. request_url = request_url + "3262"
  1871. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1872. }
  1873. func Jxyb3263(stmt_mon string, stmt_loc string, upld_btch string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  1874. // 生成签名
  1875. timestamp := time.Now().Unix()
  1876. // 生成输入报文
  1877. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1878. //input := make(map[string]interface{})
  1879. inputData := make(map[string]interface{})
  1880. inputMessage["infno"] = "3263" // 交易编码
  1881. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1882. inputData["fixmedins_name"] = org_name //对帐结束时间
  1883. inputData["setl_mon"] = stmt_mon //医疗费总额
  1884. inputData["stmt_loc"] = stmt_loc //医疗费总额
  1885. inputData["upld_btch"] = upld_btch //医疗费总额
  1886. //input["data"] = inputData
  1887. inputMessage["input"] = inputData //交易输入
  1888. bytesData, err := json.Marshal(inputMessage)
  1889. fmt.Println(string(bytesData))
  1890. if err != nil {
  1891. fmt.Println(err.Error())
  1892. return err.Error(), ""
  1893. }
  1894. request_url = request_url + "3263"
  1895. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1896. }
  1897. func Jxyb3264(stmt_mon string, stmt_loc string, upld_btch string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, hp []string) (string, string) {
  1898. // 生成签名
  1899. timestamp := time.Now().Unix()
  1900. // 生成输入报文
  1901. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1902. //input := make(map[string]interface{})
  1903. inputData := make(map[string]interface{})
  1904. inputMessage["infno"] = "3264" // 交易编码
  1905. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1906. inputData["fixmedins_name"] = org_name //对帐结束时间
  1907. inputData["setl_mon"] = stmt_mon //医疗费总额
  1908. inputData["stmt_loc"] = stmt_loc //医疗费总额
  1909. inputData["upld_btch"] = upld_btch //医疗费总额
  1910. //inputData["solidifyIdList"] = hp //医疗费总额
  1911. if len(hp) == 0 {
  1912. inputData["solidifyIdList"] = make([]string, 0) //医疗费总额
  1913. } else {
  1914. inputData["solidifyIdList"] = hp //医疗费总额
  1915. }
  1916. //input["data"] = inputData
  1917. inputMessage["input"] = inputData //交易输入
  1918. bytesData, err := json.Marshal(inputMessage)
  1919. fmt.Println(string(bytesData))
  1920. if err != nil {
  1921. fmt.Println(err.Error())
  1922. return err.Error(), ""
  1923. }
  1924. request_url = request_url + "3264"
  1925. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1926. }
  1927. func Jxyb3265(stmt_mon string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, upld_btch string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, hp []string) (string, string) {
  1928. // 生成签名
  1929. timestamp := time.Now().Unix()
  1930. // 生成输入报文
  1931. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1932. //input := make(map[string]interface{})
  1933. inputData := make(map[string]interface{})
  1934. //solidifyId := make(map[string]interface{})
  1935. inputMessage["infno"] = "3265" // 交易编码
  1936. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1937. inputData["fixmedins_name"] = org_name //对帐结束时间
  1938. inputData["setl_mon"] = stmt_mon //医疗费总额
  1939. inputData["fix_fill_dept"] = fix_fill_dept //对帐结束时间
  1940. inputData["fix_fill_psn_id"] = fix_fill_psn_id //对帐结束时间
  1941. inputData["fix_fill_psn"] = fix_fill_psn //对帐结束时间
  1942. inputData["fix_fill_date"] = fix_fill_date //对帐结束时间
  1943. inputData["stmt_loc"] = stmt_loc //医疗费总额
  1944. inputData["upld_btch"] = upld_btch //医疗费总额
  1945. fmt.Println(hp)
  1946. if len(hp) == 0 {
  1947. inputData["solidifyIdList"] = make([]string, 0) //医疗费总额
  1948. } else {
  1949. inputData["solidifyIdList"] = hp //医疗费总额
  1950. }
  1951. //input["data"] = inputData
  1952. inputMessage["input"] = inputData //交易输入
  1953. bytesData, err := json.Marshal(inputMessage)
  1954. fmt.Println(string(bytesData))
  1955. if err != nil {
  1956. fmt.Println(err.Error())
  1957. return err.Error(), ""
  1958. }
  1959. request_url = request_url + "3265"
  1960. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1961. }
  1962. func Jxyb3266(stmt_mon string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, upld_btch string, fix_blng_admdvs string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  1963. // 生成签名
  1964. timestamp := time.Now().Unix()
  1965. // 生成输入报文
  1966. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1967. //input := make(map[string]interface{})
  1968. inputData := make(map[string]interface{})
  1969. inputMessage["infno"] = "3266" // 交易编码
  1970. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  1971. inputData["fixmedins_name"] = org_name //对帐结束时间
  1972. inputData["fix_blng_admdvs"] = fix_blng_admdvs //对帐结束时间
  1973. inputData["setl_mon"] = stmt_mon //医疗费总额
  1974. inputData["fix_fill_dept"] = fix_fill_dept //对帐结束时间
  1975. inputData["fix_fill_psn_id"] = fix_fill_psn_id //对帐结束时间
  1976. inputData["fix_fill_psn"] = fix_fill_psn //对帐结束时间
  1977. inputData["fix_fill_date"] = fix_fill_date //对帐结束时间
  1978. inputData["stmt_loc"] = stmt_loc //医疗费总额
  1979. inputData["upld_btch"] = upld_btch //医疗费总额
  1980. //input["data"] = inputData
  1981. inputMessage["input"] = inputData //交易输入
  1982. bytesData, err := json.Marshal(inputMessage)
  1983. fmt.Println(string(bytesData))
  1984. if err != nil {
  1985. fmt.Println(err.Error())
  1986. return err.Error(), ""
  1987. }
  1988. request_url = request_url + "3266"
  1989. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  1990. }
  1991. func Jxyb3267(stmt_mon string, stmt_loc string, upld_btch string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  1992. // 生成签名
  1993. timestamp := time.Now().Unix()
  1994. // 生成输入报文
  1995. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  1996. //input := make(map[string]interface{})
  1997. inputData := make(map[string]interface{})
  1998. inputMessage["infno"] = "3267" // 交易编码
  1999. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2000. inputData["fixmedins_name"] = org_name //对帐结束时间
  2001. inputData["setl_mon"] = stmt_mon //医疗费总额
  2002. inputData["stmt_loc"] = stmt_loc //医疗费总额
  2003. inputData["upld_btch"] = upld_btch //医疗费总额
  2004. //input["data"] = inputData
  2005. inputMessage["input"] = inputData //交易输入
  2006. bytesData, err := json.Marshal(inputMessage)
  2007. fmt.Println(string(bytesData))
  2008. if err != nil {
  2009. fmt.Println(err.Error())
  2010. return err.Error(), ""
  2011. }
  2012. request_url = request_url + "3267"
  2013. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2014. }
  2015. func Jxyb3268(setl_mon string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, upld_btch string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, hp []models.FixMonRecDetailFileInTwo, funds []models.Fund) (string, string) {
  2016. // 生成签名
  2017. timestamp := time.Now().Unix()
  2018. // 生成输入报文
  2019. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2020. //input := make(map[string]interface{})
  2021. inputData := make(map[string]interface{})
  2022. fixMonRecDetailFileIns := make([]map[string]interface{}, 0)
  2023. fundList := make([]map[string]interface{}, 0)
  2024. inputMessage["infno"] = "3268" // 交易编码
  2025. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2026. inputData["fixmedins_name"] = org_name //对帐结束时间
  2027. inputData["upld_btch"] = upld_btch
  2028. inputData["setl_mon"] = setl_mon //对帐结束时间
  2029. inputData["fix_fill_dept"] = fix_fill_dept
  2030. inputData["fix_fill_psn_id"] = fix_fill_psn_id
  2031. inputData["fix_fill_psn"] = fix_fill_psn
  2032. inputData["fix_fill_date"] = fix_fill_date
  2033. inputData["stmt_loc"] = stmt_loc
  2034. for _, item := range hp {
  2035. fixMonRecDetailFileIn := make(map[string]interface{})
  2036. fixMonRecDetailFileIn["setl_date"] = item.SetlDate
  2037. fixMonRecDetailFileIn["insutype"] = item.Insutype
  2038. fixMonRecDetailFileIn["psn_type"] = item.PsnType
  2039. fixMonRecDetailFileIn["med_type"] = item.MedType
  2040. fixMonRecDetailFileIn["fix_blng_admdvs"] = mdtrtarea_admvs
  2041. fixMonRecDetailFileIn["insu_admdvs"] = insuplc_admdvs
  2042. fixMonRecDetailFileIn["psn_time"] = item.PsnTime
  2043. fixMonRecDetailFileIn["psn_cnt"] = item.PsnCnt
  2044. fixMonRecDetailFileIn["medfee_sumamt"] = item.MedfeeSumAmt
  2045. fixMonRecDetailFileIn["inscp_amt"] = item.InscpAmt
  2046. fixMonRecDetailFileIn["fund_pay_sumamt"] = item.FundPaySumAmt
  2047. fixMonRecDetailFileIn["fund_key"] = item.FundKey
  2048. fixMonRecDetailFileIns = append(fixMonRecDetailFileIns, fixMonRecDetailFileIn)
  2049. }
  2050. for _, item := range funds {
  2051. fund := make(map[string]interface{})
  2052. fund["fund_key"] = item.FundKey
  2053. fund["fix_blng_admdvs"] = item.FixBlngAdmdvs
  2054. fund["insu_admdvs"] = item.InsuAdmdvs
  2055. fund["fix_blng_admdvs"] = item.FixBlngAdmdvs
  2056. fund["insu_admdvs"] = item.InsuAdmdvs
  2057. fund["fund_code"] = item.FundCode
  2058. fund["fund_name"] = item.FundName
  2059. fund["fund_amt"] = item.FundAmt
  2060. fund["memo"] = ""
  2061. fundList = append(fundList, fund)
  2062. }
  2063. inputData["fixDateRecDetailFileInList"] = fixMonRecDetailFileIns
  2064. inputData["fundList"] = fundList
  2065. //input["data"] = inputData
  2066. inputMessage["input"] = inputData //交易输入
  2067. bytesData, err := json.Marshal(inputMessage)
  2068. fmt.Println(string(bytesData))
  2069. if err != nil {
  2070. fmt.Println(err.Error())
  2071. return err.Error(), ""
  2072. }
  2073. request_url = request_url + "3268"
  2074. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2075. }
  2076. func Jxyb3269(stmt_mon string, stmt_loc string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2077. // 生成签名
  2078. timestamp := time.Now().Unix()
  2079. // 生成输入报文
  2080. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2081. //input := make(map[string]interface{})
  2082. inputData := make(map[string]interface{})
  2083. inputMessage["infno"] = "3269" // 交易编码
  2084. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2085. inputData["fixmedins_name"] = org_name //对帐结束时间
  2086. inputData["setl_mon"] = stmt_mon //医疗费总额
  2087. inputData["stmt_loc"] = stmt_loc //医疗费总额
  2088. //input["data"] = inputData
  2089. inputMessage["input"] = inputData //交易输入
  2090. bytesData, err := json.Marshal(inputMessage)
  2091. fmt.Println(string(bytesData))
  2092. if err != nil {
  2093. fmt.Println(err.Error())
  2094. return err.Error(), ""
  2095. }
  2096. request_url = request_url + "3269"
  2097. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2098. }
  2099. func Jxyb3270(setl_mon string, stmt_loc string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, hp []string) (string, string) {
  2100. // 生成签名
  2101. timestamp := time.Now().Unix()
  2102. // 生成输入报文
  2103. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2104. //input := make(map[string]interface{})
  2105. inputData := make(map[string]interface{})
  2106. inputMessage["infno"] = "3270" // 交易编码
  2107. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2108. inputData["fixmedins_name"] = org_name //对帐结束时间
  2109. inputData["setl_mon"] = setl_mon //医疗费总额
  2110. inputData["stmt_loc"] = stmt_loc //医疗费总额
  2111. //inputData["solidifyIdList"] = hp //医疗费总额
  2112. if len(hp) == 0 {
  2113. inputData["solidifyIdList"] = make([]string, 0) //医疗费总额
  2114. } else {
  2115. inputData["solidifyIdList"] = hp //医疗费总额
  2116. }
  2117. //input["data"] = inputData
  2118. inputMessage["input"] = inputData //交易输入
  2119. bytesData, err := json.Marshal(inputMessage)
  2120. fmt.Println(string(bytesData))
  2121. if err != nil {
  2122. fmt.Println(err.Error())
  2123. return err.Error(), ""
  2124. }
  2125. request_url = request_url + "3270"
  2126. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2127. }
  2128. func Jxyb3271(stmt_mon string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string, hp []string) (string, string) {
  2129. // 生成签名
  2130. timestamp := time.Now().Unix()
  2131. // 生成输入报文
  2132. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2133. //input := make(map[string]interface{})
  2134. inputData := make(map[string]interface{})
  2135. inputMessage["infno"] = "3271" // 交易编码
  2136. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2137. inputData["fixmedins_name"] = org_name //对帐结束时间
  2138. inputData["setl_mon"] = stmt_mon //医疗费总额
  2139. inputData["fix_fill_dept"] = fix_fill_dept //对帐结束时间
  2140. inputData["fix_fill_psn_id"] = fix_fill_psn_id //对帐结束时间
  2141. inputData["fix_fill_psn"] = fix_fill_psn //对帐结束时间
  2142. inputData["fix_fill_date"] = fix_fill_date //对帐结束时间
  2143. inputData["stmt_loc"] = stmt_loc //医疗费总额
  2144. if len(hp) == 0 {
  2145. inputData["solidifyIdList"] = make([]string, 0) //医疗费总额
  2146. } else {
  2147. inputData["solidifyIdList"] = hp //医疗费总额
  2148. }
  2149. //input["data"] = inputData
  2150. inputMessage["input"] = inputData //交易输入
  2151. bytesData, err := json.Marshal(inputMessage)
  2152. fmt.Println(string(bytesData))
  2153. if err != nil {
  2154. fmt.Println(err.Error())
  2155. return err.Error(), ""
  2156. }
  2157. request_url = request_url + "3271"
  2158. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2159. }
  2160. func Jxyb3272(setl_mon string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2161. // 生成签名
  2162. timestamp := time.Now().Unix()
  2163. // 生成输入报文
  2164. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2165. //input := make(map[string]interface{})
  2166. inputData := make(map[string]interface{})
  2167. inputMessage["infno"] = "3272" // 交易编码
  2168. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2169. inputData["fixmedins_name"] = org_name //对帐结束时间
  2170. inputData["fix_blng_admdvs"] = mdtrtarea_admvs //对帐结束时间
  2171. inputData["setl_mon"] = setl_mon //对帐结束时间
  2172. inputData["fix_fill_dept"] = fix_fill_dept //对帐结束时间
  2173. inputData["fix_fill_psn_id"] = fix_fill_psn_id //对帐结束时间
  2174. inputData["fix_fill_psn"] = fix_fill_psn //
  2175. inputData["fix_fill_date"] = fix_fill_date //对帐结束时间
  2176. inputData["stmt_loc"] = stmt_loc //对帐结束时间
  2177. //input["data"] = inputData
  2178. inputMessage["input"] = inputData //交易输入
  2179. bytesData, err := json.Marshal(inputMessage)
  2180. fmt.Println(string(bytesData))
  2181. if err != nil {
  2182. fmt.Println(err.Error())
  2183. return err.Error(), ""
  2184. }
  2185. request_url = request_url + "3272"
  2186. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2187. }
  2188. func Jxyb3273(stmt_mon string, stmt_loc string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2189. // 生成签名
  2190. timestamp := time.Now().Unix()
  2191. // 生成输入报文
  2192. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2193. //input := make(map[string]interface{})
  2194. inputData := make(map[string]interface{})
  2195. inputMessage["infno"] = "3273" // 交易编码
  2196. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2197. inputData["fixmedins_name"] = org_name //对帐结束时间
  2198. inputData["setl_mon"] = stmt_mon //医疗费总额
  2199. inputData["stmt_loc"] = stmt_loc //医疗费总额
  2200. //input["data"] = inputData
  2201. inputMessage["input"] = inputData //交易输入
  2202. bytesData, err := json.Marshal(inputMessage)
  2203. fmt.Println(string(bytesData))
  2204. if err != nil {
  2205. fmt.Println(err.Error())
  2206. return err.Error(), ""
  2207. }
  2208. request_url = request_url + "3273"
  2209. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2210. }
  2211. func Jxyb3274(setl_mon string, fix_fill_dept string, fix_fill_psn_id string, fix_fill_psn string, fix_fill_date string, stmt_loc string, upld_btch string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2212. // 生成签名
  2213. timestamp := time.Now().Unix()
  2214. // 生成输入报文
  2215. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2216. input := make(map[string]interface{})
  2217. inputData := make(map[string]interface{})
  2218. inputMessage["infno"] = "3274" // 交易编码
  2219. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2220. inputData["fixmedins_name"] = org_name //对帐结束时间
  2221. inputData["fix_blng_admdvs"] = mdtrtarea_admvs //对帐结束时间
  2222. inputData["setl_mon"] = setl_mon //对帐结束时间
  2223. inputData["fix_fill_dept"] = fix_fill_dept //对帐结束时间
  2224. inputData["fix_fill_psn_id"] = fix_fill_psn_id //对帐结束时间
  2225. inputData["fix_fill_psn"] = fix_fill_psn //
  2226. inputData["fix_fill_date"] = fix_fill_date //对帐结束时间
  2227. inputData["stmt_loc"] = stmt_loc //对帐结束时间
  2228. input["data"] = inputData
  2229. inputMessage["input"] = input //交易输入
  2230. bytesData, err := json.Marshal(inputMessage)
  2231. fmt.Println(string(bytesData))
  2232. if err != nil {
  2233. fmt.Println(err.Error())
  2234. return err.Error(), ""
  2235. }
  2236. request_url = request_url + "3274"
  2237. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2238. }
  2239. func Jxyb3275(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2240. // 生成签名
  2241. timestamp := time.Now().Unix()
  2242. // 生成输入报文
  2243. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2244. input := make(map[string]interface{})
  2245. inputData := make(map[string]interface{})
  2246. fund := make(map[string]interface{})
  2247. fundList := make([]map[string]interface{}, 0)
  2248. inputMessage["infno"] = "3275" // 交易编码
  2249. inputData["dcla_cal"] = "" //医疗费总额
  2250. inputData["setlym"] = "" //医疗费总额
  2251. inputData["fix_blng_admdvs"] = "" //医疗费总额
  2252. inputData["insu_admdvs"] = "" //医疗费总额
  2253. inputData["medfee_sumamt"] = "" //医疗费总额
  2254. inputData["med_sumfee"] = "" //医疗费总额
  2255. inputData["fund_appy_sum"] = "" //医疗费总额
  2256. inputData["cash_payamt"] = "" //医疗费总额
  2257. fund["dcla_cal"] = ""
  2258. fund["setlym"] = ""
  2259. fund["fix_blng_admdvs"] = ""
  2260. fund["insu_admdvs"] = ""
  2261. fund["fund_code"] = ""
  2262. fund["fund_name"] = ""
  2263. fund["fund_amt"] = ""
  2264. fund["memo"] = ""
  2265. fundList = append(fundList, fund)
  2266. inputData["fundList"] = fundList
  2267. input["data"] = inputData
  2268. inputMessage["input"] = input //交易输入
  2269. bytesData, err := json.Marshal(inputMessage)
  2270. fmt.Println(string(bytesData))
  2271. if err != nil {
  2272. fmt.Println(err.Error())
  2273. return err.Error(), ""
  2274. }
  2275. request_url = request_url + "3275"
  2276. return JXHttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData), "3267"), string(bytesData)
  2277. }
  2278. func Jxyb3276(upld_btch_no, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2279. // 生成签名
  2280. timestamp := time.Now().Unix()
  2281. // 生成输入报文
  2282. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2283. input := make(map[string]interface{})
  2284. inputData := make(map[string]interface{})
  2285. inputMessage["infno"] = "3276" // 交易编码
  2286. inputData["upld_btch_no"] = upld_btch_no //医疗费总额
  2287. input["data"] = inputData
  2288. inputMessage["input"] = input //交易输入
  2289. bytesData, err := json.Marshal(inputMessage)
  2290. fmt.Println(string(bytesData))
  2291. if err != nil {
  2292. fmt.Println(err.Error())
  2293. return err.Error(), ""
  2294. }
  2295. request_url = request_url + "3276"
  2296. return JXHttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData), "3276"), string(bytesData)
  2297. }
  2298. func Jxyb3277(stmt_mon string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
  2299. // 生成签名
  2300. timestamp := time.Now().Unix()
  2301. // 生成输入报文
  2302. inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2303. input := make(map[string]interface{})
  2304. inputData := make(map[string]interface{})
  2305. inputMessage["infno"] = "3277" // 交易编码
  2306. inputData["fixmedins_code"] = fixmedins_code // 对帐开始时间
  2307. inputData["fixmedins_name"] = org_name //对帐结束时间
  2308. inputData["stmt_mon"] = stmt_mon //医疗费总额
  2309. input["data"] = inputData
  2310. inputMessage["input"] = input //交易输入
  2311. bytesData, err := json.Marshal(inputMessage)
  2312. fmt.Println(string(bytesData))
  2313. if err != nil {
  2314. fmt.Println(err.Error())
  2315. return err.Error(), ""
  2316. }
  2317. request_url = request_url + "3277"
  2318. return JXHttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData), "3277"), string(bytesData)
  2319. }
  2320. func Jsyb1318(code string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, cainfo string) (string, string) {
  2321. // 生成签名
  2322. timestamp := time.Now().Unix()
  2323. // 生成输入报文
  2324. inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
  2325. input := make(map[string]interface{})
  2326. inputData := make(map[string]interface{})
  2327. inputMessage["infno"] = "1318" // 交易编码
  2328. inputData["query_date"] = ""
  2329. inputData["hilist_code"] = code
  2330. inputData["hilist_lmtpric_type"] = ""
  2331. inputData["overlmt_dspo_way"] = ""
  2332. inputData["insu_admdvs"] = ""
  2333. inputData["begndate"] = ""
  2334. inputData["enddate"] = ""
  2335. inputData["vali_flag"] = ""
  2336. inputData["rid"] = ""
  2337. inputData["tabname"] = ""
  2338. inputData["poolarea_no"] = ""
  2339. inputData["updt_time"] = "2024-03-11"
  2340. inputData["page_num"] = "1"
  2341. inputData["page_size"] = "100"
  2342. input["data"] = inputData
  2343. inputMessage["input"] = input //交易输入
  2344. bytesData, err := json.Marshal(inputMessage)
  2345. fmt.Println(string(bytesData))
  2346. if err != nil {
  2347. fmt.Println(err.Error())
  2348. return err.Error(), ""
  2349. }
  2350. request_url = request_url + "1318"
  2351. return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), string(bytesData)
  2352. }