main.go 249KB

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