main.go 249KB

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