main.go 242KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424
  1. package main
  2. import (
  3. _ "gdyb/routers"
  4. "gdyb/service"
  5. "github.com/astaxie/beego"
  6. //"github.com/qiniu/api.v7/auth/qbox"
  7. //"github.com/qiniu/api.v7/storage"
  8. //"github.com/qiniu/roapi.v7/auth/qbox"
  9. //"github.com/qiniu/api.v7/storage"
  10. //"strconv"
  11. //"time"
  12. )
  13. func init() {
  14. service.ConnectDB()
  15. org_id, _ := beego.AppConfig.Int64("org_id")
  16. miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  17. ////CreateLog(miConfig)
  18. ////UploadLog(miConfig)
  19. if org_id == 10191 {
  20. service.GetFjAuthorizationInfo(miConfig.Code)
  21. }
  22. }
  23. func main() {
  24. //service.AutoCreateStock()
  25. //service.AutoGdybCreateStock()
  26. //service.AutoUploadData
  27. //台山百伦清单上传方法
  28. //GetBatchSettleList()
  29. //深圳百霖
  30. //GetblBatchSettleList()
  31. //深圳百霖贝尔
  32. //GetbrBatchSettleList()
  33. //赤峰费森
  34. //GetcfBatchSettleList()
  35. beego.Run()
  36. }
  37. type CustomFundPay struct {
  38. FundPayType string `json:"fund_pay_type"`
  39. FundPayamt float64 `json:"fund_payamt"`
  40. }
  41. type ResultSeventeen struct {
  42. ErrMsg string `json:"err_msg"`
  43. InfRefmsgid string `json:"inf_refmsgid"`
  44. Infcode int64 `json:"infcode"`
  45. Output struct {
  46. SetlListId string `json:"setl_list_id"`
  47. } `json:"output"`
  48. RefmsgTime string `json:"refmsg_time"`
  49. RespondTime string `json:"respond_time"`
  50. Signtype string `json:"signtype"`
  51. WarnInfo string `json:"warn_info"`
  52. }
  53. //func GetcfBatchSettleList() {
  54. // orders, _ := service.GetAllHisOrder10265()
  55. //
  56. // for _, item := range orders{
  57. // order, _ := service.GetHisOrderByIDTwo(item.ID)
  58. // roles, _ := service.GetDoctorListTwo(item.UserOrgId)
  59. // his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
  60. // admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
  61. // curRoles, _ := service.GetAdminUserInfoByID(item.UserOrgId, 2738)
  62. // depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  63. // miConfig, _ := service.FindMedicalInsuranceInfo(item.UserOrgId)
  64. //
  65. // if order.ID == 0 {
  66. // c.ServeFailJSONWithSGJErrorCode(enu8ms.ErrorCodeHisOrderNoExistParamWrong)
  67. // return
  68. // }
  69. //
  70. // last_order, _ := service.GetLastHisOrder(c.GetAdminUserInfo().CurrentOrgId)
  71. // max_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
  72. // count, _ := strconv.ParseInt(max_order.FaPiaoNumber, 10, 64)
  73. // fmt.Println(count)
  74. // var zero string
  75. // number := count + 1
  76. // if number >= 1000 {
  77. // zero = "0000" + strconv.FormatInt(number, 10)
  78. // } else if number >= 10000 {
  79. // zero = "000" + strconv.FormatInt(number, 10)
  80. // } else if number >= 100000 {
  81. // zero = "00" + strconv.FormatInt(number, 10)
  82. // } else if number >= 1000000 {
  83. // zero = "0" + strconv.FormatInt(number, 10)
  84. // } else {
  85. // zero = strconv.FormatInt(number, 10)
  86. // }
  87. // fmt.Println(zero)
  88. //
  89. // struct4101 := service.Struct4101{
  90. // PsnNo: order.PsnNo,
  91. // MdtrtId: order.MdtrtId,
  92. // SetlId: order.SetlId,
  93. // PsnName: order.PsnName,
  94. // Gend: order.Gend,
  95. // Brdy: his.Brdy,
  96. // Age: int64(order.Age),
  97. // Naty: order.Naty,
  98. // PatnCertType: "01",
  99. // Certno: order.Certno,
  100. // Prfs: "90",
  101. // ConerName: roles[0].UserName,
  102. // PatnRlts: "99",
  103. // ConerAddr: miConfig.OrgName,
  104. // ConerTel: admin.Mobile,
  105. // HiType: order.Insutype,
  106. // Insuplc: miConfig.InsuplcAdmdvs,
  107. // MaindiagFlag: "1",
  108. // BillCode: order.SetlId,
  109. // BillNo: order.SetlId,
  110. // BizSn: order.Number,
  111. // PsnSelfPay: order.PsnPartAmt,
  112. // PsnOwnPay: order.PsnPartAmt,
  113. // AcctPay: order.AcctPay,
  114. // PsnCashpay: order.PsnCashPay,
  115. // HiPaymtd: "1",
  116. // Hsorg: miConfig.InsuplcAdmdvs,
  117. // HsorgOpter: miConfig.InsuplcAdmdvs,
  118. // MedinsFillPsn: curRoles.UserName,
  119. // MedinsFillDept: depart.Name,
  120. // IptMedType: "2",
  121. // AdmTime: his.InHosptialTime,
  122. // AdmEndTime: his.OutHosptialTime,
  123. // }
  124. // struct4101.SetlBegnDate = order.SetlTime
  125. // struct4101.SetlEndDate = order.SetlTime
  126. //
  127. // var rf []CustomFundPay
  128. // json.Unmarshal([]byte(order.SetlDetail), &rf)
  129. //
  130. // var tempFunPays []service.CustomStruct
  131. // for _, item := range rf {
  132. // var tempFunPay service.CustomStruct
  133. // tempFunPay.FundPayamt = item.FundPayamt
  134. // tempFunPay.FundPayType = item.FundPayType
  135. // tempFunPays = append(tempFunPays, tempFunPay)
  136. // }
  137. // struct4101.CustomStruct = tempFunPays
  138. //
  139. // var tempDiaginfos []service.DiaginfoStructTwo
  140. // var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  141. // var tempOpspdiseinfos []service.OpspdiseinfoStruct
  142. // infos, _ := service.FindLastPatientPrescriptionInfoTwo2(c.GetAdminUserInfo().CurrentOrgId, his.PatientId,strings.Split(his.InHosptialTime," ")[0],strings.Split(his.OutHosptialTime," ")[0])
  143. // for _, item := range infos{
  144. // his.Diagnosis = his.Diagnosis+","+ item.Diagnosis
  145. // }
  146. // diagnosis_ids_arr := strings.Split(his.Diagnosis, ",")
  147. // diagnosis_ids_arr = RemoveRepeatedPurviewElement2(diagnosis_ids_arr)
  148. // //diagnosis_ids := strings.Split(his.Diagnosis, ",")
  149. // fmt.Println(diagnosis_ids_arr)
  150. // var config []*models.HisXtDiagnoseConfig
  151. // for _, item := range diagnosis_ids_arr {
  152. // id, _ := strconv.ParseInt(item, 10, 64)
  153. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  154. // if diagnosisConfig.ID > 0 {
  155. // config = append(config, &diagnosisConfig)
  156. // }
  157. // }
  158. //
  159. // for index, item := range config {
  160. // if item.ID > 0 {
  161. // if index == 0 {
  162. // var tempDiaginfo service.DiaginfoStructTwo
  163. // tempDiaginfo.DiagCode = item.CountryCode
  164. // tempDiaginfo.DiagName = item.CountryContentName
  165. // tempDiaginfo.DiagType = "1"
  166. // tempDiaginfo.MaindiagFlag = "1"
  167. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  168. // } else {
  169. //
  170. // var tempDiaginfo service.DiaginfoStructTwo
  171. // tempDiaginfo.DiagCode = item.CountryCode
  172. // tempDiaginfo.DiagName = item.CountryContentName
  173. // tempDiaginfo.DiagType = "2"
  174. // tempDiaginfo.MaindiagFlag = "0"
  175. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  176. // }
  177. // }
  178. // }
  179. // struct4101.Diseinfo = tempDiaginfos
  180. //
  181. // sickConfigTwo, _ := service.FindSickById(his.SickType)
  182. // tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  183. // tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  184. // tempOpspdiseinfo2.OprnOprtCode = ""
  185. // tempOpspdiseinfo2.OprnOprtName = ""
  186. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  187. // struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  188. //
  189. // var iteminfo service.IteminfoStruct
  190. //
  191. // var bedCostTotal float64 = 0 //床位总费
  192. // var bedCostSelfTotal float64 = 0 //床位自费
  193. // var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  194. //
  195. // var operationCostTotal float64 = 0 //手术费
  196. // var operationCostSelfTotal float64 = 0 //手术费
  197. // var operationCostPartSelfTotal float64 = 0 //手术费
  198. //
  199. // var otherCostTotal float64 = 0 //其他费用
  200. // var otherCostSelfTotal float64 = 0 //其他费用
  201. // var otherCostPartSelfTotal float64 = 0 //其他费用
  202. //
  203. // var materialCostTotal float64 = 0 //材料费
  204. // var materialCostSelfTotal float64 = 0 //材料费
  205. // var materialCostPartSelfTotal float64 = 0 //材料费
  206. //
  207. // var westernMedicineCostTotal float64 = 0 //西药费
  208. // var westernMedicineCostSelfTotal float64 = 0 //西药费
  209. // var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  210. //
  211. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  212. // var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  213. // var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  214. //
  215. // var checkCostTotal float64 = 0 //检查费
  216. // var checkCostSelfTotal float64 = 0 //检查费
  217. // var checkCostPartSelfTotal float64 = 0 //检查费
  218. //
  219. // var laboratoryCostTotal float64 = 0 //化验费
  220. // var laboratoryCostSelfTotal float64 = 0 //化验费
  221. // var laboratoryCostPartSelfTotal float64 = 0 //化验费
  222. //
  223. // var treatCostTotal float64 = 0 //治疗费用
  224. // var treatCostSelfTotal float64 = 0 //治疗费用
  225. // var treatCostPartSelfTotal float64 = 0 //治疗费用
  226. //
  227. // decimal.DivisionPrecision = 2
  228. //
  229. // var bed_fulamt_ownpay_amt float64 = 0
  230. // var operation_fulamt_ownpay_amt float64 = 0
  231. // var other_fulamt_ownpay_amt float64 = 0
  232. // var westernMedicine_fulamt_ownpay_amt float64 = 0
  233. // var chineseTraditional_fulamt_ownpay_amt float64 = 0
  234. // var check_fulamt_ownpay_amt float64 = 0
  235. // var material_fulamt_ownpay_amt float64 = 0
  236. // var laboratory_fulamt_ownpay_amt float64 = 0
  237. // var treat_fulamt_ownpay_amt float64 = 0
  238. //
  239. // var bed_claa_sunmfee float64 = 0
  240. // var bed_clab_amt float64 = 0
  241. // var bed_other_amt float64 = 0
  242. //
  243. // var operation_claa_sunmfee float64 = 0
  244. // var operation_clab_amt float64 = 0
  245. // var operation_other_amt float64 = 0
  246. //
  247. // var other_claa_sunmfee float64 = 0
  248. // var other_clab_amt float64 = 0
  249. // var other_other_amt float64 = 0
  250. //
  251. // var westernMedicine_claa_sunmfee float64 = 0
  252. // var westernMedicine_clab_amt float64 = 0
  253. // var westernMedicine_other_amt float64 = 0
  254. //
  255. // var chineseTraditional_claa_sunmfee float64 = 0
  256. // var chineseTraditional_clab_amt float64 = 0
  257. // var chineseTraditional_other_amt float64 = 0
  258. //
  259. // var check_claa_sunmfee float64 = 0
  260. // var check_clab_amt float64 = 0
  261. // var check_other_amt float64 = 0
  262. //
  263. // var material_claa_sunmfee float64 = 0
  264. // var material_clab_amt float64 = 0
  265. // var material_other_amt float64 = 0
  266. //
  267. // var laboratory_claa_sunmfee float64 = 0
  268. // var laboratory_clab_amt float64 = 0
  269. // var laboratory_other_amt float64 = 0
  270. //
  271. // var treat_claa_sunmfee float64 = 0
  272. // var treat_clab_amt float64 = 0
  273. // var treat_other_amt float64 = 0
  274. //
  275. // for _, item := range order.HisOrderInfo {
  276. // if item.MedChrgitmType == "01" { //床位费
  277. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  278. // bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  279. // bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  280. // bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  281. // if item.ChrgitmLv == "1" {
  282. // bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  283. // }
  284. // if item.ChrgitmLv == "2" {
  285. // bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  286. //
  287. // }
  288. // if item.ChrgitmLv == "3" {
  289. // bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  290. // }
  291. //
  292. // }
  293. //
  294. // if item.MedChrgitmType == "03" { //检查费
  295. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  296. // checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  297. // checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  298. // check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  299. // if item.ChrgitmLv == "1" {
  300. //
  301. // check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  302. //
  303. // }
  304. // if item.ChrgitmLv == "2" {
  305. // check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  306. //
  307. // }
  308. // if item.ChrgitmLv == "3" {
  309. // check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  310. // }
  311. // }
  312. //
  313. // if item.MedChrgitmType == "04" { //化验费
  314. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  315. // laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  316. // laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  317. // laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  318. // if item.ChrgitmLv == "1" {
  319. //
  320. // laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  321. //
  322. // }
  323. // if item.ChrgitmLv == "2" {
  324. // laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  325. //
  326. // }
  327. // if item.ChrgitmLv == "3" {
  328. // laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  329. // }
  330. // }
  331. //
  332. // if item.MedChrgitmType == "05" { //治疗费
  333. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  334. // treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  335. // treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  336. // treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  337. // if item.ChrgitmLv == "1" {
  338. //
  339. // treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  340. //
  341. // }
  342. // if item.ChrgitmLv == "2" {
  343. // treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  344. //
  345. // }
  346. // if item.ChrgitmLv == "3" {
  347. // treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  348. // }
  349. // }
  350. //
  351. // if item.MedChrgitmType == "06" { //手术费
  352. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  353. // operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  354. // operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  355. // operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  356. //
  357. // if item.ChrgitmLv == "1" {
  358. //
  359. // operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  360. //
  361. // }
  362. // if item.ChrgitmLv == "2" {
  363. // operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  364. //
  365. // }
  366. // if item.ChrgitmLv == "3" {
  367. // operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  368. // }
  369. // }
  370. //
  371. // if item.MedChrgitmType == "08" { //材料费
  372. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  373. // materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  374. // materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  375. // material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  376. // if item.ChrgitmLv == "1" {
  377. //
  378. // material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  379. //
  380. // }
  381. // if item.ChrgitmLv == "2" {
  382. // material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  383. //
  384. // }
  385. // if item.ChrgitmLv == "3" {
  386. // material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  387. // }
  388. // }
  389. //
  390. // if item.MedChrgitmType == "09" { //西药费
  391. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  392. // westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  393. // westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  394. // westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  395. // if item.ChrgitmLv == "1" {
  396. //
  397. // westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  398. //
  399. // }
  400. // if item.ChrgitmLv == "2" {
  401. // westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  402. //
  403. // }
  404. // if item.ChrgitmLv == "3" {
  405. // westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  406. // }
  407. // }
  408. //
  409. // if item.MedChrgitmType == "11" { //中成费
  410. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  411. // chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  412. // chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  413. // chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  414. // if item.ChrgitmLv == "1" {
  415. //
  416. // chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  417. //
  418. // }
  419. // if item.ChrgitmLv == "2" {
  420. // chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  421. //
  422. // }
  423. // if item.ChrgitmLv == "3" {
  424. // chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  425. // }
  426. // }
  427. //
  428. // if item.MedChrgitmType == "14" { //其他费
  429. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  430. // otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  431. // otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  432. // other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  433. // if item.ChrgitmLv == "1" {
  434. // other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  435. //
  436. // }
  437. // if item.ChrgitmLv == "2" {
  438. // other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  439. //
  440. // }
  441. // if item.ChrgitmLv == "3" {
  442. // other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  443. // }
  444. // }
  445. //
  446. // }
  447. //
  448. // var iteminfoStructs []service.IteminfoStruct
  449. //
  450. // if bedCostTotal != 0 {
  451. // iteminfo.MedChrgitm = "01"
  452. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  453. // iteminfo.Amt = bedCostTotal
  454. // iteminfo.ClaaSumfee = bed_claa_sunmfee
  455. // iteminfo.ClabAmt = bed_clab_amt
  456. // iteminfo.OthAmt = bed_other_amt
  457. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  458. // }
  459. //
  460. // if checkCostTotal != 0 {
  461. // iteminfo.MedChrgitm = "03"
  462. // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  463. // iteminfo.Amt = checkCostTotal
  464. // iteminfo.ClaaSumfee = check_claa_sunmfee
  465. // iteminfo.ClabAmt = check_clab_amt
  466. // iteminfo.OthAmt = check_other_amt
  467. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  468. //
  469. // }
  470. //
  471. // if laboratoryCostTotal != 0 {
  472. // iteminfo.MedChrgitm = "04"
  473. // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  474. // iteminfo.Amt = laboratoryCostTotal
  475. // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  476. // iteminfo.ClabAmt = laboratory_clab_amt
  477. // iteminfo.OthAmt = laboratory_other_amt
  478. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  479. //
  480. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  481. //
  482. // }
  483. //
  484. // if treatCostTotal != 0 {
  485. // iteminfo.MedChrgitm = "05"
  486. // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  487. // iteminfo.Amt = treatCostTotal
  488. // iteminfo.ClaaSumfee = treat_claa_sunmfee
  489. // iteminfo.ClabAmt = treat_clab_amt
  490. // iteminfo.OthAmt = treat_other_amt
  491. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  492. // //(struct4101.IteminfoStruct, iteminfo)
  493. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  494. // }
  495. //
  496. // if operationCostTotal != 0 {
  497. // iteminfo.MedChrgitm = "06"
  498. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  499. // iteminfo.Amt = operationCostTotal
  500. // iteminfo.ClaaSumfee = operation_claa_sunmfee
  501. // iteminfo.ClabAmt = operation_clab_amt
  502. // iteminfo.OthAmt = operation_other_amt
  503. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  504. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  505. // }
  506. //
  507. // if materialCostTotal != 0 {
  508. // iteminfo.MedChrgitm = "08"
  509. // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  510. // iteminfo.Amt = materialCostTotal
  511. // iteminfo.ClaaSumfee = material_claa_sunmfee
  512. // iteminfo.ClabAmt = material_clab_amt
  513. // iteminfo.OthAmt = material_other_amt
  514. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  515. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  516. // }
  517. //
  518. // if westernMedicineCostTotal != 0 {
  519. // iteminfo.MedChrgitm = "09"
  520. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  521. // iteminfo.Amt = westernMedicineCostTotal
  522. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  523. // iteminfo.ClabAmt = westernMedicine_clab_amt
  524. // iteminfo.OthAmt = westernMedicine_other_amt
  525. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  526. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  527. //
  528. // }
  529. // if chineseTraditionalMedicineCostTotal != 0 {
  530. // iteminfo.MedChrgitm = "11"
  531. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  532. // iteminfo.Amt = westernMedicineCostTotal
  533. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  534. // iteminfo.ClabAmt = westernMedicine_clab_amt
  535. // iteminfo.OthAmt = westernMedicine_other_amt
  536. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  537. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  538. //
  539. // }
  540. // if otherCostTotal != 0 {
  541. // iteminfo.MedChrgitm = "14"
  542. // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  543. // iteminfo.Amt = otherCostTotal
  544. // iteminfo.ClaaSumfee = other_claa_sunmfee
  545. // iteminfo.ClabAmt = other_clab_amt
  546. // iteminfo.OthAmt = other_other_amt
  547. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  548. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  549. //
  550. // }
  551. // struct4101.IteminfoStruct = iteminfoStructs
  552. // struct4101.Ntly = "中国"
  553. // struct4101.AdmCaty = "A03.06"
  554. // var resOther ResultSeventeenOther
  555. // var res ResultSeventeen
  556. // if miConfig.MdtrtareaAdmvs == "150499" {
  557. // var pp models.PublicParams
  558. // pp.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
  559. // pp.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
  560. // pp.FixmedinsName = miConfig.OrgName
  561. // pp.FixmedinsCode = miConfig.Code
  562. // pp.RequestUrl = miConfig.Url
  563. // pp.Cainfo = miConfig.Cainfo
  564. // pp.SecretKey = miConfig.SecretKey
  565. // pp.AccessKey = miConfig.AccessKey
  566. // pp.OpterName = curRoles.UserName
  567. // client := &http.Client{}
  568. // var req *http.Request
  569. // data := make(map[string]interface{})
  570. // data["struct4101"] = struct4101
  571. // data["pp"] = pp
  572. // bytesData, _ := json.Marshal(data)
  573. // req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"nmyb/4101", bytes.NewReader(bytesData))
  574. // resp, _ := client.Do(req)
  575. // defer resp.Body.Close()
  576. // body, ioErr := ioutil.ReadAll(resp.Body)
  577. // if ioErr != nil {
  578. // utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
  579. // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  580. // return
  581. // }
  582. // var respJSON map[string]interface{}
  583. // if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
  584. // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  585. // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  586. // return
  587. // }
  588. //
  589. // respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
  590. // userJSONBytes, _ := json.Marshal(respJSON)
  591. // if err := json.Unmarshal(userJSONBytes, &resOther); err != nil {
  592. // utils.ErrorLog("解析失败:%v", err)
  593. // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  594. // return
  595. // }
  596. // res.InfRefmsgid = resOther.InfRefmsgid
  597. // res.Output = resOther.Output
  598. // res.ErrMsg = resOther.ErrMsg
  599. // infocode, _ := strconv.ParseInt(resOther.Infcode, 10, 64)
  600. // res.Infcode = infocode
  601. // }
  602. // if res.Infcode != 0 {
  603. // c.ServeSuccessJSON(map[string]interface{}{
  604. // "failed_code": -10,
  605. // "msg": res.ErrMsg,
  606. // })
  607. // return
  608. // } else {
  609. // if miConfig.MdtrtareaAdmvs != "150499" {
  610. // order.FaPiaoNumber = zero
  611. // order.FaPiaoCode = last_order.FaPiaoCode
  612. // service.UpdateOrder(order)
  613. // }
  614. // hisFundSettleListResult := &models.HisFundSettleListResult{
  615. // Number: res.Output.SetlListId,
  616. // Status: 1,
  617. // Ctime: time.Now().Unix(),
  618. // Mtime: time.Now().Unix(),
  619. // UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
  620. // IsUpload: 1,
  621. // OrderId: order_id,
  622. // }
  623. // service.CreateUploadRecord(hisFundSettleListResult)
  624. // c.ServeSuccessJSON(map[string]interface{}{
  625. // "msg": "上传成功",
  626. // "result": hisFundSettleListResult,
  627. // })
  628. // return
  629. // }
  630. //}
  631. //
  632. //
  633. //func GetblBatchSettleList() {
  634. // org_id, _ := beego.AppConfig.Int64("org_id")
  635. // //var orders []*models.HisOrder
  636. // var orders []*models.HisOrderError
  637. //
  638. // orders, _ = service.GetOrderError10138(org_id)
  639. // for _, item := range orders {
  640. // order_id := item.PatientId
  641. // order, _ := service.GetHisOrderByIDTwo(order_id)
  642. // his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  643. // var patientPrescription models.HisPrescriptionInfo
  644. // patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
  645. // doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
  646. // department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
  647. // miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
  648. // var configTwo []*models.HisXtDiagnoseConfig
  649. // diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
  650. // curRoles, _ := service.GetAdminUserInfoByID(org_id, 2185)
  651. // for _, item := range diagnosis_idstwo {
  652. // id, _ := strconv.ParseInt(item, 10, 64)
  653. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  654. // configTwo = append(configTwo, &diagnosisConfig)
  655. // }
  656. //
  657. // sickConfig, _ := service.FindSickById(his.SickType)
  658. // if order.MedType == "1111" || order.MedType == "1112" {
  659. // order.MedType = "11"
  660. // }
  661. // service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
  662. //
  663. // depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  664. // pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
  665. // doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
  666. // if order.ID == 0 {
  667. // return
  668. // }
  669. // if his.BalanceAccountsType == 2 {
  670. // continue
  671. // }
  672. // struct4101 := service.Struct4101{
  673. // PsnNo: order.PsnNo,
  674. // MdtrtId: order.MdtrtId,
  675. // SetlId: order.SetlId,
  676. // PsnName: order.PsnName,
  677. // Gend: order.Gend,
  678. // Brdy: his.Brdy,
  679. // Age: his.Age,
  680. // Naty: order.Naty,
  681. // PatnCertType: order.PsnCertType,
  682. // Certno: order.Certno,
  683. // Prfs: "90",
  684. // ConerName: "",
  685. // PatnRlts: "",
  686. // ConerAddr: "",
  687. // ConerTel: "",
  688. // HiType: order.Insutype,
  689. // Insuplc: his.InsuplcAdmdvs,
  690. // MaindiagFlag: "1",
  691. // BillCode: order.SetlId,
  692. // BillNo: order.SetlId,
  693. // BizSn: order.Number,
  694. // PsnSelfPay: order.PsnPartAmt,
  695. // PsnOwnPay: order.PsnPartAmt,
  696. // AcctPay: order.AcctPay,
  697. // PsnCashpay: order.PsnCashPay,
  698. // HiPaymtd: "1",
  699. // Hsorg: his.InsuplcAdmdvs,
  700. // HsorgOpter: his.InsuplcAdmdvs,
  701. // MedinsFillPsn: curRoles.UserName,
  702. // MedinsFillDept: depart.Name,
  703. // IptMedType: "2",
  704. // }
  705. //
  706. // struct4101.SetlBegnDate = order.SetlTime
  707. // struct4101.SetlEndDate = order.SetlTime
  708. //
  709. // var rf []CustomFundPay
  710. // json.Unmarshal([]byte(order.SetlDetail), &rf)
  711. //
  712. // //var tempFunPays []service.CustomStruct
  713. // //var tempFunPay610100 service.CustomStruct
  714. //
  715. // //for _, item := range rf {
  716. // // if item.FundPayType == "610100" {
  717. // // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  718. // // tempFunPay610100.FundPayType = item.FundPayType
  719. // // } else {
  720. // // var tempFunPay service.CustomStruct
  721. // // tempFunPay.FundPayamt = item.FundPayamt
  722. // // tempFunPay.FundPayType = item.FundPayType
  723. // // tempFunPays = append(tempFunPays, tempFunPay)
  724. // // }
  725. // //}
  726. // //tempFunPays = append(tempFunPays, tempFunPay610100)
  727. // //struct4101.CustomStruct = tempFunPays
  728. //
  729. // var tempDiaginfos []service.DiaginfoStructTwo
  730. // var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  731. // var tempOpspdiseinfos []service.OpspdiseinfoStruct
  732. //
  733. // diagnosis_ids := strings.Split(his.Diagnosis, ",")
  734. // var config []*models.HisXtDiagnoseConfig
  735. // for _, item := range diagnosis_ids {
  736. // id, _ := strconv.ParseInt(item, 10, 64)
  737. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  738. // config = append(config, &diagnosisConfig)
  739. // }
  740. //
  741. // for index, item := range config {
  742. // if index == 0 {
  743. // var tempDiaginfo service.DiaginfoStructTwo
  744. // tempDiaginfo.DiagCode = item.CountryCode
  745. // tempDiaginfo.DiagName = item.CountryContentName
  746. // tempDiaginfo.DiagType = "1"
  747. // tempDiaginfo.MaindiagFlag = "1"
  748. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  749. // } else {
  750. //
  751. // var tempDiaginfo service.DiaginfoStructTwo
  752. // tempDiaginfo.DiagCode = item.CountryCode
  753. // tempDiaginfo.DiagName = item.CountryContentName
  754. // tempDiaginfo.DiagType = "2"
  755. // tempDiaginfo.MaindiagFlag = "0"
  756. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  757. // }
  758. // }
  759. // struct4101.Diseinfo = tempDiaginfos
  760. //
  761. // sickConfigTwo, _ := service.FindSickById(his.SickType)
  762. // tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  763. // tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  764. // tempOpspdiseinfo2.OprnOprtCode = ""
  765. // tempOpspdiseinfo2.OprnOprtName = ""
  766. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  767. // struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  768. //
  769. // //var iteminfo service.IteminfoStruct
  770. //
  771. // var bedCostTotal float64 = 0 //床位总费
  772. // var bedCostSelfTotal float64 = 0 //床位自费
  773. // var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  774. //
  775. // var examineCostTotal float64 = 0 //诊查总费
  776. // var examineCostSelfTotal float64 = 0 //诊查自费
  777. // var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  778. //
  779. // var nursingCostTotal float64 = 0 //护理总费
  780. // var nursingCostSelfTotal float64 = 0 //护理自费
  781. // var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  782. //
  783. // var chineseMedicineCostTotal float64 = 0 //中成药
  784. // var chineseMedicineCostSelfTotal float64 = 0 //中成药
  785. // var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  786. //
  787. // var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  788. // var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  789. // var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  790. //
  791. // var registerCostTotal float64 = 0 //一般诊疗费
  792. // var registerCostSelfTotal float64 = 0 //一般诊疗费
  793. // var registerPartSelfTotal float64 = 0 //一般诊疗费
  794. //
  795. // var operationCostTotal float64 = 0 //手术费
  796. // var operationCostSelfTotal float64 = 0 //手术费
  797. // var operationCostPartSelfTotal float64 = 0 //手术费
  798. //
  799. // var otherCostTotal float64 = 0 //其他费用
  800. // var otherCostSelfTotal float64 = 0 //其他费用
  801. // var otherCostPartSelfTotal float64 = 0 //其他费用
  802. //
  803. // var materialCostTotal float64 = 0 //材料费
  804. // var materialCostSelfTotal float64 = 0 //材料费
  805. // var materialCostPartSelfTotal float64 = 0 //材料费
  806. //
  807. // var westernMedicineCostTotal float64 = 0 //西药费
  808. // var westernMedicineCostSelfTotal float64 = 0 //西药费
  809. // var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  810. //
  811. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  812. // var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  813. // var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  814. //
  815. // var checkCostTotal float64 = 0 //检查费
  816. // var checkCostSelfTotal float64 = 0 //检查费
  817. // var checkCostPartSelfTotal float64 = 0 //检查费
  818. //
  819. // var laboratoryCostTotal float64 = 0 //化验费
  820. // var laboratoryCostSelfTotal float64 = 0 //化验费
  821. // var laboratoryCostPartSelfTotal float64 = 0 //化验费
  822. //
  823. // var treatCostTotal float64 = 0 //治疗费用
  824. // var treatCostSelfTotal float64 = 0 //治疗费用
  825. // var treatCostPartSelfTotal float64 = 0 //治疗费用
  826. //
  827. // decimal.DivisionPrecision = 2
  828. //
  829. // var bed_fulamt_ownpay_amt float64 = 0
  830. //
  831. // var examine_fulamt_ownpay_amt float64 = 0
  832. //
  833. // var nursing_fulamt_ownpay_amt float64 = 0
  834. //
  835. // var chinese_medicine_fulamt_ownpay_amt float64 = 0
  836. //
  837. // var commonly_treatment_fulamt_ownpay_amt float64 = 0
  838. //
  839. // var register_fulamt_ownpay_amt float64 = 0
  840. //
  841. // var operation_fulamt_ownpay_amt float64 = 0
  842. // var other_fulamt_ownpay_amt float64 = 0
  843. // var westernMedicine_fulamt_ownpay_amt float64 = 0
  844. // var chineseTraditional_fulamt_ownpay_amt float64 = 0
  845. // var check_fulamt_ownpay_amt float64 = 0
  846. // var material_fulamt_ownpay_amt float64 = 0
  847. // var laboratory_fulamt_ownpay_amt float64 = 0
  848. // var treat_fulamt_ownpay_amt float64 = 0
  849. //
  850. // var bed_claa_sunmfee float64 = 0
  851. // var bed_clab_amt float64 = 0
  852. // var bed_other_amt float64 = 0
  853. //
  854. // var examine_claa_sunmfee float64 = 0
  855. // var examine_clab_amt float64 = 0
  856. // var examine_other_amt float64 = 0
  857. //
  858. // var nursing_claa_sunmfee float64 = 0
  859. // var nursing_clab_amt float64 = 0
  860. // var nursing_other_amt float64 = 0
  861. //
  862. // var chinese_medicine_claa_sunmfee float64 = 0
  863. // var chinese_medicine_clab_amt float64 = 0
  864. // var chinese_medicine_other_amt float64 = 0
  865. //
  866. // var commonly_treatment_claa_sunmfee float64 = 0
  867. // var commonly_treatment_clab_amt float64 = 0
  868. // var commonly_treatment_other_amt float64 = 0
  869. //
  870. // var operation_claa_sunmfee float64 = 0
  871. // var operation_clab_amt float64 = 0
  872. // var operation_other_amt float64 = 0
  873. //
  874. // var other_claa_sunmfee float64 = 0
  875. // var other_clab_amt float64 = 0
  876. // var other_other_amt float64 = 0
  877. //
  878. // var westernMedicine_claa_sunmfee float64 = 0
  879. // var westernMedicine_clab_amt float64 = 0
  880. // var westernMedicine_other_amt float64 = 0
  881. //
  882. // var chineseTraditional_claa_sunmfee float64 = 0
  883. // var chineseTraditional_clab_amt float64 = 0
  884. // var chineseTraditional_other_amt float64 = 0
  885. //
  886. // var check_claa_sunmfee float64 = 0
  887. // var check_clab_amt float64 = 0
  888. // var check_other_amt float64 = 0
  889. //
  890. // var material_claa_sunmfee float64 = 0
  891. // var material_clab_amt float64 = 0
  892. // var material_other_amt float64 = 0
  893. //
  894. // var laboratory_claa_sunmfee float64 = 0
  895. // var laboratory_clab_amt float64 = 0
  896. // var laboratory_other_amt float64 = 0
  897. //
  898. // var treat_claa_sunmfee float64 = 0
  899. // var treat_clab_amt float64 = 0
  900. // var treat_other_amt float64 = 0
  901. //
  902. // var register_claa_sunmfee float64 = 0
  903. // var register_clab_amt float64 = 0
  904. // var register_other_amt float64 = 0
  905. //
  906. // for _, item := range order.HisOrderInfo {
  907. // if item.MedChrgitmType == "01" { //床位费
  908. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  909. // bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  910. // bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  911. // bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  912. // if item.ChrgitmLv == "1" {
  913. // bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  914. // }
  915. // if item.ChrgitmLv == "2" {
  916. // bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  917. //
  918. // }
  919. // if item.ChrgitmLv == "3" {
  920. // bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  921. // }
  922. //
  923. // }
  924. //
  925. // if item.MedChrgitmType == "02" { //诊查
  926. // examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  927. // examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  928. // examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  929. // examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  930. // if item.ChrgitmLv == "1" {
  931. // examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  932. // }
  933. // if item.ChrgitmLv == "2" {
  934. // examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  935. //
  936. // }
  937. // if item.ChrgitmLv == "3" {
  938. // examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  939. // }
  940. //
  941. // }
  942. //
  943. // if item.MedChrgitmType == "03" { //检查费
  944. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  945. // checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  946. // checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  947. // check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  948. // if item.ChrgitmLv == "1" {
  949. //
  950. // check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  951. //
  952. // }
  953. // if item.ChrgitmLv == "2" {
  954. // check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  955. //
  956. // }
  957. // if item.ChrgitmLv == "3" {
  958. // check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  959. // }
  960. // }
  961. //
  962. // if item.MedChrgitmType == "04" { //化验费
  963. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  964. // laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  965. // laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  966. // laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  967. // if item.ChrgitmLv == "1" {
  968. //
  969. // laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  970. //
  971. // }
  972. // if item.ChrgitmLv == "2" {
  973. // laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  974. //
  975. // }
  976. // if item.ChrgitmLv == "3" {
  977. // laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  978. // }
  979. // }
  980. //
  981. // if item.MedChrgitmType == "05" { //治疗费
  982. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  983. // treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  984. // treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  985. // treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  986. // if item.ChrgitmLv == "1" {
  987. //
  988. // treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  989. //
  990. // }
  991. // if item.ChrgitmLv == "2" {
  992. // treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  993. //
  994. // }
  995. // if item.ChrgitmLv == "3" {
  996. // treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  997. // }
  998. // }
  999. //
  1000. // if item.MedChrgitmType == "06" { //手术费
  1001. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1002. // operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1003. // operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1004. // operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1005. //
  1006. // if item.ChrgitmLv == "1" {
  1007. //
  1008. // operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1009. //
  1010. // }
  1011. // if item.ChrgitmLv == "2" {
  1012. // operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1013. //
  1014. // }
  1015. // if item.ChrgitmLv == "3" {
  1016. // operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1017. // }
  1018. // }
  1019. //
  1020. // if item.MedChrgitmType == "07" { //手术费
  1021. // nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1022. // nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1023. // nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1024. // nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1025. //
  1026. // if item.ChrgitmLv == "1" {
  1027. //
  1028. // nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1029. //
  1030. // }
  1031. // if item.ChrgitmLv == "2" {
  1032. // nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1033. //
  1034. // }
  1035. // if item.ChrgitmLv == "3" {
  1036. // nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1037. // }
  1038. // }
  1039. //
  1040. // if item.MedChrgitmType == "08" { //材料费
  1041. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1042. // materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1043. // materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1044. // material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1045. // if item.ChrgitmLv == "1" {
  1046. //
  1047. // material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1048. //
  1049. // }
  1050. // if item.ChrgitmLv == "2" {
  1051. // material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1052. //
  1053. // }
  1054. // if item.ChrgitmLv == "3" {
  1055. // material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1056. // }
  1057. // }
  1058. // if item.MedChrgitmType == "09" { //西药费
  1059. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1060. // westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1061. // westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1062. // westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1063. // if item.ChrgitmLv == "1" {
  1064. // westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1065. // }
  1066. // if item.ChrgitmLv == "2" {
  1067. // westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1068. // }
  1069. // if item.ChrgitmLv == "3" {
  1070. // westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1071. // }
  1072. // }
  1073. // if item.MedChrgitmType == "10" { //中药饮片
  1074. // chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1075. // chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1076. // chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1077. // chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1078. // if item.ChrgitmLv == "1" {
  1079. // chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1080. // }
  1081. // if item.ChrgitmLv == "2" {
  1082. // chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1083. // }
  1084. // if item.ChrgitmLv == "3" {
  1085. // chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1086. // }
  1087. // }
  1088. //
  1089. // if item.MedChrgitmType == "11" { //中成费
  1090. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1091. // chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1092. // chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1093. // chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1094. // if item.ChrgitmLv == "1" {
  1095. //
  1096. // chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1097. //
  1098. // }
  1099. // if item.ChrgitmLv == "2" {
  1100. // chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1101. //
  1102. // }
  1103. // if item.ChrgitmLv == "3" {
  1104. // chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1105. // }
  1106. // }
  1107. //
  1108. // if item.MedChrgitmType == "12" { //中成费
  1109. // commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1110. // commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1111. // commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1112. // commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1113. // if item.ChrgitmLv == "1" {
  1114. //
  1115. // commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1116. //
  1117. // }
  1118. // if item.ChrgitmLv == "2" {
  1119. // commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1120. //
  1121. // }
  1122. // if item.ChrgitmLv == "3" {
  1123. // commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1124. // }
  1125. // }
  1126. //
  1127. // if item.MedChrgitmType == "13" { //中成费
  1128. // registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1129. // registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1130. // registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1131. // register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1132. // if item.ChrgitmLv == "1" {
  1133. //
  1134. // register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1135. //
  1136. // }
  1137. // if item.ChrgitmLv == "2" {
  1138. // register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1139. //
  1140. // }
  1141. // if item.ChrgitmLv == "3" {
  1142. // register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1143. // }
  1144. // }
  1145. //
  1146. // if item.MedChrgitmType == "14" { //其他费
  1147. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1148. // otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1149. // otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1150. // other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1151. // if item.ChrgitmLv == "1" {
  1152. // other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1153. //
  1154. // }
  1155. // if item.ChrgitmLv == "2" {
  1156. // other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1157. //
  1158. // }
  1159. // if item.ChrgitmLv == "3" {
  1160. // other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1161. // }
  1162. // }
  1163. //
  1164. // }
  1165. //
  1166. // //var iteminfoStructs []service.IteminfoStruct
  1167. // //
  1168. // //if bedCostTotal != 0 {
  1169. // // iteminfo.MedChrgitm = "01"
  1170. // // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  1171. // // iteminfo.Amt = bedCostTotal
  1172. // // iteminfo.ClaaSumfee = bed_claa_sunmfee
  1173. // // iteminfo.ClabAmt = bed_clab_amt
  1174. // // iteminfo.OthAmt = bed_other_amt
  1175. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1176. // //}
  1177. // //
  1178. // //if examineCostTotal != 0 {
  1179. // // iteminfo.MedChrgitm = "02"
  1180. // // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  1181. // // iteminfo.Amt = examineCostTotal
  1182. // // iteminfo.ClaaSumfee = examine_claa_sunmfee
  1183. // // iteminfo.ClabAmt = examine_clab_amt
  1184. // // iteminfo.OthAmt = examine_other_amt
  1185. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1186. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1187. // //}
  1188. // //
  1189. // //if checkCostTotal != 0 {
  1190. // // iteminfo.MedChrgitm = "03"
  1191. // // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  1192. // // iteminfo.Amt = checkCostTotal
  1193. // // iteminfo.ClaaSumfee = check_claa_sunmfee
  1194. // // iteminfo.ClabAmt = check_clab_amt
  1195. // // iteminfo.OthAmt = check_other_amt
  1196. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1197. // //
  1198. // //}
  1199. // //
  1200. // //if laboratoryCostTotal != 0 {
  1201. // // iteminfo.MedChrgitm = "04"
  1202. // // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  1203. // // iteminfo.Amt = laboratoryCostTotal
  1204. // // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  1205. // // iteminfo.ClabAmt = laboratory_clab_amt
  1206. // // iteminfo.OthAmt = laboratory_other_amt
  1207. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1208. // //
  1209. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1210. // //
  1211. // //}
  1212. // //
  1213. // //if treatCostTotal != 0 {
  1214. // // iteminfo.MedChrgitm = "05"
  1215. // // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  1216. // // iteminfo.Amt = treatCostTotal
  1217. // // iteminfo.ClaaSumfee = treat_claa_sunmfee
  1218. // // iteminfo.ClabAmt = treat_clab_amt
  1219. // // iteminfo.OthAmt = treat_other_amt
  1220. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1221. // // //(struct4101.IteminfoStruct, iteminfo)
  1222. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1223. // //}
  1224. // //
  1225. // //if operationCostTotal != 0 {
  1226. // // iteminfo.MedChrgitm = "06"
  1227. // // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  1228. // // iteminfo.Amt = operationCostTotal
  1229. // // iteminfo.ClaaSumfee = operation_claa_sunmfee
  1230. // // iteminfo.ClabAmt = operation_clab_amt
  1231. // // iteminfo.OthAmt = operation_other_amt
  1232. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1233. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1234. // //}
  1235. // //
  1236. // //if nursingCostTotal != 0 {
  1237. // // iteminfo.MedChrgitm = "07"
  1238. // // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  1239. // // iteminfo.Amt = nursingCostTotal
  1240. // // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  1241. // // iteminfo.ClabAmt = nursing_clab_amt
  1242. // // iteminfo.OthAmt = nursing_other_amt
  1243. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1244. // //}
  1245. // //
  1246. // //if materialCostTotal != 0 {
  1247. // // iteminfo.MedChrgitm = "08"
  1248. // // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  1249. // // iteminfo.Amt = materialCostTotal
  1250. // // iteminfo.ClaaSumfee = material_claa_sunmfee
  1251. // // iteminfo.ClabAmt = material_clab_amt
  1252. // // iteminfo.OthAmt = material_other_amt
  1253. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1254. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1255. // //}
  1256. // //
  1257. // //if westernMedicineCostTotal != 0 {
  1258. // // iteminfo.MedChrgitm = "09"
  1259. // // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  1260. // // iteminfo.Amt = westernMedicineCostTotal
  1261. // // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  1262. // // iteminfo.ClabAmt = westernMedicine_clab_amt
  1263. // // iteminfo.OthAmt = westernMedicine_other_amt
  1264. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1265. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1266. // //
  1267. // //}
  1268. // //
  1269. // //if chineseMedicineCostTotal != 0 {
  1270. // // iteminfo.MedChrgitm = "10"
  1271. // // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  1272. // // iteminfo.Amt = chineseMedicineCostTotal
  1273. // // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  1274. // // iteminfo.ClabAmt = chinese_medicine_clab_amt
  1275. // // iteminfo.OthAmt = chinese_medicine_other_amt
  1276. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1277. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1278. // //
  1279. // //}
  1280. // //
  1281. // //if chineseTraditionalMedicineCostTotal != 0 {
  1282. // // iteminfo.MedChrgitm = "11"
  1283. // // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  1284. // // iteminfo.Amt = westernMedicineCostTotal
  1285. // // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  1286. // // iteminfo.ClabAmt = westernMedicine_clab_amt
  1287. // // iteminfo.OthAmt = westernMedicine_other_amt
  1288. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1289. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1290. // //
  1291. // //}
  1292. // //
  1293. // //if commonlyTreatmentCostTotal != 0 {
  1294. // // iteminfo.MedChrgitm = "12"
  1295. // // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  1296. // // iteminfo.Amt = commonlyTreatmentCostTotal
  1297. // // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  1298. // // iteminfo.ClabAmt = commonly_treatment_clab_amt
  1299. // // iteminfo.OthAmt = commonly_treatment_other_amt
  1300. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1301. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1302. // //
  1303. // //}
  1304. // //
  1305. // //if registerCostTotal != 0 {
  1306. // // iteminfo.MedChrgitm = "13"
  1307. // // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  1308. // // iteminfo.Amt = registerCostTotal
  1309. // // iteminfo.ClaaSumfee = register_claa_sunmfee
  1310. // // iteminfo.ClabAmt = register_clab_amt
  1311. // // iteminfo.OthAmt = register_other_amt
  1312. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1313. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1314. // //
  1315. // //}
  1316. // //
  1317. // //if otherCostTotal != 0 {
  1318. // // iteminfo.MedChrgitm = "14"
  1319. // // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  1320. // // iteminfo.Amt = otherCostTotal
  1321. // // iteminfo.ClaaSumfee = other_claa_sunmfee
  1322. // // iteminfo.ClabAmt = other_clab_amt
  1323. // // iteminfo.OthAmt = other_other_amt
  1324. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1325. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1326. // //
  1327. // //}
  1328. // //
  1329. // //struct4101.IteminfoStruct = iteminfoStructs
  1330. // time_arr := strings.Split(order.SetlTime, " ")
  1331. // struct4101.AdmTime = time_arr[0]
  1332. // struct4101.AdmEndTime = time_arr[0]
  1333. // struct4101.DoctorName = doctor.UserName
  1334. // struct4101.DoctorCode = doctor.DoctorNumber
  1335. //
  1336. // struct4101.Ntly = "中国"
  1337. // struct4101.AdmCaty = "A03.06"
  1338. // var res ResultSeventeen
  1339. // {
  1340. // result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  1341. // fmt.Println(result)
  1342. // saveLog(result, request, "4101A", "清单上传")
  1343. // var dat map[string]interface{}
  1344. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1345. // fmt.Println(dat)
  1346. // } else {
  1347. // fmt.Println(err)
  1348. // }
  1349. // userJSONBytes, _ := json.Marshal(dat)
  1350. // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  1351. // //utils.ErrorLog("解析失败:%v", err)
  1352. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  1353. // //adminUser := c.GetAdminUserInfo()
  1354. // errlog := &models.HisOrderError{
  1355. // UserOrgId: org_id,
  1356. // Ctime: time.Now().Unix(),
  1357. // Mtime: time.Now().Unix(),
  1358. // ErrMsg: res.ErrMsg + "解析失败",
  1359. // Status: 1,
  1360. // PatientId: order_id,
  1361. // Stage: 10136000,
  1362. // }
  1363. // service.CreateErrMsgLog(errlog)
  1364. // continue
  1365. // }
  1366. // }
  1367. //
  1368. // if res.Infcode != 0 {
  1369. // //adminUser := c.GetAdminUserInfo()
  1370. // errlog := &models.HisOrderError{
  1371. // UserOrgId: org_id,
  1372. // Ctime: time.Now().Unix(),
  1373. // Mtime: time.Now().Unix(),
  1374. // ErrMsg: res.ErrMsg,
  1375. // Status: 1,
  1376. // PatientId: order_id,
  1377. // Stage: 10136000,
  1378. // }
  1379. // service.CreateErrMsgLog(errlog)
  1380. // continue
  1381. // } else {
  1382. // hisFundSettleListResult := &models.HisFundSettleListResult{
  1383. // Number: res.Output.SetlListId,
  1384. // Status: 1,
  1385. // Ctime: time.Now().Unix(),
  1386. // Mtime: time.Now().Unix(),
  1387. // UserOrgId: org_id,
  1388. // IsUpload: 1,
  1389. // OrderId: order_id,
  1390. // }
  1391. // service.CreateUploadRecord(hisFundSettleListResult)
  1392. // continue
  1393. // }
  1394. // }
  1395. //}
  1396. //
  1397. ////func GetbrBatchSettleList() {
  1398. //// org_id, _ := beego.AppConfig.Int64("org_id")
  1399. //// var orders []*models.HisOrder
  1400. //// orders, _ = service.GetAllHisOrder10278()
  1401. //// for _, item := range orders {
  1402. //// order_id := item.ID
  1403. //// order, _ := service.GetHisOrderByIDTwo(order_id)
  1404. //// //roles, _ := service.GetDoctorListTwo(org_id)
  1405. //// his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  1406. //// var patientPrescription models.HisPrescriptionInfo
  1407. //// patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
  1408. //// doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
  1409. //// department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
  1410. //// miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
  1411. //// var configTwo []*models.HisXtDiagnoseConfig
  1412. //// diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
  1413. //// curRoles, _ := service.GetAdminUserInfoByID(org_id, 2185)
  1414. //// for _, item := range diagnosis_idstwo {
  1415. //// id, _ := strconv.ParseInt(item, 10, 64)
  1416. //// diagnosisConfig, _ := service.FindDiagnoseById(id)
  1417. //// configTwo = append(configTwo, &diagnosisConfig)
  1418. //// }
  1419. ////
  1420. //// sickConfig, _ := service.FindSickById(his.SickType)
  1421. //// service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
  1422. ////
  1423. //// depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  1424. //// pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
  1425. //// doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
  1426. //// if order.ID == 0 {
  1427. //// return
  1428. //// }
  1429. //// if his.BalanceAccountsType == 2 {
  1430. //// continue
  1431. //// }
  1432. //// struct4101 := service.Struct4101{
  1433. //// PsnNo: order.PsnNo,
  1434. //// MdtrtId: order.MdtrtId,
  1435. //// SetlId: order.SetlId,
  1436. //// PsnName: order.PsnName,
  1437. //// Gend: order.Gend,
  1438. //// Brdy: his.Brdy,
  1439. //// Age: his.Age,
  1440. //// Naty: order.Naty,
  1441. //// PatnCertType: order.PsnCertType,
  1442. //// Certno: order.Certno,
  1443. //// Prfs: "90",
  1444. //// ConerName: "",
  1445. //// PatnRlts: "",
  1446. //// ConerAddr: "",
  1447. //// ConerTel: "",
  1448. //// HiType: order.Insutype,
  1449. //// Insuplc: his.InsuplcAdmdvs,
  1450. //// MaindiagFlag: "1",
  1451. //// BillCode: order.SetlId,
  1452. //// BillNo: order.SetlId,
  1453. //// BizSn: order.Number,
  1454. //// PsnSelfPay: order.PsnPartAmt,
  1455. //// PsnOwnPay: order.PsnPartAmt,
  1456. //// AcctPay: order.AcctPay,
  1457. //// PsnCashpay: order.PsnCashPay,
  1458. //// HiPaymtd: "1",
  1459. //// Hsorg: his.InsuplcAdmdvs,
  1460. //// HsorgOpter: his.InsuplcAdmdvs,
  1461. //// MedinsFillPsn: curRoles.UserName,
  1462. //// MedinsFillDept: depart.Name,
  1463. //// IptMedType: "2",
  1464. //// }
  1465. ////
  1466. //// struct4101.SetlBegnDate = order.SetlTime
  1467. //// struct4101.SetlEndDate = order.SetlTime
  1468. ////
  1469. ////
  1470. //// var rf []CustomFundPay
  1471. //// json.Unmarshal([]byte(order.SetlDetail), &rf)
  1472. ////
  1473. //// //var tempFunPays []service.CustomStruct
  1474. //// //var tempFunPay610100 service.CustomStruct
  1475. ////
  1476. //// //for _, item := range rf {
  1477. //// // if item.FundPayType == "610100" {
  1478. //// // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  1479. //// // tempFunPay610100.FundPayType = item.FundPayType
  1480. //// // } else {
  1481. //// // var tempFunPay service.CustomStruct
  1482. //// // tempFunPay.FundPayamt = item.FundPayamt
  1483. //// // tempFunPay.FundPayType = item.FundPayType
  1484. //// // tempFunPays = append(tempFunPays, tempFunPay)
  1485. //// // }
  1486. //// //}
  1487. //// //tempFunPays = append(tempFunPays, tempFunPay610100)
  1488. //// //struct4101.CustomStruct = tempFunPays
  1489. ////
  1490. //// var tempDiaginfos []service.DiaginfoStructTwo
  1491. //// var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  1492. //// var tempOpspdiseinfos []service.OpspdiseinfoStruct
  1493. ////
  1494. //// diagnosis_ids := strings.Split(his.Diagnosis, ",")
  1495. //// var config []*models.HisXtDiagnoseConfig
  1496. //// for _, item := range diagnosis_ids {
  1497. //// id, _ := strconv.ParseInt(item, 10, 64)
  1498. //// diagnosisConfig, _ := service.FindDiagnoseById(id)
  1499. //// config = append(config, &diagnosisConfig)
  1500. //// }
  1501. ////
  1502. //// for index, item := range config {
  1503. //// if index == 0 {
  1504. //// var tempDiaginfo service.DiaginfoStructTwo
  1505. //// tempDiaginfo.DiagCode = item.CountryCode
  1506. //// tempDiaginfo.DiagName = item.CountryContentName
  1507. //// tempDiaginfo.DiagType = "1"
  1508. //// tempDiaginfo.MaindiagFlag = "1"
  1509. //// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  1510. //// } else {
  1511. ////
  1512. //// var tempDiaginfo service.DiaginfoStructTwo
  1513. //// tempDiaginfo.DiagCode = item.CountryCode
  1514. //// tempDiaginfo.DiagName = item.CountryContentName
  1515. //// tempDiaginfo.DiagType = "2"
  1516. //// tempDiaginfo.MaindiagFlag = "0"
  1517. //// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  1518. //// }
  1519. //// }
  1520. //// struct4101.Diseinfo = tempDiaginfos
  1521. ////
  1522. //// sickConfigTwo, _ := service.FindSickById(his.SickType)
  1523. //// tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  1524. //// tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  1525. //// tempOpspdiseinfo2.OprnOprtCode = ""
  1526. //// tempOpspdiseinfo2.OprnOprtName = ""
  1527. //// tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  1528. //// struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  1529. ////
  1530. //// //var iteminfo service.IteminfoStruct
  1531. ////
  1532. //// var bedCostTotal float64 = 0 //床位总费
  1533. //// var bedCostSelfTotal float64 = 0 //床位自费
  1534. //// var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  1535. ////
  1536. //// var examineCostTotal float64 = 0 //诊查总费
  1537. //// var examineCostSelfTotal float64 = 0 //诊查自费
  1538. //// var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  1539. ////
  1540. //// var nursingCostTotal float64 = 0 //护理总费
  1541. //// var nursingCostSelfTotal float64 = 0 //护理自费
  1542. //// var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  1543. ////
  1544. //// var chineseMedicineCostTotal float64 = 0 //中成药
  1545. //// var chineseMedicineCostSelfTotal float64 = 0 //中成药
  1546. //// var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  1547. ////
  1548. //// var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  1549. //// var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  1550. //// var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  1551. ////
  1552. //// var registerCostTotal float64 = 0 //一般诊疗费
  1553. //// var registerCostSelfTotal float64 = 0 //一般诊疗费
  1554. //// var registerPartSelfTotal float64 = 0 //一般诊疗费
  1555. ////
  1556. //// var operationCostTotal float64 = 0 //手术费
  1557. //// var operationCostSelfTotal float64 = 0 //手术费
  1558. //// var operationCostPartSelfTotal float64 = 0 //手术费
  1559. ////
  1560. //// var otherCostTotal float64 = 0 //其他费用
  1561. //// var otherCostSelfTotal float64 = 0 //其他费用
  1562. //// var otherCostPartSelfTotal float64 = 0 //其他费用
  1563. ////
  1564. //// var materialCostTotal float64 = 0 //材料费
  1565. //// var materialCostSelfTotal float64 = 0 //材料费
  1566. //// var materialCostPartSelfTotal float64 = 0 //材料费
  1567. ////
  1568. //// var westernMedicineCostTotal float64 = 0 //西药费
  1569. //// var westernMedicineCostSelfTotal float64 = 0 //西药费
  1570. //// var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  1571. ////
  1572. //// var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  1573. //// var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  1574. //// var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  1575. ////
  1576. //// var checkCostTotal float64 = 0 //检查费
  1577. //// var checkCostSelfTotal float64 = 0 //检查费
  1578. //// var checkCostPartSelfTotal float64 = 0 //检查费
  1579. ////
  1580. //// var laboratoryCostTotal float64 = 0 //化验费
  1581. //// var laboratoryCostSelfTotal float64 = 0 //化验费
  1582. //// var laboratoryCostPartSelfTotal float64 = 0 //化验费
  1583. ////
  1584. //// var treatCostTotal float64 = 0 //治疗费用
  1585. //// var treatCostSelfTotal float64 = 0 //治疗费用
  1586. //// var treatCostPartSelfTotal float64 = 0 //治疗费用
  1587. ////
  1588. //// decimal.DivisionPrecision = 2
  1589. ////
  1590. //// var bed_fulamt_ownpay_amt float64 = 0
  1591. ////
  1592. //// var examine_fulamt_ownpay_amt float64 = 0
  1593. ////
  1594. //// var nursing_fulamt_ownpay_amt float64 = 0
  1595. ////
  1596. //// var chinese_medicine_fulamt_ownpay_amt float64 = 0
  1597. ////
  1598. //// var commonly_treatment_fulamt_ownpay_amt float64 = 0
  1599. ////
  1600. //// var register_fulamt_ownpay_amt float64 = 0
  1601. ////
  1602. //// var operation_fulamt_ownpay_amt float64 = 0
  1603. //// var other_fulamt_ownpay_amt float64 = 0
  1604. //// var westernMedicine_fulamt_ownpay_amt float64 = 0
  1605. //// var chineseTraditional_fulamt_ownpay_amt float64 = 0
  1606. //// var check_fulamt_ownpay_amt float64 = 0
  1607. //// var material_fulamt_ownpay_amt float64 = 0
  1608. //// var laboratory_fulamt_ownpay_amt float64 = 0
  1609. //// var treat_fulamt_ownpay_amt float64 = 0
  1610. ////
  1611. //// var bed_claa_sunmfee float64 = 0
  1612. //// var bed_clab_amt float64 = 0
  1613. //// var bed_other_amt float64 = 0
  1614. ////
  1615. //// var examine_claa_sunmfee float64 = 0
  1616. //// var examine_clab_amt float64 = 0
  1617. //// var examine_other_amt float64 = 0
  1618. ////
  1619. //// var nursing_claa_sunmfee float64 = 0
  1620. //// var nursing_clab_amt float64 = 0
  1621. //// var nursing_other_amt float64 = 0
  1622. ////
  1623. //// var chinese_medicine_claa_sunmfee float64 = 0
  1624. //// var chinese_medicine_clab_amt float64 = 0
  1625. //// var chinese_medicine_other_amt float64 = 0
  1626. ////
  1627. //// var commonly_treatment_claa_sunmfee float64 = 0
  1628. //// var commonly_treatment_clab_amt float64 = 0
  1629. //// var commonly_treatment_other_amt float64 = 0
  1630. ////
  1631. //// var operation_claa_sunmfee float64 = 0
  1632. //// var operation_clab_amt float64 = 0
  1633. //// var operation_other_amt float64 = 0
  1634. ////
  1635. //// var other_claa_sunmfee float64 = 0
  1636. //// var other_clab_amt float64 = 0
  1637. //// var other_other_amt float64 = 0
  1638. ////
  1639. //// var westernMedicine_claa_sunmfee float64 = 0
  1640. //// var westernMedicine_clab_amt float64 = 0
  1641. //// var westernMedicine_other_amt float64 = 0
  1642. ////
  1643. //// var chineseTraditional_claa_sunmfee float64 = 0
  1644. //// var chineseTraditional_clab_amt float64 = 0
  1645. //// var chineseTraditional_other_amt float64 = 0
  1646. ////
  1647. //// var check_claa_sunmfee float64 = 0
  1648. //// var check_clab_amt float64 = 0
  1649. //// var check_other_amt float64 = 0
  1650. ////
  1651. //// var material_claa_sunmfee float64 = 0
  1652. //// var material_clab_amt float64 = 0
  1653. //// var material_other_amt float64 = 0
  1654. ////
  1655. //// var laboratory_claa_sunmfee float64 = 0
  1656. //// var laboratory_clab_amt float64 = 0
  1657. //// var laboratory_other_amt float64 = 0
  1658. ////
  1659. //// var treat_claa_sunmfee float64 = 0
  1660. //// var treat_clab_amt float64 = 0
  1661. //// var treat_other_amt float64 = 0
  1662. ////
  1663. //// var register_claa_sunmfee float64 = 0
  1664. //// var register_clab_amt float64 = 0
  1665. //// var register_other_amt float64 = 0
  1666. ////
  1667. //// for _, item := range order.HisOrderInfo {
  1668. //// if item.MedChrgitmType == "01" { //床位费
  1669. //// bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1670. //// bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1671. //// bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1672. //// bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1673. //// if item.ChrgitmLv == "1" {
  1674. //// bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1675. //// }
  1676. //// if item.ChrgitmLv == "2" {
  1677. //// bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1678. ////
  1679. //// }
  1680. //// if item.ChrgitmLv == "3" {
  1681. //// bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1682. //// }
  1683. ////
  1684. //// }
  1685. ////
  1686. //// if item.MedChrgitmType == "02" { //诊查
  1687. //// examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1688. //// examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1689. //// examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1690. //// examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1691. //// if item.ChrgitmLv == "1" {
  1692. //// examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1693. //// }
  1694. //// if item.ChrgitmLv == "2" {
  1695. //// examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1696. ////
  1697. //// }
  1698. //// if item.ChrgitmLv == "3" {
  1699. //// examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1700. //// }
  1701. ////
  1702. //// }
  1703. ////
  1704. //// if item.MedChrgitmType == "03" { //检查费
  1705. //// checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1706. //// checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1707. //// checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1708. //// check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1709. //// if item.ChrgitmLv == "1" {
  1710. ////
  1711. //// check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1712. ////
  1713. //// }
  1714. //// if item.ChrgitmLv == "2" {
  1715. //// check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1716. ////
  1717. //// }
  1718. //// if item.ChrgitmLv == "3" {
  1719. //// check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1720. //// }
  1721. //// }
  1722. ////
  1723. //// if item.MedChrgitmType == "04" { //化验费
  1724. //// laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1725. //// laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1726. //// laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1727. //// laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1728. //// if item.ChrgitmLv == "1" {
  1729. ////
  1730. //// laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1731. ////
  1732. //// }
  1733. //// if item.ChrgitmLv == "2" {
  1734. //// laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1735. ////
  1736. //// }
  1737. //// if item.ChrgitmLv == "3" {
  1738. //// laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1739. //// }
  1740. //// }
  1741. ////
  1742. //// if item.MedChrgitmType == "05" { //治疗费
  1743. //// treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1744. //// treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1745. //// treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1746. //// treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1747. //// if item.ChrgitmLv == "1" {
  1748. ////
  1749. //// treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1750. ////
  1751. //// }
  1752. //// if item.ChrgitmLv == "2" {
  1753. //// treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1754. ////
  1755. //// }
  1756. //// if item.ChrgitmLv == "3" {
  1757. //// treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1758. //// }
  1759. //// }
  1760. ////
  1761. //// if item.MedChrgitmType == "06" { //手术费
  1762. //// operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1763. //// operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1764. //// operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1765. //// operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1766. ////
  1767. //// if item.ChrgitmLv == "1" {
  1768. ////
  1769. //// operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1770. ////
  1771. //// }
  1772. //// if item.ChrgitmLv == "2" {
  1773. //// operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1774. ////
  1775. //// }
  1776. //// if item.ChrgitmLv == "3" {
  1777. //// operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1778. //// }
  1779. //// }
  1780. ////
  1781. //// if item.MedChrgitmType == "07" { //手术费
  1782. //// nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1783. //// nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1784. //// nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1785. //// nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1786. ////
  1787. //// if item.ChrgitmLv == "1" {
  1788. ////
  1789. //// nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1790. ////
  1791. //// }
  1792. //// if item.ChrgitmLv == "2" {
  1793. //// nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1794. ////
  1795. //// }
  1796. //// if item.ChrgitmLv == "3" {
  1797. //// nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1798. //// }
  1799. //// }
  1800. ////
  1801. //// if item.MedChrgitmType == "08" { //材料费
  1802. //// materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1803. //// materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1804. //// materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1805. //// material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1806. //// if item.ChrgitmLv == "1" {
  1807. ////
  1808. //// material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1809. ////
  1810. //// }
  1811. //// if item.ChrgitmLv == "2" {
  1812. //// material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1813. ////
  1814. //// }
  1815. //// if item.ChrgitmLv == "3" {
  1816. //// material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1817. //// }
  1818. //// }
  1819. //// if item.MedChrgitmType == "09" { //西药费
  1820. //// westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1821. //// westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1822. //// westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1823. //// westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1824. //// if item.ChrgitmLv == "1" {
  1825. //// westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1826. //// }
  1827. //// if item.ChrgitmLv == "2" {
  1828. //// westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1829. //// }
  1830. //// if item.ChrgitmLv == "3" {
  1831. //// westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1832. //// }
  1833. //// }
  1834. //// if item.MedChrgitmType == "10" { //中药饮片
  1835. //// chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1836. //// chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1837. //// chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1838. //// chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1839. //// if item.ChrgitmLv == "1" {
  1840. //// chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1841. //// }
  1842. //// if item.ChrgitmLv == "2" {
  1843. //// chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1844. //// }
  1845. //// if item.ChrgitmLv == "3" {
  1846. //// chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1847. //// }
  1848. //// }
  1849. ////
  1850. //// if item.MedChrgitmType == "11" { //中成费
  1851. //// chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1852. //// chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1853. //// chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1854. //// chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1855. //// if item.ChrgitmLv == "1" {
  1856. ////
  1857. //// chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1858. ////
  1859. //// }
  1860. //// if item.ChrgitmLv == "2" {
  1861. //// chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1862. ////
  1863. //// }
  1864. //// if item.ChrgitmLv == "3" {
  1865. //// chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1866. //// }
  1867. //// }
  1868. ////
  1869. //// if item.MedChrgitmType == "12" { //中成费
  1870. //// commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1871. //// commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1872. //// commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1873. //// commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1874. //// if item.ChrgitmLv == "1" {
  1875. ////
  1876. //// commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1877. ////
  1878. //// }
  1879. //// if item.ChrgitmLv == "2" {
  1880. //// commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1881. ////
  1882. //// }
  1883. //// if item.ChrgitmLv == "3" {
  1884. //// commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1885. //// }
  1886. //// }
  1887. ////
  1888. //// if item.MedChrgitmType == "13" { //中成费
  1889. //// registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1890. //// registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1891. //// registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1892. //// register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1893. //// if item.ChrgitmLv == "1" {
  1894. ////
  1895. //// register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1896. ////
  1897. //// }
  1898. //// if item.ChrgitmLv == "2" {
  1899. //// register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1900. ////
  1901. //// }
  1902. //// if item.ChrgitmLv == "3" {
  1903. //// register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1904. //// }
  1905. //// }
  1906. ////
  1907. //// if item.MedChrgitmType == "14" { //其他费
  1908. //// otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1909. //// otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1910. //// otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1911. //// other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  1912. //// if item.ChrgitmLv == "1" {
  1913. //// other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  1914. ////
  1915. //// }
  1916. //// if item.ChrgitmLv == "2" {
  1917. //// other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  1918. ////
  1919. //// }
  1920. //// if item.ChrgitmLv == "3" {
  1921. //// other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  1922. //// }
  1923. //// }
  1924. ////
  1925. //// }
  1926. ////
  1927. //// //var iteminfoStructs []service.IteminfoStruct
  1928. //// //
  1929. //// //if bedCostTotal != 0 {
  1930. //// // iteminfo.MedChrgitm = "01"
  1931. //// // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  1932. //// // iteminfo.Amt = bedCostTotal
  1933. //// // iteminfo.ClaaSumfee = bed_claa_sunmfee
  1934. //// // iteminfo.ClabAmt = bed_clab_amt
  1935. //// // iteminfo.OthAmt = bed_other_amt
  1936. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1937. //// //}
  1938. //// //
  1939. //// //if examineCostTotal != 0 {
  1940. //// // iteminfo.MedChrgitm = "02"
  1941. //// // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  1942. //// // iteminfo.Amt = examineCostTotal
  1943. //// // iteminfo.ClaaSumfee = examine_claa_sunmfee
  1944. //// // iteminfo.ClabAmt = examine_clab_amt
  1945. //// // iteminfo.OthAmt = examine_other_amt
  1946. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1947. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1948. //// //}
  1949. //// //
  1950. //// //if checkCostTotal != 0 {
  1951. //// // iteminfo.MedChrgitm = "03"
  1952. //// // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  1953. //// // iteminfo.Amt = checkCostTotal
  1954. //// // iteminfo.ClaaSumfee = check_claa_sunmfee
  1955. //// // iteminfo.ClabAmt = check_clab_amt
  1956. //// // iteminfo.OthAmt = check_other_amt
  1957. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1958. //// //
  1959. //// //}
  1960. //// //
  1961. //// //if laboratoryCostTotal != 0 {
  1962. //// // iteminfo.MedChrgitm = "04"
  1963. //// // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  1964. //// // iteminfo.Amt = laboratoryCostTotal
  1965. //// // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  1966. //// // iteminfo.ClabAmt = laboratory_clab_amt
  1967. //// // iteminfo.OthAmt = laboratory_other_amt
  1968. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1969. //// //
  1970. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1971. //// //
  1972. //// //}
  1973. //// //
  1974. //// //if treatCostTotal != 0 {
  1975. //// // iteminfo.MedChrgitm = "05"
  1976. //// // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  1977. //// // iteminfo.Amt = treatCostTotal
  1978. //// // iteminfo.ClaaSumfee = treat_claa_sunmfee
  1979. //// // iteminfo.ClabAmt = treat_clab_amt
  1980. //// // iteminfo.OthAmt = treat_other_amt
  1981. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1982. //// // //(struct4101.IteminfoStruct, iteminfo)
  1983. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1984. //// //}
  1985. //// //
  1986. //// //if operationCostTotal != 0 {
  1987. //// // iteminfo.MedChrgitm = "06"
  1988. //// // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  1989. //// // iteminfo.Amt = operationCostTotal
  1990. //// // iteminfo.ClaaSumfee = operation_claa_sunmfee
  1991. //// // iteminfo.ClabAmt = operation_clab_amt
  1992. //// // iteminfo.OthAmt = operation_other_amt
  1993. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  1994. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  1995. //// //}
  1996. //// //
  1997. //// //if nursingCostTotal != 0 {
  1998. //// // iteminfo.MedChrgitm = "07"
  1999. //// // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  2000. //// // iteminfo.Amt = nursingCostTotal
  2001. //// // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  2002. //// // iteminfo.ClabAmt = nursing_clab_amt
  2003. //// // iteminfo.OthAmt = nursing_other_amt
  2004. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2005. //// //}
  2006. //// //
  2007. //// //if materialCostTotal != 0 {
  2008. //// // iteminfo.MedChrgitm = "08"
  2009. //// // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  2010. //// // iteminfo.Amt = materialCostTotal
  2011. //// // iteminfo.ClaaSumfee = material_claa_sunmfee
  2012. //// // iteminfo.ClabAmt = material_clab_amt
  2013. //// // iteminfo.OthAmt = material_other_amt
  2014. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2015. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2016. //// //}
  2017. //// //
  2018. //// //if westernMedicineCostTotal != 0 {
  2019. //// // iteminfo.MedChrgitm = "09"
  2020. //// // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  2021. //// // iteminfo.Amt = westernMedicineCostTotal
  2022. //// // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  2023. //// // iteminfo.ClabAmt = westernMedicine_clab_amt
  2024. //// // iteminfo.OthAmt = westernMedicine_other_amt
  2025. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2026. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2027. //// //
  2028. //// //}
  2029. //// //
  2030. //// //if chineseMedicineCostTotal != 0 {
  2031. //// // iteminfo.MedChrgitm = "10"
  2032. //// // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  2033. //// // iteminfo.Amt = chineseMedicineCostTotal
  2034. //// // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  2035. //// // iteminfo.ClabAmt = chinese_medicine_clab_amt
  2036. //// // iteminfo.OthAmt = chinese_medicine_other_amt
  2037. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2038. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2039. //// //
  2040. //// //}
  2041. //// //
  2042. //// //if chineseTraditionalMedicineCostTotal != 0 {
  2043. //// // iteminfo.MedChrgitm = "11"
  2044. //// // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  2045. //// // iteminfo.Amt = westernMedicineCostTotal
  2046. //// // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  2047. //// // iteminfo.ClabAmt = westernMedicine_clab_amt
  2048. //// // iteminfo.OthAmt = westernMedicine_other_amt
  2049. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2050. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2051. //// //
  2052. //// //}
  2053. //// //
  2054. //// //if commonlyTreatmentCostTotal != 0 {
  2055. //// // iteminfo.MedChrgitm = "12"
  2056. //// // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  2057. //// // iteminfo.Amt = commonlyTreatmentCostTotal
  2058. //// // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  2059. //// // iteminfo.ClabAmt = commonly_treatment_clab_amt
  2060. //// // iteminfo.OthAmt = commonly_treatment_other_amt
  2061. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2062. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2063. //// //
  2064. //// //}
  2065. //// //
  2066. //// //if registerCostTotal != 0 {
  2067. //// // iteminfo.MedChrgitm = "13"
  2068. //// // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  2069. //// // iteminfo.Amt = registerCostTotal
  2070. //// // iteminfo.ClaaSumfee = register_claa_sunmfee
  2071. //// // iteminfo.ClabAmt = register_clab_amt
  2072. //// // iteminfo.OthAmt = register_other_amt
  2073. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2074. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2075. //// //
  2076. //// //}
  2077. //// //
  2078. //// //if otherCostTotal != 0 {
  2079. //// // iteminfo.MedChrgitm = "14"
  2080. //// // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  2081. //// // iteminfo.Amt = otherCostTotal
  2082. //// // iteminfo.ClaaSumfee = other_claa_sunmfee
  2083. //// // iteminfo.ClabAmt = other_clab_amt
  2084. //// // iteminfo.OthAmt = other_other_amt
  2085. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2086. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2087. //// //
  2088. //// //}
  2089. //// //
  2090. //// //struct4101.IteminfoStruct = iteminfoStructs
  2091. //// time_arr := strings.Split(order.SetlTime, " ")
  2092. //// struct4101.AdmTime = time_arr[0]
  2093. //// struct4101.AdmEndTime = time_arr[0]
  2094. //// struct4101.DoctorName = doctor.UserName
  2095. //// struct4101.DoctorCode = doctor.DoctorNumber
  2096. ////
  2097. //// struct4101.Ntly = "中国"
  2098. //// struct4101.AdmCaty = "A03.06"
  2099. //// var res ResultSeventeen
  2100. //// {
  2101. //// result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  2102. //// fmt.Println(result)
  2103. //// saveLog(result, request, "4101A", "清单上传")
  2104. //// var dat map[string]interface{}
  2105. //// if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2106. //// fmt.Println(dat)
  2107. //// } else {
  2108. //// fmt.Println(err)
  2109. //// }
  2110. //// userJSONBytes, _ := json.Marshal(dat)
  2111. //// if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  2112. //// //utils.ErrorLog("解析失败:%v", err)
  2113. //// //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  2114. //// //adminUser := c.GetAdminUserInfo()
  2115. //// errlog := &models.HisOrderError{
  2116. //// UserOrgId: org_id,
  2117. //// Ctime: time.Now().Unix(),
  2118. //// Mtime: time.Now().Unix(),
  2119. //// ErrMsg: res.ErrMsg + "解析失败",
  2120. //// Status: 1,
  2121. //// PatientId: order_id,
  2122. //// Stage: 10138,
  2123. //// }
  2124. //// service.CreateErrMsgLog(errlog)
  2125. //// continue
  2126. //// }
  2127. //// }
  2128. ////
  2129. //// if res.Infcode != 0 {
  2130. //// //adminUser := c.GetAdminUserInfo()
  2131. //// errlog := &models.HisOrderError{
  2132. //// UserOrgId: org_id,
  2133. //// Ctime: time.Now().Unix(),
  2134. //// Mtime: time.Now().Unix(),
  2135. //// ErrMsg: res.ErrMsg,
  2136. //// Status: 1,
  2137. //// PatientId: order_id,
  2138. //// Stage: 10138,
  2139. //// }
  2140. //// service.CreateErrMsgLog(errlog)
  2141. //// continue
  2142. //// } else {
  2143. //// hisFundSettleListResult := &models.HisFundSettleListResult{
  2144. //// Number: res.Output.SetlListId,
  2145. //// Status: 1,
  2146. //// Ctime: time.Now().Unix(),
  2147. //// Mtime: time.Now().Unix(),
  2148. //// UserOrgId: org_id,
  2149. //// IsUpload: 1,
  2150. //// OrderId: order_id,
  2151. //// }
  2152. //// service.CreateUploadRecord(hisFundSettleListResult)
  2153. //// continue
  2154. //// }
  2155. //// }
  2156. ////}
  2157. //
  2158. //func GetbrBatchSettleList() {
  2159. // org_id, _ := beego.AppConfig.Int64("org_id")
  2160. // var orders []*models.HisOrder
  2161. // //var orders []*models.HisOrderError
  2162. //
  2163. // orders, _ = service.GetAllHisOrder10278()
  2164. // for _, item := range orders {
  2165. // order_id := item.ID
  2166. // order, _ := service.GetHisOrderByIDTwo(order_id)
  2167. // //roles, _ := service.GetDoctorListTwo(org_id)
  2168. // his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  2169. // var patientPrescription models.HisPrescriptionInfo
  2170. // patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
  2171. // doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
  2172. // department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
  2173. // miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
  2174. // var configTwo []*models.HisXtDiagnoseConfig
  2175. // diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
  2176. // curRoles, _ := service.GetAdminUserInfoByID(org_id, 2185)
  2177. // for _, item := range diagnosis_idstwo {
  2178. // id, _ := strconv.ParseInt(item, 10, 64)
  2179. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  2180. // configTwo = append(configTwo, &diagnosisConfig)
  2181. // }
  2182. //
  2183. // sickConfig, _ := service.FindSickById(his.SickType)
  2184. // if order.MedType == "1111" || order.MedType == "1112" {
  2185. // order.MedType = "11"
  2186. // }
  2187. // service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, order.MedType, doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, strings.Split(time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"), " ")[0]+" 22:00:00")
  2188. //
  2189. // depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  2190. // pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
  2191. // doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
  2192. // if order.ID == 0 {
  2193. // return
  2194. // }
  2195. // if his.BalanceAccountsType == 2 {
  2196. // continue
  2197. // }
  2198. // struct4101 := service.Struct4101{
  2199. // PsnNo: order.PsnNo,
  2200. // MdtrtId: order.MdtrtId,
  2201. // SetlId: order.SetlId,
  2202. // PsnName: order.PsnName,
  2203. // Gend: order.Gend,
  2204. // Brdy: his.Brdy,
  2205. // Age: his.Age,
  2206. // Naty: order.Naty,
  2207. // PatnCertType: order.PsnCertType,
  2208. // Certno: order.Certno,
  2209. // Prfs: "90",
  2210. // ConerName: "",
  2211. // PatnRlts: "",
  2212. // ConerAddr: "",
  2213. // ConerTel: "",
  2214. // HiType: order.Insutype,
  2215. // Insuplc: his.InsuplcAdmdvs,
  2216. // MaindiagFlag: "1",
  2217. // BillCode: order.SetlId,
  2218. // BillNo: order.SetlId,
  2219. // BizSn: order.Number,
  2220. // PsnSelfPay: order.PsnPartAmt,
  2221. // PsnOwnPay: order.PsnPartAmt,
  2222. // AcctPay: order.AcctPay,
  2223. // PsnCashpay: order.PsnCashPay,
  2224. // HiPaymtd: "1",
  2225. // Hsorg: his.InsuplcAdmdvs,
  2226. // HsorgOpter: his.InsuplcAdmdvs,
  2227. // MedinsFillPsn: curRoles.UserName,
  2228. // MedinsFillDept: depart.Name,
  2229. // IptMedType: "2",
  2230. // }
  2231. //
  2232. // struct4101.SetlBegnDate = order.SetlTime
  2233. // struct4101.SetlEndDate = order.SetlTime
  2234. //
  2235. // var rf []CustomFundPay
  2236. // json.Unmarshal([]byte(order.SetlDetail), &rf)
  2237. //
  2238. // //var tempFunPays []service.CustomStruct
  2239. // //var tempFunPay610100 service.CustomStruct
  2240. //
  2241. // //for _, item := range rf {
  2242. // // if item.FundPayType == "610100" {
  2243. // // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  2244. // // tempFunPay610100.FundPayType = item.FundPayType
  2245. // // } else {
  2246. // // var tempFunPay service.CustomStruct
  2247. // // tempFunPay.FundPayamt = item.FundPayamt
  2248. // // tempFunPay.FundPayType = item.FundPayType
  2249. // // tempFunPays = append(tempFunPays, tempFunPay)
  2250. // // }
  2251. // //}
  2252. // //tempFunPays = append(tempFunPays, tempFunPay610100)
  2253. // //struct4101.CustomStruct = tempFunPays
  2254. //
  2255. // var tempDiaginfos []service.DiaginfoStructTwo
  2256. // var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  2257. // var tempOpspdiseinfos []service.OpspdiseinfoStruct
  2258. //
  2259. // diagnosis_ids := strings.Split(his.Diagnosis, ",")
  2260. // var config []*models.HisXtDiagnoseConfig
  2261. // for _, item := range diagnosis_ids {
  2262. // id, _ := strconv.ParseInt(item, 10, 64)
  2263. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  2264. // config = append(config, &diagnosisConfig)
  2265. // }
  2266. //
  2267. // for index, item := range config {
  2268. // if index == 0 {
  2269. // var tempDiaginfo service.DiaginfoStructTwo
  2270. // tempDiaginfo.DiagCode = item.CountryCode
  2271. // tempDiaginfo.DiagName = item.CountryContentName
  2272. // tempDiaginfo.DiagType = "1"
  2273. // tempDiaginfo.MaindiagFlag = "1"
  2274. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  2275. // } else {
  2276. //
  2277. // var tempDiaginfo service.DiaginfoStructTwo
  2278. // tempDiaginfo.DiagCode = item.CountryCode
  2279. // tempDiaginfo.DiagName = item.CountryContentName
  2280. // tempDiaginfo.DiagType = "2"
  2281. // tempDiaginfo.MaindiagFlag = "0"
  2282. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  2283. // }
  2284. // }
  2285. // struct4101.Diseinfo = tempDiaginfos
  2286. //
  2287. // sickConfigTwo, _ := service.FindSickById(his.SickType)
  2288. // tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  2289. // tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  2290. // tempOpspdiseinfo2.OprnOprtCode = ""
  2291. // tempOpspdiseinfo2.OprnOprtName = ""
  2292. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  2293. // struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  2294. //
  2295. // //var iteminfo service.IteminfoStruct
  2296. //
  2297. // var bedCostTotal float64 = 0 //床位总费
  2298. // var bedCostSelfTotal float64 = 0 //床位自费
  2299. // var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  2300. //
  2301. // var examineCostTotal float64 = 0 //诊查总费
  2302. // var examineCostSelfTotal float64 = 0 //诊查自费
  2303. // var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  2304. //
  2305. // var nursingCostTotal float64 = 0 //护理总费
  2306. // var nursingCostSelfTotal float64 = 0 //护理自费
  2307. // var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  2308. //
  2309. // var chineseMedicineCostTotal float64 = 0 //中成药
  2310. // var chineseMedicineCostSelfTotal float64 = 0 //中成药
  2311. // var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  2312. //
  2313. // var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  2314. // var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  2315. // var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  2316. //
  2317. // var registerCostTotal float64 = 0 //一般诊疗费
  2318. // var registerCostSelfTotal float64 = 0 //一般诊疗费
  2319. // var registerPartSelfTotal float64 = 0 //一般诊疗费
  2320. //
  2321. // var operationCostTotal float64 = 0 //手术费
  2322. // var operationCostSelfTotal float64 = 0 //手术费
  2323. // var operationCostPartSelfTotal float64 = 0 //手术费
  2324. //
  2325. // var otherCostTotal float64 = 0 //其他费用
  2326. // var otherCostSelfTotal float64 = 0 //其他费用
  2327. // var otherCostPartSelfTotal float64 = 0 //其他费用
  2328. //
  2329. // var materialCostTotal float64 = 0 //材料费
  2330. // var materialCostSelfTotal float64 = 0 //材料费
  2331. // var materialCostPartSelfTotal float64 = 0 //材料费
  2332. //
  2333. // var westernMedicineCostTotal float64 = 0 //西药费
  2334. // var westernMedicineCostSelfTotal float64 = 0 //西药费
  2335. // var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  2336. //
  2337. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  2338. // var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  2339. // var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  2340. //
  2341. // var checkCostTotal float64 = 0 //检查费
  2342. // var checkCostSelfTotal float64 = 0 //检查费
  2343. // var checkCostPartSelfTotal float64 = 0 //检查费
  2344. //
  2345. // var laboratoryCostTotal float64 = 0 //化验费
  2346. // var laboratoryCostSelfTotal float64 = 0 //化验费
  2347. // var laboratoryCostPartSelfTotal float64 = 0 //化验费
  2348. //
  2349. // var treatCostTotal float64 = 0 //治疗费用
  2350. // var treatCostSelfTotal float64 = 0 //治疗费用
  2351. // var treatCostPartSelfTotal float64 = 0 //治疗费用
  2352. //
  2353. // decimal.DivisionPrecision = 2
  2354. //
  2355. // var bed_fulamt_ownpay_amt float64 = 0
  2356. //
  2357. // var examine_fulamt_ownpay_amt float64 = 0
  2358. //
  2359. // var nursing_fulamt_ownpay_amt float64 = 0
  2360. //
  2361. // var chinese_medicine_fulamt_ownpay_amt float64 = 0
  2362. //
  2363. // var commonly_treatment_fulamt_ownpay_amt float64 = 0
  2364. //
  2365. // var register_fulamt_ownpay_amt float64 = 0
  2366. //
  2367. // var operation_fulamt_ownpay_amt float64 = 0
  2368. // var other_fulamt_ownpay_amt float64 = 0
  2369. // var westernMedicine_fulamt_ownpay_amt float64 = 0
  2370. // var chineseTraditional_fulamt_ownpay_amt float64 = 0
  2371. // var check_fulamt_ownpay_amt float64 = 0
  2372. // var material_fulamt_ownpay_amt float64 = 0
  2373. // var laboratory_fulamt_ownpay_amt float64 = 0
  2374. // var treat_fulamt_ownpay_amt float64 = 0
  2375. //
  2376. // var bed_claa_sunmfee float64 = 0
  2377. // var bed_clab_amt float64 = 0
  2378. // var bed_other_amt float64 = 0
  2379. //
  2380. // var examine_claa_sunmfee float64 = 0
  2381. // var examine_clab_amt float64 = 0
  2382. // var examine_other_amt float64 = 0
  2383. //
  2384. // var nursing_claa_sunmfee float64 = 0
  2385. // var nursing_clab_amt float64 = 0
  2386. // var nursing_other_amt float64 = 0
  2387. //
  2388. // var chinese_medicine_claa_sunmfee float64 = 0
  2389. // var chinese_medicine_clab_amt float64 = 0
  2390. // var chinese_medicine_other_amt float64 = 0
  2391. //
  2392. // var commonly_treatment_claa_sunmfee float64 = 0
  2393. // var commonly_treatment_clab_amt float64 = 0
  2394. // var commonly_treatment_other_amt float64 = 0
  2395. //
  2396. // var operation_claa_sunmfee float64 = 0
  2397. // var operation_clab_amt float64 = 0
  2398. // var operation_other_amt float64 = 0
  2399. //
  2400. // var other_claa_sunmfee float64 = 0
  2401. // var other_clab_amt float64 = 0
  2402. // var other_other_amt float64 = 0
  2403. //
  2404. // var westernMedicine_claa_sunmfee float64 = 0
  2405. // var westernMedicine_clab_amt float64 = 0
  2406. // var westernMedicine_other_amt float64 = 0
  2407. //
  2408. // var chineseTraditional_claa_sunmfee float64 = 0
  2409. // var chineseTraditional_clab_amt float64 = 0
  2410. // var chineseTraditional_other_amt float64 = 0
  2411. //
  2412. // var check_claa_sunmfee float64 = 0
  2413. // var check_clab_amt float64 = 0
  2414. // var check_other_amt float64 = 0
  2415. //
  2416. // var material_claa_sunmfee float64 = 0
  2417. // var material_clab_amt float64 = 0
  2418. // var material_other_amt float64 = 0
  2419. //
  2420. // var laboratory_claa_sunmfee float64 = 0
  2421. // var laboratory_clab_amt float64 = 0
  2422. // var laboratory_other_amt float64 = 0
  2423. //
  2424. // var treat_claa_sunmfee float64 = 0
  2425. // var treat_clab_amt float64 = 0
  2426. // var treat_other_amt float64 = 0
  2427. //
  2428. // var register_claa_sunmfee float64 = 0
  2429. // var register_clab_amt float64 = 0
  2430. // var register_other_amt float64 = 0
  2431. //
  2432. // for _, item := range order.HisOrderInfo {
  2433. // if item.MedChrgitmType == "01" { //床位费
  2434. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2435. // bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2436. // bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2437. // bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2438. // if item.ChrgitmLv == "1" {
  2439. // bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2440. // }
  2441. // if item.ChrgitmLv == "2" {
  2442. // bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2443. //
  2444. // }
  2445. // if item.ChrgitmLv == "3" {
  2446. // bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2447. // }
  2448. //
  2449. // }
  2450. //
  2451. // if item.MedChrgitmType == "02" { //诊查
  2452. // examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2453. // examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2454. // examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2455. // examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2456. // if item.ChrgitmLv == "1" {
  2457. // examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2458. // }
  2459. // if item.ChrgitmLv == "2" {
  2460. // examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2461. //
  2462. // }
  2463. // if item.ChrgitmLv == "3" {
  2464. // examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2465. // }
  2466. //
  2467. // }
  2468. //
  2469. // if item.MedChrgitmType == "03" { //检查费
  2470. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2471. // checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2472. // checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2473. // check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2474. // if item.ChrgitmLv == "1" {
  2475. //
  2476. // check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2477. //
  2478. // }
  2479. // if item.ChrgitmLv == "2" {
  2480. // check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2481. //
  2482. // }
  2483. // if item.ChrgitmLv == "3" {
  2484. // check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2485. // }
  2486. // }
  2487. //
  2488. // if item.MedChrgitmType == "04" { //化验费
  2489. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2490. // laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2491. // laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2492. // laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2493. // if item.ChrgitmLv == "1" {
  2494. //
  2495. // laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2496. //
  2497. // }
  2498. // if item.ChrgitmLv == "2" {
  2499. // laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2500. //
  2501. // }
  2502. // if item.ChrgitmLv == "3" {
  2503. // laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2504. // }
  2505. // }
  2506. //
  2507. // if item.MedChrgitmType == "05" { //治疗费
  2508. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2509. // treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2510. // treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2511. // treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2512. // if item.ChrgitmLv == "1" {
  2513. //
  2514. // treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2515. //
  2516. // }
  2517. // if item.ChrgitmLv == "2" {
  2518. // treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2519. //
  2520. // }
  2521. // if item.ChrgitmLv == "3" {
  2522. // treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2523. // }
  2524. // }
  2525. //
  2526. // if item.MedChrgitmType == "06" { //手术费
  2527. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2528. // operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2529. // operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2530. // operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2531. //
  2532. // if item.ChrgitmLv == "1" {
  2533. //
  2534. // operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2535. //
  2536. // }
  2537. // if item.ChrgitmLv == "2" {
  2538. // operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2539. //
  2540. // }
  2541. // if item.ChrgitmLv == "3" {
  2542. // operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2543. // }
  2544. // }
  2545. //
  2546. // if item.MedChrgitmType == "07" { //手术费
  2547. // nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2548. // nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2549. // nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2550. // nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2551. //
  2552. // if item.ChrgitmLv == "1" {
  2553. //
  2554. // nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2555. //
  2556. // }
  2557. // if item.ChrgitmLv == "2" {
  2558. // nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2559. //
  2560. // }
  2561. // if item.ChrgitmLv == "3" {
  2562. // nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2563. // }
  2564. // }
  2565. //
  2566. // if item.MedChrgitmType == "08" { //材料费
  2567. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2568. // materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2569. // materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2570. // material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2571. // if item.ChrgitmLv == "1" {
  2572. //
  2573. // material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2574. //
  2575. // }
  2576. // if item.ChrgitmLv == "2" {
  2577. // material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2578. //
  2579. // }
  2580. // if item.ChrgitmLv == "3" {
  2581. // material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2582. // }
  2583. // }
  2584. // if item.MedChrgitmType == "09" { //西药费
  2585. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2586. // westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2587. // westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2588. // westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2589. // if item.ChrgitmLv == "1" {
  2590. // westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2591. // }
  2592. // if item.ChrgitmLv == "2" {
  2593. // westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2594. // }
  2595. // if item.ChrgitmLv == "3" {
  2596. // westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2597. // }
  2598. // }
  2599. // if item.MedChrgitmType == "10" { //中药饮片
  2600. // chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2601. // chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2602. // chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2603. // chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2604. // if item.ChrgitmLv == "1" {
  2605. // chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2606. // }
  2607. // if item.ChrgitmLv == "2" {
  2608. // chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2609. // }
  2610. // if item.ChrgitmLv == "3" {
  2611. // chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2612. // }
  2613. // }
  2614. //
  2615. // if item.MedChrgitmType == "11" { //中成费
  2616. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2617. // chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2618. // chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2619. // chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2620. // if item.ChrgitmLv == "1" {
  2621. //
  2622. // chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2623. //
  2624. // }
  2625. // if item.ChrgitmLv == "2" {
  2626. // chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2627. //
  2628. // }
  2629. // if item.ChrgitmLv == "3" {
  2630. // chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2631. // }
  2632. // }
  2633. //
  2634. // if item.MedChrgitmType == "12" { //中成费
  2635. // commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2636. // commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2637. // commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2638. // commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2639. // if item.ChrgitmLv == "1" {
  2640. //
  2641. // commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2642. //
  2643. // }
  2644. // if item.ChrgitmLv == "2" {
  2645. // commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2646. //
  2647. // }
  2648. // if item.ChrgitmLv == "3" {
  2649. // commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2650. // }
  2651. // }
  2652. //
  2653. // if item.MedChrgitmType == "13" { //中成费
  2654. // registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2655. // registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2656. // registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2657. // register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2658. // if item.ChrgitmLv == "1" {
  2659. //
  2660. // register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2661. //
  2662. // }
  2663. // if item.ChrgitmLv == "2" {
  2664. // register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2665. //
  2666. // }
  2667. // if item.ChrgitmLv == "3" {
  2668. // register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2669. // }
  2670. // }
  2671. //
  2672. // if item.MedChrgitmType == "14" { //其他费
  2673. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2674. // otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2675. // otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2676. // other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  2677. // if item.ChrgitmLv == "1" {
  2678. // other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  2679. //
  2680. // }
  2681. // if item.ChrgitmLv == "2" {
  2682. // other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  2683. //
  2684. // }
  2685. // if item.ChrgitmLv == "3" {
  2686. // other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  2687. // }
  2688. // }
  2689. //
  2690. // }
  2691. //
  2692. // //var iteminfoStructs []service.IteminfoStruct
  2693. // //
  2694. // //if bedCostTotal != 0 {
  2695. // // iteminfo.MedChrgitm = "01"
  2696. // // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  2697. // // iteminfo.Amt = bedCostTotal
  2698. // // iteminfo.ClaaSumfee = bed_claa_sunmfee
  2699. // // iteminfo.ClabAmt = bed_clab_amt
  2700. // // iteminfo.OthAmt = bed_other_amt
  2701. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2702. // //}
  2703. // //
  2704. // //if examineCostTotal != 0 {
  2705. // // iteminfo.MedChrgitm = "02"
  2706. // // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  2707. // // iteminfo.Amt = examineCostTotal
  2708. // // iteminfo.ClaaSumfee = examine_claa_sunmfee
  2709. // // iteminfo.ClabAmt = examine_clab_amt
  2710. // // iteminfo.OthAmt = examine_other_amt
  2711. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2712. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2713. // //}
  2714. // //
  2715. // //if checkCostTotal != 0 {
  2716. // // iteminfo.MedChrgitm = "03"
  2717. // // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  2718. // // iteminfo.Amt = checkCostTotal
  2719. // // iteminfo.ClaaSumfee = check_claa_sunmfee
  2720. // // iteminfo.ClabAmt = check_clab_amt
  2721. // // iteminfo.OthAmt = check_other_amt
  2722. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2723. // //
  2724. // //}
  2725. // //
  2726. // //if laboratoryCostTotal != 0 {
  2727. // // iteminfo.MedChrgitm = "04"
  2728. // // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  2729. // // iteminfo.Amt = laboratoryCostTotal
  2730. // // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  2731. // // iteminfo.ClabAmt = laboratory_clab_amt
  2732. // // iteminfo.OthAmt = laboratory_other_amt
  2733. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2734. // //
  2735. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2736. // //
  2737. // //}
  2738. // //
  2739. // //if treatCostTotal != 0 {
  2740. // // iteminfo.MedChrgitm = "05"
  2741. // // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  2742. // // iteminfo.Amt = treatCostTotal
  2743. // // iteminfo.ClaaSumfee = treat_claa_sunmfee
  2744. // // iteminfo.ClabAmt = treat_clab_amt
  2745. // // iteminfo.OthAmt = treat_other_amt
  2746. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2747. // // //(struct4101.IteminfoStruct, iteminfo)
  2748. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2749. // //}
  2750. // //
  2751. // //if operationCostTotal != 0 {
  2752. // // iteminfo.MedChrgitm = "06"
  2753. // // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  2754. // // iteminfo.Amt = operationCostTotal
  2755. // // iteminfo.ClaaSumfee = operation_claa_sunmfee
  2756. // // iteminfo.ClabAmt = operation_clab_amt
  2757. // // iteminfo.OthAmt = operation_other_amt
  2758. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2759. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2760. // //}
  2761. // //
  2762. // //if nursingCostTotal != 0 {
  2763. // // iteminfo.MedChrgitm = "07"
  2764. // // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  2765. // // iteminfo.Amt = nursingCostTotal
  2766. // // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  2767. // // iteminfo.ClabAmt = nursing_clab_amt
  2768. // // iteminfo.OthAmt = nursing_other_amt
  2769. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2770. // //}
  2771. // //
  2772. // //if materialCostTotal != 0 {
  2773. // // iteminfo.MedChrgitm = "08"
  2774. // // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  2775. // // iteminfo.Amt = materialCostTotal
  2776. // // iteminfo.ClaaSumfee = material_claa_sunmfee
  2777. // // iteminfo.ClabAmt = material_clab_amt
  2778. // // iteminfo.OthAmt = material_other_amt
  2779. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2780. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2781. // //}
  2782. // //
  2783. // //if westernMedicineCostTotal != 0 {
  2784. // // iteminfo.MedChrgitm = "09"
  2785. // // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  2786. // // iteminfo.Amt = westernMedicineCostTotal
  2787. // // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  2788. // // iteminfo.ClabAmt = westernMedicine_clab_amt
  2789. // // iteminfo.OthAmt = westernMedicine_other_amt
  2790. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2791. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2792. // //
  2793. // //}
  2794. // //
  2795. // //if chineseMedicineCostTotal != 0 {
  2796. // // iteminfo.MedChrgitm = "10"
  2797. // // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  2798. // // iteminfo.Amt = chineseMedicineCostTotal
  2799. // // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  2800. // // iteminfo.ClabAmt = chinese_medicine_clab_amt
  2801. // // iteminfo.OthAmt = chinese_medicine_other_amt
  2802. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2803. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2804. // //
  2805. // //}
  2806. // //
  2807. // //if chineseTraditionalMedicineCostTotal != 0 {
  2808. // // iteminfo.MedChrgitm = "11"
  2809. // // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  2810. // // iteminfo.Amt = westernMedicineCostTotal
  2811. // // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  2812. // // iteminfo.ClabAmt = westernMedicine_clab_amt
  2813. // // iteminfo.OthAmt = westernMedicine_other_amt
  2814. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2815. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2816. // //
  2817. // //}
  2818. // //
  2819. // //if commonlyTreatmentCostTotal != 0 {
  2820. // // iteminfo.MedChrgitm = "12"
  2821. // // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  2822. // // iteminfo.Amt = commonlyTreatmentCostTotal
  2823. // // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  2824. // // iteminfo.ClabAmt = commonly_treatment_clab_amt
  2825. // // iteminfo.OthAmt = commonly_treatment_other_amt
  2826. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2827. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2828. // //
  2829. // //}
  2830. // //
  2831. // //if registerCostTotal != 0 {
  2832. // // iteminfo.MedChrgitm = "13"
  2833. // // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  2834. // // iteminfo.Amt = registerCostTotal
  2835. // // iteminfo.ClaaSumfee = register_claa_sunmfee
  2836. // // iteminfo.ClabAmt = register_clab_amt
  2837. // // iteminfo.OthAmt = register_other_amt
  2838. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2839. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2840. // //
  2841. // //}
  2842. // //
  2843. // //if otherCostTotal != 0 {
  2844. // // iteminfo.MedChrgitm = "14"
  2845. // // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  2846. // // iteminfo.Amt = otherCostTotal
  2847. // // iteminfo.ClaaSumfee = other_claa_sunmfee
  2848. // // iteminfo.ClabAmt = other_clab_amt
  2849. // // iteminfo.OthAmt = other_other_amt
  2850. // // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  2851. // // iteminfoStructs = append(iteminfoStructs, iteminfo)
  2852. // //
  2853. // //}
  2854. // //
  2855. // //struct4101.IteminfoStruct = iteminfoStructs
  2856. // time_arr := strings.Split(order.SetlTime, " ")
  2857. // struct4101.AdmTime = time_arr[0]
  2858. // struct4101.AdmEndTime = time_arr[0]
  2859. // struct4101.DoctorName = doctor.UserName
  2860. // struct4101.DoctorCode = doctor.DoctorNumber
  2861. //
  2862. // struct4101.Ntly = "中国"
  2863. // struct4101.AdmCaty = "A03.06"
  2864. // var res ResultSeventeen
  2865. // {
  2866. // result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  2867. // fmt.Println(result)
  2868. // saveLog(result, request, "4101A", "清单上传")
  2869. // var dat map[string]interface{}
  2870. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2871. // fmt.Println(dat)
  2872. // } else {
  2873. // fmt.Println(err)
  2874. // }
  2875. // userJSONBytes, _ := json.Marshal(dat)
  2876. // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  2877. // //utils.ErrorLog("解析失败:%v", err)
  2878. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  2879. // //adminUser := c.GetAdminUserInfo()
  2880. // errlog := &models.HisOrderError{
  2881. // UserOrgId: org_id,
  2882. // Ctime: time.Now().Unix(),
  2883. // Mtime: time.Now().Unix(),
  2884. // ErrMsg: res.ErrMsg + "解析失败",
  2885. // Status: 1,
  2886. // PatientId: order_id,
  2887. // Stage: 10278000,
  2888. // }
  2889. // service.CreateErrMsgLog(errlog)
  2890. // continue
  2891. // }
  2892. // }
  2893. //
  2894. // if res.Infcode != 0 {
  2895. // //adminUser := c.GetAdminUserInfo()
  2896. // errlog := &models.HisOrderError{
  2897. // UserOrgId: org_id,
  2898. // Ctime: time.Now().Unix(),
  2899. // Mtime: time.Now().Unix(),
  2900. // ErrMsg: res.ErrMsg,
  2901. // Status: 1,
  2902. // PatientId: order_id,
  2903. // Stage: 10278000,
  2904. // }
  2905. // service.CreateErrMsgLog(errlog)
  2906. // continue
  2907. // } else {
  2908. // hisFundSettleListResult := &models.HisFundSettleListResult{
  2909. // Number: res.Output.SetlListId,
  2910. // Status: 1,
  2911. // Ctime: time.Now().Unix(),
  2912. // Mtime: time.Now().Unix(),
  2913. // UserOrgId: org_id,
  2914. // IsUpload: 1,
  2915. // OrderId: order_id,
  2916. // }
  2917. // service.CreateUploadRecord(hisFundSettleListResult)
  2918. // continue
  2919. // }
  2920. // }
  2921. //}
  2922. //
  2923. ////func GetbrBatchSettleList() {
  2924. //// org_id, _ := beego.AppConfig.Int64("org_id")
  2925. //// var orders []*models.HisOrder
  2926. //// orders, _ = service.GetAllHisOrder10278()
  2927. //// for _, item := range orders {
  2928. //// order_id := item.ID
  2929. //// order, _ := service.GetHisOrderByIDTwo(order_id)
  2930. //// roles, _ := service.GetDoctorListTwo(org_id)
  2931. //// his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  2932. //// admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
  2933. //// curRoles, _ := service.GetAdminUserInfoByID(org_id, 2185)
  2934. //// depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  2935. //// miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  2936. //// pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
  2937. //// doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
  2938. //// if order.ID == 0 {
  2939. //// return
  2940. //// }
  2941. //// if his.BalanceAccountsType == 2 {
  2942. //// continue
  2943. //// }
  2944. //// struct4101 := service.Struct4101{
  2945. //// PsnNo: order.PsnNo,
  2946. //// MdtrtId: order.MdtrtId,
  2947. //// SetlId: order.SetlId,
  2948. //// PsnName: order.PsnName,
  2949. //// Gend: order.Gend,
  2950. //// Brdy: his.Brdy,
  2951. //// Age: his.Age,
  2952. //// Naty: order.Naty,
  2953. //// PatnCertType: order.PsnCertType,
  2954. //// Certno: order.Certno,
  2955. //// Prfs: "90",
  2956. //// ConerName: roles[0].UserName,
  2957. //// PatnRlts: "99",
  2958. //// ConerAddr: miConfig.OrgName,
  2959. //// ConerTel: admin.Mobile,
  2960. //// HiType: order.Insutype,
  2961. //// Insuplc: his.InsuplcAdmdvs,
  2962. //// MaindiagFlag: "1",
  2963. //// BillCode: order.SetlId,
  2964. //// BillNo: order.SetlId,
  2965. //// BizSn: order.Number,
  2966. //// PsnSelfPay: order.PsnPartAmt,
  2967. //// PsnOwnPay: order.PsnPartAmt,
  2968. //// AcctPay: order.AcctPay,
  2969. //// PsnCashpay: order.PsnCashPay,
  2970. //// HiPaymtd: "1",
  2971. //// Hsorg: his.InsuplcAdmdvs,
  2972. //// HsorgOpter: his.InsuplcAdmdvs,
  2973. //// MedinsFillPsn: curRoles.UserName,
  2974. //// MedinsFillDept: depart.Name,
  2975. //// IptMedType: "2",
  2976. //// }
  2977. ////
  2978. //// struct4101.SetlBegnDate = order.SetlTime
  2979. //// struct4101.SetlEndDate = order.SetlTime
  2980. ////
  2981. ////
  2982. //// var rf []CustomFundPay
  2983. //// json.Unmarshal([]byte(order.SetlDetail), &rf)
  2984. ////
  2985. //// //var tempFunPays []service.CustomStruct
  2986. //// //var tempFunPay610100 service.CustomStruct
  2987. ////
  2988. //// //for _, item := range rf {
  2989. //// // if item.FundPayType == "610100" {
  2990. //// // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  2991. //// // tempFunPay610100.FundPayType = item.FundPayType
  2992. //// // } else {
  2993. //// // var tempFunPay service.CustomStruct
  2994. //// // tempFunPay.FundPayamt = item.FundPayamt
  2995. //// // tempFunPay.FundPayType = item.FundPayType
  2996. //// // tempFunPays = append(tempFunPays, tempFunPay)
  2997. //// // }
  2998. //// //}
  2999. //// //tempFunPays = append(tempFunPays, tempFunPay610100)
  3000. //// //struct4101.CustomStruct = tempFunPays
  3001. ////
  3002. //// var tempDiaginfos []service.DiaginfoStructTwo
  3003. //// var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  3004. //// var tempOpspdiseinfos []service.OpspdiseinfoStruct
  3005. ////
  3006. //// diagnosis_ids := strings.Split(his.Diagnosis, ",")
  3007. //// var config []*models.HisXtDiagnoseConfig
  3008. //// for _, item := range diagnosis_ids {
  3009. //// id, _ := strconv.ParseInt(item, 10, 64)
  3010. //// diagnosisConfig, _ := service.FindDiagnoseById(id)
  3011. //// config = append(config, &diagnosisConfig)
  3012. //// }
  3013. ////
  3014. //// for index, item := range config {
  3015. //// if index == 0 {
  3016. //// var tempDiaginfo service.DiaginfoStructTwo
  3017. //// tempDiaginfo.DiagCode = item.CountryCode
  3018. //// tempDiaginfo.DiagName = item.CountryContentName
  3019. //// tempDiaginfo.DiagType = "1"
  3020. //// tempDiaginfo.MaindiagFlag = "1"
  3021. //// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  3022. //// } else {
  3023. ////
  3024. //// var tempDiaginfo service.DiaginfoStructTwo
  3025. //// tempDiaginfo.DiagCode = item.CountryCode
  3026. //// tempDiaginfo.DiagName = item.CountryContentName
  3027. //// tempDiaginfo.DiagType = "2"
  3028. //// tempDiaginfo.MaindiagFlag = "0"
  3029. //// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  3030. //// }
  3031. //// }
  3032. //// struct4101.Diseinfo = tempDiaginfos
  3033. ////
  3034. //// sickConfigTwo, _ := service.FindSickById(his.SickType)
  3035. //// tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  3036. //// tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  3037. //// tempOpspdiseinfo2.OprnOprtCode = ""
  3038. //// tempOpspdiseinfo2.OprnOprtName = ""
  3039. //// tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  3040. //// struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  3041. ////
  3042. //// //var iteminfo service.IteminfoStruct
  3043. ////
  3044. //// var bedCostTotal float64 = 0 //床位总费
  3045. //// var bedCostSelfTotal float64 = 0 //床位自费
  3046. //// var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  3047. ////
  3048. //// var examineCostTotal float64 = 0 //诊查总费
  3049. //// var examineCostSelfTotal float64 = 0 //诊查自费
  3050. //// var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  3051. ////
  3052. //// var nursingCostTotal float64 = 0 //护理总费
  3053. //// var nursingCostSelfTotal float64 = 0 //护理自费
  3054. //// var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  3055. ////
  3056. //// var chineseMedicineCostTotal float64 = 0 //中成药
  3057. //// var chineseMedicineCostSelfTotal float64 = 0 //中成药
  3058. //// var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  3059. ////
  3060. //// var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  3061. //// var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  3062. //// var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  3063. ////
  3064. //// var registerCostTotal float64 = 0 //一般诊疗费
  3065. //// var registerCostSelfTotal float64 = 0 //一般诊疗费
  3066. //// var registerPartSelfTotal float64 = 0 //一般诊疗费
  3067. ////
  3068. //// var operationCostTotal float64 = 0 //手术费
  3069. //// var operationCostSelfTotal float64 = 0 //手术费
  3070. //// var operationCostPartSelfTotal float64 = 0 //手术费
  3071. ////
  3072. //// var otherCostTotal float64 = 0 //其他费用
  3073. //// var otherCostSelfTotal float64 = 0 //其他费用
  3074. //// var otherCostPartSelfTotal float64 = 0 //其他费用
  3075. ////
  3076. //// var materialCostTotal float64 = 0 //材料费
  3077. //// var materialCostSelfTotal float64 = 0 //材料费
  3078. //// var materialCostPartSelfTotal float64 = 0 //材料费
  3079. ////
  3080. //// var westernMedicineCostTotal float64 = 0 //西药费
  3081. //// var westernMedicineCostSelfTotal float64 = 0 //西药费
  3082. //// var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  3083. ////
  3084. //// var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  3085. //// var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  3086. //// var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  3087. ////
  3088. //// var checkCostTotal float64 = 0 //检查费
  3089. //// var checkCostSelfTotal float64 = 0 //检查费
  3090. //// var checkCostPartSelfTotal float64 = 0 //检查费
  3091. ////
  3092. //// var laboratoryCostTotal float64 = 0 //化验费
  3093. //// var laboratoryCostSelfTotal float64 = 0 //化验费
  3094. //// var laboratoryCostPartSelfTotal float64 = 0 //化验费
  3095. ////
  3096. //// var treatCostTotal float64 = 0 //治疗费用
  3097. //// var treatCostSelfTotal float64 = 0 //治疗费用
  3098. //// var treatCostPartSelfTotal float64 = 0 //治疗费用
  3099. ////
  3100. //// decimal.DivisionPrecision = 2
  3101. ////
  3102. //// var bed_fulamt_ownpay_amt float64 = 0
  3103. ////
  3104. //// var examine_fulamt_ownpay_amt float64 = 0
  3105. ////
  3106. //// var nursing_fulamt_ownpay_amt float64 = 0
  3107. ////
  3108. //// var chinese_medicine_fulamt_ownpay_amt float64 = 0
  3109. ////
  3110. //// var commonly_treatment_fulamt_ownpay_amt float64 = 0
  3111. ////
  3112. //// var register_fulamt_ownpay_amt float64 = 0
  3113. ////
  3114. //// var operation_fulamt_ownpay_amt float64 = 0
  3115. //// var other_fulamt_ownpay_amt float64 = 0
  3116. //// var westernMedicine_fulamt_ownpay_amt float64 = 0
  3117. //// var chineseTraditional_fulamt_ownpay_amt float64 = 0
  3118. //// var check_fulamt_ownpay_amt float64 = 0
  3119. //// var material_fulamt_ownpay_amt float64 = 0
  3120. //// var laboratory_fulamt_ownpay_amt float64 = 0
  3121. //// var treat_fulamt_ownpay_amt float64 = 0
  3122. ////
  3123. //// var bed_claa_sunmfee float64 = 0
  3124. //// var bed_clab_amt float64 = 0
  3125. //// var bed_other_amt float64 = 0
  3126. ////
  3127. //// var examine_claa_sunmfee float64 = 0
  3128. //// var examine_clab_amt float64 = 0
  3129. //// var examine_other_amt float64 = 0
  3130. ////
  3131. //// var nursing_claa_sunmfee float64 = 0
  3132. //// var nursing_clab_amt float64 = 0
  3133. //// var nursing_other_amt float64 = 0
  3134. ////
  3135. //// var chinese_medicine_claa_sunmfee float64 = 0
  3136. //// var chinese_medicine_clab_amt float64 = 0
  3137. //// var chinese_medicine_other_amt float64 = 0
  3138. ////
  3139. //// var commonly_treatment_claa_sunmfee float64 = 0
  3140. //// var commonly_treatment_clab_amt float64 = 0
  3141. //// var commonly_treatment_other_amt float64 = 0
  3142. ////
  3143. //// var operation_claa_sunmfee float64 = 0
  3144. //// var operation_clab_amt float64 = 0
  3145. //// var operation_other_amt float64 = 0
  3146. ////
  3147. //// var other_claa_sunmfee float64 = 0
  3148. //// var other_clab_amt float64 = 0
  3149. //// var other_other_amt float64 = 0
  3150. ////
  3151. //// var westernMedicine_claa_sunmfee float64 = 0
  3152. //// var westernMedicine_clab_amt float64 = 0
  3153. //// var westernMedicine_other_amt float64 = 0
  3154. ////
  3155. //// var chineseTraditional_claa_sunmfee float64 = 0
  3156. //// var chineseTraditional_clab_amt float64 = 0
  3157. //// var chineseTraditional_other_amt float64 = 0
  3158. ////
  3159. //// var check_claa_sunmfee float64 = 0
  3160. //// var check_clab_amt float64 = 0
  3161. //// var check_other_amt float64 = 0
  3162. ////
  3163. //// var material_claa_sunmfee float64 = 0
  3164. //// var material_clab_amt float64 = 0
  3165. //// var material_other_amt float64 = 0
  3166. ////
  3167. //// var laboratory_claa_sunmfee float64 = 0
  3168. //// var laboratory_clab_amt float64 = 0
  3169. //// var laboratory_other_amt float64 = 0
  3170. ////
  3171. //// var treat_claa_sunmfee float64 = 0
  3172. //// var treat_clab_amt float64 = 0
  3173. //// var treat_other_amt float64 = 0
  3174. ////
  3175. //// var register_claa_sunmfee float64 = 0
  3176. //// var register_clab_amt float64 = 0
  3177. //// var register_other_amt float64 = 0
  3178. ////
  3179. //// for _, item := range order.HisOrderInfo {
  3180. //// if item.MedChrgitmType == "01" { //床位费
  3181. //// bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3182. //// bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3183. //// bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3184. //// bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3185. //// if item.ChrgitmLv == "1" {
  3186. //// bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3187. //// }
  3188. //// if item.ChrgitmLv == "2" {
  3189. //// bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3190. ////
  3191. //// }
  3192. //// if item.ChrgitmLv == "3" {
  3193. //// bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3194. //// }
  3195. ////
  3196. //// }
  3197. ////
  3198. //// if item.MedChrgitmType == "02" { //诊查
  3199. //// examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3200. //// examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3201. //// examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3202. //// examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3203. //// if item.ChrgitmLv == "1" {
  3204. //// examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3205. //// }
  3206. //// if item.ChrgitmLv == "2" {
  3207. //// examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3208. ////
  3209. //// }
  3210. //// if item.ChrgitmLv == "3" {
  3211. //// examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3212. //// }
  3213. ////
  3214. //// }
  3215. ////
  3216. //// if item.MedChrgitmType == "03" { //检查费
  3217. //// checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3218. //// checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3219. //// checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3220. //// check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3221. //// if item.ChrgitmLv == "1" {
  3222. ////
  3223. //// check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3224. ////
  3225. //// }
  3226. //// if item.ChrgitmLv == "2" {
  3227. //// check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3228. ////
  3229. //// }
  3230. //// if item.ChrgitmLv == "3" {
  3231. //// check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3232. //// }
  3233. //// }
  3234. ////
  3235. //// if item.MedChrgitmType == "04" { //化验费
  3236. //// laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3237. //// laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3238. //// laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3239. //// laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3240. //// if item.ChrgitmLv == "1" {
  3241. ////
  3242. //// laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3243. ////
  3244. //// }
  3245. //// if item.ChrgitmLv == "2" {
  3246. //// laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3247. ////
  3248. //// }
  3249. //// if item.ChrgitmLv == "3" {
  3250. //// laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3251. //// }
  3252. //// }
  3253. ////
  3254. //// if item.MedChrgitmType == "05" { //治疗费
  3255. //// treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3256. //// treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3257. //// treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3258. //// treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3259. //// if item.ChrgitmLv == "1" {
  3260. ////
  3261. //// treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3262. ////
  3263. //// }
  3264. //// if item.ChrgitmLv == "2" {
  3265. //// treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3266. ////
  3267. //// }
  3268. //// if item.ChrgitmLv == "3" {
  3269. //// treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3270. //// }
  3271. //// }
  3272. ////
  3273. //// if item.MedChrgitmType == "06" { //手术费
  3274. //// operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3275. //// operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3276. //// operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3277. //// operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3278. ////
  3279. //// if item.ChrgitmLv == "1" {
  3280. ////
  3281. //// operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3282. ////
  3283. //// }
  3284. //// if item.ChrgitmLv == "2" {
  3285. //// operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3286. ////
  3287. //// }
  3288. //// if item.ChrgitmLv == "3" {
  3289. //// operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3290. //// }
  3291. //// }
  3292. ////
  3293. //// if item.MedChrgitmType == "07" { //手术费
  3294. //// nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3295. //// nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3296. //// nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3297. //// nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3298. ////
  3299. //// if item.ChrgitmLv == "1" {
  3300. ////
  3301. //// nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3302. ////
  3303. //// }
  3304. //// if item.ChrgitmLv == "2" {
  3305. //// nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3306. ////
  3307. //// }
  3308. //// if item.ChrgitmLv == "3" {
  3309. //// nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3310. //// }
  3311. //// }
  3312. ////
  3313. //// if item.MedChrgitmType == "08" { //材料费
  3314. //// materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3315. //// materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3316. //// materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3317. //// material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3318. //// if item.ChrgitmLv == "1" {
  3319. ////
  3320. //// material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3321. ////
  3322. //// }
  3323. //// if item.ChrgitmLv == "2" {
  3324. //// material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3325. ////
  3326. //// }
  3327. //// if item.ChrgitmLv == "3" {
  3328. //// material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3329. //// }
  3330. //// }
  3331. //// if item.MedChrgitmType == "09" { //西药费
  3332. //// westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3333. //// westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3334. //// westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3335. //// westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3336. //// if item.ChrgitmLv == "1" {
  3337. //// westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3338. //// }
  3339. //// if item.ChrgitmLv == "2" {
  3340. //// westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3341. //// }
  3342. //// if item.ChrgitmLv == "3" {
  3343. //// westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3344. //// }
  3345. //// }
  3346. //// if item.MedChrgitmType == "10" { //中药饮片
  3347. //// chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3348. //// chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3349. //// chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3350. //// chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3351. //// if item.ChrgitmLv == "1" {
  3352. //// chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3353. //// }
  3354. //// if item.ChrgitmLv == "2" {
  3355. //// chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3356. //// }
  3357. //// if item.ChrgitmLv == "3" {
  3358. //// chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3359. //// }
  3360. //// }
  3361. ////
  3362. //// if item.MedChrgitmType == "11" { //中成费
  3363. //// chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3364. //// chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3365. //// chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3366. //// chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3367. //// if item.ChrgitmLv == "1" {
  3368. ////
  3369. //// chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3370. ////
  3371. //// }
  3372. //// if item.ChrgitmLv == "2" {
  3373. //// chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3374. ////
  3375. //// }
  3376. //// if item.ChrgitmLv == "3" {
  3377. //// chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3378. //// }
  3379. //// }
  3380. ////
  3381. //// if item.MedChrgitmType == "12" { //中成费
  3382. //// commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3383. //// commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3384. //// commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3385. //// commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3386. //// if item.ChrgitmLv == "1" {
  3387. ////
  3388. //// commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3389. ////
  3390. //// }
  3391. //// if item.ChrgitmLv == "2" {
  3392. //// commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3393. ////
  3394. //// }
  3395. //// if item.ChrgitmLv == "3" {
  3396. //// commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3397. //// }
  3398. //// }
  3399. ////
  3400. //// if item.MedChrgitmType == "13" { //中成费
  3401. //// registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3402. //// registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3403. //// registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3404. //// register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3405. //// if item.ChrgitmLv == "1" {
  3406. ////
  3407. //// register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3408. ////
  3409. //// }
  3410. //// if item.ChrgitmLv == "2" {
  3411. //// register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3412. ////
  3413. //// }
  3414. //// if item.ChrgitmLv == "3" {
  3415. //// register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3416. //// }
  3417. //// }
  3418. ////
  3419. //// if item.MedChrgitmType == "14" { //其他费
  3420. //// otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3421. //// otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3422. //// otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3423. //// other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3424. //// if item.ChrgitmLv == "1" {
  3425. //// other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3426. ////
  3427. //// }
  3428. //// if item.ChrgitmLv == "2" {
  3429. //// other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3430. ////
  3431. //// }
  3432. //// if item.ChrgitmLv == "3" {
  3433. //// other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3434. //// }
  3435. //// }
  3436. ////
  3437. //// }
  3438. ////
  3439. //// //var iteminfoStructs []service.IteminfoStruct
  3440. //// //
  3441. //// //if bedCostTotal != 0 {
  3442. //// // iteminfo.MedChrgitm = "01"
  3443. //// // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  3444. //// // iteminfo.Amt = bedCostTotal
  3445. //// // iteminfo.ClaaSumfee = bed_claa_sunmfee
  3446. //// // iteminfo.ClabAmt = bed_clab_amt
  3447. //// // iteminfo.OthAmt = bed_other_amt
  3448. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3449. //// //}
  3450. //// //
  3451. //// //if examineCostTotal != 0 {
  3452. //// // iteminfo.MedChrgitm = "02"
  3453. //// // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  3454. //// // iteminfo.Amt = examineCostTotal
  3455. //// // iteminfo.ClaaSumfee = examine_claa_sunmfee
  3456. //// // iteminfo.ClabAmt = examine_clab_amt
  3457. //// // iteminfo.OthAmt = examine_other_amt
  3458. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3459. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3460. //// //}
  3461. //// //
  3462. //// //if checkCostTotal != 0 {
  3463. //// // iteminfo.MedChrgitm = "03"
  3464. //// // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  3465. //// // iteminfo.Amt = checkCostTotal
  3466. //// // iteminfo.ClaaSumfee = check_claa_sunmfee
  3467. //// // iteminfo.ClabAmt = check_clab_amt
  3468. //// // iteminfo.OthAmt = check_other_amt
  3469. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3470. //// //
  3471. //// //}
  3472. //// //
  3473. //// //if laboratoryCostTotal != 0 {
  3474. //// // iteminfo.MedChrgitm = "04"
  3475. //// // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  3476. //// // iteminfo.Amt = laboratoryCostTotal
  3477. //// // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  3478. //// // iteminfo.ClabAmt = laboratory_clab_amt
  3479. //// // iteminfo.OthAmt = laboratory_other_amt
  3480. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3481. //// //
  3482. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3483. //// //
  3484. //// //}
  3485. //// //
  3486. //// //if treatCostTotal != 0 {
  3487. //// // iteminfo.MedChrgitm = "05"
  3488. //// // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  3489. //// // iteminfo.Amt = treatCostTotal
  3490. //// // iteminfo.ClaaSumfee = treat_claa_sunmfee
  3491. //// // iteminfo.ClabAmt = treat_clab_amt
  3492. //// // iteminfo.OthAmt = treat_other_amt
  3493. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3494. //// // //(struct4101.IteminfoStruct, iteminfo)
  3495. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3496. //// //}
  3497. //// //
  3498. //// //if operationCostTotal != 0 {
  3499. //// // iteminfo.MedChrgitm = "06"
  3500. //// // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  3501. //// // iteminfo.Amt = operationCostTotal
  3502. //// // iteminfo.ClaaSumfee = operation_claa_sunmfee
  3503. //// // iteminfo.ClabAmt = operation_clab_amt
  3504. //// // iteminfo.OthAmt = operation_other_amt
  3505. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3506. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3507. //// //}
  3508. //// //
  3509. //// //if nursingCostTotal != 0 {
  3510. //// // iteminfo.MedChrgitm = "07"
  3511. //// // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  3512. //// // iteminfo.Amt = nursingCostTotal
  3513. //// // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  3514. //// // iteminfo.ClabAmt = nursing_clab_amt
  3515. //// // iteminfo.OthAmt = nursing_other_amt
  3516. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3517. //// //}
  3518. //// //
  3519. //// //if materialCostTotal != 0 {
  3520. //// // iteminfo.MedChrgitm = "08"
  3521. //// // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  3522. //// // iteminfo.Amt = materialCostTotal
  3523. //// // iteminfo.ClaaSumfee = material_claa_sunmfee
  3524. //// // iteminfo.ClabAmt = material_clab_amt
  3525. //// // iteminfo.OthAmt = material_other_amt
  3526. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3527. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3528. //// //}
  3529. //// //
  3530. //// //if westernMedicineCostTotal != 0 {
  3531. //// // iteminfo.MedChrgitm = "09"
  3532. //// // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  3533. //// // iteminfo.Amt = westernMedicineCostTotal
  3534. //// // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  3535. //// // iteminfo.ClabAmt = westernMedicine_clab_amt
  3536. //// // iteminfo.OthAmt = westernMedicine_other_amt
  3537. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3538. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3539. //// //
  3540. //// //}
  3541. //// //
  3542. //// //if chineseMedicineCostTotal != 0 {
  3543. //// // iteminfo.MedChrgitm = "10"
  3544. //// // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  3545. //// // iteminfo.Amt = chineseMedicineCostTotal
  3546. //// // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  3547. //// // iteminfo.ClabAmt = chinese_medicine_clab_amt
  3548. //// // iteminfo.OthAmt = chinese_medicine_other_amt
  3549. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3550. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3551. //// //
  3552. //// //}
  3553. //// //
  3554. //// //if chineseTraditionalMedicineCostTotal != 0 {
  3555. //// // iteminfo.MedChrgitm = "11"
  3556. //// // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  3557. //// // iteminfo.Amt = westernMedicineCostTotal
  3558. //// // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  3559. //// // iteminfo.ClabAmt = westernMedicine_clab_amt
  3560. //// // iteminfo.OthAmt = westernMedicine_other_amt
  3561. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3562. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3563. //// //
  3564. //// //}
  3565. //// //
  3566. //// //if commonlyTreatmentCostTotal != 0 {
  3567. //// // iteminfo.MedChrgitm = "12"
  3568. //// // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  3569. //// // iteminfo.Amt = commonlyTreatmentCostTotal
  3570. //// // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  3571. //// // iteminfo.ClabAmt = commonly_treatment_clab_amt
  3572. //// // iteminfo.OthAmt = commonly_treatment_other_amt
  3573. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3574. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3575. //// //
  3576. //// //}
  3577. //// //
  3578. //// //if registerCostTotal != 0 {
  3579. //// // iteminfo.MedChrgitm = "13"
  3580. //// // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  3581. //// // iteminfo.Amt = registerCostTotal
  3582. //// // iteminfo.ClaaSumfee = register_claa_sunmfee
  3583. //// // iteminfo.ClabAmt = register_clab_amt
  3584. //// // iteminfo.OthAmt = register_other_amt
  3585. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3586. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3587. //// //
  3588. //// //}
  3589. //// //
  3590. //// //if otherCostTotal != 0 {
  3591. //// // iteminfo.MedChrgitm = "14"
  3592. //// // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  3593. //// // iteminfo.Amt = otherCostTotal
  3594. //// // iteminfo.ClaaSumfee = other_claa_sunmfee
  3595. //// // iteminfo.ClabAmt = other_clab_amt
  3596. //// // iteminfo.OthAmt = other_other_amt
  3597. //// // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  3598. //// // iteminfoStructs = append(iteminfoStructs, iteminfo)
  3599. //// //
  3600. //// //}
  3601. //// //
  3602. //// //struct4101.IteminfoStruct = iteminfoStructs
  3603. //// time_arr := strings.Split(order.SetlTime, " ")
  3604. //// struct4101.AdmTime = time_arr[0]
  3605. //// struct4101.AdmEndTime = time_arr[0]
  3606. //// struct4101.DoctorName = doctor.UserName
  3607. //// struct4101.DoctorCode = doctor.DoctorNumber
  3608. ////
  3609. //// struct4101.Ntly = "中国"
  3610. //// struct4101.AdmCaty = "A03.06"
  3611. //// var res ResultSeventeen
  3612. //// {
  3613. //// result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  3614. //// fmt.Println(result)
  3615. //// saveLog(result, request, "4101A", "清单上传")
  3616. //// var dat map[string]interface{}
  3617. //// if err := json.Unmarshal([]byte(result), &dat); err == nil {
  3618. //// fmt.Println(dat)
  3619. //// } else {
  3620. //// fmt.Println(err)
  3621. //// }
  3622. //// userJSONBytes, _ := json.Marshal(dat)
  3623. //// if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  3624. //// //utils.ErrorLog("解析失败:%v", err)
  3625. //// //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  3626. //// //adminUser := c.GetAdminUserInfo()
  3627. //// errlog := &models.HisOrderError{
  3628. //// UserOrgId: org_id,
  3629. //// Ctime: time.Now().Unix(),
  3630. //// Mtime: time.Now().Unix(),
  3631. //// ErrMsg: res.ErrMsg + "解析失败",
  3632. //// Status: 1,
  3633. //// PatientId: order_id,
  3634. //// Stage: 10138,
  3635. //// }
  3636. //// service.CreateErrMsgLog(errlog)
  3637. //// continue
  3638. //// }
  3639. //// }
  3640. ////
  3641. //// if res.Infcode != 0 {
  3642. //// //adminUser := c.GetAdminUserInfo()
  3643. //// errlog := &models.HisOrderError{
  3644. //// UserOrgId: org_id,
  3645. //// Ctime: time.Now().Unix(),
  3646. //// Mtime: time.Now().Unix(),
  3647. //// ErrMsg: res.ErrMsg,
  3648. //// Status: 1,
  3649. //// PatientId: order_id,
  3650. //// Stage: 10138,
  3651. //// }
  3652. //// service.CreateErrMsgLog(errlog)
  3653. //// continue
  3654. //// } else {
  3655. //// hisFundSettleListResult := &models.HisFundSettleListResult{
  3656. //// Number: res.Output.SetlListId,
  3657. //// Status: 1,
  3658. //// Ctime: time.Now().Unix(),
  3659. //// Mtime: time.Now().Unix(),
  3660. //// UserOrgId: org_id,
  3661. //// IsUpload: 1,
  3662. //// OrderId: order_id,
  3663. //// }
  3664. //// service.CreateUploadRecord(hisFundSettleListResult)
  3665. //// continue
  3666. //// }
  3667. //// }
  3668. ////}
  3669. //
  3670. //func GetBatchSettleList() {
  3671. //
  3672. // org_id, _ := beego.AppConfig.Int64("org_id")
  3673. // //list, _ := service.GetLastFundList(org_id)
  3674. // //orders, _ := service.GetOrderError(org_id)
  3675. // //order, _ := service.GetHisOrderByID(list.OrderId)
  3676. // var orders []*models.HisOrder
  3677. // //if order.ID > 0 {
  3678. // //
  3679. // // orders, _ = service.GetAllHisOrderTwo(org_id, order.ID)
  3680. // //
  3681. // //} else {
  3682. // orders, _ = service.GetAllHisOrder10106(org_id)
  3683. // //
  3684. // //}
  3685. //
  3686. // for _, item := range orders {
  3687. // order_id := item.ID
  3688. // order, _ := service.GetHisOrderByIDTwo(order_id)
  3689. // roles, _ := service.GetDoctorListTwo(org_id)
  3690. // his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  3691. // admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
  3692. // curRoles, _ := service.GetAdminUserInfoByID(org_id, 2495)
  3693. // depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  3694. // miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  3695. //
  3696. // pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
  3697. //
  3698. // doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
  3699. //
  3700. // if order.ID == 0 {
  3701. // return
  3702. // }
  3703. // if his.BalanceAccountsType == 2 {
  3704. // continue
  3705. // }
  3706. // struct4101 := service.Struct4101{
  3707. // PsnNo: order.PsnNo,
  3708. // MdtrtId: order.MdtrtId,
  3709. // SetlId: order.SetlId,
  3710. // PsnName: order.PsnName,
  3711. // Gend: order.Gend,
  3712. // Brdy: his.Brdy,
  3713. // Age: his.Age,
  3714. // Naty: order.Naty,
  3715. // PatnCertType: "01",
  3716. // Certno: order.Certno,
  3717. // Prfs: "90",
  3718. // ConerName: roles[0].UserName,
  3719. // PatnRlts: "99",
  3720. // ConerAddr: miConfig.OrgName,
  3721. // ConerTel: admin.Mobile,
  3722. // HiType: order.Insutype,
  3723. // Insuplc: his.InsuplcAdmdvs,
  3724. // MaindiagFlag: "1",
  3725. // BillCode: order.SetlId,
  3726. // BillNo: order.SetlId,
  3727. // BizSn: order.Number,
  3728. // PsnSelfPay: order.PsnPartAmt,
  3729. // PsnOwnPay: order.PsnPartAmt,
  3730. // AcctPay: order.AcctPay,
  3731. // PsnCashpay: order.PsnCashPay,
  3732. // HiPaymtd: "1",
  3733. // Hsorg: his.InsuplcAdmdvs,
  3734. // HsorgOpter: his.InsuplcAdmdvs,
  3735. // MedinsFillPsn: curRoles.UserName,
  3736. // MedinsFillDept: depart.Name,
  3737. // IptMedType: "2",
  3738. // }
  3739. //
  3740. // struct4101.SetlBegnDate = order.SetlTime
  3741. // struct4101.SetlEndDate = order.SetlTime
  3742. //
  3743. // //if order.SettleType == 1 {
  3744. // // t := time.Unix(int64(order.SettleAccountsDate), 0)
  3745. // // dateStr := t.Format("2006-01-02")
  3746. // // struct4101.SetlBegnDate = dateStr
  3747. // // struct4101.SetlEndDate = dateStr
  3748. // //} else {
  3749. // // t := time.Unix(int64(order.SettleStartTime), 0)
  3750. // // t2 := time.Unix(int64(order.SettleEndTime), 0)
  3751. // // dateStartStr := t.Format("2006-01-02")
  3752. // // dateEndStr := t2.Format("2006-01-02")
  3753. // // struct4101.SetlBegnDate = dateStartStr
  3754. // // struct4101.SetlEndDate = dateEndStr
  3755. // //}
  3756. //
  3757. // var rf []CustomFundPay
  3758. // json.Unmarshal([]byte(order.SetlDetail), &rf)
  3759. //
  3760. // var tempFunPays []service.CustomStruct
  3761. // var tempFunPay610100 service.CustomStruct
  3762. //
  3763. // for _, item := range rf {
  3764. // if item.FundPayType == "610100" {
  3765. // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  3766. // tempFunPay610100.FundPayType = item.FundPayType
  3767. // } else {
  3768. // var tempFunPay service.CustomStruct
  3769. // tempFunPay.FundPayamt = item.FundPayamt
  3770. // tempFunPay.FundPayType = item.FundPayType
  3771. // tempFunPays = append(tempFunPays, tempFunPay)
  3772. // }
  3773. // }
  3774. // tempFunPays = append(tempFunPays, tempFunPay610100)
  3775. // struct4101.CustomStruct = tempFunPays
  3776. //
  3777. // var tempDiaginfos []service.DiaginfoStructTwo
  3778. // var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  3779. // var tempOpspdiseinfos []service.OpspdiseinfoStruct
  3780. //
  3781. // diagnosis_ids := strings.Split(his.Diagnosis, ",")
  3782. // var config []*models.HisXtDiagnoseConfig
  3783. // for _, item := range diagnosis_ids {
  3784. // id, _ := strconv.ParseInt(item, 10, 64)
  3785. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  3786. // config = append(config, &diagnosisConfig)
  3787. // }
  3788. //
  3789. // for index, item := range config {
  3790. // if index == 0 {
  3791. // var tempDiaginfo service.DiaginfoStructTwo
  3792. // tempDiaginfo.DiagCode = item.CountryCode
  3793. // tempDiaginfo.DiagName = item.CountryContentName
  3794. // tempDiaginfo.DiagType = "1"
  3795. // tempDiaginfo.MaindiagFlag = "1"
  3796. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  3797. // } else {
  3798. //
  3799. // var tempDiaginfo service.DiaginfoStructTwo
  3800. // tempDiaginfo.DiagCode = item.CountryCode
  3801. // tempDiaginfo.DiagName = item.CountryContentName
  3802. // tempDiaginfo.DiagType = "2"
  3803. // tempDiaginfo.MaindiagFlag = "0"
  3804. // tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
  3805. // }
  3806. // }
  3807. // struct4101.Diseinfo = tempDiaginfos
  3808. //
  3809. // sickConfigTwo, _ := service.FindSickById(his.SickType)
  3810. // tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  3811. // tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  3812. // tempOpspdiseinfo2.OprnOprtCode = ""
  3813. // tempOpspdiseinfo2.OprnOprtName = ""
  3814. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  3815. // struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  3816. //
  3817. // var iteminfo service.IteminfoStruct
  3818. //
  3819. // var bedCostTotal float64 = 0 //床位总费
  3820. // var bedCostSelfTotal float64 = 0 //床位自费
  3821. // var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  3822. //
  3823. // var examineCostTotal float64 = 0 //诊查总费
  3824. // var examineCostSelfTotal float64 = 0 //诊查自费
  3825. // var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  3826. //
  3827. // var nursingCostTotal float64 = 0 //护理总费
  3828. // var nursingCostSelfTotal float64 = 0 //护理自费
  3829. // var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  3830. //
  3831. // var chineseMedicineCostTotal float64 = 0 //中成药
  3832. // var chineseMedicineCostSelfTotal float64 = 0 //中成药
  3833. // var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  3834. //
  3835. // var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  3836. // var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  3837. // var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  3838. //
  3839. // var registerCostTotal float64 = 0 //一般诊疗费
  3840. // var registerCostSelfTotal float64 = 0 //一般诊疗费
  3841. // var registerPartSelfTotal float64 = 0 //一般诊疗费
  3842. //
  3843. // var operationCostTotal float64 = 0 //手术费
  3844. // var operationCostSelfTotal float64 = 0 //手术费
  3845. // var operationCostPartSelfTotal float64 = 0 //手术费
  3846. //
  3847. // var otherCostTotal float64 = 0 //其他费用
  3848. // var otherCostSelfTotal float64 = 0 //其他费用
  3849. // var otherCostPartSelfTotal float64 = 0 //其他费用
  3850. //
  3851. // var materialCostTotal float64 = 0 //材料费
  3852. // var materialCostSelfTotal float64 = 0 //材料费
  3853. // var materialCostPartSelfTotal float64 = 0 //材料费
  3854. //
  3855. // var westernMedicineCostTotal float64 = 0 //西药费
  3856. // var westernMedicineCostSelfTotal float64 = 0 //西药费
  3857. // var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  3858. //
  3859. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  3860. // var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  3861. // var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  3862. //
  3863. // var checkCostTotal float64 = 0 //检查费
  3864. // var checkCostSelfTotal float64 = 0 //检查费
  3865. // var checkCostPartSelfTotal float64 = 0 //检查费
  3866. //
  3867. // var laboratoryCostTotal float64 = 0 //化验费
  3868. // var laboratoryCostSelfTotal float64 = 0 //化验费
  3869. // var laboratoryCostPartSelfTotal float64 = 0 //化验费
  3870. //
  3871. // var treatCostTotal float64 = 0 //治疗费用
  3872. // var treatCostSelfTotal float64 = 0 //治疗费用
  3873. // var treatCostPartSelfTotal float64 = 0 //治疗费用
  3874. //
  3875. // decimal.DivisionPrecision = 2
  3876. //
  3877. // var bed_fulamt_ownpay_amt float64 = 0
  3878. //
  3879. // var examine_fulamt_ownpay_amt float64 = 0
  3880. //
  3881. // var nursing_fulamt_ownpay_amt float64 = 0
  3882. //
  3883. // var chinese_medicine_fulamt_ownpay_amt float64 = 0
  3884. //
  3885. // var commonly_treatment_fulamt_ownpay_amt float64 = 0
  3886. //
  3887. // var register_fulamt_ownpay_amt float64 = 0
  3888. //
  3889. // var operation_fulamt_ownpay_amt float64 = 0
  3890. // var other_fulamt_ownpay_amt float64 = 0
  3891. // var westernMedicine_fulamt_ownpay_amt float64 = 0
  3892. // var chineseTraditional_fulamt_ownpay_amt float64 = 0
  3893. // var check_fulamt_ownpay_amt float64 = 0
  3894. // var material_fulamt_ownpay_amt float64 = 0
  3895. // var laboratory_fulamt_ownpay_amt float64 = 0
  3896. // var treat_fulamt_ownpay_amt float64 = 0
  3897. //
  3898. // var bed_claa_sunmfee float64 = 0
  3899. // var bed_clab_amt float64 = 0
  3900. // var bed_other_amt float64 = 0
  3901. //
  3902. // var examine_claa_sunmfee float64 = 0
  3903. // var examine_clab_amt float64 = 0
  3904. // var examine_other_amt float64 = 0
  3905. //
  3906. // var nursing_claa_sunmfee float64 = 0
  3907. // var nursing_clab_amt float64 = 0
  3908. // var nursing_other_amt float64 = 0
  3909. //
  3910. // var chinese_medicine_claa_sunmfee float64 = 0
  3911. // var chinese_medicine_clab_amt float64 = 0
  3912. // var chinese_medicine_other_amt float64 = 0
  3913. //
  3914. // var commonly_treatment_claa_sunmfee float64 = 0
  3915. // var commonly_treatment_clab_amt float64 = 0
  3916. // var commonly_treatment_other_amt float64 = 0
  3917. //
  3918. // var operation_claa_sunmfee float64 = 0
  3919. // var operation_clab_amt float64 = 0
  3920. // var operation_other_amt float64 = 0
  3921. //
  3922. // var other_claa_sunmfee float64 = 0
  3923. // var other_clab_amt float64 = 0
  3924. // var other_other_amt float64 = 0
  3925. //
  3926. // var westernMedicine_claa_sunmfee float64 = 0
  3927. // var westernMedicine_clab_amt float64 = 0
  3928. // var westernMedicine_other_amt float64 = 0
  3929. //
  3930. // var chineseTraditional_claa_sunmfee float64 = 0
  3931. // var chineseTraditional_clab_amt float64 = 0
  3932. // var chineseTraditional_other_amt float64 = 0
  3933. //
  3934. // var check_claa_sunmfee float64 = 0
  3935. // var check_clab_amt float64 = 0
  3936. // var check_other_amt float64 = 0
  3937. //
  3938. // var material_claa_sunmfee float64 = 0
  3939. // var material_clab_amt float64 = 0
  3940. // var material_other_amt float64 = 0
  3941. //
  3942. // var laboratory_claa_sunmfee float64 = 0
  3943. // var laboratory_clab_amt float64 = 0
  3944. // var laboratory_other_amt float64 = 0
  3945. //
  3946. // var treat_claa_sunmfee float64 = 0
  3947. // var treat_clab_amt float64 = 0
  3948. // var treat_other_amt float64 = 0
  3949. //
  3950. // var register_claa_sunmfee float64 = 0
  3951. // var register_clab_amt float64 = 0
  3952. // var register_other_amt float64 = 0
  3953. //
  3954. // for _, item := range order.HisOrderInfo {
  3955. // if item.MedChrgitmType == "01" { //床位费
  3956. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3957. // bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3958. // bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3959. // bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3960. // if item.ChrgitmLv == "1" {
  3961. // bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3962. // }
  3963. // if item.ChrgitmLv == "2" {
  3964. // bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3965. //
  3966. // }
  3967. // if item.ChrgitmLv == "3" {
  3968. // bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3969. // }
  3970. //
  3971. // }
  3972. //
  3973. // if item.MedChrgitmType == "02" { //诊查
  3974. // examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3975. // examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3976. // examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3977. // examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3978. // if item.ChrgitmLv == "1" {
  3979. // examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3980. // }
  3981. // if item.ChrgitmLv == "2" {
  3982. // examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3983. //
  3984. // }
  3985. // if item.ChrgitmLv == "3" {
  3986. // examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3987. // }
  3988. //
  3989. // }
  3990. //
  3991. // if item.MedChrgitmType == "03" { //检查费
  3992. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3993. // checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  3994. // checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  3995. // check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  3996. // if item.ChrgitmLv == "1" {
  3997. //
  3998. // check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  3999. //
  4000. // }
  4001. // if item.ChrgitmLv == "2" {
  4002. // check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4003. //
  4004. // }
  4005. // if item.ChrgitmLv == "3" {
  4006. // check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4007. // }
  4008. // }
  4009. //
  4010. // if item.MedChrgitmType == "04" { //化验费
  4011. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4012. // laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4013. // laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4014. // laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4015. // if item.ChrgitmLv == "1" {
  4016. //
  4017. // laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4018. //
  4019. // }
  4020. // if item.ChrgitmLv == "2" {
  4021. // laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4022. //
  4023. // }
  4024. // if item.ChrgitmLv == "3" {
  4025. // laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4026. // }
  4027. // }
  4028. //
  4029. // if item.MedChrgitmType == "05" { //治疗费
  4030. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4031. // treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4032. // treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4033. // treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4034. // if item.ChrgitmLv == "1" {
  4035. //
  4036. // treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4037. //
  4038. // }
  4039. // if item.ChrgitmLv == "2" {
  4040. // treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4041. //
  4042. // }
  4043. // if item.ChrgitmLv == "3" {
  4044. // treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4045. // }
  4046. // }
  4047. //
  4048. // if item.MedChrgitmType == "06" { //手术费
  4049. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4050. // operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4051. // operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4052. // operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4053. //
  4054. // if item.ChrgitmLv == "1" {
  4055. //
  4056. // operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4057. //
  4058. // }
  4059. // if item.ChrgitmLv == "2" {
  4060. // operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4061. //
  4062. // }
  4063. // if item.ChrgitmLv == "3" {
  4064. // operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4065. // }
  4066. // }
  4067. //
  4068. // if item.MedChrgitmType == "07" { //手术费
  4069. // nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4070. // nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4071. // nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4072. // nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4073. //
  4074. // if item.ChrgitmLv == "1" {
  4075. //
  4076. // nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4077. //
  4078. // }
  4079. // if item.ChrgitmLv == "2" {
  4080. // nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4081. //
  4082. // }
  4083. // if item.ChrgitmLv == "3" {
  4084. // nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4085. // }
  4086. // }
  4087. //
  4088. // if item.MedChrgitmType == "08" { //材料费
  4089. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4090. // materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4091. // materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4092. // material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4093. // if item.ChrgitmLv == "1" {
  4094. //
  4095. // material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4096. //
  4097. // }
  4098. // if item.ChrgitmLv == "2" {
  4099. // material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4100. //
  4101. // }
  4102. // if item.ChrgitmLv == "3" {
  4103. // material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4104. // }
  4105. // }
  4106. // if item.MedChrgitmType == "09" { //西药费
  4107. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4108. // westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4109. // westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4110. // westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4111. // if item.ChrgitmLv == "1" {
  4112. // westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4113. // }
  4114. // if item.ChrgitmLv == "2" {
  4115. // westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4116. // }
  4117. // if item.ChrgitmLv == "3" {
  4118. // westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4119. // }
  4120. // }
  4121. // if item.MedChrgitmType == "10" { //中药饮片
  4122. // chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4123. // chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4124. // chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4125. // chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4126. // if item.ChrgitmLv == "1" {
  4127. // chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4128. // }
  4129. // if item.ChrgitmLv == "2" {
  4130. // chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4131. // }
  4132. // if item.ChrgitmLv == "3" {
  4133. // chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4134. // }
  4135. // }
  4136. //
  4137. // if item.MedChrgitmType == "11" { //中成费
  4138. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4139. // chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4140. // chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4141. // chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4142. // if item.ChrgitmLv == "1" {
  4143. //
  4144. // chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4145. //
  4146. // }
  4147. // if item.ChrgitmLv == "2" {
  4148. // chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4149. //
  4150. // }
  4151. // if item.ChrgitmLv == "3" {
  4152. // chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4153. // }
  4154. // }
  4155. //
  4156. // if item.MedChrgitmType == "12" { //中成费
  4157. // commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4158. // commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4159. // commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4160. // commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4161. // if item.ChrgitmLv == "1" {
  4162. //
  4163. // commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4164. //
  4165. // }
  4166. // if item.ChrgitmLv == "2" {
  4167. // commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4168. //
  4169. // }
  4170. // if item.ChrgitmLv == "3" {
  4171. // commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4172. // }
  4173. // }
  4174. //
  4175. // if item.MedChrgitmType == "13" { //中成费
  4176. // registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4177. // registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4178. // registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4179. // register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4180. // if item.ChrgitmLv == "1" {
  4181. //
  4182. // register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4183. //
  4184. // }
  4185. // if item.ChrgitmLv == "2" {
  4186. // register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4187. //
  4188. // }
  4189. // if item.ChrgitmLv == "3" {
  4190. // register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4191. // }
  4192. // }
  4193. //
  4194. // if item.MedChrgitmType == "14" { //其他费
  4195. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4196. // otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4197. // otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4198. // other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4199. // if item.ChrgitmLv == "1" {
  4200. // other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4201. //
  4202. // }
  4203. // if item.ChrgitmLv == "2" {
  4204. // other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4205. //
  4206. // }
  4207. // if item.ChrgitmLv == "3" {
  4208. // other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4209. // }
  4210. // }
  4211. //
  4212. // }
  4213. //
  4214. // var iteminfoStructs []service.IteminfoStruct
  4215. //
  4216. // if bedCostTotal != 0 {
  4217. // iteminfo.MedChrgitm = "01"
  4218. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  4219. // iteminfo.Amt = bedCostTotal
  4220. // iteminfo.ClaaSumfee = bed_claa_sunmfee
  4221. // iteminfo.ClabAmt = bed_clab_amt
  4222. // iteminfo.OthAmt = bed_other_amt
  4223. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4224. // }
  4225. //
  4226. // if examineCostTotal != 0 {
  4227. // iteminfo.MedChrgitm = "02"
  4228. // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  4229. // iteminfo.Amt = examineCostTotal
  4230. // iteminfo.ClaaSumfee = examine_claa_sunmfee
  4231. // iteminfo.ClabAmt = examine_clab_amt
  4232. // iteminfo.OthAmt = examine_other_amt
  4233. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4234. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4235. // }
  4236. //
  4237. // if checkCostTotal != 0 {
  4238. // iteminfo.MedChrgitm = "03"
  4239. // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  4240. // iteminfo.Amt = checkCostTotal
  4241. // iteminfo.ClaaSumfee = check_claa_sunmfee
  4242. // iteminfo.ClabAmt = check_clab_amt
  4243. // iteminfo.OthAmt = check_other_amt
  4244. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4245. //
  4246. // }
  4247. //
  4248. // if laboratoryCostTotal != 0 {
  4249. // iteminfo.MedChrgitm = "04"
  4250. // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  4251. // iteminfo.Amt = laboratoryCostTotal
  4252. // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  4253. // iteminfo.ClabAmt = laboratory_clab_amt
  4254. // iteminfo.OthAmt = laboratory_other_amt
  4255. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4256. //
  4257. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4258. //
  4259. // }
  4260. //
  4261. // if treatCostTotal != 0 {
  4262. // iteminfo.MedChrgitm = "05"
  4263. // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  4264. // iteminfo.Amt = treatCostTotal
  4265. // iteminfo.ClaaSumfee = treat_claa_sunmfee
  4266. // iteminfo.ClabAmt = treat_clab_amt
  4267. // iteminfo.OthAmt = treat_other_amt
  4268. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4269. // //(struct4101.IteminfoStruct, iteminfo)
  4270. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4271. // }
  4272. //
  4273. // if operationCostTotal != 0 {
  4274. // iteminfo.MedChrgitm = "06"
  4275. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  4276. // iteminfo.Amt = operationCostTotal
  4277. // iteminfo.ClaaSumfee = operation_claa_sunmfee
  4278. // iteminfo.ClabAmt = operation_clab_amt
  4279. // iteminfo.OthAmt = operation_other_amt
  4280. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4281. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4282. // }
  4283. //
  4284. // if nursingCostTotal != 0 {
  4285. // iteminfo.MedChrgitm = "07"
  4286. // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  4287. // iteminfo.Amt = nursingCostTotal
  4288. // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  4289. // iteminfo.ClabAmt = nursing_clab_amt
  4290. // iteminfo.OthAmt = nursing_other_amt
  4291. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4292. // }
  4293. //
  4294. // if materialCostTotal != 0 {
  4295. // iteminfo.MedChrgitm = "08"
  4296. // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  4297. // iteminfo.Amt = materialCostTotal
  4298. // iteminfo.ClaaSumfee = material_claa_sunmfee
  4299. // iteminfo.ClabAmt = material_clab_amt
  4300. // iteminfo.OthAmt = material_other_amt
  4301. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4302. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4303. // }
  4304. //
  4305. // if westernMedicineCostTotal != 0 {
  4306. // iteminfo.MedChrgitm = "09"
  4307. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  4308. // iteminfo.Amt = westernMedicineCostTotal
  4309. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  4310. // iteminfo.ClabAmt = westernMedicine_clab_amt
  4311. // iteminfo.OthAmt = westernMedicine_other_amt
  4312. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4313. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4314. //
  4315. // }
  4316. //
  4317. // if chineseMedicineCostTotal != 0 {
  4318. // iteminfo.MedChrgitm = "10"
  4319. // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  4320. // iteminfo.Amt = chineseMedicineCostTotal
  4321. // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  4322. // iteminfo.ClabAmt = chinese_medicine_clab_amt
  4323. // iteminfo.OthAmt = chinese_medicine_other_amt
  4324. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4325. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4326. //
  4327. // }
  4328. //
  4329. // if chineseTraditionalMedicineCostTotal != 0 {
  4330. // iteminfo.MedChrgitm = "11"
  4331. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  4332. // iteminfo.Amt = westernMedicineCostTotal
  4333. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  4334. // iteminfo.ClabAmt = westernMedicine_clab_amt
  4335. // iteminfo.OthAmt = westernMedicine_other_amt
  4336. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4337. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4338. //
  4339. // }
  4340. //
  4341. // if commonlyTreatmentCostTotal != 0 {
  4342. // iteminfo.MedChrgitm = "12"
  4343. // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  4344. // iteminfo.Amt = commonlyTreatmentCostTotal
  4345. // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  4346. // iteminfo.ClabAmt = commonly_treatment_clab_amt
  4347. // iteminfo.OthAmt = commonly_treatment_other_amt
  4348. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4349. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4350. //
  4351. // }
  4352. //
  4353. // if registerCostTotal != 0 {
  4354. // iteminfo.MedChrgitm = "13"
  4355. // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  4356. // iteminfo.Amt = registerCostTotal
  4357. // iteminfo.ClaaSumfee = register_claa_sunmfee
  4358. // iteminfo.ClabAmt = register_clab_amt
  4359. // iteminfo.OthAmt = register_other_amt
  4360. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4361. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4362. //
  4363. // }
  4364. //
  4365. // if otherCostTotal != 0 {
  4366. // iteminfo.MedChrgitm = "14"
  4367. // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  4368. // iteminfo.Amt = otherCostTotal
  4369. // iteminfo.ClaaSumfee = other_claa_sunmfee
  4370. // iteminfo.ClabAmt = other_clab_amt
  4371. // iteminfo.OthAmt = other_other_amt
  4372. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  4373. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  4374. //
  4375. // }
  4376. //
  4377. // struct4101.IteminfoStruct = iteminfoStructs
  4378. // time_arr := strings.Split(order.SetlTime, " ")
  4379. // struct4101.AdmTime = time_arr[0]
  4380. // struct4101.AdmEndTime = time_arr[0]
  4381. // struct4101.DoctorName = doctor.UserName
  4382. // struct4101.DoctorCode = doctor.DoctorNumber
  4383. //
  4384. // struct4101.Ntly = "中国"
  4385. // struct4101.AdmCaty = "A03.06"
  4386. // var res ResultSeventeen
  4387. // if miConfig.MdtrtareaAdmvs == "421300" {
  4388. // data := make(map[string]interface{})
  4389. // data["struct4101"] = struct4101
  4390. // data["secret_key"] = miConfig.SecretKey
  4391. // data["org_name"] = miConfig.OrgName
  4392. // data["opera"] = curRoles.UserName
  4393. // data["code"] = miConfig.Code
  4394. // data["insuplc_admdvs"] = miConfig.InsuplcAdmdvs
  4395. // data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
  4396. //
  4397. // client := &http.Client{}
  4398. // bytesData, _ := json.Marshal(data)
  4399. // req, _ := http.NewRequest("POST", "http://192.168.124.4:9532/"+"hbyb/4101", bytes.NewReader(bytesData))
  4400. // resp, _ := client.Do(req)
  4401. // defer resp.Body.Close()
  4402. // body, ioErr := ioutil.ReadAll(resp.Body)
  4403. // if ioErr != nil {
  4404. // //utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
  4405. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  4406. // return
  4407. // }
  4408. // var respJSON map[string]interface{}
  4409. // if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
  4410. // //utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  4411. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  4412. // return
  4413. // }
  4414. //
  4415. // respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
  4416. // userJSONBytes, _ := json.Marshal(respJSON)
  4417. // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  4418. // //utils.ErrorLog("解析失败:%v", err)
  4419. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  4420. //
  4421. // errlog := &models.HisOrderError{
  4422. // UserOrgId: org_id,
  4423. // Ctime: time.Now().Unix(),
  4424. // Mtime: time.Now().Unix(),
  4425. // ErrMsg: res.ErrMsg + "解析失败",
  4426. // Status: 1,
  4427. // PatientId: order_id,
  4428. // Stage: 10088,
  4429. // }
  4430. // service.CreateErrMsgLog(errlog)
  4431. // continue
  4432. // }
  4433. //
  4434. // } else {
  4435. // result, request := service.Gdyb4101For10106(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  4436. // fmt.Println(result)
  4437. // saveLog(result, request, "4205", "自费就诊和诊断信息上传")
  4438. // var dat map[string]interface{}
  4439. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  4440. // fmt.Println(dat)
  4441. // } else {
  4442. // fmt.Println(err)
  4443. // }
  4444. // userJSONBytes, _ := json.Marshal(dat)
  4445. // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  4446. // //utils.ErrorLog("解析失败:%v", err)
  4447. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  4448. // //adminUser := c.GetAdminUserInfo()
  4449. // errlog := &models.HisOrderError{
  4450. // UserOrgId: org_id,
  4451. // Ctime: time.Now().Unix(),
  4452. // Mtime: time.Now().Unix(),
  4453. // ErrMsg: res.ErrMsg + "解析失败",
  4454. // Status: 1,
  4455. // PatientId: order_id,
  4456. // Stage: 50000,
  4457. // }
  4458. // service.CreateErrMsgLog(errlog)
  4459. // continue
  4460. // }
  4461. // }
  4462. //
  4463. // if res.Infcode != 0 {
  4464. // //adminUser := c.GetAdminUserInfo()
  4465. // errlog := &models.HisOrderError{
  4466. // UserOrgId: org_id,
  4467. // Ctime: time.Now().Unix(),
  4468. // Mtime: time.Now().Unix(),
  4469. // ErrMsg: res.ErrMsg,
  4470. // Status: 1,
  4471. // PatientId: order_id,
  4472. // Stage: 50000,
  4473. // }
  4474. // service.CreateErrMsgLog(errlog)
  4475. // continue
  4476. // } else {
  4477. // hisFundSettleListResult := &models.HisFundSettleListResult{
  4478. // Number: res.Output.SetlListId,
  4479. // Status: 1,
  4480. // Ctime: time.Now().Unix(),
  4481. // Mtime: time.Now().Unix(),
  4482. // UserOrgId: org_id,
  4483. // IsUpload: 1,
  4484. // OrderId: order_id,
  4485. // }
  4486. // service.CreateUploadRecord(hisFundSettleListResult)
  4487. // continue
  4488. // }
  4489. // }
  4490. //}
  4491. //
  4492. //func saveLog(result string, request string, infno string, desc string) {
  4493. //
  4494. // org_id, _ := beego.AppConfig.Int64("org_id")
  4495. // miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  4496. // dir := miConfig.OrgName + "日志"
  4497. // utils.Mkdir(dir)
  4498. // month := time.Unix(1557042972, 0).Format("1")
  4499. // year := time.Now().Format("2006")
  4500. // month = time.Now().Format("01")
  4501. // day := time.Now().Format("02")
  4502. // hour := time.Now().Format("15")
  4503. // min := time.Now().Format("04")
  4504. // sec := time.Now().Format("05")
  4505. //
  4506. // result_time := year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec
  4507. //
  4508. // file := strconv.FormatInt(org_id, 10) + "_" + year + month + day + "_log"
  4509. // file_name := file + ".txt"
  4510. // file_path := miConfig.OrgName + "日志" + "/" + file_name
  4511. // exist, _ := utils.PathExists(file_path)
  4512. // if exist { //存在
  4513. // fmt.Println("存在")
  4514. // f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  4515. // if err != nil {
  4516. // fmt.Println("read fail")
  4517. // }
  4518. // content := "\r\n" + "\r\n" + "\r\n" + result_time + " " + "【 " + desc + infno + "入参" + " 】:" + "\r\n" + request + "\r\n" + result_time + " " + "【 " + desc + infno + "出参" + " 】:" + "\r\n" + result
  4519. // n, _ := f.Seek(0, 2)
  4520. // _, err = f.WriteAt([]byte(content), n)
  4521. //
  4522. // } else { //不存在
  4523. // fmt.Println("文件不存在,创建文件")
  4524. // f, err := os.Create(miConfig.OrgName + "日志" + "/" + file_name)
  4525. // defer f.Close()
  4526. // if err != nil {
  4527. // } else {
  4528. // _, err = f.Write([]byte("记录日志"))
  4529. // }
  4530. // }
  4531. //
  4532. //}
  4533. //
  4534. ////func UploadSettleList(org_id int64) {
  4535. //// orders, _ := service.GetAllHisOrder(org_id)
  4536. //// for _, item := range orders {
  4537. //// order_id := item.ID
  4538. //// order, _ := service.GetHisOrderByIDTwo(order_id)
  4539. //// roles, _ := service.GetDoctorListTwo(org_id)
  4540. //// his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  4541. //// admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
  4542. //// curRoles, _ := service.GetAdminUserInfo(org_id)
  4543. //// depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  4544. //// miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  4545. ////
  4546. //// result, _ := service.GetHisFundSettleListResult(order_id)
  4547. //// //判断是否已经上传过医保,上传过就跳过该条记录
  4548. //// if result.ID > 0 {
  4549. //// continue
  4550. //// }
  4551. ////
  4552. //// if his.BalanceAccountsType == 2 {
  4553. //// continue
  4554. //// }
  4555. ////
  4556. //// struct4101 := service.Struct4101{
  4557. //// PsnNo: order.PsnNo,
  4558. //// MdtrtId: order.MdtrtId,
  4559. //// SetlId: order.SetlId,
  4560. //// PsnName: order.PsnName,
  4561. //// Gend: order.Gend,
  4562. //// Brdy: his.Brdy,
  4563. //// Age: his.Age,
  4564. //// Naty: order.Naty,
  4565. //// PatnCertType: "01",
  4566. //// Certno: order.Certno,
  4567. //// Prfs: "90",
  4568. //// ConerName: roles[0].UserName,
  4569. //// PatnRlts: "99",
  4570. //// ConerAddr: miConfig.OrgName,
  4571. //// ConerTel: admin.Mobile,
  4572. //// HiType: order.Insutype,
  4573. //// Insuplc: his.InsuplcAdmdvs,
  4574. //// MaindiagFlag: "1",
  4575. //// BillCode: order.FaPiaoCode,
  4576. //// BillNo: order.FaPiaoNumber,
  4577. //// BizSn: order.Number,
  4578. //// PsnSelfPay: order.PsnPartAmt,
  4579. //// PsnOwnPay: order.PsnPartAmt,
  4580. //// AcctPay: order.AcctPay,
  4581. //// PsnCashpay: order.PsnCashPay,
  4582. //// HiPaymtd: "1",
  4583. //// Hsorg: his.InsuplcAdmdvs,
  4584. //// HsorgOpter: his.InsuplcAdmdvs,
  4585. //// MedinsFillPsn: curRoles.UserName,
  4586. //// MedinsFillDept: depart.Name,
  4587. //// IptMedType: "2",
  4588. //// }
  4589. //// struct4101.SetlBegnDate = order.SetlTime
  4590. //// struct4101.SetlEndDate = order.SetlTime
  4591. //// //if order.SettleType == 1 {
  4592. //// // t := time.Unix(int64(order.SettleAccountsDate), 0)
  4593. //// // dateStr := t.Format("2006-01-02")
  4594. //// // struct4101.SetlBegnDate = dateStr
  4595. //// // struct4101.SetlEndDate = dateStr
  4596. //// //} else {
  4597. //// // t := time.Unix(int64(order.SettleStartTime), 0)
  4598. //// // t2 := time.Unix(int64(order.SettleEndTime), 0)
  4599. //// // dateStartStr := t.Format("2006-01-02")
  4600. //// // dateEndStr := t2.Format("2006-01-02")
  4601. //// // struct4101.SetlBegnDate = dateStartStr
  4602. //// // struct4101.SetlEndDate = dateEndStr
  4603. //// //}
  4604. ////
  4605. //// var rf []CustomFundPay
  4606. //// json.Unmarshal([]byte(order.SetlDetail), &rf)
  4607. ////
  4608. //// var tempFunPays []service.CustomStruct
  4609. //// var tempFunPay610100 service.CustomStruct
  4610. ////
  4611. //// for _, item := range rf {
  4612. //// if item.FundPayType == "610100" {
  4613. //// tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  4614. //// tempFunPay610100.FundPayType = item.FundPayType
  4615. //// } else {
  4616. //// var tempFunPay service.CustomStruct
  4617. //// tempFunPay.FundPayamt = item.FundPayamt
  4618. //// tempFunPay.FundPayType = item.FundPayType
  4619. //// tempFunPays = append(tempFunPays, tempFunPay)
  4620. //// }
  4621. //// }
  4622. //// tempFunPays = append(tempFunPays, tempFunPay610100)
  4623. //// struct4101.CustomStruct = tempFunPays
  4624. ////
  4625. //// var tempOpspdiseinfos []service.OpspdiseinfoStruct
  4626. //// var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  4627. //// //sickConfig, _ := service.FindDiagnoseById(his.Diagnosis)
  4628. ////
  4629. //// diagnosis_ids := strings.Split(his.Diagnosis, ",")
  4630. //// var config []*models.HisXtDiagnoseConfig
  4631. //// for _, item := range diagnosis_ids {
  4632. //// id, _ := strconv.ParseInt(item, 10, 64)
  4633. //// diagnosisConfig, _ := service.FindDiagnoseById(id)
  4634. //// config = append(config, &diagnosisConfig)
  4635. //// }
  4636. ////
  4637. //// for _, item := range config {
  4638. //// var tempOpspdiseinfo service.OpspdiseinfoStruct
  4639. //// tempOpspdiseinfo.DiagCode = item.CountryCode
  4640. //// tempOpspdiseinfo.DiagName = item.CountryContentName
  4641. //// tempOpspdiseinfo.MaindiagFlag = "1"
  4642. //// tempOpspdiseinfo.OprnOprtCode = ""
  4643. //// tempOpspdiseinfo.OprnOprtName = ""
  4644. //// tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
  4645. //// }
  4646. ////
  4647. //// sickConfigTwo, _ := service.FindSickById(his.SickType)
  4648. //// tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  4649. //// tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  4650. //// tempOpspdiseinfo2.MaindiagFlag = "2"
  4651. //// tempOpspdiseinfo2.OprnOprtCode = ""
  4652. //// tempOpspdiseinfo2.OprnOprtName = ""
  4653. //// tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  4654. //// struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  4655. ////
  4656. //// var iteminfo service.IteminfoStruct
  4657. ////
  4658. //// var bedCostTotal float64 = 0 //床位总费
  4659. //// var bedCostSelfTotal float64 = 0 //床位自费
  4660. //// var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  4661. ////
  4662. //// var examineCostTotal float64 = 0 //诊查总费
  4663. //// var examineCostSelfTotal float64 = 0 //诊查自费
  4664. //// var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  4665. ////
  4666. //// var nursingCostTotal float64 = 0 //护理总费
  4667. //// var nursingCostSelfTotal float64 = 0 //护理自费
  4668. //// var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  4669. ////
  4670. //// var chineseMedicineCostTotal float64 = 0 //中成药
  4671. //// var chineseMedicineCostSelfTotal float64 = 0 //中成药
  4672. //// var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  4673. ////
  4674. //// var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  4675. //// var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  4676. //// var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  4677. ////
  4678. //// var registerCostTotal float64 = 0 //一般诊疗费
  4679. //// var registerCostSelfTotal float64 = 0 //一般诊疗费
  4680. //// var registerPartSelfTotal float64 = 0 //一般诊疗费
  4681. ////
  4682. //// var operationCostTotal float64 = 0 //手术费
  4683. //// var operationCostSelfTotal float64 = 0 //手术费
  4684. //// var operationCostPartSelfTotal float64 = 0 //手术费
  4685. ////
  4686. //// var otherCostTotal float64 = 0 //其他费用
  4687. //// var otherCostSelfTotal float64 = 0 //其他费用
  4688. //// var otherCostPartSelfTotal float64 = 0 //其他费用
  4689. ////
  4690. //// var materialCostTotal float64 = 0 //材料费
  4691. //// var materialCostSelfTotal float64 = 0 //材料费
  4692. //// var materialCostPartSelfTotal float64 = 0 //材料费
  4693. ////
  4694. //// var westernMedicineCostTotal float64 = 0 //西药费
  4695. //// var westernMedicineCostSelfTotal float64 = 0 //西药费
  4696. //// var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  4697. ////
  4698. //// var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  4699. //// var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  4700. //// var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  4701. ////
  4702. //// var checkCostTotal float64 = 0 //检查费
  4703. //// var checkCostSelfTotal float64 = 0 //检查费
  4704. //// var checkCostPartSelfTotal float64 = 0 //检查费
  4705. ////
  4706. //// var laboratoryCostTotal float64 = 0 //化验费
  4707. //// var laboratoryCostSelfTotal float64 = 0 //化验费
  4708. //// var laboratoryCostPartSelfTotal float64 = 0 //化验费
  4709. ////
  4710. //// var treatCostTotal float64 = 0 //治疗费用
  4711. //// var treatCostSelfTotal float64 = 0 //治疗费用
  4712. //// var treatCostPartSelfTotal float64 = 0 //治疗费用
  4713. ////
  4714. //// decimal.DivisionPrecision = 2
  4715. ////
  4716. //// var bed_fulamt_ownpay_amt float64 = 0
  4717. ////
  4718. //// var examine_fulamt_ownpay_amt float64 = 0
  4719. ////
  4720. //// var nursing_fulamt_ownpay_amt float64 = 0
  4721. ////
  4722. //// var chinese_medicine_fulamt_ownpay_amt float64 = 0
  4723. ////
  4724. //// var commonly_treatment_fulamt_ownpay_amt float64 = 0
  4725. ////
  4726. //// var register_fulamt_ownpay_amt float64 = 0
  4727. ////
  4728. //// var operation_fulamt_ownpay_amt float64 = 0
  4729. //// var other_fulamt_ownpay_amt float64 = 0
  4730. //// var westernMedicine_fulamt_ownpay_amt float64 = 0
  4731. //// var chineseTraditional_fulamt_ownpay_amt float64 = 0
  4732. //// var check_fulamt_ownpay_amt float64 = 0
  4733. //// var material_fulamt_ownpay_amt float64 = 0
  4734. //// var laboratory_fulamt_ownpay_amt float64 = 0
  4735. //// var treat_fulamt_ownpay_amt float64 = 0
  4736. ////
  4737. //// var bed_claa_sunmfee float64 = 0
  4738. //// var bed_clab_amt float64 = 0
  4739. //// var bed_other_amt float64 = 0
  4740. ////
  4741. //// var examine_claa_sunmfee float64 = 0
  4742. //// var examine_clab_amt float64 = 0
  4743. //// var examine_other_amt float64 = 0
  4744. ////
  4745. //// var nursing_claa_sunmfee float64 = 0
  4746. //// var nursing_clab_amt float64 = 0
  4747. //// var nursing_other_amt float64 = 0
  4748. ////
  4749. //// var chinese_medicine_claa_sunmfee float64 = 0
  4750. //// var chinese_medicine_clab_amt float64 = 0
  4751. //// var chinese_medicine_other_amt float64 = 0
  4752. ////
  4753. //// var commonly_treatment_claa_sunmfee float64 = 0
  4754. //// var commonly_treatment_clab_amt float64 = 0
  4755. //// var commonly_treatment_other_amt float64 = 0
  4756. ////
  4757. //// var operation_claa_sunmfee float64 = 0
  4758. //// var operation_clab_amt float64 = 0
  4759. //// var operation_other_amt float64 = 0
  4760. ////
  4761. //// var other_claa_sunmfee float64 = 0
  4762. //// var other_clab_amt float64 = 0
  4763. //// var other_other_amt float64 = 0
  4764. ////
  4765. //// var westernMedicine_claa_sunmfee float64 = 0
  4766. //// var westernMedicine_clab_amt float64 = 0
  4767. //// var westernMedicine_other_amt float64 = 0
  4768. ////
  4769. //// var chineseTraditional_claa_sunmfee float64 = 0
  4770. //// var chineseTraditional_clab_amt float64 = 0
  4771. //// var chineseTraditional_other_amt float64 = 0
  4772. ////
  4773. //// var check_claa_sunmfee float64 = 0
  4774. //// var check_clab_amt float64 = 0
  4775. //// var check_other_amt float64 = 0
  4776. ////
  4777. //// var material_claa_sunmfee float64 = 0
  4778. //// var material_clab_amt float64 = 0
  4779. //// var material_other_amt float64 = 0
  4780. ////
  4781. //// var laboratory_claa_sunmfee float64 = 0
  4782. //// var laboratory_clab_amt float64 = 0
  4783. //// var laboratory_other_amt float64 = 0
  4784. ////
  4785. //// var treat_claa_sunmfee float64 = 0
  4786. //// var treat_clab_amt float64 = 0
  4787. //// var treat_other_amt float64 = 0
  4788. ////
  4789. //// var register_claa_sunmfee float64 = 0
  4790. //// var register_clab_amt float64 = 0
  4791. //// var register_other_amt float64 = 0
  4792. ////
  4793. //// for _, item := range order.HisOrderInfo {
  4794. //// if item.MedChrgitmType == "01" { //床位费
  4795. //// bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4796. //// bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4797. //// bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4798. //// bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4799. //// if item.ChrgitmLv == "1" {
  4800. //// bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4801. //// }
  4802. //// if item.ChrgitmLv == "2" {
  4803. //// bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4804. ////
  4805. //// }
  4806. //// if item.ChrgitmLv == "3" {
  4807. //// bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4808. //// }
  4809. ////
  4810. //// }
  4811. ////
  4812. //// if item.MedChrgitmType == "02" { //诊查
  4813. //// examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4814. //// examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4815. //// examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4816. //// examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4817. //// if item.ChrgitmLv == "1" {
  4818. //// examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4819. //// }
  4820. //// if item.ChrgitmLv == "2" {
  4821. //// examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4822. ////
  4823. //// }
  4824. //// if item.ChrgitmLv == "3" {
  4825. //// examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4826. //// }
  4827. ////
  4828. //// }
  4829. ////
  4830. //// if item.MedChrgitmType == "03" { //检查费
  4831. //// checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4832. //// checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4833. //// checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4834. //// check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4835. //// if item.ChrgitmLv == "1" {
  4836. ////
  4837. //// check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4838. ////
  4839. //// }
  4840. //// if item.ChrgitmLv == "2" {
  4841. //// check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4842. ////
  4843. //// }
  4844. //// if item.ChrgitmLv == "3" {
  4845. //// check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4846. //// }
  4847. //// }
  4848. ////
  4849. //// if item.MedChrgitmType == "04" { //化验费
  4850. //// laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4851. //// laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4852. //// laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4853. //// laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4854. //// if item.ChrgitmLv == "1" {
  4855. ////
  4856. //// laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4857. ////
  4858. //// }
  4859. //// if item.ChrgitmLv == "2" {
  4860. //// laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4861. ////
  4862. //// }
  4863. //// if item.ChrgitmLv == "3" {
  4864. //// laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4865. //// }
  4866. //// }
  4867. ////
  4868. //// if item.MedChrgitmType == "05" { //治疗费
  4869. //// treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4870. //// treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4871. //// treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4872. //// treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4873. //// if item.ChrgitmLv == "1" {
  4874. ////
  4875. //// treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4876. ////
  4877. //// }
  4878. //// if item.ChrgitmLv == "2" {
  4879. //// treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4880. ////
  4881. //// }
  4882. //// if item.ChrgitmLv == "3" {
  4883. //// treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4884. //// }
  4885. //// }
  4886. ////
  4887. //// if item.MedChrgitmType == "06" { //手术费
  4888. //// operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4889. //// operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4890. //// operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4891. //// operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4892. ////
  4893. //// if item.ChrgitmLv == "1" {
  4894. ////
  4895. //// operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4896. ////
  4897. //// }
  4898. //// if item.ChrgitmLv == "2" {
  4899. //// operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4900. ////
  4901. //// }
  4902. //// if item.ChrgitmLv == "3" {
  4903. //// operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4904. //// }
  4905. //// }
  4906. ////
  4907. //// if item.MedChrgitmType == "07" { //手术费
  4908. //// nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4909. //// nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4910. //// nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4911. //// nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4912. ////
  4913. //// if item.ChrgitmLv == "1" {
  4914. ////
  4915. //// nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4916. ////
  4917. //// }
  4918. //// if item.ChrgitmLv == "2" {
  4919. //// nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4920. ////
  4921. //// }
  4922. //// if item.ChrgitmLv == "3" {
  4923. //// nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4924. //// }
  4925. //// }
  4926. ////
  4927. //// if item.MedChrgitmType == "08" { //材料费
  4928. //// materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4929. //// materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4930. //// materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4931. //// material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4932. //// if item.ChrgitmLv == "1" {
  4933. ////
  4934. //// material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4935. ////
  4936. //// }
  4937. //// if item.ChrgitmLv == "2" {
  4938. //// material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4939. ////
  4940. //// }
  4941. //// if item.ChrgitmLv == "3" {
  4942. //// material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4943. //// }
  4944. //// }
  4945. //// if item.MedChrgitmType == "09" { //西药费
  4946. //// westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4947. //// westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4948. //// westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4949. //// westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4950. //// if item.ChrgitmLv == "1" {
  4951. //// westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4952. //// }
  4953. //// if item.ChrgitmLv == "2" {
  4954. //// westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4955. //// }
  4956. //// if item.ChrgitmLv == "3" {
  4957. //// westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4958. //// }
  4959. //// }
  4960. //// if item.MedChrgitmType == "10" { //中药饮片
  4961. //// chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4962. //// chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4963. //// chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4964. //// chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4965. //// if item.ChrgitmLv == "1" {
  4966. //// chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4967. //// }
  4968. //// if item.ChrgitmLv == "2" {
  4969. //// chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4970. //// }
  4971. //// if item.ChrgitmLv == "3" {
  4972. //// chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4973. //// }
  4974. //// }
  4975. ////
  4976. //// if item.MedChrgitmType == "11" { //中成费
  4977. //// chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4978. //// chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4979. //// chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4980. //// chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  4981. //// if item.ChrgitmLv == "1" {
  4982. ////
  4983. //// chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4984. ////
  4985. //// }
  4986. //// if item.ChrgitmLv == "2" {
  4987. //// chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4988. ////
  4989. //// }
  4990. //// if item.ChrgitmLv == "3" {
  4991. //// chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4992. //// }
  4993. //// }
  4994. ////
  4995. //// if item.MedChrgitmType == "12" { //中成费
  4996. //// commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  4997. //// commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  4998. //// commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  4999. //// commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  5000. //// if item.ChrgitmLv == "1" {
  5001. ////
  5002. //// commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  5003. ////
  5004. //// }
  5005. //// if item.ChrgitmLv == "2" {
  5006. //// commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  5007. ////
  5008. //// }
  5009. //// if item.ChrgitmLv == "3" {
  5010. //// commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  5011. //// }
  5012. //// }
  5013. ////
  5014. //// if item.MedChrgitmType == "13" { //中成费
  5015. //// registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  5016. //// registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  5017. //// registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  5018. //// register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  5019. //// if item.ChrgitmLv == "1" {
  5020. ////
  5021. //// register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  5022. ////
  5023. //// }
  5024. //// if item.ChrgitmLv == "2" {
  5025. //// register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  5026. ////
  5027. //// }
  5028. //// if item.ChrgitmLv == "3" {
  5029. //// register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  5030. //// }
  5031. //// }
  5032. ////
  5033. //// if item.MedChrgitmType == "14" { //其他费
  5034. //// otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  5035. //// otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  5036. //// otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  5037. //// other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  5038. //// if item.ChrgitmLv == "1" {
  5039. //// other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  5040. ////
  5041. //// }
  5042. //// if item.ChrgitmLv == "2" {
  5043. //// other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  5044. ////
  5045. //// }
  5046. //// if item.ChrgitmLv == "3" {
  5047. //// other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  5048. //// }
  5049. //// }
  5050. ////
  5051. //// }
  5052. ////
  5053. //// var iteminfoStructs []service.IteminfoStruct
  5054. ////
  5055. //// if bedCostTotal != 0 {
  5056. //// iteminfo.MedChrgitm = "01"
  5057. //// iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  5058. //// iteminfo.Amt = bedCostTotal
  5059. //// iteminfo.ClaaSumfee = bed_claa_sunmfee
  5060. //// iteminfo.ClabAmt = bed_clab_amt
  5061. //// iteminfo.OthAmt = bed_other_amt
  5062. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5063. //// }
  5064. ////
  5065. //// if examineCostTotal != 0 {
  5066. //// iteminfo.MedChrgitm = "02"
  5067. //// iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  5068. //// iteminfo.Amt = examineCostTotal
  5069. //// iteminfo.ClaaSumfee = examine_claa_sunmfee
  5070. //// iteminfo.ClabAmt = examine_clab_amt
  5071. //// iteminfo.OthAmt = examine_other_amt
  5072. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5073. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5074. //// }
  5075. ////
  5076. //// if checkCostTotal != 0 {
  5077. //// iteminfo.MedChrgitm = "03"
  5078. //// iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  5079. //// iteminfo.Amt = checkCostTotal
  5080. //// iteminfo.ClaaSumfee = check_claa_sunmfee
  5081. //// iteminfo.ClabAmt = check_clab_amt
  5082. //// iteminfo.OthAmt = check_other_amt
  5083. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5084. ////
  5085. //// }
  5086. ////
  5087. //// if laboratoryCostTotal != 0 {
  5088. //// iteminfo.MedChrgitm = "04"
  5089. //// iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  5090. //// iteminfo.Amt = laboratoryCostTotal
  5091. //// iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  5092. //// iteminfo.ClabAmt = laboratory_clab_amt
  5093. //// iteminfo.OthAmt = laboratory_other_amt
  5094. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5095. ////
  5096. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5097. ////
  5098. //// }
  5099. ////
  5100. //// if treatCostTotal != 0 {
  5101. //// iteminfo.MedChrgitm = "05"
  5102. //// iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  5103. //// iteminfo.Amt = treatCostTotal
  5104. //// iteminfo.ClaaSumfee = treat_claa_sunmfee
  5105. //// iteminfo.ClabAmt = treat_clab_amt
  5106. //// iteminfo.OthAmt = treat_other_amt
  5107. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5108. //// //(struct4101.IteminfoStruct, iteminfo)
  5109. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5110. //// }
  5111. ////
  5112. //// if operationCostTotal != 0 {
  5113. //// iteminfo.MedChrgitm = "06"
  5114. //// iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  5115. //// iteminfo.Amt = operationCostTotal
  5116. //// iteminfo.ClaaSumfee = operation_claa_sunmfee
  5117. //// iteminfo.ClabAmt = operation_clab_amt
  5118. //// iteminfo.OthAmt = operation_other_amt
  5119. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5120. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5121. //// }
  5122. ////
  5123. //// if nursingCostTotal != 0 {
  5124. //// iteminfo.MedChrgitm = "07"
  5125. //// iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  5126. //// iteminfo.Amt = nursingCostTotal
  5127. //// iteminfo.ClaaSumfee = nursing_claa_sunmfee
  5128. //// iteminfo.ClabAmt = nursing_clab_amt
  5129. //// iteminfo.OthAmt = nursing_other_amt
  5130. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5131. //// }
  5132. ////
  5133. //// if materialCostTotal != 0 {
  5134. //// iteminfo.MedChrgitm = "08"
  5135. //// iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  5136. //// iteminfo.Amt = materialCostTotal
  5137. //// iteminfo.ClaaSumfee = material_claa_sunmfee
  5138. //// iteminfo.ClabAmt = material_clab_amt
  5139. //// iteminfo.OthAmt = material_other_amt
  5140. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5141. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5142. //// }
  5143. ////
  5144. //// if westernMedicineCostTotal != 0 {
  5145. //// iteminfo.MedChrgitm = "09"
  5146. //// iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  5147. //// iteminfo.Amt = westernMedicineCostTotal
  5148. //// iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  5149. //// iteminfo.ClabAmt = westernMedicine_clab_amt
  5150. //// iteminfo.OthAmt = westernMedicine_other_amt
  5151. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5152. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5153. ////
  5154. //// }
  5155. ////
  5156. //// if chineseMedicineCostTotal != 0 {
  5157. //// iteminfo.MedChrgitm = "10"
  5158. //// iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  5159. //// iteminfo.Amt = chineseMedicineCostTotal
  5160. //// iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  5161. //// iteminfo.ClabAmt = chinese_medicine_clab_amt
  5162. //// iteminfo.OthAmt = chinese_medicine_other_amt
  5163. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5164. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5165. ////
  5166. //// }
  5167. ////
  5168. //// if chineseTraditionalMedicineCostTotal != 0 {
  5169. //// iteminfo.MedChrgitm = "11"
  5170. //// iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  5171. //// iteminfo.Amt = westernMedicineCostTotal
  5172. //// iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  5173. //// iteminfo.ClabAmt = westernMedicine_clab_amt
  5174. //// iteminfo.OthAmt = westernMedicine_other_amt
  5175. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5176. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5177. ////
  5178. //// }
  5179. ////
  5180. //// if commonlyTreatmentCostTotal != 0 {
  5181. //// iteminfo.MedChrgitm = "12"
  5182. //// iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  5183. //// iteminfo.Amt = commonlyTreatmentCostTotal
  5184. //// iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  5185. //// iteminfo.ClabAmt = commonly_treatment_clab_amt
  5186. //// iteminfo.OthAmt = commonly_treatment_other_amt
  5187. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5188. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5189. ////
  5190. //// }
  5191. ////
  5192. //// if registerCostTotal != 0 {
  5193. //// iteminfo.MedChrgitm = "13"
  5194. //// iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  5195. //// iteminfo.Amt = registerCostTotal
  5196. //// iteminfo.ClaaSumfee = register_claa_sunmfee
  5197. //// iteminfo.ClabAmt = register_clab_amt
  5198. //// iteminfo.OthAmt = register_other_amt
  5199. //// //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  5200. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5201. ////
  5202. //// }
  5203. ////
  5204. //// if otherCostTotal != 0 {
  5205. //// iteminfo.MedChrgitm = "14"
  5206. //// iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  5207. //// iteminfo.Amt = otherCostTotal
  5208. //// iteminfo.ClaaSumfee = other_claa_sunmfee
  5209. //// iteminfo.ClabAmt = other_clab_amt
  5210. //// iteminfo.OthAmt = other_other_amt
  5211. //// iteminfoStructs = append(iteminfoStructs, iteminfo)
  5212. ////
  5213. //// }
  5214. //// struct4101.IteminfoStruct = iteminfoStructs
  5215. //// struct4101.Ntly = "中国"
  5216. //// struct4101.AdmCaty = "A03.06"
  5217. //// result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  5218. //// fmt.Println(result)
  5219. ////
  5220. //// var dat map[string]interface{}
  5221. //// if err := json.Unmarshal([]byte(result), &dat); err == nil {
  5222. //// fmt.Println(dat)
  5223. //// } else {
  5224. //// fmt.Println(err)
  5225. //// }
  5226. //// userJSONBytes, _ := json.Marshal(dat)
  5227. //// var res ResultSeventeen
  5228. //// if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  5229. //// utils.ErrorLog("解析失败:%v", err)
  5230. //// //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  5231. //// errlog := &models.HisOrderError{
  5232. //// UserOrgId: org_id,
  5233. //// Ctime: time.Now().Unix(),
  5234. //// Mtime: time.Now().Unix(),
  5235. //// ErrMsg: res.ErrMsg + "解析失败",
  5236. //// Status: 1,
  5237. //// PatientId: order_id,
  5238. //// Stage: 120,
  5239. //// }
  5240. //// service.CreateErrMsgLog(errlog)
  5241. //// continue
  5242. //// }
  5243. ////
  5244. //// if res.Infcode != 0 {
  5245. //// errlog := &models.HisOrderError{
  5246. //// UserOrgId: org_id,
  5247. //// Ctime: time.Now().Unix(),
  5248. //// Mtime: time.Now().Unix(),
  5249. //// ErrMsg: res.ErrMsg,
  5250. //// Status: 1,
  5251. //// PatientId: order_id,
  5252. //// Stage: 200,
  5253. //// }
  5254. //// service.CreateErrMsgLog(errlog)
  5255. //// continue
  5256. //// } else {
  5257. //// hisFundSettleListResult := &models.HisFundSettleListResult{
  5258. //// Number: res.Output.SetlListId,
  5259. //// Status: 1,
  5260. //// Ctime: time.Now().Unix(),
  5261. //// Mtime: time.Now().Unix(),
  5262. //// UserOrgId: org_id,
  5263. //// IsUpload: 1,
  5264. //// OrderId: order_id,
  5265. //// }
  5266. //// service.CreateUploadRecord(hisFundSettleListResult)
  5267. //// continue
  5268. //// }
  5269. //// }
  5270. ////}
  5271. //
  5272. ////func CreateLog(miConfig models.MedicalInsuranceOrgConfig) {
  5273. //// Mkdir(miConfig.OrgName + "日志")
  5274. //// //org_id,_ := beego.AppConfig.Int("org_id")
  5275. //// month := time.Unix(1557042972, 0).Format("1")
  5276. //// year := time.Now().Format("2006")
  5277. //// month = time.Now().Format("01")
  5278. //// day := time.Now().Format("02")
  5279. //// file := strconv.FormatInt(miConfig.UserOrgId, 10) + "_" + year + month + day + "_log"
  5280. //// file_name := file + ".txt"
  5281. //// file_path := miConfig.OrgName + "日志" + "/" + file_name
  5282. //// exist, _ := PathExists(file_path)
  5283. //// if exist { //存在
  5284. //// fmt.Println("存在")
  5285. //// f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  5286. //// if err != nil {
  5287. //// fmt.Println("read fail")
  5288. //// }
  5289. //// content := "\r\r\r"
  5290. //// n, _ := f.Seek(0, 2)
  5291. //// _, err = f.WriteAt([]byte(content), n)
  5292. ////
  5293. //// } else { //不存在
  5294. //// fmt.Println("文件不存在,创建文件")
  5295. //// f, err := os.Create(miConfig.OrgName + "日志" + "/" + file_name)
  5296. //// defer f.Close()
  5297. //// if err != nil {
  5298. //// } else {
  5299. //// _, err = f.Write([]byte("记录日志"))
  5300. //// }
  5301. //// }
  5302. ////
  5303. ////}
  5304. //
  5305. ////func UploadLog(miConfig models.MedicalInsuranceOrgConfig) {
  5306. //// //获取七牛云上的文件信息,不存在则表示没上传到七牛云,上传昨天日志信息
  5307. //// nTime := time.Now()
  5308. //// yesTime := nTime.AddDate(0, 0, -1)
  5309. //// file_key := strconv.FormatInt(miConfig.UserOrgId, 10) + "_" + yesTime.Format("20060102") + "_log.txt"
  5310. //// mac := qbox.NewMac(beego.AppConfig.String("qiniu_accesskey"), beego.AppConfig.String("qiniu_secretkey"))
  5311. //// cfg := storage.Config{
  5312. //// // 是否使用https域名进行资源管理
  5313. //// UseHTTPS: true,
  5314. //// }
  5315. //// // 指定空间所在的区域,如果不指定将自动探测
  5316. //// // 如果没有特殊需求,默认不需要指定
  5317. //// //cfg.Zone=&storage.ZoneHuabei
  5318. //// bucketManager := storage.NewBucketManager(mac, &cfg)
  5319. //// bucket := beego.AppConfig.String("qiniu_bucket")
  5320. //// key := file_key
  5321. //// file, sErr := bucketManager.Stat(bucket, key)
  5322. //// fmt.Println(file)
  5323. //// fmt.Println(sErr)
  5324. //// fmt.Println(miConfig.OrgName + "日志" + "/" + file_key)
  5325. ////
  5326. //// if sErr != nil {
  5327. //// fmt.Println("七牛云上文件不存在,上传到七牛云")
  5328. //// //判断本地文件是否存在,存在则执行上传操作
  5329. //// exist, _ := PathExists(miConfig.OrgName + "日志" + "/" + file_key)
  5330. //// if exist {
  5331. //// upload_qiniu(miConfig.OrgName+"日志"+"/"+file_key, file_key)
  5332. //// } else {
  5333. //// fmt.Println("本地文件不存在")
  5334. ////
  5335. //// }
  5336. //// } else {
  5337. //// fmt.Println("七牛云文件存在")
  5338. //// }
  5339. ////
  5340. ////}
  5341. ////func Mkdir(dir string) {
  5342. //// // 创建文件夹
  5343. //// exist, err := PathExists(dir)
  5344. //// if err != nil {
  5345. //// fmt.Println(err.Error())
  5346. //// } else {
  5347. //// if exist {
  5348. //// fmt.Println(dir + "文件夹已存在!")
  5349. //// } else {
  5350. //// // 文件夹名称,权限
  5351. //// err := os.Mkdir(dir, os.ModePerm)
  5352. //// if err != nil {
  5353. //// fmt.Println(dir+"文件夹创建失败:", err.Error())
  5354. //// } else {
  5355. //// fmt.Println(dir + "文件夹创建成功!")
  5356. //// }
  5357. //// }
  5358. //// }
  5359. ////}
  5360. ////func PathExists(path string) (bool, error) {
  5361. //// _, err := os.Stat(path)
  5362. //// if err == nil {
  5363. //// return true, nil
  5364. //// }
  5365. //// if os.IsNotExist(err) {
  5366. //// return false, nil
  5367. //// }
  5368. //// return false, err
  5369. ////}
  5370. //
  5371. ////func upload_qiniu(filePath string, keys string) {
  5372. //// key := keys
  5373. //// //上传凭证,关于凭证这块大家可以去看看官方文档
  5374. //// putPolicy := storage.PutPolicy{
  5375. //// Scope: beego.AppConfig.String("qiniu_bucket"),
  5376. //// }
  5377. //// mac := qbox.NewMac(beego.AppConfig.String("qiniu_accesskey"), beego.AppConfig.String("qiniu_secretkey"))
  5378. //// upToken := putPolicy.UploadToken(mac)
  5379. //// cfg := storage.Config{}
  5380. //// //空间对应机房
  5381. //// //其中关于Zone对象和机房的关系如下:
  5382. //// // 机房 Zone对象
  5383. //// // 华东 storage.ZoneHuadong
  5384. //// // 华北 storage.ZoneHuabei
  5385. //// // 华南 storage.ZoneHuanan
  5386. //// // 北美 storage.ZoneBeimei
  5387. //// //七牛云存储空间设置首页有存储区域
  5388. //// cfg.Zone = &storage.ZoneHuadong
  5389. //// //不启用HTTPS域名
  5390. //// cfg.UseHTTPS = false
  5391. //// //不使用CND加速
  5392. //// cfg.UseCdnDomains = false
  5393. //// //构建上传表单对象
  5394. //// formUploader := storage.NewFormUploader(&cfg)
  5395. //// ret := storage.PutRet{}
  5396. //// // 可选
  5397. //// putExtra := storage.PutExtra{
  5398. //// Params: map[string]string{},
  5399. //// }
  5400. //// err := formUploader.PutFile(context.Background(), &ret, upToken, key, filePath, &putExtra)
  5401. //// if err != nil {
  5402. //// fmt.Println(err)
  5403. //// return
  5404. //// }
  5405. //// fmt.Println(ret.Key, ret.Hash)
  5406. ////}