main.go 223KB

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