jsyb_service.go 139KB

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