jsyb_service.go 144KB

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