jsyb_service.go 139KB

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