clinic.js 420 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590
  1. //@ sourceURL=clinic.js
  2. //判断病人列表是否在加载中,防止重复加载
  3. var msg_list_loading = false;
  4. //挂号卡片列表页面下标
  5. var pageIndex = 0;
  6. //药品使用方法,天数和频次的集合
  7. var groupIdMap = null;
  8. var LODOP; //声明为全局变量
  9. //默认打印机下标
  10. var printIndex = -1;
  11. // //上一個光标点击的元素ID
  12. var prevEleId = null;
  13. //打开检查检验报告的时候不知道哪个有报告,如果检查没有就自动打开检验,但是为了防止死循环,次数加到1就不在进行重试
  14. var retryCount = 0;
  15. $(function () {
  16. initGenderSelect();
  17. iniAdmissStatus();
  18. initListDeptSelect();
  19. initResponceTypeSelect();
  20. initTemplateTypeSelect();
  21. initTemplateKindTypeSelect('templateKindType');
  22. initZyClassTypeSelect();
  23. initInstructionSelect();
  24. setSelectSize();
  25. initCertificateTypeSelect();
  26. $('#editUserBirthDayGroup').datetimepicker({
  27. format: 'yyyy-mm-dd',
  28. language: 'zh-CN',
  29. minView: "month",
  30. });
  31. initDaterangepickerWithId('reportrange', "right");
  32. formatCheck();
  33. //数据校验
  34. init_validator();
  35. //初始频次下拉选
  36. initOrderFrequencys("orderFrequency", true);
  37. //初始用药方式下拉选
  38. initSupplyTypes();
  39. //加载候诊患者列表
  40. loadUnClinicTableList();
  41. //加载接诊中患者列表
  42. loadInClinicTableList();
  43. //加载已接诊患者列表
  44. loadClinicTableList();
  45. //每隔一分钟秒读加载候诊患者列表
  46. setInterval(function () {
  47. //加载候诊患者列表
  48. loadUnClinicTableList();
  49. //加载已接诊患者列表 病人会缴费,需要刷新状态
  50. loadClinicTableList();
  51. }, 60000);
  52. //初始化快速接诊病人姓名栏事件
  53. initUserList();
  54. //初始化主诉弹出层
  55. initRecommendList();
  56. //卡号输入改变事件
  57. cardNoChange();
  58. /**
  59. * 患者信息修改
  60. */
  61. $("#saveEditUser").on("click", function (t) {
  62. modifyPatient();
  63. });
  64. // /**
  65. // * 保存入院证
  66. // */
  67. // $("#saveBeHospitalized").on("click", function (t) {
  68. // saveBeHospitalized();
  69. // });
  70. /**
  71. * 打印入院证
  72. */
  73. $("#printBeHospitalized").on("click", function (t) {
  74. modifyPatient();
  75. });
  76. //折叠按钮初始化
  77. $('.collapse-link').on('click', function () {
  78. var $BOX_PANEL = $(this).closest('.x_panel_mine'),
  79. $ICON = $(this).find('i'),
  80. $BOX_CONTENT = $BOX_PANEL.find('.x_content');
  81. // fix for some div with hardcoded fix class
  82. if ($BOX_PANEL.attr('style')) {
  83. $BOX_CONTENT.slideToggle(200, function () {
  84. $BOX_PANEL.removeAttr('style');
  85. });
  86. } else {
  87. $BOX_CONTENT.slideToggle(200);
  88. $BOX_PANEL.css('height', 'auto');
  89. }
  90. $ICON.toggleClass('fa-chevron-up fa-chevron-down');
  91. });
  92. /**
  93. * 接诊
  94. */
  95. $("#clinicalReception").on("click", function (t) {
  96. var patientIdDb = $("#patientIdDb").val();
  97. if (patientIdDb == null || patientIdDb == "") {
  98. errorMesageSimaple("当前未选择病人,无法接诊");
  99. return;
  100. }
  101. $.ajax({
  102. type: "GET",
  103. url: '/thmz/getMzfzPatientOrderByPatientId?patientId=' + patientIdDb,
  104. contentType: "application/json;charset=UTF-8",
  105. dataType: "json",
  106. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  107. success: function (res) {
  108. if (res == '401' || res == 401) {
  109. window.location.href = '/thmz/login/view'
  110. return;
  111. }
  112. if (res.code == 0) {
  113. if (res.data != null && res.data.length > 0) {
  114. if (res.data.length == 1) {
  115. //快速接诊的时候不知道分诊号
  116. clinicalReception(patientIdDb, res.data[0].serialNo);
  117. } else {
  118. $("#mzfzPatientOrderModal").modal();
  119. $("#mzfzPatientOrderTable").html(null);
  120. for (var i = 0; i < res.data.length; i++) {
  121. var roomCode = res.data[i].roomCode;
  122. if (roomCode == null || roomCode == "null") {
  123. roomCode = "";
  124. }
  125. $("<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 () {
  126. $("#mzfzPatientOrderModal").modal("hide");
  127. clinicalReception(patientIdDb, $(this).attr("data-target"));
  128. });
  129. }
  130. }
  131. clearRapidAcceptsModal();
  132. $("#rapidAcceptsModal").modal("hide");
  133. } else {
  134. errorMesageSimaple("当前病人没有分诊信息");
  135. }
  136. } else if (res.code == 200) {
  137. clearRapidAcceptsModal();
  138. $("#rapidAcceptsModal").modal("hide");
  139. clinicalReception(patientIdDb, null);
  140. } else {
  141. errorMesage(res);
  142. }
  143. }
  144. });
  145. });
  146. /**
  147. * 存为范本
  148. */
  149. $("#saveapidAccepts").on("click", function (t) {
  150. // var symptom = $("#symptom").val();
  151. // if (symptom == null || symptom == "") {
  152. // errorMesageSimaple("主诉不能为空!");
  153. // return;
  154. // }
  155. //var emrHpi = $("#emrHpi").val();
  156. // if (emrHpi == null || emrHpi == "") {
  157. // errorMesageSimaple("现病史不能为空!");
  158. // return;
  159. // }
  160. // var diagnoseValue = $("#diagnoseValue").val();
  161. // var tentativeDiagnosis = $("#tentativeDiagnosis").val();
  162. // if (diagnoseValue != null) {
  163. // var reg = new RegExp(',', "g")
  164. // diagnoseValue = diagnoseValue.replace(reg, '');
  165. // }
  166. // if ((diagnoseValue == null || diagnoseValue == "") && (tentativeDiagnosis == null || tentativeDiagnosis == "")) {
  167. // errorMesageSimaple("诊断和初步诊断不能同时为空!");
  168. // return;
  169. // }
  170. //关闭帮助框
  171. $("#treeButton").webuiPopover('hide');
  172. $("#western_medicine_name").webuiPopover('hide');
  173. $("#chinese_medicine_name").webuiPopover('hide');
  174. $("#jcJyItem").webuiPopover('hide');
  175. $("#zlItem").webuiPopover('hide');
  176. $("#saveapidAcceptsModal").modal("show");
  177. });
  178. /**
  179. * 实例化智能问诊弹窗
  180. */
  181. // $("[data-toggle='popover']").popover();
  182. $("#box-arrow-left").popover({
  183. html: 'true',
  184. content: '<div id="smartAssistPopoverContent"></div>'
  185. });
  186. //初始化药品分组下拉选
  187. initGroupOrder();
  188. // 初始化用药天数下拉选
  189. initDayNum();
  190. //页面加载完成初始化西药处方
  191. //initNavTabs(0);
  192. //页面加载完成初始化住院处方
  193. //initNavTabs(3);
  194. //初始医生工作太配置
  195. initWorkspaceConfigForCurrent();
  196. initExecUnit();
  197. /**
  198. * 西药点击事件
  199. */
  200. $("#western_medicine_name").on("click", function (t) {
  201. var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
  202. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  203. $('#western_medicine_name').webuiPopover('hide');
  204. $("#treeButton").webuiPopover('hide');
  205. return;
  206. }
  207. $('#western_medicine_name').webuiPopover('show');
  208. loadYpList(0, null);
  209. });
  210. /**
  211. * 中药点击事件
  212. */
  213. $("#chinese_medicine_name").on("click", function (t) {
  214. var obj = $("#chineseMedicinePopoverContent").parent().parent().parent();
  215. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  216. $('#chinese_medicine_name').webuiPopover('hide');
  217. $("#treeButton").webuiPopover('hide');
  218. return;
  219. }
  220. $('#chinese_medicine_name').webuiPopover('show');
  221. loadYpList(1, null);
  222. });
  223. /**
  224. * 辅助检查、检验点击事件
  225. */
  226. $("#jcJyItem").on("click", function (t) {
  227. if ($("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
  228. $('#jcJyItem').webuiPopover('hide');
  229. $("#treeButton").webuiPopover('hide');
  230. return;
  231. }
  232. $('#jcJyItem').webuiPopover('show');
  233. loadjcJyItemList(null);
  234. });
  235. /**
  236. * 诊疗点击事件
  237. */
  238. $("#zlItem").on("click", function (t) {
  239. if ($("#zlItemPopoverContent").parent().parent().parent().hasClass("in")) {
  240. $('#zlItem').webuiPopover('hide');
  241. $("#treeButton").webuiPopover('hide');
  242. return;
  243. }
  244. $('#zlItem').webuiPopover('show');
  245. loadZlItemList(null);
  246. });
  247. initYshPart();
  248. initJyZdSample();
  249. setTimeout(function () {
  250. getLodop();
  251. }, 800);
  252. //键盘监听回车键
  253. $(document).unbind("keyup").keyup(function (event) {
  254. var index = getIndex("bill_item_group");
  255. if (event.keyCode == 13) { //是否是回车
  256. var el = event.srcElement || event.target;
  257. var id = el.getAttribute("id");
  258. var current_code = null;
  259. if(index==0){
  260. current_code= $("#western_medicine_current_code").val();
  261. }else if(index==1){
  262. current_code= $("#chinese_medicine_current_code").val();
  263. }else if(index==2){
  264. current_code= $("#jcjy_current_code").val();
  265. }else if(index==3){
  266. current_code= $("#zl_current_code").val();
  267. }
  268. if (id == null || id == "") {
  269. id = el.getAttribute("data-id");
  270. }
  271. if (id == null || id == "") {
  272. var search = el.getAttribute("aria-label");
  273. if (search == "Search") {
  274. id = $(el).parent().parent().prev().attr("data-id");
  275. }
  276. }
  277. if (id != null && id != "") {
  278. //将当前点击的id记录下
  279. //prevEleId = id;
  280. } else if (prevEleId != null) {
  281. id = prevEleId;
  282. }
  283. //回车时,光标不在任何区域判断是不是在药品和诊疗开立区域
  284. if (id == null || id == "") {
  285. var index = getIndex("bill_item_group");
  286. if (index == 0) {
  287. if (current_code != null && current_code != "") {
  288. //当前页面是西药保存页面,且有药品选中
  289. $("#supplyType").next().click();
  290. }
  291. } else if (index == 1) {
  292. //当前页面是中草药保存页面,且有药品选中
  293. } else if (index == 2) {
  294. if (current_code != null && current_code != "") {
  295. //当前页面是医技保存页面,且有选中
  296. if ($("#jyZdSampleDiv").hasClass('in')) {
  297. //此时是检验
  298. $("#jyZdSample").next().click();
  299. } else if ($("#yshPartDiv").hasClass('in')) {
  300. //说明现在是检查
  301. $("#yshPart").next().click();
  302. }
  303. }
  304. } else if (index == 3) {
  305. //诊疗
  306. $("#yshPart").next().click();
  307. return;
  308. } else if (index == 4) {
  309. //当前页面是住院保存页面
  310. $("#inpatientWardBeHospitalized").next().click();
  311. return;
  312. }
  313. }
  314. var customization = $("div.customization").not(".hide");
  315. // //回车时,光标不在任何区域,默认点击主诉
  316. // if (id == null || id == "") {
  317. // var eleId = $(customization[0]).attr("target-id");
  318. // $("#" + eleId).focus();
  319. // if (eleId == 'symptom') {
  320. // $("#" + eleId).click();
  321. // }
  322. // console.log("eleId=" + eleId);
  323. // } else
  324. if (id == 'symptom' || id == 'emrHpi' || id == 'emrPs' || id == 'personalHistory' || id == 'familyHistory' || id == 'obstericalHistory' || id == 'otherCheck' || id == 'diagnose' || id == 'tentativeDiagnosis') {
  325. console.log("1id=" + id);
  326. if (id != $(customization[customization.length - 1]).attr("target-id")) {
  327. var next = $("#" + id + "Flag").next();
  328. while ($(next).hasClass("foreclose") || $(next).hasClass("hide")) {
  329. next = $(next).next();
  330. }
  331. var eleId = $(next).attr("target-id");
  332. $("#" + eleId).focus();
  333. if (eleId == 'diagnose' || id == 'diagnose' || id == 'symptom') {
  334. $("#" + eleId).click();
  335. }
  336. console.log("1eleId=" + eleId);
  337. } else {
  338. var data_target = $("#symptom").attr("data-target");
  339. $("#" + data_target).find("a.close").click();
  340. data_target = $("#diagnose").attr("data-target");
  341. $("#" + data_target).find("a.close").click();
  342. if (index == 0) {
  343. $("#western_medicine_name").focus();
  344. } else if (index == 1) {
  345. $("#chinese_medicine_name").focus();
  346. } else if (index == 2) {
  347. $("#jcJyItem").focus();
  348. } else if (index == 3) {
  349. $("#zlItem").focus();
  350. } else if (index == 4) {
  351. $("#inpatientWardBeHospitalized").next().click();
  352. }
  353. }
  354. } else if (id == 'zy_drugWin') {
  355. $("#zyInstruction").next().click();
  356. } else if (id == 'zyInstruction') {
  357. var ariaExpanded = $("#zyInstruction").next().attr("aria-expanded");
  358. if (ariaExpanded == true || ariaExpanded == "true") {
  359. $("#zyInstruction").next().click();
  360. }
  361. $("#saveChineseMedicine").click();
  362. $("#zyfs").focus();
  363. // saveMedicine(1);
  364. }
  365. // else if (id == 'saveChineseMedicine') {
  366. // $("input.zyfs").focus();
  367. // }
  368. else if (id == 'zyfs') {
  369. $("#zy_orderFrequency_1").next().click();
  370. } else if (id == 'zy_orderFrequency_1') {
  371. $("#useType_1").next().click();
  372. } else if (id == 'useType_1') {
  373. $("#cyJssm").next().click();
  374. } else if (id == 'cyJssm') {
  375. $("#zy_supplyType_1").next().click();
  376. } else if (id == 'zy_supplyType_1') {
  377. $("#chinese_medicine_name").focus();
  378. $("#chinese_medicine_name").click();
  379. } else if (id == 'supplyType') {
  380. $("#drugWinUnit").next().click();
  381. } else if (id == 'drugWinUnit') {
  382. $("#drugWin").focus();
  383. } else if (id == 'drugWin') {
  384. $("#dayNum").next().click();
  385. } else if (id == 'dayNum') {
  386. $("#orderFrequency").next().click();
  387. } else if (id == 'orderFrequency') {
  388. $("#gross").focus();
  389. } else if (id == 'gross') {
  390. $("#packUnit").next().click();
  391. } else if (id == 'packUnit') {
  392. $("#medicalAdvice").next().click();
  393. } else if (id == 'medicalAdvice') {
  394. var ariaExpanded = $("#medicalAdvice").next().attr("aria-expanded");
  395. if (ariaExpanded == true || ariaExpanded == "true") {
  396. $("#medicalAdvice").next().click();
  397. }
  398. saveMedicine(0);
  399. $("#western_medicine_name").focus();
  400. } else if (id == 'saveWesternMedicine') {
  401. $("#western_medicine_name").focus();
  402. $("#western_medicine_name").click();
  403. }else if (id == 'jyZdSample' || id == 'yshPart') {
  404. $("#execUnit").next().click();
  405. } else if (id == 'execUnit') {
  406. var ariaExpanded = $("#execUnit").next().attr("aria-expanded");
  407. if (ariaExpanded == true || ariaExpanded == "true") {
  408. $("#execUnit").next().click();
  409. }
  410. $("#remark").focus();
  411. } else if (id == 'remark') {
  412. saveJyJcItem(true);
  413. $("#jcJyItem").focus();
  414. }else if (id == 'chargeUnit') {
  415. $("#zlExecUnit").next().click();
  416. } else if (id == 'zlExecUnit') {
  417. var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
  418. if (ariaExpanded == true || ariaExpanded == "true") {
  419. $("#zlExecUnit").next().click();
  420. }
  421. $("#itemQuantity").focus();
  422. }else if(id == 'itemQuantity' ){
  423. $("#zlRemark").focus();
  424. }else if (id == 'zlRemark') {
  425. saveZlItem(true);
  426. $("#zlItem").focus();
  427. } else if (id == 'inpatientWardBeHospitalized') {
  428. $("#smallWardBeHospitalized").next().click();
  429. } else if (id == 'smallWardBeHospitalized') {
  430. $("#admissStatus").next().click();
  431. } else if (id == 'admissStatus') {
  432. saveZyReq(true);
  433. $("#zy_req_button").focus();
  434. } else if (id == 'western_medicine_name') {
  435. var webuiID = $("#western_medicine_name").attr("data-target");
  436. if (webuiID == null || webuiID == "null" || webuiID == "") {
  437. //药品查询框是空白的,打开查询框
  438. $("#western_medicine_name").click();
  439. return;
  440. }
  441. //选择框打开
  442. if ($("#" + webuiID).hasClass("in")) {
  443. var arr = $("#tb_table_western_medicine").find("tbody").find("tr.trhover");
  444. if (arr != undefined && arr != null && arr.length > 0) {
  445. var dataIndex = $(arr).attr("data-index");
  446. var tableData = $("#tb_table_western_medicine").bootstrapTable('getData');
  447. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  448. var trData = tableData[dataIndex];
  449. checkYpInfo(trData.code, trData.serial, trData.ypType, true);
  450. $("#western_medicine_name").click();
  451. }
  452. } else {
  453. //药品查询框是空白的,打开查询框
  454. $("#western_medicine_name").click();
  455. }
  456. } else {
  457. if (current_code != null && current_code != "") {
  458. //已经选中药品,跳到用法
  459. $("#supplyType").next().click();
  460. } else {
  461. //药品查询框是空白的,打开查询框
  462. $("#western_medicine_name").click();
  463. }
  464. }
  465. } else if (id == 'chinese_medicine_name') {
  466. var webuiID = $("#chinese_medicine_name").attr("data-target");
  467. if (webuiID == null || webuiID == "null" || webuiID == "") {
  468. $("#chinese_medicine_name").click();
  469. return;
  470. }
  471. //选择框打开
  472. if ($("#" + webuiID).hasClass("in")) {
  473. var arr = $("#tb_table_chinese_medicine").find("tbody").find("tr.trhover");
  474. if (arr != undefined && arr != null && arr.length > 0) {
  475. var dataIndex = $(arr).attr("data-index");
  476. var tableData = $("#tb_table_chinese_medicine").bootstrapTable('getData');
  477. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  478. var trData = tableData[dataIndex];
  479. checkZyInfo(trData.code, trData.serial, true);
  480. $("#chinese_medicine_name").click();
  481. }
  482. } else {
  483. //药品查询框是空白的,打开查询框
  484. $("#chinese_medicine_name").click();
  485. }
  486. } else {
  487. if (current_code != null && current_code != "") {
  488. //已经选中药品,跳到剂量
  489. $("#zy_drugWin").next().click();
  490. } else {
  491. //药品查询框是空白的,打开查询框
  492. $("#chinese_medicine_name").click();
  493. }
  494. }
  495. } else if (id == 'jcJyItem') {
  496. var webuiID = $("#jcJyItem").attr("data-target");
  497. if (webuiID == null || webuiID == "null" || webuiID == "") {
  498. $("#jcJyItem").click();
  499. return;
  500. }
  501. //选择框打开
  502. if ($("#" + webuiID).hasClass("in")) {
  503. var arr = $("#tb_table_jc_jy_item").find("tbody").find("tr.trhover");
  504. if (arr != undefined && arr != null && arr.length > 0) {
  505. var dataIndex = $(arr).attr("data-index");
  506. var tableData = $("#tb_table_jc_jy_item").bootstrapTable('getData');
  507. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  508. var trData = tableData[dataIndex];
  509. $('#jcJyItem').webuiPopover('hide');
  510. $("#jcJyZltype").val(trData.type);
  511. $("#execUnit").selectpicker('val', trData.execUnit);//默认不选中
  512. $("#execUnit").selectpicker('refresh');
  513. if (trData.type == 1) {
  514. //检验
  515. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  516. $("#chargeUnitDiv").removeClass("in").addClass("hide");
  517. $("#yshPartDiv").removeClass("in").addClass("hide");
  518. if (trData.sampleCode != null && trData.sampleCode != "") {
  519. $("#jyZdSample").selectpicker('val', trData.sampleCode);
  520. $('#jyZdSample').selectpicker('refresh');
  521. }
  522. } else if (trData.type == 2) {
  523. //检查
  524. $("#yshPartDiv").removeClass("hide").addClass("in");
  525. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  526. $("#chargeUnitDiv").removeClass("in").addClass("hide");
  527. if (trData.bwCode != null && trData.bwCode != "") {
  528. $("#yshPart").selectpicker('val', trData.bwCode);
  529. $('#yshPart').selectpicker('refresh');
  530. }
  531. }
  532. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  533. checkJcJyItemInfo(trData.code, trData.name, trData.type, true);
  534. }
  535. } else {
  536. //药品查询框是空白的,打开查询框
  537. $("#jcJyItem").click();
  538. }
  539. } else {
  540. if (current_code != null && current_code != "") {
  541. //如果是保存失败的,重新打开输入框查询
  542. if(prevEleId=='remark'){
  543. $("#jcJyItem").click();
  544. }else {
  545. //当前页面是医技保存页面,且有选中
  546. if ($("#jyZdSampleDiv").hasClass('in')) {
  547. //此时是检验
  548. $("#jyZdSample").next().click();
  549. } else if ($("#yshPartDiv").hasClass('in')) {
  550. //说明现在是检查
  551. $("#yshPart").next().click();
  552. }
  553. }
  554. } else {
  555. //药品查询框是空白的,打开查询框
  556. $("#jcJyItem").click();
  557. }
  558. }
  559. } else if (id == 'zlItem') {
  560. var webuiID = $("#zlItem").attr("data-target");
  561. if (webuiID == null || webuiID == "null" || webuiID == "") {
  562. $("#zlItem").click();
  563. return;
  564. }
  565. //选择框打开
  566. if ($("#" + webuiID).hasClass("in")) {
  567. var arr = $("#tb_table_zl_item").find("tbody").find("tr.trhover");
  568. if (arr != undefined && arr != null && arr.length > 0) {
  569. var dataIndex = $(arr).attr("data-index");
  570. var tableData = $("#tb_table_zl_item").bootstrapTable('getData');
  571. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  572. var trData = tableData[dataIndex];
  573. $('#zlItem').webuiPopover('hide');
  574. $("#zlExecUnit").selectpicker('val', trData.execUnit);//默认不选中
  575. $("#zlExecUnit").selectpicker('refresh');
  576. //诊疗
  577. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  578. initNavTabs(3);
  579. }
  580. $("#zlItem").val(trData.name);
  581. $("#zlItem").blur();
  582. $("#zlItemPrice").val(trData.chargeAmount);
  583. $("#chargeUnit").val(trData.specification);
  584. $("#zl_current_code").val(trData.code);
  585. $("#itemQuantity").val(1);
  586. $("#chargeUnit").focus();
  587. }
  588. } else {
  589. //药品查询框是空白的,打开查询框
  590. $("#zlItem").click();
  591. }
  592. } else {
  593. if (current_code != null && current_code != "") {
  594. //如果是保存失败的,重新打开输入框查询
  595. if(prevEleId=='zlRemark'){
  596. $("#zlItem").click();
  597. }else {
  598. $("#chargeUnit").focus();
  599. }
  600. } else {
  601. //药品查询框是空白的,打开查询框
  602. $("#zlItem").click();
  603. }
  604. }
  605. }else if (id == 'zy_req_button') {
  606. //当前页面是住院保存页面,此时光标在入院按钮上
  607. console.log("入院按钮")
  608. $("#inpatientWardBeHospitalized").next().click();
  609. }
  610. if (id != null && id != "") {
  611. //将当前点击的id记录下
  612. prevEleId = id;
  613. }
  614. }else if(event.keyCode == 37){
  615. // //左键事件
  616. // if(index==0){
  617. // return;
  618. // }
  619. // var prevObject=$("#bill_item_group").find("button")[index-1];
  620. // $(prevObject).click();
  621. }else if (event.keyCode == 38) {
  622. //上键事件
  623. var tableId = null;
  624. var inputId = null;
  625. var contentId = null;
  626. if (index == 0) {
  627. tableId = "tb_table_western_medicine";
  628. inputId = "western_medicine_name";
  629. contentId = "westernMedicinePopoverContent";
  630. } else if (index == 1) {
  631. tableId = "tb_table_chinese_medicine";
  632. inputId = "chinese_medicine_name";
  633. contentId = "chineseMedicinePopoverContent";
  634. } else if (index == 2) {
  635. tableId = "tb_table_jc_jy_item";
  636. inputId = "jcJyItem";
  637. contentId = "jcJyItemPopoverContent";
  638. } else if (index == 3) {
  639. tableId = "tb_table_zl_item";
  640. inputId = "zlItem";
  641. contentId = "zlItemPopoverContent";
  642. }
  643. if (inputId == null) {
  644. return;
  645. }
  646. var webuiID = $("#" + inputId).attr("data-target");
  647. if (webuiID == null || webuiID == "null" || webuiID == "") {
  648. return;
  649. }
  650. //选择框打开
  651. if ($("#" + webuiID).hasClass("in")) {
  652. var arr = $("#" + tableId).find("tbody").find("tr.trhover");
  653. var prev = $(arr).prev();
  654. if (arr != undefined && arr != null && arr.length > 0) {
  655. if (prev != undefined && prev != null && prev.length > 0) {
  656. $(arr).removeClass("trhover");
  657. $(prev).addClass("trhover");
  658. var height = $(arr).css("height");
  659. $("#" + contentId).parent().animate({scrollTop: "-=" + height}, 100);
  660. }
  661. } else {
  662. var arrs = $("#" + tableId).find("tbody").find("tr");
  663. $(arrs[0]).addClass("trhover");
  664. var height = $(arrs[0]).css("height");
  665. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  666. }
  667. }
  668. }else if(event.keyCode == 39){
  669. // //右键事件
  670. // if(index==4){
  671. // return;
  672. // }
  673. // var nextObject=$("#bill_item_group").find("button")[index+1];
  674. // $(nextObject).click();
  675. } else if (event.keyCode == 40) {
  676. //下键事件
  677. var tableId = null;
  678. var inputId = null;
  679. var contentId = null;
  680. if (index == 0) {
  681. tableId = "tb_table_western_medicine";
  682. inputId = "western_medicine_name";
  683. contentId = "westernMedicinePopoverContent";
  684. } else if (index == 1) {
  685. tableId = "tb_table_chinese_medicine";
  686. inputId = "chinese_medicine_name";
  687. contentId = "chineseMedicinePopoverContent";
  688. } else if (index == 2) {
  689. tableId = "tb_table_jc_jy_item";
  690. inputId = "jcJyItem";
  691. contentId = "jcJyItemPopoverContent";
  692. } else if (index == 3) {
  693. tableId = "tb_table_zl_item";
  694. inputId = "zlItem";
  695. contentId = "zlItemPopoverContent";
  696. }
  697. if (inputId == null) {
  698. return;
  699. }
  700. var webuiID = $("#" + inputId).attr("data-target");
  701. if (webuiID == null || webuiID == "null" || webuiID == "") {
  702. return;
  703. }
  704. //选择框打开
  705. if ($("#" + webuiID).hasClass("in")) {
  706. var arr = $("#" + tableId).find("tbody").find("tr.trhover");
  707. var next = $(arr).next();
  708. if (arr != undefined && arr != null && arr.length > 0) {
  709. if (next != undefined && next != null && next.length > 0) {
  710. $(arr).removeClass("trhover");
  711. $(next).addClass("trhover");
  712. var height = $(arr).css("height");
  713. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  714. }
  715. } else {
  716. var arrs = $("#" + tableId).find("tbody").find("tr");
  717. $(arrs[0]).addClass("trhover");
  718. var height = $(arrs[0]).css("height");
  719. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  720. }
  721. }
  722. }
  723. });
  724. //打印检查检验报告单
  725. $('#btn_print').click(function () {
  726. printJyJcReport(1);
  727. });
  728. //打印设置检查检验报告单
  729. $('#btn_print_setup').click(function () {
  730. printJyJcReport(2);
  731. });
  732. /**
  733. * 医保电子凭证读卡
  734. */
  735. $("#siReadCard").on("click", function (t) {
  736. siReadCard();
  737. });
  738. });
  739. /**
  740. * 打开配置页面
  741. */
  742. function configWorkspaceModal() {
  743. initWorkspaceConfigForCurrent();
  744. $("#configWorkspaceModal").modal("show");
  745. }
  746. /**
  747. * 初始化用药天数下拉选
  748. */
  749. function initDayNum() {
  750. var html = '';
  751. for (var i = 1; i <= 112; i++) {
  752. html += '<option value="' + i + '">' + i + '</option>';
  753. }
  754. $('#dayNum').html(html);
  755. $('#dayNum').selectpicker('refresh');
  756. }
  757. /**
  758. * 初始化药品分组下拉选
  759. */
  760. function initGroupOrder() {
  761. var html = '<option value="1">1</option>';
  762. $('#groupId').html(html);
  763. $('#groupId').selectpicker('refresh');
  764. $("#groupId").selectpicker('val', 1);
  765. $('#groupId').selectpicker('refresh');
  766. groupIdMap = new Map();
  767. }
  768. /**
  769. * 追加分组
  770. */
  771. function appendGroupOrder() {
  772. var last = parseInt($("#groupId > option:last").val());
  773. last++;
  774. var html = '<option value="' + last + '">' + last + '</option>';
  775. $('#groupId').append(html);
  776. $('#groupId').selectpicker('refresh');
  777. }
  778. /**
  779. * 组号改变事件
  780. */
  781. function groupIdChange() {
  782. var last = parseInt($("#groupId > option:last").val());
  783. var groupId = $("#groupId").val();
  784. if (groupId == last) {
  785. //是新增药品清空药品输入区域
  786. var updateFlag = $("#western_medicine_update_flag").val();
  787. var currentCode = $("#western_medicine_current_code").val();
  788. //当前时新增药品,而且没有选择药品的时候,组号变更,清空区域
  789. if ((updateFlag == undefined || updateFlag == null || updateFlag == "false" || updateFlag == false) && (currentCode == null || currentCode == "")) {
  790. clearWesternMedicine(true);
  791. }
  792. } else {
  793. var map = groupIdMap.get(groupId);
  794. if (map != null) {
  795. var supplyType = map.get("supplyType");
  796. var orderFrequency = map.get("orderFrequency");
  797. var dayNum = map.get("dayNum");
  798. //用法编码
  799. $("#supplyType").selectpicker('val', supplyType);
  800. $('#supplyType').selectpicker('refresh');
  801. //$("#supplyType").attr("disabled", "disabled");
  802. //天数
  803. $("#dayNum").selectpicker('val', dayNum);
  804. $('#dayNum').selectpicker('refresh');
  805. // $("#dayNum").attr("disabled", "disabled");
  806. //频次编码
  807. $("#orderFrequency").selectpicker('val', orderFrequency);
  808. $('#orderFrequency').selectpicker('refresh');
  809. // $("#orderFrequency").attr("disabled", "disabled");
  810. }
  811. }
  812. }
  813. /**
  814. * 关闭智能问诊弹框
  815. */
  816. function closePopover() {
  817. //$(".popover").popover('hide');
  818. $("#box-arrow-left").click();
  819. }
  820. /**
  821. * 加载智能问诊弹框内容
  822. */
  823. function contentMethod() {
  824. setTimeout(function () {
  825. $(".popover div.arrow").css("display", "none");
  826. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  827. if (popoverId == undefined) {
  828. return;
  829. }
  830. var left = $("#" + popoverId).css("left");
  831. left = left.replace("px", "");
  832. left = parseInt(left);
  833. left = left + 55;
  834. $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
  835. $("#" + popoverId + " .popover-content").css("height", "100%");
  836. $("#smartAssistPopoverContent").css("height", "100%");
  837. var html = ' <div style="height: 24%;padding-left: 15px;width: 100%;">' +
  838. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
  839. ' class="btn btn-primary">' +
  840. ' <span id="patientHisData"></span>就医轨迹' +
  841. ' </button>' +
  842. ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
  843. ' </button>' +
  844. ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
  845. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  846. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
  847. ' </form>' +
  848. ' </div>' +
  849. ' </div>' +
  850. ' <div style="height: 23%;padding-left: 15px;width: 100%;">' +
  851. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
  852. ' class="btn btn-primary">' +
  853. ' <span id="recommendType"></span>推荐' +
  854. ' </button>' +
  855. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
  856. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  857. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
  858. ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
  859. ' </form>' +
  860. ' </div>' +
  861. ' </div>' +
  862. ' <div style="height: 53%;padding-left: 15px;width: 100%;">' +
  863. ' <button type="button"' +
  864. ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
  865. ' class="btn btn-primary">' +
  866. ' 医疗范本' +
  867. ' </button>' +
  868. ' <div class="item" style="width: 230px;height: 35px;float: right;line-height: 35px;margin-right: 40px;">' +
  869. ' <label class="control-label col-md-4 col-sm-4 col-xs-12" for="templateKindTypeForm">范文类型' +
  870. ' </label>' +
  871. ' <div class="col-md-8 col-sm-8 col-xs-12">' +
  872. ' <select class="form-control selectpicker show-tick" title="请选择" onchange="fitTemplateData()"' +
  873. ' id="templateKindTypeForm">' +
  874. ' </select>' +
  875. ' </div>' +
  876. ' </div>' +
  877. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;position: relative;">' +
  878. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  879. ' style="height: 100%;overflow-y: auto;width: 100%;" id="TemplateData">' +
  880. ' </form>' +
  881. ' </div>' +
  882. ' </div>';
  883. $("#smartAssistPopoverContent").html(html);
  884. initTemplateKindTypeSelect('templateKindTypeForm');
  885. fitPatientHisData();
  886. fitSymptomData();
  887. fitEmrHpiData();
  888. fitEmrPsData();
  889. fitDiagnoseData();
  890. fitTemplateData();
  891. }, 100);
  892. // setTimeout(function () {
  893. // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
  894. // },1000);
  895. }
  896. /**
  897. * 设置患者的就诊轨迹
  898. */
  899. function fitPatientHisData() {
  900. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  901. if (!$("#" + popoverId).hasClass("in")) {
  902. return;
  903. }
  904. var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  905. if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
  906. $("#patientHisDataForm").html(emptyHtml);
  907. return;
  908. }
  909. var patientId = $("#patientId").text();
  910. if (patientId == null || patientId == "") {
  911. patientId = $("#userName").val();
  912. }
  913. $.ajax({
  914. type: "POST",
  915. url: '/thmz/getClinicWithPage',
  916. contentType: "application/json;charset=UTF-8",
  917. dataType: "json",
  918. data: JSON.stringify({
  919. "patientId": patientId,
  920. //"clinicStatuses": [5, 6],
  921. "clinicStatuses": [6],
  922. "pageSize": 10000,
  923. "offset": 0,
  924. "beginDate": "2012-02-01 00:00:00",
  925. "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss"),
  926. "doctorCode": "-1"
  927. }),
  928. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  929. success: function (res) {
  930. if (res == '401' || res == 401) {
  931. window.location.href = '/thmz/login/view'
  932. return;
  933. }
  934. if (res.code == 0) {
  935. var html = '';
  936. var data = res.data;
  937. if (data == null || data.length == 0) {
  938. html += emptyHtml;
  939. } else {
  940. for (var i = 0; i < data.length; i++) {
  941. var icdText = data[i].icdText;
  942. if (icdText == null) {
  943. // continue;
  944. icdText = "空白诊断";
  945. }
  946. icdText = icdText.trim();
  947. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  948. html += ' <div style="float: left;width: 172px;">';
  949. html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
  950. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  951. html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
  952. html += ' </div>';
  953. html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
  954. html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
  955. html += ' onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
  956. html += ' </div>';
  957. html += ' </div>';
  958. }
  959. }
  960. var patientName = $("#patientName").text();
  961. if ((patientName == null || patientName == "") && res.mzPatientMi != null) {
  962. patientName = res.mzPatientMi.name;
  963. }
  964. $("#patientHisData").text(patientName + "的");
  965. if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
  966. $("#patientHisDataForm").html(emptyHtml);
  967. } else {
  968. $("#patientHisDataForm").html(html);
  969. }
  970. } else {
  971. errorMesage(res);
  972. }
  973. }
  974. });
  975. }
  976. /**
  977. * 设置主诉推荐
  978. */
  979. function fitSymptomData() {
  980. fitRecommendData(12);
  981. }
  982. /**
  983. * 设置现病史推荐
  984. */
  985. function fitEmrHpiData() {
  986. fitRecommendData(5);
  987. }
  988. /**
  989. * 设置既往史推荐
  990. */
  991. function fitEmrPsData() {
  992. fitRecommendData(6);
  993. }
  994. /**
  995. * 设置诊断推荐
  996. */
  997. function fitDiagnoseData() {
  998. fitRecommendData(13);
  999. }
  1000. /**
  1001. * 设置推荐通用方法
  1002. */
  1003. function fitRecommendData(paramsType) {
  1004. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1005. if (!$("#" + popoverId).hasClass("in")) {
  1006. return;
  1007. }
  1008. var inputId = "symptom";
  1009. var text = "主诉";
  1010. if (paramsType == 5) {
  1011. inputId = "emrHpi";
  1012. text = "现病史";
  1013. } else if (paramsType == 6) {
  1014. inputId = "emrPs";
  1015. text = "既往史";
  1016. } else if (paramsType == 13) {
  1017. inputId = "diagnose";
  1018. text = "诊断";
  1019. }
  1020. //光标不在现病史上
  1021. if (document.activeElement.id != inputId) {
  1022. return;
  1023. }
  1024. $("#recommendType").html(text);
  1025. var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  1026. $.ajax({
  1027. type: "GET",
  1028. url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
  1029. contentType: "application/json;charset=UTF-8",
  1030. dataType: "json",
  1031. async: false,
  1032. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1033. success: function (res) {
  1034. if (res == '401' || res == 401) {
  1035. window.location.href = '/thmz/login/view'
  1036. return;
  1037. }
  1038. if (res.code == 0) {
  1039. var html = '';
  1040. var data = res.data;
  1041. if (data == null || data.length == 0) {
  1042. html += emptyHtml;
  1043. } else {
  1044. for (var i = 0; i < data.length; i++) {
  1045. var paramsContent = data[i].paramsContent;
  1046. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  1047. html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
  1048. html += paramsContent;
  1049. html += ' </div>';
  1050. html += ' <div style="float: left;width: 36px;cursor: pointer;"';
  1051. html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ',' + data[i].id + ')">';
  1052. html += ' <img';
  1053. html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
  1054. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  1055. html += ' </div>';
  1056. html += ' </div>';
  1057. }
  1058. }
  1059. $("#recommendForm").html(html);
  1060. } else {
  1061. errorMesage(res);
  1062. }
  1063. }
  1064. });
  1065. }
  1066. /**
  1067. * 设置医疗范文方法
  1068. */
  1069. function fitTemplateData() {
  1070. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1071. if (!$("#" + popoverId).hasClass("in")) {
  1072. return;
  1073. }
  1074. 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;">';
  1075. $.ajax({
  1076. type: "GET",
  1077. url: '/thmz/getTemplate?templateKindType=' + $("#templateKindTypeForm").val(),
  1078. contentType: "application/json;charset=UTF-8",
  1079. dataType: "json",
  1080. async: false,
  1081. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1082. success: function (res) {
  1083. if (res == '401' || res == 401) {
  1084. window.location.href = '/thmz/login/view'
  1085. return;
  1086. }
  1087. if (res.code == 0) {
  1088. var html = '';
  1089. var data = res.data;
  1090. if (data == null || data.length == 0) {
  1091. html += emptyHtml;
  1092. } else {
  1093. for (var i = 0; i < data.length; i++) {
  1094. var template = data[i];
  1095. var icdText=(template.icdText==null || template.icdText=="")?"无":template.icdText;
  1096. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  1097. html += ' <div title="' + template.name + '"';
  1098. html += ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">';
  1099. html += template.name;
  1100. html += ' </div>';
  1101. html += ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"';
  1102. html += ' title="' + template.icdText + '">诊断:<a';
  1103. html += ' style="cursor: pointer; color: #2e69eb;"';
  1104. html += ' onclick="medicalModelModal(' + template.id + ')">' + icdText + '</a>';
  1105. html += ' </div>';
  1106. html += ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(' + template.id + ')"><img';
  1107. html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
  1108. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  1109. html += ' </div>';
  1110. html += ' </div>';
  1111. }
  1112. }
  1113. $("#TemplateData").html(html);
  1114. } else {
  1115. errorMesage(res);
  1116. }
  1117. }
  1118. });
  1119. }
  1120. /**
  1121. * 清空快速接诊弹窗
  1122. */
  1123. function clearRapidAcceptsModal() {
  1124. $("#rapidAcceptsUserName").val(null);
  1125. $("#rapidAcceptsUserCode").val(null);
  1126. $("#patientIdDb").val(null);
  1127. $("#rapidAcceptsUserCardNo").val(null);
  1128. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  1129. $("#rapidAcceptsUserGender").selectpicker('refresh');
  1130. $("#rapidAcceptsUserPhoneNum").val(null);
  1131. $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
  1132. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  1133. $("#rapidAcceptsUserIdCard").val(null);
  1134. $("#rapidAcceptsUserIdCard").attr("title", null);
  1135. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  1136. }
  1137. /**
  1138. * 清空接诊台用户信息
  1139. * @param flag 是否清空分诊流水哈 true 清空
  1140. */
  1141. function clearUser(flag) {
  1142. $("#patientName").html("");
  1143. $("#patientAge").html("");
  1144. $("#patientGender").html("");
  1145. $("#patientId").text(null);
  1146. $("#editUser").css("display", "none");
  1147. $("#clearUser").css("display", "none");
  1148. $("#fetchSpcSlwinfo").css("display", "none");
  1149. $("#patientPhone").html("");
  1150. $("#patientPhoneLabel").hide();
  1151. $("#patientResponseType").html("");
  1152. $("#first").next().click();
  1153. $("#patientHisData").text("");
  1154. if (flag) {
  1155. $("#mzfzSerialNoInClick").val(null);
  1156. }
  1157. }
  1158. /**
  1159. * 卡号输入改变事件
  1160. */
  1161. function cardNoChange() {
  1162. if (window.ActiveXObject || "ActiveXObject" in window) {
  1163. $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
  1164. queryUserInfoByCardNo();
  1165. });
  1166. } else {
  1167. $("#rapidAcceptsUserCardNo").on('input οninput', function () {
  1168. queryUserInfoByCardNo();
  1169. });
  1170. }
  1171. }
  1172. /**
  1173. * 刷新就诊列表
  1174. */
  1175. function refreshClinic() {
  1176. loadInClinicTableList();
  1177. loadClinicTableList();
  1178. }
  1179. /**
  1180. * 加载已接诊患者列表
  1181. */
  1182. function loadClinicTableList() {
  1183. //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
  1184. loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
  1185. }
  1186. /**
  1187. * 加载患者列表通用方法
  1188. * @param id
  1189. * @param queryParams
  1190. */
  1191. function loadCommonClinicTableList(id, queryParams) {
  1192. $('#' + id).bootstrapTable('refresh');
  1193. $('#' + id).bootstrapTable({
  1194. url: "/thmz/getClinicWithPage", //请求后台的URL(*)
  1195. method: 'post', //请求方式(*)
  1196. toolbar: '#toolbar', //工具按钮用哪个容器
  1197. striped: true, //是否显示行间隔色
  1198. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1199. pagination: true, //是否显示分页(*)
  1200. sortable: true, //是否启用排序
  1201. sortOrder: "asc", //排序方式
  1202. queryParams: queryParams, //传递参数(*)
  1203. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1204. pageNumber: 1, //初始化加载第一页,默认第一页
  1205. pageSize: 5, //每页的记录行数(*)
  1206. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  1207. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1208. strictSearch: true,
  1209. showColumns: false, //是否显示所有的列
  1210. showRefresh: false, //是否显示刷新按钮
  1211. minimumCountColumns: 2, //最少允许的列数
  1212. clickToSelect: true, //是否启用点击选中行
  1213. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1214. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1215. cardView: false, //是否显示详细视图
  1216. detailView: false,
  1217. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1218. ajaxOptions: {
  1219. headers: {
  1220. 'Accept': 'application/json',
  1221. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1222. }
  1223. },
  1224. columns: [
  1225. {
  1226. field: 'patientName',
  1227. title: '姓名/性别/年龄',
  1228. align: "center",
  1229. valign: 'middle',
  1230. // sortable: true
  1231. formatter: function (value, row, index) {
  1232. return value + "/" + row.gender + "/" + row.age + "岁";
  1233. }
  1234. }, {
  1235. field: 'opDay',
  1236. title: '接诊时间',
  1237. align: "center",
  1238. valign: 'middle',
  1239. // sortable: true
  1240. formatter: function (value, row, index) {
  1241. return format(value, "MM/dd HH:mm");
  1242. }
  1243. }
  1244. , {
  1245. title: '操作',
  1246. align: "center",
  1247. valign: 'middle',
  1248. // sortable: true,
  1249. formatter: function (value, row, index) {
  1250. if (row.clinicStatus == 5) {
  1251. return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
  1252. // return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a>&nbsp;<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
  1253. } else if (row.clinicStatus == 6) {
  1254. return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',0)">详情</a>';
  1255. } else if (row.clinicStatus == 7) {
  1256. return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',1)">详情</a>';
  1257. }
  1258. }
  1259. }
  1260. ],
  1261. responseHandler: function (res) {
  1262. if (res == '401' || res == 401) {
  1263. window.location.href = '/thmz/login/view'
  1264. return;
  1265. }
  1266. var ress = eval(res);
  1267. if (ress.code == -1) {
  1268. new PNotify({
  1269. title: '错误提示',
  1270. text: ress.message,
  1271. type: 'error',
  1272. hide: false,
  1273. styling: 'bootstrap3'
  1274. });
  1275. return {
  1276. "total": 0,//总页数
  1277. "rows": {} //数据
  1278. };
  1279. }
  1280. return {
  1281. "total": ress.total,//总页数
  1282. "rows": ress.data //数据
  1283. };
  1284. },
  1285. onLoadSuccess: function (data) {
  1286. $(".pagination-detail").css("display", "none");
  1287. if (id == "tb_table_clinic") {
  1288. $("#ClinicNum").html(data.total);
  1289. } else {
  1290. $("#inClinicNum").html(data.total);
  1291. }
  1292. }
  1293. });
  1294. }
  1295. /**
  1296. * 得到查询的参数 接诊中
  1297. * @param params
  1298. * @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}}
  1299. */
  1300. function queryParamsInClinic(params) {
  1301. var temp = {
  1302. pageSize: params.limit,
  1303. pageIndex: params.offset / params.limit, //页码
  1304. statusFlagList: [8]
  1305. };
  1306. return temp;
  1307. };
  1308. /**
  1309. * 得到查询的参数
  1310. * @param params
  1311. * @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}}
  1312. */
  1313. function queryParamsClinic(params) {
  1314. var rePortRangeArr = getRePortRangeArr();
  1315. var temp = {
  1316. beginDate: rePortRangeArr[0],
  1317. endDate: rePortRangeArr[1],
  1318. commonParams: $("#userName").val(),
  1319. clinicStatuses: [5, 6, 7],
  1320. pageSize: params.limit,
  1321. offset: params.offset
  1322. };
  1323. return temp;
  1324. };
  1325. /**
  1326. * 加载待诊患者列表方法
  1327. */
  1328. function loadUnClinicTableList() {
  1329. loadCanClinicTableList("tb_table_un_clinic", queryParamsUnClinic);
  1330. }
  1331. /**
  1332. * 加载接诊中患者列表方法
  1333. */
  1334. function loadInClinicTableList() {
  1335. loadCanClinicTableList("tb_table_in_clinic", queryParamsInClinic);
  1336. }
  1337. /**
  1338. * 加载待诊和接诊中患者列表通用方法方法
  1339. */
  1340. function loadCanClinicTableList(id, queryParams) {
  1341. $('#' + id).bootstrapTable('refresh');
  1342. $('#' + id).bootstrapTable({
  1343. url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
  1344. method: 'post', //请求方式(*)
  1345. toolbar: '#toolbar', //工具按钮用哪个容器
  1346. striped: true, //是否显示行间隔色
  1347. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1348. pagination: true, //是否显示分页(*)
  1349. sortable: true, //是否启用排序
  1350. sortOrder: "asc", //排序方式
  1351. queryParams: queryParams, //传递参数(*)
  1352. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1353. pageNumber: 1, //初始化加载第一页,默认第一页
  1354. pageSize: 5, //每页的记录行数(*)
  1355. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  1356. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1357. strictSearch: true,
  1358. showColumns: false, //是否显示所有的列
  1359. showRefresh: false, //是否显示刷新按钮
  1360. minimumCountColumns: 2, //最少允许的列数
  1361. clickToSelect: true, //是否启用点击选中行
  1362. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1363. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1364. cardView: false, //是否显示详细视图
  1365. detailView: false,
  1366. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1367. ajaxOptions: {
  1368. headers: {
  1369. 'Accept': 'application/json',
  1370. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1371. }
  1372. },
  1373. columns: [
  1374. {
  1375. field: 'name',
  1376. title: '姓名/性别/年龄',
  1377. align: "center",
  1378. valign: 'middle',
  1379. // sortable: true
  1380. formatter: function (value, row, index) {
  1381. return value + "/" + row.gender + "/" + row.age + "岁";
  1382. }
  1383. }, {
  1384. field: 'visitDate',
  1385. title: '分诊时间',
  1386. align: "center",
  1387. valign: 'middle',
  1388. // sortable: true
  1389. formatter: function (value, row, index) {
  1390. return format(value, "MM/dd HH:mm");
  1391. }
  1392. }
  1393. , {
  1394. title: '操作',
  1395. align: "center",
  1396. valign: 'middle',
  1397. // sortable: true,
  1398. formatter: function (value, row, index) {
  1399. if (row.statusFlag == 0) {
  1400. return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
  1401. } else if (row.statusFlag == 8) {
  1402. //TODO 继续接诊需要新方法
  1403. return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">续诊</a> <a title="取消接诊" onclick="cancelClinic(\'' + row.patientId + '\',\'' + row.times + '\')" style="cursor: pointer">消诊</a>';
  1404. } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
  1405. return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a>&nbsp;<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
  1406. }
  1407. }
  1408. }
  1409. ],
  1410. responseHandler: function (res) {
  1411. if (res == '401' || res == 401) {
  1412. window.location.href = '/thmz/login/view'
  1413. return;
  1414. }
  1415. var ress = eval(res);
  1416. if (ress.code == -1) {
  1417. new PNotify({
  1418. title: '错误提示',
  1419. text: ress.message,
  1420. type: 'error',
  1421. hide: false,
  1422. styling: 'bootstrap3'
  1423. });
  1424. return {
  1425. "total": 0,//总页数
  1426. "rows": {} //数据
  1427. };
  1428. }
  1429. return {
  1430. "total": ress.total,//总页数
  1431. "rows": ress.data //数据
  1432. };
  1433. },
  1434. onLoadSuccess: function (data) {
  1435. $(".pagination-detail").css("display", "none");
  1436. $("#unClinicNum").html(data.total);
  1437. }
  1438. });
  1439. }
  1440. /**
  1441. * 得到查询的参数
  1442. * @param params
  1443. * @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}}
  1444. */
  1445. function queryParamsUnClinic(params) {
  1446. var temp = {
  1447. pageSize: params.limit,
  1448. pageIndex: params.offset / params.limit, //页码
  1449. statusFlagList: [0, 1, 2, 3]
  1450. };
  1451. return temp;
  1452. };
  1453. /**
  1454. * 通知叫号
  1455. * @param serialNo
  1456. */
  1457. function clinicCallNumber(serialNo) {
  1458. $.ajax({
  1459. type: "GET",
  1460. url: '/thmz/clinicCallNumber?serialNo=' + serialNo,
  1461. contentType: "application/json;charset=UTF-8",
  1462. dataType: "json",
  1463. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1464. success: function (res) {
  1465. if (res == '401' || res == 401) {
  1466. window.location.href = '/thmz/login/view'
  1467. return;
  1468. }
  1469. if (res.code == 0) {
  1470. successMesage(res);
  1471. } else {
  1472. errorMesage(res);
  1473. }
  1474. }
  1475. });
  1476. }
  1477. /**
  1478. * 接诊方法
  1479. * @param patientId 门诊id
  1480. * @param serialNo 分诊流水号
  1481. */
  1482. function clinicalReception(patientId, serialNo) {
  1483. var existPatientId = $("#patientId").text();
  1484. if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
  1485. $("#messageModal").modal();
  1486. $("#messageContent").html("当前有病人正在接诊,是否切换?");
  1487. $("#messageButton").off("click").on("click", function (t) {
  1488. $("#messageModal").modal("hide");
  1489. //当前有人在接诊,提示是否需要切换和保存
  1490. $("#messagePrescriptionModal").modal();
  1491. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  1492. $("#messagePrescriptionModal").modal("hide");
  1493. //先保存目前接诊信息,再切换就诊人
  1494. var jsonData = getParamsForpPrescription();
  1495. $.ajax({
  1496. type: "POST",
  1497. url: '/thmz/savePrescription',
  1498. contentType: "application/json;charset=UTF-8",
  1499. dataType: "json",
  1500. data: JSON.stringify(jsonData),
  1501. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1502. success: function (res) {
  1503. if (res == '401' || res == 401) {
  1504. window.location.href = '/thmz/login/view'
  1505. return;
  1506. }
  1507. if (res.code == 0) {
  1508. clearWorkSpace();
  1509. realClinicalReception(patientId, serialNo);
  1510. //加载已接诊患者列表
  1511. loadClinicTableList();
  1512. } else {
  1513. errorMesage(res);
  1514. }
  1515. }
  1516. });
  1517. });
  1518. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  1519. $("#messagePrescriptionModal").modal("hide");
  1520. clearWorkSpace();
  1521. realClinicalReception(patientId, serialNo);
  1522. });
  1523. });
  1524. $("#cancelButton").off("click");
  1525. } else {
  1526. realClinicalReception(patientId, serialNo);
  1527. }
  1528. }
  1529. /**
  1530. * 取消接诊
  1531. * @param patientId
  1532. */
  1533. function cancelClinic(patientId, times) {
  1534. $("#messageModal").modal();
  1535. $("#messageContent").html("确认取消当前病人的接诊记录吗?");
  1536. $("#messageButton").off("click").on("click", function (t) {
  1537. $("#messageModal").modal("hide");
  1538. $.ajax({
  1539. type: "GET",
  1540. url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
  1541. contentType: "application/json;charset=UTF-8",
  1542. dataType: "json",
  1543. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1544. success: function (res) {
  1545. if (res == '401' || res == 401) {
  1546. window.location.href = '/thmz/login/view'
  1547. return;
  1548. }
  1549. if (res.code == 0) {
  1550. if (res.data == null || res.data.length == 0) {
  1551. return;
  1552. }
  1553. successMesage(res);
  1554. if (times > 0) {
  1555. loadUnClinicTableList();
  1556. loadInClinicTableList();
  1557. }
  1558. } else if (res.code == -1) {
  1559. errorMesage(res);
  1560. }
  1561. }
  1562. });
  1563. });
  1564. $("#cancelButton").off("click");
  1565. };
  1566. /**
  1567. * 设置当前接诊病人信息
  1568. * @param mzPatientMi
  1569. */
  1570. function setMzPatientInfo(mzPatientMi) {
  1571. $("#patientName").html(mzPatientMi.name);
  1572. $("#patientAge").html(mzPatientMi.age);
  1573. $("#patientGender").html(mzPatientMi.gender);
  1574. $("#patientId").text(mzPatientMi.patientId);
  1575. $("#editUser").css("display", "inline-block");
  1576. $("#clearUser").css("display", "inline-block");
  1577. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
  1578. $("#patientPhone").html(mzPatientMi.phoneNo);
  1579. $("#patientPhoneLabel").show();
  1580. } else {
  1581. $("#patientPhoneLabel").hide();
  1582. }
  1583. $("#patientResponseType").html(mzPatientMi.responseTypeName);
  1584. if (mzPatientMi.times == 1) {
  1585. $("#first").next().click();
  1586. } else {
  1587. $("#not").next().click();
  1588. }
  1589. $("#patientHisData").text(mzPatientMi.name);
  1590. fitPatientHisData();
  1591. setTmResponseType(mzPatientMi.patientId);
  1592. }
  1593. /**
  1594. * 判断是否是特门病人
  1595. * @param patientId
  1596. */
  1597. function setTmResponseType(patientId) {
  1598. $.ajax({
  1599. type: "GET",
  1600. url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
  1601. contentType: "application/json;charset=UTF-8",
  1602. dataType: "json",
  1603. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1604. success: function (res) {
  1605. if (res == '401' || res == 401) {
  1606. window.location.href = '/thmz/login/view'
  1607. return;
  1608. }
  1609. if (res.code == 0) {
  1610. if (res.data != null && res.data.length > 0) {
  1611. $("#patientResponseType").html("特殊门诊");
  1612. $("#fetchSpcSlwinfo").css("display", "inline-block");
  1613. }
  1614. }
  1615. }
  1616. });
  1617. }
  1618. /**
  1619. * 特门详情
  1620. * @param patientId
  1621. */
  1622. function fetchSpcSlwinfo() {
  1623. var patientId = $("#patientId").text();
  1624. $.ajax({
  1625. type: "GET",
  1626. url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
  1627. contentType: "application/json;charset=UTF-8",
  1628. dataType: "json",
  1629. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1630. success: function (res) {
  1631. if (res == '401' || res == 401) {
  1632. window.location.href = '/thmz/login/view'
  1633. return;
  1634. }
  1635. if (res.code == 0) {
  1636. if (res.data != null && res.data.length > 0) {
  1637. $("#fetchSpcSlwinfoModal").modal();
  1638. $("#fetchSpcSlwinfoTable").html(null);
  1639. for (var i = 0; i < res.data.length; i++) {
  1640. var begndate = res.data[i].begndate;
  1641. if (begndate == null || begndate == "null") {
  1642. begndate = "";
  1643. }
  1644. var enddate = res.data[i].enddate;
  1645. if (enddate == null || enddate == "null") {
  1646. enddate = "";
  1647. }
  1648. var opspDiseName = res.data[i].opspDiseName;
  1649. if (opspDiseName == null || opspDiseName == "null") {
  1650. opspDiseName = "";
  1651. }
  1652. var opspDiseCode = res.data[i].opspDiseCode;
  1653. if (opspDiseCode == null || opspDiseCode == "null") {
  1654. opspDiseCode = "";
  1655. }
  1656. var ideFixmedinsName = res.data[i].ideFixmedinsName;
  1657. if (ideFixmedinsName == null || ideFixmedinsName == "null") {
  1658. ideFixmedinsName = "";
  1659. }
  1660. $("<tr><td>" + begndate + "</td><td>" + enddate + "</td><td>" + opspDiseCode + "</td><td>" + opspDiseName + "</td><td>" + ideFixmedinsName + "</td></tr>").appendTo("#fetchSpcSlwinfoTable");
  1661. // .bind('click', function () {
  1662. // $("#fetchSpcSlwinfoModal").modal("hide");
  1663. // clinicalReception(patientIdDb, $(this).attr("data-target"));
  1664. // });
  1665. }
  1666. } else {
  1667. errorMesage(res);
  1668. }
  1669. } else {
  1670. errorMesage(res);
  1671. }
  1672. }
  1673. });
  1674. }
  1675. /**
  1676. * 真实的接诊方法
  1677. * @param patientId
  1678. * @param serialNo 分诊流水号
  1679. */
  1680. function realClinicalReception(patientId, serialNo) {
  1681. $.ajax({
  1682. type: "GET",
  1683. url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo,
  1684. contentType: "application/json;charset=UTF-8",
  1685. dataType: "json",
  1686. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1687. success: function (res) {
  1688. if (res == '401' || res == 401) {
  1689. window.location.href = '/thmz/login/view'
  1690. return;
  1691. }
  1692. if (res.code == 0) {
  1693. if (res.data != null) {
  1694. var mzPatientMi = res.data;
  1695. setMzPatientInfo(mzPatientMi);
  1696. $("#mzfzSerialNoInClick").val(serialNo);
  1697. //加载候诊患者列表
  1698. loadUnClinicTableList();
  1699. //加载接诊中患者列表
  1700. loadInClinicTableList();
  1701. }
  1702. } else {
  1703. errorMesage(res);
  1704. }
  1705. }
  1706. });
  1707. }
  1708. /**
  1709. * 清空工作台
  1710. */
  1711. function clearWorkSpace() {
  1712. clearUser(true);
  1713. clearWorkSpaceExcludeUser();
  1714. }
  1715. /**
  1716. * 清空工作台除了用户信息
  1717. */
  1718. function clearWorkSpaceExcludeUser() {
  1719. $("#symptom").val(null);
  1720. $("#emrHpi").val(null);
  1721. $("#emrPs").val(null);
  1722. $("#personalHistory").val(null);
  1723. $("#familyHistory").val(null);
  1724. $("#obstericalHistory").val(null);
  1725. $("#weight").val(null);
  1726. $("#temperature").val(null);
  1727. $("#sphygmus").val(null);
  1728. $("#breathe").val(null);
  1729. $("#pressure_high").val(null);
  1730. $("#pressure_floor").val(null);
  1731. $("#pressure_high_left").val(null);
  1732. $("#pressure_floor_left").val(null);
  1733. $("#tentativeDiagnosis").val(null);
  1734. $("#otherCheck").val(null);
  1735. $("#diagnoseValue").val(null);
  1736. $("#diagnoseTags").html(null);
  1737. $("#healthEducation").val(null);
  1738. clearWesternMedicine(true);
  1739. clearChineseMedicine();
  1740. clearJyJcItem();
  1741. clearZyReq();
  1742. //initNavTabs(0);
  1743. clearNavTabs(0);
  1744. clearNavTabs(1);
  1745. clearNavTabs(2);
  1746. clearNavTabs(3);
  1747. clearApidAcceptsModal();
  1748. $("#totalAmount").text(0);
  1749. }
  1750. /**
  1751. * 医疗范文详情预览
  1752. * @param id
  1753. */
  1754. function medicalModelModal(id) {
  1755. $.ajax({
  1756. type: "GET",
  1757. url: '/thmz/getTemplateById?id=' + id,
  1758. contentType: "application/json;charset=UTF-8",
  1759. dataType: "json",
  1760. async: false,
  1761. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1762. success: function (res) {
  1763. if (res == '401' || res == 401) {
  1764. window.location.href = '/thmz/login/view'
  1765. return;
  1766. }
  1767. if (res.code == 0) {
  1768. var jsonData = JSON.parse(res.data.templateData);
  1769. $("#vmedicalModelName").text(res.data.name);
  1770. $("#idTemplate").val(res.data.id);
  1771. $("#zsTemplate").html(jsonData.mzBlRecord.emrChiefComplaint);
  1772. $("#xbsTemplate").html(jsonData.mzBlRecord.emrHpi);
  1773. var icdText = res.data.icdText;
  1774. $("#zdTemplate").html("");
  1775. $("#xyzlContent").html("");
  1776. $("#zyzlContent").html("");
  1777. $("#zlyjContent").html("");
  1778. if (icdText != null) {
  1779. var arr = icdText.split(",");
  1780. var html = "";
  1781. for (var i = 0; i < arr.length; i++) {
  1782. if (i == 0) {
  1783. html += ' <div class="tagZdy tagZdy-back">';
  1784. } else {
  1785. html += ' <div class="tagZdy tagZdy-back-green">';
  1786. }
  1787. html += arr[i];
  1788. html += '</div>';
  1789. }
  1790. $("#zdTemplate").html(html);
  1791. }
  1792. var emrProcess = jsonData.mzBlRecord.emrProcess;
  1793. if (emrProcess != null) {
  1794. var xy = null;
  1795. if (emrProcess.indexOf("西药治疗:") >= 0) {
  1796. if (emrProcess.indexOf("中药治疗:") >= 0) {
  1797. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
  1798. } else if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  1799. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
  1800. } else if (emrProcess.indexOf("诊疗:") >= 0) {
  1801. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
  1802. } else {
  1803. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
  1804. }
  1805. var arr = xy.split("_");
  1806. if (arr != null && arr.length > 0) {
  1807. var xyhtml = "";
  1808. for (var i = 0; i < arr.length; i++) {
  1809. xyhtml += "<div>";
  1810. xyhtml += arr[i];
  1811. xyhtml += "</div>";
  1812. }
  1813. $("#xyzlContent").html(xyhtml);
  1814. $("#xyzlTitle").removeClass("hide").addClass("in");
  1815. } else {
  1816. $("#xyzlTitle").removeClass("in").addClass("hide");
  1817. }
  1818. } else {
  1819. $("#xyzlTitle").removeClass("in").addClass("hide");
  1820. }
  1821. var zy = null;
  1822. if (emrProcess.indexOf("中药治疗:") >= 0) {
  1823. if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  1824. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
  1825. } else if (emrProcess.indexOf("诊疗:") >= 0) {
  1826. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
  1827. } else {
  1828. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
  1829. }
  1830. var zyArr = zy.split("_");
  1831. if (zyArr != null && zyArr.length > 0) {
  1832. var zyhtml = "";
  1833. for (var i = 1; i < zyArr.length; i++) {
  1834. zyhtml += "<div>";
  1835. zyhtml += zyArr[i];
  1836. zyhtml += "</div>";
  1837. }
  1838. var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
  1839. if (zyfs != null && zyfs != "") {
  1840. zyhtml += " <div>";
  1841. zyhtml += ' <div style="text-indent: 2em;">';
  1842. zyhtml += ' <div>';
  1843. zyhtml += 'x<span>';
  1844. zyhtml += zyfs;
  1845. zyhtml += '</span> 付</div></div></div>';
  1846. }
  1847. $("#zyzlContent").html(zyhtml);
  1848. $("#zyzlTitle").removeClass("hide").addClass("in");
  1849. } else {
  1850. $("#zyzlTitle").removeClass("in").addClass("hide");
  1851. }
  1852. } else {
  1853. $("#zyzlTitle").removeClass("in").addClass("hide");
  1854. }
  1855. var jcjy = null;
  1856. if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  1857. if (emrProcess.indexOf("诊疗:") >= 0) {
  1858. jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
  1859. } else {
  1860. jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
  1861. }
  1862. var jcjyArr = jcjy.split("_");
  1863. if (jcjyArr != null && jcjyArr.length > 0) {
  1864. var jcjyhtml = "";
  1865. for (var i = 0; i < jcjyArr.length; i++) {
  1866. jcjyhtml += "<div>";
  1867. jcjyhtml += jcjyArr[i];
  1868. jcjyhtml += "</div>";
  1869. }
  1870. $("#zlyjContent").html(jcjyhtml);
  1871. $("#zlyjTitle").removeClass("hide").addClass("in");
  1872. } else {
  1873. $("#zlyjTitle").removeClass("in").addClass("hide");
  1874. }
  1875. } else {
  1876. $("#zlyjTitle").removeClass("in").addClass("hide");
  1877. }
  1878. if (emrProcess.indexOf("诊疗:") >= 0) {
  1879. var zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
  1880. var zlArr = zl.split("_");
  1881. if (zlArr != null && zlArr.length > 0) {
  1882. var zlhtml = "";
  1883. for (var i = 0; i < zlArr.length; i++) {
  1884. zlhtml += "<div>";
  1885. zlhtml += zlArr[i];
  1886. zlhtml += "</div>";
  1887. }
  1888. $("#zlContent").html(zlhtml);
  1889. $("#zlTitle").removeClass("hide").addClass("in");
  1890. } else {
  1891. $("#zlTitle").removeClass("in").addClass("hide");
  1892. }
  1893. } else {
  1894. $("#zlTitle").removeClass("in").addClass("hide");
  1895. }
  1896. }
  1897. } else {
  1898. errorMesage(res);
  1899. }
  1900. }
  1901. });
  1902. $("#medicalModelModal").modal();
  1903. }
  1904. /**
  1905. * 诊疗项目回写
  1906. * @param code
  1907. * @param mzChargeDetail
  1908. */
  1909. function callBackZlDetail(code, mzChargeDetail) {
  1910. //诊疗项目
  1911. $.ajax({
  1912. type: "GET",
  1913. url: '/thmz/getZdChargeItemByCode?code=' + code,
  1914. contentType: "application/json;charset=UTF-8",
  1915. dataType: "json",
  1916. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1917. async: false,
  1918. success: function (res) {
  1919. if (res == '401' || res == 401) {
  1920. window.location.href = '/thmz/login/view'
  1921. return;
  1922. }
  1923. if (res.code == 0) {
  1924. //如果
  1925. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  1926. initNavTabs(3);
  1927. }
  1928. $("#zlItem").val(res.data.name);
  1929. $("#zlItem").blur();
  1930. $("#zlItemPrice").val(res.data.chargeAmount);
  1931. $("#chargeUnit").val(res.data.chargeUnit);
  1932. $("#zl_current_code").val(res.data.code);
  1933. $("#zlRemark").val(mzChargeDetail.instructionText);
  1934. if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
  1935. $("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
  1936. $('#zlExecUnit').selectpicker('refresh');
  1937. }
  1938. $("#itemQuantity").val(mzChargeDetail.quantity);
  1939. saveZlItem(false);
  1940. } else {
  1941. errorMesage(res);
  1942. }
  1943. }
  1944. });
  1945. }
  1946. /**
  1947. * 处方回写
  1948. * @param jsonData 处方数据
  1949. * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
  1950. */
  1951. function editPrescription(jsonData, type) {
  1952. var firstOrNot = jsonData.firstOrNot;
  1953. var conciseRecordsFlagYlfw = $("#conciseRecordsYlfw").parent().hasClass("checked");
  1954. var prescriptionSubsidiaryFlagYlfw = $("#prescriptionSubsidiaryYlfw").parent().hasClass("checked");
  1955. var conciseRecordsFlagJzxq = $("#conciseRecordsJzxq").parent().hasClass("checked");
  1956. var prescriptionSubsidiaryFlagJzxq = $("#prescriptionSubsidiaryJzxq").parent().hasClass("checked");
  1957. if (firstOrNot == 0) {
  1958. $("#first").next().click();
  1959. } else if (firstOrNot == 1) {
  1960. $("#not").next().click();
  1961. }
  1962. if (type == 0 || (type == 1 && conciseRecordsFlagYlfw == true) || (type == 2 && conciseRecordsFlagJzxq == true)) {
  1963. $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
  1964. $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
  1965. $("#emrPs").val(jsonData.mzBlRecord.emrPs);
  1966. $("#personalHistory").val(jsonData.mzBlRecord.personalHistory);
  1967. $("#familyHistory").val(jsonData.mzBlRecord.familyHistory);
  1968. $("#obstericalHistory").val(jsonData.mzBlRecord.obstericalHistory);
  1969. if (jsonData.mzBlRecord.weight != null && jsonData.mzBlRecord.weight != 0) {
  1970. $("#weight").val(jsonData.mzBlRecord.weight);
  1971. } else {
  1972. $("#weight").val("");
  1973. }
  1974. if (jsonData.mzBlRecord.temperature != null && jsonData.mzBlRecord.temperature != 0) {
  1975. $("#temperature").val(jsonData.mzBlRecord.temperature);
  1976. } else {
  1977. $("#temperature").val("");
  1978. }
  1979. if (jsonData.mzBlRecord.sphygmus != null && jsonData.mzBlRecord.sphygmus != 0) {
  1980. $("#sphygmus").val(jsonData.mzBlRecord.sphygmus);
  1981. } else {
  1982. $("#sphygmus").val("");
  1983. }
  1984. if (jsonData.mzBlRecord.breathe != null && jsonData.mzBlRecord.breathe != 0) {
  1985. $("#breathe").val(jsonData.mzBlRecord.breathe);
  1986. } else {
  1987. $("#breathe").val("");
  1988. }
  1989. if (jsonData.mzBlRecord.pressureHigh != null && jsonData.mzBlRecord.pressureHigh != 0) {
  1990. $("#pressure_high").val(jsonData.mzBlRecord.pressureHigh);
  1991. } else {
  1992. $("#pressure_high").val("");
  1993. }
  1994. if (jsonData.mzBlRecord.pressureFloor != null && jsonData.mzBlRecord.pressureFloor != 0) {
  1995. $("#pressure_floor").val(jsonData.mzBlRecord.pressureFloor);
  1996. } else {
  1997. $("#pressure_floor").val("");
  1998. }
  1999. if (jsonData.mzBlRecord.pressureHighLeft != null && jsonData.mzBlRecord.pressureHighLeft != 0) {
  2000. $("#pressure_high_left").val(jsonData.mzBlRecord.pressureHighLeft);
  2001. } else {
  2002. $("#pressure_high_left").val("");
  2003. }
  2004. if (jsonData.mzBlRecord.pressureFloorLeft != null && jsonData.mzBlRecord.pressureFloorLeft != 0) {
  2005. $("#pressure_floor_left").val(jsonData.mzBlRecord.pressureFloorLeft);
  2006. } else {
  2007. $("#pressure_floor_left").val("");
  2008. }
  2009. $("#tentativeDiagnosis").val(jsonData.mzBlRecord.tentativeDiagnosis);
  2010. $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
  2011. var icdCode = jsonData.icdCode;
  2012. var icdText = jsonData.icdText;
  2013. var icdCodeArr = icdCode != null ? icdCode.split(",") : null;
  2014. var icdTextArr = icdText != null ? icdText.split(",") : null;
  2015. if (icdCodeArr != null && icdCodeArr.length > 0 && icdTextArr != null && icdTextArr.length > 0) {
  2016. for (var i = 0; i < icdCodeArr.length; i++) {
  2017. fitDiagnoseValue(icdTextArr[i], icdCodeArr[i]);
  2018. }
  2019. }
  2020. $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
  2021. }
  2022. if (type == 0 || (type == 1 && prescriptionSubsidiaryFlagYlfw == true) || (type == 2 && prescriptionSubsidiaryFlagJzxq == true)) {
  2023. var mzChargeDetailList = jsonData.mzChargeDetailList;
  2024. var mzZyReq = jsonData.mzZyReq;
  2025. //中药的公共参数是否已经设置了
  2026. var hadSetZyFullParams = false;
  2027. //西药,成药,医材,麻精,中药,诊疗
  2028. if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
  2029. for (var i = 0; i < mzChargeDetailList.length; i++) {
  2030. var mzChargeDetail = mzChargeDetailList[i];
  2031. var groupNo = mzChargeDetail.groupNo;
  2032. var code = mzChargeDetail.chargeItemCode;
  2033. var serial = mzChargeDetail.serial;
  2034. if (groupNo == "00") {
  2035. callBackZlDetail(code, mzChargeDetail);
  2036. } else if (groupNo == "71" || groupNo == "91" || groupNo == "111" || groupNo == "131") {
  2037. // 71 西成药 91 医材 111 精一 131 精二
  2038. var groupOrder = mzChargeDetail.groupOrder;
  2039. if (groupOrder == null || groupOrder == 'null' || groupOrder == "") {
  2040. groupOrder = 1;
  2041. }
  2042. $("#groupId").selectpicker('val', groupOrder);
  2043. $('#groupId').selectpicker('refresh');
  2044. checkYpInfo(code, serial, groupNo, false);
  2045. // 给药方式 同组药品给药方式相同
  2046. $("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
  2047. $('#supplyType').selectpicker('refresh');
  2048. $("#drugWin").val(mzChargeDetail.drugQuan);
  2049. $("#drugWinUnit").selectpicker('val', mzChargeDetail.drugUnit);
  2050. $('#drugWinUnit').selectpicker('refresh');
  2051. //天数 同组药品天数相同
  2052. $("#dayNum").selectpicker('val', mzChargeDetail.orderDays);
  2053. $('#dayNum').selectpicker('refresh');
  2054. //频次编码 同组药品频次编码相同
  2055. $("#orderFrequency").selectpicker('val', mzChargeDetail.frequency);
  2056. $('#orderFrequency').selectpicker('refresh');
  2057. if (mzChargeDetail.tryFlag == 1 || mzChargeDetail.tryFlag == "1") {
  2058. $("#tryFlag").parent().addClass("checked");
  2059. } else {
  2060. $("#tryFlag").parent().removeClass("checked");
  2061. }
  2062. $("#gross").val(mzChargeDetail.quantity);
  2063. $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()).toFixed(2));
  2064. $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
  2065. $('#medicalAdvice').selectpicker('refresh');
  2066. saveWesternMedicine(false);
  2067. $("#western_medicine_button").click();
  2068. } else {
  2069. //中药与颗粒剂
  2070. checkZyInfo(code, serial, false);
  2071. //类型
  2072. $("#zyClassType").selectpicker('val', groupNo);
  2073. $('#zyClassType').selectpicker('refresh');
  2074. $("#zy_drugWin").val(mzChargeDetail.quantity);
  2075. $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
  2076. $('#zyInstruction').selectpicker('refresh');
  2077. saveChineseMedicine(false);
  2078. if (!hadSetZyFullParams) {
  2079. hadSetZyFullParams = true;
  2080. $("input.zyfs").val(mzChargeDetail.drugWin);
  2081. $("#zy_orderFrequency_1").selectpicker('val', mzChargeDetail.frequency);
  2082. $('#zy_orderFrequency_1').selectpicker('refresh');
  2083. $("#useType_1").selectpicker('val', mzChargeDetail.cyFysm);
  2084. $('#useType_1').selectpicker('refresh');
  2085. $("#cyJssm").selectpicker('val', mzChargeDetail.cyJssm);
  2086. $('#cyJssm').selectpicker('refresh');
  2087. $("#zy_supplyType_1").selectpicker('val', mzChargeDetail.cyDj);
  2088. $('#zy_supplyType_1').selectpicker('refresh');
  2089. }
  2090. $("#chinese_medicine_button").click();
  2091. }
  2092. }
  2093. }
  2094. //检验与检查
  2095. var mzYjReqList = jsonData.mzYjReqList;
  2096. if (mzYjReqList != null && mzYjReqList.length > 0) {
  2097. for (var i = 0; i < mzYjReqList.length; i++) {
  2098. var mzYjReq = mzYjReqList[i];
  2099. var code = mzYjReq.orderCode;
  2100. var jcJyZltype = null;
  2101. if (mzYjReq.reqType == 2) {
  2102. jcJyZltype = 1;
  2103. $("#jyZdSample").selectpicker('val', mzYjReq.inspectStuff);
  2104. $('#jyZdSample').selectpicker('refresh');
  2105. } else if (mzYjReq.reqType == 3) {
  2106. jcJyZltype = 2;
  2107. $("#yshPart").selectpicker('val', mzYjReq.inspectPart);
  2108. $('#yshPart').selectpicker('refresh');
  2109. }
  2110. $("#jcJyZltype").val(jcJyZltype);
  2111. checkJcJyItemInfo(code, null, jcJyZltype, false);
  2112. $("#remark").val(mzYjReq.jyRemark);
  2113. if (mzYjReq.execDept != null && mzYjReq.execDept != "") {
  2114. $("#execUnit").selectpicker('val', mzYjReq.execDept);
  2115. $('#execUnit').selectpicker('refresh');
  2116. }
  2117. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  2118. saveJyJcItem(false);
  2119. $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
  2120. }
  2121. $("#yj_req_button").click();
  2122. }
  2123. //入院证
  2124. if (mzZyReq != null && mzZyReq.reqDept != null && mzZyReq.reqDept != "") {
  2125. $("#inpatientWardBeHospitalized").selectpicker('val', mzZyReq.reqDept);
  2126. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  2127. initSmallDeptByDept();
  2128. $("#admissStatus").selectpicker('val', mzZyReq.admissStatus);
  2129. $('#admissStatus').selectpicker('refresh');
  2130. setTimeout(function () {
  2131. $("#smallWardBeHospitalized").selectpicker('val', mzZyReq.smallDept);
  2132. $('#smallWardBeHospitalized').selectpicker('refresh');
  2133. saveZyReq(false);
  2134. }, 500);
  2135. $("#zy_req_button").click();
  2136. }
  2137. }
  2138. setTimeout(function () {
  2139. //设置总金额 计算金额的时候,可能处方还没有回写完
  2140. calculateTotalAmount();
  2141. }, 1000);
  2142. }
  2143. /**
  2144. * 调用医疗范文
  2145. */
  2146. function callTemplate() {
  2147. clearWorkSpaceExcludeUser();
  2148. $.ajax({
  2149. type: "GET",
  2150. url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(),
  2151. contentType: "application/json;charset=UTF-8",
  2152. dataType: "json",
  2153. async: false,
  2154. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2155. success: function (res) {
  2156. if (res == '401' || res == 401) {
  2157. window.location.href = '/thmz/login/view'
  2158. return;
  2159. }
  2160. if (res.code == 0) {
  2161. var jsonData = JSON.parse(res.data.templateData);
  2162. editPrescription(jsonData, 1);
  2163. $("#templateId").val(res.data.id);
  2164. $("#templateName").val(res.data.name);
  2165. $("#templateKindType").selectpicker('val', res.data.templateKindType);
  2166. $("#templateKindType").selectpicker('refresh');
  2167. $("#templateType").selectpicker('val', res.data.templateType);
  2168. $("#templateType").selectpicker('refresh');
  2169. $("#medicalModelModal").modal("hide");
  2170. closePopover();
  2171. } else {
  2172. errorMesage(res);
  2173. }
  2174. }
  2175. });
  2176. }
  2177. /**
  2178. * 底层填充推荐方法
  2179. * @param paramsType
  2180. * @param appeal
  2181. * @param inputId
  2182. */
  2183. function extracted(paramsType, appeal, inputId) {
  2184. if (paramsType == 13) {
  2185. var contentArr = appeal.split(",");
  2186. if (contentArr != null && contentArr.length > 0) {
  2187. for (var i = 0; i < contentArr.length; i++) {
  2188. var content = contentArr[i].replace(")", "").replace("(", "-");
  2189. var diagnoseArr = content.split("-");
  2190. if (diagnoseArr == null || diagnoseArr.length == 0) {
  2191. continue;
  2192. }
  2193. fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
  2194. }
  2195. }
  2196. } else {
  2197. $("#" + inputId).val(appeal);
  2198. }
  2199. }
  2200. /**
  2201. * 填充推荐
  2202. * @param appeal
  2203. * @param paramsType
  2204. * @param id
  2205. */
  2206. function fitAppeal(appeal, paramsType, id) {
  2207. var inputId = "symptom";
  2208. var text = "主诉项已经录入,是否覆盖?";
  2209. if (paramsType == 5) {
  2210. inputId = "emrHpi";
  2211. text = "现病史项已经录入,是否覆盖?";
  2212. } else if (paramsType == 6) {
  2213. inputId = "emrPs";
  2214. text = "既往史项已经录入,是否覆盖?";
  2215. } else if (paramsType == 13) {
  2216. inputId = "diagnoseValue";
  2217. text = "诊断项已经录入,是否覆盖?";
  2218. }
  2219. var symptom = $("#" + inputId).val();
  2220. if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
  2221. symptom = null;
  2222. }
  2223. if (symptom != null && symptom != "") {
  2224. $("#messageModal").modal();
  2225. $("#messageContent").html(text);
  2226. $("#messageButton").off("click").on("click", function (t) {
  2227. $("#messageModal").modal("hide");
  2228. if (paramsType == 13) {
  2229. $("#" + inputId).val(null);
  2230. $("#diagnoseTags").html(null);
  2231. }
  2232. extracted(paramsType, appeal, inputId);
  2233. });
  2234. $("#cancelButton").off("click");
  2235. } else {
  2236. extracted(paramsType, appeal, inputId);
  2237. }
  2238. $.ajax({
  2239. type: "GET",
  2240. url: '/thmz/increaseTcCommonParamsNumber?id=' + id,
  2241. contentType: "application/json;charset=UTF-8",
  2242. dataType: "json",
  2243. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2244. success: function (res) {
  2245. }
  2246. });
  2247. }
  2248. /**
  2249. * 初始嘱托下拉选
  2250. */
  2251. function initInstructionSelect() {
  2252. //西药医嘱
  2253. $.ajax({
  2254. type: "GET",
  2255. url: '/thmz/getMzZdInstructionByType?instructionType=0',
  2256. contentType: "application/json;charset=UTF-8",
  2257. dataType: "json",
  2258. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2259. success: function (res) {
  2260. if (res == '401' || res == 401) {
  2261. window.location.href = '/thmz/login/view'
  2262. return;
  2263. }
  2264. if (res.code == 0) {
  2265. res.data.forEach(function (item, index) {
  2266. var html = '<option value="' + item.code + '">' + item.instructionText + '</option>';
  2267. $('#medicalAdvice').append(html);
  2268. });
  2269. $('#medicalAdvice').selectpicker('refresh');
  2270. } else {
  2271. errorMesage(res);
  2272. }
  2273. }
  2274. });
  2275. //中药医嘱
  2276. $.ajax({
  2277. type: "GET",
  2278. url: '/thmz/getMzZdInstructionByType?instructionType=1',
  2279. contentType: "application/json;charset=UTF-8",
  2280. dataType: "json",
  2281. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2282. success: function (res) {
  2283. if (res == '401' || res == 401) {
  2284. window.location.href = '/thmz/login/view'
  2285. return;
  2286. }
  2287. if (res.code == 0) {
  2288. res.data.forEach(function (item, index) {
  2289. var html = '<option value="' + item.code + '">' + item.instructionText.trim() + '</option>';
  2290. $('#zyInstruction').append(html);
  2291. });
  2292. $('#zyInstruction').selectpicker('refresh');
  2293. } else {
  2294. errorMesage(res);
  2295. }
  2296. }
  2297. });
  2298. }
  2299. /**
  2300. * 设置下拉选的尺寸
  2301. */
  2302. function setSelectSize() {
  2303. $(".selectpicker").selectpicker({
  2304. dropuAuto: false,
  2305. size: 10
  2306. });
  2307. //$('#icdCodeBeHospitalized').parent().addClass("hide");
  2308. }
  2309. /**
  2310. * 初始化性别下拉选
  2311. */
  2312. function initGenderSelect() {
  2313. var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
  2314. $('#rapidAcceptsUserGender').html(gender);
  2315. $('#rapidAcceptsUserGender').selectpicker('refresh');
  2316. $('#editUserGender').html(gender);
  2317. $('#editUserGender').selectpicker('refresh');
  2318. //医疗范文状态
  2319. var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
  2320. $('#templateStatus').html(templateStatus);
  2321. $('#templateStatus').selectpicker('refresh');
  2322. }
  2323. /**
  2324. * 初始化中药类型下拉选
  2325. */
  2326. function initZyClassTypeSelect() {
  2327. var gender = '<option value="81">普通</option><option value="82">颗粒剂</option>';
  2328. $('#zyClassType').html(gender);
  2329. $('#zyClassType').selectpicker('refresh');
  2330. //$('#zyClassType').selectpicker('val', "81");
  2331. // $('#zyClassType').selectpicker('refresh');
  2332. }
  2333. /**
  2334. * 初始化病人身份类别下拉选
  2335. */
  2336. function initResponceTypeSelect() {
  2337. $.ajax({
  2338. type: "GET",
  2339. url: '/thmz/getMzResponceType',
  2340. contentType: "application/json;charset=UTF-8",
  2341. dataType: "json",
  2342. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2343. success: function (res) {
  2344. if (res == '401' || res == 401) {
  2345. window.location.href = '/thmz/login/view'
  2346. return;
  2347. }
  2348. if (res.code == 0) {
  2349. res.data.forEach(function (item, index) {
  2350. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  2351. $('#patientsNature').append(html);
  2352. $('#editUserPatientsNature').append(html);
  2353. // $('#responeTypeBeHospitalized').append(html);
  2354. });
  2355. $('#patientsNature').selectpicker('refresh');
  2356. $('#editUserPatientsNature').selectpicker('refresh');
  2357. } else {
  2358. errorMesage(res);
  2359. }
  2360. }
  2361. });
  2362. }
  2363. /**
  2364. * 所有的入院状态
  2365. */
  2366. function iniAdmissStatus() {
  2367. $.ajax({
  2368. type: "GET",
  2369. url: '/thmz/getAdmissStatus',
  2370. dataType: "json",
  2371. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2372. success: function (res) {
  2373. if (res == '401' || res == 401) {
  2374. window.location.href = '/thmz/login/view'
  2375. return;
  2376. }
  2377. var html = '';
  2378. $.each(res.data, function (commentIndex, comment) {
  2379. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  2380. });
  2381. $('#admissStatus').empty();
  2382. $('#admissStatus').html(html);
  2383. $('#admissStatus').selectpicker('destroy').selectpicker('refresh');
  2384. }
  2385. });
  2386. }
  2387. /**
  2388. * 入院登记的病区列表
  2389. */
  2390. function initListDeptSelect() {
  2391. //科室列表
  2392. $.ajax({
  2393. type: "GET",
  2394. url: '/thmz/allInpatientWard',
  2395. dataType: "json",
  2396. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2397. success: function (data) {
  2398. if (data == '401' || data == 401) {
  2399. window.location.href = '/thmz/login/view'
  2400. return;
  2401. }
  2402. var html = '';
  2403. $.each(data.data, function (commentIndex, comment) {
  2404. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  2405. });
  2406. $('#inpatientWardBeHospitalized').empty();
  2407. $('#inpatientWardBeHospitalized').html(html);
  2408. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  2409. initSmallDeptByDept();
  2410. }
  2411. });
  2412. }
  2413. /**
  2414. * 小科室列表
  2415. */
  2416. function initSmallDeptByDept() {
  2417. //小科室列表
  2418. $.ajax({
  2419. type: "GET",
  2420. url: '/thmz/getSmallDeptByDept?code=' + $('#inpatientWardBeHospitalized').val(),
  2421. dataType: "json",
  2422. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2423. success: function (res) {
  2424. if (res == '401' || res == 401) {
  2425. window.location.href = '/thmz/login/view'
  2426. return;
  2427. }
  2428. var html = '';
  2429. $.each(res.data, function (commentIndex, comment) {
  2430. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  2431. });
  2432. $('#smallWardBeHospitalized').empty();
  2433. $('#smallWardBeHospitalized').html(html);
  2434. $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
  2435. }
  2436. });
  2437. //病床数
  2438. $.ajax({
  2439. type: "GET",
  2440. url: '/thmz/getBedStatusNumByDept?code=' + $('#inpatientWardBeHospitalized').val(),
  2441. dataType: "json",
  2442. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2443. success: function (res) {
  2444. if (res == '401' || res == 401) {
  2445. window.location.href = '/thmz/login/view'
  2446. return;
  2447. }
  2448. if (res.code == 0) {
  2449. var data = res.data;
  2450. if (data == null) {
  2451. $("#totalBedNum").val(0);
  2452. $("#freeBedNum").val(0);
  2453. $("#occupationBedNum").val(0);
  2454. } else {
  2455. $("#totalBedNum").val(data.total);
  2456. $("#freeBedNum").val(data.free);
  2457. $("#occupationBedNum").val(data.occupation);
  2458. }
  2459. } else {
  2460. errorMesage(res);
  2461. }
  2462. }
  2463. });
  2464. }
  2465. //
  2466. // /**
  2467. // * 初始化诊断下拉选
  2468. // */
  2469. // function initIcdSelect() {
  2470. // var icdCodeInputBeHospitalized = $("#icdCodeInputBeHospitalized").val()
  2471. // $.ajax({
  2472. // type: "GET",
  2473. // url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + icdCodeInputBeHospitalized + '&pageSize=100',
  2474. // contentType: "application/json;charset=UTF-8",
  2475. // dataType: "json",
  2476. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2477. // success: function (res) {
  2478. // if (res == '401' || res == 401) {
  2479. // window.location.href = '/thmz/login/view'
  2480. // return;
  2481. // }
  2482. // var html = '';
  2483. // if (res.code == 0) {
  2484. // if (res.data != null && res.data.length > 0) {
  2485. // var html = '';
  2486. // for (var i = 0; i < res.data.length; i++) {
  2487. // html += '<option value="' + res.data[i].paramsCode + '">' + res.data[i].paramsName + '(' + res.data[i].paramsCode + ')</option>';
  2488. // }
  2489. // $('#icdCodeBeHospitalized').empty();
  2490. // $('#icdCodeBeHospitalized').html(html);
  2491. // $('#icdCodeBeHospitalized').selectpicker('destroy').selectpicker('refresh');
  2492. // $('#icdCodeBeHospitalized').parent().addClass("open");
  2493. // $('#icdCodeBeHospitalized').next().addClass("hide");
  2494. // $('#icdCodeBeHospitalized').next().next().css("margin-top", "-34px");
  2495. // }
  2496. // } else {
  2497. // errorMesage(res);
  2498. // }
  2499. // }
  2500. // });
  2501. // }
  2502. //
  2503. // /**
  2504. // * 设置诊断内容
  2505. // */
  2506. // function setIcdText() {
  2507. // var icdCodeBeHospitalized = $('#icdCodeBeHospitalized option:selected').text();
  2508. // if (icdCodeBeHospitalized != null) {
  2509. // var icdText = icdCodeBeHospitalized.substring(0, icdCodeBeHospitalized.indexOf("("));
  2510. // $("#icdTextBeHospitalized").val(icdText);
  2511. // $("#icdCodeInputBeHospitalized").val($('#icdCodeBeHospitalized').val());
  2512. // $("#icdTextBeHospitalized").attr("title", icdText);
  2513. // } else {
  2514. // $("#icdTextBeHospitalized").val("");
  2515. // $("#icdCodeInputBeHospitalized").val("");
  2516. // $("#icdTextBeHospitalized").attr("title", "");
  2517. // }
  2518. // $('#icdCodeBeHospitalized').parent().addClass("hide");
  2519. // }
  2520. /**
  2521. * 初始化医疗范文范围下拉选
  2522. */
  2523. function initTemplateTypeSelect() {
  2524. $.ajax({
  2525. type: "GET",
  2526. url: '/thmz/getTemplateTypes',
  2527. contentType: "application/json;charset=UTF-8",
  2528. dataType: "json",
  2529. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2530. success: function (res) {
  2531. if (res == '401' || res == 401) {
  2532. window.location.href = '/thmz/login/view'
  2533. return;
  2534. }
  2535. if (res.code == 0) {
  2536. res.data.forEach(function (item) {
  2537. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  2538. $('#templateType').append(html);
  2539. });
  2540. $('#templateType').selectpicker('refresh');
  2541. } else {
  2542. errorMesage(res);
  2543. }
  2544. }
  2545. });
  2546. }
  2547. /**
  2548. * 初始化医疗范文类型下拉选
  2549. * @param templateKindTypeId
  2550. */
  2551. function initTemplateKindTypeSelect(templateKindTypeId) {
  2552. $.ajax({
  2553. type: "GET",
  2554. url: '/thmz/getTemplateKindTypes',
  2555. contentType: "application/json;charset=UTF-8",
  2556. dataType: "json",
  2557. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2558. success: function (res) {
  2559. if (res == '401' || res == 401) {
  2560. window.location.href = '/thmz/login/view'
  2561. return;
  2562. }
  2563. if (res.code == 0) {
  2564. res.data.forEach(function (item) {
  2565. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  2566. $('#' + templateKindTypeId).append(html);
  2567. });
  2568. $('#' + templateKindTypeId).selectpicker('refresh');
  2569. } else {
  2570. errorMesage(res);
  2571. }
  2572. }
  2573. });
  2574. }
  2575. /**
  2576. * 初始频次下拉选
  2577. * @param id
  2578. * @param async 是否是异步 true 异步 false 同步
  2579. */
  2580. function initOrderFrequencys(id, async) {
  2581. $.ajax({
  2582. type: "GET",
  2583. url: '/thmz/getOrderFrequencys',
  2584. dataType: "json",
  2585. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2586. async: async,
  2587. success: function (res) {
  2588. if (res == '401' || res == 401) {
  2589. window.location.href = '/thmz/login/view'
  2590. return;
  2591. }
  2592. var html = '';
  2593. $.each(res.data, function (commentIndex, comment) {
  2594. html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
  2595. });
  2596. $('#' + id).empty();
  2597. $('#' + id).html(html);
  2598. $('#' + id).selectpicker('refresh');
  2599. }
  2600. });
  2601. }
  2602. /**
  2603. * 初始用药方式下拉选
  2604. */
  2605. function initSupplyTypes() {
  2606. $.ajax({
  2607. type: "GET",
  2608. url: '/thmz/getSupplyTypes',
  2609. dataType: "json",
  2610. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2611. success: function (res) {
  2612. if (res == '401' || res == 401) {
  2613. window.location.href = '/thmz/login/view'
  2614. return;
  2615. }
  2616. var html = '';
  2617. $.each(res.data, function (commentIndex, comment) {
  2618. if (comment.supplyOcc === "71") {
  2619. html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
  2620. }
  2621. });
  2622. $('#supplyType').empty();
  2623. $('#supplyType').html(html);
  2624. $('#supplyType').selectpicker('refresh');
  2625. }
  2626. });
  2627. }
  2628. /**
  2629. * 初始煎药方式下拉选
  2630. * @param async 是否是异步 true 异步 false 同步
  2631. */
  2632. function initZySupplyTypes(id, async) {
  2633. setSelectSize();
  2634. $.ajax({
  2635. type: "GET",
  2636. url: '/thmz/getSupplyTypes',
  2637. dataType: "json",
  2638. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2639. async: async,
  2640. success: function (res) {
  2641. if (res == '401' || res == 401) {
  2642. window.location.href = '/thmz/login/view'
  2643. return;
  2644. }
  2645. var html = '';
  2646. $.each(res.data, function (commentIndex, comment) {
  2647. if (comment.supplyOcc === "81") {
  2648. // html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  2649. html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
  2650. }
  2651. });
  2652. $('#' + id).empty();
  2653. $('#' + id).html(html);
  2654. $('#' + id).selectpicker('refresh');
  2655. }
  2656. });
  2657. }
  2658. /**
  2659. * 初始查检查部位
  2660. */
  2661. function initYshPart() {
  2662. setSelectSize();
  2663. $.ajax({
  2664. type: "GET",
  2665. url: '/thmz/getYshPart',
  2666. dataType: "json",
  2667. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2668. success: function (res) {
  2669. if (res == '401' || res == 401) {
  2670. window.location.href = '/thmz/login/view'
  2671. return;
  2672. }
  2673. var html = '';
  2674. $.each(res.data, function (commentIndex, comment) {
  2675. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
  2676. });
  2677. $('#yshPart').empty();
  2678. $('#yshPart').html(html);
  2679. $('#yshPart').selectpicker('refresh');
  2680. }
  2681. });
  2682. }
  2683. /**
  2684. * 初始化验物下拉选
  2685. */
  2686. function initJyZdSample() {
  2687. setSelectSize();
  2688. $.ajax({
  2689. type: "GET",
  2690. url: '/thmz/getJyZdSample',
  2691. dataType: "json",
  2692. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2693. success: function (res) {
  2694. if (res == '401' || res == 401) {
  2695. window.location.href = '/thmz/login/view'
  2696. return;
  2697. }
  2698. var html = '';
  2699. $.each(res.data, function (commentIndex, comment) {
  2700. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
  2701. });
  2702. $('#jyZdSample').empty();
  2703. $('#jyZdSample').html(html);
  2704. $('#jyZdSample').selectpicker('refresh');
  2705. }
  2706. });
  2707. }
  2708. /**
  2709. * 保存当前药品到右边处方区域
  2710. * @param index 0 西药 1中药 2 诊疗和社备
  2711. */
  2712. function saveMedicine(index) {
  2713. if (index == 0) {
  2714. // //每个处方不能超过5个药品
  2715. // var tableId = $("#xyTab li.active").find("a").attr("href");
  2716. // var childrens = $(tableId).find("div:eq(0)").children().length;
  2717. // if (childrens === 5) {
  2718. // $("#messageModal").modal();
  2719. // $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
  2720. // $("#messageButton").off("click").on("click", function (t) {
  2721. // $("#messageModal").modal("hide");
  2722. // refreshNavTabs(index);
  2723. // saveWesternMedicine();
  2724. // });
  2725. // } else {
  2726. // saveWesternMedicine();
  2727. // }
  2728. saveWesternMedicine(true);
  2729. } else if (index == 1) {
  2730. saveChineseMedicine(true);
  2731. }
  2732. }
  2733. /**
  2734. * 保存当前药品到右边处方区域 西药
  2735. * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  2736. */
  2737. function saveWesternMedicine(calculateTotalAmountFlag) {
  2738. //组号
  2739. var groupId = $("#groupId").val();
  2740. //药品名称
  2741. var westernMedicineNamme = $("#western_medicine_name").val();
  2742. //当前药品编码
  2743. var currentCode = $("#western_medicine_current_code").val();
  2744. //当前药品规格
  2745. var currentSerial = $("#western_medicine_current_serial").val();
  2746. //当前药房编码
  2747. var currentGroupNo = $("#current_groupNo").val();
  2748. //用法编码
  2749. var supplyType = $("#supplyType").val();
  2750. //用法描述
  2751. var supplyTypeText = $('#supplyType option:selected').text();
  2752. supplyTypeText = supplyTypeText.substring(0, supplyTypeText.indexOf("["));
  2753. //药品默认单次使用剂量
  2754. var drugWinDb = $("#drugWinDb").val();
  2755. //处方实际单次使用剂量
  2756. var drugWin = $("#drugWin").val();
  2757. //剂量单位
  2758. var drugWinUnit = $('#drugWinUnit option:selected').text();
  2759. //drugWinUnit = drugWinUnit.substring(0, drugWinUnit.indexOf("("));
  2760. //天数
  2761. var dayNum = $("#dayNum").val();
  2762. //频次编码
  2763. var orderFrequency = $("#orderFrequency").val();
  2764. //频次描述
  2765. var orderFrequencyText = $('#orderFrequency option:selected').text();
  2766. orderFrequencyText = orderFrequencyText.substring(0, orderFrequencyText.indexOf("("));
  2767. //总量
  2768. var gross = $("#gross").val();
  2769. //包装单位
  2770. var packUnit = $("#packUnit").val();
  2771. if (packUnit == null) {
  2772. packUnit = "";
  2773. }
  2774. //医嘱码
  2775. var medicalAdvice = $("#medicalAdvice").val();
  2776. //医嘱内容
  2777. var medicalAdviceText = $('#medicalAdvice option:selected').text();
  2778. medicalAdviceText = medicalAdviceText.substring(0, medicalAdviceText.indexOf("("));
  2779. //金额
  2780. var totalRetprice = parseFloat($("#totalRetprice").val());
  2781. //单价
  2782. var packRetprice = $("#packRetprice").val();
  2783. //皮试
  2784. var tryFlag = $("#tryFlag").parent().hasClass("checked");
  2785. if (currentCode == null || currentCode == '') {
  2786. errorMesageSimaple("未选择任何药品!");
  2787. return;
  2788. }
  2789. if (currentGroupNo != '91') {
  2790. if (supplyType == null || supplyType == "") {
  2791. errorMesageSimaple("用法为空!");
  2792. return;
  2793. }
  2794. if (drugWin == null || drugWin == "") {
  2795. errorMesageSimaple("剂量为空!");
  2796. return;
  2797. }
  2798. if (dayNum == null || dayNum == "") {
  2799. errorMesageSimaple("天数为空!");
  2800. return;
  2801. }
  2802. if (orderFrequency == null || orderFrequency == "") {
  2803. errorMesageSimaple("频次为空!");
  2804. return;
  2805. }
  2806. }
  2807. if (gross == null || gross == "") {
  2808. errorMesageSimaple("总量为空!");
  2809. return;
  2810. }
  2811. var manufactoryName = $("#manufactoryName").val();
  2812. var html = '<div class="form-group">';
  2813. html += groupId + '.<span style="margin-left: 5px"></span>';
  2814. html += westernMedicineNamme;
  2815. if (manufactoryName != null && manufactoryName != 'null' && manufactoryName != "") {
  2816. html += "(" + manufactoryName + ")"
  2817. }
  2818. html += '&nbsp;&nbsp;&nbsp;&nbsp;';
  2819. html += $("#specification").val();
  2820. html += '&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;';
  2821. //html += drugWinDb + drugWinUnit + ' 共';
  2822. html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
  2823. html += '用法:' + supplyTypeText + ' ';
  2824. html += drugWin + drugWinUnit + ' ';
  2825. html += '频次:' + orderFrequencyText + ' ';
  2826. html += dayNum + '天 ';
  2827. if (tryFlag == "true" || tryFlag == true) {
  2828. html += '皮试 ';
  2829. }
  2830. if (medicalAdvice != null && medicalAdvice != '') {
  2831. html += '医嘱:' + medicalAdviceText;
  2832. }
  2833. 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>';
  2834. 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>';
  2835. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  2836. html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
  2837. html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
  2838. html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
  2839. html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
  2840. html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
  2841. html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
  2842. html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
  2843. html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
  2844. html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
  2845. html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
  2846. html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
  2847. html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
  2848. html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
  2849. html += '<input type="hidden" class="temporary_items_medicalAdviceText" value="' + medicalAdviceText + '"/>';
  2850. html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
  2851. html += '<input type="hidden" class="temporary_items_tryFlag" value="' + tryFlag + '"/>';
  2852. html += '</div>';
  2853. var tableId = $("#xyTab li.active").find("a").attr("href");
  2854. //是新增药品还是编辑 true 修改 默认false
  2855. var updateFlag = $("#western_medicine_update_flag").val();
  2856. if (updateFlag == undefined || updateFlag == null) {
  2857. updateFlag = false;
  2858. }
  2859. // //原药品金额 如果是修改则需要设置
  2860. // var temporaryItemsAmount = 0;
  2861. //当前需要被移除元素的下个兄弟节点
  2862. var nextObj = null;
  2863. //当前修改的药品是不是最后一个
  2864. var isLast = false;
  2865. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  2866. if (formGroups != null && formGroups.length > 0) {
  2867. //如果是修改,需要减去原来的费用
  2868. if (updateFlag == "true" || updateFlag == true) {
  2869. for (var i = 0; i < formGroups.length; i++) {
  2870. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  2871. var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
  2872. if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
  2873. //temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  2874. if (formGroups.length > 1) {
  2875. nextObj = $(formGroups[i]).next();
  2876. }
  2877. isLast = (i + 1) === formGroups.length;
  2878. $(formGroups[i]).remove();
  2879. break;
  2880. }
  2881. }
  2882. } else {
  2883. //因为药品可以换组号,要保证相同组号的在一起
  2884. for (var i = 0; i < formGroups.length; i++) {
  2885. var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
  2886. //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
  2887. if (temporaryItemsGroupId > groupId) {
  2888. nextObj = $(formGroups[i]);
  2889. break;
  2890. }
  2891. }
  2892. }
  2893. }
  2894. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  2895. if (nextObj == null || isLast) {
  2896. $(tableId).find("div:eq(0)").append(html);
  2897. } else {
  2898. $(nextObj).before(html);
  2899. }
  2900. //设置当前处方金额
  2901. //calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
  2902. if (calculateTotalAmountFlag) {
  2903. //设置总金额
  2904. calculateTotalAmount();
  2905. }
  2906. //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
  2907. var groupIdLast = $("#groupId option:last-child").text();
  2908. if (groupId === groupIdLast) {
  2909. appendGroupOrder();
  2910. }
  2911. //设置药品的用法,频次,天数
  2912. var map = groupIdMap.get(groupId);
  2913. if (map == null) {
  2914. map = new Map();
  2915. map.put("supplyType", supplyType);
  2916. map.put("orderFrequency", orderFrequency);
  2917. map.put("dayNum", dayNum);
  2918. groupIdMap.put(groupId, map);
  2919. }
  2920. //设置当前药品的品类
  2921. $(tableId).find("input.current_groupNo").val($("#current_groupNo").val());
  2922. clearWesternMedicine(false);
  2923. }
  2924. /**
  2925. * 上移
  2926. * @param obj
  2927. */
  2928. function arrowUp(obj) {
  2929. var parentObject = $(obj).parent();
  2930. if ($(parentObject).prev() == null) {
  2931. return;
  2932. }
  2933. //当前元素的序号
  2934. var thisJcjyItemGroupId = null;
  2935. //前一个兄弟节点的序号
  2936. var prevJcjyItemGroupId = null;
  2937. //当是项目时有序号,进行序号调整
  2938. if ($(parentObject).find("span.jcjyItemGroupId") != null) {
  2939. thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
  2940. prevJcjyItemGroupId = $(parentObject).prev().find("span.jcjyItemGroupId").html();
  2941. $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
  2942. $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
  2943. }
  2944. $(parentObject).prev().before($(parentObject));
  2945. }
  2946. /**
  2947. * 下移
  2948. * @param obj
  2949. */
  2950. function arrowDown(obj) {
  2951. var parentObject = $(obj).parent();
  2952. if ($(parentObject).next() == null) {
  2953. return;
  2954. }
  2955. //当前元素的序号
  2956. var thisJcjyItemGroupId = null;
  2957. //后一个兄弟节点的序号
  2958. var afterJcjyItemGroupId = null;
  2959. //当是项目时有序号,进行序号调整
  2960. if ($(parentObject).find("span.jcjyItemGroupId") != null) {
  2961. thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
  2962. afterJcjyItemGroupId = $(parentObject).after().find("span.jcjyItemGroupId").html();
  2963. $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
  2964. $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
  2965. }
  2966. $(parentObject).next().after($(parentObject));
  2967. }
  2968. /**
  2969. * 修改西药
  2970. * @param obj
  2971. */
  2972. function editWesternMedicine(obj) {
  2973. //是新增药品还是编辑 true 修改 默认false
  2974. $("#western_medicine_update_flag").val(true);
  2975. var parentObject = $(obj).parent();
  2976. //组号
  2977. $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
  2978. $('#groupId').selectpicker('refresh');
  2979. //药品名称
  2980. $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
  2981. var code = $(parentObject).find("input.temporary_items_code").val();
  2982. var serial = $(parentObject).find("input.temporary_items_serial").val();
  2983. //当前药品编码
  2984. $("#western_medicine_current_code").val(code);
  2985. //当前药品规格
  2986. $("#western_medicine_current_serial").val(serial);
  2987. //用法编码
  2988. $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
  2989. $('#supplyType').selectpicker('refresh');
  2990. //药品默认单次使用剂量
  2991. $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
  2992. //处方实际单次使用剂量
  2993. $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
  2994. //天数
  2995. $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
  2996. $('#dayNum').selectpicker('refresh');
  2997. //频次编码
  2998. $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
  2999. $('#orderFrequency').selectpicker('refresh');
  3000. //总量
  3001. $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
  3002. //医嘱
  3003. $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
  3004. $('#medicalAdvice').selectpicker('refresh');
  3005. //金额
  3006. $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
  3007. //单价
  3008. $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
  3009. //皮试
  3010. var tryFlag = $(parentObject).find("input.temporary_items_tryFlag").val();
  3011. if (tryFlag == true || tryFlag == "true") {
  3012. $("#tryFlag").parent().addClass("checked");
  3013. $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
  3014. }
  3015. $.ajax({
  3016. type: "GET",
  3017. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
  3018. contentType: "application/json;charset=UTF-8",
  3019. dataType: "json",
  3020. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3021. success: function (res) {
  3022. if (res == '401' || res == 401) {
  3023. window.location.href = '/thmz/login/view'
  3024. return;
  3025. }
  3026. if (res.code == 0) {
  3027. if (res.data != null) {
  3028. var drugWinHtml = '';
  3029. if (res.data.weight != null) {
  3030. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  3031. $("#drugWin").val(res.data.weight);
  3032. $("#drugWinDb").val(res.data.weight);
  3033. }
  3034. drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
  3035. }
  3036. if (res.data.volum != null) {
  3037. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  3038. $("#drugWin").val(res.data.volum);
  3039. $("#drugWinDb").val(res.data.volum);
  3040. }
  3041. drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
  3042. }
  3043. if (res.data.miniUnit != null && res.data.miniUnit != "") {
  3044. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  3045. $("#drugWin").val(1);
  3046. $("#drugWinDb").val(1);
  3047. }
  3048. drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
  3049. }
  3050. $('#drugWinUnit').html(drugWinHtml);
  3051. $('#drugWinUnit').selectpicker('refresh');
  3052. //剂量单位
  3053. $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
  3054. $('#drugWinUnit').selectpicker('refresh');
  3055. if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
  3056. var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
  3057. $('#packUnit').html(html);
  3058. $('#packUnit').selectpicker('refresh');
  3059. //包装单位
  3060. $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
  3061. $('#packUnit').selectpicker('refresh');
  3062. }
  3063. if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
  3064. $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
  3065. } else {
  3066. $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
  3067. }
  3068. }
  3069. } else {
  3070. errorMesage(res);
  3071. }
  3072. }
  3073. });
  3074. }
  3075. /**
  3076. * 修改中药
  3077. * @param obj
  3078. */
  3079. function editChineseMedicine(obj) {
  3080. //是新增药品还是编辑 true 修改 默认false
  3081. $("#chinese_medicine_update_flag").val(true);
  3082. var parentObject = $(obj).parent();
  3083. //当前药品编码
  3084. $("#chinese_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
  3085. //当前药品规格
  3086. $("#chinese_medicine_current_serial").val($(parentObject).find("input.temporary_items_serial").val());
  3087. //中药类型
  3088. $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
  3089. $('#zyClassType').selectpicker('refresh');
  3090. //药品名称
  3091. $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
  3092. //单价
  3093. $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
  3094. //处方实际单次使用剂量
  3095. $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
  3096. //医嘱码
  3097. $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
  3098. $('#zyInstruction').selectpicker('refresh');
  3099. }
  3100. /**
  3101. * 修改辅助检查、检验项目
  3102. * @param obj
  3103. */
  3104. function editJyJcItem(obj) {
  3105. //是新增药品还是编辑 true 修改 默认false
  3106. $("#jcjy_update_flag").val(true);
  3107. var parentObject = $(obj).parent();
  3108. //当前项目编码
  3109. $("#jcjy_current_code").val($(parentObject).find("input.temporary_items_code").val());
  3110. //项目名称
  3111. $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
  3112. //单价
  3113. $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
  3114. //备注
  3115. $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
  3116. var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
  3117. var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
  3118. //执行科室
  3119. var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
  3120. $("#execUnit").selectpicker('val', execUnit);
  3121. $('#execUnit').selectpicker('refresh');
  3122. if (jcJyZltype == 1 || jcJyZltype == "1") {
  3123. $("#jyZdSample").selectpicker('val', chargeUnit);
  3124. $('#jyZdSample').selectpicker('refresh');
  3125. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  3126. $("#yshPartDiv").removeClass("in").addClass("hide");
  3127. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  3128. } else if (jcJyZltype == 2 || jcJyZltype == "2") {
  3129. $("#yshPart").selectpicker('val', chargeUnit);
  3130. $('#yshPart').selectpicker('refresh');
  3131. $("#yshPartDiv").removeClass("hide").addClass("in");
  3132. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  3133. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  3134. }
  3135. $("#jcJyZltype").val(jcJyZltype);
  3136. }
  3137. /**
  3138. * 修改诊疗项目
  3139. * @param obj
  3140. */
  3141. function editZlItem(obj) {
  3142. //是新增药品还是编辑 true 修改 默认false
  3143. $("#zl_update_flag").val(true);
  3144. var parentObject = $(obj).parent();
  3145. //当前项目编码
  3146. $("#zl_current_code").val($(parentObject).find("input.temporary_items_code").val());
  3147. //项目名称
  3148. $("#zlItem").val($(parentObject).find("input.temporary_items_zlItemName").val());
  3149. //单价
  3150. $("#zlItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
  3151. //备注
  3152. $("#zlRemark").val($(parentObject).find("input.temporary_items_remark").val());
  3153. var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
  3154. //数量
  3155. var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
  3156. //执行科室
  3157. var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
  3158. $("#zlExecUnit").selectpicker('val', execUnit);
  3159. $('#zlExecUnit').selectpicker('refresh');
  3160. //描述
  3161. $("#chargeUnit").val(chargeUnit);
  3162. $("#itemQuantity").val(itemQuantity);
  3163. }
  3164. /**
  3165. * 保存当前辅助检查、检验项目到右边处方区域 需要提示加价
  3166. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  3167. */
  3168. function saveJyJcItem(calculateTotalAmountFlag) {
  3169. //6岁内提示加价
  3170. var patientAge = $("#patientAge").text();
  3171. if (patientAge != null && patientAge != "" && patientAge < 6) {
  3172. $.ajax({
  3173. type: "GET",
  3174. url: '/thmz/checkAdditionally?code=' + $("#jcjy_current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
  3175. contentType: "application/json;charset=UTF-8",
  3176. dataType: "json",
  3177. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3178. success: function (res) {
  3179. if (res == '401' || res == 401) {
  3180. window.location.href = '/thmz/login/view'
  3181. return;
  3182. }
  3183. if (res.code == 0) {
  3184. if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
  3185. var xlCode = res.data.xlCode;
  3186. xlCode = Multiply(100, xlCode);
  3187. $("#messageModal").modal();
  3188. $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
  3189. $("#messageButton").off("click").on("click", function (t) {
  3190. $("#messageModal").modal("hide");
  3191. saveJyJcItemReal(true);
  3192. });
  3193. $("#cancelButton").off("click");
  3194. } else {
  3195. //虽然是不满6岁,但是也没有需要加收的项目,直接保存
  3196. saveJyJcItemReal(calculateTotalAmountFlag);
  3197. }
  3198. } else {
  3199. errorMesage(res);
  3200. }
  3201. }
  3202. });
  3203. } else {
  3204. saveJyJcItemReal(calculateTotalAmountFlag);
  3205. }
  3206. }
  3207. /**
  3208. * 保存当前项目到右边处方区域
  3209. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  3210. */
  3211. function saveJyJcItemReal(calculateTotalAmountFlag) {
  3212. var tableId = $("#jcjyTab li.active").find("a").attr("href");
  3213. //组号
  3214. var groupId = $(tableId).find("div:eq(0)").children().length + 1;
  3215. //项目名称
  3216. var jcJyItem = $("#jcJyItem").val();
  3217. //当前项目编码
  3218. var currentCode = $("#jcjy_current_code").val();
  3219. //当前项目价格
  3220. var jcjyItemPrice = $("#jcjyItemPrice").val();
  3221. //执行科室
  3222. var execUnit = $("#execUnit").val();
  3223. //执行科室
  3224. var execUnitName = $('#execUnit option:selected').text();
  3225. execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
  3226. //描述编码
  3227. var chargeUnitCode = null;
  3228. var chargeUnitName = "";
  3229. //检验物或者检查部位
  3230. var chargeUnit = null;
  3231. //备注
  3232. var remark = $("#remark").val();
  3233. //项目类型
  3234. var jcJyZltype = $("#jcJyZltype").val();
  3235. if (jcJyZltype == "1" || jcJyZltype == 1) {
  3236. //检验
  3237. chargeUnit = $('#jyZdSample option:selected').text();
  3238. chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
  3239. chargeUnitCode = $('#jyZdSample').val();
  3240. chargeUnitName = " 检验物:";
  3241. } else if (jcJyZltype == "2" || jcJyZltype == 2) {
  3242. //检查
  3243. chargeUnit = $('#yshPart option:selected').text();
  3244. chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
  3245. chargeUnitCode = $('#yshPart').val();
  3246. chargeUnitName = " 检查部位:";
  3247. }
  3248. if (currentCode == null || currentCode == '') {
  3249. if (calculateTotalAmountFlag == true) {
  3250. errorMesageSimaple("未选择任何项目!");
  3251. }
  3252. return;
  3253. }
  3254. //判断是否有重复的项目 返回true 说明有重复的
  3255. if (verifyRepeat(currentCode, null, chargeUnitCode, 2)) {
  3256. return;
  3257. }
  3258. //原药品金额 如果是修改则需要设置
  3259. var temporaryItemsAmount = 0;
  3260. //当前需要被移除元素的下个兄弟节点
  3261. var nextObj = null;
  3262. //当前修改的药品是不是最后一个
  3263. var isLast = false;
  3264. //是新增药品还是编辑 true 修改 默认false
  3265. var updateFlag = $("#jcjy_update_flag").val();
  3266. if (updateFlag == undefined || updateFlag == null) {
  3267. updateFlag = false;
  3268. }
  3269. //如果是修改,需要减去原来的费用
  3270. //原组号
  3271. var oriGroupId = null;
  3272. if (updateFlag == "true" || updateFlag == true) {
  3273. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  3274. if (formGroups != null && formGroups.length > 0) {
  3275. for (var i = 0; i < formGroups.length; i++) {
  3276. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  3277. if (temporaryItemsCode === currentCode) {
  3278. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  3279. if (formGroups.length > 1) {
  3280. nextObj = $(formGroups[i]).next();
  3281. }
  3282. isLast = (i + 1) === formGroups.length;
  3283. oriGroupId = $(formGroups[i]).find("span.jcjyItemGroupId").text();
  3284. $(formGroups[i]).remove();
  3285. break;
  3286. }
  3287. }
  3288. }
  3289. }
  3290. if (oriGroupId != null) {
  3291. groupId = oriGroupId;
  3292. }
  3293. var html = '<div class="form-group">';
  3294. html += '<span class="jcjyItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
  3295. html += jcJyItem + ' ';
  3296. if (jcJyZltype == "3" || jcJyZltype == 3) {
  3297. html += " 数量:" + itemQuantity;
  3298. }
  3299. if (execUnit != null && execUnit != "") {
  3300. html += " 执行科室:" + execUnitName;
  3301. }
  3302. if (chargeUnit != null && chargeUnit != '') {
  3303. html += chargeUnitName + chargeUnit;
  3304. }
  3305. if (remark != null && remark != '') {
  3306. html += ' 备注:' + remark;
  3307. }
  3308. 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>';
  3309. 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>';
  3310. 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>';
  3311. if ($("#jcJyItemChargeDetail").hasClass("in")) {
  3312. 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>';
  3313. }
  3314. 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>';
  3315. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  3316. html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
  3317. html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
  3318. html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
  3319. html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
  3320. html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
  3321. html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
  3322. html += '</div>';
  3323. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  3324. if (nextObj == null || isLast) {
  3325. $(tableId).find("div:eq(0)").append(html);
  3326. } else {
  3327. $(nextObj).before(html);
  3328. }
  3329. //设置当前处方金额
  3330. //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
  3331. if (calculateTotalAmountFlag) {
  3332. //设置总金额
  3333. calculateTotalAmount();
  3334. }
  3335. clearJyJcItem();
  3336. }
  3337. /**
  3338. * 保存当前诊疗项目到右边处方区域 需要提示加价
  3339. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  3340. */
  3341. function saveZlItem(calculateTotalAmountFlag) {
  3342. //6岁内提示加价
  3343. var patientAge = $("#patientAge").text();
  3344. if (patientAge != null && patientAge != "" && patientAge < 6) {
  3345. $.ajax({
  3346. type: "GET",
  3347. url: '/thmz/checkAdditionally?code=' + $("#zl_current_code").val() + "&jcJyZltype=3",
  3348. contentType: "application/json;charset=UTF-8",
  3349. dataType: "json",
  3350. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3351. success: function (res) {
  3352. if (res == '401' || res == 401) {
  3353. window.location.href = '/thmz/login/view'
  3354. return;
  3355. }
  3356. if (res.code == 0) {
  3357. if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
  3358. var xlCode = res.data.xlCode;
  3359. xlCode = Multiply(100, xlCode);
  3360. $("#messageModal").modal();
  3361. $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
  3362. $("#messageButton").off("click").on("click", function (t) {
  3363. $("#messageModal").modal("hide");
  3364. saveZlItemReal(true);
  3365. });
  3366. $("#cancelButton").off("click");
  3367. } else {
  3368. //虽然是不满6岁,但是也没有需要加收的项目,直接保存
  3369. saveZlItemReal(calculateTotalAmountFlag);
  3370. }
  3371. } else {
  3372. errorMesage(res);
  3373. }
  3374. }
  3375. });
  3376. } else {
  3377. saveZlItemReal(calculateTotalAmountFlag);
  3378. }
  3379. }
  3380. /**
  3381. * 保存当前项目到右边处方区域
  3382. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  3383. */
  3384. function saveZlItemReal(calculateTotalAmountFlag) {
  3385. var tableId = $("#zlTab li.active").find("a").attr("href");
  3386. //组号
  3387. var groupId = $(tableId).find("div:eq(0)").children().length + 1;
  3388. //项目名称
  3389. var zlItem = $("#zlItem").val();
  3390. //当前项目编码
  3391. var currentCode = $("#zl_current_code").val();
  3392. //当前项目价格
  3393. var zlItemPrice = $("#zlItemPrice").val();
  3394. //描述
  3395. var chargeUnit = $("#chargeUnit").val();
  3396. //执行科室
  3397. var zlExecUnit = $("#zlExecUnit").val();
  3398. //执行科室
  3399. var zlExecUnitName = $('#zlExecUnit option:selected').text();
  3400. zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
  3401. //次数
  3402. var itemQuantity = $("#itemQuantity").val();
  3403. //描述编码
  3404. var chargeUnitCode = chargeUnit;
  3405. var chargeUnitName = " 描述:";
  3406. //备注
  3407. var remark = $("#zlRemark").val();
  3408. if (currentCode == null || currentCode == '') {
  3409. if (calculateTotalAmountFlag == true) {
  3410. errorMesageSimaple("未选择任何项目!");
  3411. }
  3412. return;
  3413. }
  3414. //判断是否有重复的项目 返回true 说明有重复的
  3415. if (verifyRepeat(currentCode, null, null, 3)) {
  3416. return;
  3417. }
  3418. //原药品金额 如果是修改则需要设置
  3419. var temporaryItemsAmount = 0;
  3420. //当前需要被移除元素的下个兄弟节点
  3421. var nextObj = null;
  3422. //当前修改的药品是不是最后一个
  3423. var isLast = false;
  3424. //是新增药品还是编辑 true 修改 默认false
  3425. var updateFlag = $("#zl_update_flag").val();
  3426. if (updateFlag == undefined || updateFlag == null) {
  3427. updateFlag = false;
  3428. }
  3429. //如果是修改,需要减去原来的费用
  3430. //原组号
  3431. var oriGroupId = null;
  3432. if (updateFlag == "true" || updateFlag == true) {
  3433. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  3434. if (formGroups != null && formGroups.length > 0) {
  3435. for (var i = 0; i < formGroups.length; i++) {
  3436. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  3437. if (temporaryItemsCode === currentCode) {
  3438. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  3439. if (formGroups.length > 1) {
  3440. nextObj = $(formGroups[i]).next();
  3441. }
  3442. isLast = (i + 1) === formGroups.length;
  3443. oriGroupId = $(formGroups[i]).find("span.zlItemGroupId").text();
  3444. $(formGroups[i]).remove();
  3445. break;
  3446. }
  3447. }
  3448. }
  3449. }
  3450. if (oriGroupId != null) {
  3451. groupId = oriGroupId;
  3452. }
  3453. var html = '<div class="form-group">';
  3454. html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
  3455. html += zlItem + ' ';
  3456. html += " 数量:" + itemQuantity;
  3457. if (zlExecUnit != null && zlExecUnit != "") {
  3458. html += " 执行科室:" + zlExecUnitName;
  3459. }
  3460. if (chargeUnit != null && chargeUnit != '') {
  3461. html += chargeUnitName + chargeUnit;
  3462. }
  3463. if (remark != null && remark != '') {
  3464. html += ' 备注:' + remark;
  3465. }
  3466. 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>';
  3467. 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>';
  3468. html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editZlItem(this)"></i>';
  3469. 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>';
  3470. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  3471. html += '<input type="hidden" class="temporary_items_zlItemName" value="' + zlItem + '"/>';
  3472. html += '<input type="hidden" class="temporary_items_amount" value="' + zlItemPrice + '"/>';
  3473. html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
  3474. html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
  3475. html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
  3476. html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
  3477. html += '</div>';
  3478. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  3479. if (nextObj == null || isLast) {
  3480. $(tableId).find("div:eq(0)").append(html);
  3481. } else {
  3482. $(nextObj).before(html);
  3483. }
  3484. //设置当前处方金额
  3485. //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
  3486. if (calculateTotalAmountFlag) {
  3487. //设置总金额
  3488. calculateTotalAmount();
  3489. }
  3490. clearZlItem();
  3491. }
  3492. /**
  3493. * 临时保存住院证
  3494. * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
  3495. */
  3496. function saveZyReq(messageFlag) {
  3497. //如果
  3498. if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
  3499. initNavTabs(4);
  3500. }
  3501. var tableId = $("#zyReqTab li.active").find("a").attr("href");
  3502. //病区编码
  3503. var inpatientWardBeHospitalized = $("#inpatientWardBeHospitalized").val();
  3504. //小病室编码
  3505. var smallWardBeHospitalized = $("#smallWardBeHospitalized").val();
  3506. //入院状态编码
  3507. var admissStatus = $("#admissStatus").val();
  3508. //病区名称
  3509. var inpatientWardText = $('#inpatientWardBeHospitalized option:selected').text();
  3510. //小科室名称
  3511. var smallWardText = $('#smallWardBeHospitalized option:selected').text();
  3512. //入院状态名称
  3513. var admissStatusText = $('#admissStatus option:selected').text();
  3514. if (inpatientWardBeHospitalized == null || inpatientWardBeHospitalized == '') {
  3515. errorMesageSimaple("未选择入院病区!");
  3516. return;
  3517. }
  3518. if (admissStatus == null || admissStatus == '') {
  3519. errorMesageSimaple("未选择入院状态!");
  3520. return;
  3521. }
  3522. if (messageFlag == "true" || messageFlag == true) {
  3523. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  3524. if (formGroups != null && formGroups.length > 0) {
  3525. $("#messageModal").modal();
  3526. $("#messageContent").html("当前病人已经有一个暂存的入院申请,是否需要替换该申请?");
  3527. $("#messageButton").off("click").on("click", function (t) {
  3528. $("#messageModal").modal("hide");
  3529. saveZyReq(false);
  3530. });
  3531. $("#cancelButton").off("click");
  3532. return;
  3533. }
  3534. }
  3535. var html = '<div class="form-group"> 收住院';
  3536. if (inpatientWardText != null) {
  3537. html += " [" + inpatientWardText;
  3538. }
  3539. if (smallWardText != null) {
  3540. html += " (" + smallWardText + ") ";
  3541. }
  3542. if (inpatientWardText != null) {
  3543. html += "] ";
  3544. }
  3545. if (admissStatusText != null) {
  3546. html += admissStatusText;
  3547. }
  3548. html += ' 侯床';
  3549. //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>';
  3550. 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>';
  3551. html += '<input type="hidden" class="temporary_inpatient_ward" value="' + inpatientWardBeHospitalized + '"/>';
  3552. html += '<input type="hidden" class="temporary_items_small_ward" value="' + smallWardBeHospitalized + '"/>';
  3553. html += '<input type="hidden" class="temporary_items_admiss_status" value="' + admissStatus + '"/>';
  3554. html += '</div>';
  3555. $(tableId).find("div:eq(0)").html(html);
  3556. clearZyReq();
  3557. }
  3558. /**
  3559. * 删除药品或者项目
  3560. * @param index 0 西药 1 中药 2 项目
  3561. * @param obj 当前点击的对象
  3562. */
  3563. function removeYpOrProject(index, obj) {
  3564. var tabId = null;
  3565. var className=null;
  3566. //西药
  3567. if (index == 0) {
  3568. tabId = "xyTab";
  3569. } else if (index == 1) {
  3570. //中成药
  3571. tabId = "zyTab";
  3572. } else if (index == 2) {
  3573. //辅助检查、检验
  3574. className=".jcjyItemGroupId";
  3575. tabId = "jcjyTab";
  3576. } else if (index == 3) {
  3577. //诊疗
  3578. className=".zlItemGroupId";
  3579. tabId = "zlTab";
  3580. } else if (index == 4) {
  3581. //入院
  3582. tabId = "zyReqTab";
  3583. }
  3584. var tableId = $("#" + tabId + " li.active").find("a").attr("href");
  3585. //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
  3586. //calculateCfAmount(tableId, totalRetprice, null, index, 1);
  3587. //医技和诊疗的序号调整一下
  3588. if (index == 2 || index == 3) {
  3589. var nextAll = $(obj).parent().nextAll();
  3590. if (nextAll != null && nextAll.length > 0) {
  3591. for (var i = 0; i < nextAll.length; i++) {
  3592. var index = $(nextAll[i]).find(className).text();
  3593. $(nextAll[i]).find(className).text(index - 1);
  3594. }
  3595. }
  3596. }
  3597. $(obj).parent().remove();
  3598. if (index != 4) {
  3599. calculateTotalAmount();
  3600. }
  3601. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  3602. if (formGroups == null || formGroups.length == 0) {
  3603. if (index == 0) {
  3604. //西药被清空后,重置药房类型编码
  3605. $(tableId).find("input.current_groupNo").val(null);
  3606. //当本处方内容都被删除完后,也删除处方table
  3607. $("#" + tabId).find("a[href=\"" + tableId + "\"]").parent().remove();
  3608. $(tableId).remove();
  3609. //切换处方 最后一个被选中
  3610. $("#" + tabId).find("li:last > a").off("click").tab('show');
  3611. } else if (index == 1) {
  3612. //当中药处方被清空完后,重置当前中药类型为空
  3613. $("#current_zyClassType").val(null);
  3614. }
  3615. }
  3616. }
  3617. /**
  3618. * 清空西药
  3619. * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
  3620. */
  3621. function clearWesternMedicine(flag) {
  3622. $("#western_medicine_update_flag").val(false);
  3623. //药品名称
  3624. $("#western_medicine_name").val(null);
  3625. //当前药品编码
  3626. $("#western_medicine_current_code").val(null);
  3627. //当前药品规格
  3628. $("#western_medicine_current_serial").val(null);
  3629. //当前药房编码
  3630. $("#current_groupNo").val(null);
  3631. if (flag) {
  3632. //用法编码
  3633. $("#supplyType").selectpicker('val', null);
  3634. $('#supplyType').selectpicker('refresh');
  3635. //$("#supplyType").removeAttr("disabled");
  3636. //天数
  3637. $("#dayNum").selectpicker('val', null);
  3638. $('#dayNum').selectpicker('refresh');
  3639. // $("#dayNum").removeAttr("disabled");
  3640. //频次编码
  3641. $("#orderFrequency").selectpicker('val', null);
  3642. $('#orderFrequency').selectpicker('refresh');
  3643. // $("#orderFrequency").removeAttr("disabled");
  3644. }
  3645. //药品默认单次使用剂量
  3646. $("#drugWinDb").val(null);
  3647. //处方实际单次使用剂量
  3648. $("#drugWin").val(null);
  3649. //剂量单位
  3650. $("#drugWinUnit").selectpicker('val', null);
  3651. $('#drugWinUnit').selectpicker('refresh');
  3652. //总量
  3653. $("#gross").val(null);
  3654. //包装单位
  3655. $("#packUnit").selectpicker('val', null);
  3656. $('#packUnit').selectpicker('refresh');
  3657. //单价
  3658. $("#packRetprice").val(null);
  3659. //金额
  3660. $("#totalRetprice").val(null);
  3661. //医嘱
  3662. $("#medicalAdvice").selectpicker('val', null);
  3663. $('#medicalAdvice').selectpicker('refresh');
  3664. //皮试
  3665. $("#tryFlag").parent().removeClass('checked');
  3666. $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
  3667. //$("#gross").attr("readonly", "readonly");
  3668. $("#manufactoryName").val(null);
  3669. $("#specification").val(null);
  3670. }
  3671. /**
  3672. * 保存当前药品到右边处方区域 中药
  3673. * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  3674. */
  3675. function saveChineseMedicine(calculateTotalAmountFlag) {
  3676. //药品名称
  3677. var chineseMedicineNamme = $("#chinese_medicine_name").val();
  3678. //当前药品编码
  3679. var currentCode = $("#chinese_medicine_current_code").val();
  3680. //当前药品规格
  3681. var currentSerial = $("#chinese_medicine_current_serial").val();
  3682. //处方实际单次使用剂量
  3683. var drugWin = $("#zy_drugWin").val();
  3684. //医嘱码
  3685. var zyInstruction = $("#zyInstruction").val();
  3686. //医嘱
  3687. var zyInstructionText = $('#zyInstruction option:selected').text();
  3688. //单价
  3689. var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
  3690. //当前中药的总价
  3691. var totalRetprice = Multiply(drugWin, zyPackRetprice);
  3692. //中药类型
  3693. var zyClassType = $("#zyClassType").val();
  3694. //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
  3695. var currentYyClassType = $("#current_zyClassType").val();
  3696. if (currentYyClassType == null || currentYyClassType == "") {
  3697. //中药此时是第一次选择药品,不控制类型
  3698. $("#current_zyClassType").val(zyClassType);
  3699. } else if (currentYyClassType != zyClassType) {
  3700. errorMesageSimaple("同一个中药处方不允许同时出现普通中药和颗粒剂中药!");
  3701. return;
  3702. }
  3703. if (currentCode == null || currentCode == '') {
  3704. errorMesageSimaple("未选择任何药品!");
  3705. return;
  3706. }
  3707. var html = '<div class="form-group" style="float: left;">';
  3708. html += chineseMedicineNamme;
  3709. if (zyInstruction != null && zyInstruction != '') {
  3710. html += '[' + zyInstructionText + ']';
  3711. }
  3712. html += '<span style="margin-left: 5px"></span>';
  3713. html += drugWin + 'g';
  3714. 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>';
  3715. 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>';
  3716. 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>';
  3717. 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>';
  3718. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  3719. html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
  3720. html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
  3721. html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
  3722. html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
  3723. html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
  3724. html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
  3725. html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
  3726. html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
  3727. html += '</div>';
  3728. var tableId = $("#zyTab li.active").find("a").attr("href");
  3729. //原药品金额 如果是修改则需要设置
  3730. var temporaryItemsAmount = 0;
  3731. //当前需要被移除元素的下个兄弟节点
  3732. var nextObj = null;
  3733. //当前修改的药品是不是最后一个
  3734. var isLast = false;
  3735. //是新增药品还是编辑 true 修改 默认false
  3736. var updateFlag = $("#chinese_medicine_update_flag").val();
  3737. if (updateFlag == undefined || updateFlag == null) {
  3738. updateFlag = false;
  3739. }
  3740. //如果是修改,需要减去原来的费用
  3741. if (updateFlag == "true" || updateFlag == true) {
  3742. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  3743. if (formGroups != null && formGroups.length > 0) {
  3744. for (var i = 0; i < formGroups.length; i++) {
  3745. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  3746. var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
  3747. if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
  3748. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  3749. if (formGroups.length > 1) {
  3750. nextObj = $(formGroups[i]).next();
  3751. }
  3752. isLast = (i + 1) === formGroups.length;
  3753. $(formGroups[i]).remove();
  3754. break;
  3755. }
  3756. }
  3757. }
  3758. }
  3759. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  3760. if (nextObj == null || isLast) {
  3761. $(tableId).find("div:eq(0)").append(html);
  3762. } else {
  3763. $(nextObj).before(html);
  3764. }
  3765. //设置当前处方金额
  3766. // calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
  3767. if (calculateTotalAmountFlag) {
  3768. //设置总金额
  3769. calculateTotalAmount();
  3770. }
  3771. clearChineseMedicine();
  3772. }
  3773. /**
  3774. * 清空中药
  3775. */
  3776. function clearChineseMedicine() {
  3777. $("#chinese_medicine_update_flag").val(false);
  3778. //药品名称
  3779. $("#chinese_medicine_name").val(null);
  3780. //当前药品编码
  3781. $("#chinese_medicine_current_code").val(null);
  3782. //当前药品规格
  3783. $("#chinese_medicine_current_serial").val(null);
  3784. //医嘱
  3785. $("#zyInstruction").selectpicker('val', null);
  3786. $('#zyInstruction').selectpicker('refresh');
  3787. //剂量
  3788. $("#zy_drugWin").val(null);
  3789. //单价
  3790. $("#zy_packRetprice").val(null);
  3791. }
  3792. /**
  3793. * 清空辅助检查、检验项目
  3794. */
  3795. function clearJyJcItem() {
  3796. $("#jcjy_update_flag").val(false);
  3797. //项目名称
  3798. $("#jcJyItem").val(null);
  3799. //当前项目编码
  3800. $("#jcjy_current_code").val(null);
  3801. //单价
  3802. $("#jcjyItemPrice").val(null);
  3803. //备注
  3804. $("#remark").val(null);
  3805. $("#jcJyZltype").val(null);
  3806. $("#jyZdSample").selectpicker('val', null);
  3807. $('#jyZdSample').selectpicker('refresh');
  3808. $("#yshPart").selectpicker('val', null);
  3809. $('#yshPart').selectpicker('refresh');
  3810. $("#execUnit").selectpicker('val', null);
  3811. $('#execUnit').selectpicker('refresh');
  3812. $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
  3813. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  3814. $("#yshPartDiv").removeClass("in").addClass("hide");
  3815. }
  3816. /**
  3817. * 清空诊疗项目
  3818. */
  3819. function clearZlItem() {
  3820. $("#zl_update_flag").val(false);
  3821. //项目名称
  3822. $("#zlItem").val(null);
  3823. //当前项目编码
  3824. $("#zl_current_code").val(null);
  3825. //单价
  3826. $("#zlItemPrice").val(null);
  3827. //备注
  3828. $("#zlRemark").val(null);
  3829. //描述
  3830. $("#chargeUnit").val(null);
  3831. $("#itemQuantity").val(1);
  3832. $("#zlExecUnit").selectpicker('val', null);
  3833. $('#zlExecUnit').selectpicker('refresh');
  3834. }
  3835. /**
  3836. * 清空入院证输入框
  3837. */
  3838. function clearZyReq() {
  3839. $("#inpatientWardBeHospitalized").selectpicker('val', null);
  3840. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  3841. $("#smallWardBeHospitalized").selectpicker('val', null);
  3842. $('#smallWardBeHospitalized').selectpicker('refresh');
  3843. $("#admissStatus").selectpicker('val', null);
  3844. $('#admissStatus').selectpicker('refresh');
  3845. $("#totalBedNum").val(null);
  3846. $("#freeBedNum").val(null);
  3847. $("#occupationBedNum").val(null);
  3848. initSmallDeptByDept();
  3849. }
  3850. /**
  3851. * 计算总金额
  3852. */
  3853. function calculateTotalAmount() {
  3854. var jsonData = getParamsForpPrescription();
  3855. $.ajax({
  3856. type: "POST",
  3857. url: '/thmz/getAmountForTempPrescription',
  3858. contentType: "application/json;charset=UTF-8",
  3859. dataType: "json",
  3860. data: JSON.stringify(jsonData),
  3861. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3862. success: function (res) {
  3863. if (res == '401' || res == 401) {
  3864. window.location.href = '/thmz/login/view'
  3865. return;
  3866. }
  3867. if (res.code == 0) {
  3868. $("#totalAmount").html(res.data.amount.toFixed(1));
  3869. var arrs = $("span.cf_amount");
  3870. for (var i = 0; i < arrs.length; i++) {
  3871. if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
  3872. $(arrs[i]).html(res.data.amountList[i].toFixed(1));
  3873. }
  3874. }
  3875. // var arrs = $("#xyTabContent").find("span.cf_amount");
  3876. // for (var i = 0; i < arrs.length; i++) {
  3877. // $(arrs[i]).html(res.data.xyAmount.toFixed(1));
  3878. // }
  3879. // $("#zyTabContent").find("span.cf_amount").html(res.data.zyAmount.toFixed(1));
  3880. // if (res.data.yjAmount != null) {
  3881. // //如果
  3882. // if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  3883. // initNavTabs(2);
  3884. // }
  3885. // $("#zlTabContent").find("span.cf_amount").html(res.data.yjAmount.toFixed(1));
  3886. // }
  3887. } else {
  3888. errorMesage(res);
  3889. }
  3890. }
  3891. });
  3892. }
  3893. // /**
  3894. // * 打开住院处理窗口
  3895. // * @param data
  3896. // */
  3897. // function beHospitalized() {
  3898. // $("#beHospitalizedModal").modal();
  3899. // //根据病人门诊id查询病人的入院申请
  3900. // $.ajax({
  3901. // type: "GET",
  3902. // url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
  3903. // contentType: "application/json;charset=UTF-8",
  3904. // dataType: "json",
  3905. // headers: {
  3906. // 'Accept': 'application/json',
  3907. // 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3908. // },
  3909. // success: function (resZyz) {
  3910. // if (resZyz == '401' || resZyz == 401) {
  3911. // window.location.href = '/thmz/login/view'
  3912. // return;
  3913. // }
  3914. // if (resZyz.code == 0) {
  3915. // $("#icdCodeInputBeHospitalized").val(resZyz.data.icdCode);
  3916. // $("#icdTextBeHospitalized").val(resZyz.data.icdText);
  3917. // $("#icdTextBeHospitalized").attr("title", resZyz.data.icdText);
  3918. // $("#inpatientWardBeHospitalized").selectpicker('val', resZyz.data.reqDept);
  3919. // $("#inpatientWardBeHospitalized").selectpicker('refresh');
  3920. // initSmallDeptByDept();
  3921. // $("#smallWardBeHospitalized").selectpicker('val', resZyz.data.smallDept);
  3922. // $("#smallWardBeHospitalized").selectpicker('refresh');
  3923. // $("#admissStatus").selectpicker('val', resZyz.data.admissStatus);
  3924. // $("#admissStatus").selectpicker('refresh');
  3925. // $("#zyReqVisitDate").val(format(resZyz.data.visitDate, "yyyy-MM-dd HH:mm:ss"));
  3926. // }
  3927. // }
  3928. // });
  3929. // }
  3930. /**
  3931. * 打开编辑用户信息窗口
  3932. * @param data
  3933. */
  3934. function editUserModal() {
  3935. $("#editUserModal").modal();
  3936. $.ajax({
  3937. type: "GET",
  3938. url: '/thmz/getByPatientId?patientId=' + $("#patientId").text(),
  3939. contentType: "application/json;charset=UTF-8",
  3940. dataType: "json",
  3941. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3942. success: function (res) {
  3943. if (res == '401' || res == 401) {
  3944. window.location.href = '/thmz/login/view'
  3945. return;
  3946. }
  3947. if (res.code == 0) {
  3948. if (res.data != null) {
  3949. //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
  3950. setTimeout(function () {
  3951. fillPlusPatinet(res.data);
  3952. }, 400);
  3953. }
  3954. } else {
  3955. errorMesage(res);
  3956. }
  3957. }
  3958. });
  3959. }
  3960. /**
  3961. * 处方类型按钮切换事件
  3962. * @param object
  3963. * @param objectIndex
  3964. */
  3965. function billItemButtonChange(object, objectIndex) {
  3966. $(".nav-tabs").removeClass("in").addClass("hide");
  3967. $(".tab-content").removeClass("in").addClass("hide");
  3968. $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
  3969. $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
  3970. $("#bill_item_group").find("button").each(function (index, element) {
  3971. if ($(element).hasClass("btn-primary")) {
  3972. $(element).removeClass("btn-primary").addClass("btn-default");
  3973. }
  3974. $("#rp_form" + index).removeClass("show").addClass("hide");
  3975. });
  3976. $("#rp_form" + objectIndex).removeClass("hide").addClass("show");
  3977. $(object).removeClass("btn-default").addClass("btn-primary");
  3978. $("#western_medicine_name").webuiPopover('hide');
  3979. $("#chinese_medicine_name").webuiPopover('hide');
  3980. $("#jcJyItem").webuiPopover('hide');
  3981. $("#zlItem").webuiPopover('hide');
  3982. if (objectIndex == 0) {
  3983. $("#western_medicine_name").focus();
  3984. } else if (objectIndex == 1) {
  3985. $("#chinese_medicine_name").focus();
  3986. } else if (objectIndex == 2) {
  3987. $("#jcJyItem").focus();
  3988. } else if (objectIndex == 3) {
  3989. $("#zlItem").focus();
  3990. }else if (objectIndex == 4) {
  3991. // $("#inpatientWardBeHospitalized").next().click();
  3992. prevEleId = "zy_req_button";
  3993. }
  3994. }
  3995. /**
  3996. * 打开快速接诊窗口
  3997. * @param data
  3998. */
  3999. function rapidAcceptsModal() {
  4000. $("#rapidAcceptsModal").modal();
  4001. //延迟触发 默认光标在卡号输入框
  4002. setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
  4003. }
  4004. /**
  4005. * checkBox样式
  4006. */
  4007. function formatCheck() {
  4008. if ($("input.flat")[0]) {
  4009. $(document).ready(function () {
  4010. $('input.flat').iCheck({
  4011. checkboxClass: 'icheckbox_flat-blue',
  4012. radioClass: 'iradio_flat-blue'
  4013. });
  4014. });
  4015. }
  4016. }
  4017. /**
  4018. * 卡号有变化后查询病人信息
  4019. */
  4020. function queryUserInfoByCardNo() {
  4021. //当反写的id不存在,说明不是查询后的改变事件,触发查询
  4022. var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
  4023. var index = rapidAcceptsUserCardNo.indexOf("-");
  4024. if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "") && ((index > 0 && index == rapidAcceptsUserCardNo.length - 2) || rapidAcceptsUserCardNo.length == 8)) {
  4025. $("#cardNo").attr("title", rapidAcceptsUserCardNo);
  4026. $.ajax({
  4027. type: "GET",
  4028. url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
  4029. contentType: "application/json;charset=UTF-8",
  4030. dataType: "json",
  4031. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4032. success: function (res) {
  4033. if (res == '401' || res == 401) {
  4034. window.location.href = '/thmz/login/view'
  4035. return;
  4036. }
  4037. if (res.code == 0) {
  4038. if (res.data != null) {
  4039. $("#rapidAcceptsUserName").val(res.data.name);
  4040. $("#rapidAcceptsUserCode").val(res.data.patientId);
  4041. $("#patientIdDb").val(res.data.patientId);
  4042. $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
  4043. $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
  4044. $("#rapidAcceptsUserGender").selectpicker('refresh');
  4045. $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
  4046. $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
  4047. $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
  4048. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  4049. $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
  4050. $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
  4051. //查询分诊号
  4052. $.ajax({
  4053. type: "POST",
  4054. url: '/thmz/getUnClinicWithPage',
  4055. contentType: "application/json;charset=UTF-8",
  4056. dataType: "json",
  4057. data: JSON.stringify({"patientId": res.data.patientId}),
  4058. headers: {
  4059. 'Accept': 'application/json',
  4060. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  4061. },
  4062. success: function (resFz) {
  4063. if (resFz == '401' || resFz == 401) {
  4064. window.location.href = '/thmz/login/view'
  4065. return;
  4066. }
  4067. if (resFz.code == 0) {
  4068. if (resFz.data == null || resFz.data.length == 0) {
  4069. errorMesageSimaple("没有查询到符合条件的分诊记录!");
  4070. clearRapidAcceptsModal();
  4071. return;
  4072. }
  4073. $("#mzfzSerialNo").val(resFz.data[0].serialNo);
  4074. }
  4075. }
  4076. });
  4077. } else {
  4078. errorMesageSimaple("病人信息不存在!");
  4079. }
  4080. } else {
  4081. errorMesage(res);
  4082. }
  4083. }
  4084. });
  4085. }
  4086. }
  4087. /**
  4088. * 清空快速接诊查询框
  4089. */
  4090. function clearRapidAccepts() {
  4091. $("#rapidAcceptsUserName").val(null);
  4092. $("#rapidAcceptsUserCode").val(null);
  4093. $("#patientIdDb").val(null);
  4094. $("#rapidAcceptsUserCardNo").val(null);
  4095. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  4096. $("#rapidAcceptsUserGender").selectpicker('refresh');
  4097. $("#rapidAcceptsUserPhoneNum").val(null);
  4098. $("#rapidAcceptsUserIdCard").val(null);
  4099. $("#rapidAcceptsUserIdCard").attr("title", null);
  4100. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  4101. $("#mzfzSerialNo").val(null);
  4102. $("#rapidAcceptsUserCardNo").focus();
  4103. }
  4104. /**
  4105. * 根据病人姓名输入框内容动态加载病人列表
  4106. */
  4107. function initUserList() {
  4108. //var width=$("#userName").css("width");
  4109. var settings = {
  4110. trigger: 'click',
  4111. content: '',
  4112. width: 170,
  4113. multi: true,
  4114. closeable: false,
  4115. style: '',
  4116. delay: 300,
  4117. padding: true,
  4118. height: 300,
  4119. };
  4120. var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
  4121. //用户姓名选中事件
  4122. $("#rapidAcceptsUserName").on("click", function (t) {
  4123. if ($(webuiPopover).css("display") == "block") {
  4124. refeshPatinetList(true);
  4125. }
  4126. });
  4127. }
  4128. /**
  4129. * 刷新候诊病人列表
  4130. */
  4131. function refeshPatinetList(flag) {
  4132. //如果是重新加载病人列表,需要重置下标
  4133. if (flag) {
  4134. //重置下标
  4135. pageIndex = 0;
  4136. msg_list_loading = true;
  4137. }
  4138. var userName = $('#rapidAcceptsUserName').val();
  4139. if (!(userName == null || userName == "" || isChinese(userName))) {
  4140. return;
  4141. }
  4142. $.ajax({
  4143. type: "POST",
  4144. url: '/thmz/getUnClinicWithPage',
  4145. contentType: "application/json;charset=UTF-8",
  4146. dataType: "json",
  4147. data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
  4148. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4149. success: function (res) {
  4150. if (res == '401' || res == 401) {
  4151. window.location.href = '/thmz/login/view'
  4152. return;
  4153. }
  4154. if (res.code == 0) {
  4155. if (res.data != null && res.data.length > 0) {
  4156. $("#webuiPopover0").css("display", "block");
  4157. $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
  4158. var html = '<div class="list-group">';
  4159. for (var i = 0; i < res.data.length; i++) {
  4160. var mzPatientMi = res.data[i];
  4161. html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
  4162. if (mzPatientMi.gender == "男") {
  4163. html += '<img src="/thmz/images/boy.png"/>'
  4164. } else if (mzPatientMi.gender == "女") {
  4165. html += '<img src="/thmz/images/girl.png"/>'
  4166. } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
  4167. html += '<img src="/thmz/images/girl_or_boy.png"/>'
  4168. }
  4169. html += '<div>' + mzPatientMi.name + '&nbsp;' + mzPatientMi.gender + '&nbsp;';
  4170. if (mzPatientMi.age != null && mzPatientMi.age != "") {
  4171. html += mzPatientMi.age + '岁';
  4172. } else {
  4173. html += '**岁';
  4174. }
  4175. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
  4176. html += '<span>' + mzPatientMi.phoneNo + '</span>';
  4177. }
  4178. html += '</div></a>';
  4179. }
  4180. html += '</div>';
  4181. if (flag) {
  4182. $("#webuiPopover0 div.webui-popover-content").html("");
  4183. }
  4184. $("#webuiPopover0 div.webui-popover-content").append(html);
  4185. $("#webuiPopover0 div.arrow").css("left", "23px");
  4186. refeshPatinetListScrollEvent();
  4187. } else {
  4188. $("#webuiPopover0").css("display", "none");
  4189. }
  4190. }
  4191. //查询完成,设置加载完成
  4192. msg_list_loading = false;
  4193. }
  4194. });
  4195. }
  4196. /**
  4197. * 病人下拉列表滚动条滚动到底部时继续加载新纪录
  4198. */
  4199. function refeshPatinetListScrollEvent() {
  4200. $('.webui-popover-content').scroll(function (event) {
  4201. var top = $(this).scrollTop();
  4202. var height = $(this).height();
  4203. var scrollHeight = $(this).get(0).scrollHeight;
  4204. if (scrollHeight <= top + height) {
  4205. if (!msg_list_loading) {
  4206. msg_list_loading = true;
  4207. pageIndex = pageIndex + 1;
  4208. refeshPatinetList(false);
  4209. }
  4210. }
  4211. });
  4212. }
  4213. /**
  4214. * 按照病人id查询病人信息
  4215. * @param patientId
  4216. */
  4217. function fillUnClinicPatinet(patientId) {
  4218. $("#rapidAcceptsUserCardNo").val(patientId);
  4219. $("#webuiPopover0").css("display", "none");
  4220. queryUserInfoByCardNo();
  4221. }
  4222. /**
  4223. * 加载主诉,体格检查,诊断窗口
  4224. */
  4225. function initRecommendList() {
  4226. var width = $("#symptom").parent().css("width");
  4227. var settings = {
  4228. placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  4229. trigger: 'click', //值:click,hover 触发方式 manual 手动
  4230. content: '',//内容,内容可以是函数
  4231. width: width,
  4232. //arrow:false,//是否显示箭头
  4233. multi: true,//在页面允许其他弹出层
  4234. closeable: true,//显示关闭按钮
  4235. style: '', //值:'',inverse
  4236. delay: 300,//延迟时间, 悬浮属性才执行
  4237. padding: true,//内容填充
  4238. height: 320,
  4239. //offsetTop:10,
  4240. cache: true,//如果缓存设置为false,则popover将销毁并重新创建
  4241. };
  4242. //主诉弹窗
  4243. var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
  4244. //体格检查弹窗
  4245. settings.height = 260;
  4246. $('#weight').webuiPopover('destroy').webuiPopover(settings);
  4247. //诊断弹窗
  4248. settings.height = 320;
  4249. var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
  4250. //西药弹窗
  4251. settings.width = 680;
  4252. settings.closeable = false;
  4253. settings.arrow = false;//显示箭头或不显示箭头
  4254. settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
  4255. //手动触发
  4256. settings.trigger = 'manual';
  4257. var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
  4258. //中药弹窗
  4259. settings.trigger = 'click';
  4260. settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
  4261. //手动触发
  4262. settings.trigger = 'manual';
  4263. var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
  4264. //辅助检查、检验弹窗
  4265. settings.trigger = 'manual';
  4266. settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
  4267. var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
  4268. //诊疗弹窗
  4269. settings.trigger = 'manual';
  4270. settings.content = '<div id="zlItemPopoverContent"><table id="tb_table_zl_item"></table></div>';
  4271. var zlItemWebuiPopover = $('#zlItem').webuiPopover('destroy').webuiPopover(settings);
  4272. //主诉选中事件
  4273. $("#symptom").on("click", function (t) {
  4274. if ($(symptomWebuiPopover).css("display") == "block") {
  4275. $("#webuiPopover1 div.arrow").css("left", "23px");
  4276. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
  4277. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
  4278. html += "</div>";
  4279. html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
  4280. '<div style="float: left">' +
  4281. '<span style="margin-left: 20px;">内容:</span> ' +
  4282. '</div>' +
  4283. '<div style="float: left;">' +
  4284. '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
  4285. '<option label="常用症状" value="0">常用症状</option>' +
  4286. '<option label="常用时间" value="1">常用时间</option>' +
  4287. '<option label="常用标点" value="2">常用标点</option>' +
  4288. '<option label="常用词" value="3">常用词</option>' +
  4289. '</select> ' +
  4290. '</div>' +
  4291. '<div style="width: 200px;float: left;margin-left: 10px;">' +
  4292. '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
  4293. '</div>' +
  4294. '<div style="float: left;margin-left: 10px;">' +
  4295. ' <button type="button" class="btn" onclick="saveParams();"' +
  4296. ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
  4297. ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
  4298. ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
  4299. ' </svg>' +
  4300. '新增' +
  4301. ' </button>' +
  4302. ' </div>' +
  4303. '</div>';
  4304. $("#webuiPopover1 div.webui-popover-content").html(html);
  4305. $('#paramsType').selectpicker('refresh');
  4306. $("#paramsType").parent().css("width", "140px").css("height", "34px");
  4307. $("#webuiPopover1").css("z-index", "10");
  4308. if ($("#webuiPopover1").hasClass("in")) {
  4309. loadSymptom();
  4310. }
  4311. }
  4312. //加载智能接诊模块的主诉推荐
  4313. fitSymptomData();
  4314. });
  4315. //体格检查各输入框选中事件
  4316. $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor,#pressure_high_left,#pressure_floor_left").on("click", function (t) {
  4317. if ($("#webuiPopover2").css("display") == "block") {
  4318. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  4319. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
  4320. $("#webuiPopover2 div.arrow").css("left", "23px");
  4321. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  4322. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  4323. html += "</div>";
  4324. $("#webuiPopover2 div.webui-popover-content").html(html);
  4325. $("#webuiPopover2").css("z-index", "10");
  4326. if ($("#webuiPopover2").hasClass("in")) {
  4327. loadHealthCheckup();
  4328. }
  4329. }
  4330. //loadSymptom();
  4331. } else {
  4332. $('#weight').webuiPopover('show');
  4333. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  4334. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
  4335. $("#webuiPopover2 div.arrow").css("left", "23px");
  4336. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  4337. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  4338. html += "</div>";
  4339. $("#webuiPopover2 div.webui-popover-content").html(html);
  4340. $("#webuiPopover2").css("z-index", "10");
  4341. if ($("#webuiPopover2").hasClass("in")) {
  4342. loadHealthCheckup();
  4343. }
  4344. }
  4345. }
  4346. return false;
  4347. });
  4348. //诊断选中事件
  4349. $("#diagnose").on("click", function (t) {
  4350. if ($(diagnoseWebuiPopover).css("display") == "block") {
  4351. $("#webuiPopover3 div.arrow").css("left", "23px");
  4352. $("#webuiPopover3 a.close").css("margin-top", "15px");
  4353. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
  4354. html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
  4355. ' <input type="text" class="form-control has-feedback-left" ' +
  4356. ' placeholder="搜索" style="padding-left: 10px;" oninput="loadDiagnose(this.value)" id="paramsDiagnose">' +
  4357. ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
  4358. ' </div>';
  4359. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
  4360. html += "</div>";
  4361. $("#webuiPopover3 div.webui-popover-content").html(html);
  4362. $("#webuiPopover3").css("z-index", "10");
  4363. //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
  4364. loadDiagnose("");
  4365. }
  4366. //加载智能接诊模块的诊断推荐推荐
  4367. fitDiagnoseData();
  4368. });
  4369. //现病史选中事件
  4370. $("#emrHpi").on("click", function (t) {
  4371. //加载智能接诊模块的现病史推荐推荐
  4372. fitEmrHpiData();
  4373. });
  4374. //既往史选中事件
  4375. $("#emrPs").on("click", function (t) {
  4376. //加载智能接诊模块的既往史推荐推荐
  4377. fitEmrPsData();
  4378. });
  4379. // //西药选中事件
  4380. // $("#western_medicine_name").on("click", function (t) {
  4381. // if ($(westernMedicineWebuiPopover).css("display") == "block") {
  4382. // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
  4383. // loadYpList(0);
  4384. // }
  4385. // });
  4386. // //中药选中事件
  4387. // $("#chinese_medicine_name").on("click", function (t) {
  4388. // if ($(chineseMedicineWebuiPopover).css("display") == "block") {
  4389. // $("#chineseMedicinePopoverContent").parent().parent().prev().css("left", "23px");
  4390. // loadYpList(1);
  4391. // }
  4392. // });
  4393. // //诊疗与医技弹窗选中事件
  4394. // $("#jcJyItem").on("click", function (t) {
  4395. // if ($(jcJyItemWebuiPopover).css("display") == "block") {
  4396. // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
  4397. // loadjcJyItemList();
  4398. // }
  4399. // });
  4400. //帮助字典弹窗
  4401. settings.width = 450;
  4402. settings.height = 500;
  4403. settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  4404. settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
  4405. settings.trigger = 'click';
  4406. var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
  4407. $("#treeButton").on("click", function (t) {
  4408. // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
  4409. //初始化药品,检查检验菜单树
  4410. initzTree();
  4411. });
  4412. }
  4413. /**
  4414. * 新增通用参数
  4415. */
  4416. function saveParams() {
  4417. $.ajax({
  4418. type: "POST",
  4419. url: '/thmz/saveTCommonParams',
  4420. contentType: "application/json;charset=UTF-8",
  4421. dataType: "json",
  4422. data: JSON.stringify({
  4423. "paramsType": $("#paramsType").val(),
  4424. "paramsName": $("#paramsNameInput").val()
  4425. }),
  4426. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4427. success: function (res) {
  4428. if (res == '401' || res == 401) {
  4429. window.location.href = '/thmz/login/view'
  4430. return;
  4431. }
  4432. if (res.code == 0) {
  4433. successMesage(res);
  4434. loadSymptom();
  4435. $("#paramsNameInput").val(null);
  4436. // $("#paramsType").selectpicker('val', 0);
  4437. // $("#paramsType").selectpicker('refresh');
  4438. } else {
  4439. errorMesage(res);
  4440. }
  4441. }
  4442. });
  4443. }
  4444. /**
  4445. * 加载主诉参数列表
  4446. */
  4447. function loadSymptom() {
  4448. $.ajax({
  4449. type: "GET",
  4450. url: '/thmz/loadSymptom',
  4451. contentType: "application/json;charset=UTF-8",
  4452. dataType: "json",
  4453. async: false,
  4454. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4455. success: function (res) {
  4456. if (res == '401' || res == 401) {
  4457. window.location.href = '/thmz/login/view'
  4458. return;
  4459. }
  4460. var html = '';
  4461. if (res.code == 0) {
  4462. if (res.featureList != null && res.featureList.length > 0) {
  4463. html += '<div id="feature">';
  4464. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
  4465. html += '<div style="width: calc(100% - 80px); float: left;">';
  4466. for (var i = 0; i < res.featureList.length; i++) {
  4467. 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;">';
  4468. html += res.featureList[i].paramsName;
  4469. html += '</span></button>';
  4470. }
  4471. html += '</div><div style="clear:both"></div></div>';
  4472. }
  4473. if (res.timeList != null && res.timeList.length > 0) {
  4474. html += '<div id="time">';
  4475. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
  4476. html += '<div style="width: calc(100% - 80px); float: left;">';
  4477. for (var i = 0; i < res.timeList.length; i++) {
  4478. 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;">';
  4479. html += res.timeList[i].paramsName;
  4480. html += '</span></button>';
  4481. }
  4482. html += '</div><div style="clear:both"></div></div>';
  4483. }
  4484. if (res.characterList != null && res.characterList.length > 0) {
  4485. html += '<div id="character">';
  4486. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
  4487. html += '<div style="width: calc(100% - 80px); float: left;">';
  4488. for (var i = 0; i < res.characterList.length; i++) {
  4489. 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;">';
  4490. html += res.characterList[i].paramsName;
  4491. html += '</span></button>';
  4492. }
  4493. html += '</div><div style="clear:both"></div></div>';
  4494. }
  4495. if (res.wordsList != null && res.wordsList.length > 0) {
  4496. html += '<div id="words">';
  4497. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
  4498. html += '<div style="width: calc(100% - 80px); float: left;">';
  4499. for (var i = 0; i < res.wordsList.length; i++) {
  4500. 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;">';
  4501. html += res.wordsList[i].paramsName;
  4502. html += '</span></button>';
  4503. }
  4504. html += '</div><div style="clear:both"></div></div>';
  4505. }
  4506. } else {
  4507. errorMesage(res);
  4508. }
  4509. $("#contentHtml").html(html);
  4510. }
  4511. });
  4512. }
  4513. /**
  4514. * 加载体格检查参数列表
  4515. */
  4516. function loadHealthCheckup() {
  4517. $.ajax({
  4518. type: "GET",
  4519. url: '/thmz/loadHealthCheckup',
  4520. contentType: "application/json;charset=UTF-8",
  4521. dataType: "json",
  4522. async: false,
  4523. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4524. success: function (res) {
  4525. if (res == '401' || res == 401) {
  4526. window.location.href = '/thmz/login/view'
  4527. return;
  4528. }
  4529. var html = '';
  4530. if (res.code == 0) {
  4531. if (res.weightList != null && res.weightList.length > 0) {
  4532. html += '<div id="weightDiv">';
  4533. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
  4534. html += '<div style="width: calc(100% - 80px); float: left;">';
  4535. for (var i = 0; i < res.weightList.length; i++) {
  4536. 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;">';
  4537. html += res.weightList[i].paramsName;
  4538. html += '</span></button>';
  4539. }
  4540. html += '</div><div style="clear:both"></div></div>';
  4541. }
  4542. if (res.temperatureList != null && res.temperatureList.length > 0) {
  4543. html += '<div id="temperatureDiv">';
  4544. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
  4545. html += '<div style="width: calc(100% - 80px); float: left;">';
  4546. for (var i = 0; i < res.temperatureList.length; i++) {
  4547. 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;">';
  4548. html += res.temperatureList[i].paramsName;
  4549. html += '</span></button>';
  4550. }
  4551. html += '</div><div style="clear:both"></div></div>';
  4552. }
  4553. if (res.sphygmusList != null && res.sphygmusList.length > 0) {
  4554. html += '<div id="sphygmusDiv">';
  4555. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
  4556. html += '<div style="width: calc(100% - 80px); float: left;">';
  4557. for (var i = 0; i < res.sphygmusList.length; i++) {
  4558. 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;">';
  4559. html += res.sphygmusList[i].paramsName;
  4560. html += '</span></button>';
  4561. }
  4562. html += '</div><div style="clear:both"></div></div>';
  4563. }
  4564. if (res.breatheList != null && res.breatheList.length > 0) {
  4565. html += '<div id="breatheDiv">';
  4566. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
  4567. html += '<div style="width: calc(100% - 80px); float: left;">';
  4568. for (var i = 0; i < res.breatheList.length; i++) {
  4569. 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;">';
  4570. html += res.breatheList[i].paramsName;
  4571. html += '</span></button>';
  4572. }
  4573. html += '</div><div style="clear:both"></div></div>';
  4574. }
  4575. if (res.pressureList != null && res.pressureList.length > 0) {
  4576. html += '<div id="pressureDiv">';
  4577. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">血压:</div>';
  4578. html += '<div style="width: calc(100% - 80px); float: left;">';
  4579. for (var i = 0; i < res.pressureList.length; i++) {
  4580. 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;">';
  4581. html += res.pressureList[i].paramsName;
  4582. html += '</span></button>';
  4583. }
  4584. html += '</div><div style="clear:both"></div></div>';
  4585. }
  4586. } else {
  4587. errorMesage(res);
  4588. }
  4589. $("#healthCheckupContentHtml").html(html);
  4590. }
  4591. });
  4592. }
  4593. /**
  4594. * 加载诊断参数列表
  4595. * @param value
  4596. */
  4597. function loadDiagnose(value) {
  4598. if (!$("#webuiPopover3").hasClass("in")) {
  4599. return;
  4600. }
  4601. $.ajax({
  4602. type: "GET",
  4603. url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + value + '&pageSize=100',
  4604. contentType: "application/json;charset=UTF-8",
  4605. dataType: "json",
  4606. async: false,
  4607. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4608. success: function (res) {
  4609. if (res == '401' || res == 401) {
  4610. window.location.href = '/thmz/login/view'
  4611. return;
  4612. }
  4613. var html = '';
  4614. if (res.code == 0) {
  4615. if (res.data != null && res.data.length > 0) {
  4616. html += '<div>';
  4617. for (var i = 0; i < res.data.length; i++) {
  4618. 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;">';
  4619. html += res.data[i].paramsName;
  4620. html += '<small>&nbsp;&nbsp;(' + res.data[i].paramsCode + ')</small>';
  4621. html += '</span></button>';
  4622. }
  4623. html += '</div>';
  4624. }
  4625. } else {
  4626. errorMesage(res);
  4627. }
  4628. $("#diagnoseContentHtml").html(html);
  4629. }
  4630. });
  4631. }
  4632. /**
  4633. * 填充诊断
  4634. * @param value
  4635. * @param code
  4636. */
  4637. function fitDiagnoseValue(value, code) {
  4638. if (code === null || code === "") {
  4639. return;
  4640. }
  4641. var html = '';
  4642. var childrenNum = $("#diagnoseTags").children().length;
  4643. if (childrenNum == 6) {
  4644. errorMesageSimaple("最多填写六个诊断!");
  4645. return;
  4646. }
  4647. var diagnoseValue = $("#diagnoseValue").val();
  4648. if (diagnoseValue == null || diagnoseValue == "") {
  4649. diagnoseValue = code;
  4650. } else {
  4651. if (diagnoseValue.indexOf(code) != -1) {
  4652. errorMesageSimaple("诊断已存在,请勿重复添加!");
  4653. return;
  4654. }
  4655. diagnoseValue += "," + code;
  4656. }
  4657. $("#diagnoseValue").val(diagnoseValue);
  4658. if (childrenNum == 0) {
  4659. html += '<span class="el-tag--mainDiagnosis" ';
  4660. } else {
  4661. html += '<span class="el-tag--secondaryDiagnosis" ';
  4662. }
  4663. 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>';
  4664. $("#diagnoseTags").append(html);
  4665. $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
  4666. }
  4667. /**
  4668. * 移除诊断
  4669. * @param code
  4670. */
  4671. function removeDiagnoseValue(code) {
  4672. var childrenIndex = 0;
  4673. var children = $("#diagnoseTags").children();
  4674. for (var i = 0; i < children.length; i++) {
  4675. if ($(children[i]).attr("id") == code) {
  4676. childrenIndex = i;
  4677. break;
  4678. }
  4679. }
  4680. $($("#diagnoseTags").children("span")[childrenIndex]).remove();
  4681. if (childrenIndex == 0) {
  4682. $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
  4683. }
  4684. var diagnoseValue = $("#diagnoseValue").val();
  4685. $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
  4686. $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
  4687. }
  4688. /**
  4689. * 点击通用参数属性值时设置值到对应的区域
  4690. * @param value
  4691. * @param id
  4692. */
  4693. function fitValue(value, id) {
  4694. //当选择的是血压时
  4695. if (id == "pressure_") {
  4696. var arr = value.split("/");
  4697. $("#pressure_high").val(arr[0]);
  4698. $("#pressure_floor").val(arr[1]);
  4699. if ($("#pressureLeftFlag").hasClass("in")) {
  4700. $("#pressure_high_left").val(arr[0]);
  4701. $("#pressure_floor_left").val(arr[1]);
  4702. }
  4703. //当选的是体重,体温,脉搏和呼吸时
  4704. } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
  4705. $("#" + id).val(value);
  4706. } else {
  4707. //主诉拼写时
  4708. var valueExist = $("#" + id).val();
  4709. if (valueExist != null && valueExist != "") {
  4710. value = valueExist + value;
  4711. }
  4712. $("#" + id).val(value);
  4713. }
  4714. }
  4715. /**
  4716. * 加载药品列表数列表
  4717. * @param index
  4718. */
  4719. function loadYpList(index, event) {
  4720. if (event != null) {
  4721. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  4722. //上下键不刷新表格
  4723. return;
  4724. }
  4725. }
  4726. var medicinePopoverContent = null;
  4727. var tableMedicine = null;
  4728. var MedicineName = null;
  4729. //var groupNo=null;
  4730. if (index == 0) {
  4731. medicinePopoverContent = "westernMedicinePopoverContent";
  4732. tableMedicine = "tb_table_western_medicine";
  4733. MedicineName = "western_medicine_name";
  4734. // groupNo=71;
  4735. }
  4736. if (index == 1) {
  4737. medicinePopoverContent = "chineseMedicinePopoverContent";
  4738. tableMedicine = "tb_table_chinese_medicine";
  4739. MedicineName = "chinese_medicine_name";
  4740. // groupNo=$("#zyClassType").val();
  4741. }
  4742. // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
  4743. // return;
  4744. // }
  4745. $('#' + tableMedicine).bootstrapTable('refresh');
  4746. $('#' + tableMedicine).bootstrapTable({
  4747. url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
  4748. method: 'GET', //请求方式(*)
  4749. toolbar: '#toolbar', //工具按钮用哪个容器
  4750. striped: true, //是否显示行间隔色
  4751. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  4752. pagination: false, //是否显示分页(*)
  4753. sortable: true, //是否启用排序
  4754. sortOrder: "asc", //排序方式
  4755. queryParams: function (params) {
  4756. var groupNo = null;
  4757. if (index == 0) {
  4758. groupNo = 71;
  4759. }
  4760. if (index == 1) {
  4761. groupNo = $("#zyClassType").val();
  4762. }
  4763. var temp = {
  4764. groupNo: groupNo,
  4765. commonParams: $("#" + MedicineName).val()
  4766. };
  4767. return temp;
  4768. }, //传递参数(*)
  4769. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  4770. pageNumber: 1, //初始化加载第一页,默认第一页
  4771. pageSize: 5, //每页的记录行数(*)
  4772. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  4773. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  4774. strictSearch: true,
  4775. showColumns: false, //是否显示所有的列
  4776. showRefresh: false, //是否显示刷新按钮
  4777. minimumCountColumns: 2, //最少允许的列数
  4778. clickToSelect: true, //是否启用点击选中行
  4779. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  4780. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  4781. cardView: false, //是否显示详细视图
  4782. detailView: false,
  4783. //rowStyle:rowStyle,//通过自定义函数设置行样式
  4784. ajaxOptions: {
  4785. headers: {
  4786. 'Accept': 'application/json',
  4787. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  4788. }
  4789. },
  4790. columns: [
  4791. {
  4792. field: 'code',
  4793. title: '编码',
  4794. align: "center",
  4795. valign: 'middle',
  4796. // sortable: true
  4797. }, {
  4798. field: 'name',
  4799. title: '药品名称',
  4800. align: "center",
  4801. valign: 'middle',
  4802. // sortable: true
  4803. }
  4804. , {
  4805. field: 'specification',
  4806. title: '规格',
  4807. align: "center",
  4808. valign: 'middle',
  4809. // sortable: true
  4810. }, {
  4811. field: 'manufactory',
  4812. title: '生产厂家',
  4813. align: "center",
  4814. valign: 'middle',
  4815. // sortable: true
  4816. }, {
  4817. field: 'miniUnitName',
  4818. title: '单位',
  4819. align: "center",
  4820. valign: 'middle',
  4821. // sortable: true
  4822. }, {
  4823. field: 'chargeAmount',
  4824. title: '零售价',
  4825. align: "center",
  4826. valign: 'middle',
  4827. // sortable: true
  4828. formatter: function (value, row, index) {
  4829. if (value == null) {
  4830. return '0.0元';
  4831. }
  4832. return value.toFixed(2) + "元";
  4833. }
  4834. }, {
  4835. field: 'drugWinDesc',
  4836. title: '剂量',
  4837. align: "center",
  4838. valign: 'middle',
  4839. // sortable: true
  4840. }, {
  4841. field: 'stockAmountVirtual',
  4842. title: '库存数量',
  4843. align: "center",
  4844. valign: 'middle',
  4845. // sortable: true
  4846. }
  4847. ],
  4848. responseHandler: function (res) {
  4849. if (res == '401' || res == 401) {
  4850. window.location.href = '/thmz/login/view'
  4851. return;
  4852. }
  4853. var ress = eval(res);
  4854. if (ress.code == -1) {
  4855. errorMesage(res);
  4856. return {
  4857. "total": 0,//总页数
  4858. "rows": {} //数据
  4859. };
  4860. }
  4861. $("#" + medicinePopoverContent).parent().css("background", "#EBEBE4");
  4862. return {
  4863. "total": ress.data.length,//总页数
  4864. "rows": ress.data //数据
  4865. };
  4866. },
  4867. onClickRow: function (row, $element) {
  4868. $('#' + MedicineName).webuiPopover('hide');
  4869. if (index == 0) {
  4870. checkYpInfo(row.code, row.serial, row.ypType, true);
  4871. }
  4872. if (index == 1) {
  4873. checkZyInfo(row.code, row.serial, true);
  4874. }
  4875. }
  4876. });
  4877. }
  4878. /**
  4879. * 按照药品的编码 和药品拆零规格查询药品信息 西药
  4880. * @param code
  4881. * @param serial
  4882. * @param groupNo
  4883. * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
  4884. */
  4885. function checkYpInfo(code, serial, groupNo, needNotice) {
  4886. //判断是否有重复的项目 返回true 说明有重复的
  4887. if (verifyRepeat(code, serial, null, 0)) {
  4888. return;
  4889. }
  4890. $("#current_groupNo").val(groupNo);
  4891. //不需要每次都关闭这个帮助字典
  4892. //$("#treeButton").webuiPopover('hide');
  4893. $.ajax({
  4894. type: "GET",
  4895. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
  4896. contentType: "application/json;charset=UTF-8",
  4897. dataType: "json",
  4898. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4899. async: needNotice,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  4900. success: function (res) {
  4901. if (res == '401' || res == 401) {
  4902. window.location.href = '/thmz/login/view'
  4903. return;
  4904. }
  4905. if (res.code == 0) {
  4906. if (res.data != null) {
  4907. //如果
  4908. if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
  4909. initNavTabs(0);
  4910. }
  4911. var cfdesc = '普药';
  4912. if (groupNo == '91') {
  4913. cfdesc = '医材';
  4914. } else if (groupNo == '111') {
  4915. cfdesc = '麻、精一';
  4916. } else if (groupNo == '131') {
  4917. cfdesc = '精二';
  4918. }
  4919. // else if(groupNo=='151'){
  4920. // cfdesc='诊疗';
  4921. // }
  4922. //每个处方不能超过5个药品
  4923. var tableId = $("#xyTab li.active").find("a").attr("href");
  4924. var childrens = $(tableId).find("div:eq(0)").children().length;
  4925. var currentGroupNo = $(tableId).find("input.current_groupNo").val();
  4926. if (childrens === 5) {
  4927. if (needNotice) {
  4928. $("#messageModal").modal();
  4929. $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
  4930. $("#messageButton").off("click").on("click", function (t) {
  4931. $("#messageModal").modal("hide");
  4932. refreshNavTabs(0, groupNo);
  4933. fitWesternMedicine(res, groupNo);
  4934. // //选中药品后,光标默认到用法
  4935. // $("#supplyType").next().click();
  4936. });
  4937. $("#cancelButton").off("click");
  4938. } else {
  4939. refreshNavTabs(0, groupNo);
  4940. fitWesternMedicine(res, groupNo);
  4941. }
  4942. } else if (currentGroupNo != null && currentGroupNo != '' && groupNo != currentGroupNo) {
  4943. //当前编辑的处方与选中的品类非同一处方能保存的
  4944. var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
  4945. //是否需要新增处方页,以保存医材处方
  4946. var needAddTable = true;
  4947. for (var i = 0; i < currentGroupNos.length; i++) {
  4948. if ($(currentGroupNos[i]).val() == groupNo) {
  4949. var next = $(currentGroupNos[i]).next();
  4950. if ($(next).children().length < 5) {
  4951. var parentId = $(currentGroupNos[i]).parent().attr("id");
  4952. //切换处方
  4953. $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
  4954. //因为存在没有满5个的处方页,直接保存到该页
  4955. needAddTable = false;
  4956. fitWesternMedicine(res, groupNo);
  4957. }
  4958. }
  4959. }
  4960. if (needAddTable) {
  4961. //91 医材
  4962. var message = "医材需要单独处方,是否需要新增医材处方?";
  4963. if (groupNo == '71') {
  4964. message = "普通西成药需要单独处方,是否需要新增处方?"
  4965. } else if (groupNo == '111') {
  4966. message = "麻、精一药物需要单独处方,是否需要新增处方?"
  4967. } else if (groupNo == '131') {
  4968. message = "精二药物需要单独处方,是否需要新增处方?"
  4969. }
  4970. if (needNotice) {
  4971. $("#messageModal").modal();
  4972. $("#messageContent").html(message);
  4973. $("#messageButton").off("click").on("click", function (t) {
  4974. $("#messageModal").modal("hide");
  4975. refreshNavTabs(0, groupNo);
  4976. fitWesternMedicine(res, groupNo);
  4977. // //选中药品后,光标默认到用法
  4978. // $("#supplyType").next().click();
  4979. });
  4980. $("#cancelButton").off("click");
  4981. } else {
  4982. refreshNavTabs(0, groupNo);
  4983. fitWesternMedicine(res, groupNo);
  4984. }
  4985. }
  4986. //当前编辑的处方非普通西药处方
  4987. } else {
  4988. $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
  4989. fitWesternMedicine(res, groupNo);
  4990. }
  4991. // if (needNotice) {
  4992. // //选中药品后,光标默认到用法
  4993. // $("#supplyType").next().click();
  4994. // // prevEleId = 'supplyType';
  4995. // }
  4996. }
  4997. } else {
  4998. errorMesage(res);
  4999. }
  5000. }
  5001. });
  5002. }
  5003. /**
  5004. * 按照药品的编码 和药品拆零规格查询药品信息 中药
  5005. * @param code
  5006. * @param serial
  5007. * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  5008. */
  5009. function checkZyInfo(code, serial, async) {
  5010. //判断是否有重复的项目 返回true 说明有重复的
  5011. if (verifyRepeat(code, serial, null, 1)) {
  5012. return;
  5013. }
  5014. $.ajax({
  5015. type: "GET",
  5016. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
  5017. contentType: "application/json;charset=UTF-8",
  5018. dataType: "json",
  5019. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  5020. async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  5021. success: function (res) {
  5022. if (res == '401' || res == 401) {
  5023. window.location.href = '/thmz/login/view'
  5024. return;
  5025. }
  5026. if (res.code == 0) {
  5027. if (res.data != null) {
  5028. //如果
  5029. if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
  5030. initNavTabs(1);
  5031. $("input.zyfs").val(1);
  5032. }
  5033. $("#chinese_medicine_name").val(res.data.name);
  5034. $("#chinese_medicine_name").blur();
  5035. //$("#zy_drugWin").val(res.data.weight);
  5036. $("#zy_packRetprice").val(res.data.packRetprice);
  5037. $("#chinese_medicine_current_code").val(res.data.code);
  5038. $("#chinese_medicine_current_serial").val(res.data.serial);
  5039. if (async) {
  5040. //选中药品后,光标默认到数量输入框
  5041. $("#zy_drugWin").focus();
  5042. // prevEleId = 'zy_drugWin';
  5043. }
  5044. }
  5045. } else {
  5046. errorMesage(res);
  5047. }
  5048. }
  5049. });
  5050. }
  5051. /**
  5052. * 加载辅助检查、检验列表
  5053. * @param index
  5054. */
  5055. function loadjcJyItemList(event) {
  5056. if (event != null) {
  5057. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  5058. //上下键不刷新表格
  5059. return;
  5060. }
  5061. }
  5062. // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
  5063. // return;
  5064. // }
  5065. $('#tb_table_jc_jy_item').bootstrapTable('refresh');
  5066. $('#tb_table_jc_jy_item').bootstrapTable({
  5067. url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
  5068. method: 'GET', //请求方式(*)
  5069. toolbar: '#toolbar', //工具按钮用哪个容器
  5070. striped: true, //是否显示行间隔色
  5071. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  5072. pagination: false, //是否显示分页(*)
  5073. sortable: true, //是否启用排序
  5074. sortOrder: "asc", //排序方式
  5075. queryParams: function (params) {
  5076. var temp = {
  5077. commonParams: $("#jcJyItem").val()
  5078. };
  5079. return temp;
  5080. }, //传递参数(*)
  5081. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  5082. pageNumber: 1, //初始化加载第一页,默认第一页
  5083. pageSize: 5, //每页的记录行数(*)
  5084. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  5085. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  5086. strictSearch: true,
  5087. showColumns: false, //是否显示所有的列
  5088. showRefresh: false, //是否显示刷新按钮
  5089. minimumCountColumns: 2, //最少允许的列数
  5090. clickToSelect: true, //是否启用点击选中行
  5091. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  5092. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  5093. cardView: false, //是否显示详细视图
  5094. detailView: false,
  5095. //rowStyle:rowStyle,//通过自定义函数设置行样式
  5096. ajaxOptions: {
  5097. headers: {
  5098. 'Accept': 'application/json',
  5099. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  5100. }
  5101. },
  5102. columns: [
  5103. {
  5104. field: 'code',
  5105. title: '编码',
  5106. align: "center",
  5107. valign: 'middle',
  5108. // sortable: true
  5109. }, {
  5110. field: 'name',
  5111. title: '名称',
  5112. align: "center",
  5113. valign: 'middle',
  5114. // sortable: true
  5115. }
  5116. , {
  5117. field: 'execUnitName',
  5118. title: '执行科室',
  5119. align: "center",
  5120. valign: 'middle',
  5121. // sortable: true
  5122. }, {
  5123. field: 'type',
  5124. title: '项目类型',
  5125. align: "center",
  5126. valign: 'middle',
  5127. // sortable: true
  5128. formatter: function (value, row, index) {
  5129. if (value == 1 || value == "1") {
  5130. return "检验";
  5131. }
  5132. if (value == 2 || value == "2") {
  5133. return "辅助检查";
  5134. }
  5135. if (value == 3 || value == "3") {
  5136. return "诊疗";
  5137. }
  5138. return "";
  5139. }
  5140. },
  5141. ],
  5142. responseHandler: function (res) {
  5143. if (res == '401' || res == 401) {
  5144. window.location.href = '/thmz/login/view'
  5145. return;
  5146. }
  5147. var ress = eval(res);
  5148. if (ress.code == -1) {
  5149. errorMesage(res);
  5150. return {
  5151. "total": 0,//总页数
  5152. "rows": {} //数据
  5153. };
  5154. }
  5155. $("#jcJyItemPopoverContent").parent().css("background", "#EBEBE4");
  5156. return {
  5157. "total": ress.data.length,//总页数
  5158. "rows": ress.data //数据
  5159. };
  5160. },
  5161. onClickRow: function (row, $element) {
  5162. $('#jcJyItem').webuiPopover('hide');
  5163. $("#jcJyZltype").val(row.type);
  5164. $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
  5165. $("#execUnit").selectpicker('refresh');
  5166. if (row.type == 1) {
  5167. //检验
  5168. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  5169. $("#yshPartDiv").removeClass("in").addClass("hide");
  5170. if (row.sampleCode != null && row.sampleCode != "") {
  5171. $("#jyZdSample").selectpicker('val', row.sampleCode);
  5172. $('#jyZdSample').selectpicker('refresh');
  5173. }
  5174. } else if (row.type == 2) {
  5175. //检查
  5176. $("#yshPartDiv").removeClass("hide").addClass("in");
  5177. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  5178. if (row.bwCode != null && row.bwCode != "") {
  5179. $("#yshPart").selectpicker('val', row.bwCode);
  5180. $('#yshPart').selectpicker('refresh');
  5181. }
  5182. }
  5183. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  5184. checkJcJyItemInfo(row.code, row.name, row.type, true);
  5185. }
  5186. });
  5187. }
  5188. /**
  5189. * 加载诊疗列表
  5190. * @param index
  5191. */
  5192. function loadZlItemList(event) {
  5193. if (event != null) {
  5194. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  5195. //上下键不刷新表格
  5196. return;
  5197. }
  5198. }
  5199. $('#tb_table_zl_item').bootstrapTable('refresh');
  5200. $('#tb_table_zl_item').bootstrapTable({
  5201. url: '/thmz/getZlItemByCommonParams', //请求后台的URL(*)
  5202. method: 'GET', //请求方式(*)
  5203. toolbar: '#toolbar', //工具按钮用哪个容器
  5204. striped: true, //是否显示行间隔色
  5205. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  5206. pagination: false, //是否显示分页(*)
  5207. sortable: true, //是否启用排序
  5208. sortOrder: "asc", //排序方式
  5209. queryParams: function (params) {
  5210. var temp = {
  5211. commonParams: $("#zlItem").val()
  5212. };
  5213. return temp;
  5214. }, //传递参数(*)
  5215. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  5216. pageNumber: 1, //初始化加载第一页,默认第一页
  5217. pageSize: 5, //每页的记录行数(*)
  5218. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  5219. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  5220. strictSearch: true,
  5221. showColumns: false, //是否显示所有的列
  5222. showRefresh: false, //是否显示刷新按钮
  5223. minimumCountColumns: 2, //最少允许的列数
  5224. clickToSelect: true, //是否启用点击选中行
  5225. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  5226. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  5227. cardView: false, //是否显示详细视图
  5228. detailView: false,
  5229. //rowStyle:rowStyle,//通过自定义函数设置行样式
  5230. ajaxOptions: {
  5231. headers: {
  5232. 'Accept': 'application/json',
  5233. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  5234. }
  5235. },
  5236. columns: [
  5237. {
  5238. field: 'code',
  5239. title: '编码',
  5240. align: "center",
  5241. valign: 'middle',
  5242. // sortable: true
  5243. }, {
  5244. field: 'name',
  5245. title: '名称',
  5246. align: "center",
  5247. valign: 'middle',
  5248. // sortable: true
  5249. }
  5250. , {
  5251. field: 'execUnitName',
  5252. title: '执行科室',
  5253. align: "center",
  5254. valign: 'middle',
  5255. // sortable: true
  5256. }, {
  5257. field: 'type',
  5258. title: '项目类型',
  5259. align: "center",
  5260. valign: 'middle',
  5261. // sortable: true
  5262. formatter: function (value, row, index) {
  5263. return "诊疗";
  5264. }
  5265. },
  5266. ],
  5267. responseHandler: function (res) {
  5268. if (res == '401' || res == 401) {
  5269. window.location.href = '/thmz/login/view'
  5270. return;
  5271. }
  5272. var ress = eval(res);
  5273. if (ress.code == -1) {
  5274. errorMesage(res);
  5275. return {
  5276. "total": 0,//总页数
  5277. "rows": {} //数据
  5278. };
  5279. }
  5280. $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
  5281. return {
  5282. "total": ress.data.length,//总页数
  5283. "rows": ress.data //数据
  5284. };
  5285. },
  5286. onClickRow: function (row, $element) {
  5287. $('#zlItem').webuiPopover('hide');
  5288. $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
  5289. $("#zlExecUnit").selectpicker('refresh');
  5290. //诊疗
  5291. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  5292. initNavTabs(3);
  5293. }
  5294. $("#zlItem").val(row.name);
  5295. $("#zlItem").blur();
  5296. $("#zlItemPrice").val(row.chargeAmount);
  5297. $("#chargeUnit").val(row.specification);
  5298. $("#zl_current_code").val(row.code);
  5299. $("#itemQuantity").val(1);
  5300. $("#chargeUnit").focus();
  5301. return;
  5302. }
  5303. });
  5304. }
  5305. /**
  5306. * 诊疗与医技选中
  5307. * @param code
  5308. * @param name 回写的时候可以设置null
  5309. * @param type 1 检验 2 检查 3 诊疗
  5310. * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  5311. */
  5312. //function checkJcJyItemInfo(code, name, type) {
  5313. function checkJcJyItemInfo(code, name, type, async) {
  5314. // //判断是否有重复的项目 返回true 说明有重复的
  5315. // if (verifyRepeat(code, null, 2)) {
  5316. // return;
  5317. // }
  5318. //不需要每次都关闭帮助树
  5319. //$("#treeButton").webuiPopover('hide');
  5320. $.ajax({
  5321. type: "GET",
  5322. url: '/thmz/getJcJyItemChargeByCode?code=' + code + '&jcJyZltype=' + type,
  5323. contentType: "application/json;charset=UTF-8",
  5324. dataType: "json",
  5325. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  5326. async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  5327. success: function (res) {
  5328. if (res == '401' || res == 401) {
  5329. window.location.href = '/thmz/login/view'
  5330. return;
  5331. }
  5332. if (res.code == 0) {
  5333. if (res.data != null) {
  5334. //如果
  5335. if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
  5336. initNavTabs(2);
  5337. }
  5338. if (name == null) {
  5339. name = res.name;
  5340. }
  5341. $("#jcJyItem").val(name);
  5342. $("#jcJyItem").blur();
  5343. $("#jcjyItemPrice").val(res.totalAmount);
  5344. $("#jcjy_current_code").val(code);
  5345. $("#execUnit").selectpicker('val', res.execUnit);//默认不选中
  5346. $("#execUnit").selectpicker('refresh');
  5347. // if (async) {
  5348. // if (type == 1) {
  5349. // //选中项目后,光标默认到数量输入框
  5350. // $("#jyZdSample").next().click();
  5351. // // prevEleId = 'jyZdSample';
  5352. // } else if (type == 2) {
  5353. // $("#yshPart").next().click();
  5354. // // prevEleId = 'yshPart';
  5355. // }
  5356. // }
  5357. }
  5358. } else {
  5359. errorMesage(res);
  5360. }
  5361. }
  5362. });
  5363. }
  5364. /**
  5365. * 查询辅助检查、检验项目明细
  5366. * @param code 编码
  5367. * @param jcJyZltype 1 检验 2 检查
  5368. */
  5369. function getJcJyItemChargeByCode(code, jcJyZltype) {
  5370. if (code != null) {
  5371. $("#itemCodeSearch").val(code);
  5372. $("#jcJyZltypeSearch").val(jcJyZltype);
  5373. } else if ($("#jcjy_current_code").val() == null || $("#jcjy_current_code").val() == '') {
  5374. errorMesageSimaple("未选中任何项目!");
  5375. return;
  5376. }
  5377. $("#jcJyItemModal").modal("show");
  5378. $('#jcJyItemTable').bootstrapTable('refresh');
  5379. $('#jcJyItemTable').bootstrapTable({
  5380. url: '/thmz/getJcJyItemChargeByCode', //请求后台的URL(*)
  5381. method: 'GET', //请求方式(*)
  5382. toolbar: '#toolbar', //工具按钮用哪个容器
  5383. striped: true, //是否显示行间隔色
  5384. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  5385. pagination: false, //是否显示分页(*)
  5386. sortable: true, //是否启用排序
  5387. sortOrder: "asc", //排序方式
  5388. queryParams: function (params) {
  5389. var itemCodeSearch = $("#itemCodeSearch").val();
  5390. var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
  5391. if (itemCodeSearch == null || itemCodeSearch == "") {
  5392. itemCodeSearch = $("#jcjy_current_code").val();
  5393. jcJyZltypeSearch = $("#jcJyZltype").val();
  5394. }
  5395. var temp = {
  5396. code: itemCodeSearch,
  5397. jcJyZltype: jcJyZltypeSearch
  5398. };
  5399. return temp;
  5400. }, //传递参数(*)
  5401. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  5402. pageNumber: 1, //初始化加载第一页,默认第一页
  5403. pageSize: 5, //每页的记录行数(*)
  5404. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  5405. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  5406. strictSearch: true,
  5407. showColumns: false, //是否显示所有的列
  5408. showRefresh: false, //是否显示刷新按钮
  5409. minimumCountColumns: 2, //最少允许的列数
  5410. clickToSelect: true, //是否启用点击选中行
  5411. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  5412. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  5413. cardView: false, //是否显示详细视图
  5414. detailView: false,
  5415. //rowStyle:rowStyle,//通过自定义函数设置行样式
  5416. ajaxOptions: {
  5417. headers: {
  5418. 'Accept': 'application/json',
  5419. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  5420. }
  5421. },
  5422. columns: [
  5423. {
  5424. field: 'tcCode',
  5425. title: '项目编码',
  5426. align: "center",
  5427. valign: 'middle',
  5428. // sortable: true
  5429. }, {
  5430. field: 'code',
  5431. title: '收费编码',
  5432. align: "center",
  5433. valign: 'middle',
  5434. // sortable: true
  5435. }
  5436. , {
  5437. field: 'name',
  5438. title: '收费名称',
  5439. align: "center",
  5440. valign: 'middle',
  5441. // sortable: true
  5442. }, {
  5443. field: 'num',
  5444. title: '数量',
  5445. align: "center",
  5446. valign: 'middle',
  5447. // sortable: true
  5448. }, {
  5449. field: 'chargeAmount',
  5450. title: '单价',
  5451. align: "center",
  5452. valign: 'middle',
  5453. // sortable: true
  5454. formatter: function (value, row, index) {
  5455. if (value == null || value == "") {
  5456. return 0;
  5457. }
  5458. return value.toFixed(2);
  5459. }
  5460. }, {
  5461. field: 'totalAmount',
  5462. title: '总金额',
  5463. align: "center",
  5464. valign: 'middle',
  5465. // sortable: true
  5466. formatter: function (value, row, index) {
  5467. if (value == null || value == "") {
  5468. return 0;
  5469. }
  5470. return value.toFixed(2);
  5471. }
  5472. }
  5473. ],
  5474. responseHandler: function (res) {
  5475. if (res == '401' || res == 401) {
  5476. window.location.href = '/thmz/login/view'
  5477. return;
  5478. }
  5479. $("#itemCodeSearch").val(null);
  5480. var ress = eval(res);
  5481. if (ress.code == -1) {
  5482. errorMesage(res);
  5483. return {
  5484. "total": 0,//总页数
  5485. "rows": {} //数据
  5486. };
  5487. }
  5488. return {
  5489. "total": ress.data.length,//总页数
  5490. "rows": ress.data //数据
  5491. };
  5492. }
  5493. });
  5494. }
  5495. /**
  5496. * 判断是否有重复的项目 返回true 说明有重复的
  5497. * @param code 编码
  5498. * @param serial 药品规格 null 时是非药品
  5499. * @param chargeUnitCode 检查部位或者检验物 null 时是 诊疗
  5500. * @param index
  5501. */
  5502. function verifyRepeat(code, serial, chargeUnitCode, index) {
  5503. //是新增药品还是编辑 true 修改 默认false
  5504. var updateFlag = null;
  5505. if(index==0){
  5506. updateFlag= $("#western_medicine_update_flag").val();
  5507. }else if(index==1){
  5508. updateFlag= $("#chinese_medicine_update_flag").val();
  5509. }else if(index==2){
  5510. updateFlag= $("#jcjy_update_flag").val();
  5511. }else if(index==3){
  5512. updateFlag= $("#zl_update_flag").val();
  5513. }
  5514. if (updateFlag == undefined || updateFlag == null) {
  5515. updateFlag = false;
  5516. }
  5517. if (updateFlag == "true" || updateFlag == true) {
  5518. return false;
  5519. }
  5520. var tabId = null;
  5521. //西药
  5522. if (index == 0) {
  5523. tabId = "xyTab";
  5524. } else if (index == 1) {
  5525. //中成药
  5526. tabId = "zyTab";
  5527. } else if (index == 2) {
  5528. //辅助检查、检验
  5529. tabId = "jcjyTab";
  5530. } else if (index == 3) {
  5531. //诊疗
  5532. tabId = "zlTab";
  5533. } else if (index == 4) {
  5534. //入院
  5535. tabId = "zyReqTab";
  5536. }
  5537. var tableId = $("#" + tabId + " li.active").find("a").attr("href");
  5538. var items = $(tableId).find("div:eq(0)").find("div.form-group");
  5539. var groupId = null;
  5540. if (index == 0) {
  5541. groupId = $("#groupId").val();
  5542. }
  5543. if (items != null && items.length > 0) {
  5544. for (var i = 0; i < items.length; i++) {
  5545. if (serial == null) {
  5546. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  5547. var temporary_items_desc_value = $(items[i]).find("input.temporary_items_desc_value").val();
  5548. if(chargeUnitCode==null && code === temporary_items_code){
  5549. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  5550. return true;
  5551. }
  5552. if (code === temporary_items_code && chargeUnitCode === temporary_items_desc_value) {
  5553. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  5554. return true;
  5555. }
  5556. } else {
  5557. if (index == 0) {
  5558. //西药需要判断组号,因为可能会有不同组的皮试用药,需要相同的药品
  5559. var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
  5560. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  5561. var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
  5562. if (code === temporary_items_code && serial === temporary_items_serial && groupId === temporary_items_groupId) {
  5563. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  5564. return true;
  5565. }
  5566. } else {
  5567. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  5568. var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
  5569. if (code === temporary_items_code && serial === temporary_items_serial) {
  5570. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  5571. return true;
  5572. }
  5573. }
  5574. }
  5575. }
  5576. }
  5577. return false;
  5578. }
  5579. /**
  5580. * 初始化处方分页
  5581. * @param index 0 西药 1 中药 2 诊疗 3 入院
  5582. */
  5583. function initNavTabs(index) {
  5584. var tabId = null;
  5585. var tabContentId = null;
  5586. var paneId = null;
  5587. var cfdesc = '普药';
  5588. //西药
  5589. if (index == 0) {
  5590. tabId = "xyTab";
  5591. tabContentId = "xyTabContent";
  5592. paneId = "xycf_" + getUID();
  5593. } else if (index == 1) {
  5594. //中草药
  5595. tabId = "zyTab";
  5596. tabContentId = "zyTabContent";
  5597. paneId = "zycf_" + getUID();
  5598. cfdesc = '中草药';
  5599. } else if (index == 2) {
  5600. //医技
  5601. tabId = "jcjyTab";
  5602. tabContentId = "jcjyTabContent";
  5603. paneId = "jcjycf_" + getUID();
  5604. cfdesc = '辅助检查、检验';
  5605. } else if (index == 3) {
  5606. //诊疗
  5607. tabId = "zlTab";
  5608. tabContentId = "zlTabContent";
  5609. paneId = "zlcf_" + getUID();
  5610. cfdesc = '诊疗';
  5611. } else if (index == 4) {
  5612. //住院
  5613. tabId = "zyReqTab";
  5614. tabContentId = "zyReqTabContent";
  5615. paneId = "zyReqcf_" + getUID();
  5616. cfdesc = '入院';
  5617. }
  5618. $("#" + tabId).html('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>');
  5619. var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
  5620. html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
  5621. html += '<input class="current_groupNo" type="hidden"/>';
  5622. html += ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
  5623. ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
  5624. html += '<div style="width: 460px;">'
  5625. if (index == 1) {
  5626. html += ' <div style="width: 130px;float: left;">' +
  5627. ' <label class="my_label_2">付数:</label>' +
  5628. ' <input type="text" class="form-control my_label_input_2 zyfs" id="zyfs"' +
  5629. ' placeholder="请输入" style="padding-left: 10px;" onchange="calculateZyAmount()">' +
  5630. ' </div>';
  5631. html += '<div style="width: 130px;float: left;">' +
  5632. ' <label class="my_label_2">频次:</label>' +
  5633. ' <div style="width: 85px;float: right;">' +
  5634. ' <select class="form-control selectpicker show-tick zy_orderFrequency"' +
  5635. ' title="请选择" data-live-search="true" onchange="calculate()" id="zy_orderFrequency_1">' +
  5636. ' </select>' +
  5637. ' </div>' +
  5638. ' </div>';
  5639. html += '<div style="width: 180px;float: left;">' +
  5640. ' <label class="my_label_2">用法:</label>' +
  5641. ' <div style="width: 135px;float: left;">' +
  5642. ' <select class="form-control selectpicker show-tick useType"' +
  5643. ' title="请选择" id="useType_1">' +
  5644. ' </select>' +
  5645. ' </div>' +
  5646. ' </div>';
  5647. html += '</div><div style="width: 460px;">'
  5648. html += '<input id="singleAmount" type="hidden"/>';
  5649. }
  5650. html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
  5651. //html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;"></div>';
  5652. if (index == 1) {
  5653. html += '<div style="width: 130px;float: left;">' +
  5654. ' <label class="my_label_2">液型:</label>' +
  5655. ' <div style="width: 85px;float: right;">' +
  5656. ' <select class="form-control selectpicker show-tick water" id="cyJssm">' +
  5657. ' </select>' +
  5658. ' </div>' +
  5659. ' </div>';
  5660. html += ' <div style="width: 180px;float: left;">' +
  5661. ' <label class="my_label_2">煎法:</label>' +
  5662. ' <div style="width: 135px;float: left;">' +
  5663. ' <select class="form-control selectpicker show-tick zy_supplyType"' +
  5664. ' title="请选择" id="zy_supplyType_1" onchange="calculateTotalAmount()">' +
  5665. ' </select>' +
  5666. ' </div>' +
  5667. ' </div>';
  5668. }
  5669. if (index == 0) {
  5670. html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
  5671. }
  5672. // else if (index == 1) {
  5673. // html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品代煎所产生的费用!</div>';
  5674. // }
  5675. html += '</div></div></div>';
  5676. $("#" + tabContentId).html(html);
  5677. if (index == 1) {
  5678. 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>';
  5679. $('.useType').html(useType);
  5680. $('.useType').selectpicker('refresh');
  5681. var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
  5682. $('.water').html(water);
  5683. $('.water').selectpicker('refresh');
  5684. initOrderFrequencys("zy_orderFrequency_1", false);
  5685. initZySupplyTypes("zy_supplyType_1", false);
  5686. }
  5687. }
  5688. /**
  5689. * 清空处方分页
  5690. * @param index 0 西药 1 中药 2 诊疗 3 入院
  5691. */
  5692. function clearNavTabs(index) {
  5693. var tabId = null;
  5694. var tabContentId = null;
  5695. //西药
  5696. if (index == 0) {
  5697. tabId = "xyTab";
  5698. tabContentId = "xyTabContent";
  5699. } else if (index == 1) {
  5700. //中草药
  5701. tabId = "zyTab";
  5702. tabContentId = "zyTabContent";
  5703. } else if (index == 2) {
  5704. //辅助检查、检验
  5705. tabId = "jcjyTab";
  5706. tabContentId = "jcjyTabContent";
  5707. }else if (index == 3) {
  5708. //医技
  5709. tabId = "zlTab";
  5710. tabContentId = "zlTabContent";
  5711. } else if (index == 4) {
  5712. //医技
  5713. tabId = "zyReqTab";
  5714. tabContentId = "zyReqTabContent";
  5715. }
  5716. $("#" + tabId).html(null);
  5717. $("#" + tabContentId).html(null);
  5718. }
  5719. /**
  5720. * 添加处方分页
  5721. * @param index 0 西药 1 中药 2 诊疗 3 入院
  5722. * @param groupNo 71 普通西药 91 医材 111 麻、精一 131 精二 151 诊疗
  5723. */
  5724. function refreshNavTabs(index, groupNo) {
  5725. var tabId = null;
  5726. var tabContentId = null;
  5727. var paneIdPrfix = null;
  5728. var cfdesc = '普药';
  5729. //西药
  5730. if (index == 0) {
  5731. tabId = "xyTab";
  5732. tabContentId = "xyTabContent";
  5733. paneIdPrfix = "xycf_";
  5734. if (groupNo == '91') {
  5735. cfdesc = '医材';
  5736. } else if (groupNo == '111') {
  5737. cfdesc = '麻、精一';
  5738. } else if (groupNo == '131') {
  5739. cfdesc = '精二';
  5740. }
  5741. // else if(groupNo=='151'){
  5742. // cfdesc='诊疗';
  5743. // }
  5744. } else if (index == 1) {
  5745. //中草药
  5746. tabId = "zyTab";
  5747. tabContentId = "zyTabContent";
  5748. paneIdPrfix = "zycf_";
  5749. cfdesc = '中草药';
  5750. } else if (index == 2) {
  5751. //辅助检查、检验
  5752. tabId = "jcjyTab";
  5753. tabContentId = "jcjyTabContent";
  5754. paneIdPrfix = "jcjycf_";
  5755. cfdesc = '辅助检查、检验';
  5756. }else if (index == 3) {
  5757. //诊疗
  5758. tabId = "zlTab";
  5759. tabContentId = "zlTabContent";
  5760. paneIdPrfix = "zlcf_";
  5761. cfdesc = '诊疗';
  5762. } else if (index == 4) {
  5763. //入院
  5764. tabId = "zyReqTab";
  5765. tabContentId = "zyReqTabContent";
  5766. paneIdPrfix = "zyReqcf_";
  5767. cfdesc = '入院';
  5768. }
  5769. // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
  5770. // var length = $(tableId).find("div:eq(0)").children().length;
  5771. // if(length==0){
  5772. // //当前处方是空白的,不需要新增处方
  5773. // return;
  5774. // }
  5775. var cfTitle = "处方" + " <small class=\"cfdesc\">(" + cfdesc + ")</small>";
  5776. var paneId = paneIdPrfix + getUID();
  5777. //清除选中的样式
  5778. $("#" + tabId).find("li.active").removeClass("active");
  5779. $("#" + tabId).append('<li><a href="#' + paneId + '" role="tab" data-toggle="tab">' + cfTitle + '</a></li>');
  5780. var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
  5781. '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
  5782. '<input class="current_groupNo" type="hidden"/>' +
  5783. ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
  5784. ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">' +
  5785. '<div style="width: 460px;">' +
  5786. '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
  5787. if (index == 0) {
  5788. html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
  5789. }
  5790. html += '</div></div>';
  5791. $("#" + tabContentId).append(html);
  5792. //切换处方
  5793. $("#" + tabId).find("a[href='#" + paneId + "']").off("click").tab('show');
  5794. }
  5795. /**
  5796. * 填充西药选中的内容
  5797. * @param res
  5798. * @param groupNo
  5799. */
  5800. function fitWesternMedicine(res, groupNo) {
  5801. $("#western_medicine_name").val(res.data.name);
  5802. $("#western_medicine_name").blur();
  5803. var drugWinHtml = '';
  5804. var index = null;
  5805. if (res.data.weight != null) {
  5806. $("#drugWin").val(res.data.weight);
  5807. $("#drugWinDb").val(res.data.weight);
  5808. drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
  5809. index = res.data.weighUnit;
  5810. }
  5811. if (res.data.volum != null) {
  5812. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  5813. $("#drugWin").val(res.data.volum);
  5814. $("#drugWinDb").val(res.data.volum);
  5815. }
  5816. drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
  5817. if (index == null) {
  5818. index = res.data.volUnit;
  5819. }
  5820. }
  5821. if (res.data.miniUnit != null && res.data.miniUnit != "") {
  5822. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  5823. $("#drugWin").val(1);
  5824. $("#drugWinDb").val(1);
  5825. }
  5826. drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
  5827. if (index == null) {
  5828. index = res.data.miniUnit;
  5829. }
  5830. }
  5831. $('#drugWinUnit').html(drugWinHtml);
  5832. $('#drugWinUnit').selectpicker('refresh');
  5833. $("#drugWinUnit").selectpicker('val', index);
  5834. $('#drugWinUnit').selectpicker('refresh');
  5835. if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
  5836. var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
  5837. $('#packUnit').html(html);
  5838. $('#packUnit').selectpicker('refresh');
  5839. $("#packUnit").selectpicker('val', res.data.packUnitDesc);
  5840. $('#packUnit').selectpicker('refresh');
  5841. }
  5842. $("#packRetprice").val(res.data.packRetprice);
  5843. $("#packSize").val(res.data.packSize);
  5844. $("#western_medicine_current_code").val(res.data.code);
  5845. $("#western_medicine_current_serial").val(res.data.serial);
  5846. if ($("#dayNum").val() == null) {
  5847. //天数 同组药品天数相同
  5848. $("#dayNum").selectpicker('val', 1);
  5849. $('#dayNum').selectpicker('refresh');
  5850. }
  5851. if ($("#supplyType").val() == null && res.data.supplyType != null) {
  5852. // 给药方式 同组药品给药方式相同
  5853. $("#supplyType").selectpicker('val', res.data.supplyType);
  5854. $('#supplyType').selectpicker('refresh');
  5855. }
  5856. if ($("#orderFrequency").val() == null && res.data.frequency != null) {
  5857. //频次编码 同组药品频次编码相同
  5858. $("#orderFrequency").selectpicker('val', res.data.frequency);
  5859. $('#orderFrequency').selectpicker('refresh');
  5860. }
  5861. if ($("#orderFrequency").val() == null) {
  5862. //频次编码 防止频次为空
  5863. $("#orderFrequency").selectpicker('val', "ONCE");
  5864. $('#orderFrequency').selectpicker('refresh');
  5865. }
  5866. if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
  5867. $("#tryFlag").parent().addClass("checked");
  5868. $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
  5869. } else {
  5870. $("#tryFlag").parent().removeClass("checked");
  5871. $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
  5872. }
  5873. $("#manufactoryName").val(res.data.manufactoryName);
  5874. $("#specification").val(res.data.specification);
  5875. // if (groupNo == "91") {
  5876. // //医材
  5877. // $("#gross").removeAttr("readonly")
  5878. // } else {
  5879. // $("#gross").attr("readonly", "readonly");
  5880. // }
  5881. calculate();
  5882. $("#western_medicine_name").focus();
  5883. }
  5884. /**
  5885. * 剂量单位改变事件
  5886. */
  5887. function drugWinUnitChange() {
  5888. var desc = $('#drugWinUnit').find("option:selected").attr('desc');
  5889. $("#drugWin").val(desc);
  5890. $("#drugWinDb").val(desc);
  5891. calculate();
  5892. }
  5893. /**
  5894. * 根据选择的内容计算总的用药量
  5895. */
  5896. function calculate() {
  5897. //最小规格剂量
  5898. var drugWinDb = $("#drugWinDb").val();
  5899. //天数
  5900. var dayNum = $("#dayNum").val();
  5901. //当前使用的最小剂量
  5902. var drugWin = $("#drugWin").val();
  5903. //频率
  5904. var times = $('#orderFrequency').find("option:selected").attr('desc');
  5905. //包装规格数量
  5906. var packSize = $("#packSize").val();
  5907. //单价
  5908. var packRetprice = $("#packRetprice").val();
  5909. //当前药房编码
  5910. var currentGroupNo = $("#current_groupNo").val();
  5911. if (drugWinDb == null || drugWinDb === "") {
  5912. if (currentGroupNo == '71') {
  5913. return;
  5914. }
  5915. drugWinDb = 1;
  5916. }
  5917. if (dayNum == null || dayNum === "") {
  5918. if (currentGroupNo == '71') {
  5919. return;
  5920. }
  5921. dayNum = 1;
  5922. }
  5923. if (drugWin == null || drugWin === "") {
  5924. if (currentGroupNo == '71') {
  5925. return;
  5926. }
  5927. drugWin = 1;
  5928. }
  5929. if (times == null || times === "") {
  5930. if (currentGroupNo == '71') {
  5931. return;
  5932. }
  5933. times = 1;
  5934. }
  5935. if (packSize == null || packSize === "") {
  5936. return;
  5937. }
  5938. //拆零总量
  5939. var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
  5940. //整包装的数量
  5941. var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
  5942. $("#gross").val(totalNum);
  5943. $("#totalRetprice").val(Multiply(totalNum, packRetprice).toFixed(2));
  5944. }
  5945. /**
  5946. * 根据选择的总量计算金额 只有医材的时候需要计算
  5947. */
  5948. function calculateSimple() {
  5949. //总量
  5950. var gross = $("#gross").val();
  5951. //单价
  5952. var packRetprice = $("#packRetprice").val();
  5953. $("#totalRetprice").val(Multiply(gross, packRetprice).toFixed(2));
  5954. //当前药房编码
  5955. var currentGroupNo = $("#current_groupNo").val();
  5956. if (currentGroupNo == '91') {
  5957. //医材默认天数为1
  5958. $("#dayNum").selectpicker('val', 1);
  5959. $('#dayNum').selectpicker('refresh');
  5960. $("#orderFrequency").selectpicker('val', "ONCE");
  5961. $('#orderFrequency').selectpicker('refresh');
  5962. }
  5963. }
  5964. /**
  5965. * 根据中药付数计算金额
  5966. */
  5967. function calculateZyAmount() {
  5968. var singleAmount = $("#singleAmount").val();
  5969. var tableId = $("#zyTab li.active").find("a").attr("href");
  5970. //获取中药付数
  5971. var zyfs = $(tableId).find("input.zyfs").val();
  5972. var cfAmount = Multiply(zyfs, singleAmount);
  5973. $(tableId).find("span.cf_amount").html(cfAmount);
  5974. calculateTotalAmount();
  5975. }
  5976. /**
  5977. * 将病人信息填入患者信息修改form
  5978. * @param patinet
  5979. */
  5980. function fillPlusPatinet(patinet) {
  5981. if (patinet != null) {
  5982. $("#editUserCode").val(patinet.patientId);
  5983. $("#editUserName").val(patinet.name);
  5984. $("#editUserName").blur();
  5985. $("#editUserAge").val(patinet.age);
  5986. $("#editUserAge").blur();
  5987. $("#editUserGender").selectpicker('val', patinet.sex);
  5988. $("#editUserGender").selectpicker('refresh');
  5989. $("#editUserGender").blur();
  5990. $("#editUserBirthDay").val(patinet.birthDayStr);
  5991. $("#editUserBirthDay").blur();
  5992. $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
  5993. $('#editUserCertificateType').selectpicker('refresh');
  5994. $("#editUserCardNo").val(patinet.icCardNo);
  5995. $("#editUserCardNo").attr("title", patinet.icCardNo);
  5996. $("#editUserCardNo").blur();
  5997. $("#editUserPhoneNum").val(patinet.phoneNo);
  5998. $("#editUserPhoneNum").attr("title", patinet.phoneNo);
  5999. $("#editUserPhoneNum").blur();
  6000. $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
  6001. $('#editUserPatientsNature').selectpicker('refresh');
  6002. $("#editUserPatientsNature").blur();
  6003. $("#editUserIdCard").val(patinet.socialNo);
  6004. $("#editUserIdCard").attr("title", patinet.socialNo);
  6005. $("#editUserIdCard").blur();
  6006. $("#editUserAddress").val(patinet.address);
  6007. $("#editUserAddress").blur();
  6008. $("#editUserContact").val(patinet.relName);
  6009. $("#editUserContactPhone").val(patinet.contractName);
  6010. }
  6011. }
  6012. /**
  6013. * 修改病人信息
  6014. */
  6015. function modifyPatient() {
  6016. $.ajax({
  6017. type: "POST",
  6018. url: '/thmz/modifyPatient',
  6019. contentType: "application/json;charset=UTF-8",
  6020. dataType: "json",
  6021. data: JSON.stringify({
  6022. "name": $("#editUserName").val(),
  6023. "age": $("#editUserAge").val(),
  6024. "sex": $("#editUserGender").val(),
  6025. "birthDay": $("#editUserBirthDay").val(),
  6026. "certificateType": $("#editUserCertificateType").val(),
  6027. "icCardNo": $("#editUserCardNo").val(),
  6028. "phoneNo": $("#editUserPhoneNum").val(),
  6029. "responseType": $("#editUserPatientsNature").val(),
  6030. "socialNo": $("#editUserIdCard").val(),
  6031. "address": $("#editUserAddress").val(),
  6032. "patientId": $("#editUserCode").val(),
  6033. "relName": $("#editUserContact").val(),
  6034. "contractName": $("#editUserContactPhone").val()
  6035. }),
  6036. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6037. success: function (res) {
  6038. if (res == '401' || res == 401) {
  6039. window.location.href = '/thmz/login/view'
  6040. return;
  6041. }
  6042. if (res.code == 0) {
  6043. $('#editUserModal').modal('hide');
  6044. realClinicalReception($("#patientId").text(), $("#mzfzSerialNoInClick").val());
  6045. clearPlusPatinet();
  6046. } else {
  6047. errorMesage(res);
  6048. }
  6049. }
  6050. });
  6051. }
  6052. /**
  6053. * 将病人信息修改域置空
  6054. * @param patinet
  6055. */
  6056. function clearPlusPatinet() {
  6057. $("#editUserCode").val(null);
  6058. $("#editUserName").val(null);
  6059. $("#editUserAge").val(null);
  6060. $("#editUserGender").selectpicker('val', '1');
  6061. $("#editUserGender").selectpicker('refresh');
  6062. $("#editUserBirthDay").val(null);
  6063. $('#editUserCertificateType').selectpicker('val', '01');
  6064. $('#editUserCertificateType').selectpicker('refresh');
  6065. $("#editUserCardNo").val(null);
  6066. $("#editUserCardNo").attr("title", null);
  6067. $("#editUserPhoneNum").val(null);
  6068. $("#editUserPhoneNum").attr("title", null);
  6069. $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
  6070. $('#editUserPatientsNature').selectpicker('refresh');
  6071. $("#editUserIdCard").val(null);
  6072. $("#editUserIdCard").attr("title", null);
  6073. $("#editUserAddress").val(null);
  6074. $("#editUserContact").val(null);
  6075. $("#editUserContactPhone").val(null);
  6076. }
  6077. // /**
  6078. // * 保存入院证
  6079. // */
  6080. // function saveBeHospitalized() {
  6081. // $.ajax({
  6082. // type: "POST",
  6083. // url: '/thmz/saveMzZyReq',
  6084. // contentType: "application/json;charset=UTF-8",
  6085. // dataType: "json",
  6086. // data: JSON.stringify({
  6087. // "patientId": $("#patientId").text(),
  6088. // "icdCode": $("#icdCodeBeHospitalized").val(),
  6089. // "icdText": $("#icdTextBeHospitalized").val(),
  6090. // "reqDept": $("#inpatientWardBeHospitalized").val(),
  6091. // "smallDept": $("#smallWardBeHospitalized").val(),
  6092. // "admissStatus": $("#admissStatus").val()
  6093. // }),
  6094. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6095. // success: function (res) {
  6096. // if (res == '401' || res == 401) {
  6097. // window.location.href = '/thmz/login/view'
  6098. // return;
  6099. // }
  6100. // if (res.code == 0) {
  6101. // successMesage(res);
  6102. // $('#beHospitalizedModal').modal('hide');
  6103. // loadInClinicTableList();
  6104. // loadClinicTableList();
  6105. // clearWorkSpace();
  6106. // } else {
  6107. // errorMesage(res);
  6108. // }
  6109. // }
  6110. // });
  6111. // }
  6112. /**
  6113. * 获取按钮组选择的下标
  6114. * @param id
  6115. * @returns {number}
  6116. */
  6117. function getIndex(id) {
  6118. var index = 0;
  6119. var item = $("#" + id).find("button");
  6120. for (var i = 0; i <= item.length; i++) {
  6121. if ($(item[i]).hasClass("btn-primary")) {
  6122. index = i;
  6123. break;
  6124. }
  6125. }
  6126. return index;
  6127. }
  6128. /**
  6129. * 获取时间选择器的时间数组
  6130. * @returns {string[]}
  6131. */
  6132. function getRePortRangeArr() {
  6133. var rePortRange = $('#reportrange span').html();
  6134. var rePortRangeArr = rePortRange.split(" - ");
  6135. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  6136. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  6137. return rePortRangeArr;
  6138. }
  6139. /**
  6140. * 初始医生工作太配置
  6141. */
  6142. function initWorkspaceConfigForCurrent() {
  6143. $.ajax({
  6144. type: "GET",
  6145. url: '/thmz/getWorkspaceConfigForCurrent',
  6146. dataType: "json",
  6147. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6148. success: function (res) {
  6149. if (res == '401' || res == 401) {
  6150. window.location.href = '/thmz/login/view'
  6151. return;
  6152. }
  6153. if (res.code == 0) {
  6154. if (res.data.symptomFlag == 1) {
  6155. $("#symptomFlag").removeClass("in").addClass("hide");
  6156. if ($("#symptomFlagCheck").parent().hasClass("checked")) {
  6157. $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
  6158. }
  6159. } else if (res.data.symptomFlag == 0) {
  6160. $("#symptomFlag").removeClass("hide").addClass("in");
  6161. if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
  6162. $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
  6163. }
  6164. }
  6165. if (res.data.emrHpiFlag == 1) {
  6166. $("#emrHpiFlag").removeClass("in").addClass("hide");
  6167. if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
  6168. $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
  6169. }
  6170. } else if (res.data.emrHpiFlag == 0) {
  6171. $("#emrHpiFlag").removeClass("hide").addClass("in");
  6172. if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
  6173. $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
  6174. }
  6175. }
  6176. if (res.data.emrPsFlag == 1) {
  6177. $("#emrPsFlag").removeClass("in").addClass("hide");
  6178. if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
  6179. $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
  6180. }
  6181. } else if (res.data.emrPsFlag == 0) {
  6182. $("#emrPsFlag").removeClass("hide").addClass("in");
  6183. if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
  6184. $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
  6185. }
  6186. }
  6187. if (res.data.personalHistoryFlag == 1) {
  6188. $("#personalHistoryFlag").removeClass("in").addClass("hide");
  6189. if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
  6190. $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  6191. }
  6192. } else if (res.data.personalHistoryFlag == 0) {
  6193. $("#personalHistoryFlag").removeClass("hide").addClass("in");
  6194. if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
  6195. $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  6196. }
  6197. }
  6198. if (res.data.familyHistoryFlag == 1) {
  6199. $("#familyHistoryFlag").removeClass("in").addClass("hide");
  6200. if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
  6201. $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  6202. }
  6203. } else if (res.data.familyHistoryFlag == 0) {
  6204. $("#familyHistoryFlag").removeClass("hide").addClass("in");
  6205. if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
  6206. $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  6207. }
  6208. }
  6209. if (res.data.obstericalHistoryFlag == 1) {
  6210. $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
  6211. if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
  6212. $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  6213. }
  6214. } else if (res.data.obstericalHistoryFlag == 0) {
  6215. $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
  6216. if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
  6217. $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  6218. }
  6219. }
  6220. if (res.data.pressureLeftFlag == 1) {
  6221. $("#pressureLeftFlag").removeClass("in").addClass("hide");
  6222. if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
  6223. $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
  6224. }
  6225. } else if (res.data.pressureLeftFlag == 0) {
  6226. $("#pressureLeftFlag").removeClass("hide").addClass("in");
  6227. if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
  6228. $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
  6229. }
  6230. }
  6231. if (res.data.tentativeDiagnosisFlag == 1) {
  6232. $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
  6233. if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
  6234. $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
  6235. }
  6236. } else if (res.data.tentativeDiagnosisFlag == 0) {
  6237. $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
  6238. if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
  6239. $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
  6240. }
  6241. }
  6242. } else {
  6243. errorMesage(res);
  6244. }
  6245. }
  6246. });
  6247. }
  6248. /**
  6249. * 保存医生工作台配置
  6250. */
  6251. function saveWorkspaceConfig() {
  6252. var symptomFlag = $("#symptomFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6253. var emrHpiFlag = $("#emrHpiFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6254. var emrPsFlag = $("#emrPsFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6255. var personalHistoryFlag = $("#personalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6256. var familyHistoryFlag = $("#familyHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6257. var obstericalHistoryFlag = $("#obstericalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6258. var pressureLeftFlag = $("#pressureLeftFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6259. var tentativeDiagnosisFlag = $("#tentativeDiagnosisFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  6260. $.ajax({
  6261. type: "POST",
  6262. url: '/thmz/saveWorkspaceConfig',
  6263. contentType: "application/json;charset=UTF-8",
  6264. dataType: "json",
  6265. data: JSON.stringify({
  6266. "symptomFlag": symptomFlag,
  6267. "emrHpiFlag": emrHpiFlag,
  6268. "emrPsFlag": emrPsFlag,
  6269. "personalHistoryFlag": personalHistoryFlag,
  6270. "familyHistoryFlag": familyHistoryFlag,
  6271. "obstericalHistoryFlag": obstericalHistoryFlag,
  6272. "pressureLeftFlag": pressureLeftFlag,
  6273. "tentativeDiagnosisFlag": tentativeDiagnosisFlag
  6274. }),
  6275. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6276. success: function (res) {
  6277. if (res == '401' || res == 401) {
  6278. window.location.href = '/thmz/login/view'
  6279. return;
  6280. }
  6281. if (res.code == 0) {
  6282. //successMesage(res);
  6283. initWorkspaceConfigForCurrent();
  6284. $("#configWorkspaceModal").modal("hide");
  6285. } else {
  6286. errorMesage(res);
  6287. }
  6288. }
  6289. });
  6290. }
  6291. /**
  6292. * 初始化药品,检查检验菜单树
  6293. */
  6294. function initzTree() {
  6295. var index = getIndex("bill_item_group");
  6296. if (index == 0) {
  6297. $("#western_medicine_name").webuiPopover('hide');
  6298. $.ajax({
  6299. type: "GET",
  6300. url: '/thmz/getYpZdClasses',
  6301. contentType: "application/json;charset=UTF-8",
  6302. dataType: "json",
  6303. async: false,
  6304. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6305. success: function (res) {
  6306. if (res == '401' || res == 401) {
  6307. window.location.href = '/thmz/login/view'
  6308. return;
  6309. }
  6310. if (res.code == 0) {
  6311. // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
  6312. var setting = {
  6313. callback: {
  6314. onClick: zTreeOnClick
  6315. }
  6316. };
  6317. $.fn.zTree.init($("#treeDemo"), setting, res.data);
  6318. var webuiId = $("#treeButton").attr("data-target");
  6319. var top = $("#" + webuiId).css("top");
  6320. if (top.indexOf("-") == 0) {
  6321. $("#" + webuiId).css("top", '0px');
  6322. }
  6323. } else {
  6324. errorMesage(res);
  6325. }
  6326. }
  6327. });
  6328. } else if (index == 2) {
  6329. $("#jcJyItem").webuiPopover('hide');
  6330. $.ajax({
  6331. type: "GET",
  6332. url: '/thmz/getJyJcZdClasses',
  6333. contentType: "application/json;charset=UTF-8",
  6334. dataType: "json",
  6335. async: false,
  6336. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6337. success: function (res) {
  6338. if (res == '401' || res == 401) {
  6339. window.location.href = '/thmz/login/view'
  6340. return;
  6341. }
  6342. if (res.code == 0) {
  6343. // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
  6344. var setting = {
  6345. callback: {
  6346. onClick: zTreeOnClick
  6347. }
  6348. };
  6349. $.fn.zTree.init($("#treeDemo"), setting, res.data);
  6350. var webuiId = $("#treeButton").attr("data-target");
  6351. var top = $("#" + webuiId).css("top");
  6352. if (top.indexOf("-") == 0) {
  6353. $("#" + webuiId).css("top", '0px');
  6354. }
  6355. } else {
  6356. errorMesage(res);
  6357. }
  6358. }
  6359. });
  6360. } else if (index == 1) {
  6361. $("#treeButton").webuiPopover('hide');
  6362. warningMesageSimaple("中药暂无帮助字典");
  6363. } else if (index == 3) {
  6364. $("#treeButton").webuiPopover('hide');
  6365. warningMesageSimaple("诊疗暂无帮助字典");
  6366. } else {
  6367. $("#treeButton").webuiPopover('hide');
  6368. warningMesageSimaple("入院暂无帮助字典");
  6369. }
  6370. }
  6371. /**
  6372. * 节点点击事件
  6373. * @param event
  6374. * @param treeId
  6375. * @param treeNode
  6376. */
  6377. function zTreeOnClick(event, treeId, treeNode) {
  6378. var index = getIndex("bill_item_group");
  6379. if (index == 0) {
  6380. $("#western_medicine_name").val(treeNode.id);
  6381. $('#western_medicine_name').webuiPopover('show');
  6382. loadYpList(0, null);
  6383. } else if (index == 2) {
  6384. $("#jcJyItem").val(treeNode.id);
  6385. $('#jcJyItem').webuiPopover('show');
  6386. loadjcJyItemList(null);
  6387. }
  6388. }
  6389. /**
  6390. * 构建处方参数
  6391. * @returns {any}
  6392. */
  6393. function getParamsForpPrescription() {
  6394. var codes = $("#diagnoseValue").val();
  6395. var icdCode = null;
  6396. if (codes != null && codes.length > 0) {
  6397. var arr = codes.split(",");
  6398. if (arr != null) {
  6399. for (i = 0; i < arr.length; i++) {
  6400. if (arr[i] != "") {
  6401. if (icdCode == null) {
  6402. icdCode = arr[i];
  6403. } else {
  6404. icdCode += "," + arr[i];
  6405. }
  6406. }
  6407. }
  6408. }
  6409. }
  6410. 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": ""}}');
  6411. jsonData.patientId = $("#patientId").text();
  6412. jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
  6413. jsonData.icdCode = icdCode;
  6414. jsonData.serialNo = $("#mzfzSerialNoInClick").val();
  6415. jsonData.mzBlRecord.firstOrNot = jsonData.firstOrNot;
  6416. jsonData.mzBlRecord.emrChiefComplaint = $("#symptom").val();
  6417. jsonData.mzBlRecord.emrHpi = $("#emrHpi").val();
  6418. jsonData.mzBlRecord.emrPs = $("#emrPs").val();
  6419. jsonData.mzBlRecord.emrPe = $("#otherCheck").val();
  6420. jsonData.mzBlRecord.emrJkjy = $("#healthEducation").val();
  6421. jsonData.mzBlRecord.personalHistory = $("#personalHistory").val();
  6422. jsonData.mzBlRecord.familyHistory = $("#familyHistory").val();
  6423. jsonData.mzBlRecord.obstericalHistory = $("#obstericalHistory").val();
  6424. jsonData.mzBlRecord.weight = $("#weight").val();
  6425. jsonData.mzBlRecord.temperature = $("#temperature").val();
  6426. jsonData.mzBlRecord.sphygmus = $("#sphygmus").val();
  6427. jsonData.mzBlRecord.breathe = $("#breathe").val();
  6428. jsonData.mzBlRecord.pressureHigh = $("#pressure_high").val();
  6429. jsonData.mzBlRecord.pressureFloor = $("#pressure_floor").val();
  6430. jsonData.mzBlRecord.pressureHighLeft = $("#pressure_high_left").val();
  6431. jsonData.mzBlRecord.pressureFloorLeft = $("#pressure_floor_left").val();
  6432. jsonData.mzBlRecord.tentativeDiagnosis = $("#tentativeDiagnosis").val();
  6433. //设置处方详情
  6434. var emrFzjc = null;
  6435. var xyTabContents = $("#xyTabContent").find("div.tab-pane");
  6436. //处方号
  6437. var orderNo = 0;
  6438. var arrs = $("span.cf_amount");
  6439. //西药设置
  6440. if (xyTabContents != null && xyTabContents.length > 0) {
  6441. for (var i = 0; i < xyTabContents.length; i++) {
  6442. //当前药品类型
  6443. var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
  6444. var formGroups = $(xyTabContents[i]).find("div.form-group");
  6445. if (formGroups != null && formGroups.length > 0) {
  6446. for (var j = 0; j < formGroups.length; j++) {
  6447. 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":""}');
  6448. tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
  6449. tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
  6450. tempJson.quantity = $(formGroups[j]).find("input.temporary_items_gross").val();
  6451. tempJson.drugQuan = $(formGroups[j]).find("input.temporary_items_drugWin").val();
  6452. tempJson.drugUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnit").val();
  6453. tempJson.frequency = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
  6454. tempJson.orderDays = $(formGroups[j]).find("input.temporary_items_dayNum").val();
  6455. tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
  6456. tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
  6457. tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
  6458. orderNo = i + 1;
  6459. tempJson.orderNo = orderNo;
  6460. tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
  6461. tempJson.groupNo = currentGroupNo;
  6462. var tryFlag = $(formGroups[j]).find("input.temporary_items_tryFlag").val();
  6463. if (tryFlag == true || tryFlag == "true") {
  6464. tempJson.tryFlag = 1;
  6465. }
  6466. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  6467. }
  6468. }
  6469. }
  6470. }
  6471. //中草药
  6472. var zyTabContents = $("#zyTabContent").find("div.form-group");
  6473. if (zyTabContents != null && zyTabContents.length > 0) {
  6474. orderNo++;
  6475. var zyfs = $("input.zyfs").val();
  6476. //中药的类型
  6477. var currentZyClassType = $("#current_zyClassType").val();
  6478. for (var i = 0; i < zyTabContents.length; i++) {
  6479. 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":""}');
  6480. tempJson.chargeItemCode = $(zyTabContents[i]).find("input.temporary_items_code").val();
  6481. tempJson.serial = $(zyTabContents[i]).find("input.temporary_items_serial").val();
  6482. tempJson.quantity = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
  6483. tempJson.drugQuan = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
  6484. tempJson.drugWin = zyfs;
  6485. tempJson.frequency = $("#zy_orderFrequency_1").val();
  6486. tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
  6487. tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
  6488. tempJson.cyFysm = $("#useType_1").val();
  6489. tempJson.cyJssm = $("#cyJssm").val();
  6490. tempJson.cyDj = $("#zy_supplyType_1").val();
  6491. tempJson.orderNo = orderNo;
  6492. tempJson.groupNo = currentZyClassType;
  6493. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  6494. }
  6495. }
  6496. //辅助检查、检验
  6497. var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
  6498. if (jcjyTabContents != null && jcjyTabContents.length > 0) {
  6499. orderNo++;
  6500. for (var i = 0; i < jcjyTabContents.length; i++) {
  6501. if (emrFzjc == null) {
  6502. emrFzjc = $(jcjyTabContents[i]).text();
  6503. } else {
  6504. emrFzjc += "," + $(jcjyTabContents[i]).text();
  6505. }
  6506. var tempJson = null;
  6507. //项目类型
  6508. var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
  6509. //执行科室
  6510. var execUnit = $(jcjyTabContents[i]).find("input.temporary_items_execUnit").val();
  6511. tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":""}');
  6512. tempJson.orderCode = $(jcjyTabContents[i]).find("input.temporary_items_code").val();
  6513. if (itemsType == "1" || itemsType == 1) {
  6514. //检验
  6515. tempJson.inspectStuff = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
  6516. } else if (itemsType == "2" || itemsType == 2) {
  6517. //检查
  6518. tempJson.inspectPart = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
  6519. }
  6520. tempJson.jyRemark = $(jcjyTabContents[i]).find("input.temporary_items_remark").val();
  6521. tempJson.orderNo = orderNo;
  6522. tempJson.execDept = execUnit;
  6523. jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
  6524. }
  6525. }
  6526. //诊疗
  6527. var zlTabContents = $("#zlTabContent").find("div.form-group");
  6528. if (zlTabContents != null && zlTabContents.length > 0) {
  6529. orderNo++;
  6530. for (var i = 0; i < zlTabContents.length; i++) {
  6531. var tempJson = null;
  6532. //执行科室
  6533. var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
  6534. //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
  6535. 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":""}');
  6536. tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
  6537. tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
  6538. tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
  6539. tempJson.orderNo = orderNo;
  6540. tempJson.execDept = execUnit;
  6541. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  6542. }
  6543. }
  6544. //入院
  6545. var zyReqTabContents = $("#zyReqTabContent").find("div.form-group");
  6546. if (zyReqTabContents != null && zyReqTabContents.length > 0) {
  6547. jsonData.mzZyReq.reqDept = $(zyReqTabContents[0]).find("input.temporary_inpatient_ward").val();
  6548. jsonData.mzZyReq.smallDept = $(zyReqTabContents[0]).find("input.temporary_items_small_ward").val();
  6549. jsonData.mzZyReq.admissStatus = $(zyReqTabContents[0]).find("input.temporary_items_admiss_status").val();
  6550. }
  6551. //设置诊断名称
  6552. var icdText = null;
  6553. var tagsTexts = $("span.el-select__tags-text");
  6554. if (tagsTexts != null && tagsTexts.length > 0) {
  6555. for (var i = 0; i < tagsTexts.length; i++) {
  6556. if (icdText == null) {
  6557. icdText = $(tagsTexts[i]).text();
  6558. } else {
  6559. icdText += "," + $(tagsTexts[i]).text();
  6560. }
  6561. }
  6562. }
  6563. jsonData.icdText = icdText;
  6564. jsonData.mzBlRecord.emrFzjc = emrFzjc;
  6565. return jsonData;
  6566. }
  6567. /**
  6568. * 保存处方
  6569. */
  6570. function savePrescription() {
  6571. //关闭帮助框
  6572. $("#treeButton").webuiPopover('hide');
  6573. $("#western_medicine_name").webuiPopover('hide');
  6574. $("#chinese_medicine_name").webuiPopover('hide');
  6575. $("#jcJyItem").webuiPopover('hide');
  6576. $("#zlItem").webuiPopover('hide');
  6577. $("#messageModal").modal();
  6578. $("#messageContent").html("确认保存处方吗?");
  6579. $("#messageButton").off("click").on("click", function (t) {
  6580. //$("#messageModal").modal("hide");
  6581. var jsonData = getParamsForpPrescription();
  6582. $.ajax({
  6583. type: "POST",
  6584. url: '/thmz/savePrescription',
  6585. contentType: "application/json;charset=UTF-8",
  6586. dataType: "json",
  6587. data: JSON.stringify(jsonData),
  6588. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6589. success: function (res) {
  6590. if (res == '401' || res == 401) {
  6591. window.location.href = '/thmz/login/view'
  6592. return;
  6593. }
  6594. if (res.code == 0) {
  6595. successMesage(res);
  6596. clearWorkSpace();
  6597. loadInClinicTableList();
  6598. loadClinicTableList();
  6599. //$("#messageModal").modal();
  6600. $("#messageContent").html("门诊处方保存成功,是否打印处方和门诊指引单?");
  6601. $("#messageButton").off("click").on("click", function (t) {
  6602. $("#messageModal").modal("hide");
  6603. printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
  6604. });
  6605. $("#cancelButton").off("click");
  6606. } else {
  6607. $("#messageModal").modal("hide");
  6608. errorMesage(res);
  6609. }
  6610. }
  6611. });
  6612. });
  6613. $("#cancelButton").off("click");
  6614. }
  6615. /**
  6616. * 保存医疗范文
  6617. */
  6618. function saveapidAccepts() {
  6619. var templateName = $("#templateName").val();
  6620. if (templateName == null || templateName == "") {
  6621. errorMesageSimaple("范文名称不能为空!");
  6622. return;
  6623. }
  6624. var templateKindType = $("#templateKindType").val();
  6625. if (templateKindType == null || templateKindType == "") {
  6626. errorMesageSimaple("范文类型不能为空!");
  6627. return;
  6628. }
  6629. var templateType = $("#templateType").val();
  6630. if (templateType == null || templateType == "") {
  6631. errorMesageSimaple("范文范围不能为空!");
  6632. return;
  6633. }
  6634. var templateStatus = $("#templateStatus").val();
  6635. if (templateStatus == null || templateStatus == "") {
  6636. errorMesageSimaple("范文状态不能为空!");
  6637. return;
  6638. }
  6639. $("#saveapidAcceptsModal").modal("hide");
  6640. $("#messageModal").modal();
  6641. $("#messageContent").html("确认保存医疗范文吗?");
  6642. $("#messageButton").off("click").on("click", function (t) {
  6643. $("#messageModal").modal("hide");
  6644. var jsonData = getParamsForpPrescription();
  6645. $.ajax({
  6646. type: "POST",
  6647. url: '/thmz/saveTemplate',
  6648. contentType: "application/json;charset=UTF-8",
  6649. dataType: "json",
  6650. data: JSON.stringify({
  6651. "id": $("#templateId").val(),
  6652. "name": templateName,
  6653. "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
  6654. "templateKindType": templateKindType,
  6655. "templateType": templateType,
  6656. "templateStatus": templateStatus,
  6657. "templateData": JSON.stringify(jsonData),
  6658. "emrChiefComplaint": $("#symptom").val(),
  6659. "emrHpi": $("#emrHpi").val(),
  6660. "emrPs": $("#emrPs").val(),
  6661. "icdCode": $("#diagnoseValue").val()
  6662. }),
  6663. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6664. success: function (res) {
  6665. if (res == '401' || res == 401) {
  6666. window.location.href = '/thmz/login/view'
  6667. return;
  6668. }
  6669. if (res.code == 0) {
  6670. successMesage(res);
  6671. //范本保存完不清空
  6672. //clearWorkSpace();
  6673. } else {
  6674. $("#saveapidAcceptsModal").modal();
  6675. errorMesage(res);
  6676. }
  6677. }
  6678. });
  6679. });
  6680. $("#cancelButton").off("click");
  6681. }
  6682. /**
  6683. * 停用医疗范文
  6684. */
  6685. function removeTemplate() {
  6686. $("#messageModal").modal();
  6687. $("#messageContent").html("确认停用医疗范文吗?");
  6688. $("#messageButton").off("click").on("click", function (t) {
  6689. $("#messageModal").modal("hide");
  6690. $.ajax({
  6691. type: "POST",
  6692. url: '/thmz/removeTemplate',
  6693. contentType: "application/json;charset=UTF-8",
  6694. dataType: "json",
  6695. data: JSON.stringify({
  6696. "id": $("#idTemplate").val()
  6697. }),
  6698. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6699. success: function (res) {
  6700. if (res == '401' || res == 401) {
  6701. window.location.href = '/thmz/login/view'
  6702. return;
  6703. }
  6704. if (res.code == 0) {
  6705. successMesage(res);
  6706. $("#medicalModelModal").modal("hide");
  6707. fitTemplateData();
  6708. } else {
  6709. errorMesage(res);
  6710. }
  6711. }
  6712. });
  6713. });
  6714. $("#cancelButton").off("click");
  6715. }
  6716. /**
  6717. * 清空医疗范文模块内容
  6718. */
  6719. function clearApidAcceptsModal() {
  6720. $("#templateId").val(null);
  6721. $("#templateName").val(null);
  6722. $("#templateKindType").selectpicker('val', 0);
  6723. $("#templateKindType").selectpicker('refresh');
  6724. $("#templateType").selectpicker('val', 0);
  6725. $("#templateType").selectpicker('refresh');
  6726. $("#templateStatus").selectpicker('val', 0);
  6727. $("#templateStatus").selectpicker('refresh');
  6728. }
  6729. /**
  6730. * 查询病人未缴费处方信息 加载到处方修改
  6731. * @param patientId
  6732. * @param times
  6733. * @param clnicId 就诊记录id
  6734. */
  6735. function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
  6736. var currentPatientId = $("#patientId").text();
  6737. //当前接诊的用户和操作接诊的是同一个人,不做任何操作
  6738. if (currentPatientId == patientId) {
  6739. warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
  6740. return;
  6741. }
  6742. if (currentPatientId == null || currentPatientId == "") {
  6743. //当前没有人接诊,直接接诊
  6744. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  6745. } else {
  6746. //当前有人在接诊,提示是否需要切换和保存
  6747. $("#messagePrescriptionModal").modal();
  6748. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  6749. $("#messagePrescriptionModal").modal("hide");
  6750. //先保存目前接诊信息,再切换就诊人
  6751. var jsonData = getParamsForpPrescription();
  6752. $.ajax({
  6753. type: "POST",
  6754. url: '/thmz/savePrescription',
  6755. contentType: "application/json;charset=UTF-8",
  6756. dataType: "json",
  6757. data: JSON.stringify(jsonData),
  6758. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6759. success: function (res) {
  6760. if (res == '401' || res == 401) {
  6761. window.location.href = '/thmz/login/view'
  6762. return;
  6763. }
  6764. if (res.code == 0) {
  6765. loadInClinicTableList();
  6766. loadClinicTableList();
  6767. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  6768. } else {
  6769. errorMesage(res);
  6770. }
  6771. }
  6772. });
  6773. });
  6774. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  6775. $("#messagePrescriptionModal").modal("hide");
  6776. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  6777. });
  6778. }
  6779. }
  6780. /**
  6781. * 查询病人未缴费处方信息 加载到处方修改 通用方法
  6782. * @param patientId
  6783. * @param times
  6784. * @param clnicId 就诊记录id
  6785. */
  6786. function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
  6787. $.ajax({
  6788. type: "GET",
  6789. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=false&payMark=5&clnicId=null",
  6790. contentType: "application/json;charset=UTF-8",
  6791. dataType: "json",
  6792. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6793. success: function (res) {
  6794. if (res == '401' || res == 401) {
  6795. window.location.href = '/thmz/login/view'
  6796. return;
  6797. }
  6798. if (res.code == 0) {
  6799. clearWorkSpace();
  6800. setMzPatientInfo(res.mzPatientMi);
  6801. editPrescription(res.data, 0)
  6802. //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
  6803. $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
  6804. } else {
  6805. errorMesage(res);
  6806. }
  6807. }
  6808. });
  6809. }
  6810. /**
  6811. * 查询病人已缴费处方信息 调用处方
  6812. * @param patientId
  6813. * @param times
  6814. * @param clnicId 就诊记录id
  6815. */
  6816. function getMzPrescriptionVoPaid(patientId, times, clnicId) {
  6817. $("#visitingDetailModal").modal("hide");
  6818. $("#messageModal").modal();
  6819. $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
  6820. $("#messageButton").off("click").on("click", function (t) {
  6821. $("#messageModal").modal("hide");
  6822. $.ajax({
  6823. type: "GET",
  6824. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
  6825. contentType: "application/json;charset=UTF-8",
  6826. dataType: "json",
  6827. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6828. success: function (res) {
  6829. if (res == '401' || res == 401) {
  6830. window.location.href = '/thmz/login/view'
  6831. return;
  6832. }
  6833. if (res.code == 0) {
  6834. var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
  6835. clearUser(false);
  6836. clearWorkSpaceExcludeUser();
  6837. setMzPatientInfo(res.mzPatientMi);
  6838. editPrescription(res.data, 2)
  6839. $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
  6840. } else {
  6841. errorMesage(res);
  6842. }
  6843. }
  6844. });
  6845. });
  6846. $("#cancelButton").off("click");
  6847. }
  6848. /**
  6849. * 重复接诊
  6850. * @param patientId
  6851. * @param times
  6852. * @param clnicId
  6853. * @param deptCode 就诊科室编码
  6854. */
  6855. function repeatAccepts(patientId, times, clnicId, deptCode) {
  6856. $.ajax({
  6857. type: "GET",
  6858. url: '/thmz/validMzyReqrec?patientId=' + patientId + "&deptCode=" + deptCode,
  6859. contentType: "application/json;charset=UTF-8",
  6860. dataType: "json",
  6861. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6862. success: function (res) {
  6863. if (res == '401' || res == 401) {
  6864. window.location.href = '/thmz/login/view'
  6865. return;
  6866. }
  6867. if (res.code == 0) {
  6868. if (res.data == 0) {
  6869. $("#messageModal").modal();
  6870. $("#messageContent").html("挂号失效,确定继续就诊?");
  6871. $("#messageButton").off("click").on("click", function (t) {
  6872. $("#messageModal").modal("hide");
  6873. repeatAcceptsConfirm(patientId, times, clnicId);
  6874. });
  6875. $("#cancelButton").off("click");
  6876. return;
  6877. }
  6878. repeatAcceptsConfirm(patientId, times, clnicId);
  6879. } else {
  6880. errorMesage(res);
  6881. }
  6882. }
  6883. });
  6884. }
  6885. /**
  6886. * 重复接诊提示方法
  6887. * @param patientId
  6888. * @param times
  6889. * @param clnicId
  6890. */
  6891. function repeatAcceptsConfirm(patientId, times, clnicId) {
  6892. var currentPatientId = $("#patientId").text();
  6893. //当前接诊的用户和操作接诊的是同一个人,不做任何操作
  6894. if (currentPatientId == patientId) {
  6895. return;
  6896. }
  6897. if (currentPatientId == null || currentPatientId == "") {
  6898. //当前没有人接诊,直接接诊
  6899. repeatAcceptsCommon(patientId, times, clnicId);
  6900. } else {
  6901. //当前有人在接诊,提示是否需要切换和保存
  6902. $("#messagePrescriptionModal").modal();
  6903. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  6904. $("#messagePrescriptionModal").modal("hide");
  6905. //先保存目前接诊信息,再切换就诊人
  6906. var jsonData = getParamsForpPrescription();
  6907. $.ajax({
  6908. type: "POST",
  6909. url: '/thmz/savePrescription',
  6910. contentType: "application/json;charset=UTF-8",
  6911. dataType: "json",
  6912. data: JSON.stringify(jsonData),
  6913. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6914. success: function (res) {
  6915. if (res == '401' || res == 401) {
  6916. window.location.href = '/thmz/login/view'
  6917. return;
  6918. }
  6919. if (res.code == 0) {
  6920. repeatAcceptsCommon(patientId, times, clnicId);
  6921. //加载已接诊患者列表
  6922. loadClinicTableList();
  6923. } else {
  6924. errorMesage(res);
  6925. }
  6926. }
  6927. });
  6928. });
  6929. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  6930. $("#messagePrescriptionModal").modal("hide");
  6931. repeatAcceptsCommon(patientId, times, clnicId);
  6932. });
  6933. }
  6934. }
  6935. /**
  6936. * 重复接诊通用方法
  6937. * @param patientId
  6938. * @param times
  6939. * @param clnicId
  6940. */
  6941. function repeatAcceptsCommon(patientId, times, clnicId) {
  6942. $.ajax({
  6943. type: "GET",
  6944. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=true&payMark=null&clnicId=null",
  6945. contentType: "application/json;charset=UTF-8",
  6946. dataType: "json",
  6947. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6948. success: function (res) {
  6949. if (res == '401' || res == 401) {
  6950. window.location.href = '/thmz/login/view'
  6951. return;
  6952. }
  6953. if (res.code == 0) {
  6954. clearWorkSpace();
  6955. setMzPatientInfo(res.mzPatientMi);
  6956. editPrescription(res.data, 0)
  6957. //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
  6958. $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
  6959. } else {
  6960. errorMesage(res);
  6961. }
  6962. }
  6963. });
  6964. }
  6965. /**
  6966. * 就诊详情 已诊患者列表发起
  6967. * @param patientId
  6968. * @param times
  6969. * @param clnicId
  6970. * @param payMark
  6971. */
  6972. function prescriptionDetail(patientId, times, clnicId, payMark) {
  6973. prescriptionDetailCommon(patientId, times, clnicId, payMark, 0);
  6974. }
  6975. /**
  6976. * 就诊详情 历史轨迹发起
  6977. * @param patientId
  6978. * @param times
  6979. * @param clnicId
  6980. * @param clinicStatus
  6981. */
  6982. function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
  6983. var payMark = null;
  6984. if (clinicStatus == 5) {
  6985. payMark = 5;
  6986. } else {
  6987. payMark = 0;
  6988. }
  6989. prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
  6990. }
  6991. /**
  6992. * 就诊详情通用方法
  6993. * @param patientId
  6994. * @param times
  6995. * @param clnicId
  6996. * @param payMark
  6997. * @param type 0 已诊患者列表发起 1 历史轨迹发起
  6998. */
  6999. function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
  7000. $('#baseMzBlTimes').val(null);
  7001. var oriPayMark = payMark;
  7002. if (payMark == 1) {
  7003. //退费时,查看的明细还是处方开立的情况
  7004. payMark = 0;
  7005. }
  7006. $.ajax({
  7007. type: "GET",
  7008. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
  7009. contentType: "application/json;charset=UTF-8",
  7010. dataType: "json",
  7011. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7012. success: function (res) {
  7013. if (res == '401' || res == 401) {
  7014. window.location.href = '/thmz/login/view'
  7015. return;
  7016. }
  7017. if (res.code == 0) {
  7018. $("#visitingDetailModal").modal();
  7019. var jsonData = res.data;
  7020. var mzPatientMi = res.mzPatientMi;
  7021. $("#visitingDetailPatientName").text(mzPatientMi.name);
  7022. $("#visitingDetailPatientAge").text(mzPatientMi.age);
  7023. $("#visitingDetailPatientGender").val(mzPatientMi.gender);
  7024. $("#prescriptionDetail_zd").html("");
  7025. $("#prescriptionDetail_xyzlContent").html("");
  7026. $("#prescriptionDetail_zyzlContent").html("");
  7027. $("#prescriptionDetail_zlyjContent").html("");
  7028. if (res.opDate != null) {
  7029. $("#visitingDetailDate").text(res.opDate);
  7030. }
  7031. if (res.deptName != null) {
  7032. $("#visitingDetailDept").text(res.deptName);
  7033. }
  7034. if (res.doctorName != null) {
  7035. $("#visitingDetailDoctor").text(res.doctorName);
  7036. }
  7037. var firstOrNot = jsonData.mzBlRecord.firstOrNot;
  7038. if (firstOrNot == 0) {
  7039. $("#visitFlag").html("初诊");
  7040. $("#first").next().click();
  7041. } else if (firstOrNot == 1) {
  7042. $("#visitFlag").html("复诊");
  7043. $("#not").next().click();
  7044. }
  7045. if (oriPayMark == 0) {
  7046. $("#chargeImage").attr("src", "/thmz/images/charge.png");
  7047. } else if (oriPayMark == 1) {
  7048. $("#chargeImage").attr("src", "/thmz/images/refund.png");
  7049. } else if (oriPayMark == 5) {
  7050. $("#chargeImage").attr("src", "/thmz/images/nocharge.png");
  7051. }
  7052. var icdText = jsonData.icdText;
  7053. if (icdText != null) {
  7054. var arr = icdText.split(",");
  7055. var html = "";
  7056. for (var i = 0; i < arr.length; i++) {
  7057. if (i == 0) {
  7058. html += ' <div class="tagZdy tagZdy-back">';
  7059. } else {
  7060. html += ' <div class="tagZdy tagZdy-back-green">';
  7061. }
  7062. html += arr[i];
  7063. html += '</div>';
  7064. }
  7065. $("#prescriptionDetail_zd").html(html);
  7066. } else {
  7067. $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
  7068. }
  7069. var emrProcess = jsonData.mzBlRecord.emrProcess;
  7070. if (emrProcess != null) {
  7071. var xy = null;
  7072. if (emrProcess.indexOf("西药治疗:") >= 0) {
  7073. if (emrProcess.indexOf("中药治疗:") >= 0) {
  7074. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
  7075. } else if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  7076. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
  7077. } else if (emrProcess.indexOf("诊疗:") >= 0) {
  7078. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
  7079. } else if (emrProcess.indexOf("入院处理:") >= 0) {
  7080. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("入院处理:"));
  7081. } else {
  7082. xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
  7083. }
  7084. var arr = xy.split("_");
  7085. if (arr != null && arr.length > 0) {
  7086. var xyhtml = "";
  7087. for (var i = 0; i < arr.length; i++) {
  7088. xyhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
  7089. xyhtml += arr[i];
  7090. xyhtml += "</div>";
  7091. }
  7092. $("#prescriptionDetail_xyzlContent").html(xyhtml);
  7093. $("#prescriptionDetail_xyzlTitle").removeClass("hide").addClass("in");
  7094. } else {
  7095. $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
  7096. }
  7097. } else {
  7098. $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
  7099. }
  7100. var zy = null;
  7101. if (emrProcess.indexOf("中药治疗:") >= 0) {
  7102. if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  7103. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
  7104. } else if (emrProcess.indexOf("诊疗:") >= 0) {
  7105. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
  7106. } else if (emrProcess.indexOf("入院处理:") >= 0) {
  7107. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("入院处理:"));
  7108. } else {
  7109. zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
  7110. }
  7111. var zyArr = zy.split("_");
  7112. if (zyArr != null && zyArr.length > 0) {
  7113. var zyhtml = "";
  7114. for (var i = 1; i < zyArr.length; i++) {
  7115. if (i % 4 == 1) {
  7116. zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
  7117. }
  7118. zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
  7119. zyhtml += zyArr[i];
  7120. zyhtml += "</div>";
  7121. if (i % 4 == 0) {
  7122. zyhtml += '</div>';
  7123. }
  7124. }
  7125. var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
  7126. if (zyfs != null && zyfs != "") {
  7127. if (zyArr.length % 4 == 1) {
  7128. zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
  7129. }
  7130. zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
  7131. zyhtml += ' <div style="text-indent: 2em;">';
  7132. zyhtml += ' <div>';
  7133. zyhtml += 'X<span>';
  7134. zyhtml += zyfs;
  7135. zyhtml += '</span> 付</div></div>';
  7136. zyhtml += '</div>';
  7137. }
  7138. $("#prescriptionDetail_zyzlContent").html(zyhtml);
  7139. $("#prescriptionDetail_zyzlTitle").removeClass("hide").addClass("in");
  7140. } else {
  7141. $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
  7142. }
  7143. } else {
  7144. $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
  7145. }
  7146. if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
  7147. var zlyj = null;
  7148. if (emrProcess.indexOf("诊疗:") >= 0) {
  7149. zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
  7150. } else if (emrProcess.indexOf("入院处理:") >= 0) {
  7151. zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("入院处理:"));
  7152. } else {
  7153. zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
  7154. }
  7155. var zlyjArr = zlyj.split("_");
  7156. if (zlyjArr != null && zlyjArr.length > 0) {
  7157. var zlyjhtml = "";
  7158. for (var i = 0; i < zlyjArr.length; i++) {
  7159. zlyjhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
  7160. zlyjhtml += zlyjArr[i];
  7161. zlyjhtml += "</div>";
  7162. }
  7163. $("#prescriptionDetail_zlyjContent").html(zlyjhtml);
  7164. $("#prescriptionDetail_zlyjTitle").removeClass("hide").addClass("in");
  7165. } else {
  7166. $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
  7167. }
  7168. } else {
  7169. $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
  7170. }
  7171. if (emrProcess.indexOf("诊疗:") >= 0) {
  7172. var zl = null;
  7173. if (emrProcess.indexOf("入院处理:") >= 0) {
  7174. zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3, emrProcess.indexOf("入院处理:"));
  7175. } else {
  7176. zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
  7177. }
  7178. var zlArr = zl.split("_");
  7179. if (zlArr != null && zlArr.length > 0) {
  7180. var zlhtml = "";
  7181. for (var i = 0; i < zlArr.length; i++) {
  7182. zlhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
  7183. zlhtml += zlyjArr[i];
  7184. zlhtml += "</div>";
  7185. }
  7186. $("#prescriptionDetail_zlContent").html(zlhtml);
  7187. $("#prescriptionDetail_zlTitle").removeClass("hide").addClass("in");
  7188. } else {
  7189. $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
  7190. }
  7191. } else {
  7192. $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
  7193. }
  7194. if (emrProcess.indexOf("入院处理:") >= 0) {
  7195. var zyReq = emrProcess.substring(emrProcess.indexOf("入院处理:") + 5);
  7196. if (zyReq != null && zyReq != "") {
  7197. var zyReqhtml = "<div style='margin-bottom: 5px;padding-left: 10px;'>";
  7198. zyReqhtml += zyReq;
  7199. zyReqhtml += "</div>";
  7200. $("#prescriptionDetail_zyReqContent").html(zyReqhtml);
  7201. $("#prescriptionDetail_zyReqTitle").removeClass("hide").addClass("in");
  7202. } else {
  7203. $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
  7204. }
  7205. } else {
  7206. $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
  7207. }
  7208. }
  7209. $("#printJcReq").removeClass("in").addClass("hide");
  7210. $("#printJcReq").off("click");
  7211. $("#printJyReq").removeClass("in").addClass("hide");
  7212. $("#printJyReq").off("click");
  7213. $("#printJcReqSetup").removeClass("in").addClass("hide");
  7214. $("#printJcReqSetup").off("click");
  7215. $("#printJyReqSetup").removeClass("in").addClass("hide");
  7216. $("#printJyReqSetup").off("click");
  7217. $("#previewYjReq").removeClass("in").addClass("hide");
  7218. $("#previewYjReq").off("click");
  7219. $("#previewYjReqAll").removeClass("in").addClass("hide");
  7220. $("#previewYjReqAll").off("click");
  7221. $("#deletePrescription").removeClass("in").addClass("hide");
  7222. $("#deletePrescription").off("click");
  7223. if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
  7224. $("#previewYjReq").removeClass("hide").addClass("in");
  7225. $("#previewYjReq").off("click").on("click", function (t) {
  7226. previewYjReq(patientId, times);
  7227. });
  7228. }
  7229. if (res.yjReqCount != null && res.yjReqCount > 0) {
  7230. $("#previewYjReqAll").removeClass("hide").addClass("in");
  7231. $("#previewYjReqAll").off("click").on("click", function (t) {
  7232. previewYjReqAll(patientId);
  7233. });
  7234. }
  7235. if (type == 0) {
  7236. $("#callPrescription").removeClass("in").addClass("hide");
  7237. if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
  7238. $("#printPrescription").removeClass("in").addClass("hide");
  7239. $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  7240. } else {
  7241. $("#printPrescription").removeClass("hide").addClass("in");
  7242. $("#printPrescription").off("click").on("click", function (t) {
  7243. printPrescription(patientId, times, clnicId, payMark, 1);
  7244. });
  7245. $("#printPrescriptionSetup").removeClass("hide").addClass("in");
  7246. $("#printPrescriptionSetup").off("click").on("click", function (t) {
  7247. printPrescription(patientId, times, clnicId, payMark, 2);
  7248. });
  7249. }
  7250. if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
  7251. var hadJc = false;
  7252. var hadJy = false;
  7253. for (var i = 0; i < jsonData.mzYjReqList.length; i++) {
  7254. var mzYjReq = jsonData.mzYjReqList[i];
  7255. if (mzYjReq.reqType == 2) {
  7256. hadJy = true;
  7257. } else if (mzYjReq.reqType == 3) {
  7258. hadJc = true;
  7259. }
  7260. }
  7261. if (hadJc) {
  7262. $("#printJcReq").removeClass("hide").addClass("in");
  7263. $("#printJcReq").off("click").on("click", function (t) {
  7264. printYjReq(patientId, times, 3, 1);
  7265. });
  7266. $("#printJcReqSetup").removeClass("hide").addClass("in");
  7267. $("#printJcReqSetup").off("click").on("click", function (t) {
  7268. printYjReq(patientId, times, 3, 2);
  7269. });
  7270. }
  7271. if (hadJy) {
  7272. $("#printJyReq").removeClass("hide").addClass("in");
  7273. $("#printJyReq").off("click").on("click", function (t) {
  7274. printYjReq(patientId, times, 2, 1);
  7275. });
  7276. $("#printJyReqSetup").removeClass("hide").addClass("in");
  7277. $("#printJyReqSetup").off("click").on("click", function (t) {
  7278. printYjReq(patientId, times, 2, 2);
  7279. });
  7280. }
  7281. }
  7282. if (jsonData.mzZyReq == null || jsonData.mzZyReq.reqDept == null || jsonData.mzZyReq.reqDept == "") {
  7283. $("#printZyReq").removeClass("in").addClass("hide");
  7284. $("#printZyReq").off("click");
  7285. $("#printZyReqSetup").removeClass("in").addClass("hide");
  7286. $("#printZyReqSetup").off("click");
  7287. } else {
  7288. $("#printZyReq").removeClass("hide").addClass("in");
  7289. $("#printZyReq").off("click").on("click", function (t) {
  7290. printZyReq(patientId, 1);
  7291. });
  7292. $("#printZyReqSetup").removeClass("hide").addClass("in");
  7293. $("#printZyReqSetup").off("click").on("click", function (t) {
  7294. printZyReq(patientId, 2);
  7295. });
  7296. }
  7297. //未缴费状态的时候可以删除处方
  7298. if (oriPayMark == 5 || oriPayMark == "5") {
  7299. $("#deletePrescription").removeClass("hide").addClass("in");
  7300. $("#deletePrescription").off("click").on("click", function (t) {
  7301. deletePrescription(clnicId);
  7302. });
  7303. }
  7304. } else {
  7305. $("#printPrescription").removeClass("in").addClass("hide");
  7306. $("#printZyReq").removeClass("in").addClass("hide");
  7307. $("#printBlRecord").removeClass("in").addClass("hide");
  7308. $("#printJcReq").removeClass("in").addClass("hide");
  7309. $("#printJyReq").removeClass("in").addClass("hide");
  7310. $("#callPrescription").removeClass("hide").addClass("in");
  7311. $("#callPrescription").off("click").on("click", function (t) {
  7312. getMzPrescriptionVoPaid(patientId, times, clnicId);
  7313. });
  7314. }
  7315. if (oriPayMark == 1) {
  7316. $("#printPrescription").removeClass("in").addClass("hide");
  7317. $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  7318. } else {
  7319. if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
  7320. $("#printPrescription").removeClass("in").addClass("hide");
  7321. $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  7322. } else {
  7323. $("#printPrescription").removeClass("hide").addClass("in");
  7324. $("#printPrescription").off("click").on("click", function (t) {
  7325. printPrescription(patientId, times, clnicId, payMark, 1);
  7326. });
  7327. $("#printPrescriptionSetup").removeClass("hide").addClass("in");
  7328. $("#printPrescriptionSetup").off("click").on("click", function (t) {
  7329. printPrescription(patientId, times, clnicId, payMark, 2);
  7330. });
  7331. }
  7332. }
  7333. $("#printBlRecord").removeClass("hide").addClass("in");
  7334. $("#printBlRecord").off("click").on("click", function (t) {
  7335. printBlRecord(patientId, times, 1);
  7336. });
  7337. $("#printBlRecordSetup").removeClass("hide").addClass("in");
  7338. $("#printBlRecordSetup").off("click").on("click", function (t) {
  7339. printBlRecord(patientId, times, 2);
  7340. });
  7341. $("#showMzBlRecordModal").removeClass("hide").addClass("in");
  7342. $("#showMzBlRecordModal").off("click").on("click", function (t) {
  7343. showMzBlRecordModal(patientId, times, 1);
  7344. });
  7345. if ($("#setupId").hasClass("fa-chevron-up")) {
  7346. //默认不展开打印设置
  7347. $("#setupId").parent().click();
  7348. }
  7349. // setTimeout(function () {
  7350. // if ($("#setupId").hasClass("fa-chevron-up")) {
  7351. // //默认不展开打印设置
  7352. // $("#setupId").parent().click();
  7353. // }
  7354. // }, 400);
  7355. } else {
  7356. errorMesage(res);
  7357. }
  7358. }
  7359. });
  7360. }
  7361. /**
  7362. * 查询默认打印机
  7363. */
  7364. function setPrint() {
  7365. if (printIndex >= 0) {
  7366. return;
  7367. }
  7368. $.ajax({
  7369. type: "GET",
  7370. url: '/thmz/getLastWindowsByCurrentUser',
  7371. contentType: "application/json;charset=UTF-8",
  7372. dataType: "json",
  7373. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7374. async: false,
  7375. success: function (res) {
  7376. if (res == '401' || res == 401) {
  7377. window.location.href = '/thmz/login/view'
  7378. return;
  7379. }
  7380. if (res.code == 0) {
  7381. printIndex = res.data.cgPrintIndex;
  7382. } else {
  7383. printIndex = -1;
  7384. }
  7385. }
  7386. });
  7387. }
  7388. function setTableHtml(prescriptionDetail) {
  7389. var html = "";
  7390. for (var j = 0; j < prescriptionDetail.length; j++) {
  7391. html += "<tr><td>";
  7392. html += prescriptionDetail[j].substring(0, prescriptionDetail[j].indexOf("用法"));
  7393. html += "</td></tr>";
  7394. html += "<tr><td>";
  7395. html += prescriptionDetail[j].substring(prescriptionDetail[j].indexOf("用法"));
  7396. html += "</td></tr>";
  7397. }
  7398. html += "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;------(以下空白)------</td></tr>";
  7399. return {html: html, j: j};
  7400. }
  7401. // /**
  7402. // * 打印门诊指引单
  7403. // * @param patientId
  7404. // * @param times
  7405. // */
  7406. // function printGuideCard(patientId, times) {
  7407. //
  7408. // }
  7409. /**
  7410. * 打印门诊处方
  7411. * @param patientId
  7412. * @param times
  7413. * @param clnicId
  7414. * @param payMark
  7415. * @param printType 打印模式 1 预览打印 2 打印设置
  7416. */
  7417. function printPrescription(patientId, times, clnicId, payMark, printType) {
  7418. $.ajax({
  7419. type: "GET",
  7420. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
  7421. contentType: "application/json;charset=UTF-8",
  7422. dataType: "json",
  7423. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7424. success: function (res) {
  7425. if (res == '401' || res == 401) {
  7426. window.location.href = '/thmz/login/view'
  7427. return;
  7428. }
  7429. if (res.code == 0) {
  7430. var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
  7431. if (prescriptionDetail != null && prescriptionDetail != "") {
  7432. var prescriptionDetailJson = JSON.parse(prescriptionDetail);
  7433. //当前处方只开了住院证则只打印住院证
  7434. 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) {
  7435. printZyReq(patientId, 1);
  7436. return;
  7437. }
  7438. var index = 0;
  7439. setPrint();
  7440. LODOP = getLodop();
  7441. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院处方笺");
  7442. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  7443. //设置默认打印机
  7444. LODOP.SET_PRINTER_INDEX(printIndex);
  7445. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  7446. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  7447. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  7448. //LODOP.SET_SHOW_MODE("SETUP_ENABLESS",getCheckSS());
  7449. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
  7450. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  7451. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  7452. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  7453. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  7454. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  7455. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  7456. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  7457. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  7458. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  7459. var mzPatientMi = res.mzPatientMi;
  7460. $("#patientNamePrescription").text(mzPatientMi.name);
  7461. $("#patientGenderPrescription").text(mzPatientMi.gender);
  7462. $("#patientAgePrescription").text(mzPatientMi.age);
  7463. $("#patientIdPrescription").text(mzPatientMi.patientId);
  7464. $("#deptPrescription").text(res.deptName);
  7465. $("#doctorPrescription").text(res.doctorName);
  7466. $("#cfTime").text(res.opDate);
  7467. $("#socialNo").text(mzPatientMi.socialNo);
  7468. $("#zdPrescription").text(res.data.icdText);
  7469. $("#patientIdGuideCard").text(mzPatientMi.patientId);
  7470. $("#patientNameGuideCard").text(mzPatientMi.name);
  7471. $("#patientDateGuideCard").text(format(new Date(), "yyyy-MM-dd"));
  7472. //普药处方
  7473. var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
  7474. if (pyPrescription != null && pyPrescription.length > 0) {
  7475. for (var i = 0; i < pyPrescription.length; i++) {
  7476. if (index > 0) {
  7477. LODOP.NewPageA();
  7478. }
  7479. var prescriptionDetail = pyPrescription[i].detail;
  7480. var __ret = setTableHtml(prescriptionDetail);
  7481. var html = __ret.html;
  7482. var j = __ret.j;
  7483. if (res.deptName != undefined && res.deptName != null) {
  7484. if (res.deptName.indexOf("儿") > 0) {
  7485. $("#typePrescription").text("儿科");
  7486. $("#cfTitle").text("儿科");
  7487. } else if (res.deptName.indexOf("急诊科") > 0) {
  7488. $("#typePrescription").text("急诊");
  7489. $("#cfTitle").text("急诊");
  7490. } else {
  7491. $("#typePrescription").text("普通处方");
  7492. $("#cfTitle").text("普通");
  7493. }
  7494. }
  7495. $("#prescriptionDetail").html(html);
  7496. $("#cfAmountPrint").text(pyPrescription[i].amount + "元 (不含注射费)");
  7497. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7498. index++;
  7499. }
  7500. }
  7501. //医材处方
  7502. var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
  7503. if (ycPrescription != null && ycPrescription.length > 0) {
  7504. for (var i = 0; i < ycPrescription.length; i++) {
  7505. if (index > 0) {
  7506. LODOP.NewPageA();
  7507. }
  7508. var prescriptionDetail = ycPrescription[i].detail;
  7509. var __ret = setTableHtml(prescriptionDetail);
  7510. var html = __ret.html;
  7511. var j = __ret.j;
  7512. if (res.deptName != undefined && res.deptName != null) {
  7513. if (res.deptName.indexOf("儿") > 0) {
  7514. $("#typePrescription").text("儿科");
  7515. $("#cfTitle").text("儿科");
  7516. } else if (res.deptName.indexOf("急诊科") > 0) {
  7517. $("#typePrescription").text("急诊");
  7518. $("#cfTitle").text("急诊");
  7519. } else {
  7520. $("#typePrescription").text("医材处方");
  7521. $("#cfTitle").text("普通");
  7522. }
  7523. }
  7524. $("#prescriptionDetail").html(html);
  7525. $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
  7526. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7527. index++;
  7528. }
  7529. }
  7530. //麻精处方
  7531. var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
  7532. if (mjPrescription != null && mjPrescription.length > 0) {
  7533. for (var i = 0; i < mjPrescription.length; i++) {
  7534. if (index > 0) {
  7535. LODOP.NewPageA();
  7536. }
  7537. var prescriptionDetail = mjPrescription[i].detail;
  7538. var __ret = setTableHtml(prescriptionDetail);
  7539. var html = __ret.html;
  7540. var j = __ret.j;
  7541. $("#typePrescription").text("麻、精一处方");
  7542. $("#cfTitle").text("麻、精一");
  7543. $("#prescriptionDetail").html(html);
  7544. $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
  7545. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7546. index++;
  7547. }
  7548. }
  7549. //精二处方
  7550. var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
  7551. if (jePrescription != null && jePrescription.length > 0) {
  7552. for (var i = 0; i < jePrescription.length; i++) {
  7553. if (index > 0) {
  7554. LODOP.NewPageA();
  7555. }
  7556. var prescriptionDetail = jePrescription[i].detail;
  7557. var __ret = setTableHtml(prescriptionDetail);
  7558. var html = __ret.html;
  7559. var j = __ret.j;
  7560. $("#typePrescription").text("精二处方");
  7561. $("#cfTitle").text("精二");
  7562. $("#prescriptionDetail").html(html);
  7563. $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
  7564. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7565. index++;
  7566. }
  7567. }
  7568. //中药处方
  7569. if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0) {
  7570. var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;
  7571. if (zyPrescription != null && zyPrescription.length > 0) {
  7572. var html = "";
  7573. for (var i = 0; i < zyPrescription.length; i++) {
  7574. if (i % 3 == 0) {
  7575. html += "<tr>";
  7576. }
  7577. html += "<td>";
  7578. html += zyPrescription[i].trim();
  7579. if (i % 3 == 2) {
  7580. html += "</td></tr>";
  7581. } else {
  7582. html += "</td>";
  7583. }
  7584. }
  7585. if (zyPrescription.length % 3 != 0) {
  7586. html += "</tr>";
  7587. }
  7588. html += "<tr><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td>";
  7589. var colNum = 1;
  7590. var frequency = prescriptionDetailJson.zyPrescription[0].frequency;
  7591. if (frequency != null && frequency != "") {
  7592. html += "<td>频率:" + frequency + "</td>";
  7593. colNum++;
  7594. }
  7595. var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
  7596. if (cyJssm != null && cyJssm != "") {
  7597. html += "<td>加水说明:" + cyJssm + "</td>";
  7598. colNum++;
  7599. if (colNum % 3 == 0) {
  7600. html += "</tr>";
  7601. }
  7602. }
  7603. var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
  7604. if (cyFysm != null && cyFysm != "") {
  7605. colNum++;
  7606. if (colNum % 3 == 1) {
  7607. html += "<tr>";
  7608. }
  7609. html += "<td>服用说明:" + cyFysm + "</td>";
  7610. if (colNum % 3 == 0) {
  7611. html += "</tr>";
  7612. }
  7613. }
  7614. var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
  7615. if (cyDj != null && cyDj != "") {
  7616. colNum++;
  7617. if (colNum % 3 == 1) {
  7618. html += "<tr>";
  7619. }
  7620. html += "<td>" + cyDj + "</td>";
  7621. if (colNum % 3 == 0) {
  7622. html += "</tr>";
  7623. }
  7624. }
  7625. if (index > 0) {
  7626. LODOP.NewPageA();
  7627. }
  7628. if (res.deptName != undefined && res.deptName != null) {
  7629. if (res.deptName.indexOf("儿") > 0) {
  7630. $("#typePrescription").text("儿科");
  7631. $("#cfTitle").text("儿科");
  7632. } else if (res.deptName.indexOf("急诊科") > 0) {
  7633. $("#typePrescription").text("急诊");
  7634. $("#cfTitle").text("急诊");
  7635. } else {
  7636. $("#typePrescription").text("中药处方");
  7637. $("#cfTitle").text("普通");
  7638. }
  7639. }
  7640. $("#prescriptionDetail").html(html);
  7641. $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 (不含代煎费)");
  7642. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7643. index++;
  7644. }
  7645. }
  7646. //暂时不打印 诊疗了
  7647. var printZlPrescription = false;
  7648. if (printZlPrescription) {
  7649. if (prescriptionDetailJson.zlPrescription != null && prescriptionDetailJson.zlPrescription.length > 0) {
  7650. //诊疗处方
  7651. var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
  7652. if (zlPrescription != null && zlPrescription.length > 0) {
  7653. var html = "";
  7654. for (var i = 0; i < zlPrescription.length; i++) {
  7655. html += "<tr><td>";
  7656. html += zlPrescription[i];
  7657. html += "</td></tr>";
  7658. }
  7659. if (index > 0) {
  7660. LODOP.NewPageA();
  7661. }
  7662. if (res.deptName != undefined && res.deptName != null) {
  7663. if (res.deptName.indexOf("儿") > 0) {
  7664. $("#typePrescription").text("儿科");
  7665. $("#cfTitle").text("儿科");
  7666. } else if (res.deptName.indexOf("急诊科") > 0) {
  7667. $("#typePrescription").text("急诊");
  7668. $("#cfTitle").text("急诊");
  7669. } else {
  7670. $("#typePrescription").text("诊疗处方");
  7671. $("#cfTitle").text("普通");
  7672. }
  7673. }
  7674. $("#prescriptionDetail").html(html);
  7675. $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
  7676. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  7677. index++;
  7678. }
  7679. }
  7680. }
  7681. //检查申请单打印
  7682. var mzYjReqList = res.data.mzYjReqList;
  7683. if (mzYjReqList != null && mzYjReqList.length > 0) {
  7684. $("#patientIdJcReq").text(mzPatientMi.patientId);
  7685. $("#patientNameJcReq").text(mzPatientMi.name);
  7686. $("#patientGenderJcReq").text(mzPatientMi.gender);
  7687. $("#patientAgeJcReq").text(mzPatientMi.age + "岁");
  7688. $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
  7689. $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
  7690. $("#icdTextJcReq").text(res.data.icdText);
  7691. var mzBlRecord = res.data.mzBlRecord;
  7692. $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  7693. $("#jcReqHis").text(mzBlRecord.emrHpi);
  7694. var tz = getTz(mzBlRecord);
  7695. $("#jcReqTz").text(tz);
  7696. $("#jcReqReqDept").text(res.deptName);
  7697. $("#jcReqReqDoctor").text(res.doctorName);
  7698. for (var i = 0; i < mzYjReqList.length; i++) {
  7699. var mzYjReq = mzYjReqList[i];
  7700. if (i == 0) {
  7701. var dateStr = format(mzYjReq.reqDate, "yyyy-MM-dd");
  7702. $("#jcReqReqDate").text(dateStr);
  7703. }
  7704. if (mzYjReq == null || mzYjReq.reqType == 2) {
  7705. continue;
  7706. }
  7707. if ((i == 0 && index > 0) || i > 0) {
  7708. LODOP.NewPageA();
  7709. }
  7710. $("#reqNoJcReq").text(mzYjReq.reqNo);
  7711. $("#jcReqItem").text(mzYjReq.groupName);
  7712. $("#jcReqRemark").text(mzYjReq.jyRemark);
  7713. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
  7714. index++;
  7715. }
  7716. }
  7717. $.ajax({
  7718. type: "GET",
  7719. url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '&times=' + times,
  7720. contentType: "application/json;charset=UTF-8",
  7721. dataType: "json",
  7722. headers: {
  7723. 'Accept': 'application/json',
  7724. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  7725. },
  7726. success: function (res) {
  7727. if (res == '401' || res == 401) {
  7728. window.location.href = '/thmz/login/view'
  7729. return;
  7730. }
  7731. if (res.code == 0) {
  7732. if (res.data != null && res.data.length > 0) {
  7733. var html = "";
  7734. for (var i = 0; i < res.data.length; i++) {
  7735. 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>"
  7736. }
  7737. $("#guideCardDetail").html(html);
  7738. }
  7739. if (res.payQrcode != null && res.payQrcode != "") {
  7740. $("#payQrcodeGuideCard").html(null);
  7741. new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
  7742. $("canvas").attr("id", "erw");
  7743. var canvas = document.getElementById('erw');
  7744. var src = canvas.toDataURL("image/png");
  7745. //var strDataURI =canvas.toDataURL("image/png");
  7746. $("#payQrcodeGuideCard").html("<img src='" + src + "' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>微信支付</div>");
  7747. }
  7748. $("#totalAmountGuideCard").text("¥" + res.totalAmount);
  7749. // $("#imgcode").JsBarcode(patientId);
  7750. console.log(patientId);
  7751. JsBarcode('#imgcode', patientId, {
  7752. lineColor: '#333', //线条颜色
  7753. width: 2, //线宽
  7754. height: 60, //条码高度
  7755. displayValue: false, //是否显示文字信息
  7756. });
  7757. if (index > 0) {
  7758. LODOP.NewPageA();
  7759. }
  7760. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
  7761. //LODOP.PRINT();
  7762. if (printType == 1) {
  7763. LODOP.PREVIEW();
  7764. } else if (printType == 2) {
  7765. LODOP.PRINT_SETUP();
  7766. }
  7767. } else if (res.code == -2) {
  7768. if (printType == 1) {
  7769. LODOP.PREVIEW();
  7770. } else if (printType == 2) {
  7771. LODOP.PRINT_SETUP();
  7772. }
  7773. } else {
  7774. errorMesage(res);
  7775. }
  7776. }
  7777. });
  7778. // printGuideCard(patientId, times);
  7779. }
  7780. } else {
  7781. errorMesage(res);
  7782. }
  7783. }
  7784. });
  7785. }
  7786. /**
  7787. * 构建体征描述
  7788. * @param mzBlRecord
  7789. * @returns {*}
  7790. */
  7791. function getTz(mzBlRecord) {
  7792. var tz = null;
  7793. if (mzBlRecord.weight != null && mzBlRecord.weight != 0) {
  7794. var temp = "体重:" + mzBlRecord.weight + "kg ";
  7795. if (tz == null) {
  7796. tz = temp;
  7797. } else {
  7798. tz += " " + temp;
  7799. }
  7800. }
  7801. if (mzBlRecord.temperature != null && mzBlRecord.temperature != 0) {
  7802. var temp = "体温:" + mzBlRecord.temperature + "℃ ";
  7803. if (tz == null) {
  7804. tz = temp;
  7805. } else {
  7806. tz += " " + temp;
  7807. }
  7808. }
  7809. if (mzBlRecord.sphygmus != null && mzBlRecord.sphygmus != 0) {
  7810. var temp = "脉搏:" + mzBlRecord.sphygmus + "次/分 ";
  7811. if (tz == null) {
  7812. tz = temp;
  7813. } else {
  7814. tz += " " + temp;
  7815. }
  7816. }
  7817. if (mzBlRecord.breathe != null && mzBlRecord.breathe != 0) {
  7818. var temp = "呼吸:" + mzBlRecord.breathe + "次/分 ";
  7819. if (tz == null) {
  7820. tz = temp;
  7821. } else {
  7822. tz += " " + temp;
  7823. }
  7824. }
  7825. if (mzBlRecord.pressureHigh != null && mzBlRecord.pressureFloor != null && mzBlRecord.pressureHigh != 0 && mzBlRecord.pressureFloor != 0) {
  7826. var temp = "血压:" + mzBlRecord.pressureHigh + "/" + mzBlRecord.pressureFloor;
  7827. if (tz == null) {
  7828. tz = temp;
  7829. } else {
  7830. tz += " " + temp;
  7831. }
  7832. }
  7833. if (mzBlRecord.pressureHighLeft != null && mzBlRecord.pressureFloorLeft != null && mzBlRecord.pressureHighLeft != 0 && mzBlRecord.pressureFloorLeft != 0) {
  7834. var temp = "左血压:" + mzBlRecord.pressureHighLeft + "/" + mzBlRecord.pressureFloorLeft;
  7835. if (tz == null) {
  7836. tz = temp;
  7837. } else {
  7838. tz += " " + temp;
  7839. }
  7840. }
  7841. return tz;
  7842. }
  7843. /**
  7844. * 打印医技申请单
  7845. * @param patientId
  7846. * @param times
  7847. * @param type 申请单类型:2:检验;3:检查
  7848. * @param printType 打印模式 1 预览打印 2 打印设置
  7849. */
  7850. function printYjReq(patientId, times, type, printType) {
  7851. $.ajax({
  7852. type: "GET",
  7853. url: '/thmz/printYjReq?patientId=' + patientId + '&times=' + times + "&reqType=" + type,
  7854. contentType: "application/json;charset=UTF-8",
  7855. dataType: "json",
  7856. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7857. success: function (res) {
  7858. if (res == '401' || res == 401) {
  7859. window.location.href = '/thmz/login/view'
  7860. return;
  7861. }
  7862. if (res.code == 0) {
  7863. if (res.data == null || res.data.mzYjReqList == null || res.data.mzYjReqList.length == 0) {
  7864. errorMesageSimaple("没有医技申请单可以打印");
  7865. return;
  7866. }
  7867. setPrint();
  7868. LODOP = getLodop();
  7869. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院检查申请单");
  7870. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  7871. //设置默认打印机
  7872. LODOP.SET_PRINTER_INDEX(printIndex);
  7873. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  7874. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  7875. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  7876. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "检查申请单");//对新建的纸张重命名
  7877. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  7878. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  7879. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  7880. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  7881. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  7882. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  7883. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  7884. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  7885. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  7886. var mzPatientMi = res.data.mzPatientMi;
  7887. $("#patientIdJcReq").text(mzPatientMi.patientId);
  7888. $("#patientNameJcReq").text(mzPatientMi.name);
  7889. $("#patientGenderJcReq").text(mzPatientMi.gender);
  7890. $("#patientAgeJcReq").text(mzPatientMi.age + "岁");
  7891. $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
  7892. $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
  7893. $("#icdTextJcReq").text(res.data.mzVisitTable.icdText);
  7894. $("#patientIdJyReq").text(mzPatientMi.patientId);
  7895. $("#patientNameJyReq").text(mzPatientMi.name);
  7896. $("#patientGenderJyReq").text(mzPatientMi.gender);
  7897. $("#patientAgeJyReq").text(mzPatientMi.age + "岁");
  7898. $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
  7899. $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
  7900. $("#icdTextJyReq").text(res.data.mzVisitTable.icdText);
  7901. var mzBlRecord = res.data.mzBlRecord;
  7902. $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  7903. $("#jcReqHis").text(mzBlRecord.emrHpi);
  7904. $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  7905. $("#jyReqHis").text(mzBlRecord.emrHpi);
  7906. var tz = getTz(mzBlRecord);
  7907. $("#jcReqTz").text(tz);
  7908. $("#jcReqReqDept").text(res.data.deptName);
  7909. $("#jcReqReqDoctor").text(res.data.doctorName);
  7910. $("#jyReqTz").text(tz);
  7911. $("#jyReqReqDept").text(res.data.deptName);
  7912. $("#jyReqReqDoctor").text(res.data.doctorName);
  7913. //检验报告列表名
  7914. var jyTitle = '<tr><th style="min-height: 30px;border-bottom: 1px solid black;">检验项目</th><th style="min-height: 30px;border-bottom: 1px solid black;">标本</th><th style="min-height: 30px;border-bottom: 1px solid black;">单号</th></tr>';
  7915. var jyContent = "";
  7916. var needNewPageA = false;
  7917. for (var i = 0; i < res.data.mzYjReqList.length; i++) {
  7918. var obj = res.data.mzYjReqList[i];
  7919. if (i == 0) {
  7920. var dateStr = format(obj.reqDate, "yyyy-MM-dd");
  7921. $("#jcReqReqDate").text(dateStr);
  7922. $("#jyReqReqDate").text(dateStr);
  7923. }
  7924. if (obj.reqType == "3") {
  7925. if (i > 0) {
  7926. LODOP.NewPageA();
  7927. }
  7928. $("#reqNoJcReq").text(obj.reqNo);
  7929. $("#jcReqItem").text(obj.groupName);
  7930. $("#jcReqRemark").text(obj.jyRemark);
  7931. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
  7932. needNewPageA = true;
  7933. } else if (obj.reqType == "2") {
  7934. var inspectStuff = (obj.inspectStuff == null || obj.inspectStuff == "null") ? "" : obj.inspectStuff;
  7935. jyContent += '<tr><td style="min-height: 30px;">' + obj.groupName + '</td><td>' + inspectStuff + '</td><td>' + obj.reqNo + '</td></tr>';
  7936. }
  7937. }
  7938. if (jyContent != null && jyContent != "" && jyContent.length > 0) {
  7939. if (needNewPageA) {
  7940. LODOP.NewPageA();
  7941. }
  7942. jyContent = jyTitle + jyContent;
  7943. $("#jyContent").html(jyContent);
  7944. //检验
  7945. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jy_card_table").innerHTML);
  7946. }
  7947. if (printType == 1) {
  7948. LODOP.PREVIEW();
  7949. } else if (printType == 2) {
  7950. LODOP.PRINT_SETUP();
  7951. }
  7952. } else {
  7953. errorMesage(res);
  7954. }
  7955. }
  7956. });
  7957. }
  7958. /**
  7959. * 打印门诊病历
  7960. * @param patientId
  7961. * @param times
  7962. * @param clnicId
  7963. * @param payMark
  7964. * @param printType 打印模式 1 预览打印 2 打印设置
  7965. */
  7966. function printBlRecord(patientId, times, printType) {
  7967. $.ajax({
  7968. type: "GET",
  7969. url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times,
  7970. contentType: "application/json;charset=UTF-8",
  7971. dataType: "json",
  7972. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7973. success: function (res) {
  7974. if (res == '401' || res == 401) {
  7975. window.location.href = '/thmz/login/view'
  7976. return;
  7977. }
  7978. if (res.code == 0) {
  7979. setPrint();
  7980. LODOP = getLodop();
  7981. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院门诊病历");
  7982. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  7983. //设置默认打印机
  7984. LODOP.SET_PRINTER_INDEX(printIndex);
  7985. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  7986. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  7987. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  7988. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊病历");//对新建的纸张重命名
  7989. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  7990. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  7991. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  7992. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  7993. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  7994. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  7995. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  7996. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  7997. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  7998. var mzPatientMi = res.mzPatientMi;
  7999. $("#patientIdBlrecord").text(mzPatientMi.patientId);
  8000. $("#patientNameBlrecord").text(mzPatientMi.name);
  8001. $("#patientGenderBlrecord").text(mzPatientMi.gender);
  8002. $("#patientAgeBlrecord").text(mzPatientMi.age + "岁");
  8003. var mzBlRecord = res.mzBlRecord;
  8004. if (mzBlRecord.firstOrNot == "1") {
  8005. $("#firstOrNotTitle").text("复诊");
  8006. } else {
  8007. $("#firstOrNotTitle").text("初诊");
  8008. }
  8009. if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
  8010. $("#emrChiefComplaintBlrecord").text(mzBlRecord.emrChiefComplaint);
  8011. $("#emrChiefComplaintBlrecord").parent().css("display", "block");
  8012. } else {
  8013. $("#emrChiefComplaintBlrecord").parent().css("display", "none");
  8014. }
  8015. if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
  8016. $("#emrHpiBlrecord").text(mzBlRecord.emrHpi);
  8017. $("#emrHpiBlrecord").parent().css("display", "block");
  8018. } else {
  8019. $("#emrHpiBlrecord").parent().css("display", "none");
  8020. }
  8021. if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
  8022. $("#emrPsBlrecord").text(mzBlRecord.emrPs);
  8023. $("#emrPsBlrecord").parent().css("display", "block");
  8024. } else {
  8025. $("#emrPsBlrecord").parent().css("display", "none");
  8026. }
  8027. if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
  8028. $("#personalHistoryBlrecord").text(mzBlRecord.personalHistory);
  8029. $("#personalHistoryBlrecord").parent().css("display", "block");
  8030. } else {
  8031. $("#personalHistoryBlrecord").parent().css("display", "none");
  8032. }
  8033. if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
  8034. $("#familyHistoryBlrecord").text(mzBlRecord.familyHistory);
  8035. $("#familyHistoryBlrecord").parent().css("display", "block");
  8036. } else {
  8037. $("#familyHistoryBlrecord").parent().css("display", "none");
  8038. }
  8039. if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
  8040. $("#obstericalHistoryBlrecord").text(mzBlRecord.obstericalHistory);
  8041. $("#obstericalHistoryBlrecord").parent().css("display", "block");
  8042. } else {
  8043. $("#obstericalHistoryBlrecord").parent().css("display", "none");
  8044. }
  8045. var tz = getTz(mzBlRecord);
  8046. if (tz != null && tz != "") {
  8047. $("#tzjcBlrecord").text(tz);
  8048. $("#tzjcBlrecord").parent().css("display", "block");
  8049. } else {
  8050. $("#tzjcBlrecord").parent().css("display", "none");
  8051. }
  8052. if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
  8053. $("#emrPeBlrecord").text(mzBlRecord.emrPe);
  8054. $("#emrPeBlrecord").parent().css("display", "block");
  8055. } else {
  8056. $("#emrPeBlrecord").parent().css("display", "none");
  8057. }
  8058. if (res.icdText != null && res.icdText != "") {
  8059. $("#icdTextBlrecord").text(res.icdText);
  8060. $("#icdTextBlrecord").parent().css("display", "block");
  8061. } else {
  8062. $("#icdTextBlrecord").parent().css("display", "none");
  8063. }
  8064. if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
  8065. $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
  8066. $("#emrProcessBlrecord").parent().css("display", "block");
  8067. } else {
  8068. $("#emrProcessBlrecord").parent().css("display", "none");
  8069. }
  8070. if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
  8071. $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
  8072. $("#emrJkjyBlrecord").parent().css("display", "block");
  8073. } else {
  8074. $("#emrJkjyBlrecord").parent().css("display", "none");
  8075. }
  8076. $("#visitDeptBlrecord").text(res.deptName);
  8077. $("#visitDoctorBlrecord").text(res.doctorName);
  8078. $("#visitDateBlrecord").text(res.visitDate);
  8079. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
  8080. if (printType == 1) {
  8081. LODOP.PREVIEW();
  8082. } else if (printType == 2) {
  8083. LODOP.PRINT_SETUP();
  8084. }
  8085. } else {
  8086. errorMesage(res);
  8087. }
  8088. }
  8089. });
  8090. }
  8091. /**
  8092. * 将内容拼接空格,这样才会有下划线
  8093. * @param mzPatientMi
  8094. * @param maxLength 最大长度
  8095. * @returns {*}
  8096. */
  8097. function formatUnderline(params, maxLength) {
  8098. var length = 0;
  8099. if (params == null || params.length == 0) {
  8100. length = maxLength;
  8101. } else {
  8102. length = maxLength - params.length;
  8103. }
  8104. for (var i = 0; i < length; i++) {
  8105. params += " ";
  8106. }
  8107. return params;
  8108. }
  8109. /**
  8110. * 打印入院通知单
  8111. * @param patientId
  8112. * @param times
  8113. * @param clnicId
  8114. * @param payMark
  8115. * @param printType 打印模式 1 预览打印 2 打印设置
  8116. */
  8117. function printZyReq(patientId, printType) {
  8118. $.ajax({
  8119. type: "GET",
  8120. url: '/thmz/printZyReq?patientId=' + patientId,
  8121. contentType: "application/json;charset=UTF-8",
  8122. dataType: "json",
  8123. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8124. success: function (res) {
  8125. if (res == '401' || res == 401) {
  8126. window.location.href = '/thmz/login/view'
  8127. return;
  8128. }
  8129. if (res.code == 0) {
  8130. setPrint();
  8131. LODOP = getLodop();
  8132. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院入院通知单");
  8133. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  8134. //设置默认打印机
  8135. LODOP.SET_PRINTER_INDEX(printIndex);
  8136. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  8137. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  8138. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  8139. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
  8140. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  8141. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  8142. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  8143. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  8144. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  8145. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  8146. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  8147. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  8148. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  8149. var mzPatientMi = res.mzPatientMi;
  8150. var mzZyReq = res.mzZyReq;
  8151. var mzPatientId = formatUnderline(mzPatientMi.patientId, 15);
  8152. $("#patientIdZyReq").text(mzPatientId);
  8153. var mzPatientMiName = formatUnderline(mzPatientMi.name, 22);
  8154. $("#patientNameZyReq").text(mzPatientMiName);
  8155. var mzPatientGender = formatUnderline(mzPatientMi.gender, 10);
  8156. $("#patientGenderZyReq").text(mzPatientGender);
  8157. var mzPatientAge = formatUnderline(mzPatientMi.age + "岁", 6);
  8158. $("#patientAgeZyReq").text(mzPatientAge);
  8159. var mzPatientSocialNo = formatUnderline(mzPatientMi.socialNo, 48);
  8160. $("#sfzZyReq").text(mzPatientSocialNo);
  8161. $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
  8162. var mzPatientPhoneNo = formatUnderline(mzPatientMi.phoneNo, 55);
  8163. $("#phoneZyReq").text(mzPatientPhoneNo);
  8164. $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
  8165. var mzPatientMiAddress = formatUnderline(mzPatientMi.address, 31);
  8166. $("#addressZyReq").text(mzPatientMiAddress);
  8167. if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
  8168. $("#icsCodeZyReq").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  8169. var mzPatientMiIcdText = formatUnderline(mzZyReq.icdText, 29);
  8170. $("#icsTextZyReq").text(" " + mzPatientMiIcdText);
  8171. } else {
  8172. var mzPatientMiIcdCode = formatUnderline(mzZyReq.icdCode, 12);
  8173. $("#icsCodeZyReq").text(mzPatientMiIcdCode);
  8174. var mzPatientMiIcdText = formatUnderline(mzZyReq.icdText, 29);
  8175. $("#icsTextZyReq").text(mzPatientMiIcdText);
  8176. }
  8177. var mzZyReqReqWard = formatUnderline(mzZyReq.reqWard, 6);
  8178. $("#reqDeptZyReq").text(mzZyReqReqWard);
  8179. var mzZyReqSmallDept = formatUnderline(mzZyReq.smallDept, 27);
  8180. $("#smallDeptZyReq").text(mzZyReqSmallDept);
  8181. //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
  8182. $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
  8183. var mzZyReqVisitDate = formatUnderline(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"), 37);
  8184. $("#visitDateZyReq").text(mzZyReqVisitDate);
  8185. var mzZyReqDeptCode = formatUnderline(mzZyReq.deptCode, 15);
  8186. $("#deptCodeZyReq").text(mzZyReqDeptCode);
  8187. var mzZyReqDoctorCode = formatUnderline(mzZyReq.doctorCode, 16);
  8188. $("#doctorCodeZyReq").text(mzZyReqDoctorCode);
  8189. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
  8190. if (printType == 1) {
  8191. LODOP.PREVIEW();
  8192. } else if (printType == 2) {
  8193. LODOP.PRINT_SETUP();
  8194. }
  8195. } else {
  8196. errorMesage(res);
  8197. }
  8198. }
  8199. });
  8200. }
  8201. /**
  8202. * 打开查看检查检验报告窗口(含往期)
  8203. * @param patientId
  8204. */
  8205. function previewYjReqAll(patientId) {
  8206. $("#visitingDetailModal").modal("hide");
  8207. $("#previewYjReqModal").modal();
  8208. $("#previewYjReqModalPatientId").val(patientId);
  8209. $("#previewYjReqModalTimes").val(null);
  8210. //重置参数
  8211. retryCount = 0;
  8212. initJcJyTable();
  8213. }
  8214. /**
  8215. * 打开查看检查检验报告窗口
  8216. * @param patientId 门诊病人ID
  8217. * @param times 就诊次数
  8218. */
  8219. function previewYjReq(patientId, times) {
  8220. $("#visitingDetailModal").modal("hide");
  8221. $("#previewYjReqModal").modal();
  8222. $("#previewYjReqModalPatientId").val(patientId);
  8223. $("#previewYjReqModalTimes").val(times);
  8224. //重置参数
  8225. retryCount = 0;
  8226. initJcJyTable();
  8227. }
  8228. /**
  8229. * 删除本次处方
  8230. * @param clnicId 就诊记录id
  8231. */
  8232. function deletePrescription(clnicId) {
  8233. $("#visitingDetailModal").modal("hide");
  8234. $("#messageModal").modal();
  8235. $("#messageContent").html("确认要删除本次处方信息吗?");
  8236. $("#messageButton").off("click").on("click", function (t) {
  8237. $("#messageModal").modal("hide");
  8238. $.ajax({
  8239. type: "GET",
  8240. url: '/thmz/deletePrescription?clnicId=' + clnicId,
  8241. contentType: "application/json;charset=UTF-8",
  8242. dataType: "json",
  8243. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8244. success: function (res) {
  8245. if (res == '401' || res == 401) {
  8246. window.location.href = '/thmz/login/view'
  8247. return;
  8248. }
  8249. if (res.code == 0) {
  8250. successMesage(res);
  8251. $("#tb_table_clinic").bootstrapTable('refresh');
  8252. } else {
  8253. errorMesage(res);
  8254. }
  8255. }
  8256. });
  8257. });
  8258. $("#cancelButton").off("click").on("click", function (t) {
  8259. $("#visitingDetailModal").modal();
  8260. });
  8261. ;
  8262. }
  8263. /**
  8264. * 检查检验列表类型按钮切换事件
  8265. * @param object
  8266. */
  8267. function jcjyButtonChange(object) {
  8268. $("#jcjy_group").find("button").each(function (index, element) {
  8269. if ($(element).hasClass("btn-primary")) {
  8270. $(element).removeClass("btn-primary").addClass("btn-default");
  8271. }
  8272. });
  8273. $(object).removeClass("btn-default").addClass("btn-primary");
  8274. initJcJyTable();
  8275. }
  8276. /**
  8277. * 初始化检查检验报告列表
  8278. */
  8279. function initJcJyTable() {
  8280. clearInspectionDetail();
  8281. clearJcDetail();
  8282. var typeIndex = getIndex("jcjy_group");
  8283. if (typeIndex == 0) {
  8284. //检查
  8285. $('#tb_jy_pName_table_list').bootstrapTable("destroy");
  8286. $('#tb_jy_table_list').bootstrapTable("destroy");
  8287. initJcListTable();
  8288. $("#jy_detail").removeClass("in").addClass("hide");
  8289. $("#jc_detail").removeClass("hide").addClass("in");
  8290. } else {
  8291. $('#tb_table_list').bootstrapTable("destroy");
  8292. initJyListTable();
  8293. $("#jc_detail").removeClass("in").addClass("hide");
  8294. $("#jy_detail").removeClass("hide").addClass("in");
  8295. }
  8296. }
  8297. /**
  8298. * 初始化检查报告列表
  8299. */
  8300. function initJcListTable() {
  8301. $('#tb_table_list').bootstrapTable("destroy");
  8302. $('#tb_table_list').bootstrapTable({
  8303. url: '/thmz/getJcJyList', //请求后台的URL(*)
  8304. method: 'post', //请求方式(*)
  8305. toolbar: '#toolbar', //工具按钮用哪个容器
  8306. striped: true, //是否显示行间隔色
  8307. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8308. pagination: true, //是否显示分页(*)
  8309. sortable: true, //是否启用排序
  8310. sortOrder: "asc", //排序方式
  8311. queryParams: queryParams, //传递参数(*)
  8312. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  8313. pageNumber: 1, //初始化加载第一页,默认第一页
  8314. pageSize: 5, //每页的记录行数(*)
  8315. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8316. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8317. strictSearch: true,
  8318. showColumns: false, //是否显示所有的列
  8319. showRefresh: false, //是否显示刷新按钮
  8320. minimumCountColumns: 2, //最少允许的列数
  8321. clickToSelect: true, //是否启用点击选中行
  8322. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8323. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8324. cardView: false, //是否显示详细视图
  8325. detailView: false,
  8326. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8327. ajaxOptions: {
  8328. headers: {
  8329. 'Accept': 'application/json',
  8330. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8331. }
  8332. },
  8333. columns: [
  8334. {
  8335. field: 'groupName',
  8336. title: '项目名称',
  8337. align: "center",
  8338. valign: 'middle',
  8339. }, {
  8340. field: 'reqDate',
  8341. title: '申请时间',
  8342. align: "center",
  8343. valign: 'middle',
  8344. formatter: function (value, row, index) {
  8345. if (value == null || value == "") {
  8346. return "";
  8347. }
  8348. return format(value, "yyyy-MM-dd HH:mm:ss");
  8349. }
  8350. }
  8351. ],
  8352. onClickRow: function (row) {
  8353. clearJcDetail();
  8354. $("#patientId_t").text(row.patientId);
  8355. $("#name_t").text(row.patientName);
  8356. $("#date_t").text(format(row.reqDate, "yyyy-MM-dd HH:mm:ss"));
  8357. fitJcDetail(row.reqNo, row.patientId);
  8358. },
  8359. responseHandler: function (res) {
  8360. if (res == '401' || res == 401) {
  8361. window.location.href = '/thmz/login/view'
  8362. return;
  8363. }
  8364. var ress = eval(res);
  8365. if (ress.code == -1) {
  8366. if (ress.message != null && ress.message != '') {
  8367. errorMesage(ress);
  8368. }
  8369. if (retryCount == 0) {
  8370. retryCount++;
  8371. $("#jyButton").click();
  8372. return;
  8373. }
  8374. return {
  8375. "total": 0,//总页数
  8376. "rows": {} //数据
  8377. };
  8378. }
  8379. if (ress.count <= 0 && retryCount == 0) {
  8380. retryCount++;
  8381. $("#jyButton").click();
  8382. return;
  8383. }
  8384. //有数据的时候,计数也需要加1,防止这时医生自己候点击检验没数据又跳回检查
  8385. retryCount++;
  8386. return {
  8387. "total": ress.count,//总页数
  8388. "rows": ress.data //数据
  8389. };
  8390. },
  8391. onLoadSuccess: function (data) {
  8392. $(".pagination-detail").css("display", "none");
  8393. }
  8394. });
  8395. }
  8396. /**
  8397. * 构建列表查询参数
  8398. * @param params
  8399. * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  8400. */
  8401. function queryParams(params) {
  8402. var patientId = $("#previewYjReqModalPatientId").val();
  8403. var times = $("#previewYjReqModalTimes").val();
  8404. return {
  8405. reqType: "3",
  8406. patientId: patientId,
  8407. times: times,
  8408. pageSize: params.limit, //页面大小
  8409. pageIndex: params.offset / params.limit //页码
  8410. };
  8411. };
  8412. /**
  8413. * 加载检查明细
  8414. * @param reqNo
  8415. */
  8416. function fitJcDetail(reqNo, patientId) {
  8417. $.ajax({
  8418. type: "GET",
  8419. url: '/thmz/getYjJcRecordReport?hisReqNo=' + reqNo + "&patientId=" + patientId,
  8420. contentType: "application/json;charset=UTF-8",
  8421. dataType: "json",
  8422. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8423. success: function (res) {
  8424. if (res == '401' || res == 401) {
  8425. window.location.href = '/thmz/login/view'
  8426. return;
  8427. }
  8428. if (res.code == 0) {
  8429. canBePrintJc = true;
  8430. $("#jy_detail").removeClass("in").addClass("hide");
  8431. $("#jc_detail").removeClass("hide").addClass("in");
  8432. var mzPatientMi = res.data.mzPatientMi;
  8433. $("#gender_jc").text(mzPatientMi.gender);
  8434. $("#age_jc").text(mzPatientMi.age);
  8435. var yjJcRecordReport = res.data.yjJcRecordReport;
  8436. $("#groupName").text(res.data.groupName);
  8437. $("#textJc").text(yjJcRecordReport.textJc);
  8438. $("#textZd").text(yjJcRecordReport.textZd);
  8439. var jcRecord = res.data.jcRecord;
  8440. $("#report_no").text(jcRecord.reportNo);
  8441. $("#reportId").text(jcRecord.reportId);
  8442. if (jcRecord.reportDate == null || jcRecord.reportDate == "") {
  8443. $("#reportDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  8444. } else {
  8445. $("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
  8446. }
  8447. $("#confirmId").text(jcRecord.confirmId);
  8448. if (jcRecord.confirmDate == null || jcRecord.confirmDate == "") {
  8449. $("#confirmDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  8450. } else {
  8451. $("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
  8452. }
  8453. } else {
  8454. errorMesage(res);
  8455. }
  8456. }
  8457. });
  8458. }
  8459. /**
  8460. * 清空检查明细
  8461. * @param reqNo
  8462. */
  8463. function clearJcDetail() {
  8464. canBePrintJc = false;
  8465. $("#patientId_t").text("");
  8466. $("#name_t").text("");
  8467. $("#date_t").text("");
  8468. $("#gender_jc").text("");
  8469. $("#age_jc").text("");
  8470. $("#groupName").text("");
  8471. $("#textJc").text("");
  8472. $("#textZd").text("");
  8473. $("#report_no").text("");
  8474. $("#reportId").text("");
  8475. $("#reportDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  8476. $("#confirmId").text("");
  8477. $("#confirmDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  8478. }
  8479. /**
  8480. * 初始化检验报告列表
  8481. */
  8482. function initJyListTable() {
  8483. var patientId = $("#previewYjReqModalPatientId").val();
  8484. var times = $("#previewYjReqModalTimes").val();
  8485. $('#tb_table_list').bootstrapTable("destroy");
  8486. $('#tb_table_list').bootstrapTable({
  8487. url: '/thmz/getJyListByPatientIdAndTimes?patientId=' + patientId + "&times=" + times, //请求后台的URL(*)
  8488. method: 'get', //请求方式(*)
  8489. toolbar: '#toolbar', //工具按钮用哪个容器
  8490. striped: true, //是否显示行间隔色
  8491. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8492. pagination: true, //是否显示分页(*)
  8493. sortable: true, //是否启用排序
  8494. sortOrder: "asc", //排序方式
  8495. //queryParams: queryJyPNameParams, //传递参数(*)
  8496. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  8497. pageNumber: 1, //初始化加载第一页,默认第一页
  8498. pageSize: 5, //每页的记录行数(*)
  8499. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8500. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8501. strictSearch: true,
  8502. showColumns: false, //是否显示所有的列
  8503. showRefresh: false, //是否显示刷新按钮
  8504. minimumCountColumns: 2, //最少允许的列数
  8505. clickToSelect: true, //是否启用点击选中行
  8506. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8507. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8508. cardView: false, //是否显示详细视图
  8509. detailView: false,
  8510. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8511. ajaxOptions: {
  8512. headers: {
  8513. 'Accept': 'application/json',
  8514. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8515. }
  8516. },
  8517. columns: [
  8518. {
  8519. field: 'aply_CTNT',
  8520. title: '检验名称',
  8521. align: "center",
  8522. valign: 'middle',
  8523. }, {
  8524. field: 'ordr_CREATE_DATE',
  8525. title: '检验时间',
  8526. align: "center",
  8527. valign: 'middle',
  8528. formatter: function (value, row, index) {
  8529. if (value == null || value == "") {
  8530. return "";
  8531. }
  8532. return format(value, "yyyy-MM-dd HH:mm:ss");
  8533. }
  8534. }
  8535. ],
  8536. onClickRow: function (row) {
  8537. queryInspectionDetail(row.ordr_ID);
  8538. },
  8539. responseHandler: function (res) {
  8540. if (res == '401' || res == 401) {
  8541. window.location.href = '/thmz/login/view'
  8542. return;
  8543. }
  8544. var ress = eval(res);
  8545. if (ress.code == -1) {
  8546. if (retryCount == 0) {
  8547. retryCount++;
  8548. $("#jcButton").click();
  8549. return;
  8550. }
  8551. if (ress.message != null && ress.message != '') {
  8552. errorMesage(ress);
  8553. }
  8554. return {
  8555. "total": ress.data.length,//总页数
  8556. "rows": ress.data //数据
  8557. };
  8558. }
  8559. if (ress.data.length <= 0 && retryCount == 0) {
  8560. retryCount++;
  8561. $("#jcButton").click();
  8562. return;
  8563. }
  8564. //有数据的时候,计数也需要加1,防止这时医生自己候点击检查没数据又跳回检验
  8565. retryCount++;
  8566. return {
  8567. "total": ress.data.length,//总页数
  8568. "rows": ress.data //数据
  8569. };
  8570. },
  8571. onLoadSuccess: function (data) {
  8572. $("#jy_table_table_div").find(".pagination-detail").css("display", "none");
  8573. }
  8574. });
  8575. }
  8576. /**
  8577. * 清空检验明细
  8578. * @param orderId
  8579. */
  8580. function clearInspectionDetail() {
  8581. canBePrintJy = false;
  8582. $("#patientId_t_jy").text("");
  8583. $("#name_t_jy").text("");
  8584. $("#gender_jy").text("");
  8585. $("#age_jy").text("");
  8586. $("#reqDept_t_jy").text("");
  8587. $("#bed_no_jy").text("");
  8588. $("#smpl_jy").text("");
  8589. $("#item_jy").text("");
  8590. $("#applyDate").text("");
  8591. $("#orderCreateDate").text("");
  8592. $("#auditTime").text("");
  8593. $("#orderUsrName").text("");
  8594. $("#testUsrName").text("");
  8595. $("#auditUsrName").text("");
  8596. $("#jyBody").html("");
  8597. }
  8598. /**
  8599. * 加载检验明细
  8600. * @param orderId
  8601. */
  8602. function queryInspectionDetail(orderId) {
  8603. clearInspectionDetail();
  8604. $.ajax({
  8605. type: "GET",
  8606. url: '/thmz/getInspectionDetail?orderId=' + orderId,
  8607. contentType: "application/json;charset=UTF-8",
  8608. dataType: "json",
  8609. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8610. success: function (res) {
  8611. if (res == '401' || res == 401) {
  8612. window.location.href = '/thmz/login/view'
  8613. return;
  8614. }
  8615. if (res.code == 0) {
  8616. canBePrintJy = true;
  8617. $("#jc_detail").removeClass("in").addClass("hide");
  8618. $("#jy_detail").removeClass("hide").addClass("in");
  8619. var mzPatientMi = res.mzPatientMi;
  8620. $("#patientId_t_jy").text(mzPatientMi.patientId);
  8621. $("#name_t_jy").text(mzPatientMi.name);
  8622. $("#gender_jy").text(mzPatientMi.gender);
  8623. $("#age_jy").text(mzPatientMi.age);
  8624. var html = "";
  8625. if (res.data != null) {
  8626. var inspectionHeader = res.data.inspectionHeader;
  8627. $("#reqDept_t_jy").text(inspectionHeader.dept_NAME);
  8628. $("#bed_no_jy").text(inspectionHeader.ptnt_BED_NO);
  8629. $("#smpl_jy").text(inspectionHeader.smpl_NAME);
  8630. $("#item_jy").text(inspectionHeader.aply_CNTN);
  8631. $("#applyDate").text(format(inspectionHeader.aply_DATE, "yyyy-MM-dd HH:mm:ss"));
  8632. $("#orderCreateDate").text(format(inspectionHeader.ordr_CREATE_DATE, "yyyy-MM-dd HH:mm:ss"));
  8633. $("#auditTime").text(format(inspectionHeader.audt_TIME, "yyyy-MM-dd HH:mm:ss"));
  8634. $("#orderUsrName").text(inspectionHeader.ordr_USR_NAME);
  8635. $("#testUsrName").text(inspectionHeader.test_USR_NAME);
  8636. $("#auditUsrName").text(inspectionHeader.audt_USR_NAME);
  8637. var inspectionItems = res.data.inspectionItems;
  8638. if (inspectionItems != null && inspectionItems.length > 0) {
  8639. for (var i = 0; i < inspectionItems.length; i++) {
  8640. html += "<tr>";
  8641. var obj = inspectionItems[i];
  8642. var itm_VALUE = obj.itm_VALUE;
  8643. if (itm_VALUE == null || itm_VALUE == "null") {
  8644. itm_VALUE = "";
  8645. }
  8646. itm_VALUE += (obj.itm_STR_VALUE == null || obj.itm_STR_VALUE == "null") ? "" : obj.itm_STR_VALUE;
  8647. var range = obj.range;
  8648. if (range == null || range == "null") {
  8649. range = "";
  8650. }
  8651. range += (obj.range_STR == null || obj.range_STR == "null") ? "" : obj.range_STR;
  8652. html += "<td width='25%'>" + obj.itm_NAME + "</td>";
  8653. html += "<td width='16.66%'>" + itm_VALUE + "</td>";
  8654. html += "<td width='16.66%'>" + obj.itm_UNIT + "</td>";
  8655. if (obj.itm_ALERT == null || obj.itm_ALERT == "") {
  8656. html += "<td width='16.66%'><span style=\"color:#67C23A;font-weight:bold\"></span></td>";
  8657. } else if (obj.itm_ALERT == "H") {
  8658. html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↑</span></td>";
  8659. } else if (obj.itm_ALERT == "L") {
  8660. html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↓</span></td>";
  8661. }
  8662. html += "<td width='25%'>" + range + "</td>";
  8663. html += "</tr>";
  8664. var bacteriaResults = obj.bacteriaResults;
  8665. if (bacteriaResults == null || bacteriaResults.length == 0) {
  8666. continue;
  8667. }
  8668. var bacteriaResult = bacteriaResults[0];
  8669. if (bacteriaResult == null || bacteriaResult.length == 0) {
  8670. continue;
  8671. }
  8672. var antibioticResults = bacteriaResult.antibioticResults;
  8673. if (antibioticResults == null || antibioticResults.length == 0) {
  8674. continue;
  8675. }
  8676. html += '<tr><th width="35%;" style="text-align: left;padding-left: 2%;" >抗菌药物</th><th width="20%;" style="text-align: left;">药物编码</th><th width="30%;" style="text-align: left;">MIC值</th><th width="15%;" style="text-align: left;padding-right: 2%;">敏感性</th></tr>';
  8677. for (var j = 0; j < antibioticResults.length; j++) {
  8678. var antibioticResultsObj = antibioticResults[j];
  8679. html += "<tr>";
  8680. html += "<td width='35%' style='padding-left: 2%;";
  8681. if (j == 0) {
  8682. html += "border-top: 1px solid black;";
  8683. }
  8684. html += "'>" + antibioticResultsObj.anti_NAME_CN + "</td>";
  8685. html += "<td width='20%' ";
  8686. if (j == 0) {
  8687. html += "style='border-top: 1px solid black;'";
  8688. }
  8689. html += ">" + antibioticResultsObj.anti_ABB + "</td>";
  8690. html += "<td width='25%' ";
  8691. if (j == 0) {
  8692. html += "style='border-top: 1px solid black;'";
  8693. }
  8694. html += ">" + antibioticResultsObj.anti_MIC + "</td>";
  8695. html += "<td width='20%' style='padding-right: 2%;";
  8696. if (j == 0) {
  8697. html += "border-top: 1px solid black;";
  8698. }
  8699. html += "'>" + antibioticResultsObj.anti_VALUE + "</td>";
  8700. html += "</tr>";
  8701. }
  8702. }
  8703. }
  8704. }
  8705. $("#jyBody").html(html);
  8706. } else {
  8707. errorMesage(res);
  8708. }
  8709. }
  8710. });
  8711. }
  8712. /**
  8713. * 打印检查检验报告单
  8714. * @param printType 打印模式 1 预览打印 2 打印设置
  8715. */
  8716. function printJyJcReport(printType) {
  8717. var typeIndex = getIndex("jcjy_group");
  8718. var title = "检查报告单";
  8719. if (typeIndex == 1) {
  8720. title = "检验报告单"
  8721. if (!canBePrintJy) {
  8722. warningMesageSimaple("没有任何【" + title + "】可供打印!");
  8723. return;
  8724. }
  8725. } else {
  8726. if (!canBePrintJc) {
  8727. warningMesageSimaple("没有任何【" + title + "】可供打印!");
  8728. return;
  8729. }
  8730. }
  8731. setPrint();
  8732. LODOP = getLodop();
  8733. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院" + title);
  8734. LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
  8735. //设置默认打印机
  8736. LODOP.SET_PRINTER_INDEX(printIndex);
  8737. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  8738. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  8739. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  8740. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
  8741. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  8742. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  8743. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  8744. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  8745. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  8746. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  8747. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  8748. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  8749. var strStyle = "<style>table{width: 96%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
  8750. if (typeIndex == 0) {
  8751. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_detail").innerHTML);
  8752. }
  8753. if (typeIndex == 1) {
  8754. LODOP.ADD_PRINT_TABLE("37mm", "5mm", "130mm", "138mm", strStyle + document.getElementById("jy_detail_content").innerHTML);
  8755. LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
  8756. LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_title").innerHTML);
  8757. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  8758. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  8759. LODOP.ADD_PRINT_HTM("177mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_foot").innerHTML);
  8760. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  8761. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  8762. }
  8763. if (printType == 1) {
  8764. LODOP.PREVIEW();
  8765. } else if (printType == 2) {
  8766. LODOP.PRINT_SETUP();
  8767. }
  8768. }
  8769. /**
  8770. * 初始化科室下拉选
  8771. */
  8772. function initExecUnit() {
  8773. //父科室列表
  8774. $.ajax({
  8775. type: "GET",
  8776. url: '/thmz/allUnitCode',
  8777. dataType: "json",
  8778. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8779. success: function (data) {
  8780. if (data == '401' || data == 401) {
  8781. window.location.href = '/thmz/login/view'
  8782. return;
  8783. }
  8784. $('#execUnit').empty(); //清空resText里面的所有内容
  8785. $('#zlExecUnit').empty(); //清空resText里面的所有内容
  8786. var html = '';
  8787. $.each(data.data, function (commentIndex, comment) {
  8788. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
  8789. });
  8790. $('#execUnit').html(html);
  8791. $('#execUnit').selectpicker('refresh');
  8792. $('#zlExecUnit').html(html);
  8793. $('#zlExecUnit').selectpicker('refresh');
  8794. }
  8795. });
  8796. }
  8797. /**
  8798. * 初始化证件类型下拉选
  8799. */
  8800. function initCertificateTypeSelect() {
  8801. $.ajax({
  8802. type: "GET",
  8803. url: '/thmz/listCertificateType',
  8804. contentType: "application/json;charset=UTF-8",
  8805. dataType: "json",
  8806. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8807. success: function (res) {
  8808. if (res == '401' || res == 401) {
  8809. window.location.href = '/thmz/login/view'
  8810. return;
  8811. }
  8812. if (res.code == 0) {
  8813. res.data.forEach(function (item, index) {
  8814. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  8815. $('#rapidAcceptsUserCertificateType').append(html);
  8816. $('#editUserCertificateType').append(html);
  8817. });
  8818. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  8819. $('#editUserCertificateType').selectpicker('refresh');
  8820. } else {
  8821. errorMesage(res);
  8822. }
  8823. }
  8824. });
  8825. }
  8826. /**
  8827. * 加载病历信息编辑预览
  8828. * @param patientId
  8829. * @param times
  8830. * @param type 1 编辑 2 预览
  8831. */
  8832. function showMzBlRecordModal(patientId, times, type) {
  8833. $.ajax({
  8834. type: "GET",
  8835. url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times,
  8836. contentType: "application/json;charset=UTF-8",
  8837. dataType: "json",
  8838. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8839. success: function (res) {
  8840. if (res == '401' || res == 401) {
  8841. window.location.href = '/thmz/login/view'
  8842. return;
  8843. }
  8844. if (res.code == 0) {
  8845. //$("#visitingDetailModal").modal("hide");
  8846. var mzPatientMi = res.mzPatientMi;
  8847. $("#editPatientId").text(mzPatientMi.patientId);
  8848. $("#editPatientName").text(mzPatientMi.name);
  8849. $("#editPatientGender").text(mzPatientMi.gender);
  8850. $("#editPatientAge").text(mzPatientMi.age + "岁");
  8851. var mzBlRecord = res.mzBlRecord;
  8852. // if (mzBlRecord.firstOrNot == "1") {
  8853. // $("#firstOrNotTitle").text("复诊");
  8854. // } else {
  8855. // $("#firstOrNotTitle").text("初诊");
  8856. // }
  8857. if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
  8858. $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint);
  8859. $("#editEmrChiefComplaint").parent().parent().parent().css("display", "block");
  8860. } else {
  8861. $("#editEmrChiefComplaint").parent().parent().parent().css("display", "none");
  8862. }
  8863. if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
  8864. $("#editEmrHpi").val(mzBlRecord.emrHpi);
  8865. $("#editEmrHpi").parent().parent().parent().css("display", "block");
  8866. } else {
  8867. $("#editEmrHpi").parent().parent().parent().css("display", "none");
  8868. }
  8869. if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
  8870. $("#editEmrPs").val(mzBlRecord.emrPs);
  8871. $("#editEmrPs").parent().parent().parent().css("display", "block");
  8872. } else {
  8873. $("#editEmrPs").parent().parent().parent().css("display", "none");
  8874. }
  8875. if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
  8876. $("#editPersonalHistory").val(mzBlRecord.personalHistory);
  8877. $("#editPersonalHistory").parent().parent().parent().css("display", "block");
  8878. } else {
  8879. $("#editPersonalHistory").parent().parent().parent().css("display", "none");
  8880. }
  8881. if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
  8882. $("#editFamilyHistory").val(mzBlRecord.familyHistory);
  8883. $("#editFamilyHistory").parent().parent().parent().css("display", "block");
  8884. } else {
  8885. $("#editFamilyHistory").parent().parent().parent().css("display", "none");
  8886. }
  8887. if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
  8888. $("#editObstericalHistory").val(mzBlRecord.obstericalHistory);
  8889. $("#editObstericalHistory").parent().parent().parent().css("display", "block");
  8890. } else {
  8891. $("#editObstericalHistory").parent().parent().parent().css("display", "none");
  8892. }
  8893. var tz = getTz(mzBlRecord);
  8894. if (tz != null && tz != "") {
  8895. $("#editTgjc").val(tz);
  8896. $("#editTgjc").parent().parent().parent().css("display", "block");
  8897. } else {
  8898. $("#editTgjc").parent().parent().parent().css("display", "none");
  8899. }
  8900. if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
  8901. $("#editQtjc").val(mzBlRecord.emrPe);
  8902. $("#editQtjc").parent().parent().parent().css("display", "block");
  8903. } else {
  8904. $("#editQtjc").parent().parent().parent().css("display", "none");
  8905. }
  8906. if (res.icdText != null && res.icdText != "") {
  8907. $("#editZd").val(res.icdText);
  8908. $("#editZd").parent().parent().parent().css("display", "block");
  8909. } else {
  8910. $("#editZd").parent().parent().parent().css("display", "none");
  8911. }
  8912. if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
  8913. var reg = new RegExp("</br>", "g");//g,表示全部替换。
  8914. var editEmrProcess = mzBlRecord.emrProcess.replace(reg, "\n");
  8915. reg = new RegExp("&nbsp;", "g");//g,表示全部替换。
  8916. editEmrProcess = editEmrProcess.replace(reg, "");
  8917. $("#editEmrProcess").val(editEmrProcess);
  8918. $("#editEmrProcess").parent().parent().parent().css("display", "block");
  8919. } else {
  8920. $("#editEmrProcess").parent().parent().parent().css("display", "none");
  8921. }
  8922. if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "" && mzBlRecord.emrJkjy != "无") {
  8923. $("#editEmrJkjy").val(mzBlRecord.emrJkjy);
  8924. $("#editEmrJkjy").parent().parent().parent().css("display", "block");
  8925. } else {
  8926. $("#editEmrJkjy").parent().parent().parent().css("display", "none");
  8927. }
  8928. if (type == 1) {
  8929. $("#mzBlRecorTitle").html("门诊病历【编辑】");
  8930. $("#setOtherEmrProcess").removeClass("in").addClass("hide");
  8931. $("#openBlRecordModel").removeClass("hide").addClass("in");
  8932. $("#setEmrProcess").removeClass("hide").addClass("in");
  8933. $("#newEmrProcessDiv").removeClass("hide").addClass("in");
  8934. $("#visitingDetailModal").modal("hide");
  8935. } else if (type == 2) {
  8936. $("#mzBlRecorTitle").html("门诊病历【预览】");
  8937. $("#setOtherEmrProcess").removeClass("hide").addClass("in");
  8938. $("#openBlRecordModel").removeClass("in").addClass("hide");
  8939. $("#setEmrProcess").removeClass("in").addClass("hide");
  8940. $("#newEmrProcessDiv").removeClass("in").addClass("hide");
  8941. //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
  8942. if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
  8943. $("#baseMzBlTimes").val($("#mzBlTimes").val());
  8944. }
  8945. $("#otherBlRecordModal").modal("hide");
  8946. }
  8947. $("#mzBlTimes").val(mzBlRecord.times);
  8948. $("#editMzBlRecordModal").modal();
  8949. } else {
  8950. errorMesage(res);
  8951. }
  8952. }
  8953. });
  8954. }
  8955. /**
  8956. * 清空区域
  8957. */
  8958. function clearInput() {
  8959. //编辑病历的时候,没有基础病历的就诊次数,如果是预览病历的时候,有基础病历的次数
  8960. var baseMzBlTimes = $("#baseMzBlTimes").val();
  8961. $("#editPatientId").text(null);
  8962. $("#editPatientName").text(null);
  8963. $("#editPatientGender").text(null);
  8964. $("#editPatientAge").text(null);
  8965. $("#editEmrChiefComplaint").val(null);
  8966. $("#editEmrHpi").val(null);
  8967. $("#editEmrPs").val(null);
  8968. $("#editPersonalHistory").val(null);
  8969. $("#editFamilyHistory").val(null);
  8970. $("#editObstericalHistory").val(null);
  8971. $("#editTgjc").val(null);
  8972. $("#editQtjc").val(null);
  8973. $("#editZd").val(null);
  8974. $("#editEmrProcess").val(null);
  8975. $("#editEmrJkjy").val(null);
  8976. $("#newEmrProcess").val(null);
  8977. $("#mzBlTimes").val(null);
  8978. if (baseMzBlTimes != null && baseMzBlTimes != "") {
  8979. $("#otherBlRecordModal").modal();
  8980. }
  8981. }
  8982. /**
  8983. * 保存门诊病历
  8984. */
  8985. function setEmrProcess() {
  8986. $("#editMzBlRecordModal").modal("hide");
  8987. $("#messageModal").modal();
  8988. $("#messageContent").html("是否保存并替换已有补充处理意见?");
  8989. $("#messageButton").off("click").on("click", function (t) {
  8990. if ($("#newEmrProcess").val() == null || $("#newEmrProcess").val() == "") {
  8991. $("#messageContent").html("当前录入的补充处理为空,是否保存并替换已有补充处理意见?");
  8992. $("#messageButton").off("click").on("click", function (t) {
  8993. $("#messageModal").modal("hide");
  8994. sendEmrProcess();
  8995. });
  8996. } else {
  8997. $("#messageModal").modal("hide");
  8998. sendEmrProcess();
  8999. }
  9000. });
  9001. $("#cancelButton").off("click").on("click", function (t) {
  9002. $("#editMzBlRecordModal").modal();
  9003. });
  9004. }
  9005. /**
  9006. * 提交保存门诊病历
  9007. */
  9008. function sendEmrProcess() {
  9009. $.ajax({
  9010. type: "POST",
  9011. url: '/thmz/setEmrProcess',
  9012. contentType: "application/json;charset=UTF-8",
  9013. dataType: "json",
  9014. data: JSON.stringify({
  9015. "patientId": $("#editPatientId").text(),
  9016. "times": $("#mzBlTimes").val(),
  9017. "emrChiefComplaint": $("#editEmrChiefComplaint").val(),
  9018. "emrHpi": $("#editEmrHpi").val(),
  9019. "emrPs": $("#editEmrPs").val(),
  9020. "personalHistory": $("#editPersonalHistory").val(),
  9021. "familyHistory": $("#editFamilyHistory").val(),
  9022. "obstericalHistory": $("#editObstericalHistory").val(),
  9023. "emrJkjy": $("#editEmrJkjy").val(),
  9024. "emrProcess": $("#newEmrProcess").val()
  9025. }),
  9026. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9027. success: function (res) {
  9028. if (res == '401' || res == 401) {
  9029. window.location.href = '/thmz/login/view'
  9030. return;
  9031. }
  9032. if (res.code == 0) {
  9033. clearInput();
  9034. successMesage(res);
  9035. $("#editMzBlRecordModal").modal("hide");
  9036. } else {
  9037. errorMesage(res);
  9038. }
  9039. }
  9040. });
  9041. }
  9042. /**
  9043. * 打开待合并病历列表弹框
  9044. */
  9045. function openBlRecordModel() {
  9046. $("#editMzBlRecordModal").modal("hide");
  9047. $("#otherBlRecordModal").modal();
  9048. initOtherMzBlRecordList();
  9049. }
  9050. /**
  9051. * 关闭待合并病历列表
  9052. */
  9053. function closeBlRecordModel() {
  9054. $('#baseMzBlTimes').val(null);
  9055. $("#visitingDetailModal").modal();
  9056. }
  9057. /**
  9058. * 病历列表
  9059. */
  9060. function initOtherMzBlRecordList() {
  9061. $('#other_bl_record_table').bootstrapTable("destroy");
  9062. $('#other_bl_record_table').bootstrapTable({
  9063. url: '/thmz/getMzBlRecordList', //请求后台的URL(*)
  9064. method: 'post', //请求方式(*)
  9065. toolbar: '#toolbar', //工具按钮用哪个容器
  9066. striped: true, //是否显示行间隔色
  9067. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  9068. pagination: true, //是否显示分页(*)
  9069. sortable: true, //是否启用排序
  9070. sortOrder: "desc", //排序方式
  9071. queryParams: queryOtherParams, //传递参数(*)
  9072. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  9073. pageNumber: 1, //初始化加载第一页,默认第一页
  9074. pageSize: 5, //每页的记录行数(*)
  9075. pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
  9076. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  9077. strictSearch: true,
  9078. showColumns: false, //是否显示所有的列
  9079. showRefresh: false, //是否显示刷新按钮
  9080. minimumCountColumns: 2, //最少允许的列数
  9081. clickToSelect: true, //是否启用点击选中行
  9082. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  9083. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  9084. cardView: false, //是否显示详细视图
  9085. detailView: false,
  9086. //rowStyle:rowStyle,//通过自定义函数设置行样式
  9087. ajaxOptions: {
  9088. headers: {
  9089. 'Accept': 'application/json',
  9090. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  9091. }
  9092. },
  9093. columns: [
  9094. {
  9095. title: '操作',
  9096. field: 'op',
  9097. align: "center",
  9098. valign: 'middle',
  9099. formatter: function (value, row, index) {
  9100. var str = '<button type="button" class="btn btn-primary btn-sm" onclick="showMzBlRecordModal(\'' + row.patientId + '\',' + row.times + ',2)">预览<i class="fa fa-edit" style="margin-left: 10px;"></i></button>';
  9101. return [str].join('');
  9102. }
  9103. },
  9104. {
  9105. field: 'patientId',
  9106. title: '门诊ID',
  9107. align: "center",
  9108. valign: 'middle'
  9109. }, {
  9110. field: 'patientName',
  9111. title: '患者姓名',
  9112. align: "center",
  9113. valign: 'middle'
  9114. }, {
  9115. field: 'deptCode',
  9116. title: '就诊科室',
  9117. align: "center",
  9118. valign: 'middle'
  9119. }, {
  9120. field: 'doctorCode',
  9121. title: '接诊医师',
  9122. align: "center",
  9123. valign: 'middle'
  9124. }, {
  9125. field: 'firstOrNot',
  9126. title: '初/复诊',
  9127. align: "center",
  9128. valign: 'middle',
  9129. formatter: function (value, row, index) {
  9130. if (value == '1') {
  9131. return "复诊";
  9132. }
  9133. return "初诊";
  9134. }
  9135. }
  9136. , {
  9137. field: 'visitDate',
  9138. title: '就诊时间',
  9139. align: "center",
  9140. valign: 'middle',
  9141. formatter: function (value, row, index) {
  9142. if (value == null || value == "") {
  9143. return "";
  9144. }
  9145. return format(value, "yyyy-MM-dd HH:mm:ss");
  9146. }
  9147. }
  9148. ],
  9149. responseHandler: function (res) {
  9150. if (res == '401' || res == 401) {
  9151. window.location.href = '/thmz/login/view'
  9152. return;
  9153. }
  9154. var ress = eval(res);
  9155. if (ress.code == -1) {
  9156. if (ress.message != null && ress.message != '') {
  9157. errorMesage(ress);
  9158. }
  9159. return {
  9160. "total": 0,//总页数
  9161. "rows": {} //数据
  9162. };
  9163. }
  9164. return {
  9165. "total": ress.total,//总页数
  9166. "rows": ress.data //数据
  9167. };
  9168. },
  9169. });
  9170. }
  9171. /**
  9172. * 构建列表查询参数
  9173. * @param params
  9174. * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  9175. */
  9176. function queryOtherParams(params) {
  9177. var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
  9178. patientId: $("#editPatientId").text(),
  9179. exceptTimes: $("#mzBlTimes").val(),
  9180. pageSize: params.limit, //页面大小
  9181. pageIndex: params.offset / params.limit, //页码
  9182. };
  9183. return temp;
  9184. }
  9185. /**
  9186. * 提取处理意见保存
  9187. */
  9188. function setOtherEmrProcess() {
  9189. $("#editMzBlRecordModal").modal("hide");
  9190. $("#messageModal").modal();
  9191. $("#messageContent").html("确定要执行此次提取处理意见操作吗?");
  9192. $("#messageButton").off("click").on("click", function (t) {
  9193. $("#messageModal").modal("hide");
  9194. $.ajax({
  9195. type: "GET",
  9196. url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val() + '&times=' + $("#mzBlTimes").val(),
  9197. contentType: "application/json;charset=UTF-8",
  9198. dataType: "json",
  9199. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9200. success: function (res) {
  9201. if (res == '401' || res == 401) {
  9202. window.location.href = '/thmz/login/view'
  9203. return;
  9204. }
  9205. if (res.code == 0) {
  9206. successMesage(res);
  9207. $("#editMzBlRecordModal").modal("hide");
  9208. } else {
  9209. errorMesage(res);
  9210. }
  9211. }
  9212. });
  9213. });
  9214. $("#cancelButton").off("click").on("click", function (t) {
  9215. $("#editMzBlRecordModal").modal();
  9216. });
  9217. }
  9218. /**
  9219. * 医保电子凭证读卡
  9220. */
  9221. function siReadCard() {
  9222. $.ajax({
  9223. type: "GET",
  9224. url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
  9225. contentType: "application/json;charset=UTF-8",
  9226. dataType: "json",
  9227. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9228. success: function (res) {
  9229. if (res == '401' || res == 401) {
  9230. window.location.href = '/thmz/login/view'
  9231. return;
  9232. }
  9233. //console.log(res);
  9234. if (res.code == 200) {
  9235. var data = JSON.parse(res.data);
  9236. queryUserInfoBySocialNoNotFillPatient('rapidAcceptsUserCardNo',""+data.data.idNo+"",queryUserInfoByCardNo,'rapidAcceptsModal');
  9237. } else {
  9238. errorMesage(res);
  9239. }
  9240. }
  9241. });
  9242. // window.open('ReadCard://'+prm, '_self')
  9243. }