main.go 249KB

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