main.go 250KB

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