123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338 |
- //@ sourceURL=clinic.js
- //判断病人列表是否在加载中,防止重复加载
- var msg_list_loading = false;
- //挂号卡片列表页面下标
- var pageIndex = 0;
- //药品使用方法,天数和频次的集合
- var groupIdMap = null;
- var LODOP; //声明为全局变量
- //默认打印机下标
- var printIndex = -1;
- //当前光标点击的元素ID
- var currentEleId = null;
- $(function () {
- initGenderSelect();
- iniAdmissStatus();
- initListDeptSelect();
- initResponceTypeSelect();
- initTemplateTypeSelect();
- initTemplateKindTypeSelect('templateKindType');
- initZyClassTypeSelect();
- initInstructionSelect();
- setSelectSize();
- $('#editUserBirthDayGroup').datetimepicker({
- format: 'yyyy-mm-dd',
- language: 'zh-CN',
- minView: "month",
- });
- initDaterangepickerWithId('reportrange', "right");
- formatCheck();
- //数据校验
- init_validator();
- //初始频次下拉选
- initOrderFrequencys("orderFrequency", true);
- //初始用药方式下拉选
- initSupplyTypes();
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //加载已接诊患者列表
- loadClinicTableList();
- //每隔一分钟秒读加载候诊患者列表
- setInterval(function () {
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载已接诊患者列表 病人会缴费,需要刷新状态
- loadClinicTableList();
- }, 60000);
- //初始化快速接诊病人姓名栏事件
- initUserList();
- //初始化主诉弹出层
- initRecommendList();
- //卡号输入改变事件
- cardNoChange();
- /**
- * 患者信息修改
- */
- $("#saveEditUser").on("click", function (t) {
- modifyPatient();
- });
- // /**
- // * 保存入院证
- // */
- // $("#saveBeHospitalized").on("click", function (t) {
- // saveBeHospitalized();
- // });
- /**
- * 打印入院证
- */
- $("#printBeHospitalized").on("click", function (t) {
- modifyPatient();
- });
- //折叠按钮初始化
- $('.collapse-link').on('click', function () {
- var $BOX_PANEL = $(this).closest('.x_panel_mine'),
- $ICON = $(this).find('i'),
- $BOX_CONTENT = $BOX_PANEL.find('.x_content');
- // fix for some div with hardcoded fix class
- if ($BOX_PANEL.attr('style')) {
- $BOX_CONTENT.slideToggle(200, function () {
- $BOX_PANEL.removeAttr('style');
- });
- } else {
- $BOX_CONTENT.slideToggle(200);
- $BOX_PANEL.css('height', 'auto');
- }
- $ICON.toggleClass('fa-chevron-up fa-chevron-down');
- });
- /**
- * 接诊
- */
- $("#clinicalReception").on("click", function (t) {
- var patientIdDb = $("#patientIdDb").val();
- if (patientIdDb == null || patientIdDb == "") {
- errorMesageSimaple("当前未选择病人,无法接诊");
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzfzPatientOrderByPatientId?patientId=' + patientIdDb,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- if (res.data.length == 1) {
- //快速接诊的时候不知道分诊号
- clinicalReception(patientIdDb, res.data[0].serialNo);
- } else {
- $("#mzfzPatientOrderModal").modal();
- $("#mzfzPatientOrderTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- var roomCode = res.data[i].roomCode;
- if (roomCode == null || roomCode == "null") {
- roomCode = "";
- }
- $("<tr data-target='" + res.data[i].serialNo + "'><td>" + res.data[i].patientId + "</td><td>" + res.data[i].name + "</td><td>" + res.data[i].deptCode + "</td><td>" + res.data[i].doctorCode + "</td><td>" + roomCode + "</td></tr>").appendTo("#mzfzPatientOrderTable").bind('click', function () {
- $("#mzfzPatientOrderModal").modal("hide");
- clinicalReception(patientIdDb, $(this).attr("data-target"));
- });
- }
- }
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- } else {
- errorMesageSimaple("当前病人没有分诊信息");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- });
- /**
- * 存为范本
- */
- $("#saveapidAccepts").on("click", function (t) {
- var symptom = $("#symptom").val();
- if (symptom == null || symptom == "") {
- errorMesageSimaple("主诉不能为空!");
- return;
- }
- var emrHpi = $("#emrHpi").val();
- if (emrHpi == null || emrHpi == "") {
- errorMesageSimaple("现病史不能为空!");
- return;
- }
- var diagnoseValue = $("#diagnoseValue").val();
- var tentativeDiagnosis = $("#tentativeDiagnosis").val();
- if (diagnoseValue != null) {
- var reg = new RegExp(',', "g")
- diagnoseValue = diagnoseValue.replace(reg, '');
- }
- if ((diagnoseValue == null || diagnoseValue == "") && (tentativeDiagnosis == null || tentativeDiagnosis == "")) {
- errorMesageSimaple("诊断和初步诊断不能同时为空!");
- return;
- }
- $("#saveapidAcceptsModal").modal("show");
- });
- /**
- * 实例化智能问诊弹窗
- */
- // $("[data-toggle='popover']").popover();
- $("#box-arrow-left").popover({
- html: 'true',
- content: '<div id="smartAssistPopoverContent"></div>'
- });
- //初始化药品分组下拉选
- initGroupOrder();
- // 初始化用药天数下拉选
- initDayNum();
- //页面加载完成初始化西药处方
- //initNavTabs(0);
- //页面加载完成初始化住院处方
- //initNavTabs(3);
- //初始医生工作太配置
- initWorkspaceConfigForCurrent();
- initExecUnit();
- /**
- * 西药点击事件
- */
- $("#western_medicine_name").on("click", function (t) {
- var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#western_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0);
- });
- /**
- * 中药点击事件
- */
- $("#chinese_medicine_name").on("click", function (t) {
- var obj = $("#chineseMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#chinese_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#chinese_medicine_name').webuiPopover('show');
- loadYpList(1);
- });
- /**
- * 项目点击事件
- */
- $("#jcJyItem").on("click", function (t) {
- if ($("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
- $('#jcJyItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList();
- });
- initYshPart();
- initJyZdSample();
- setTimeout(function () {
- getLodop();
- }, 800);
- //键盘监听回车键
- $(document).keyup(function (event) {
- if (event.keyCode == 13) { //是否是回车
- //var el = event.srcElement || event.target;
- if (currentEleId == 'zy_drugWin') {
- $("#zyInstruction").next().click();
- currentEleId = 'zyInstruction';
- } else if (currentEleId == 'zyInstruction') {
- saveMedicine(1);
- currentEleId = 'saveChineseMedicine';
- } else if (currentEleId == 'saveChineseMedicine') {
- $("input.zyfs").focus();
- currentEleId = 'zyfs';
- } else if (currentEleId == 'zyfs') {
- $("#zy_orderFrequency_1").next().click();
- currentEleId = 'zy_orderFrequency_1';
- } else if (currentEleId == 'zy_orderFrequency_1') {
- $("#useType_1").next().click();
- currentEleId = 'useType_1';
- } else if (currentEleId == 'useType_1') {
- $("#cyJssm").next().click();
- currentEleId = 'cyJssm';
- } else if (currentEleId == 'cyJssm') {
- $("#zy_supplyType_1").next().click();
- currentEleId = 'zy_supplyType_1';
- } else if (currentEleId == 'zy_supplyType_1') {
- $("#chinese_medicine_name").focus();
- $("#chinese_medicine_name").click();
- currentEleId = 'chinese_medicine_name';
- } else if (currentEleId == 'supplyType') {
- $("#drugWinUnit").next().click();
- currentEleId = 'drugWinUnit';
- } else if (currentEleId == 'drugWinUnit') {
- $("#drugWin").focus();
- currentEleId = 'drugWin';
- } else if (currentEleId == 'drugWin') {
- $("#dayNum").next().click();
- currentEleId = 'dayNum';
- } else if (currentEleId == 'dayNum') {
- $("#orderFrequency").next().click();
- currentEleId = 'orderFrequency';
- } else if (currentEleId == 'orderFrequency') {
- $("#packUnit").next().click();
- currentEleId = 'packUnit';
- } else if (currentEleId == 'packUnit') {
- $("#medicalAdvice").next().click();
- currentEleId = 'medicalAdvice';
- } else if (currentEleId == 'medicalAdvice') {
- saveMedicine(0);
- currentEleId = 'saveWesternMedicine';
- } else if (currentEleId == 'saveWesternMedicine') {
- $("#western_medicine_name").focus();
- $("#western_medicine_name").click();
- currentEleId = 'western_medicine_name';
- }
- else if (currentEleId == 'chargeUnit') {
- $("#itemQuantity").focus();
- currentEleId = 'itemQuantity';
- } else if (currentEleId == 'itemQuantity' || currentEleId == 'jyZdSample' || currentEleId == 'yshPart') {
- $("#execUnit").next().click();
- currentEleId = 'execUnit';
- } else if (currentEleId == 'execUnit') {
- $("#remark").focus();
- currentEleId = 'remark';
- } else if (currentEleId == 'remark') {
- saveJyJcItem(true);
- currentEleId = 'saveJyJcItem';
- } else if (currentEleId == 'saveJyJcItem') {
- $("#jcJyItem").focus();
- $("#jcJyItem").click();
- currentEleId = 'jcJyItem';
- }
- else if (currentEleId == 'freeBedNum') {
- $("#inpatientWardBeHospitalized").next().click();
- currentEleId = 'inpatientWardBeHospitalized';
- } else if (currentEleId == 'inpatientWardBeHospitalized') {
- $("#smallWardBeHospitalized").next().click();
- currentEleId = 'smallWardBeHospitalized';
- } else if (currentEleId == 'smallWardBeHospitalized') {
- $("#admissStatus").next().click();
- currentEleId = 'admissStatus';
- } else if (currentEleId == 'admissStatus') {
- saveZyReq(true);
- currentEleId = "freeBedNum";
- }
- }
- });
- /*
- //加载打印设置功能模块
- $("[data-toggle='PRINT_SETUP']").each(function() {
- var element = $(this);
- element.popover({
- trigger: 'manual',
- html: true,
- placement: 'top',
- width:50,
- content: function() {
- return content();
- }
- }).on("mouseenter", function() {
- var _this = this;
- $(this).popover("show");
- $(this).siblings(".popover").on("mouseleave", function() {
- $(_this).popover('hide');
- });
- }).on("mouseleave", function() {
- var _this = this;
- setTimeout(function() {
- if(!$(".popover:hover").length) {
- $(_this).popover("hide")
- }
- }, 100);
- });
- });
- */
- });
- // //模拟动态加载内容(真实情况可能会跟后台进行ajax交互)
- // function content() {
- // var data = $('<button type="button" class="btn btn-primary " onclick="test()" >打印设置</button>');
- // return data;
- // }
- // //模拟悬浮框里面的按钮点击操作
- // function test() {
- // alert('关注成功');
- // }
- /**
- * 打开配置页面
- */
- function configWorkspaceModal() {
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("show");
- }
- /**
- * 初始化用药天数下拉选
- */
- function initDayNum() {
- var html = '';
- for (var i = 1; i <= 31; i++) {
- html += '<option value="' + i + '">' + i + '</option>';
- }
- $('#dayNum').html(html);
- $('#dayNum').selectpicker('refresh');
- }
- /**
- * 初始化药品分组下拉选
- */
- function initGroupOrder() {
- var html = '<option value="1">1</option>';
- $('#groupId').html(html);
- $('#groupId').selectpicker('refresh');
- $("#groupId").selectpicker('val', 1);
- $('#groupId').selectpicker('refresh');
- groupIdMap = new Map();
- }
- /**
- * 追加分组
- */
- function appendGroupOrder() {
- var last = parseInt($("#groupId > option:last").val());
- last++;
- var html = '<option value="' + last + '">' + last + '</option>';
- $('#groupId').append(html);
- $('#groupId').selectpicker('refresh');
- }
- /**
- * 组号改变事件
- */
- function groupIdChange() {
- var last = parseInt($("#groupId > option:last").val());
- var groupId = $("#groupId").val();
- if (groupId == last) {
- //是新增药品清空药品输入区域
- var updateFlag = $("#update_flag").val();
- var currentCode = $("#current_code").val();
- //当前时新增药品,而且没有选择药品的时候,组号变更,清空区域
- if ((updateFlag == undefined || updateFlag == null || updateFlag == "false" || updateFlag == false) && (currentCode == null || currentCode == "")) {
- clearWesternMedicine(true);
- }
- } else {
- var map = groupIdMap.get(groupId);
- if (map != null) {
- var supplyType = map.get("supplyType");
- var orderFrequency = map.get("orderFrequency");
- var dayNum = map.get("dayNum");
- //用法编码
- $("#supplyType").selectpicker('val', supplyType);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").attr("disabled", "disabled");
- //天数
- $("#dayNum").selectpicker('val', dayNum);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").attr("disabled", "disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', orderFrequency);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").attr("disabled", "disabled");
- }
- }
- }
- /**
- * 关闭智能问诊弹框
- */
- function closePopover() {
- //$(".popover").popover('hide');
- $("#box-arrow-left").click();
- }
- /**
- * 加载智能问诊弹框内容
- */
- function contentMethod() {
- setTimeout(function () {
- $(".popover div.arrow").css("display", "none");
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (popoverId == undefined) {
- return;
- }
- var left = $("#" + popoverId).css("left");
- left = left.replace("px", "");
- left = parseInt(left);
- left = left + 55;
- $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
- $("#" + popoverId + " .popover-content").css("height", "100%");
- $("#smartAssistPopoverContent").css("height", "100%");
- var html = ' <div style="height: 34%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' <span id="patientHisData"></span>就医轨迹' +
- ' </button>' +
- ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
- ' </button>' +
- ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 33%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
- ' class="btn btn-primary">' +
- ' <span id="recommendType"></span>推荐' +
- ' </button>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
- ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 33%;padding-left: 15px;width: 100%;">' +
- ' <button type="button"' +
- ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' 医疗范本' +
- ' </button>' +
- ' <div class="item" style="width: 230px;height: 35px;float: right;line-height: 35px;margin-right: 40px;">' +
- ' <label class="control-label col-md-4 col-sm-4 col-xs-12" for="templateKindTypeForm">范文类型' +
- ' </label>' +
- ' <div class="col-md-8 col-sm-8 col-xs-12">' +
- ' <select class="form-control selectpicker show-tick" title="请选择" onchange="fitTemplateData()"' +
- ' id="templateKindTypeForm">' +
- ' </select>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;position: relative;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;" id="TemplateData">' +
- ' </form>' +
- ' </div>' +
- ' </div>';
- $("#smartAssistPopoverContent").html(html);
- initTemplateKindTypeSelect('templateKindTypeForm');
- fitPatientHisData();
- fitSymptomData();
- fitEmrHpiData();
- fitEmrPsData();
- fitDiagnoseData();
- fitTemplateData();
- }, 100);
- // setTimeout(function () {
- // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
- // },1000);
- }
- /**
- * 设置患者的就诊轨迹
- */
- function fitPatientHisData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- return;
- }
- var patientId = $("#patientId").text();
- if (patientId == null || patientId == "") {
- patientId = $("#userName").val();
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": patientId,
- //"clinicStatuses": [5, 6],
- "clinicStatuses": [6],
- "pageSize": 10000,
- "offset": 0,
- "beginDate": "2012-02-01 00:00:00",
- "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss"),
- "doctorCode": "-1"
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var icdText = data[i].icdText;
- if (icdText == null) {
- // continue;
- icdText = "空白诊断";
- }
- icdText = icdText.trim();
- html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
- html += ' <div style="float: left;width: 172px;">';
- html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
- html += ' </div>';
- html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
- html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- var patientName = $("#patientName").text();
- if ((patientName == null || patientName == "") && res.mzPatientMi != null) {
- patientName = res.mzPatientMi.name;
- }
- $("#patientHisData").text(patientName + "的");
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- } else {
- $("#patientHisDataForm").html(html);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置主诉推荐
- */
- function fitSymptomData() {
- fitRecommendData(12);
- }
- /**
- * 设置现病史推荐
- */
- function fitEmrHpiData() {
- fitRecommendData(5);
- }
- /**
- * 设置既往史推荐
- */
- function fitEmrPsData() {
- fitRecommendData(6);
- }
- /**
- * 设置诊断推荐
- */
- function fitDiagnoseData() {
- fitRecommendData(13);
- }
- /**
- * 设置推荐通用方法
- */
- function fitRecommendData(paramsType) {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var inputId = "symptom";
- var text = "主诉";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史";
- } else if (paramsType == 13) {
- inputId = "diagnose";
- text = "诊断";
- }
- //光标不在现病史上
- if (document.activeElement.id != inputId) {
- return;
- }
- $("#recommendType").html(text);
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var paramsContent = data[i].paramsContent;
- html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
- html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
- html += paramsContent;
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;"';
- html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ',' + data[i].id + ')">';
- html += ' <img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#recommendForm").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置医疗范文方法
- */
- function fitTemplateData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;margin-left: 145px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplate?templateKindType=' + $("#templateKindTypeForm").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var template = data[i];
- html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
- html += ' <div title="' + template.name + '"';
- html += ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">';
- html += template.name;
- html += ' </div>';
- html += ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"';
- html += ' title="' + template.icdText + '">诊断:<a';
- html += ' style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="medicalModelModal(' + template.id + ')">' + template.icdText + '</a>';
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(' + template.id + ')"><img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#TemplateData").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空快速接诊弹窗
- */
- function clearRapidAcceptsModal() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- }
- /**
- * 清空接诊台用户信息
- * @param flag 是否清空分诊流水哈 true 清空
- */
- function clearUser(flag) {
- $("#patientName").html("");
- $("#patientAge").html("");
- $("#patientGender").html("");
- $("#patientId").text(null);
- $("#editUser").css("display", "none");
- $("#clearUser").css("display", "none");
- $("#patientPhone").html("");
- $("#patientPhoneLabel").hide();
- $("#patientResponseType").html("");
- $("#first").next().click();
- $("#patientHisData").text("");
- if (flag) {
- $("#mzfzSerialNoInClick").val(null);
- }
- }
- /**
- * 卡号输入改变事件
- */
- function cardNoChange() {
- if (window.ActiveXObject || "ActiveXObject" in window) {
- $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
- queryUserInfoByCardNo();
- });
- } else {
- $("#rapidAcceptsUserCardNo").on('input οninput', function () {
- queryUserInfoByCardNo();
- });
- }
- }
- /**
- * 刷新就诊列表
- */
- function refreshClinic() {
- loadInClinicTableList();
- loadClinicTableList();
- }
- /**
- * 加载已接诊患者列表
- */
- function loadClinicTableList() {
- //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
- loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
- }
- /**
- * 加载患者列表通用方法
- * @param id
- * @param queryParams
- */
- function loadCommonClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'patientName',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'opDay',
- title: '接诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.clinicStatus == 5) {
- return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- // return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- } else if (row.clinicStatus == 6) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',0)">详情</a>';
- } else if (row.clinicStatus == 7) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',1)">详情</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- if (id == "tb_table_clinic") {
- $("#ClinicNum").html(data.total);
- } else {
- $("#inClinicNum").html(data.total);
- }
- }
- });
- }
- /**
- * 得到查询的参数 接诊中
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsInClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [8]
- };
- return temp;
- };
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsClinic(params) {
- var rePortRangeArr = getRePortRangeArr();
- var temp = {
- beginDate: rePortRangeArr[0],
- endDate: rePortRangeArr[1],
- commonParams: $("#userName").val(),
- clinicStatuses: [5, 6, 7],
- pageSize: params.limit,
- offset: params.offset
- };
- return temp;
- };
- /**
- * 加载待诊患者列表方法
- */
- function loadUnClinicTableList() {
- loadCanClinicTableList("tb_table_un_clinic", queryParamsUnClinic);
- }
- /**
- * 加载接诊中患者列表方法
- */
- function loadInClinicTableList() {
- loadCanClinicTableList("tb_table_in_clinic", queryParamsInClinic);
- }
- /**
- * 加载待诊和接诊中患者列表通用方法方法
- */
- function loadCanClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'name',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'visitDate',
- title: '分诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.statusFlag == 0) {
- return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
- } else if (row.statusFlag == 8) {
- //TODO 继续接诊需要新方法
- return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">继续接诊</a>';
- } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
- return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a> <a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- $("#unClinicNum").html(data.total);
- }
- });
- }
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsUnClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [0, 1, 2, 3]
- };
- return temp;
- };
- /**
- * 通知叫号
- * @param serialNo
- */
- function clinicCallNumber(serialNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/clinicCallNumber?serialNo=' + serialNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 接诊方法
- * @param patientId 门诊id
- * @param serialNo 分诊流水号
- */
- function clinicalReception(patientId, serialNo) {
- var existPatientId = $("#patientId").text();
- if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
- $("#messageModal").modal();
- $("#messageContent").html("当前有病人正在接诊,是否切换?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- realClinicalReception(patientId, serialNo);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- clearWorkSpace();
- realClinicalReception(patientId, serialNo);
- });
- });
- } else {
- realClinicalReception(patientId, serialNo);
- }
- }
- /**
- * 设置当前接诊病人信息
- * @param mzPatientMi
- */
- function setMzPatientInfo(mzPatientMi) {
- $("#patientName").html(mzPatientMi.name);
- $("#patientAge").html(mzPatientMi.age);
- $("#patientGender").html(mzPatientMi.gender);
- $("#patientId").text(mzPatientMi.patientId);
- $("#editUser").css("display", "inline-block");
- $("#clearUser").css("display", "inline-block");
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
- $("#patientPhone").html(mzPatientMi.phoneNo);
- $("#patientPhoneLabel").show();
- } else {
- $("#patientPhoneLabel").hide();
- }
- $("#patientResponseType").html(mzPatientMi.responseTypeName);
- if (mzPatientMi.times == 1) {
- $("#first").next().click();
- } else {
- $("#not").next().click();
- }
- $("#patientHisData").text(mzPatientMi.name);
- fitPatientHisData();
- }
- /**
- * 真实的接诊方法
- * @param patientId
- * @param serialNo 分诊流水号
- */
- function realClinicalReception(patientId, serialNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- var mzPatientMi = res.data;
- setMzPatientInfo(mzPatientMi);
- $("#mzfzSerialNoInClick").val(serialNo);
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空工作台
- */
- function clearWorkSpace() {
- clearUser(true);
- clearWorkSpaceExcludeUser();
- }
- /**
- * 清空工作台除了用户信息
- */
- function clearWorkSpaceExcludeUser() {
- $("#symptom").val(null);
- $("#emrHpi").val(null);
- $("#emrPs").val(null);
- $("#personalHistory").val(null);
- $("#familyHistory").val(null);
- $("#obstericalHistory").val(null);
- $("#weight").val(null);
- $("#temperature").val(null);
- $("#sphygmus").val(null);
- $("#breathe").val(null);
- $("#pressure_high").val(null);
- $("#pressure_floor").val(null);
- $("#pressure_high_left").val(null);
- $("#pressure_floor_left").val(null);
- $("#tentativeDiagnosis").val(null);
- $("#otherCheck").val(null);
- $("#diagnoseValue").val(null);
- $("#diagnoseTags").html(null);
- $("#healthEducation").html(null);
- clearWesternMedicine(true);
- clearChineseMedicine();
- clearJyJcItem();
- clearZyReq();
- //initNavTabs(0);
- clearNavTabs(0);
- clearNavTabs(1);
- clearNavTabs(2);
- clearNavTabs(3);
- clearApidAcceptsModal();
- $("#totalAmount").text(0);
- }
- /**
- * 医疗范文详情预览
- * @param id
- */
- function medicalModelModal(id) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateById?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- $("#vmedicalModelName").text(res.data.name);
- $("#idTemplate").val(res.data.id);
- $("#zsTemplate").html(jsonData.mzBlRecord.emrChiefComplaint);
- $("#xbsTemplate").html(jsonData.mzBlRecord.emrHpi);
- var icdText = res.data.icdText;
- $("#zdTemplate").html("");
- $("#xyzlContent").html("");
- $("#zyzlContent").html("");
- $("#zlyjContent").html("");
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#zdTemplate").html(html);
- }
- var emrProcess = jsonData.mzBlRecord.emrProcess;
- if (emrProcess != null) {
- var xy = null;
- if (emrProcess.indexOf("西药治疗:") >= 0) {
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
- } else if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("医技与诊疗:"));
- } else {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
- }
- var arr = xy.split("_");
- if (arr != null && arr.length > 0) {
- var xyhtml = "";
- for (var i = 0; i < arr.length; i++) {
- xyhtml += "<div>";
- xyhtml += arr[i];
- xyhtml += "</div>";
- }
- $("#xyzlContent").html(xyhtml);
- $("#xyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#xyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#xyzlTitle").removeClass("in").addClass("hide");
- }
- var zy = null;
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("医技与诊疗:"));
- } else {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
- }
- var zyArr = zy.split("_");
- if (zyArr != null && zyArr.length > 0) {
- var zyhtml = "";
- for (var i = 1; i < zyArr.length; i++) {
- zyhtml += "<div>";
- zyhtml += zyArr[i];
- zyhtml += "</div>";
- }
- var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
- if (zyfs != null && zyfs != "") {
- zyhtml += " <div>";
- zyhtml += ' <div style="text-indent: 2em;">';
- zyhtml += ' <div>';
- zyhtml += 'x<span>';
- zyhtml += zyfs;
- zyhtml += '</span> 付</div></div></div>';
- }
- $("#zyzlContent").html(zyhtml);
- $("#zyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- var zlyj = emrProcess.substring(emrProcess.indexOf("医技与诊疗:") + 6);
- var zlyjArr = zlyj.split("_");
- if (zlyjArr != null && zlyjArr.length > 0) {
- var zlyjhtml = "";
- for (var i = 0; i < zlyjArr.length; i++) {
- zlyjhtml += "<div>";
- zlyjhtml += zlyjArr[i];
- zlyjhtml += "</div>";
- }
- $("#zlyjContent").html(zlyjhtml);
- $("#zlyjTitle").removeClass("hide").addClass("in");
- } else {
- $("#zlyjTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#zlyjTitle").removeClass("in").addClass("hide");
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- $("#medicalModelModal").modal();
- }
- /**
- * 诊疗项目回写
- * @param code
- * @param mzChargeDetail
- */
- function callBackZlDetail(code, mzChargeDetail) {
- //诊疗项目
- $.ajax({
- type: "GET",
- url: '/thmz/getJcJyItemByCommonParams?commonParams=' + code,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- //如果
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(2);
- }
- var row = res.data[0];
- $("#jcJyItem").val(row.name);
- $("#jcJyItem").blur();
- $("#jcjyItemPrice").val(row.chargeAmount);
- $("#chargeUnit").val(row.specification);
- $("#current_code").val(row.code);
- $("#remark").val(mzChargeDetail.instructionText);
- $("#jcJyZltype").val(row.type);
- if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
- $("#execUnit").selectpicker('val', mzChargeDetail.execDept);
- $('#execUnit').selectpicker('refresh');
- }
- $("#itemQuantity").val(mzChargeDetail.quantity);
- saveJyJcItem(false);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方回写
- * @param jsonData 处方数据
- * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
- */
- function editPrescription(jsonData, type) {
- var firstOrNot = jsonData.firstOrNot;
- var conciseRecordsFlagYlfw = $("#conciseRecordsYlfw").parent().hasClass("checked");
- var prescriptionSubsidiaryFlagYlfw = $("#prescriptionSubsidiaryYlfw").parent().hasClass("checked");
- var conciseRecordsFlagJzxq = $("#conciseRecordsJzxq").parent().hasClass("checked");
- var prescriptionSubsidiaryFlagJzxq = $("#prescriptionSubsidiaryJzxq").parent().hasClass("checked");
- if (firstOrNot == 0) {
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#not").next().click();
- }
- if (type == 0 || (type == 1 && conciseRecordsFlagYlfw == true) || (type == 2 && conciseRecordsFlagJzxq == true)) {
- $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
- $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
- $("#emrPs").val(jsonData.mzBlRecord.emrPs);
- $("#personalHistory").val(jsonData.mzBlRecord.personalHistory);
- $("#familyHistory").val(jsonData.mzBlRecord.familyHistory);
- $("#obstericalHistory").val(jsonData.mzBlRecord.obstericalHistory);
- $("#weight").val(jsonData.mzBlRecord.weight);
- $("#temperature").val(jsonData.mzBlRecord.temperature);
- $("#sphygmus").val(jsonData.mzBlRecord.sphygmus);
- $("#breathe").val(jsonData.mzBlRecord.breathe);
- $("#pressure_high").val(jsonData.mzBlRecord.pressureHigh);
- $("#pressure_floor").val(jsonData.mzBlRecord.pressureFloor);
- $("#pressure_high_left").val(jsonData.mzBlRecord.pressureHighLeft);
- $("#pressure_floor_left").val(jsonData.mzBlRecord.pressureFloorLeft);
- $("#tentativeDiagnosis").val(jsonData.mzBlRecord.tentativeDiagnosis);
- $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
- var icdCode = jsonData.icdCode;
- var icdText = jsonData.icdText;
- var icdCodeArr = icdCode != null ? icdCode.split(",") : null;
- var icdTextArr = icdText != null ? icdText.split(",") : null;
- if (icdCodeArr != null && icdCodeArr.length > 0 && icdTextArr != null && icdTextArr.length > 0) {
- for (var i = 0; i < icdCodeArr.length; i++) {
- fitDiagnoseValue(icdTextArr[i], icdCodeArr[i]);
- }
- }
- $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
- }
- if (type == 0 || (type == 1 && prescriptionSubsidiaryFlagYlfw == true) || (type == 2 && prescriptionSubsidiaryFlagJzxq == true)) {
- var mzChargeDetailList = jsonData.mzChargeDetailList;
- var mzZyReq = jsonData.mzZyReq;
- //中药的公共参数是否已经设置了
- var hadSetZyFullParams = false;
- //西药,成药,医材,麻精,中药,诊疗
- if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
- for (var i = 0; i < mzChargeDetailList.length; i++) {
- var mzChargeDetail = mzChargeDetailList[i];
- var groupNo = mzChargeDetail.groupNo;
- var code = mzChargeDetail.chargeItemCode;
- var serial = mzChargeDetail.serial;
- if (groupNo == "00") {
- callBackZlDetail(code, mzChargeDetail);
- } else if (groupNo == "71" || groupNo == "91" || groupNo == "111" || groupNo == "131") {
- // 71 西成药 91 医材 111 精一 131 精二
- $("#groupId").selectpicker('val', mzChargeDetail.groupOrder);
- $('#groupId').selectpicker('refresh');
- checkYpInfo(code, serial, groupNo, false);
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
- $('#supplyType').selectpicker('refresh');
- $("#drugWin").val(mzChargeDetail.drugQuan);
- $("#drugWinUnit").selectpicker('val', mzChargeDetail.drugUnit);
- $('#drugWinUnit').selectpicker('refresh');
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', mzChargeDetail.orderDays);
- $('#dayNum').selectpicker('refresh');
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', mzChargeDetail.frequency);
- $('#orderFrequency').selectpicker('refresh');
- if (mzChargeDetail.tryFlag == 1 || mzChargeDetail.tryFlag == "1") {
- $("#tryFlag").parent().addClass("checked");
- } else {
- $("#tryFlag").parent().removeClass("checked");
- }
- $("#gross").val(mzChargeDetail.quantity);
- $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()).toFixed(2));
- $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
- $('#medicalAdvice').selectpicker('refresh');
- saveWesternMedicine(false);
- } else {
- //中药与颗粒剂
- checkZyInfo(code, serial, false);
- //类型
- $("#zyClassType").selectpicker('val', groupNo);
- $('#zyClassType').selectpicker('refresh');
- $("#zy_drugWin").val(mzChargeDetail.quantity);
- $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
- $('#zyInstruction').selectpicker('refresh');
- saveChineseMedicine(false);
- if (!hadSetZyFullParams) {
- hadSetZyFullParams = true;
- $("input.zyfs").val(mzChargeDetail.drugWin);
- $("#zy_orderFrequency_1").selectpicker('val', mzChargeDetail.frequency);
- $('#zy_orderFrequency_1').selectpicker('refresh');
- $("#useType_1").selectpicker('val', mzChargeDetail.cyFysm);
- $('#useType_1').selectpicker('refresh');
- $("#cyJssm").selectpicker('val', mzChargeDetail.cyJssm);
- $('#cyJssm').selectpicker('refresh');
- $("#zy_supplyType_1").selectpicker('val', mzChargeDetail.cyDj);
- $('#zy_supplyType_1').selectpicker('refresh');
- }
- }
- }
- }
- //检验与检查
- var mzYjReqList = jsonData.mzYjReqList;
- if (mzYjReqList != null && mzYjReqList.length > 0) {
- for (var i = 0; i < mzYjReqList.length; i++) {
- var mzYjReq = mzYjReqList[i];
- var code = mzYjReq.orderCode;
- var jcJyZltype = null;
- if (mzYjReq.reqType == 2) {
- jcJyZltype = 1;
- $("#jyZdSample").selectpicker('val', mzYjReq.inspectStuff);
- $('#jyZdSample').selectpicker('refresh');
- } else if (mzYjReq.reqType == 3) {
- jcJyZltype = 2;
- $("#yshPart").selectpicker('val', mzYjReq.inspectPart);
- $('#yshPart').selectpicker('refresh');
- }
- $("#jcJyZltype").val(jcJyZltype);
- checkJcJyItemInfo(code, null, jcJyZltype, false);
- $("#remark").val(mzYjReq.jyRemark);
- if (mzYjReq.execDept != null && mzYjReq.execDept != "") {
- $("#execUnit").selectpicker('val', mzYjReq.execDept);
- $('#execUnit').selectpicker('refresh');
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- saveJyJcItem(false);
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- }
- }
- //入院证
- if (mzZyReq != null && mzZyReq.reqDept != null && mzZyReq.reqDept != "") {
- $("#inpatientWardBeHospitalized").selectpicker('val', mzZyReq.reqDept);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- $("#admissStatus").selectpicker('val', mzZyReq.admissStatus);
- $('#admissStatus').selectpicker('refresh');
- setTimeout(function () {
- $("#smallWardBeHospitalized").selectpicker('val', mzZyReq.smallDept);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- saveZyReq(false);
- }, 500);
- }
- }
- //设置总金额
- calculateTotalAmount();
- }
- /**
- * 调用医疗范文
- */
- function callTemplate() {
- clearWorkSpaceExcludeUser();
- $.ajax({
- type: "GET",
- url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- editPrescription(jsonData, 1);
- $("#templateId").val(res.data.id);
- $("#templateName").val(res.data.name);
- $("#templateKindType").selectpicker('val', res.data.templateKindType);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', res.data.templateType);
- $("#templateType").selectpicker('refresh');
- $("#medicalModelModal").modal("hide");
- closePopover();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 底层填充推荐方法
- * @param paramsType
- * @param appeal
- * @param inputId
- */
- function extracted(paramsType, appeal, inputId) {
- if (paramsType == 13) {
- var contentArr = appeal.split(",");
- if (contentArr != null && contentArr.length > 0) {
- for (var i = 0; i < contentArr.length; i++) {
- var content = contentArr[i].replace(")", "").replace("(", "-");
- var diagnoseArr = content.split("-");
- if (diagnoseArr == null || diagnoseArr.length == 0) {
- continue;
- }
- fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
- }
- }
- } else {
- $("#" + inputId).val(appeal);
- }
- }
- /**
- * 填充推荐
- * @param appeal
- * @param paramsType
- * @param id
- */
- function fitAppeal(appeal, paramsType, id) {
- var inputId = "symptom";
- var text = "主诉项已经录入,是否覆盖?";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史项已经录入,是否覆盖?";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史项已经录入,是否覆盖?";
- } else if (paramsType == 13) {
- inputId = "diagnoseValue";
- text = "诊断项已经录入,是否覆盖?";
- }
- var symptom = $("#" + inputId).val();
- if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
- symptom = null;
- }
- if (symptom != null && symptom != "") {
- $("#messageModal").modal();
- $("#messageContent").html(text);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- if (paramsType == 13) {
- $("#" + inputId).val(null);
- $("#diagnoseTags").html(null);
- }
- extracted(paramsType, appeal, inputId);
- });
- } else {
- extracted(paramsType, appeal, inputId);
- }
- $.ajax({
- type: "GET",
- url: '/thmz/increaseTcCommonParamsNumber?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- }
- });
- }
- /**
- * 初始嘱托下拉选
- */
- function initInstructionSelect() {
- //西药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=0',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText + '</option>';
- $('#medicalAdvice').append(html);
- });
- $('#medicalAdvice').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- //中药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=1',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText.trim() + '</option>';
- $('#zyInstruction').append(html);
- });
- $('#zyInstruction').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置下拉选的尺寸
- */
- function setSelectSize() {
- $(".selectpicker").selectpicker({
- dropuAuto: false,
- size: 10
- });
- //$('#icdCodeBeHospitalized').parent().addClass("hide");
- }
- /**
- * 初始化性别下拉选
- */
- function initGenderSelect() {
- var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
- $('#rapidAcceptsUserGender').html(gender);
- $('#rapidAcceptsUserGender').selectpicker('refresh');
- $('#editUserGender').html(gender);
- $('#editUserGender').selectpicker('refresh');
- //医疗范文状态
- var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
- $('#templateStatus').html(templateStatus);
- $('#templateStatus').selectpicker('refresh');
- }
- /**
- * 初始化中药类型下拉选
- */
- function initZyClassTypeSelect() {
- var gender = '<option value="81">普通</option><option value="82">颗粒剂</option>';
- $('#zyClassType').html(gender);
- $('#zyClassType').selectpicker('refresh');
- //$('#zyClassType').selectpicker('val', "81");
- // $('#zyClassType').selectpicker('refresh');
- }
- /**
- * 初始化病人身份类别下拉选
- */
- function initResponceTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzResponceType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#patientsNature').append(html);
- $('#editUserPatientsNature').append(html);
- // $('#responeTypeBeHospitalized').append(html);
- });
- $('#patientsNature').selectpicker('refresh');
- $('#editUserPatientsNature').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 所有的入院状态
- */
- function iniAdmissStatus() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAdmissStatus',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#admissStatus').empty();
- $('#admissStatus').html(html);
- $('#admissStatus').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 入院登记的病区列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allInpatientWard',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#inpatientWardBeHospitalized').empty();
- $('#inpatientWardBeHospitalized').html(html);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- }
- });
- }
- /**
- * 小科室列表
- */
- function initSmallDeptByDept() {
- //小科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getSmallDeptByDept?code=' + $('#inpatientWardBeHospitalized').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#smallWardBeHospitalized').empty();
- $('#smallWardBeHospitalized').html(html);
- $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- }
- });
- //病床数
- $.ajax({
- type: "GET",
- url: '/thmz/getBedStatusNumByDept?code=' + $('#inpatientWardBeHospitalized').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var data = res.data;
- if (data == null) {
- $("#totalBedNum").val(0);
- $("#freeBedNum").val(0);
- $("#occupationBedNum").val(0);
- } else {
- $("#totalBedNum").val(data.total);
- $("#freeBedNum").val(data.free);
- $("#occupationBedNum").val(data.occupation);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- //
- // /**
- // * 初始化诊断下拉选
- // */
- // function initIcdSelect() {
- // var icdCodeInputBeHospitalized = $("#icdCodeInputBeHospitalized").val()
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + icdCodeInputBeHospitalized + '&pageSize=100',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // var html = '';
- // if (res.code == 0) {
- // if (res.data != null && res.data.length > 0) {
- // var html = '';
- // for (var i = 0; i < res.data.length; i++) {
- // html += '<option value="' + res.data[i].paramsCode + '">' + res.data[i].paramsName + '(' + res.data[i].paramsCode + ')</option>';
- // }
- // $('#icdCodeBeHospitalized').empty();
- // $('#icdCodeBeHospitalized').html(html);
- // $('#icdCodeBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- // $('#icdCodeBeHospitalized').parent().addClass("open");
- // $('#icdCodeBeHospitalized').next().addClass("hide");
- // $('#icdCodeBeHospitalized').next().next().css("margin-top", "-34px");
- // }
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 设置诊断内容
- // */
- // function setIcdText() {
- // var icdCodeBeHospitalized = $('#icdCodeBeHospitalized option:selected').text();
- // if (icdCodeBeHospitalized != null) {
- // var icdText = icdCodeBeHospitalized.substring(0, icdCodeBeHospitalized.indexOf("("));
- // $("#icdTextBeHospitalized").val(icdText);
- // $("#icdCodeInputBeHospitalized").val($('#icdCodeBeHospitalized').val());
- // $("#icdTextBeHospitalized").attr("title", icdText);
- // } else {
- // $("#icdTextBeHospitalized").val("");
- // $("#icdCodeInputBeHospitalized").val("");
- // $("#icdTextBeHospitalized").attr("title", "");
- // }
- // $('#icdCodeBeHospitalized').parent().addClass("hide");
- // }
- /**
- * 初始化医疗范文范围下拉选
- */
- function initTemplateTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#templateType').append(html);
- });
- $('#templateType').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化医疗范文类型下拉选
- * @param templateKindTypeId
- */
- function initTemplateKindTypeSelect(templateKindTypeId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateKindTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#' + templateKindTypeId).append(html);
- });
- $('#' + templateKindTypeId).selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始用药方式下拉选
- */
- function initSupplyTypes() {
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.groupNo === "71") {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- }
- });
- $('#supplyType').empty();
- $('#supplyType').html(html);
- $('#supplyType').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始煎药方式下拉选
- * @param async 是否是异步 true 异步 false 同步
- */
- function initZySupplyTypes(id, async) {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.groupNo === "81") {
- // html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- }
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始查检查部位
- */
- function initYshPart() {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getYshPart',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#yshPart').empty();
- $('#yshPart').html(html);
- $('#yshPart').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化验物下拉选
- */
- function initJyZdSample() {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getJyZdSample',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#jyZdSample').empty();
- $('#jyZdSample').html(html);
- $('#jyZdSample').selectpicker('refresh');
- }
- });
- }
- /**
- * 保存当前药品到右边处方区域
- * @param index 0 西药 1中药 2 诊疗和社备
- */
- function saveMedicine(index) {
- if (index == 0) {
- // //每个处方不能超过5个药品
- // var tableId = $("#xyTab li.active").find("a").attr("href");
- // var childrens = $(tableId).find("div:eq(0)").children().length;
- // if (childrens === 5) {
- // $("#messageModal").modal();
- // $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- // $("#messageButton").off("click").on("click", function (t) {
- // $("#messageModal").modal("hide");
- // refreshNavTabs(index);
- // saveWesternMedicine();
- // });
- // } else {
- // saveWesternMedicine();
- // }
- saveWesternMedicine(true);
- } else if (index == 1) {
- saveChineseMedicine(true);
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveWesternMedicine(calculateTotalAmountFlag) {
- //组号
- var groupId = $("#groupId").val();
- //药品名称
- var westernMedicineNamme = $("#western_medicine_name").val();
- //当前药品编码
- var currentCode = $("#current_code").val();
- //当前药品规格
- var currentSerial = $("#current_serial").val();
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- //用法编码
- var supplyType = $("#supplyType").val();
- //用法描述
- var supplyTypeText = $('#supplyType option:selected').text();
- supplyTypeText = supplyTypeText.substring(0, supplyTypeText.indexOf("("));
- //药品默认单次使用剂量
- var drugWinDb = $("#drugWinDb").val();
- //处方实际单次使用剂量
- var drugWin = $("#drugWin").val();
- //剂量单位
- var drugWinUnit = $('#drugWinUnit option:selected').text();
- //drugWinUnit = drugWinUnit.substring(0, drugWinUnit.indexOf("("));
- //天数
- var dayNum = $("#dayNum").val();
- //频次编码
- var orderFrequency = $("#orderFrequency").val();
- //频次描述
- var orderFrequencyText = $('#orderFrequency option:selected').text();
- orderFrequencyText = orderFrequencyText.substring(0, orderFrequencyText.indexOf("("));
- //总量
- var gross = $("#gross").val();
- //包装单位
- var packUnit = $("#packUnit").val();
- if (packUnit == null) {
- packUnit = "";
- }
- //医嘱码
- var medicalAdvice = $("#medicalAdvice").val();
- //医嘱内容
- var medicalAdviceText = $('#medicalAdvice option:selected').text();
- medicalAdviceText = medicalAdviceText.substring(0, medicalAdviceText.indexOf("("));
- //金额
- var totalRetprice = parseFloat($("#totalRetprice").val());
- //单价
- var packRetprice = $("#packRetprice").val();
- //皮试
- var tryFlag = $("#tryFlag").parent().hasClass("checked");
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- if (currentGroupNo != '91') {
- if (supplyType == null || supplyType == "") {
- errorMesageSimaple("用法为空!");
- return;
- }
- if (drugWin == null || drugWin == "") {
- errorMesageSimaple("剂量为空!");
- return;
- }
- if (dayNum == null || dayNum == "") {
- errorMesageSimaple("天数为空!");
- return;
- }
- if (orderFrequency == null || orderFrequency == "") {
- errorMesageSimaple("频次为空!");
- return;
- }
- }
- if (gross == null || gross == "") {
- errorMesageSimaple("总量为空!");
- return;
- }
- var html = '<div class="form-group">';
- html += groupId + '.<span style="margin-left: 5px"></span>';
- html += westernMedicineNamme + ' ';
- html += drugWinDb + drugWinUnit + ' ';
- html += drugWin + drugWinUnit + ' 共';
- html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
- html += '用法:' + supplyTypeText + ' ';
- html += '频次:' + orderFrequencyText + ' ';
- html += dayNum + '天 ';
- if (tryFlag == "true" || tryFlag == true) {
- html += '皮试 ';
- }
- if (medicalAdvice != null && medicalAdvice != '') {
- html += '医嘱:' + medicalAdviceText;
- }
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="editWesternMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(0,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
- html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
- html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
- html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
- html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
- html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
- html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdviceText" value="' + medicalAdviceText + '"/>';
- html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_tryFlag" value="' + tryFlag + '"/>';
- html += '</div>';
- var tableId = $("#xyTab li.active").find("a").attr("href");
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- // //原药品金额 如果是修改则需要设置
- // var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
- //temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- } else {
- //因为药品可以换组号,要保证相同组号的在一起
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
- //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
- if (temporaryItemsGroupId > groupId) {
- nextObj = $(formGroups[i]);
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
- var groupIdLast = $("#groupId option:last-child").text();
- if (groupId === groupIdLast) {
- appendGroupOrder();
- }
- //设置药品的用法,频次,天数
- var map = groupIdMap.get(groupId);
- if (map == null) {
- map = new Map();
- map.put("supplyType", supplyType);
- map.put("orderFrequency", orderFrequency);
- map.put("dayNum", dayNum);
- groupIdMap.put(groupId, map);
- }
- //设置当前药品的品类
- $(tableId).find("input.current_groupNo").val($("#current_groupNo").val());
- clearWesternMedicine(false);
- }
- /**
- * 上移
- * @param obj
- */
- function arrowUp(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).prev() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //前一个兄弟节点的序号
- var prevJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- prevJcjyItemGroupId = $(parentObject).prev().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
- $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).prev().before($(parentObject));
- }
- /**
- * 下移
- * @param obj
- */
- function arrowDown(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).next() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //后一个兄弟节点的序号
- var afterJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- afterJcjyItemGroupId = $(parentObject).after().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
- $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).next().after($(parentObject));
- }
- /**
- * 修改西药
- * @param obj
- */
- function editWesternMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#update_flag").val(true);
- var parentObject = $(obj).parent();
- //组号
- $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
- $('#groupId').selectpicker('refresh');
- //药品名称
- $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
- var code = $(parentObject).find("input.temporary_items_code").val();
- var serial = $(parentObject).find("input.temporary_items_serial").val();
- //当前药品编码
- $("#current_code").val(code);
- //当前药品规格
- $("#current_serial").val(serial);
- //用法编码
- $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
- $('#supplyType').selectpicker('refresh');
- //药品默认单次使用剂量
- $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
- //处方实际单次使用剂量
- $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //天数
- $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
- $('#dayNum').selectpicker('refresh');
- //频次编码
- $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
- $('#orderFrequency').selectpicker('refresh');
- //总量
- $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
- //医嘱
- $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
- $('#medicalAdvice').selectpicker('refresh');
- //金额
- $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
- //单价
- $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
- //皮试
- var tryFlag = $(parentObject).find("input.temporary_items_tryFlag").val();
- if (tryFlag == true || tryFlag == "true") {
- $("#tryFlag").parent().addClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- var drugWinHtml = '';
- if (res.data.weight != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- }
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- //剂量单位
- $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- //包装单位
- $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
- $('#packUnit').selectpicker('refresh');
- }
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- } else {
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 修改中药
- * @param obj
- */
- function editChineseMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前药品编码
- $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前药品规格
- $("#current_serial").val($(parentObject).find("input.temporary_items_serial").val());
- //中药类型
- $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
- $('#zyClassType').selectpicker('refresh');
- //药品名称
- $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
- //单价
- $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
- //处方实际单次使用剂量
- $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //医嘱码
- $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
- $('#zyInstruction').selectpicker('refresh');
- }
- /**
- * 修改项目
- * @param obj
- */
- function editJyJcItem(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
- //项目名称
- $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
- //单价
- $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
- //备注
- $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
- var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
- var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
- //数量
- var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
- //执行科室
- var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
- $("#execUnit").selectpicker('val', execUnit);
- $('#execUnit').selectpicker('refresh');
- if (jcJyZltype == 1 || jcJyZltype == "1") {
- $("#jyZdSample").selectpicker('val', chargeUnit);
- $('#jyZdSample').selectpicker('refresh');
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- $("#itemQuantityDiv").removeClass("in").addClass("hide");
- } else if (jcJyZltype == 2 || jcJyZltype == "2") {
- $("#yshPart").selectpicker('val', chargeUnit);
- $('#yshPart').selectpicker('refresh');
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- $("#itemQuantityDiv").removeClass("in").addClass("hide");
- } else if (jcJyZltype == 3 || jcJyZltype == "3") {
- //描述
- $("#chargeUnit").val(chargeUnit);
- $("#itemQuantity").val(itemQuantity);
- $("#chargeUnitDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- $("#itemQuantityDiv").removeClass("hide").addClass("in");
- }
- $("#jcJyZltype").val(jcJyZltype);
- }
- /**
- * 保存当前项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (patientAge != null && patientAge != "" && patientAge < 6) {
- $.ajax({
- type: "GET",
- url: '/thmz/checkAdditionally?code=' + $("#current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
- var xlCode = res.data.xlCode;
- xlCode = Multiply(100, xlCode);
- $("#messageModal").modal();
- $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJyJcItemReal(true);
- });
- } else {
- //虽然是不满6岁,但是也没有需要加收的项目,直接保存
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- }
- /**
- * 保存当前项目到右边处方区域
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItemReal(calculateTotalAmountFlag) {
- var tableId = $("#zlTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //项目名称
- var jcJyItem = $("#jcJyItem").val();
- //当前项目编码
- var currentCode = $("#current_code").val();
- //当前项目价格
- var jcjyItemPrice = $("#jcjyItemPrice").val();
- //描述
- var chargeUnit = $("#chargeUnit").val();
- //执行科室
- var execUnit = $("#execUnit").val();
- //执行科室
- var execUnitName = $('#execUnit option:selected').text();
- execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
- //次数
- var itemQuantity = $("#itemQuantity").val();
- //描述编码
- var chargeUnitCode = chargeUnit;
- var chargeUnitName = " 描述:";
- //备注
- var remark = $("#remark").val();
- //项目类型
- var jcJyZltype = $("#jcJyZltype").val();
- if (jcJyZltype == "1" || jcJyZltype == 1) {
- //检验
- chargeUnit = $('#jyZdSample option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#jyZdSample').val();
- chargeUnitName = " 检验物:";
- } else if (jcJyZltype == "2" || jcJyZltype == 2) {
- //检查
- chargeUnit = $('#yshPart option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#yshPart').val();
- chargeUnitName = " 检查部位:";
- }
- if (currentCode == null || currentCode == '') {
- if (calculateTotalAmountFlag == true) {
- errorMesageSimaple("未选择任何项目!");
- }
- return;
- }
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- //原组号
- var oriGroupId = null;
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === currentCode) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- oriGroupId = $(formGroups[i]).find("span.jcjyItemGroupId").text();
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- if (oriGroupId != null) {
- groupId = oriGroupId;
- }
- var html = '<div class="form-group">';
- html += '<span class="jcjyItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
- html += jcJyItem + ' ';
- if (jcJyZltype == "3" || jcJyZltype == 3) {
- html += " 数量:" + itemQuantity;
- }
- if (execUnit != null && execUnit != "") {
- html += " 执行科室:" + execUnitName;
- }
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnitName + chargeUnit;
- }
- if (remark != null && remark != '') {
- html += ' 备注:' + remark;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- if ($("#jcJyItemChargeDetail").hasClass("in")) {
- html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\',' + jcJyZltype + ')"></i>';
- }
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(2,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
- html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
- html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
- html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
- html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- clearJyJcItem();
- }
- /**
- * 临时保存住院证
- * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
- */
- function saveZyReq(messageFlag) {
- //如果
- if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
- initNavTabs(3);
- }
- var tableId = $("#zyReqTab li.active").find("a").attr("href");
- //病区编码
- var inpatientWardBeHospitalized = $("#inpatientWardBeHospitalized").val();
- //小病室编码
- var smallWardBeHospitalized = $("#smallWardBeHospitalized").val();
- //入院状态编码
- var admissStatus = $("#admissStatus").val();
- //病区名称
- var inpatientWardText = $('#inpatientWardBeHospitalized option:selected').text();
- //小科室名称
- var smallWardText = $('#smallWardBeHospitalized option:selected').text();
- //入院状态名称
- var admissStatusText = $('#admissStatus option:selected').text();
- if (inpatientWardBeHospitalized == null || inpatientWardBeHospitalized == '') {
- errorMesageSimaple("未选择入院病区!");
- return;
- }
- if (admissStatus == null || admissStatus == '') {
- errorMesageSimaple("未选择入院状态!");
- return;
- }
- if (messageFlag == "true" || messageFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- $("#messageModal").modal();
- $("#messageContent").html("当前病人已经有一个暂存的入院申请,是否需要替换该申请?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveZyReq(false);
- });
- return;
- }
- }
- var html = '<div class="form-group"> 收住院';
- if (inpatientWardText != null) {
- html += " [" + inpatientWardText;
- }
- if (smallWardText != null) {
- html += " (" + smallWardText + ") ";
- }
- if (inpatientWardText != null) {
- html += "] ";
- }
- if (admissStatusText != null) {
- html += admissStatusText;
- }
- html += ' 侯床';
- //html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_inpatient_ward" value="' + inpatientWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_small_ward" value="' + smallWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_admiss_status" value="' + admissStatus + '"/>';
- html += '</div>';
- $(tableId).find("div:eq(0)").html(html);
- clearZyReq();
- }
- /**
- * 删除药品或者项目
- * @param index 0 西药 1 中药 2 项目
- * @param obj 当前点击的对象
- */
- function removeYpOrProject(index, obj) {
- var tabId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //医技与诊疗
- tabId = "zlTab";
- } else if (index == 3) {
- //入院
- tabId = "zyReqTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
- //calculateCfAmount(tableId, totalRetprice, null, index, 1);
- //医技的序号调整一下
- if (index == 2) {
- var nextAll = $(obj).parent().nextAll();
- if (nextAll != null && nextAll.length > 0) {
- for (var i = 0; i < nextAll.length; i++) {
- var index = $(nextAll[i]).find(".jcjyItemGroupId").text();
- $(nextAll[i]).find(".jcjyItemGroupId").text(index - 1);
- }
- }
- }
- $(obj).parent().remove();
- if (index != 3) {
- calculateTotalAmount();
- }
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups == null || formGroups.length == 0) {
- if (index == 0) {
- //西药被清空后,重置药房类型编码
- $(tableId).find("input.current_groupNo").val(null);
- //当本处方内容都被删除完后,也删除处方table
- $("#" + tabId).find("a[href=\"" + tableId + "\"]").parent().remove();
- $(tableId).remove();
- //切换处方 最后一个被选中
- $("#" + tabId).find("li:last > a").off("click").tab('show');
- } else if (index == 1) {
- //当中药处方被清空完后,重置当前中药类型为空
- $("#current_zyClassType").val(null);
- }
- }
- }
- /**
- * 清空西药
- * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
- */
- function clearWesternMedicine(flag) {
- $("#update_flag").val(false);
- //药品名称
- $("#western_medicine_name").val(null);
- //当前药品编码
- $("#current_code").val(null);
- //当前药品规格
- $("#current_serial").val(null);
- //当前药房编码
- $("#current_groupNo").val(null);
- if (flag) {
- //用法编码
- $("#supplyType").selectpicker('val', null);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").removeAttr("disabled");
- //天数
- $("#dayNum").selectpicker('val', null);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").removeAttr("disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', null);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").removeAttr("disabled");
- }
- //药品默认单次使用剂量
- $("#drugWinDb").val(null);
- //处方实际单次使用剂量
- $("#drugWin").val(null);
- //剂量单位
- $("#drugWinUnit").selectpicker('val', null);
- $('#drugWinUnit').selectpicker('refresh');
- //总量
- $("#gross").val(null);
- //包装单位
- $("#packUnit").selectpicker('val', null);
- $('#packUnit').selectpicker('refresh');
- //单价
- $("#packRetprice").val(null);
- //金额
- $("#totalRetprice").val(null);
- //医嘱
- $("#medicalAdvice").selectpicker('val', null);
- $('#medicalAdvice').selectpicker('refresh');
- //皮试
- $("#tryFlag").parent().removeClass('checked');
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- //$("#gross").attr("readonly", "readonly");
- }
- /**
- * 保存当前药品到右边处方区域 中药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveChineseMedicine(calculateTotalAmountFlag) {
- //药品名称
- var chineseMedicineNamme = $("#chinese_medicine_name").val();
- //当前药品编码
- var currentCode = $("#current_code").val();
- //当前药品规格
- var currentSerial = $("#current_serial").val();
- //处方实际单次使用剂量
- var drugWin = $("#zy_drugWin").val();
- //医嘱码
- var zyInstruction = $("#zyInstruction").val();
- //医嘱
- var zyInstructionText = $('#zyInstruction option:selected').text();
- //单价
- var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
- //当前中药的总价
- var totalRetprice = Multiply(drugWin, zyPackRetprice);
- //中药类型
- var zyClassType = $("#zyClassType").val();
- //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
- var currentYyClassType = $("#current_zyClassType").val();
- if (currentYyClassType == null || currentYyClassType == "") {
- //中药此时是第一次选择药品,不控制类型
- $("#current_zyClassType").val(zyClassType);
- } else if (currentYyClassType != zyClassType) {
- errorMesageSimaple("同一个中药处方不允许同时出现普通中药和颗粒剂中药!");
- return;
- }
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- var html = '<div class="form-group" style="float: left;">';
- html += chineseMedicineNamme;
- if (zyInstruction != null && zyInstruction != '') {
- html += '[' + zyInstructionText + ']';
- }
- html += '<span style="margin-left: 5px"></span>';
- html += drugWin + 'g';
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editChineseMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left:10px;" onclick="removeYpOrProject(1,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
- html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
- html += '</div>';
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- // calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- clearChineseMedicine();
- }
- /**
- * 清空中药
- */
- function clearChineseMedicine() {
- $("#update_flag").val(false);
- //药品名称
- $("#chinese_medicine_name").val(null);
- //当前药品编码
- $("#current_code").val(null);
- //当前药品规格
- $("#current_serial").val(null);
- //医嘱
- $("#zyInstruction").selectpicker('val', null);
- $('#zyInstruction').selectpicker('refresh');
- //剂量
- $("#zy_drugWin").val(null);
- //单价
- $("#zy_packRetprice").val(null);
- }
- /**
- * 清空项目
- */
- function clearJyJcItem() {
- $("#update_flag").val(false);
- //项目名称
- $("#jcJyItem").val(null);
- //当前项目编码
- $("#current_code").val(null);
- //单价
- $("#jcjyItemPrice").val(null);
- //备注
- $("#remark").val(null);
- //描述
- $("#chargeUnit").val(null);
- $("#jcJyZltype").val(null);
- $("#itemQuantity").val(1);
- $("#jyZdSample").selectpicker('val', null);
- $('#jyZdSample').selectpicker('refresh');
- $("#yshPart").selectpicker('val', null);
- $('#yshPart').selectpicker('refresh');
- $("#execUnit").selectpicker('val', null);
- $('#execUnit').selectpicker('refresh');
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#itemQuantityDiv").removeClass("in").addClass("hide");
- }
- /**
- * 清空入院证输入框
- */
- function clearZyReq() {
- $("#inpatientWardBeHospitalized").selectpicker('val', null);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- $("#smallWardBeHospitalized").selectpicker('val', null);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- $("#admissStatus").selectpicker('val', null);
- $('#admissStatus').selectpicker('refresh');
- $("#totalBedNum").val(null);
- $("#freeBedNum").val(null);
- $("#occupationBedNum").val(null);
- initSmallDeptByDept();
- }
- /**
- * 计算总金额
- */
- function calculateTotalAmount() {
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/getAmountForTempPrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#totalAmount").html(res.data.amount.toFixed(1));
- var arrs = $("span.cf_amount");
- for (var i = 0; i < arrs.length; i++) {
- if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
- $(arrs[i]).html(res.data.amountList[i].toFixed(1));
- }
- }
- // var arrs = $("#xyTabContent").find("span.cf_amount");
- // for (var i = 0; i < arrs.length; i++) {
- // $(arrs[i]).html(res.data.xyAmount.toFixed(1));
- // }
- // $("#zyTabContent").find("span.cf_amount").html(res.data.zyAmount.toFixed(1));
- // if (res.data.yjAmount != null) {
- // //如果
- // if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- // initNavTabs(2);
- // }
- // $("#zlTabContent").find("span.cf_amount").html(res.data.yjAmount.toFixed(1));
- // }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 打开住院处理窗口
- // * @param data
- // */
- // function beHospitalized() {
- // $("#beHospitalizedModal").modal();
- // //根据病人门诊id查询病人的入院申请
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // headers: {
- // 'Accept': 'application/json',
- // 'Authorization': 'Bearer ' + localStorage.getItem("token")
- // },
- // success: function (resZyz) {
- // if (resZyz == '401' || resZyz == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (resZyz.code == 0) {
- // $("#icdCodeInputBeHospitalized").val(resZyz.data.icdCode);
- // $("#icdTextBeHospitalized").val(resZyz.data.icdText);
- // $("#icdTextBeHospitalized").attr("title", resZyz.data.icdText);
- // $("#inpatientWardBeHospitalized").selectpicker('val', resZyz.data.reqDept);
- // $("#inpatientWardBeHospitalized").selectpicker('refresh');
- // initSmallDeptByDept();
- // $("#smallWardBeHospitalized").selectpicker('val', resZyz.data.smallDept);
- // $("#smallWardBeHospitalized").selectpicker('refresh');
- // $("#admissStatus").selectpicker('val', resZyz.data.admissStatus);
- // $("#admissStatus").selectpicker('refresh');
- // $("#zyReqVisitDate").val(format(resZyz.data.visitDate, "yyyy-MM-dd HH:mm:ss"));
- // }
- // }
- // });
- // }
- /**
- * 打开编辑用户信息窗口
- * @param data
- */
- function editUserModal() {
- $("#editUserModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + $("#patientId").text(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方类型按钮切换事件
- * @param object
- * @param objectIndex
- */
- function billItemButtonChange(object, objectIndex) {
- $(".nav-tabs").removeClass("in").addClass("hide");
- $(".tab-content").removeClass("in").addClass("hide");
- $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- // initNavTabs(objectIndex);
- $("#bill_item_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- $("#rp_form" + index).removeClass("show").addClass("hide");
- });
- $("#rp_form" + objectIndex).removeClass("hide").addClass("show");
- $(object).removeClass("btn-default").addClass("btn-primary");
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- if (objectIndex == 0) {
- $("#western_medicine_name").focus();
- $("#western_medicine_name").click();
- currentEleId = 'western_medicine_name';
- } else if (objectIndex == 1) {
- $("#chinese_medicine_name").focus();
- $("#chinese_medicine_name").click();
- currentEleId = 'chinese_medicine_name';
- } else if (objectIndex == 2) {
- $("#jcJyItem").focus();
- $("#jcJyItem").click();
- currentEleId = 'jcJyItem';
- } else if (objectIndex == 3) {
- currentEleId = 'freeBedNum';
- }
- }
- /**
- * 打开快速接诊窗口
- * @param data
- */
- function rapidAcceptsModal() {
- $("#rapidAcceptsModal").modal();
- //延迟触发 默认光标在卡号输入框
- setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
- }
- /**
- * checkBox样式
- */
- function formatCheck() {
- if ($("input.flat")[0]) {
- $(document).ready(function () {
- $('input.flat').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- /**
- * 卡号有变化后查询病人信息
- */
- function queryUserInfoByCardNo() {
- //当反写的id不存在,说明不是查询后的改变事件,触发查询
- var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
- var index = rapidAcceptsUserCardNo.indexOf("-");
- if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "") && ((index > 0 && index == rapidAcceptsUserCardNo.length - 2) || rapidAcceptsUserCardNo.length == 8)) {
- $("#cardNo").attr("title", rapidAcceptsUserCardNo);
- $.ajax({
- type: "GET",
- url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#rapidAcceptsUserName").val(res.data.name);
- $("#rapidAcceptsUserCode").val(res.data.patientId);
- $("#patientIdDb").val(res.data.patientId);
- $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
- $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
- $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
- $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
- $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
- //查询分诊号
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": res.data.patientId}),
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (resFz) {
- if (resFz == '401' || resFz == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (resFz.code == 0) {
- if (resFz.data == null || resFz.data.length == 0) {
- errorMesageSimaple("没有查询到符合条件的分诊记录!");
- clearRapidAcceptsModal();
- return;
- }
- $("#mzfzSerialNo").val(resFz.data[0].serialNo);
- }
- }
- });
- } else {
- errorMesageSimaple("病人信息不存在!");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- }
- /**
- * 清空快速接诊查询框
- */
- function clearRapidAccepts() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- $("#mzfzSerialNo").val(null);
- $("#rapidAcceptsUserCardNo").focus();
- }
- /**
- * 根据病人姓名输入框内容动态加载病人列表
- */
- function initUserList() {
- //var width=$("#userName").css("width");
- var settings = {
- trigger: 'click',
- content: '',
- width: 170,
- multi: true,
- closeable: false,
- style: '',
- delay: 300,
- padding: true,
- height: 300,
- };
- var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
- //用户姓名选中事件
- $("#rapidAcceptsUserName").on("click", function (t) {
- if ($(webuiPopover).css("display") == "block") {
- refeshPatinetList(true);
- }
- });
- }
- /**
- * 刷新候诊病人列表
- */
- function refeshPatinetList(flag) {
- //如果是重新加载病人列表,需要重置下标
- if (flag) {
- //重置下标
- pageIndex = 0;
- msg_list_loading = true;
- }
- var userName = $('#rapidAcceptsUserName').val();
- if (!(userName == null || userName == "" || isChinese(userName))) {
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#webuiPopover0").css("display", "block");
- $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
- var html = '<div class="list-group">';
- for (var i = 0; i < res.data.length; i++) {
- var mzPatientMi = res.data[i];
- html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
- if (mzPatientMi.gender == "男") {
- html += '<img src="/thmz/images/boy.png"/>'
- } else if (mzPatientMi.gender == "女") {
- html += '<img src="/thmz/images/girl.png"/>'
- } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
- html += '<img src="/thmz/images/girl_or_boy.png"/>'
- }
- html += '<div>' + mzPatientMi.name + ' ' + mzPatientMi.gender + ' ';
- if (mzPatientMi.age != null && mzPatientMi.age != "") {
- html += mzPatientMi.age + '岁';
- } else {
- html += '**岁';
- }
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
- html += '<span>' + mzPatientMi.phoneNo + '</span>';
- }
- html += '</div></a>';
- }
- html += '</div>';
- if (flag) {
- $("#webuiPopover0 div.webui-popover-content").html("");
- }
- $("#webuiPopover0 div.webui-popover-content").append(html);
- $("#webuiPopover0 div.arrow").css("left", "23px");
- refeshPatinetListScrollEvent();
- } else {
- $("#webuiPopover0").css("display", "none");
- }
- }
- //查询完成,设置加载完成
- msg_list_loading = false;
- }
- });
- }
- /**
- * 病人下拉列表滚动条滚动到底部时继续加载新纪录
- */
- function refeshPatinetListScrollEvent() {
- $('.webui-popover-content').scroll(function (event) {
- var top = $(this).scrollTop();
- var height = $(this).height();
- var scrollHeight = $(this).get(0).scrollHeight;
- if (scrollHeight <= top + height) {
- if (!msg_list_loading) {
- msg_list_loading = true;
- pageIndex = pageIndex + 1;
- refeshPatinetList(false);
- }
- }
- });
- }
- /**
- * 按照病人id查询病人信息
- * @param patientId
- */
- function fillUnClinicPatinet(patientId) {
- $("#rapidAcceptsUserCardNo").val(patientId);
- $("#webuiPopover0").css("display", "none");
- queryUserInfoByCardNo();
- }
- /**
- * 加载主诉,体格检查,诊断窗口
- */
- function initRecommendList() {
- var width = $("#symptom").parent().css("width");
- var settings = {
- placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- trigger: 'click', //值:click,hover 触发方式 manual 手动
- content: '',//内容,内容可以是函数
- width: width,
- //arrow:false,//是否显示箭头
- multi: true,//在页面允许其他弹出层
- closeable: true,//显示关闭按钮
- style: '', //值:'',inverse
- delay: 300,//延迟时间, 悬浮属性才执行
- padding: true,//内容填充
- height: 320,
- //offsetTop:10,
- cache: true,//如果缓存设置为false,则popover将销毁并重新创建
- };
- //主诉弹窗
- var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
- //体格检查弹窗
- settings.height = 260;
- $('#weight').webuiPopover('destroy').webuiPopover(settings);
- //诊断弹窗
- settings.height = 320;
- var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
- //西药弹窗
- settings.width = 680;
- settings.closeable = false;
- settings.arrow = false;//显示箭头或不显示箭头
- settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //中药弹窗
- settings.trigger = 'click';
- settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //诊疗与医技弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
- var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
- //主诉选中事件
- $("#symptom").on("click", function (t) {
- if ($(symptomWebuiPopover).css("display") == "block") {
- $("#webuiPopover1 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
- html += "</div>";
- html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
- '<div style="float: left">' +
- '<span style="margin-left: 20px;">内容:</span> ' +
- '</div>' +
- '<div style="float: left;">' +
- '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
- '<option label="常用症状" value="0">常用症状</option>' +
- '<option label="常用时间" value="1">常用时间</option>' +
- '<option label="常用标点" value="2">常用标点</option>' +
- '<option label="常用词" value="3">常用词</option>' +
- '</select> ' +
- '</div>' +
- '<div style="width: 200px;float: left;margin-left: 10px;">' +
- '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
- '</div>' +
- '<div style="float: left;margin-left: 10px;">' +
- ' <button type="button" class="btn" onclick="saveParams();"' +
- ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
- ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
- ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
- ' </svg>' +
- '新增' +
- ' </button>' +
- ' </div>' +
- '</div>';
- $("#webuiPopover1 div.webui-popover-content").html(html);
- $('#paramsType').selectpicker('refresh');
- $("#paramsType").parent().css("width", "140px").css("height", "34px");
- $("#webuiPopover1").css("z-index", "10");
- if ($("#webuiPopover1").hasClass("in")) {
- loadSymptom();
- }
- }
- //加载智能接诊模块的主诉推荐
- fitSymptomData();
- });
- //体格检查各输入框选中事件
- $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor,#pressure_high_left,#pressure_floor_left").on("click", function (t) {
- if ($("#webuiPopover2").css("display") == "block") {
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- //loadSymptom();
- } else {
- $('#weight').webuiPopover('show');
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- }
- return false;
- });
- //诊断选中事件
- $("#diagnose").on("click", function (t) {
- if ($(diagnoseWebuiPopover).css("display") == "block") {
- $("#webuiPopover3 div.arrow").css("left", "23px");
- $("#webuiPopover3 a.close").css("margin-top", "15px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
- html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
- ' <input type="text" class="form-control has-feedback-left" ' +
- ' placeholder="搜索" style="padding-left: 10px;" oninput="loadDiagnose(this.value)" id="paramsDiagnose">' +
- ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
- ' </div>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
- html += "</div>";
- $("#webuiPopover3 div.webui-popover-content").html(html);
- $("#webuiPopover3").css("z-index", "10");
- //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
- loadDiagnose("");
- }
- //加载智能接诊模块的诊断推荐推荐
- fitDiagnoseData();
- });
- //现病史选中事件
- $("#emrHpi").on("click", function (t) {
- //加载智能接诊模块的现病史推荐推荐
- fitEmrHpiData();
- });
- //既往史选中事件
- $("#emrPs").on("click", function (t) {
- //加载智能接诊模块的既往史推荐推荐
- fitEmrPsData();
- });
- // //西药选中事件
- // $("#western_medicine_name").on("click", function (t) {
- // if ($(westernMedicineWebuiPopover).css("display") == "block") {
- // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(0);
- // }
- // });
- // //中药选中事件
- // $("#chinese_medicine_name").on("click", function (t) {
- // if ($(chineseMedicineWebuiPopover).css("display") == "block") {
- // $("#chineseMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(1);
- // }
- // });
- // //诊疗与医技弹窗选中事件
- // $("#jcJyItem").on("click", function (t) {
- // if ($(jcJyItemWebuiPopover).css("display") == "block") {
- // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
- // loadjcJyItemList();
- // }
- // });
- //帮助字典弹窗
- settings.width = 450;
- settings.height = 200;
- settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
- settings.trigger = 'click';
- var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
- $("#treeButton").on("click", function (t) {
- // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
- //初始化药品,检查检验菜单树
- initzTree();
- });
- }
- /**
- * 新增通用参数
- */
- function saveParams() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveTCommonParams',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "paramsType": $("#paramsType").val(),
- "paramsName": $("#paramsNameInput").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- loadSymptom();
- $("#paramsNameInput").val(null);
- // $("#paramsType").selectpicker('val', 0);
- // $("#paramsType").selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载主诉参数列表
- */
- function loadSymptom() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadSymptom',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.featureList != null && res.featureList.length > 0) {
- html += '<div id="feature">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.featureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.featureList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.featureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.timeList != null && res.timeList.length > 0) {
- html += '<div id="time">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.timeList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.timeList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.timeList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.characterList != null && res.characterList.length > 0) {
- html += '<div id="character">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.characterList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.characterList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.characterList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.wordsList != null && res.wordsList.length > 0) {
- html += '<div id="words">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.wordsList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.wordsList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.wordsList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#contentHtml").html(html);
- }
- });
- }
- /**
- * 加载体格检查参数列表
- */
- function loadHealthCheckup() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadHealthCheckup',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.weightList != null && res.weightList.length > 0) {
- html += '<div id="weightDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.weightList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.weightList[i].paramsName + '\',\'weight\')"><span style="padding: 0px 5px;">';
- html += res.weightList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.temperatureList != null && res.temperatureList.length > 0) {
- html += '<div id="temperatureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.temperatureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.temperatureList[i].paramsName + '\',\'temperature\')"><span style="padding: 0px 5px;">';
- html += res.temperatureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.sphygmusList != null && res.sphygmusList.length > 0) {
- html += '<div id="sphygmusDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.sphygmusList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.sphygmusList[i].paramsName + '\',\'sphygmus\')"><span style="padding: 0px 5px;">';
- html += res.sphygmusList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.breatheList != null && res.breatheList.length > 0) {
- html += '<div id="breatheDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.breatheList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.breatheList[i].paramsName + '\',\'breathe\')"><span style="padding: 0px 5px;">';
- html += res.breatheList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.pressureList != null && res.pressureList.length > 0) {
- html += '<div id="pressureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">血压:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.pressureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.pressureList[i].paramsName + '\',\'pressure_\')"><span style="padding: 0px 5px;">';
- html += res.pressureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#healthCheckupContentHtml").html(html);
- }
- });
- }
- /**
- * 加载诊断参数列表
- * @param value
- */
- function loadDiagnose(value) {
- if (!$("#webuiPopover3").hasClass("in")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + value + '&pageSize=100',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- html += '<div>';
- for (var i = 0; i < res.data.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitDiagnoseValue(\'' + res.data[i].paramsName + '\',\'' + res.data[i].paramsCode + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
- html += res.data[i].paramsName;
- html += '<small> (' + res.data[i].paramsCode + ')</small>';
- html += '</span></button>';
- }
- html += '</div>';
- }
- } else {
- errorMesage(res);
- }
- $("#diagnoseContentHtml").html(html);
- }
- });
- }
- /**
- * 填充诊断
- * @param value
- * @param code
- */
- function fitDiagnoseValue(value, code) {
- if (code === null || code === "") {
- return;
- }
- var html = '';
- var childrenNum = $("#diagnoseTags").children().length;
- if (childrenNum == 2) {
- errorMesageSimaple("最多填写两个诊断!");
- return;
- }
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "") {
- diagnoseValue = code;
- } else {
- if (diagnoseValue.indexOf(code) != -1) {
- errorMesageSimaple("诊断已存在,请勿重复添加!");
- return;
- }
- diagnoseValue += "," + code;
- }
- $("#diagnoseValue").val(diagnoseValue);
- if (childrenNum == 0) {
- html += '<span class="el-tag--mainDiagnosis" ';
- } else {
- html += '<span class="el-tag--secondaryDiagnosis" ';
- }
- html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
- $("#diagnoseTags").append(html);
- }
- /**
- * 移除诊断
- * @param code
- */
- function removeDiagnoseValue(code) {
- var childrenIndex = 0;
- var children = $("#diagnoseTags").children();
- for (var i = 0; i < children.length; i++) {
- if ($(children[i]).attr("id") == code) {
- childrenIndex = i;
- break;
- }
- }
- $($("#diagnoseTags").children("span")[childrenIndex]).remove();
- if (childrenIndex == 0) {
- $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
- }
- var diagnoseValue = $("#diagnoseValue").val();
- $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
- }
- /**
- * 点击通用参数属性值时设置值到对应的区域
- * @param value
- * @param id
- */
- function fitValue(value, id) {
- //当选择的是血压时
- if (id == "pressure_") {
- var arr = value.split("/");
- $("#pressure_high").val(arr[0]);
- $("#pressure_floor").val(arr[1]);
- if ($("#pressureLeftFlag").hasClass("in")) {
- $("#pressure_high_left").val(arr[0]);
- $("#pressure_floor_left").val(arr[1]);
- }
- //当选的是体重,体温,脉搏和呼吸时
- } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
- $("#" + id).val(value);
- } else {
- //主诉拼写时
- var valueExist = $("#" + id).val();
- if (valueExist != null && valueExist != "") {
- value = valueExist + value;
- }
- $("#" + id).val(value);
- }
- }
- /**
- * 加载药品列表数列表
- * @param index
- */
- function loadYpList(index) {
- //var medicinePopoverContent = null;
- var tableMedicine = null;
- var MedicineName = null;
- //var groupNo=null;
- if (index == 0) {
- // medicinePopoverContent = "westernMedicinePopoverContent";
- tableMedicine = "tb_table_western_medicine";
- MedicineName = "western_medicine_name";
- // groupNo=71;
- }
- if (index == 1) {
- // medicinePopoverContent = "chineseMedicinePopoverContent";
- tableMedicine = "tb_table_chinese_medicine";
- MedicineName = "chinese_medicine_name";
- // groupNo=$("#zyClassType").val();
- }
- // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#' + tableMedicine).bootstrapTable('refresh');
- $('#' + tableMedicine).bootstrapTable({
- url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var groupNo = null;
- if (index == 0) {
- groupNo = 71;
- }
- if (index == 1) {
- groupNo = $("#zyClassType").val();
- }
- var temp = {
- groupNo: groupNo,
- commonParams: $("#" + MedicineName).val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '药品名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'specification',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'manufactory',
- title: '生产厂家',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'miniUnitName',
- title: '单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '零售价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return '0.0元';
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'drugWinDesc',
- title: '剂量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'stockAmountVirtual',
- title: '库存数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#' + MedicineName).webuiPopover('hide');
- if (index == 0) {
- checkYpInfo(row.code, row.serial, row.ypType, true);
- }
- if (index == 1) {
- checkZyInfo(row.code, row.serial, true);
- }
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 西药
- * @param code
- * @param serial
- * @param groupNo
- * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
- */
- function checkYpInfo(code, serial, groupNo, needNotice) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, 0)) {
- return;
- }
- $("#current_groupNo").val(groupNo);
- $("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: needNotice,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
- initNavTabs(0);
- }
- var cfdesc = '普药';
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- //每个处方不能超过5个药品
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children().length;
- var currentGroupNo = $(tableId).find("input.current_groupNo").val();
- if (childrens === 5) {
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- });
- } else {
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- }
- } else if (currentGroupNo != null && currentGroupNo != '' && groupNo != currentGroupNo) {
- //当前编辑的处方与选中的品类非同一处方能保存的
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //是否需要新增处方页,以保存医材处方
- var needAddTable = true;
- for (var i = 0; i < currentGroupNos.length; i++) {
- if ($(currentGroupNos[i]).val() == groupNo) {
- var next = $(currentGroupNos[i]).next();
- if ($(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //因为存在没有满5个的处方页,直接保存到该页
- needAddTable = false;
- fitWesternMedicine(res, groupNo);
- }
- }
- }
- if (needAddTable) {
- //91 医材
- var message = "医材需要单独处方,是否需要新增医材处方?";
- if (groupNo == '71') {
- message = "普通西成药需要单独处方,是否需要新增处方?"
- } else if (groupNo == '111') {
- message = "麻、精一药物需要单独处方,是否需要新增处方?"
- } else if (groupNo == '131') {
- message = "精二药物需要单独处方,是否需要新增处方?"
- }
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- });
- } else {
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- }
- }
- //当前编辑的处方非普通西药处方
- } else {
- fitWesternMedicine(res, groupNo);
- }
- if (needNotice) {
- //选中药品后,光标默认到用法
- $("#supplyType").next().click();
- currentEleId = 'supplyType';
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 中药
- * @param code
- * @param serial
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- function checkZyInfo(code, serial, async) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, 1)) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
- initNavTabs(1);
- $("input.zyfs").val(1);
- }
- $("#chinese_medicine_name").val(res.data.name);
- $("#chinese_medicine_name").blur();
- $("#zy_drugWin").val(res.data.weight);
- $("#zy_packRetprice").val(res.data.packRetprice);
- $("#current_code").val(res.data.code);
- $("#current_serial").val(res.data.serial);
- if (async) {
- //选中药品后,光标默认到数量输入框
- $("#zy_drugWin").focus();
- currentEleId = 'zy_drugWin';
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载医技与诊疗列表
- * @param index
- */
- function loadjcJyItemList() {
- // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#tb_table_jc_jy_item').bootstrapTable('refresh');
- $('#tb_table_jc_jy_item').bootstrapTable({
- url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- commonParams: $("#jcJyItem").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#jcJyItem').webuiPopover('hide');
- $("#jcJyZltype").val(row.type);
- $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (row.type == 3) {
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(2);
- }
- $("#jcJyItem").val(row.name);
- $("#jcJyItem").blur();
- $("#jcjyItemPrice").val(row.chargeAmount);
- $("#chargeUnit").val(row.specification);
- $("#current_code").val(row.code);
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#itemQuantityDiv").removeClass("hide").addClass("in");
- $("#itemQuantity").val(1);
- $("#chargeUnit").focus();
- currentEleId = 'chargeUnit';
- return;
- }
- if (row.type == 1) {
- //检验
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- if (row.sampleCode != null && row.sampleCode != "") {
- $("#jyZdSample").selectpicker('val', row.sampleCode);
- $('#jyZdSample').selectpicker('refresh');
- }
- } else if (row.type == 2) {
- //检查
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- if (row.bwCode != null && row.bwCode != "") {
- $("#yshPart").selectpicker('val', row.bwCode);
- $('#yshPart').selectpicker('refresh');
- }
- }
- $("#itemQuantityDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- checkJcJyItemInfo(row.code, row.name, row.type, true);
- }
- });
- }
- /**
- * 诊疗与医技选中
- * @param code
- * @param name 回写的时候可以设置null
- * @param type 1 检验 2 检查 3 诊疗
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- //function checkJcJyItemInfo(code, name, type) {
- function checkJcJyItemInfo(code, name, type, async) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, null, 2)) {
- return;
- }
- $("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJcJyItemChargeByCode?code=' + code + '&jcJyZltype=' + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(2);
- }
- if (name == null) {
- name = res.name;
- }
- $("#jcJyItem").val(name);
- $("#jcJyItem").blur();
- $("#jcjyItemPrice").val(res.totalAmount);
- $("#current_code").val(code);
- $("#execUnit").selectpicker('val', res.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (async) {
- if (type == 1) {
- //选中项目后,光标默认到数量输入框
- $("#jyZdSample").next().click();
- currentEleId = 'jyZdSample';
- } else if (type == 2) {
- $("#yshPart").next().click();
- currentEleId = 'yshPart';
- }
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询诊疗与医技项目明细
- * @param code 编码
- * @param jcJyZltype 1 检验 2 检查
- */
- function getJcJyItemChargeByCode(code, jcJyZltype) {
- if (code != null) {
- $("#itemCodeSearch").val(code);
- $("#jcJyZltypeSearch").val(jcJyZltype);
- } else if ($("#current_code").val() == null || $("#current_code").val() == '') {
- errorMesageSimaple("未选中任何项目!");
- return;
- }
- $("#jcJyItemModal").modal("show");
- $('#jcJyItemTable').bootstrapTable('refresh');
- $('#jcJyItemTable').bootstrapTable({
- url: '/thmz/getJcJyItemChargeByCode', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var itemCodeSearch = $("#itemCodeSearch").val();
- var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
- if (itemCodeSearch == null || itemCodeSearch == "") {
- itemCodeSearch = $("#current_code").val();
- jcJyZltypeSearch = $("#jcJyZltype").val();
- }
- var temp = {
- code: itemCodeSearch,
- jcJyZltype: jcJyZltypeSearch
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'tcCode',
- title: '项目编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'code',
- title: '收费编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'name',
- title: '收费名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'num',
- title: '数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '单价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }, {
- field: 'totalAmount',
- title: '总金额',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#itemCodeSearch").val(null);
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- }
- });
- }
- /**
- * 判断是否有重复的项目 返回true 说明有重复的
- * @param code
- * @param serial
- * @param index
- */
- function verifyRepeat(code, serial, index) {
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- if (updateFlag == "true" || updateFlag == true) {
- return false;
- }
- var tabId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //医技与诊疗
- tabId = "zlTab";
- } else if (index == 3) {
- //入院
- tabId = "zyReqTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- var items = $(tableId).find("div:eq(0)").find("div.form-group");
- var groupId = null;
- if (index == 0) {
- groupId = $("#groupId").val();
- }
- if (items != null && items.length > 0) {
- for (var i = 0; i < items.length; i++) {
- if (serial == null) {
- //西药需要判断组号,因为可能会有不同组的皮试用药,需要相同的药品
- if (index == 0) {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
- if (code === temporary_items_code && groupId === temporary_items_groupId) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- if (code === temporary_items_code) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- }
- } else {
- if (index == 0) {
- var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial && groupId === temporary_items_groupId) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- /**
- * 初始化处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- */
- function initNavTabs(index) {
- var tabId = null;
- var tabContentId = null;
- var paneId = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneId = "xycf_" + getUID();
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneId = "zycf_" + getUID();
- cfdesc = '中草药';
- } else if (index == 2) {
- //医技
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneId = "zlcf_" + getUID();
- cfdesc = '医技与诊疗';
- } else if (index == 3) {
- //医技
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneId = "zyReqcf_" + getUID();
- cfdesc = '入院';
- }
- $("#" + tabId).html('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>');
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
- html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
- html += '<input class="current_groupNo" type="hidden"/>';
- html += ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
- html += '<div style="width: 460px;">'
- if (index == 1) {
- html += ' <div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">付数:</label>' +
- ' <input type="text" class="form-control my_label_input_2 zyfs"' +
- ' placeholder="请输入" style="padding-left: 10px;" onchange="calculateZyAmount()">' +
- ' </div>';
- html += '<div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">频次:</label>' +
- ' <div style="width: 85px;float: right;">' +
- ' <select class="form-control selectpicker show-tick zy_orderFrequency"' +
- ' title="请选择" data-live-search="true" onchange="calculate()" id="zy_orderFrequency_1">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += '<div style="width: 180px;float: left;">' +
- ' <label class="my_label_2">用法:</label>' +
- ' <div style="width: 135px;float: left;">' +
- ' <select class="form-control selectpicker show-tick useType"' +
- ' title="请选择" id="useType_1">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += '</div><div style="width: 460px;">'
- html += '<input id="singleAmount" type="hidden"/>';
- }
- html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- //html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;"></div>';
- if (index == 1) {
- html += '<div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">液型:</label>' +
- ' <div style="width: 85px;float: right;">' +
- ' <select class="form-control selectpicker show-tick water" id="cyJssm">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += ' <div style="width: 180px;float: left;">' +
- ' <label class="my_label_2">煎法:</label>' +
- ' <div style="width: 135px;float: left;">' +
- ' <select class="form-control selectpicker show-tick zy_supplyType"' +
- ' title="请选择" id="zy_supplyType_1" onchange="calculateTotalAmount()">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- }
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- // else if (index == 1) {
- // html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品代煎所产生的费用!</div>';
- // }
- html += '</div></div></div>';
- $("#" + tabContentId).html(html);
- if (index == 1) {
- var useType = '<option value="1">饭前温服</option><option value="2">饭后温服</option><option value="3">饭前凉服</option><option value="4">饭后凉服</option><option value="5">顿服</option><option value="6">冲服</option><option value="7">外用</option>';
- $('.useType').html(useType);
- $('.useType').selectpicker('refresh');
- var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
- $('.water').html(water);
- $('.water').selectpicker('refresh');
- initOrderFrequencys("zy_orderFrequency_1", false);
- initZySupplyTypes("zy_supplyType_1", false);
- }
- }
- /**
- * 清空处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- */
- function clearNavTabs(index) {
- var tabId = null;
- var tabContentId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- } else if (index == 2) {
- //医技
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- } else if (index == 3) {
- //医技
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- }
- $("#" + tabId).html(null);
- $("#" + tabContentId).html(null);
- }
- /**
- * 添加处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- * @param groupNo 71 普通西药 91 医材 111 麻、精一 131 精二 151 诊疗
- */
- function refreshNavTabs(index, groupNo) {
- var tabId = null;
- var tabContentId = null;
- var paneIdPrfix = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneIdPrfix = "xycf_";
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneIdPrfix = "zycf_";
- cfdesc = '中草药';
- } else if (index == 2) {
- //医技
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneIdPrfix = "zlcf_";
- cfdesc = '医技与诊疗';
- } else if (index == 3) {
- //入院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneIdPrfix = "zyReqcf_";
- cfdesc = '入院';
- }
- // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
- // var length = $(tableId).find("div:eq(0)").children().length;
- // if(length==0){
- // //当前处方是空白的,不需要新增处方
- // return;
- // }
- var cfTitle = "处方" + " <small class=\"cfdesc\">(" + cfdesc + ")</small>";
- var paneId = paneIdPrfix + getUID();
- //清除选中的样式
- $("#" + tabId).find("li.active").removeClass("active");
- $("#" + tabId).append('<li><a href="#' + paneId + '" role="tab" data-toggle="tab">' + cfTitle + '</a></li>');
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
- '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
- '<input class="current_groupNo" type="hidden"/>' +
- ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">' +
- '<div style="width: 460px;">' +
- '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- html += '</div></div>';
- $("#" + tabContentId).append(html);
- //切换处方
- $("#" + tabId).find("a[href='#" + paneId + "']").off("click").tab('show');
- }
- /**
- * 填充西药选中的内容
- * @param res
- * @param groupNo
- */
- function fitWesternMedicine(res, groupNo) {
- $("#western_medicine_name").val(res.data.name);
- $("#western_medicine_name").blur();
- var drugWinHtml = '';
- var index = null;
- if (res.data.weight != null) {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- index = res.data.weighUnit;
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- if (index == null) {
- index = res.data.volUnit;
- }
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- if (index == null) {
- index = res.data.miniUnit;
- }
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- $("#drugWinUnit").selectpicker('val', index);
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- $("#packUnit").selectpicker('val', res.data.packUnitDesc);
- $('#packUnit').selectpicker('refresh');
- }
- $("#packRetprice").val(res.data.packRetprice);
- $("#packSize").val(res.data.packSize);
- $("#current_code").val(res.data.code);
- $("#current_serial").val(res.data.serial);
- if ($("#dayNum").val() == null) {
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- }
- if ($("#supplyType").val() == null && res.data.supplyType != null) {
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', res.data.supplyType);
- $('#supplyType').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null && res.data.frequency != null) {
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', res.data.frequency);
- $('#orderFrequency').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null) {
- //频次编码 防止频次为空
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- $("#tryFlag").parent().addClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- } else {
- $("#tryFlag").parent().removeClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- }
- // if (groupNo == "91") {
- // //医材
- // $("#gross").removeAttr("readonly")
- // } else {
- // $("#gross").attr("readonly", "readonly");
- // }
- calculate();
- }
- /**
- * 剂量单位改变事件
- */
- function drugWinUnitChange() {
- var desc = $('#drugWinUnit').find("option:selected").attr('desc');
- $("#drugWin").val(desc);
- $("#drugWinDb").val(desc);
- calculate();
- }
- /**
- * 根据选择的内容计算总的用药量
- */
- function calculate() {
- //最小规格剂量
- var drugWinDb = $("#drugWinDb").val();
- //天数
- var dayNum = $("#dayNum").val();
- //当前使用的最小剂量
- var drugWin = $("#drugWin").val();
- //频率
- var times = $('#orderFrequency').find("option:selected").attr('desc');
- //包装规格数量
- var packSize = $("#packSize").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (drugWinDb == null || drugWinDb === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWinDb = 1;
- }
- if (dayNum == null || dayNum === "") {
- if (currentGroupNo == '71') {
- return;
- }
- dayNum = 1;
- }
- if (drugWin == null || drugWin === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWin = 1;
- }
- if (times == null || times === "") {
- if (currentGroupNo == '71') {
- return;
- }
- times = 1;
- }
- if (packSize == null || packSize === "") {
- return;
- }
- //拆零总量
- var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
- //整包装的数量
- var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
- $("#gross").val(totalNum);
- $("#totalRetprice").val(Multiply(totalNum, packRetprice).toFixed(2));
- }
- /**
- * 根据选择的总量计算金额 只有医材的时候需要计算
- */
- function calculateSimple() {
- //总量
- var gross = $("#gross").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- $("#totalRetprice").val(Multiply(gross, packRetprice).toFixed(2));
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (currentGroupNo == '91') {
- //医材默认天数为1
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- }
- /**
- * 根据中药付数计算金额
- */
- function calculateZyAmount() {
- var singleAmount = $("#singleAmount").val();
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //获取中药付数
- var zyfs = $(tableId).find("input.zyfs").val();
- var cfAmount = Multiply(zyfs, singleAmount);
- $(tableId).find("span.cf_amount").html(cfAmount);
- calculateTotalAmount();
- }
- /**
- * 将病人信息填入患者信息修改form
- * @param patinet
- */
- function fillPlusPatinet(patinet) {
- if (patinet != null) {
- $("#editUserCode").val(patinet.patientId);
- $("#editUserName").val(patinet.name);
- $("#editUserName").blur();
- $("#editUserAge").val(patinet.age);
- $("#editUserAge").blur();
- $("#editUserGender").selectpicker('val', patinet.sex);
- $("#editUserGender").selectpicker('refresh');
- $("#editUserGender").blur();
- $("#editUserBirthDay").val(patinet.birthDayStr);
- $("#editUserBirthDay").blur();
- $("#editUserCardNo").val(patinet.icCardNo);
- $("#editUserCardNo").attr("title", patinet.icCardNo);
- $("#editUserCardNo").blur();
- $("#editUserPhoneNum").val(patinet.phoneNo);
- $("#editUserPhoneNum").attr("title", patinet.phoneNo);
- $("#editUserPhoneNum").blur();
- $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserPatientsNature").blur();
- $("#editUserIdCard").val(patinet.socialNo);
- $("#editUserIdCard").attr("title", patinet.socialNo);
- $("#editUserIdCard").blur();
- $("#editUserAddress").val(patinet.address);
- $("#editUserAddress").blur();
- $("#editUserContact").val(patinet.relName);
- $("#editUserContactPhone").val(patinet.contractName);
- }
- }
- /**
- * 修改病人信息
- */
- function modifyPatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/modifyPatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#editUserName").val(),
- "age": $("#editUserAge").val(),
- "sex": $("#editUserGender").val(),
- "birthDay": $("#editUserBirthDay").val(),
- "icCardNo": $("#editUserCardNo").val(),
- "phoneNo": $("#editUserPhoneNum").val(),
- "responseType": $("#editUserPatientsNature").val(),
- "socialNo": $("#editUserIdCard").val(),
- "address": $("#editUserAddress").val(),
- "patientId": $("#editUserCode").val(),
- "relName": $("#editUserContact").val(),
- "contractName": $("#editUserContactPhone").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#editUserModal').modal('hide');
- realClinicalReception($("#patientId").text(), $("#mzfzSerialNoInClick").val());
- } else {
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 保存入院证
- // */
- // function saveBeHospitalized() {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/saveMzZyReq',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "patientId": $("#patientId").text(),
- // "icdCode": $("#icdCodeBeHospitalized").val(),
- // "icdText": $("#icdTextBeHospitalized").val(),
- // "reqDept": $("#inpatientWardBeHospitalized").val(),
- // "smallDept": $("#smallWardBeHospitalized").val(),
- // "admissStatus": $("#admissStatus").val()
- // }),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (res.code == 0) {
- // successMesage(res);
- // $('#beHospitalizedModal').modal('hide');
- // loadInClinicTableList();
- // loadClinicTableList();
- // clearWorkSpace();
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
- function getRePortRangeArr() {
- var rePortRange = $('#reportrange span').html();
- var rePortRangeArr = rePortRange.split(" - ");
- rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
- rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
- return rePortRangeArr;
- }
- /**
- * 初始医生工作太配置
- */
- function initWorkspaceConfigForCurrent() {
- $.ajax({
- type: "GET",
- url: '/thmz/getWorkspaceConfigForCurrent',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data.symptomFlag == 1) {
- $("#symptomFlag").removeClass("in").addClass("hide");
- if ($("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.symptomFlag == 0) {
- $("#symptomFlag").removeClass("hide").addClass("in");
- if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrHpiFlag == 1) {
- $("#emrHpiFlag").removeClass("in").addClass("hide");
- if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrHpiFlag == 0) {
- $("#emrHpiFlag").removeClass("hide").addClass("in");
- if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrPsFlag == 1) {
- $("#emrPsFlag").removeClass("in").addClass("hide");
- if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrPsFlag == 0) {
- $("#emrPsFlag").removeClass("hide").addClass("in");
- if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.personalHistoryFlag == 1) {
- $("#personalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.personalHistoryFlag == 0) {
- $("#personalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.familyHistoryFlag == 1) {
- $("#familyHistoryFlag").removeClass("in").addClass("hide");
- if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.familyHistoryFlag == 0) {
- $("#familyHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.obstericalHistoryFlag == 1) {
- $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.obstericalHistoryFlag == 0) {
- $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.pressureLeftFlag == 1) {
- $("#pressureLeftFlag").removeClass("in").addClass("hide");
- if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.pressureLeftFlag == 0) {
- $("#pressureLeftFlag").removeClass("hide").addClass("in");
- if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.tentativeDiagnosisFlag == 1) {
- $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
- if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.tentativeDiagnosisFlag == 0) {
- $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
- if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存医生工作台配置
- */
- function saveWorkspaceConfig() {
- var symptomFlag = $("#symptomFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrHpiFlag = $("#emrHpiFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrPsFlag = $("#emrPsFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var personalHistoryFlag = $("#personalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var familyHistoryFlag = $("#familyHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var obstericalHistoryFlag = $("#obstericalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var pressureLeftFlag = $("#pressureLeftFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var tentativeDiagnosisFlag = $("#tentativeDiagnosisFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- $.ajax({
- type: "POST",
- url: '/thmz/saveWorkspaceConfig',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "symptomFlag": symptomFlag,
- "emrHpiFlag": emrHpiFlag,
- "emrPsFlag": emrPsFlag,
- "personalHistoryFlag": personalHistoryFlag,
- "familyHistoryFlag": familyHistoryFlag,
- "obstericalHistoryFlag": obstericalHistoryFlag,
- "pressureLeftFlag": pressureLeftFlag,
- "tentativeDiagnosisFlag": tentativeDiagnosisFlag
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //successMesage(res);
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化药品,检查检验菜单树
- */
- function initzTree() {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 2) {
- $("#jcJyItem").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJyJcZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 1) {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("中药暂无帮助字典");
- } else {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("入院暂无帮助字典");
- }
- }
- /**
- * 节点点击事件
- * @param event
- * @param treeId
- * @param treeNode
- */
- function zTreeOnClick(event, treeId, treeNode) {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").val(treeNode.id);
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0);
- } else if (index == 2) {
- $("#jcJyItem").val(treeNode.id);
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList();
- }
- }
- /**
- * 构建处方参数
- * @returns {any}
- */
- function getParamsForpPrescription() {
- var codes = $("#diagnoseValue").val();
- var icdCode = null;
- if (codes != null && codes.length > 0) {
- var arr = codes.split(",");
- if (arr != null) {
- for (i = 0; i < arr.length; i++) {
- if (arr[i] != "") {
- if (icdCode == null) {
- icdCode = arr[i];
- } else {
- icdCode += "," + arr[i];
- }
- }
- }
- }
- }
- var jsonData = JSON.parse('{"patientId": "","firstOrNot":"","icdCode": "","icdText": null,"jzFlag": "0","serialNo":"","mzBlRecord": {"firstOrNot": "","emrChiefComplaint": "","emrHpi": "","emrPs": "","emrPe": "","emrFzjc": null,"emrProcess": null,"emrXyy": "无","emrYypg": "无","emrGnpg": "无","emrJkjy": "","personalHistory": "","familyHistory": "","obstericalHistory": "","weight": "","temperature": "","sphygmus": "","breathe": "","pressureHigh": "","pressureFloor": "","pressureHighLeft": "","pressureFloorLeft": "","tentativeDiagnosis":"","prescriptionDetail":""},"mzChargeDetailList": [],"mzYjReqList": [],"mzZyReq": {"reqDept": "","smallDept": "","admissStatus": ""}}');
- jsonData.patientId = $("#patientId").text();
- jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
- jsonData.icdCode = icdCode;
- jsonData.serialNo = $("#mzfzSerialNoInClick").val();
- jsonData.mzBlRecord.firstOrNot = jsonData.firstOrNot;
- jsonData.mzBlRecord.emrChiefComplaint = $("#symptom").val();
- jsonData.mzBlRecord.emrHpi = $("#emrHpi").val();
- jsonData.mzBlRecord.emrPs = $("#emrPs").val();
- jsonData.mzBlRecord.emrPe = $("#otherCheck").val();
- jsonData.mzBlRecord.emrJkjy = $("#healthEducation").val();
- jsonData.mzBlRecord.personalHistory = $("#personalHistory").val();
- jsonData.mzBlRecord.familyHistory = $("#familyHistory").val();
- jsonData.mzBlRecord.obstericalHistory = $("#obstericalHistory").val();
- jsonData.mzBlRecord.weight = $("#weight").val();
- jsonData.mzBlRecord.temperature = $("#temperature").val();
- jsonData.mzBlRecord.sphygmus = $("#sphygmus").val();
- jsonData.mzBlRecord.breathe = $("#breathe").val();
- jsonData.mzBlRecord.pressureHigh = $("#pressure_high").val();
- jsonData.mzBlRecord.pressureFloor = $("#pressure_floor").val();
- jsonData.mzBlRecord.pressureHighLeft = $("#pressure_high_left").val();
- jsonData.mzBlRecord.pressureFloorLeft = $("#pressure_floor_left").val();
- jsonData.mzBlRecord.tentativeDiagnosis = $("#tentativeDiagnosis").val();
- //设置处方详情
- var emrFzjc = null;
- var xyTabContents = $("#xyTabContent").find("div.tab-pane");
- //处方号
- var orderNo = 0;
- var arrs = $("span.cf_amount");
- //西药设置
- if (xyTabContents != null && xyTabContents.length > 0) {
- for (var i = 0; i < xyTabContents.length; i++) {
- //当前药品类型
- var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "","frequency": "","orderDays": "","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":""}');
- tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(formGroups[j]).find("input.temporary_items_gross").val();
- tempJson.drugQuan = $(formGroups[j]).find("input.temporary_items_drugWin").val();
- tempJson.drugUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnit").val();
- tempJson.frequency = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
- tempJson.orderDays = $(formGroups[j]).find("input.temporary_items_dayNum").val();
- tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
- tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
- tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
- orderNo = i + 1;
- tempJson.orderNo = orderNo;
- tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
- tempJson.groupNo = currentGroupNo;
- var tryFlag = $(formGroups[j]).find("input.temporary_items_tryFlag").val();
- if (tryFlag == true || tryFlag == "true") {
- tempJson.tryFlag = 1;
- }
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- }
- }
- //中草药
- var zyTabContents = $("#zyTabContent").find("div.form-group");
- if (zyTabContents != null && zyTabContents.length > 0) {
- orderNo++;
- var zyfs = $("input.zyfs").val();
- //中药的类型
- var currentZyClassType = $("#current_zyClassType").val();
- for (var i = 0; i < zyTabContents.length; i++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "g","frequency": "","orderDays": "1","paySelf": "0","drugWin": "","instructionCode":"","instructionText":"","orderNo":"1","groupOrder":"1","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":""}');
- tempJson.chargeItemCode = $(zyTabContents[i]).find("input.temporary_items_code").val();
- tempJson.serial = $(zyTabContents[i]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugQuan = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugWin = zyfs;
- tempJson.frequency = $("#zy_orderFrequency_1").val();
- tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
- tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
- tempJson.cyFysm = $("#useType_1").val();
- tempJson.cyJssm = $("#cyJssm").val();
- tempJson.cyDj = $("#zy_supplyType_1").val();
- tempJson.orderNo = orderNo;
- tempJson.groupNo = currentZyClassType;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- //设置诊疗与医技
- var zlTabContents = $("#zlTabContent").find("div.form-group");
- if (zlTabContents != null && zlTabContents.length > 0) {
- orderNo++;
- for (var i = 0; i < zlTabContents.length; i++) {
- if (emrFzjc == null) {
- emrFzjc = $(zlTabContents[i]).text();
- } else {
- emrFzjc += "," + $(zlTabContents[i]).text();
- }
- var tempJson = null;
- //项目类型
- var itemsType = $(zlTabContents[i]).find("input.temporary_items_type").val();
- //执行科室
- var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
- if (itemsType == "3" || itemsType == 3) {
- //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
- tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "1","drugQuan": "1","drugUnit": "","frequency": "","orderDays": "1","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":"00","execDept":""}');
- tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
- tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- } else {
- tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":""}');
- tempJson.orderCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
- if (itemsType == "1" || itemsType == 1) {
- //检验
- tempJson.inspectStuff = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
- } else if (itemsType == "2" || itemsType == 2) {
- //检查
- tempJson.inspectPart = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
- }
- tempJson.jyRemark = $(zlTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
- }
- }
- }
- //入院
- var zyReqTabContents = $("#zyReqTabContent").find("div.form-group");
- if (zyReqTabContents != null && zyReqTabContents.length > 0) {
- jsonData.mzZyReq.reqDept = $(zyReqTabContents[0]).find("input.temporary_inpatient_ward").val();
- jsonData.mzZyReq.smallDept = $(zyReqTabContents[0]).find("input.temporary_items_small_ward").val();
- jsonData.mzZyReq.admissStatus = $(zyReqTabContents[0]).find("input.temporary_items_admiss_status").val();
- }
- //设置诊断名称
- var icdText = null;
- var tagsTexts = $("span.el-select__tags-text");
- if (tagsTexts != null && tagsTexts.length > 0) {
- for (var i = 0; i < tagsTexts.length; i++) {
- if (icdText == null) {
- icdText = $(tagsTexts[i]).text();
- } else {
- icdText += "," + $(tagsTexts[i]).text();
- }
- }
- }
- jsonData.icdText = icdText;
- jsonData.mzBlRecord.emrFzjc = emrFzjc;
- return jsonData;
- }
- /**
- * 保存处方
- */
- function savePrescription() {
- $("#messageModal").modal();
- $("#messageContent").html("确认保存处方吗?");
- $("#messageButton").off("click").on("click", function (t) {
- //$("#messageModal").modal("hide");
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- clearWorkSpace();
- loadInClinicTableList();
- loadClinicTableList();
- //$("#messageModal").modal();
- $("#messageContent").html("门诊处方保存成功,是否打印处方和门诊指引单?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
- });
- } else {
- $("#messageModal").modal("hide");
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 保存医疗范文
- */
- function saveapidAccepts() {
- var templateName = $("#templateName").val();
- if (templateName == null || templateName == "") {
- errorMesageSimaple("范文名称不能为空!");
- return;
- }
- var templateKindType = $("#templateKindType").val();
- if (templateKindType == null || templateKindType == "") {
- errorMesageSimaple("范文类型不能为空!");
- return;
- }
- var templateType = $("#templateType").val();
- if (templateType == null || templateType == "") {
- errorMesageSimaple("范文范围不能为空!");
- return;
- }
- var templateStatus = $("#templateStatus").val();
- if (templateStatus == null || templateStatus == "") {
- errorMesageSimaple("范文状态不能为空!");
- return;
- }
- $("#saveapidAcceptsModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认保存医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/saveTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#templateId").val(),
- "name": templateName,
- "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
- "templateKindType": templateKindType,
- "templateType": templateType,
- "templateStatus": templateStatus,
- "templateData": JSON.stringify(jsonData),
- "emrChiefComplaint": $("#symptom").val(),
- "emrHpi": $("#emrHpi").val(),
- "emrPs": $("#emrPs").val(),
- "icdCode": $("#diagnoseValue").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- //范本保存完不清空
- //clearWorkSpace();
- } else {
- $("#saveapidAcceptsModal").modal();
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 停用医疗范文
- */
- function removeTemplate() {
- $("#messageModal").modal();
- $("#messageContent").html("确认停用医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/removeTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#idTemplate").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#medicalModelModal").modal("hide");
- fitTemplateData();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 清空医疗范文模块内容
- */
- function clearApidAcceptsModal() {
- $("#templateId").val(null);
- $("#templateName").val(null);
- $("#templateKindType").selectpicker('val', 0);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', 0);
- $("#templateType").selectpicker('refresh');
- $("#templateStatus").selectpicker('val', 0);
- $("#templateStatus").selectpicker('refresh');
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- loadInClinicTableList();
- loadClinicTableList();
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- });
- }
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改 通用方法
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=5&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 0)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询病人已缴费处方信息 调用处方
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoPaid(patientId, times, clnicId) {
- $("#visitingDetailModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
- clearUser(false);
- clearWorkSpaceExcludeUser();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 2)
- $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 重复接诊
- * @param patientId
- * @param times
- * @param clnicId
- * @param deptCode 就诊科室编码
- */
- function repeatAccepts(patientId, times, clnicId, deptCode) {
- $.ajax({
- type: "GET",
- url: '/thmz/validMzyReqrec?patientId=' + patientId + "&deptCode=" + deptCode,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == 0) {
- $("#messageModal").modal();
- $("#messageContent").html("挂号失效,确定继续就诊?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- repeatAcceptsConfirm(patientId, times, clnicId);
- });
- return;
- }
- repeatAcceptsConfirm(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 重复接诊提示方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsConfirm(patientId, times, clnicId) {
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- repeatAcceptsCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- repeatAcceptsCommon(patientId, times, clnicId);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- repeatAcceptsCommon(patientId, times, clnicId);
- });
- }
- }
- /**
- * 重复接诊通用方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=true&payMark=null&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 0)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 就诊详情 已诊患者列表发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- */
- function prescriptionDetail(patientId, times, clnicId, payMark) {
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 0);
- }
- /**
- * 就诊详情 历史轨迹发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param clinicStatus
- */
- function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
- var payMark = null;
- if (clinicStatus == 5) {
- payMark = 5;
- } else {
- payMark = 0;
- }
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
- }
- /**
- * 就诊详情通用方法
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param type 0 已诊患者列表发起 1 历史轨迹发起
- */
- function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
- var oriPayMark = payMark;
- if (payMark == 1) {
- //退费时,查看的明细还是处方开立的情况
- payMark = 0;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#visitingDetailModal").modal();
- var jsonData = res.data;
- var mzPatientMi = res.mzPatientMi;
- $("#visitingDetailPatientName").text(mzPatientMi.name);
- $("#visitingDetailPatientAge").text(mzPatientMi.age);
- $("#visitingDetailPatientGender").val(mzPatientMi.gender);
- $("#prescriptionDetail_zd").html("");
- $("#prescriptionDetail_xyzlContent").html("");
- $("#prescriptionDetail_zyzlContent").html("");
- $("#prescriptionDetail_zlyjContent").html("");
- if (res.opDate != null) {
- $("#visitingDetailDate").text(res.opDate);
- }
- if (res.deptName != null) {
- $("#visitingDetailDept").text(res.deptName);
- }
- if (res.doctorName != null) {
- $("#visitingDetailDoctor").text(res.doctorName);
- }
- var firstOrNot = jsonData.mzBlRecord.firstOrNot;
- if (firstOrNot == 0) {
- $("#visitFlag").html("初诊");
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#visitFlag").html("复诊");
- $("#not").next().click();
- }
- if (oriPayMark == 0) {
- $("#chargeImage").attr("src", "/thmz/images/charge.png");
- } else if (oriPayMark == 1) {
- $("#chargeImage").attr("src", "/thmz/images/refund.png");
- } else if (oriPayMark == 5) {
- $("#chargeImage").attr("src", "/thmz/images/nocharge.png");
- }
- var icdText = jsonData.icdText;
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#prescriptionDetail_zd").html(html);
- } else {
- $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
- }
- var emrProcess = jsonData.mzBlRecord.emrProcess;
- if (emrProcess != null) {
- var xy = null;
- if (emrProcess.indexOf("西药治疗:") >= 0) {
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
- } else if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("医技与诊疗:"));
- } else if (emrProcess.indexOf("入院处理:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("入院处理:"));
- } else {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
- }
- var arr = xy.split("_");
- if (arr != null && arr.length > 0) {
- var xyhtml = "";
- for (var i = 0; i < arr.length; i++) {
- xyhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- xyhtml += arr[i];
- xyhtml += "</div>";
- }
- $("#prescriptionDetail_xyzlContent").html(xyhtml);
- $("#prescriptionDetail_xyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
- }
- var zy = null;
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("医技与诊疗:"));
- } else if (emrProcess.indexOf("入院处理:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("入院处理:"));
- } else {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
- }
- var zyArr = zy.split("_");
- if (zyArr != null && zyArr.length > 0) {
- var zyhtml = "";
- for (var i = 1; i < zyArr.length; i++) {
- if (i % 4 == 1) {
- zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- }
- zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
- zyhtml += zyArr[i];
- zyhtml += "</div>";
- if (i % 4 == 0) {
- zyhtml += '</div>';
- }
- }
- var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
- if (zyfs != null && zyfs != "") {
- if (zyArr.length % 4 == 1) {
- zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- }
- zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
- zyhtml += ' <div style="text-indent: 2em;">';
- zyhtml += ' <div>';
- zyhtml += 'X<span>';
- zyhtml += zyfs;
- zyhtml += '</span> 付</div></div>';
- zyhtml += '</div>';
- }
- $("#prescriptionDetail_zyzlContent").html(zyhtml);
- $("#prescriptionDetail_zyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("医技与诊疗:") >= 0) {
- var zlyj = null;
- if (emrProcess.indexOf("入院处理:") >= 0) {
- zlyj = emrProcess.substring(emrProcess.indexOf("医技与诊疗:") + 6, emrProcess.indexOf("入院处理:"));
- } else {
- zlyj = emrProcess.substring(emrProcess.indexOf("医技与诊疗:") + 6);
- }
- var zlyjArr = zlyj.split("_");
- if (zlyjArr != null && zlyjArr.length > 0) {
- var zlyjhtml = "";
- for (var i = 0; i < zlyjArr.length; i++) {
- zlyjhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- zlyjhtml += zlyjArr[i];
- zlyjhtml += "</div>";
- }
- $("#prescriptionDetail_zlyjContent").html(zlyjhtml);
- $("#prescriptionDetail_zlyjTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("入院处理:") >= 0) {
- var zyReq = emrProcess.substring(emrProcess.indexOf("入院处理:") + 5);
- if (zyReq != null && zyReq != "") {
- var zyReqhtml = "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- zyReqhtml += zyReq;
- zyReqhtml += "</div>";
- $("#prescriptionDetail_zyReqContent").html(zyReqhtml);
- $("#prescriptionDetail_zyReqTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- }
- }
- if (type == 0) {
- $("#callPrescription").removeClass("in").addClass("hide");
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- $("#printPrescription").removeClass("hide").addClass("in");
- $("#printPrescription").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 1);
- });
- $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- $("#printPrescriptionSetup").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 2);
- });
- }
- $("#printJcReq").removeClass("in").addClass("hide");
- $("#printJcReq").off("click");
- $("#printJyReq").removeClass("in").addClass("hide");
- $("#printJyReq").off("click");
- $("#printJcReqSetup").removeClass("in").addClass("hide");
- $("#printJcReqSetup").off("click");
- $("#printJyReqSetup").removeClass("in").addClass("hide");
- $("#printJyReqSetup").off("click");
- if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
- var hadJc = false;
- var hadJy = false;
- for (var i = 0; i < jsonData.mzYjReqList.length; i++) {
- var mzYjReq = jsonData.mzYjReqList[i];
- if (mzYjReq.reqType == 2) {
- hadJy = true;
- } else if (mzYjReq.reqType == 3) {
- hadJc = true;
- }
- }
- if (hadJc) {
- $("#printJcReq").removeClass("hide").addClass("in");
- $("#printJcReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 1);
- });
- $("#printJcReqSetup").removeClass("hide").addClass("in");
- $("#printJcReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 2);
- });
- }
- if (hadJy) {
- $("#printJyReq").removeClass("hide").addClass("in");
- $("#printJyReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 1);
- });
- $("#printJyReqSetup").removeClass("hide").addClass("in");
- $("#printJyReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 2);
- });
- }
- }
- $("#printBlRecord").removeClass("hide").addClass("in");
- $("#printBlRecord").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 1);
- });
- $("#printBlRecordSetup").removeClass("hide").addClass("in");
- $("#printBlRecordSetup").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 2);
- });
- if (jsonData.mzZyReq == null || jsonData.mzZyReq.reqDept == null || jsonData.mzZyReq.reqDept == "") {
- $("#printZyReq").removeClass("in").addClass("hide");
- $("#printZyReq").off("click");
- $("#printZyReqSetup").removeClass("in").addClass("hide");
- $("#printZyReqSetup").off("click");
- } else {
- $("#printZyReq").removeClass("hide").addClass("in");
- $("#printZyReq").off("click").on("click", function (t) {
- printZyReq(patientId, 1);
- });
- $("#printZyReqSetup").removeClass("hide").addClass("in");
- $("#printZyReqSetup").off("click").on("click", function (t) {
- printZyReq(patientId, 2);
- });
- }
- } else {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#callPrescription").removeClass("hide").addClass("in");
- $("#callPrescription").off("click").on("click", function (t) {
- getMzPrescriptionVoPaid(patientId, times, clnicId);
- });
- }
- if (oriPayMark == 1) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- $("#printPrescription").removeClass("hide").addClass("in");
- $("#printPrescription").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 1);
- });
- $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- $("#printPrescriptionSetup").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 2);
- });
- }
- }
- if ($("#setupId").hasClass("fa-chevron-up")) {
- //默认不展开打印设置
- $("#setupId").parent().click();
- }
- // setTimeout(function () {
- // if ($("#setupId").hasClass("fa-chevron-up")) {
- // //默认不展开打印设置
- // $("#setupId").parent().click();
- // }
- // }, 400);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询默认打印机
- */
- function setPrint() {
- if (printIndex >= 0) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getLastWindowsByCurrentUser',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- printIndex = res.data.cgPrintIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
- function setTableHtml(prescriptionDetail) {
- var html = "";
- for (var j = 0; j < prescriptionDetail.length; j++) {
- html += "<tr><td>";
- html += prescriptionDetail[j].substring(0, prescriptionDetail[j].indexOf("用法"));
- html += "</td></tr>";
- html += "<tr><td>";
- html += prescriptionDetail[j].substring(prescriptionDetail[j].indexOf("用法"));
- html += "</td></tr>";
- }
- return {html: html, j: j};
- }
- // /**
- // * 打印门诊指引单
- // * @param patientId
- // * @param times
- // */
- // function printGuideCard(patientId, times) {
- //
- // }
- /**
- * 打印门诊处方
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printPrescription(patientId, times, clnicId, payMark, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null && prescriptionDetail != "") {
- var prescriptionDetailJson = JSON.parse(prescriptionDetail);
- //当前处方只开了住院证则只打印住院证
- if (prescriptionDetailJson.xyPrescription.jePrescription.length == 0 && prescriptionDetailJson.xyPrescription.mjPrescription.length == 0 && prescriptionDetailJson.xyPrescription.pyPrescription.length == 0 && prescriptionDetailJson.xyPrescription.ycPrescription.length == 0 && prescriptionDetailJson.zlPrescription.length == 0 && prescriptionDetailJson.zyPrescription.length == 0 && prescriptionDetailJson.zyReqPrescription.length > 0) {
- printZyReq(patientId, 1);
- return;
- }
- var index = 0;
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院处方笺");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- //LODOP.SET_SHOW_MODE("SETUP_ENABLESS",getCheckSS());
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientNamePrescription").text(mzPatientMi.name);
- $("#patientGenderPrescription").text(mzPatientMi.gender);
- $("#patientAgePrescription").text(mzPatientMi.age);
- $("#patientIdPrescription").text(mzPatientMi.patientId);
- $("#deptPrescription").text(res.deptName);
- $("#doctorPrescription").text(res.doctorName);
- $("#cfTime").text(res.opDate);
- $("#zdPrescription").text(res.data.icdText);
- $("#patientIdGuideCard").text(mzPatientMi.patientId);
- $("#patientNameGuideCard").text(mzPatientMi.name);
- $("#patientDateGuideCard").text(format(new Date(), "yyyy-MM-dd"));
- //普药处方
- var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
- if (pyPrescription != null && pyPrescription.length > 0) {
- for (var i = 0; i < pyPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = pyPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("普通处方");
- $("#cfTitle").text("普通");
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(pyPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //医材处方
- var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
- if (ycPrescription != null && ycPrescription.length > 0) {
- for (var i = 0; i < ycPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = ycPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("医材处方");
- $("#cfTitle").text("普通");
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //麻精处方
- var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
- if (mjPrescription != null && mjPrescription.length > 0) {
- for (var i = 0; i < mjPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = mjPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("麻、精一处方");
- $("#cfTitle").text("麻、精一");
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //精二处方
- var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
- if (jePrescription != null && jePrescription.length > 0) {
- for (var i = 0; i < jePrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = jePrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("精二处方");
- $("#cfTitle").text("精二");
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //中药处方
- if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0) {
- var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;
- if (zyPrescription != null && zyPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zyPrescription.length; i++) {
- if (i % 3 == 0) {
- html += "<tr>";
- }
- html += "<td>";
- html += zyPrescription[i].trim();
- if (i % 3 == 2) {
- html += "</td></tr>";
- } else {
- html += "</td>";
- }
- }
- if (zyPrescription.length % 3 != 0) {
- html += "</tr>";
- }
- html += "<tr><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td>";
- var colNum = 1;
- var frequency = prescriptionDetailJson.zyPrescription[0].frequency;
- if (frequency != null && frequency != "") {
- html += "<td>频率:" + frequency + "</td>";
- colNum++;
- }
- var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
- if (cyJssm != null && cyJssm != "") {
- html += "<td>加水说明:" + cyJssm + "</td>";
- colNum++;
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
- if (cyFysm != null && cyFysm != "") {
- colNum++;
- if (colNum % 3 == 1) {
- html += "<tr>";
- }
- html += "<td>服用说明:" + cyFysm + "</td>";
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
- if (cyDj != null && cyDj != "") {
- colNum++;
- if (colNum % 3 == 1) {
- html += "<tr>";
- }
- html += "<td>" + cyDj + "</td>";
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("中药处方");
- $("#cfTitle").text("普通");
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 (不含代煎费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- if (prescriptionDetailJson.zlPrescription != null && prescriptionDetailJson.zlPrescription.length > 0) {
- //诊疗处方
- var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
- if (zlPrescription != null && zlPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zlPrescription.length; i++) {
- html += "<tr><td>";
- html += zlPrescription[i];
- html += "</td></tr>";
- }
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("诊疗处方");
- $("#cfTitle").text("普通");
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- var html = "";
- for (var i = 0; i < res.data.length; i++) {
- html += "<tr><td>" + res.data[i].itemType + "</td><td>" + Division(res.data[i].itemTotalFee, 100).toFixed(2) + "</td><td>" + res.data[i].execDeptName + "</td><td>" + res.data[i].execDeptAddress + "</td></tr>"
- }
- $("#guideCardDetail").html(html);
- }
- if (res.payQrcode != null && res.payQrcode != "") {
- $("#payQrcodeGuideCard").html(null);
- new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
- $("canvas").attr("id", "erw");
- var canvas = document.getElementById('erw');
- var src = canvas.toDataURL("image/png");
- //var strDataURI =canvas.toDataURL("image/png");
- $("#payQrcodeGuideCard").html("<img src='" + src + "' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>微信支付</div>");
- }
- $("#totalAmountGuideCard").text("¥" + res.totalAmount);
- // $("#imgcode").JsBarcode(patientId);
- console.log(patientId);
- JsBarcode('#imgcode', patientId, {
- lineColor: '#333', //线条颜色
- width: 2, //线宽
- height: 60, //条码高度
- displayValue: false, //是否显示文字信息
- });
- if (index > 0) {
- LODOP.NewPageA();
- }
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
- //LODOP.PRINT();
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else if (res.code == -2) {
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- // printGuideCard(patientId, times);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 构建体征描述
- * @param mzBlRecord
- * @returns {*}
- */
- function getTz(mzBlRecord) {
- var tz = null;
- if (mzBlRecord.weight != null && mzBlRecord.weight != 0) {
- var temp = "体重:" + mzBlRecord.weight + "kg ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.temperature != null && mzBlRecord.temperature != 0) {
- var temp = "体温:" + mzBlRecord.temperature + "℃ ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.sphygmus != null && mzBlRecord.sphygmus != 0) {
- var temp = "脉搏:" + mzBlRecord.sphygmus + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.breathe != null && mzBlRecord.breathe != 0) {
- var temp = "呼吸:" + mzBlRecord.breathe + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHigh != null && mzBlRecord.pressureFloor != null && mzBlRecord.pressureHigh != 0 && mzBlRecord.pressureFloor != 0) {
- var temp = "血压:" + mzBlRecord.pressureHigh + "/" + mzBlRecord.pressureFloor;
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHighLeft != null && mzBlRecord.pressureFloorLeft != null && mzBlRecord.pressureHighLeft != 0 && mzBlRecord.pressureFloorLeft != 0) {
- var temp = "左血压:" + mzBlRecord.pressureHighLeft + "/" + mzBlRecord.pressureFloorLeft;
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- return tz;
- }
- /**
- * 打印医技申请单
- * @param patientId
- * @param times
- * @param type 申请单类型:2:检验;3:检查
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printYjReq(patientId, times, type, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printYjReq?patientId=' + patientId + '×=' + times + "&reqType=" + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.mzYjReqList == null || res.data.mzYjReqList.length == 0) {
- errorMesageSimaple("没有医技申请单可以打印");
- return;
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院检查申请单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "检查申请单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.data.mzPatientMi;
- $("#patientIdJcReq").text(mzPatientMi.patientId);
- $("#patientNameJcReq").text(mzPatientMi.name);
- $("#patientGenderJcReq").text(mzPatientMi.gender);
- $("#patientAgeJcReq").text(mzPatientMi.age + "岁");
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.mzVisitTable.icdText);
- $("#patientIdJyReq").text(mzPatientMi.patientId);
- $("#patientNameJyReq").text(mzPatientMi.name);
- $("#patientGenderJyReq").text(mzPatientMi.gender);
- $("#patientAgeJyReq").text(mzPatientMi.age + "岁");
- $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
- $("#icdTextJyReq").text(res.data.mzVisitTable.icdText);
- var mzBlRecord = res.data.mzBlRecord;
- $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jcReqHis").text(mzBlRecord.emrHpi);
- $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jyReqHis").text(mzBlRecord.emrHpi);
- var tz = getTz(mzBlRecord);
- $("#jcReqTz").text(tz);
- $("#jcReqReqDept").text(res.data.deptName);
- $("#jcReqReqDoctor").text(res.data.doctorName);
- $("#jyReqTz").text(tz);
- $("#jyReqReqDept").text(res.data.deptName);
- $("#jyReqReqDoctor").text(res.data.doctorName);
- for (var i = 0; i < res.data.mzYjReqList.length; i++) {
- var obj = res.data.mzYjReqList[i];
- if (i == 0) {
- var dateStr = format(obj.reqDate, "yyyy-MM-dd");
- $("#jcReqReqDate").text(dateStr);
- $("#jyReqReqDate").text(dateStr);
- }
- if (i > 0) {
- LODOP.NewPageA();
- }
- if (obj.reqType == "3") {
- $("#reqNoJcReq").text(obj.reqNo);
- $("#jcReqItem").text(obj.groupName);
- $("#jcReqRemark").text(obj.jyRemark);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
- } else if (obj.reqType == "2") {
- $("#reqNoJyReq").text(obj.reqNo);
- $("#jyReqItem").text(obj.groupName);
- $("#jyReqInspectStuff").text(obj.inspectStuff);
- //检验
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jy_card_table").innerHTML);
- }
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印门诊病历
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printBlRecord(patientId, times, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院门诊病历");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊病历");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientIdBlrecord").text(mzPatientMi.patientId);
- $("#patientNameBlrecord").text(mzPatientMi.name);
- $("#patientGenderBlrecord").text(mzPatientMi.gender);
- $("#patientAgeBlrecord").text(mzPatientMi.age + "岁");
- var mzBlRecord = res.mzBlRecord;
- if (mzBlRecord.firstOrNot == "1") {
- $("#firstOrNotTitle").text("复诊");
- } else {
- $("#firstOrNotTitle").text("初诊");
- }
- if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
- $("#emrChiefComplaintBlrecord").text(mzBlRecord.emrChiefComplaint);
- $("#emrChiefComplaintBlrecord").parent().css("display", "block");
- } else {
- $("#emrChiefComplaintBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
- $("#emrHpiBlrecord").text(mzBlRecord.emrHpi);
- $("#emrHpiBlrecord").parent().css("display", "block");
- } else {
- $("#emrHpiBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
- $("#emrPsBlrecord").text(mzBlRecord.emrPs);
- $("#emrPsBlrecord").parent().css("display", "block");
- } else {
- $("#emrPsBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
- $("#personalHistoryBlrecord").text(mzBlRecord.personalHistory);
- $("#personalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#personalHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
- $("#familyHistoryBlrecord").text(mzBlRecord.familyHistory);
- $("#familyHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#familyHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
- $("#obstericalHistoryBlrecord").text(mzBlRecord.obstericalHistory);
- $("#obstericalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#obstericalHistoryBlrecord").parent().css("display", "none");
- }
- var tz = getTz(mzBlRecord);
- if (tz != null && tz != "") {
- $("#tzjcBlrecord").text(tz);
- $("#tzjcBlrecord").parent().css("display", "block");
- } else {
- $("#tzjcBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- $("#emrPeBlrecord").text(mzBlRecord.emrPe);
- $("#emrPeBlrecord").parent().css("display", "block");
- } else {
- $("#emrPeBlrecord").parent().css("display", "none");
- }
- if (res.icdText != null && res.icdText != "") {
- $("#icdTextBlrecord").text(res.icdText);
- $("#icdTextBlrecord").parent().css("display", "block");
- } else {
- $("#icdTextBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
- $("#emrProcessBlrecord").parent().css("display", "block");
- } else {
- $("#emrProcessBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
- $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
- $("#emrJkjyBlrecord").parent().css("display", "block");
- } else {
- $("#emrJkjyBlrecord").parent().css("display", "none");
- }
- $("#visitDeptBlrecord").text(res.deptName);
- $("#visitDoctorBlrecord").text(res.doctorName);
- $("#visitDateBlrecord").text(res.visitDate);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印入院通知单
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printZyReq(patientId, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printZyReq?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院入院通知单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var mzZyReq = res.mzZyReq;
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.age + "岁");
- $("#sfzZyReq").text(mzPatientMi.icCardNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- $("#reqDeptZyReq").text(mzZyReq.reqWard);
- $("#smallDeptZyReq").text(mzZyReq.smallDept);
- $("#admissStatusZyReq").text(mzZyReq.admissStatus);
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptCode);
- $("#doctorCodeZyReq").text(mzZyReq.doctorCode);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化科室下拉选
- */
- function initExecUnit() {
- //父科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $('#execUnit').empty(); //清空resText里面的所有内容
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
- });
- $('#execUnit').html(html);
- $('#execUnit').selectpicker('refresh');
- }
- });
- }
|