12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590 |
- //@ sourceURL=clinic.js
- //判断病人列表是否在加载中,防止重复加载
- var msg_list_loading = false;
- //挂号卡片列表页面下标
- var pageIndex = 0;
- //药品使用方法,天数和频次的集合
- var groupIdMap = null;
- var LODOP; //声明为全局变量
- //默认打印机下标
- var printIndex = -1;
- // //上一個光标点击的元素ID
- var prevEleId = null;
- //打开检查检验报告的时候不知道哪个有报告,如果检查没有就自动打开检验,但是为了防止死循环,次数加到1就不在进行重试
- var retryCount = 0;
- $(function () {
- initGenderSelect();
- iniAdmissStatus();
- initListDeptSelect();
- initResponceTypeSelect();
- initTemplateTypeSelect();
- initTemplateKindTypeSelect('templateKindType');
- initZyClassTypeSelect();
- initInstructionSelect();
- setSelectSize();
- initCertificateTypeSelect();
- $('#editUserBirthDayGroup').datetimepicker({
- format: 'yyyy-mm-dd',
- language: 'zh-CN',
- minView: "month",
- });
- initDaterangepickerWithId('reportrange', "right");
- formatCheck();
- //数据校验
- init_validator();
- //初始频次下拉选
- initOrderFrequencys("orderFrequency", true);
- //初始用药方式下拉选
- initSupplyTypes();
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //加载已接诊患者列表
- loadClinicTableList();
- //每隔一分钟秒读加载候诊患者列表
- setInterval(function () {
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载已接诊患者列表 病人会缴费,需要刷新状态
- loadClinicTableList();
- }, 60000);
- //初始化快速接诊病人姓名栏事件
- initUserList();
- //初始化主诉弹出层
- initRecommendList();
- //卡号输入改变事件
- cardNoChange();
- /**
- * 患者信息修改
- */
- $("#saveEditUser").on("click", function (t) {
- modifyPatient();
- });
- // /**
- // * 保存入院证
- // */
- // $("#saveBeHospitalized").on("click", function (t) {
- // saveBeHospitalized();
- // });
- /**
- * 打印入院证
- */
- $("#printBeHospitalized").on("click", function (t) {
- modifyPatient();
- });
- //折叠按钮初始化
- $('.collapse-link').on('click', function () {
- var $BOX_PANEL = $(this).closest('.x_panel_mine'),
- $ICON = $(this).find('i'),
- $BOX_CONTENT = $BOX_PANEL.find('.x_content');
- // fix for some div with hardcoded fix class
- if ($BOX_PANEL.attr('style')) {
- $BOX_CONTENT.slideToggle(200, function () {
- $BOX_PANEL.removeAttr('style');
- });
- } else {
- $BOX_CONTENT.slideToggle(200);
- $BOX_PANEL.css('height', 'auto');
- }
- $ICON.toggleClass('fa-chevron-up fa-chevron-down');
- });
- /**
- * 接诊
- */
- $("#clinicalReception").on("click", function (t) {
- var patientIdDb = $("#patientIdDb").val();
- if (patientIdDb == null || patientIdDb == "") {
- errorMesageSimaple("当前未选择病人,无法接诊");
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzfzPatientOrderByPatientId?patientId=' + patientIdDb,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- if (res.data.length == 1) {
- //快速接诊的时候不知道分诊号
- clinicalReception(patientIdDb, res.data[0].serialNo);
- } else {
- $("#mzfzPatientOrderModal").modal();
- $("#mzfzPatientOrderTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- var roomCode = res.data[i].roomCode;
- if (roomCode == null || roomCode == "null") {
- roomCode = "";
- }
- $("<tr data-target='" + res.data[i].serialNo + "'><td>" + res.data[i].patientId + "</td><td>" + res.data[i].name + "</td><td>" + res.data[i].deptCode + "</td><td>" + res.data[i].doctorCode + "</td><td>" + roomCode + "</td></tr>").appendTo("#mzfzPatientOrderTable").bind('click', function () {
- $("#mzfzPatientOrderModal").modal("hide");
- clinicalReception(patientIdDb, $(this).attr("data-target"));
- });
- }
- }
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- } else {
- errorMesageSimaple("当前病人没有分诊信息");
- }
- } else if (res.code == 200) {
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- clinicalReception(patientIdDb, null);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- /**
- * 存为范本
- */
- $("#saveapidAccepts").on("click", function (t) {
- // var symptom = $("#symptom").val();
- // if (symptom == null || symptom == "") {
- // errorMesageSimaple("主诉不能为空!");
- // return;
- // }
- //var emrHpi = $("#emrHpi").val();
- // if (emrHpi == null || emrHpi == "") {
- // errorMesageSimaple("现病史不能为空!");
- // return;
- // }
- // var diagnoseValue = $("#diagnoseValue").val();
- // var tentativeDiagnosis = $("#tentativeDiagnosis").val();
- // if (diagnoseValue != null) {
- // var reg = new RegExp(',', "g")
- // diagnoseValue = diagnoseValue.replace(reg, '');
- // }
- // if ((diagnoseValue == null || diagnoseValue == "") && (tentativeDiagnosis == null || tentativeDiagnosis == "")) {
- // errorMesageSimaple("诊断和初步诊断不能同时为空!");
- // return;
- // }
- //关闭帮助框
- $("#treeButton").webuiPopover('hide');
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- $("#saveapidAcceptsModal").modal("show");
- });
- /**
- * 实例化智能问诊弹窗
- */
- // $("[data-toggle='popover']").popover();
- $("#box-arrow-left").popover({
- html: 'true',
- content: '<div id="smartAssistPopoverContent"></div>'
- });
- //初始化药品分组下拉选
- initGroupOrder();
- // 初始化用药天数下拉选
- initDayNum();
- //页面加载完成初始化西药处方
- //initNavTabs(0);
- //页面加载完成初始化住院处方
- //initNavTabs(3);
- //初始医生工作太配置
- initWorkspaceConfigForCurrent();
- initExecUnit();
- /**
- * 西药点击事件
- */
- $("#western_medicine_name").on("click", function (t) {
- var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#western_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0, null);
- });
- /**
- * 中药点击事件
- */
- $("#chinese_medicine_name").on("click", function (t) {
- var obj = $("#chineseMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#chinese_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#chinese_medicine_name').webuiPopover('show');
- loadYpList(1, null);
- });
- /**
- * 辅助检查、检验点击事件
- */
- $("#jcJyItem").on("click", function (t) {
- if ($("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
- $('#jcJyItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList(null);
- });
- /**
- * 诊疗点击事件
- */
- $("#zlItem").on("click", function (t) {
- if ($("#zlItemPopoverContent").parent().parent().parent().hasClass("in")) {
- $('#zlItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#zlItem').webuiPopover('show');
- loadZlItemList(null);
- });
- initYshPart();
- initJyZdSample();
- setTimeout(function () {
- getLodop();
- }, 800);
- //键盘监听回车键
- $(document).unbind("keyup").keyup(function (event) {
- var index = getIndex("bill_item_group");
- if (event.keyCode == 13) { //是否是回车
- var el = event.srcElement || event.target;
- var id = el.getAttribute("id");
- var current_code = null;
- if(index==0){
- current_code= $("#western_medicine_current_code").val();
- }else if(index==1){
- current_code= $("#chinese_medicine_current_code").val();
- }else if(index==2){
- current_code= $("#jcjy_current_code").val();
- }else if(index==3){
- current_code= $("#zl_current_code").val();
- }
- if (id == null || id == "") {
- id = el.getAttribute("data-id");
- }
- if (id == null || id == "") {
- var search = el.getAttribute("aria-label");
- if (search == "Search") {
- id = $(el).parent().parent().prev().attr("data-id");
- }
- }
- if (id != null && id != "") {
- //将当前点击的id记录下
- //prevEleId = id;
- } else if (prevEleId != null) {
- id = prevEleId;
- }
- //回车时,光标不在任何区域判断是不是在药品和诊疗开立区域
- if (id == null || id == "") {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- if (current_code != null && current_code != "") {
- //当前页面是西药保存页面,且有药品选中
- $("#supplyType").next().click();
- }
- } else if (index == 1) {
- //当前页面是中草药保存页面,且有药品选中
- } else if (index == 2) {
- if (current_code != null && current_code != "") {
- //当前页面是医技保存页面,且有选中
- if ($("#jyZdSampleDiv").hasClass('in')) {
- //此时是检验
- $("#jyZdSample").next().click();
- } else if ($("#yshPartDiv").hasClass('in')) {
- //说明现在是检查
- $("#yshPart").next().click();
- }
- }
- } else if (index == 3) {
- //诊疗
- $("#yshPart").next().click();
- return;
- } else if (index == 4) {
- //当前页面是住院保存页面
- $("#inpatientWardBeHospitalized").next().click();
- return;
- }
- }
- var customization = $("div.customization").not(".hide");
- // //回车时,光标不在任何区域,默认点击主诉
- // if (id == null || id == "") {
- // var eleId = $(customization[0]).attr("target-id");
- // $("#" + eleId).focus();
- // if (eleId == 'symptom') {
- // $("#" + eleId).click();
- // }
- // console.log("eleId=" + eleId);
- // } else
- if (id == 'symptom' || id == 'emrHpi' || id == 'emrPs' || id == 'personalHistory' || id == 'familyHistory' || id == 'obstericalHistory' || id == 'otherCheck' || id == 'diagnose' || id == 'tentativeDiagnosis') {
- console.log("1id=" + id);
- if (id != $(customization[customization.length - 1]).attr("target-id")) {
- var next = $("#" + id + "Flag").next();
- while ($(next).hasClass("foreclose") || $(next).hasClass("hide")) {
- next = $(next).next();
- }
- var eleId = $(next).attr("target-id");
- $("#" + eleId).focus();
- if (eleId == 'diagnose' || id == 'diagnose' || id == 'symptom') {
- $("#" + eleId).click();
- }
- console.log("1eleId=" + eleId);
- } else {
- var data_target = $("#symptom").attr("data-target");
- $("#" + data_target).find("a.close").click();
- data_target = $("#diagnose").attr("data-target");
- $("#" + data_target).find("a.close").click();
- if (index == 0) {
- $("#western_medicine_name").focus();
- } else if (index == 1) {
- $("#chinese_medicine_name").focus();
- } else if (index == 2) {
- $("#jcJyItem").focus();
- } else if (index == 3) {
- $("#zlItem").focus();
- } else if (index == 4) {
- $("#inpatientWardBeHospitalized").next().click();
- }
- }
- } else if (id == 'zy_drugWin') {
- $("#zyInstruction").next().click();
- } else if (id == 'zyInstruction') {
- var ariaExpanded = $("#zyInstruction").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#zyInstruction").next().click();
- }
- $("#saveChineseMedicine").click();
- $("#zyfs").focus();
- // saveMedicine(1);
- }
- // else if (id == 'saveChineseMedicine') {
- // $("input.zyfs").focus();
- // }
- else if (id == 'zyfs') {
- $("#zy_orderFrequency_1").next().click();
- } else if (id == 'zy_orderFrequency_1') {
- $("#useType_1").next().click();
- } else if (id == 'useType_1') {
- $("#cyJssm").next().click();
- } else if (id == 'cyJssm') {
- $("#zy_supplyType_1").next().click();
- } else if (id == 'zy_supplyType_1') {
- $("#chinese_medicine_name").focus();
- $("#chinese_medicine_name").click();
- } else if (id == 'supplyType') {
- $("#drugWinUnit").next().click();
- } else if (id == 'drugWinUnit') {
- $("#drugWin").focus();
- } else if (id == 'drugWin') {
- $("#dayNum").next().click();
- } else if (id == 'dayNum') {
- $("#orderFrequency").next().click();
- } else if (id == 'orderFrequency') {
- $("#gross").focus();
- } else if (id == 'gross') {
- $("#packUnit").next().click();
- } else if (id == 'packUnit') {
- $("#medicalAdvice").next().click();
- } else if (id == 'medicalAdvice') {
- var ariaExpanded = $("#medicalAdvice").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#medicalAdvice").next().click();
- }
- saveMedicine(0);
- $("#western_medicine_name").focus();
- } else if (id == 'saveWesternMedicine') {
- $("#western_medicine_name").focus();
- $("#western_medicine_name").click();
- }else if (id == 'jyZdSample' || id == 'yshPart') {
- $("#execUnit").next().click();
- } else if (id == 'execUnit') {
- var ariaExpanded = $("#execUnit").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#execUnit").next().click();
- }
- $("#remark").focus();
- } else if (id == 'remark') {
- saveJyJcItem(true);
- $("#jcJyItem").focus();
- }else if (id == 'chargeUnit') {
- $("#zlExecUnit").next().click();
- } else if (id == 'zlExecUnit') {
- var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#zlExecUnit").next().click();
- }
- $("#itemQuantity").focus();
- }else if(id == 'itemQuantity' ){
- $("#zlRemark").focus();
- }else if (id == 'zlRemark') {
- saveZlItem(true);
- $("#zlItem").focus();
- } else if (id == 'inpatientWardBeHospitalized') {
- $("#smallWardBeHospitalized").next().click();
- } else if (id == 'smallWardBeHospitalized') {
- $("#admissStatus").next().click();
- } else if (id == 'admissStatus') {
- saveZyReq(true);
- $("#zy_req_button").focus();
- } else if (id == 'western_medicine_name') {
- var webuiID = $("#western_medicine_name").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#tb_table_western_medicine").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_western_medicine").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- checkYpInfo(trData.code, trData.serial, trData.ypType, true);
- $("#western_medicine_name").click();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //已经选中药品,跳到用法
- $("#supplyType").next().click();
- } else {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- }
- }
- } else if (id == 'chinese_medicine_name') {
- var webuiID = $("#chinese_medicine_name").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#chinese_medicine_name").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#tb_table_chinese_medicine").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_chinese_medicine").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- checkZyInfo(trData.code, trData.serial, true);
- $("#chinese_medicine_name").click();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#chinese_medicine_name").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //已经选中药品,跳到剂量
- $("#zy_drugWin").next().click();
- } else {
- //药品查询框是空白的,打开查询框
- $("#chinese_medicine_name").click();
- }
- }
- } else if (id == 'jcJyItem') {
- var webuiID = $("#jcJyItem").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#jcJyItem").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#tb_table_jc_jy_item").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_jc_jy_item").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- $('#jcJyItem').webuiPopover('hide');
- $("#jcJyZltype").val(trData.type);
- $("#execUnit").selectpicker('val', trData.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (trData.type == 1) {
- //检验
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- if (trData.sampleCode != null && trData.sampleCode != "") {
- $("#jyZdSample").selectpicker('val', trData.sampleCode);
- $('#jyZdSample').selectpicker('refresh');
- }
- } else if (trData.type == 2) {
- //检查
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- if (trData.bwCode != null && trData.bwCode != "") {
- $("#yshPart").selectpicker('val', trData.bwCode);
- $('#yshPart').selectpicker('refresh');
- }
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- checkJcJyItemInfo(trData.code, trData.name, trData.type, true);
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#jcJyItem").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //如果是保存失败的,重新打开输入框查询
- if(prevEleId=='remark'){
- $("#jcJyItem").click();
- }else {
- //当前页面是医技保存页面,且有选中
- if ($("#jyZdSampleDiv").hasClass('in')) {
- //此时是检验
- $("#jyZdSample").next().click();
- } else if ($("#yshPartDiv").hasClass('in')) {
- //说明现在是检查
- $("#yshPart").next().click();
- }
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#jcJyItem").click();
- }
- }
- } else if (id == 'zlItem') {
- var webuiID = $("#zlItem").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#zlItem").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#tb_table_zl_item").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_zl_item").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- $('#zlItem').webuiPopover('hide');
- $("#zlExecUnit").selectpicker('val', trData.execUnit);//默认不选中
- $("#zlExecUnit").selectpicker('refresh');
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3);
- }
- $("#zlItem").val(trData.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(trData.chargeAmount);
- $("#chargeUnit").val(trData.specification);
- $("#zl_current_code").val(trData.code);
- $("#itemQuantity").val(1);
- $("#chargeUnit").focus();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#zlItem").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //如果是保存失败的,重新打开输入框查询
- if(prevEleId=='zlRemark'){
- $("#zlItem").click();
- }else {
- $("#chargeUnit").focus();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#zlItem").click();
- }
- }
- }else if (id == 'zy_req_button') {
- //当前页面是住院保存页面,此时光标在入院按钮上
- console.log("入院按钮")
- $("#inpatientWardBeHospitalized").next().click();
- }
- if (id != null && id != "") {
- //将当前点击的id记录下
- prevEleId = id;
- }
- }else if(event.keyCode == 37){
- // //左键事件
- // if(index==0){
- // return;
- // }
- // var prevObject=$("#bill_item_group").find("button")[index-1];
- // $(prevObject).click();
- }else if (event.keyCode == 38) {
- //上键事件
- var tableId = null;
- var inputId = null;
- var contentId = null;
- if (index == 0) {
- tableId = "tb_table_western_medicine";
- inputId = "western_medicine_name";
- contentId = "westernMedicinePopoverContent";
- } else if (index == 1) {
- tableId = "tb_table_chinese_medicine";
- inputId = "chinese_medicine_name";
- contentId = "chineseMedicinePopoverContent";
- } else if (index == 2) {
- tableId = "tb_table_jc_jy_item";
- inputId = "jcJyItem";
- contentId = "jcJyItemPopoverContent";
- } else if (index == 3) {
- tableId = "tb_table_zl_item";
- inputId = "zlItem";
- contentId = "zlItemPopoverContent";
- }
- if (inputId == null) {
- return;
- }
- var webuiID = $("#" + inputId).attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#" + tableId).find("tbody").find("tr.trhover");
- var prev = $(arr).prev();
- if (arr != undefined && arr != null && arr.length > 0) {
- if (prev != undefined && prev != null && prev.length > 0) {
- $(arr).removeClass("trhover");
- $(prev).addClass("trhover");
- var height = $(arr).css("height");
- $("#" + contentId).parent().animate({scrollTop: "-=" + height}, 100);
- }
- } else {
- var arrs = $("#" + tableId).find("tbody").find("tr");
- $(arrs[0]).addClass("trhover");
- var height = $(arrs[0]).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- }
- }else if(event.keyCode == 39){
- // //右键事件
- // if(index==4){
- // return;
- // }
- // var nextObject=$("#bill_item_group").find("button")[index+1];
- // $(nextObject).click();
- } else if (event.keyCode == 40) {
- //下键事件
- var tableId = null;
- var inputId = null;
- var contentId = null;
- if (index == 0) {
- tableId = "tb_table_western_medicine";
- inputId = "western_medicine_name";
- contentId = "westernMedicinePopoverContent";
- } else if (index == 1) {
- tableId = "tb_table_chinese_medicine";
- inputId = "chinese_medicine_name";
- contentId = "chineseMedicinePopoverContent";
- } else if (index == 2) {
- tableId = "tb_table_jc_jy_item";
- inputId = "jcJyItem";
- contentId = "jcJyItemPopoverContent";
- } else if (index == 3) {
- tableId = "tb_table_zl_item";
- inputId = "zlItem";
- contentId = "zlItemPopoverContent";
- }
- if (inputId == null) {
- return;
- }
- var webuiID = $("#" + inputId).attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in")) {
- var arr = $("#" + tableId).find("tbody").find("tr.trhover");
- var next = $(arr).next();
- if (arr != undefined && arr != null && arr.length > 0) {
- if (next != undefined && next != null && next.length > 0) {
- $(arr).removeClass("trhover");
- $(next).addClass("trhover");
- var height = $(arr).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- } else {
- var arrs = $("#" + tableId).find("tbody").find("tr");
- $(arrs[0]).addClass("trhover");
- var height = $(arrs[0]).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- }
- }
- });
- //打印检查检验报告单
- $('#btn_print').click(function () {
- printJyJcReport(1);
- });
- //打印设置检查检验报告单
- $('#btn_print_setup').click(function () {
- printJyJcReport(2);
- });
- /**
- * 医保电子凭证读卡
- */
- $("#siReadCard").on("click", function (t) {
- siReadCard();
- });
- });
- /**
- * 打开配置页面
- */
- function configWorkspaceModal() {
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("show");
- }
- /**
- * 初始化用药天数下拉选
- */
- function initDayNum() {
- var html = '';
- for (var i = 1; i <= 112; i++) {
- html += '<option value="' + i + '">' + i + '</option>';
- }
- $('#dayNum').html(html);
- $('#dayNum').selectpicker('refresh');
- }
- /**
- * 初始化药品分组下拉选
- */
- function initGroupOrder() {
- var html = '<option value="1">1</option>';
- $('#groupId').html(html);
- $('#groupId').selectpicker('refresh');
- $("#groupId").selectpicker('val', 1);
- $('#groupId').selectpicker('refresh');
- groupIdMap = new Map();
- }
- /**
- * 追加分组
- */
- function appendGroupOrder() {
- var last = parseInt($("#groupId > option:last").val());
- last++;
- var html = '<option value="' + last + '">' + last + '</option>';
- $('#groupId').append(html);
- $('#groupId').selectpicker('refresh');
- }
- /**
- * 组号改变事件
- */
- function groupIdChange() {
- var last = parseInt($("#groupId > option:last").val());
- var groupId = $("#groupId").val();
- if (groupId == last) {
- //是新增药品清空药品输入区域
- var updateFlag = $("#western_medicine_update_flag").val();
- var currentCode = $("#western_medicine_current_code").val();
- //当前时新增药品,而且没有选择药品的时候,组号变更,清空区域
- if ((updateFlag == undefined || updateFlag == null || updateFlag == "false" || updateFlag == false) && (currentCode == null || currentCode == "")) {
- clearWesternMedicine(true);
- }
- } else {
- var map = groupIdMap.get(groupId);
- if (map != null) {
- var supplyType = map.get("supplyType");
- var orderFrequency = map.get("orderFrequency");
- var dayNum = map.get("dayNum");
- //用法编码
- $("#supplyType").selectpicker('val', supplyType);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").attr("disabled", "disabled");
- //天数
- $("#dayNum").selectpicker('val', dayNum);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").attr("disabled", "disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', orderFrequency);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").attr("disabled", "disabled");
- }
- }
- }
- /**
- * 关闭智能问诊弹框
- */
- function closePopover() {
- //$(".popover").popover('hide');
- $("#box-arrow-left").click();
- }
- /**
- * 加载智能问诊弹框内容
- */
- function contentMethod() {
- setTimeout(function () {
- $(".popover div.arrow").css("display", "none");
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (popoverId == undefined) {
- return;
- }
- var left = $("#" + popoverId).css("left");
- left = left.replace("px", "");
- left = parseInt(left);
- left = left + 55;
- $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
- $("#" + popoverId + " .popover-content").css("height", "100%");
- $("#smartAssistPopoverContent").css("height", "100%");
- var html = ' <div style="height: 24%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' <span id="patientHisData"></span>就医轨迹' +
- ' </button>' +
- ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
- ' </button>' +
- ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 23%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
- ' class="btn btn-primary">' +
- ' <span id="recommendType"></span>推荐' +
- ' </button>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
- ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 53%;padding-left: 15px;width: 100%;">' +
- ' <button type="button"' +
- ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' 医疗范本' +
- ' </button>' +
- ' <div class="item" style="width: 230px;height: 35px;float: right;line-height: 35px;margin-right: 40px;">' +
- ' <label class="control-label col-md-4 col-sm-4 col-xs-12" for="templateKindTypeForm">范文类型' +
- ' </label>' +
- ' <div class="col-md-8 col-sm-8 col-xs-12">' +
- ' <select class="form-control selectpicker show-tick" title="请选择" onchange="fitTemplateData()"' +
- ' id="templateKindTypeForm">' +
- ' </select>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;position: relative;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;" id="TemplateData">' +
- ' </form>' +
- ' </div>' +
- ' </div>';
- $("#smartAssistPopoverContent").html(html);
- initTemplateKindTypeSelect('templateKindTypeForm');
- fitPatientHisData();
- fitSymptomData();
- fitEmrHpiData();
- fitEmrPsData();
- fitDiagnoseData();
- fitTemplateData();
- }, 100);
- // setTimeout(function () {
- // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
- // },1000);
- }
- /**
- * 设置患者的就诊轨迹
- */
- function fitPatientHisData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- return;
- }
- var patientId = $("#patientId").text();
- if (patientId == null || patientId == "") {
- patientId = $("#userName").val();
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": patientId,
- //"clinicStatuses": [5, 6],
- "clinicStatuses": [6],
- "pageSize": 10000,
- "offset": 0,
- "beginDate": "2012-02-01 00:00:00",
- "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss"),
- "doctorCode": "-1"
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var icdText = data[i].icdText;
- if (icdText == null) {
- // continue;
- icdText = "空白诊断";
- }
- icdText = icdText.trim();
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div style="float: left;width: 172px;">';
- html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
- html += ' </div>';
- html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
- html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- var patientName = $("#patientName").text();
- if ((patientName == null || patientName == "") && res.mzPatientMi != null) {
- patientName = res.mzPatientMi.name;
- }
- $("#patientHisData").text(patientName + "的");
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- } else {
- $("#patientHisDataForm").html(html);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置主诉推荐
- */
- function fitSymptomData() {
- fitRecommendData(12);
- }
- /**
- * 设置现病史推荐
- */
- function fitEmrHpiData() {
- fitRecommendData(5);
- }
- /**
- * 设置既往史推荐
- */
- function fitEmrPsData() {
- fitRecommendData(6);
- }
- /**
- * 设置诊断推荐
- */
- function fitDiagnoseData() {
- fitRecommendData(13);
- }
- /**
- * 设置推荐通用方法
- */
- function fitRecommendData(paramsType) {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var inputId = "symptom";
- var text = "主诉";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史";
- } else if (paramsType == 13) {
- inputId = "diagnose";
- text = "诊断";
- }
- //光标不在现病史上
- if (document.activeElement.id != inputId) {
- return;
- }
- $("#recommendType").html(text);
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var paramsContent = data[i].paramsContent;
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
- html += paramsContent;
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;"';
- html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ',' + data[i].id + ')">';
- html += ' <img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#recommendForm").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置医疗范文方法
- */
- function fitTemplateData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;margin-left: 145px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplate?templateKindType=' + $("#templateKindTypeForm").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var template = data[i];
- var icdText=(template.icdText==null || template.icdText=="")?"无":template.icdText;
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div title="' + template.name + '"';
- html += ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">';
- html += template.name;
- html += ' </div>';
- html += ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"';
- html += ' title="' + template.icdText + '">诊断:<a';
- html += ' style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="medicalModelModal(' + template.id + ')">' + icdText + '</a>';
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(' + template.id + ')"><img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#TemplateData").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空快速接诊弹窗
- */
- function clearRapidAcceptsModal() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- }
- /**
- * 清空接诊台用户信息
- * @param flag 是否清空分诊流水哈 true 清空
- */
- function clearUser(flag) {
- $("#patientName").html("");
- $("#patientAge").html("");
- $("#patientGender").html("");
- $("#patientId").text(null);
- $("#editUser").css("display", "none");
- $("#clearUser").css("display", "none");
- $("#fetchSpcSlwinfo").css("display", "none");
- $("#patientPhone").html("");
- $("#patientPhoneLabel").hide();
- $("#patientResponseType").html("");
- $("#first").next().click();
- $("#patientHisData").text("");
- if (flag) {
- $("#mzfzSerialNoInClick").val(null);
- }
- }
- /**
- * 卡号输入改变事件
- */
- function cardNoChange() {
- if (window.ActiveXObject || "ActiveXObject" in window) {
- $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
- queryUserInfoByCardNo();
- });
- } else {
- $("#rapidAcceptsUserCardNo").on('input οninput', function () {
- queryUserInfoByCardNo();
- });
- }
- }
- /**
- * 刷新就诊列表
- */
- function refreshClinic() {
- loadInClinicTableList();
- loadClinicTableList();
- }
- /**
- * 加载已接诊患者列表
- */
- function loadClinicTableList() {
- //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
- loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
- }
- /**
- * 加载患者列表通用方法
- * @param id
- * @param queryParams
- */
- function loadCommonClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'patientName',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'opDay',
- title: '接诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.clinicStatus == 5) {
- return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- // return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- } else if (row.clinicStatus == 6) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',0)">详情</a>';
- } else if (row.clinicStatus == 7) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',1)">详情</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- if (id == "tb_table_clinic") {
- $("#ClinicNum").html(data.total);
- } else {
- $("#inClinicNum").html(data.total);
- }
- }
- });
- }
- /**
- * 得到查询的参数 接诊中
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsInClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [8]
- };
- return temp;
- };
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsClinic(params) {
- var rePortRangeArr = getRePortRangeArr();
- var temp = {
- beginDate: rePortRangeArr[0],
- endDate: rePortRangeArr[1],
- commonParams: $("#userName").val(),
- clinicStatuses: [5, 6, 7],
- pageSize: params.limit,
- offset: params.offset
- };
- return temp;
- };
- /**
- * 加载待诊患者列表方法
- */
- function loadUnClinicTableList() {
- loadCanClinicTableList("tb_table_un_clinic", queryParamsUnClinic);
- }
- /**
- * 加载接诊中患者列表方法
- */
- function loadInClinicTableList() {
- loadCanClinicTableList("tb_table_in_clinic", queryParamsInClinic);
- }
- /**
- * 加载待诊和接诊中患者列表通用方法方法
- */
- function loadCanClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'name',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'visitDate',
- title: '分诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.statusFlag == 0) {
- return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
- } else if (row.statusFlag == 8) {
- //TODO 继续接诊需要新方法
- return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">续诊</a> <a title="取消接诊" onclick="cancelClinic(\'' + row.patientId + '\',\'' + row.times + '\')" style="cursor: pointer">消诊</a>';
- } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
- return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a> <a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- $("#unClinicNum").html(data.total);
- }
- });
- }
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsUnClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [0, 1, 2, 3]
- };
- return temp;
- };
- /**
- * 通知叫号
- * @param serialNo
- */
- function clinicCallNumber(serialNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/clinicCallNumber?serialNo=' + serialNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 接诊方法
- * @param patientId 门诊id
- * @param serialNo 分诊流水号
- */
- function clinicalReception(patientId, serialNo) {
- var existPatientId = $("#patientId").text();
- if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
- $("#messageModal").modal();
- $("#messageContent").html("当前有病人正在接诊,是否切换?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- realClinicalReception(patientId, serialNo);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- clearWorkSpace();
- realClinicalReception(patientId, serialNo);
- });
- });
- $("#cancelButton").off("click");
- } else {
- realClinicalReception(patientId, serialNo);
- }
- }
- /**
- * 取消接诊
- * @param patientId
- */
- function cancelClinic(patientId, times) {
- $("#messageModal").modal();
- $("#messageContent").html("确认取消当前病人的接诊记录吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/cancelClinic?patientId=' + patientId + "×=" + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.length == 0) {
- return;
- }
- successMesage(res);
- if (times > 0) {
- loadUnClinicTableList();
- loadInClinicTableList();
- }
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- };
- /**
- * 设置当前接诊病人信息
- * @param mzPatientMi
- */
- function setMzPatientInfo(mzPatientMi) {
- $("#patientName").html(mzPatientMi.name);
- $("#patientAge").html(mzPatientMi.age);
- $("#patientGender").html(mzPatientMi.gender);
- $("#patientId").text(mzPatientMi.patientId);
- $("#editUser").css("display", "inline-block");
- $("#clearUser").css("display", "inline-block");
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
- $("#patientPhone").html(mzPatientMi.phoneNo);
- $("#patientPhoneLabel").show();
- } else {
- $("#patientPhoneLabel").hide();
- }
- $("#patientResponseType").html(mzPatientMi.responseTypeName);
- if (mzPatientMi.times == 1) {
- $("#first").next().click();
- } else {
- $("#not").next().click();
- }
- $("#patientHisData").text(mzPatientMi.name);
- fitPatientHisData();
- setTmResponseType(mzPatientMi.patientId);
- }
- /**
- * 判断是否是特门病人
- * @param patientId
- */
- function setTmResponseType(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#patientResponseType").html("特殊门诊");
- $("#fetchSpcSlwinfo").css("display", "inline-block");
- }
- }
- }
- });
- }
- /**
- * 特门详情
- * @param patientId
- */
- function fetchSpcSlwinfo() {
- var patientId = $("#patientId").text();
- $.ajax({
- type: "GET",
- url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#fetchSpcSlwinfoModal").modal();
- $("#fetchSpcSlwinfoTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- var begndate = res.data[i].begndate;
- if (begndate == null || begndate == "null") {
- begndate = "";
- }
- var enddate = res.data[i].enddate;
- if (enddate == null || enddate == "null") {
- enddate = "";
- }
- var opspDiseName = res.data[i].opspDiseName;
- if (opspDiseName == null || opspDiseName == "null") {
- opspDiseName = "";
- }
- var opspDiseCode = res.data[i].opspDiseCode;
- if (opspDiseCode == null || opspDiseCode == "null") {
- opspDiseCode = "";
- }
- var ideFixmedinsName = res.data[i].ideFixmedinsName;
- if (ideFixmedinsName == null || ideFixmedinsName == "null") {
- ideFixmedinsName = "";
- }
- $("<tr><td>" + begndate + "</td><td>" + enddate + "</td><td>" + opspDiseCode + "</td><td>" + opspDiseName + "</td><td>" + ideFixmedinsName + "</td></tr>").appendTo("#fetchSpcSlwinfoTable");
- // .bind('click', function () {
- // $("#fetchSpcSlwinfoModal").modal("hide");
- // clinicalReception(patientIdDb, $(this).attr("data-target"));
- // });
- }
- } else {
- errorMesage(res);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 真实的接诊方法
- * @param patientId
- * @param serialNo 分诊流水号
- */
- function realClinicalReception(patientId, serialNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- var mzPatientMi = res.data;
- setMzPatientInfo(mzPatientMi);
- $("#mzfzSerialNoInClick").val(serialNo);
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空工作台
- */
- function clearWorkSpace() {
- clearUser(true);
- clearWorkSpaceExcludeUser();
- }
- /**
- * 清空工作台除了用户信息
- */
- function clearWorkSpaceExcludeUser() {
- $("#symptom").val(null);
- $("#emrHpi").val(null);
- $("#emrPs").val(null);
- $("#personalHistory").val(null);
- $("#familyHistory").val(null);
- $("#obstericalHistory").val(null);
- $("#weight").val(null);
- $("#temperature").val(null);
- $("#sphygmus").val(null);
- $("#breathe").val(null);
- $("#pressure_high").val(null);
- $("#pressure_floor").val(null);
- $("#pressure_high_left").val(null);
- $("#pressure_floor_left").val(null);
- $("#tentativeDiagnosis").val(null);
- $("#otherCheck").val(null);
- $("#diagnoseValue").val(null);
- $("#diagnoseTags").html(null);
- $("#healthEducation").val(null);
- clearWesternMedicine(true);
- clearChineseMedicine();
- clearJyJcItem();
- clearZyReq();
- //initNavTabs(0);
- clearNavTabs(0);
- clearNavTabs(1);
- clearNavTabs(2);
- clearNavTabs(3);
- clearApidAcceptsModal();
- $("#totalAmount").text(0);
- }
- /**
- * 医疗范文详情预览
- * @param id
- */
- function medicalModelModal(id) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateById?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- $("#vmedicalModelName").text(res.data.name);
- $("#idTemplate").val(res.data.id);
- $("#zsTemplate").html(jsonData.mzBlRecord.emrChiefComplaint);
- $("#xbsTemplate").html(jsonData.mzBlRecord.emrHpi);
- var icdText = res.data.icdText;
- $("#zdTemplate").html("");
- $("#xyzlContent").html("");
- $("#zyzlContent").html("");
- $("#zlyjContent").html("");
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#zdTemplate").html(html);
- }
- var emrProcess = jsonData.mzBlRecord.emrProcess;
- if (emrProcess != null) {
- var xy = null;
- if (emrProcess.indexOf("西药治疗:") >= 0) {
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
- } else if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
- } else if (emrProcess.indexOf("诊疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
- } else {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
- }
- var arr = xy.split("_");
- if (arr != null && arr.length > 0) {
- var xyhtml = "";
- for (var i = 0; i < arr.length; i++) {
- xyhtml += "<div>";
- xyhtml += arr[i];
- xyhtml += "</div>";
- }
- $("#xyzlContent").html(xyhtml);
- $("#xyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#xyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#xyzlTitle").removeClass("in").addClass("hide");
- }
- var zy = null;
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
- } else if (emrProcess.indexOf("诊疗:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
- } else {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
- }
- var zyArr = zy.split("_");
- if (zyArr != null && zyArr.length > 0) {
- var zyhtml = "";
- for (var i = 1; i < zyArr.length; i++) {
- zyhtml += "<div>";
- zyhtml += zyArr[i];
- zyhtml += "</div>";
- }
- var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
- if (zyfs != null && zyfs != "") {
- zyhtml += " <div>";
- zyhtml += ' <div style="text-indent: 2em;">';
- zyhtml += ' <div>';
- zyhtml += 'x<span>';
- zyhtml += zyfs;
- zyhtml += '</span> 付</div></div></div>';
- }
- $("#zyzlContent").html(zyhtml);
- $("#zyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- }
- var jcjy = null;
- if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- if (emrProcess.indexOf("诊疗:") >= 0) {
- jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
- } else {
- jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
- }
- var jcjyArr = jcjy.split("_");
- if (jcjyArr != null && jcjyArr.length > 0) {
- var jcjyhtml = "";
- for (var i = 0; i < jcjyArr.length; i++) {
- jcjyhtml += "<div>";
- jcjyhtml += jcjyArr[i];
- jcjyhtml += "</div>";
- }
- $("#zlyjContent").html(jcjyhtml);
- $("#zlyjTitle").removeClass("hide").addClass("in");
- } else {
- $("#zlyjTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#zlyjTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("诊疗:") >= 0) {
- var zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
- var zlArr = zl.split("_");
- if (zlArr != null && zlArr.length > 0) {
- var zlhtml = "";
- for (var i = 0; i < zlArr.length; i++) {
- zlhtml += "<div>";
- zlhtml += zlArr[i];
- zlhtml += "</div>";
- }
- $("#zlContent").html(zlhtml);
- $("#zlTitle").removeClass("hide").addClass("in");
- } else {
- $("#zlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#zlTitle").removeClass("in").addClass("hide");
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- $("#medicalModelModal").modal();
- }
- /**
- * 诊疗项目回写
- * @param code
- * @param mzChargeDetail
- */
- function callBackZlDetail(code, mzChargeDetail) {
- //诊疗项目
- $.ajax({
- type: "GET",
- url: '/thmz/getZdChargeItemByCode?code=' + code,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //如果
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3);
- }
- $("#zlItem").val(res.data.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(res.data.chargeAmount);
- $("#chargeUnit").val(res.data.chargeUnit);
- $("#zl_current_code").val(res.data.code);
- $("#zlRemark").val(mzChargeDetail.instructionText);
- if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
- $("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
- $('#zlExecUnit').selectpicker('refresh');
- }
- $("#itemQuantity").val(mzChargeDetail.quantity);
- saveZlItem(false);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方回写
- * @param jsonData 处方数据
- * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
- */
- function editPrescription(jsonData, type) {
- var firstOrNot = jsonData.firstOrNot;
- var conciseRecordsFlagYlfw = $("#conciseRecordsYlfw").parent().hasClass("checked");
- var prescriptionSubsidiaryFlagYlfw = $("#prescriptionSubsidiaryYlfw").parent().hasClass("checked");
- var conciseRecordsFlagJzxq = $("#conciseRecordsJzxq").parent().hasClass("checked");
- var prescriptionSubsidiaryFlagJzxq = $("#prescriptionSubsidiaryJzxq").parent().hasClass("checked");
- if (firstOrNot == 0) {
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#not").next().click();
- }
- if (type == 0 || (type == 1 && conciseRecordsFlagYlfw == true) || (type == 2 && conciseRecordsFlagJzxq == true)) {
- $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
- $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
- $("#emrPs").val(jsonData.mzBlRecord.emrPs);
- $("#personalHistory").val(jsonData.mzBlRecord.personalHistory);
- $("#familyHistory").val(jsonData.mzBlRecord.familyHistory);
- $("#obstericalHistory").val(jsonData.mzBlRecord.obstericalHistory);
- if (jsonData.mzBlRecord.weight != null && jsonData.mzBlRecord.weight != 0) {
- $("#weight").val(jsonData.mzBlRecord.weight);
- } else {
- $("#weight").val("");
- }
- if (jsonData.mzBlRecord.temperature != null && jsonData.mzBlRecord.temperature != 0) {
- $("#temperature").val(jsonData.mzBlRecord.temperature);
- } else {
- $("#temperature").val("");
- }
- if (jsonData.mzBlRecord.sphygmus != null && jsonData.mzBlRecord.sphygmus != 0) {
- $("#sphygmus").val(jsonData.mzBlRecord.sphygmus);
- } else {
- $("#sphygmus").val("");
- }
- if (jsonData.mzBlRecord.breathe != null && jsonData.mzBlRecord.breathe != 0) {
- $("#breathe").val(jsonData.mzBlRecord.breathe);
- } else {
- $("#breathe").val("");
- }
- if (jsonData.mzBlRecord.pressureHigh != null && jsonData.mzBlRecord.pressureHigh != 0) {
- $("#pressure_high").val(jsonData.mzBlRecord.pressureHigh);
- } else {
- $("#pressure_high").val("");
- }
- if (jsonData.mzBlRecord.pressureFloor != null && jsonData.mzBlRecord.pressureFloor != 0) {
- $("#pressure_floor").val(jsonData.mzBlRecord.pressureFloor);
- } else {
- $("#pressure_floor").val("");
- }
- if (jsonData.mzBlRecord.pressureHighLeft != null && jsonData.mzBlRecord.pressureHighLeft != 0) {
- $("#pressure_high_left").val(jsonData.mzBlRecord.pressureHighLeft);
- } else {
- $("#pressure_high_left").val("");
- }
- if (jsonData.mzBlRecord.pressureFloorLeft != null && jsonData.mzBlRecord.pressureFloorLeft != 0) {
- $("#pressure_floor_left").val(jsonData.mzBlRecord.pressureFloorLeft);
- } else {
- $("#pressure_floor_left").val("");
- }
- $("#tentativeDiagnosis").val(jsonData.mzBlRecord.tentativeDiagnosis);
- $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
- var icdCode = jsonData.icdCode;
- var icdText = jsonData.icdText;
- var icdCodeArr = icdCode != null ? icdCode.split(",") : null;
- var icdTextArr = icdText != null ? icdText.split(",") : null;
- if (icdCodeArr != null && icdCodeArr.length > 0 && icdTextArr != null && icdTextArr.length > 0) {
- for (var i = 0; i < icdCodeArr.length; i++) {
- fitDiagnoseValue(icdTextArr[i], icdCodeArr[i]);
- }
- }
- $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
- }
- if (type == 0 || (type == 1 && prescriptionSubsidiaryFlagYlfw == true) || (type == 2 && prescriptionSubsidiaryFlagJzxq == true)) {
- var mzChargeDetailList = jsonData.mzChargeDetailList;
- var mzZyReq = jsonData.mzZyReq;
- //中药的公共参数是否已经设置了
- var hadSetZyFullParams = false;
- //西药,成药,医材,麻精,中药,诊疗
- if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
- for (var i = 0; i < mzChargeDetailList.length; i++) {
- var mzChargeDetail = mzChargeDetailList[i];
- var groupNo = mzChargeDetail.groupNo;
- var code = mzChargeDetail.chargeItemCode;
- var serial = mzChargeDetail.serial;
- if (groupNo == "00") {
- callBackZlDetail(code, mzChargeDetail);
- } else if (groupNo == "71" || groupNo == "91" || groupNo == "111" || groupNo == "131") {
- // 71 西成药 91 医材 111 精一 131 精二
- var groupOrder = mzChargeDetail.groupOrder;
- if (groupOrder == null || groupOrder == 'null' || groupOrder == "") {
- groupOrder = 1;
- }
- $("#groupId").selectpicker('val', groupOrder);
- $('#groupId').selectpicker('refresh');
- checkYpInfo(code, serial, groupNo, false);
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
- $('#supplyType').selectpicker('refresh');
- $("#drugWin").val(mzChargeDetail.drugQuan);
- $("#drugWinUnit").selectpicker('val', mzChargeDetail.drugUnit);
- $('#drugWinUnit').selectpicker('refresh');
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', mzChargeDetail.orderDays);
- $('#dayNum').selectpicker('refresh');
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', mzChargeDetail.frequency);
- $('#orderFrequency').selectpicker('refresh');
- if (mzChargeDetail.tryFlag == 1 || mzChargeDetail.tryFlag == "1") {
- $("#tryFlag").parent().addClass("checked");
- } else {
- $("#tryFlag").parent().removeClass("checked");
- }
- $("#gross").val(mzChargeDetail.quantity);
- $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()).toFixed(2));
- $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
- $('#medicalAdvice').selectpicker('refresh');
- saveWesternMedicine(false);
- $("#western_medicine_button").click();
- } else {
- //中药与颗粒剂
- checkZyInfo(code, serial, false);
- //类型
- $("#zyClassType").selectpicker('val', groupNo);
- $('#zyClassType').selectpicker('refresh');
- $("#zy_drugWin").val(mzChargeDetail.quantity);
- $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
- $('#zyInstruction').selectpicker('refresh');
- saveChineseMedicine(false);
- if (!hadSetZyFullParams) {
- hadSetZyFullParams = true;
- $("input.zyfs").val(mzChargeDetail.drugWin);
- $("#zy_orderFrequency_1").selectpicker('val', mzChargeDetail.frequency);
- $('#zy_orderFrequency_1').selectpicker('refresh');
- $("#useType_1").selectpicker('val', mzChargeDetail.cyFysm);
- $('#useType_1').selectpicker('refresh');
- $("#cyJssm").selectpicker('val', mzChargeDetail.cyJssm);
- $('#cyJssm').selectpicker('refresh');
- $("#zy_supplyType_1").selectpicker('val', mzChargeDetail.cyDj);
- $('#zy_supplyType_1').selectpicker('refresh');
- }
- $("#chinese_medicine_button").click();
- }
- }
- }
- //检验与检查
- var mzYjReqList = jsonData.mzYjReqList;
- if (mzYjReqList != null && mzYjReqList.length > 0) {
- for (var i = 0; i < mzYjReqList.length; i++) {
- var mzYjReq = mzYjReqList[i];
- var code = mzYjReq.orderCode;
- var jcJyZltype = null;
- if (mzYjReq.reqType == 2) {
- jcJyZltype = 1;
- $("#jyZdSample").selectpicker('val', mzYjReq.inspectStuff);
- $('#jyZdSample').selectpicker('refresh');
- } else if (mzYjReq.reqType == 3) {
- jcJyZltype = 2;
- $("#yshPart").selectpicker('val', mzYjReq.inspectPart);
- $('#yshPart').selectpicker('refresh');
- }
- $("#jcJyZltype").val(jcJyZltype);
- checkJcJyItemInfo(code, null, jcJyZltype, false);
- $("#remark").val(mzYjReq.jyRemark);
- if (mzYjReq.execDept != null && mzYjReq.execDept != "") {
- $("#execUnit").selectpicker('val', mzYjReq.execDept);
- $('#execUnit').selectpicker('refresh');
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- saveJyJcItem(false);
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- }
- $("#yj_req_button").click();
- }
- //入院证
- if (mzZyReq != null && mzZyReq.reqDept != null && mzZyReq.reqDept != "") {
- $("#inpatientWardBeHospitalized").selectpicker('val', mzZyReq.reqDept);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- $("#admissStatus").selectpicker('val', mzZyReq.admissStatus);
- $('#admissStatus').selectpicker('refresh');
- setTimeout(function () {
- $("#smallWardBeHospitalized").selectpicker('val', mzZyReq.smallDept);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- saveZyReq(false);
- }, 500);
- $("#zy_req_button").click();
- }
- }
- setTimeout(function () {
- //设置总金额 计算金额的时候,可能处方还没有回写完
- calculateTotalAmount();
- }, 1000);
- }
- /**
- * 调用医疗范文
- */
- function callTemplate() {
- clearWorkSpaceExcludeUser();
- $.ajax({
- type: "GET",
- url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- editPrescription(jsonData, 1);
- $("#templateId").val(res.data.id);
- $("#templateName").val(res.data.name);
- $("#templateKindType").selectpicker('val', res.data.templateKindType);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', res.data.templateType);
- $("#templateType").selectpicker('refresh');
- $("#medicalModelModal").modal("hide");
- closePopover();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 底层填充推荐方法
- * @param paramsType
- * @param appeal
- * @param inputId
- */
- function extracted(paramsType, appeal, inputId) {
- if (paramsType == 13) {
- var contentArr = appeal.split(",");
- if (contentArr != null && contentArr.length > 0) {
- for (var i = 0; i < contentArr.length; i++) {
- var content = contentArr[i].replace(")", "").replace("(", "-");
- var diagnoseArr = content.split("-");
- if (diagnoseArr == null || diagnoseArr.length == 0) {
- continue;
- }
- fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
- }
- }
- } else {
- $("#" + inputId).val(appeal);
- }
- }
- /**
- * 填充推荐
- * @param appeal
- * @param paramsType
- * @param id
- */
- function fitAppeal(appeal, paramsType, id) {
- var inputId = "symptom";
- var text = "主诉项已经录入,是否覆盖?";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史项已经录入,是否覆盖?";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史项已经录入,是否覆盖?";
- } else if (paramsType == 13) {
- inputId = "diagnoseValue";
- text = "诊断项已经录入,是否覆盖?";
- }
- var symptom = $("#" + inputId).val();
- if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
- symptom = null;
- }
- if (symptom != null && symptom != "") {
- $("#messageModal").modal();
- $("#messageContent").html(text);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- if (paramsType == 13) {
- $("#" + inputId).val(null);
- $("#diagnoseTags").html(null);
- }
- extracted(paramsType, appeal, inputId);
- });
- $("#cancelButton").off("click");
- } else {
- extracted(paramsType, appeal, inputId);
- }
- $.ajax({
- type: "GET",
- url: '/thmz/increaseTcCommonParamsNumber?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- }
- });
- }
- /**
- * 初始嘱托下拉选
- */
- function initInstructionSelect() {
- //西药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=0',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText + '</option>';
- $('#medicalAdvice').append(html);
- });
- $('#medicalAdvice').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- //中药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=1',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText.trim() + '</option>';
- $('#zyInstruction').append(html);
- });
- $('#zyInstruction').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置下拉选的尺寸
- */
- function setSelectSize() {
- $(".selectpicker").selectpicker({
- dropuAuto: false,
- size: 10
- });
- //$('#icdCodeBeHospitalized').parent().addClass("hide");
- }
- /**
- * 初始化性别下拉选
- */
- function initGenderSelect() {
- var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
- $('#rapidAcceptsUserGender').html(gender);
- $('#rapidAcceptsUserGender').selectpicker('refresh');
- $('#editUserGender').html(gender);
- $('#editUserGender').selectpicker('refresh');
- //医疗范文状态
- var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
- $('#templateStatus').html(templateStatus);
- $('#templateStatus').selectpicker('refresh');
- }
- /**
- * 初始化中药类型下拉选
- */
- function initZyClassTypeSelect() {
- var gender = '<option value="81">普通</option><option value="82">颗粒剂</option>';
- $('#zyClassType').html(gender);
- $('#zyClassType').selectpicker('refresh');
- //$('#zyClassType').selectpicker('val', "81");
- // $('#zyClassType').selectpicker('refresh');
- }
- /**
- * 初始化病人身份类别下拉选
- */
- function initResponceTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzResponceType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#patientsNature').append(html);
- $('#editUserPatientsNature').append(html);
- // $('#responeTypeBeHospitalized').append(html);
- });
- $('#patientsNature').selectpicker('refresh');
- $('#editUserPatientsNature').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 所有的入院状态
- */
- function iniAdmissStatus() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAdmissStatus',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#admissStatus').empty();
- $('#admissStatus').html(html);
- $('#admissStatus').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 入院登记的病区列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allInpatientWard',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#inpatientWardBeHospitalized').empty();
- $('#inpatientWardBeHospitalized').html(html);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- }
- });
- }
- /**
- * 小科室列表
- */
- function initSmallDeptByDept() {
- //小科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getSmallDeptByDept?code=' + $('#inpatientWardBeHospitalized').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#smallWardBeHospitalized').empty();
- $('#smallWardBeHospitalized').html(html);
- $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- }
- });
- //病床数
- $.ajax({
- type: "GET",
- url: '/thmz/getBedStatusNumByDept?code=' + $('#inpatientWardBeHospitalized').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var data = res.data;
- if (data == null) {
- $("#totalBedNum").val(0);
- $("#freeBedNum").val(0);
- $("#occupationBedNum").val(0);
- } else {
- $("#totalBedNum").val(data.total);
- $("#freeBedNum").val(data.free);
- $("#occupationBedNum").val(data.occupation);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- //
- // /**
- // * 初始化诊断下拉选
- // */
- // function initIcdSelect() {
- // var icdCodeInputBeHospitalized = $("#icdCodeInputBeHospitalized").val()
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + icdCodeInputBeHospitalized + '&pageSize=100',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // var html = '';
- // if (res.code == 0) {
- // if (res.data != null && res.data.length > 0) {
- // var html = '';
- // for (var i = 0; i < res.data.length; i++) {
- // html += '<option value="' + res.data[i].paramsCode + '">' + res.data[i].paramsName + '(' + res.data[i].paramsCode + ')</option>';
- // }
- // $('#icdCodeBeHospitalized').empty();
- // $('#icdCodeBeHospitalized').html(html);
- // $('#icdCodeBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- // $('#icdCodeBeHospitalized').parent().addClass("open");
- // $('#icdCodeBeHospitalized').next().addClass("hide");
- // $('#icdCodeBeHospitalized').next().next().css("margin-top", "-34px");
- // }
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 设置诊断内容
- // */
- // function setIcdText() {
- // var icdCodeBeHospitalized = $('#icdCodeBeHospitalized option:selected').text();
- // if (icdCodeBeHospitalized != null) {
- // var icdText = icdCodeBeHospitalized.substring(0, icdCodeBeHospitalized.indexOf("("));
- // $("#icdTextBeHospitalized").val(icdText);
- // $("#icdCodeInputBeHospitalized").val($('#icdCodeBeHospitalized').val());
- // $("#icdTextBeHospitalized").attr("title", icdText);
- // } else {
- // $("#icdTextBeHospitalized").val("");
- // $("#icdCodeInputBeHospitalized").val("");
- // $("#icdTextBeHospitalized").attr("title", "");
- // }
- // $('#icdCodeBeHospitalized').parent().addClass("hide");
- // }
- /**
- * 初始化医疗范文范围下拉选
- */
- function initTemplateTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#templateType').append(html);
- });
- $('#templateType').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化医疗范文类型下拉选
- * @param templateKindTypeId
- */
- function initTemplateKindTypeSelect(templateKindTypeId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateKindTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#' + templateKindTypeId).append(html);
- });
- $('#' + templateKindTypeId).selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始用药方式下拉选
- */
- function initSupplyTypes() {
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.supplyOcc === "71") {
- html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
- }
- });
- $('#supplyType').empty();
- $('#supplyType').html(html);
- $('#supplyType').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始煎药方式下拉选
- * @param async 是否是异步 true 异步 false 同步
- */
- function initZySupplyTypes(id, async) {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.supplyOcc === "81") {
- // html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
- }
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始查检查部位
- */
- function initYshPart() {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getYshPart',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#yshPart').empty();
- $('#yshPart').html(html);
- $('#yshPart').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化验物下拉选
- */
- function initJyZdSample() {
- setSelectSize();
- $.ajax({
- type: "GET",
- url: '/thmz/getJyZdSample',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#jyZdSample').empty();
- $('#jyZdSample').html(html);
- $('#jyZdSample').selectpicker('refresh');
- }
- });
- }
- /**
- * 保存当前药品到右边处方区域
- * @param index 0 西药 1中药 2 诊疗和社备
- */
- function saveMedicine(index) {
- if (index == 0) {
- // //每个处方不能超过5个药品
- // var tableId = $("#xyTab li.active").find("a").attr("href");
- // var childrens = $(tableId).find("div:eq(0)").children().length;
- // if (childrens === 5) {
- // $("#messageModal").modal();
- // $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- // $("#messageButton").off("click").on("click", function (t) {
- // $("#messageModal").modal("hide");
- // refreshNavTabs(index);
- // saveWesternMedicine();
- // });
- // } else {
- // saveWesternMedicine();
- // }
- saveWesternMedicine(true);
- } else if (index == 1) {
- saveChineseMedicine(true);
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveWesternMedicine(calculateTotalAmountFlag) {
- //组号
- var groupId = $("#groupId").val();
- //药品名称
- var westernMedicineNamme = $("#western_medicine_name").val();
- //当前药品编码
- var currentCode = $("#western_medicine_current_code").val();
- //当前药品规格
- var currentSerial = $("#western_medicine_current_serial").val();
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- //用法编码
- var supplyType = $("#supplyType").val();
- //用法描述
- var supplyTypeText = $('#supplyType option:selected').text();
- supplyTypeText = supplyTypeText.substring(0, supplyTypeText.indexOf("["));
- //药品默认单次使用剂量
- var drugWinDb = $("#drugWinDb").val();
- //处方实际单次使用剂量
- var drugWin = $("#drugWin").val();
- //剂量单位
- var drugWinUnit = $('#drugWinUnit option:selected').text();
- //drugWinUnit = drugWinUnit.substring(0, drugWinUnit.indexOf("("));
- //天数
- var dayNum = $("#dayNum").val();
- //频次编码
- var orderFrequency = $("#orderFrequency").val();
- //频次描述
- var orderFrequencyText = $('#orderFrequency option:selected').text();
- orderFrequencyText = orderFrequencyText.substring(0, orderFrequencyText.indexOf("("));
- //总量
- var gross = $("#gross").val();
- //包装单位
- var packUnit = $("#packUnit").val();
- if (packUnit == null) {
- packUnit = "";
- }
- //医嘱码
- var medicalAdvice = $("#medicalAdvice").val();
- //医嘱内容
- var medicalAdviceText = $('#medicalAdvice option:selected').text();
- medicalAdviceText = medicalAdviceText.substring(0, medicalAdviceText.indexOf("("));
- //金额
- var totalRetprice = parseFloat($("#totalRetprice").val());
- //单价
- var packRetprice = $("#packRetprice").val();
- //皮试
- var tryFlag = $("#tryFlag").parent().hasClass("checked");
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- if (currentGroupNo != '91') {
- if (supplyType == null || supplyType == "") {
- errorMesageSimaple("用法为空!");
- return;
- }
- if (drugWin == null || drugWin == "") {
- errorMesageSimaple("剂量为空!");
- return;
- }
- if (dayNum == null || dayNum == "") {
- errorMesageSimaple("天数为空!");
- return;
- }
- if (orderFrequency == null || orderFrequency == "") {
- errorMesageSimaple("频次为空!");
- return;
- }
- }
- if (gross == null || gross == "") {
- errorMesageSimaple("总量为空!");
- return;
- }
- var manufactoryName = $("#manufactoryName").val();
- var html = '<div class="form-group">';
- html += groupId + '.<span style="margin-left: 5px"></span>';
- html += westernMedicineNamme;
- if (manufactoryName != null && manufactoryName != 'null' && manufactoryName != "") {
- html += "(" + manufactoryName + ")"
- }
- html += ' ';
- html += $("#specification").val();
- html += ' X ';
- //html += drugWinDb + drugWinUnit + ' 共';
- html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
- html += '用法:' + supplyTypeText + ' ';
- html += drugWin + drugWinUnit + ' ';
- html += '频次:' + orderFrequencyText + ' ';
- html += dayNum + '天 ';
- if (tryFlag == "true" || tryFlag == true) {
- html += '皮试 ';
- }
- if (medicalAdvice != null && medicalAdvice != '') {
- html += '医嘱:' + medicalAdviceText;
- }
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="editWesternMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(0,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
- html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
- html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
- html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
- html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
- html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
- html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdviceText" value="' + medicalAdviceText + '"/>';
- html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_tryFlag" value="' + tryFlag + '"/>';
- html += '</div>';
- var tableId = $("#xyTab li.active").find("a").attr("href");
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#western_medicine_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- // //原药品金额 如果是修改则需要设置
- // var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
- //temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- } else {
- //因为药品可以换组号,要保证相同组号的在一起
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
- //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
- if (temporaryItemsGroupId > groupId) {
- nextObj = $(formGroups[i]);
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
- var groupIdLast = $("#groupId option:last-child").text();
- if (groupId === groupIdLast) {
- appendGroupOrder();
- }
- //设置药品的用法,频次,天数
- var map = groupIdMap.get(groupId);
- if (map == null) {
- map = new Map();
- map.put("supplyType", supplyType);
- map.put("orderFrequency", orderFrequency);
- map.put("dayNum", dayNum);
- groupIdMap.put(groupId, map);
- }
- //设置当前药品的品类
- $(tableId).find("input.current_groupNo").val($("#current_groupNo").val());
- clearWesternMedicine(false);
- }
- /**
- * 上移
- * @param obj
- */
- function arrowUp(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).prev() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //前一个兄弟节点的序号
- var prevJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- prevJcjyItemGroupId = $(parentObject).prev().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
- $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).prev().before($(parentObject));
- }
- /**
- * 下移
- * @param obj
- */
- function arrowDown(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).next() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //后一个兄弟节点的序号
- var afterJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- afterJcjyItemGroupId = $(parentObject).after().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
- $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).next().after($(parentObject));
- }
- /**
- * 修改西药
- * @param obj
- */
- function editWesternMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#western_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //组号
- $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
- $('#groupId').selectpicker('refresh');
- //药品名称
- $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
- var code = $(parentObject).find("input.temporary_items_code").val();
- var serial = $(parentObject).find("input.temporary_items_serial").val();
- //当前药品编码
- $("#western_medicine_current_code").val(code);
- //当前药品规格
- $("#western_medicine_current_serial").val(serial);
- //用法编码
- $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
- $('#supplyType').selectpicker('refresh');
- //药品默认单次使用剂量
- $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
- //处方实际单次使用剂量
- $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //天数
- $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
- $('#dayNum').selectpicker('refresh');
- //频次编码
- $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
- $('#orderFrequency').selectpicker('refresh');
- //总量
- $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
- //医嘱
- $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
- $('#medicalAdvice').selectpicker('refresh');
- //金额
- $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
- //单价
- $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
- //皮试
- var tryFlag = $(parentObject).find("input.temporary_items_tryFlag").val();
- if (tryFlag == true || tryFlag == "true") {
- $("#tryFlag").parent().addClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- var drugWinHtml = '';
- if (res.data.weight != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- }
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- //剂量单位
- $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- //包装单位
- $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
- $('#packUnit').selectpicker('refresh');
- }
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- } else {
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 修改中药
- * @param obj
- */
- function editChineseMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#chinese_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前药品编码
- $("#chinese_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前药品规格
- $("#chinese_medicine_current_serial").val($(parentObject).find("input.temporary_items_serial").val());
- //中药类型
- $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
- $('#zyClassType').selectpicker('refresh');
- //药品名称
- $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
- //单价
- $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
- //处方实际单次使用剂量
- $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //医嘱码
- $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
- $('#zyInstruction').selectpicker('refresh');
- }
- /**
- * 修改辅助检查、检验项目
- * @param obj
- */
- function editJyJcItem(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#jcjy_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#jcjy_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //项目名称
- $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
- //单价
- $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
- //备注
- $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
- var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
- var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
- //执行科室
- var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
- $("#execUnit").selectpicker('val', execUnit);
- $('#execUnit').selectpicker('refresh');
- if (jcJyZltype == 1 || jcJyZltype == "1") {
- $("#jyZdSample").selectpicker('val', chargeUnit);
- $('#jyZdSample').selectpicker('refresh');
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- } else if (jcJyZltype == 2 || jcJyZltype == "2") {
- $("#yshPart").selectpicker('val', chargeUnit);
- $('#yshPart').selectpicker('refresh');
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- }
- $("#jcJyZltype").val(jcJyZltype);
- }
- /**
- * 修改诊疗项目
- * @param obj
- */
- function editZlItem(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#zl_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#zl_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //项目名称
- $("#zlItem").val($(parentObject).find("input.temporary_items_zlItemName").val());
- //单价
- $("#zlItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
- //备注
- $("#zlRemark").val($(parentObject).find("input.temporary_items_remark").val());
- var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
- //数量
- var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
- //执行科室
- var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
- $("#zlExecUnit").selectpicker('val', execUnit);
- $('#zlExecUnit').selectpicker('refresh');
- //描述
- $("#chargeUnit").val(chargeUnit);
- $("#itemQuantity").val(itemQuantity);
- }
- /**
- * 保存当前辅助检查、检验项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (patientAge != null && patientAge != "" && patientAge < 6) {
- $.ajax({
- type: "GET",
- url: '/thmz/checkAdditionally?code=' + $("#jcjy_current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
- var xlCode = res.data.xlCode;
- xlCode = Multiply(100, xlCode);
- $("#messageModal").modal();
- $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJyJcItemReal(true);
- });
- $("#cancelButton").off("click");
- } else {
- //虽然是不满6岁,但是也没有需要加收的项目,直接保存
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- }
- /**
- * 保存当前项目到右边处方区域
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItemReal(calculateTotalAmountFlag) {
- var tableId = $("#jcjyTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //项目名称
- var jcJyItem = $("#jcJyItem").val();
- //当前项目编码
- var currentCode = $("#jcjy_current_code").val();
- //当前项目价格
- var jcjyItemPrice = $("#jcjyItemPrice").val();
- //执行科室
- var execUnit = $("#execUnit").val();
- //执行科室
- var execUnitName = $('#execUnit option:selected').text();
- execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
- //描述编码
- var chargeUnitCode = null;
- var chargeUnitName = "";
- //检验物或者检查部位
- var chargeUnit = null;
- //备注
- var remark = $("#remark").val();
- //项目类型
- var jcJyZltype = $("#jcJyZltype").val();
- if (jcJyZltype == "1" || jcJyZltype == 1) {
- //检验
- chargeUnit = $('#jyZdSample option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#jyZdSample').val();
- chargeUnitName = " 检验物:";
- } else if (jcJyZltype == "2" || jcJyZltype == 2) {
- //检查
- chargeUnit = $('#yshPart option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#yshPart').val();
- chargeUnitName = " 检查部位:";
- }
- if (currentCode == null || currentCode == '') {
- if (calculateTotalAmountFlag == true) {
- errorMesageSimaple("未选择任何项目!");
- }
- return;
- }
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(currentCode, null, chargeUnitCode, 2)) {
- return;
- }
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#jcjy_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- //原组号
- var oriGroupId = null;
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === currentCode) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- oriGroupId = $(formGroups[i]).find("span.jcjyItemGroupId").text();
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- if (oriGroupId != null) {
- groupId = oriGroupId;
- }
- var html = '<div class="form-group">';
- html += '<span class="jcjyItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
- html += jcJyItem + ' ';
- if (jcJyZltype == "3" || jcJyZltype == 3) {
- html += " 数量:" + itemQuantity;
- }
- if (execUnit != null && execUnit != "") {
- html += " 执行科室:" + execUnitName;
- }
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnitName + chargeUnit;
- }
- if (remark != null && remark != '') {
- html += ' 备注:' + remark;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- if ($("#jcJyItemChargeDetail").hasClass("in")) {
- html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\',' + jcJyZltype + ')"></i>';
- }
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(2,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
- html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
- html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
- html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- clearJyJcItem();
- }
- /**
- * 保存当前诊疗项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveZlItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (patientAge != null && patientAge != "" && patientAge < 6) {
- $.ajax({
- type: "GET",
- url: '/thmz/checkAdditionally?code=' + $("#zl_current_code").val() + "&jcJyZltype=3",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
- var xlCode = res.data.xlCode;
- xlCode = Multiply(100, xlCode);
- $("#messageModal").modal();
- $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveZlItemReal(true);
- });
- $("#cancelButton").off("click");
- } else {
- //虽然是不满6岁,但是也没有需要加收的项目,直接保存
- saveZlItemReal(calculateTotalAmountFlag);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- saveZlItemReal(calculateTotalAmountFlag);
- }
- }
- /**
- * 保存当前项目到右边处方区域
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveZlItemReal(calculateTotalAmountFlag) {
- var tableId = $("#zlTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //项目名称
- var zlItem = $("#zlItem").val();
- //当前项目编码
- var currentCode = $("#zl_current_code").val();
- //当前项目价格
- var zlItemPrice = $("#zlItemPrice").val();
- //描述
- var chargeUnit = $("#chargeUnit").val();
- //执行科室
- var zlExecUnit = $("#zlExecUnit").val();
- //执行科室
- var zlExecUnitName = $('#zlExecUnit option:selected').text();
- zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
- //次数
- var itemQuantity = $("#itemQuantity").val();
- //描述编码
- var chargeUnitCode = chargeUnit;
- var chargeUnitName = " 描述:";
- //备注
- var remark = $("#zlRemark").val();
- if (currentCode == null || currentCode == '') {
- if (calculateTotalAmountFlag == true) {
- errorMesageSimaple("未选择任何项目!");
- }
- return;
- }
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(currentCode, null, null, 3)) {
- return;
- }
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#zl_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- //原组号
- var oriGroupId = null;
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === currentCode) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- oriGroupId = $(formGroups[i]).find("span.zlItemGroupId").text();
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- if (oriGroupId != null) {
- groupId = oriGroupId;
- }
- var html = '<div class="form-group">';
- html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
- html += zlItem + ' ';
- html += " 数量:" + itemQuantity;
- if (zlExecUnit != null && zlExecUnit != "") {
- html += " 执行科室:" + zlExecUnitName;
- }
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnitName + chargeUnit;
- }
- if (remark != null && remark != '') {
- html += ' 备注:' + remark;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editZlItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_zlItemName" value="' + zlItem + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + zlItemPrice + '"/>';
- html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
- html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
- html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- clearZlItem();
- }
- /**
- * 临时保存住院证
- * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
- */
- function saveZyReq(messageFlag) {
- //如果
- if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
- initNavTabs(4);
- }
- var tableId = $("#zyReqTab li.active").find("a").attr("href");
- //病区编码
- var inpatientWardBeHospitalized = $("#inpatientWardBeHospitalized").val();
- //小病室编码
- var smallWardBeHospitalized = $("#smallWardBeHospitalized").val();
- //入院状态编码
- var admissStatus = $("#admissStatus").val();
- //病区名称
- var inpatientWardText = $('#inpatientWardBeHospitalized option:selected').text();
- //小科室名称
- var smallWardText = $('#smallWardBeHospitalized option:selected').text();
- //入院状态名称
- var admissStatusText = $('#admissStatus option:selected').text();
- if (inpatientWardBeHospitalized == null || inpatientWardBeHospitalized == '') {
- errorMesageSimaple("未选择入院病区!");
- return;
- }
- if (admissStatus == null || admissStatus == '') {
- errorMesageSimaple("未选择入院状态!");
- return;
- }
- if (messageFlag == "true" || messageFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- $("#messageModal").modal();
- $("#messageContent").html("当前病人已经有一个暂存的入院申请,是否需要替换该申请?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveZyReq(false);
- });
- $("#cancelButton").off("click");
- return;
- }
- }
- var html = '<div class="form-group"> 收住院';
- if (inpatientWardText != null) {
- html += " [" + inpatientWardText;
- }
- if (smallWardText != null) {
- html += " (" + smallWardText + ") ";
- }
- if (inpatientWardText != null) {
- html += "] ";
- }
- if (admissStatusText != null) {
- html += admissStatusText;
- }
- html += ' 侯床';
- //html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_inpatient_ward" value="' + inpatientWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_small_ward" value="' + smallWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_admiss_status" value="' + admissStatus + '"/>';
- html += '</div>';
- $(tableId).find("div:eq(0)").html(html);
- clearZyReq();
- }
- /**
- * 删除药品或者项目
- * @param index 0 西药 1 中药 2 项目
- * @param obj 当前点击的对象
- */
- function removeYpOrProject(index, obj) {
- var tabId = null;
- var className=null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //辅助检查、检验
- className=".jcjyItemGroupId";
- tabId = "jcjyTab";
- } else if (index == 3) {
- //诊疗
- className=".zlItemGroupId";
- tabId = "zlTab";
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
- //calculateCfAmount(tableId, totalRetprice, null, index, 1);
- //医技和诊疗的序号调整一下
- if (index == 2 || index == 3) {
- var nextAll = $(obj).parent().nextAll();
- if (nextAll != null && nextAll.length > 0) {
- for (var i = 0; i < nextAll.length; i++) {
- var index = $(nextAll[i]).find(className).text();
- $(nextAll[i]).find(className).text(index - 1);
- }
- }
- }
- $(obj).parent().remove();
- if (index != 4) {
- calculateTotalAmount();
- }
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups == null || formGroups.length == 0) {
- if (index == 0) {
- //西药被清空后,重置药房类型编码
- $(tableId).find("input.current_groupNo").val(null);
- //当本处方内容都被删除完后,也删除处方table
- $("#" + tabId).find("a[href=\"" + tableId + "\"]").parent().remove();
- $(tableId).remove();
- //切换处方 最后一个被选中
- $("#" + tabId).find("li:last > a").off("click").tab('show');
- } else if (index == 1) {
- //当中药处方被清空完后,重置当前中药类型为空
- $("#current_zyClassType").val(null);
- }
- }
- }
- /**
- * 清空西药
- * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
- */
- function clearWesternMedicine(flag) {
- $("#western_medicine_update_flag").val(false);
- //药品名称
- $("#western_medicine_name").val(null);
- //当前药品编码
- $("#western_medicine_current_code").val(null);
- //当前药品规格
- $("#western_medicine_current_serial").val(null);
- //当前药房编码
- $("#current_groupNo").val(null);
- if (flag) {
- //用法编码
- $("#supplyType").selectpicker('val', null);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").removeAttr("disabled");
- //天数
- $("#dayNum").selectpicker('val', null);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").removeAttr("disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', null);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").removeAttr("disabled");
- }
- //药品默认单次使用剂量
- $("#drugWinDb").val(null);
- //处方实际单次使用剂量
- $("#drugWin").val(null);
- //剂量单位
- $("#drugWinUnit").selectpicker('val', null);
- $('#drugWinUnit').selectpicker('refresh');
- //总量
- $("#gross").val(null);
- //包装单位
- $("#packUnit").selectpicker('val', null);
- $('#packUnit').selectpicker('refresh');
- //单价
- $("#packRetprice").val(null);
- //金额
- $("#totalRetprice").val(null);
- //医嘱
- $("#medicalAdvice").selectpicker('val', null);
- $('#medicalAdvice').selectpicker('refresh');
- //皮试
- $("#tryFlag").parent().removeClass('checked');
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- //$("#gross").attr("readonly", "readonly");
- $("#manufactoryName").val(null);
- $("#specification").val(null);
- }
- /**
- * 保存当前药品到右边处方区域 中药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveChineseMedicine(calculateTotalAmountFlag) {
- //药品名称
- var chineseMedicineNamme = $("#chinese_medicine_name").val();
- //当前药品编码
- var currentCode = $("#chinese_medicine_current_code").val();
- //当前药品规格
- var currentSerial = $("#chinese_medicine_current_serial").val();
- //处方实际单次使用剂量
- var drugWin = $("#zy_drugWin").val();
- //医嘱码
- var zyInstruction = $("#zyInstruction").val();
- //医嘱
- var zyInstructionText = $('#zyInstruction option:selected').text();
- //单价
- var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
- //当前中药的总价
- var totalRetprice = Multiply(drugWin, zyPackRetprice);
- //中药类型
- var zyClassType = $("#zyClassType").val();
- //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
- var currentYyClassType = $("#current_zyClassType").val();
- if (currentYyClassType == null || currentYyClassType == "") {
- //中药此时是第一次选择药品,不控制类型
- $("#current_zyClassType").val(zyClassType);
- } else if (currentYyClassType != zyClassType) {
- errorMesageSimaple("同一个中药处方不允许同时出现普通中药和颗粒剂中药!");
- return;
- }
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- var html = '<div class="form-group" style="float: left;">';
- html += chineseMedicineNamme;
- if (zyInstruction != null && zyInstruction != '') {
- html += '[' + zyInstructionText + ']';
- }
- html += '<span style="margin-left: 5px"></span>';
- html += drugWin + 'g';
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editChineseMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left:10px;" onclick="removeYpOrProject(1,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
- html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
- html += '</div>';
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#chinese_medicine_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- // calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount();
- }
- clearChineseMedicine();
- }
- /**
- * 清空中药
- */
- function clearChineseMedicine() {
- $("#chinese_medicine_update_flag").val(false);
- //药品名称
- $("#chinese_medicine_name").val(null);
- //当前药品编码
- $("#chinese_medicine_current_code").val(null);
- //当前药品规格
- $("#chinese_medicine_current_serial").val(null);
- //医嘱
- $("#zyInstruction").selectpicker('val', null);
- $('#zyInstruction').selectpicker('refresh');
- //剂量
- $("#zy_drugWin").val(null);
- //单价
- $("#zy_packRetprice").val(null);
- }
- /**
- * 清空辅助检查、检验项目
- */
- function clearJyJcItem() {
- $("#jcjy_update_flag").val(false);
- //项目名称
- $("#jcJyItem").val(null);
- //当前项目编码
- $("#jcjy_current_code").val(null);
- //单价
- $("#jcjyItemPrice").val(null);
- //备注
- $("#remark").val(null);
- $("#jcJyZltype").val(null);
- $("#jyZdSample").selectpicker('val', null);
- $('#jyZdSample').selectpicker('refresh');
- $("#yshPart").selectpicker('val', null);
- $('#yshPart').selectpicker('refresh');
- $("#execUnit").selectpicker('val', null);
- $('#execUnit').selectpicker('refresh');
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- }
- /**
- * 清空诊疗项目
- */
- function clearZlItem() {
- $("#zl_update_flag").val(false);
- //项目名称
- $("#zlItem").val(null);
- //当前项目编码
- $("#zl_current_code").val(null);
- //单价
- $("#zlItemPrice").val(null);
- //备注
- $("#zlRemark").val(null);
- //描述
- $("#chargeUnit").val(null);
- $("#itemQuantity").val(1);
- $("#zlExecUnit").selectpicker('val', null);
- $('#zlExecUnit').selectpicker('refresh');
- }
- /**
- * 清空入院证输入框
- */
- function clearZyReq() {
- $("#inpatientWardBeHospitalized").selectpicker('val', null);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- $("#smallWardBeHospitalized").selectpicker('val', null);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- $("#admissStatus").selectpicker('val', null);
- $('#admissStatus').selectpicker('refresh');
- $("#totalBedNum").val(null);
- $("#freeBedNum").val(null);
- $("#occupationBedNum").val(null);
- initSmallDeptByDept();
- }
- /**
- * 计算总金额
- */
- function calculateTotalAmount() {
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/getAmountForTempPrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#totalAmount").html(res.data.amount.toFixed(1));
- var arrs = $("span.cf_amount");
- for (var i = 0; i < arrs.length; i++) {
- if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
- $(arrs[i]).html(res.data.amountList[i].toFixed(1));
- }
- }
- // var arrs = $("#xyTabContent").find("span.cf_amount");
- // for (var i = 0; i < arrs.length; i++) {
- // $(arrs[i]).html(res.data.xyAmount.toFixed(1));
- // }
- // $("#zyTabContent").find("span.cf_amount").html(res.data.zyAmount.toFixed(1));
- // if (res.data.yjAmount != null) {
- // //如果
- // if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- // initNavTabs(2);
- // }
- // $("#zlTabContent").find("span.cf_amount").html(res.data.yjAmount.toFixed(1));
- // }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 打开住院处理窗口
- // * @param data
- // */
- // function beHospitalized() {
- // $("#beHospitalizedModal").modal();
- // //根据病人门诊id查询病人的入院申请
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // headers: {
- // 'Accept': 'application/json',
- // 'Authorization': 'Bearer ' + localStorage.getItem("token")
- // },
- // success: function (resZyz) {
- // if (resZyz == '401' || resZyz == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (resZyz.code == 0) {
- // $("#icdCodeInputBeHospitalized").val(resZyz.data.icdCode);
- // $("#icdTextBeHospitalized").val(resZyz.data.icdText);
- // $("#icdTextBeHospitalized").attr("title", resZyz.data.icdText);
- // $("#inpatientWardBeHospitalized").selectpicker('val', resZyz.data.reqDept);
- // $("#inpatientWardBeHospitalized").selectpicker('refresh');
- // initSmallDeptByDept();
- // $("#smallWardBeHospitalized").selectpicker('val', resZyz.data.smallDept);
- // $("#smallWardBeHospitalized").selectpicker('refresh');
- // $("#admissStatus").selectpicker('val', resZyz.data.admissStatus);
- // $("#admissStatus").selectpicker('refresh');
- // $("#zyReqVisitDate").val(format(resZyz.data.visitDate, "yyyy-MM-dd HH:mm:ss"));
- // }
- // }
- // });
- // }
- /**
- * 打开编辑用户信息窗口
- * @param data
- */
- function editUserModal() {
- $("#editUserModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + $("#patientId").text(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方类型按钮切换事件
- * @param object
- * @param objectIndex
- */
- function billItemButtonChange(object, objectIndex) {
- $(".nav-tabs").removeClass("in").addClass("hide");
- $(".tab-content").removeClass("in").addClass("hide");
- $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- $("#bill_item_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- $("#rp_form" + index).removeClass("show").addClass("hide");
- });
- $("#rp_form" + objectIndex).removeClass("hide").addClass("show");
- $(object).removeClass("btn-default").addClass("btn-primary");
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- if (objectIndex == 0) {
- $("#western_medicine_name").focus();
- } else if (objectIndex == 1) {
- $("#chinese_medicine_name").focus();
- } else if (objectIndex == 2) {
- $("#jcJyItem").focus();
- } else if (objectIndex == 3) {
- $("#zlItem").focus();
- }else if (objectIndex == 4) {
- // $("#inpatientWardBeHospitalized").next().click();
- prevEleId = "zy_req_button";
- }
- }
- /**
- * 打开快速接诊窗口
- * @param data
- */
- function rapidAcceptsModal() {
- $("#rapidAcceptsModal").modal();
- //延迟触发 默认光标在卡号输入框
- setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
- }
- /**
- * checkBox样式
- */
- function formatCheck() {
- if ($("input.flat")[0]) {
- $(document).ready(function () {
- $('input.flat').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- /**
- * 卡号有变化后查询病人信息
- */
- function queryUserInfoByCardNo() {
- //当反写的id不存在,说明不是查询后的改变事件,触发查询
- var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
- var index = rapidAcceptsUserCardNo.indexOf("-");
- if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "") && ((index > 0 && index == rapidAcceptsUserCardNo.length - 2) || rapidAcceptsUserCardNo.length == 8)) {
- $("#cardNo").attr("title", rapidAcceptsUserCardNo);
- $.ajax({
- type: "GET",
- url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#rapidAcceptsUserName").val(res.data.name);
- $("#rapidAcceptsUserCode").val(res.data.patientId);
- $("#patientIdDb").val(res.data.patientId);
- $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
- $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
- $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
- $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
- $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
- //查询分诊号
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": res.data.patientId}),
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (resFz) {
- if (resFz == '401' || resFz == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (resFz.code == 0) {
- if (resFz.data == null || resFz.data.length == 0) {
- errorMesageSimaple("没有查询到符合条件的分诊记录!");
- clearRapidAcceptsModal();
- return;
- }
- $("#mzfzSerialNo").val(resFz.data[0].serialNo);
- }
- }
- });
- } else {
- errorMesageSimaple("病人信息不存在!");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- }
- /**
- * 清空快速接诊查询框
- */
- function clearRapidAccepts() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- $("#mzfzSerialNo").val(null);
- $("#rapidAcceptsUserCardNo").focus();
- }
- /**
- * 根据病人姓名输入框内容动态加载病人列表
- */
- function initUserList() {
- //var width=$("#userName").css("width");
- var settings = {
- trigger: 'click',
- content: '',
- width: 170,
- multi: true,
- closeable: false,
- style: '',
- delay: 300,
- padding: true,
- height: 300,
- };
- var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
- //用户姓名选中事件
- $("#rapidAcceptsUserName").on("click", function (t) {
- if ($(webuiPopover).css("display") == "block") {
- refeshPatinetList(true);
- }
- });
- }
- /**
- * 刷新候诊病人列表
- */
- function refeshPatinetList(flag) {
- //如果是重新加载病人列表,需要重置下标
- if (flag) {
- //重置下标
- pageIndex = 0;
- msg_list_loading = true;
- }
- var userName = $('#rapidAcceptsUserName').val();
- if (!(userName == null || userName == "" || isChinese(userName))) {
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#webuiPopover0").css("display", "block");
- $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
- var html = '<div class="list-group">';
- for (var i = 0; i < res.data.length; i++) {
- var mzPatientMi = res.data[i];
- html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
- if (mzPatientMi.gender == "男") {
- html += '<img src="/thmz/images/boy.png"/>'
- } else if (mzPatientMi.gender == "女") {
- html += '<img src="/thmz/images/girl.png"/>'
- } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
- html += '<img src="/thmz/images/girl_or_boy.png"/>'
- }
- html += '<div>' + mzPatientMi.name + ' ' + mzPatientMi.gender + ' ';
- if (mzPatientMi.age != null && mzPatientMi.age != "") {
- html += mzPatientMi.age + '岁';
- } else {
- html += '**岁';
- }
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
- html += '<span>' + mzPatientMi.phoneNo + '</span>';
- }
- html += '</div></a>';
- }
- html += '</div>';
- if (flag) {
- $("#webuiPopover0 div.webui-popover-content").html("");
- }
- $("#webuiPopover0 div.webui-popover-content").append(html);
- $("#webuiPopover0 div.arrow").css("left", "23px");
- refeshPatinetListScrollEvent();
- } else {
- $("#webuiPopover0").css("display", "none");
- }
- }
- //查询完成,设置加载完成
- msg_list_loading = false;
- }
- });
- }
- /**
- * 病人下拉列表滚动条滚动到底部时继续加载新纪录
- */
- function refeshPatinetListScrollEvent() {
- $('.webui-popover-content').scroll(function (event) {
- var top = $(this).scrollTop();
- var height = $(this).height();
- var scrollHeight = $(this).get(0).scrollHeight;
- if (scrollHeight <= top + height) {
- if (!msg_list_loading) {
- msg_list_loading = true;
- pageIndex = pageIndex + 1;
- refeshPatinetList(false);
- }
- }
- });
- }
- /**
- * 按照病人id查询病人信息
- * @param patientId
- */
- function fillUnClinicPatinet(patientId) {
- $("#rapidAcceptsUserCardNo").val(patientId);
- $("#webuiPopover0").css("display", "none");
- queryUserInfoByCardNo();
- }
- /**
- * 加载主诉,体格检查,诊断窗口
- */
- function initRecommendList() {
- var width = $("#symptom").parent().css("width");
- var settings = {
- placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- trigger: 'click', //值:click,hover 触发方式 manual 手动
- content: '',//内容,内容可以是函数
- width: width,
- //arrow:false,//是否显示箭头
- multi: true,//在页面允许其他弹出层
- closeable: true,//显示关闭按钮
- style: '', //值:'',inverse
- delay: 300,//延迟时间, 悬浮属性才执行
- padding: true,//内容填充
- height: 320,
- //offsetTop:10,
- cache: true,//如果缓存设置为false,则popover将销毁并重新创建
- };
- //主诉弹窗
- var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
- //体格检查弹窗
- settings.height = 260;
- $('#weight').webuiPopover('destroy').webuiPopover(settings);
- //诊断弹窗
- settings.height = 320;
- var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
- //西药弹窗
- settings.width = 680;
- settings.closeable = false;
- settings.arrow = false;//显示箭头或不显示箭头
- settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //中药弹窗
- settings.trigger = 'click';
- settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //辅助检查、检验弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
- var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
- //诊疗弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="zlItemPopoverContent"><table id="tb_table_zl_item"></table></div>';
- var zlItemWebuiPopover = $('#zlItem').webuiPopover('destroy').webuiPopover(settings);
- //主诉选中事件
- $("#symptom").on("click", function (t) {
- if ($(symptomWebuiPopover).css("display") == "block") {
- $("#webuiPopover1 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
- html += "</div>";
- html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
- '<div style="float: left">' +
- '<span style="margin-left: 20px;">内容:</span> ' +
- '</div>' +
- '<div style="float: left;">' +
- '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
- '<option label="常用症状" value="0">常用症状</option>' +
- '<option label="常用时间" value="1">常用时间</option>' +
- '<option label="常用标点" value="2">常用标点</option>' +
- '<option label="常用词" value="3">常用词</option>' +
- '</select> ' +
- '</div>' +
- '<div style="width: 200px;float: left;margin-left: 10px;">' +
- '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
- '</div>' +
- '<div style="float: left;margin-left: 10px;">' +
- ' <button type="button" class="btn" onclick="saveParams();"' +
- ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
- ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
- ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
- ' </svg>' +
- '新增' +
- ' </button>' +
- ' </div>' +
- '</div>';
- $("#webuiPopover1 div.webui-popover-content").html(html);
- $('#paramsType').selectpicker('refresh');
- $("#paramsType").parent().css("width", "140px").css("height", "34px");
- $("#webuiPopover1").css("z-index", "10");
- if ($("#webuiPopover1").hasClass("in")) {
- loadSymptom();
- }
- }
- //加载智能接诊模块的主诉推荐
- fitSymptomData();
- });
- //体格检查各输入框选中事件
- $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor,#pressure_high_left,#pressure_floor_left").on("click", function (t) {
- if ($("#webuiPopover2").css("display") == "block") {
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- //loadSymptom();
- } else {
- $('#weight').webuiPopover('show');
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- }
- return false;
- });
- //诊断选中事件
- $("#diagnose").on("click", function (t) {
- if ($(diagnoseWebuiPopover).css("display") == "block") {
- $("#webuiPopover3 div.arrow").css("left", "23px");
- $("#webuiPopover3 a.close").css("margin-top", "15px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
- html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
- ' <input type="text" class="form-control has-feedback-left" ' +
- ' placeholder="搜索" style="padding-left: 10px;" oninput="loadDiagnose(this.value)" id="paramsDiagnose">' +
- ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
- ' </div>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
- html += "</div>";
- $("#webuiPopover3 div.webui-popover-content").html(html);
- $("#webuiPopover3").css("z-index", "10");
- //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
- loadDiagnose("");
- }
- //加载智能接诊模块的诊断推荐推荐
- fitDiagnoseData();
- });
- //现病史选中事件
- $("#emrHpi").on("click", function (t) {
- //加载智能接诊模块的现病史推荐推荐
- fitEmrHpiData();
- });
- //既往史选中事件
- $("#emrPs").on("click", function (t) {
- //加载智能接诊模块的既往史推荐推荐
- fitEmrPsData();
- });
- // //西药选中事件
- // $("#western_medicine_name").on("click", function (t) {
- // if ($(westernMedicineWebuiPopover).css("display") == "block") {
- // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(0);
- // }
- // });
- // //中药选中事件
- // $("#chinese_medicine_name").on("click", function (t) {
- // if ($(chineseMedicineWebuiPopover).css("display") == "block") {
- // $("#chineseMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(1);
- // }
- // });
- // //诊疗与医技弹窗选中事件
- // $("#jcJyItem").on("click", function (t) {
- // if ($(jcJyItemWebuiPopover).css("display") == "block") {
- // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
- // loadjcJyItemList();
- // }
- // });
- //帮助字典弹窗
- settings.width = 450;
- settings.height = 500;
- settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
- settings.trigger = 'click';
- var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
- $("#treeButton").on("click", function (t) {
- // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
- //初始化药品,检查检验菜单树
- initzTree();
- });
- }
- /**
- * 新增通用参数
- */
- function saveParams() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveTCommonParams',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "paramsType": $("#paramsType").val(),
- "paramsName": $("#paramsNameInput").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- loadSymptom();
- $("#paramsNameInput").val(null);
- // $("#paramsType").selectpicker('val', 0);
- // $("#paramsType").selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载主诉参数列表
- */
- function loadSymptom() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadSymptom',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.featureList != null && res.featureList.length > 0) {
- html += '<div id="feature">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.featureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.featureList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.featureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.timeList != null && res.timeList.length > 0) {
- html += '<div id="time">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.timeList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.timeList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.timeList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.characterList != null && res.characterList.length > 0) {
- html += '<div id="character">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.characterList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.characterList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.characterList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.wordsList != null && res.wordsList.length > 0) {
- html += '<div id="words">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.wordsList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.wordsList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.wordsList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#contentHtml").html(html);
- }
- });
- }
- /**
- * 加载体格检查参数列表
- */
- function loadHealthCheckup() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadHealthCheckup',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.weightList != null && res.weightList.length > 0) {
- html += '<div id="weightDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.weightList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.weightList[i].paramsName + '\',\'weight\')"><span style="padding: 0px 5px;">';
- html += res.weightList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.temperatureList != null && res.temperatureList.length > 0) {
- html += '<div id="temperatureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.temperatureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.temperatureList[i].paramsName + '\',\'temperature\')"><span style="padding: 0px 5px;">';
- html += res.temperatureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.sphygmusList != null && res.sphygmusList.length > 0) {
- html += '<div id="sphygmusDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.sphygmusList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.sphygmusList[i].paramsName + '\',\'sphygmus\')"><span style="padding: 0px 5px;">';
- html += res.sphygmusList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.breatheList != null && res.breatheList.length > 0) {
- html += '<div id="breatheDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.breatheList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.breatheList[i].paramsName + '\',\'breathe\')"><span style="padding: 0px 5px;">';
- html += res.breatheList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.pressureList != null && res.pressureList.length > 0) {
- html += '<div id="pressureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">血压:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.pressureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.pressureList[i].paramsName + '\',\'pressure_\')"><span style="padding: 0px 5px;">';
- html += res.pressureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#healthCheckupContentHtml").html(html);
- }
- });
- }
- /**
- * 加载诊断参数列表
- * @param value
- */
- function loadDiagnose(value) {
- if (!$("#webuiPopover3").hasClass("in")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + value + '&pageSize=100',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- html += '<div>';
- for (var i = 0; i < res.data.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitDiagnoseValue(\'' + res.data[i].paramsName + '\',\'' + res.data[i].paramsCode + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
- html += res.data[i].paramsName;
- html += '<small> (' + res.data[i].paramsCode + ')</small>';
- html += '</span></button>';
- }
- html += '</div>';
- }
- } else {
- errorMesage(res);
- }
- $("#diagnoseContentHtml").html(html);
- }
- });
- }
- /**
- * 填充诊断
- * @param value
- * @param code
- */
- function fitDiagnoseValue(value, code) {
- if (code === null || code === "") {
- return;
- }
- var html = '';
- var childrenNum = $("#diagnoseTags").children().length;
- if (childrenNum == 6) {
- errorMesageSimaple("最多填写六个诊断!");
- return;
- }
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "") {
- diagnoseValue = code;
- } else {
- if (diagnoseValue.indexOf(code) != -1) {
- errorMesageSimaple("诊断已存在,请勿重复添加!");
- return;
- }
- diagnoseValue += "," + code;
- }
- $("#diagnoseValue").val(diagnoseValue);
- if (childrenNum == 0) {
- html += '<span class="el-tag--mainDiagnosis" ';
- } else {
- html += '<span class="el-tag--secondaryDiagnosis" ';
- }
- html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
- $("#diagnoseTags").append(html);
- $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
- }
- /**
- * 移除诊断
- * @param code
- */
- function removeDiagnoseValue(code) {
- var childrenIndex = 0;
- var children = $("#diagnoseTags").children();
- for (var i = 0; i < children.length; i++) {
- if ($(children[i]).attr("id") == code) {
- childrenIndex = i;
- break;
- }
- }
- $($("#diagnoseTags").children("span")[childrenIndex]).remove();
- if (childrenIndex == 0) {
- $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
- }
- var diagnoseValue = $("#diagnoseValue").val();
- $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
- $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
- }
- /**
- * 点击通用参数属性值时设置值到对应的区域
- * @param value
- * @param id
- */
- function fitValue(value, id) {
- //当选择的是血压时
- if (id == "pressure_") {
- var arr = value.split("/");
- $("#pressure_high").val(arr[0]);
- $("#pressure_floor").val(arr[1]);
- if ($("#pressureLeftFlag").hasClass("in")) {
- $("#pressure_high_left").val(arr[0]);
- $("#pressure_floor_left").val(arr[1]);
- }
- //当选的是体重,体温,脉搏和呼吸时
- } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
- $("#" + id).val(value);
- } else {
- //主诉拼写时
- var valueExist = $("#" + id).val();
- if (valueExist != null && valueExist != "") {
- value = valueExist + value;
- }
- $("#" + id).val(value);
- }
- }
- /**
- * 加载药品列表数列表
- * @param index
- */
- function loadYpList(index, event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- var medicinePopoverContent = null;
- var tableMedicine = null;
- var MedicineName = null;
- //var groupNo=null;
- if (index == 0) {
- medicinePopoverContent = "westernMedicinePopoverContent";
- tableMedicine = "tb_table_western_medicine";
- MedicineName = "western_medicine_name";
- // groupNo=71;
- }
- if (index == 1) {
- medicinePopoverContent = "chineseMedicinePopoverContent";
- tableMedicine = "tb_table_chinese_medicine";
- MedicineName = "chinese_medicine_name";
- // groupNo=$("#zyClassType").val();
- }
- // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#' + tableMedicine).bootstrapTable('refresh');
- $('#' + tableMedicine).bootstrapTable({
- url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var groupNo = null;
- if (index == 0) {
- groupNo = 71;
- }
- if (index == 1) {
- groupNo = $("#zyClassType").val();
- }
- var temp = {
- groupNo: groupNo,
- commonParams: $("#" + MedicineName).val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '药品名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'specification',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'manufactory',
- title: '生产厂家',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'miniUnitName',
- title: '单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '零售价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return '0.0元';
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'drugWinDesc',
- title: '剂量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'stockAmountVirtual',
- title: '库存数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#" + medicinePopoverContent).parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#' + MedicineName).webuiPopover('hide');
- if (index == 0) {
- checkYpInfo(row.code, row.serial, row.ypType, true);
- }
- if (index == 1) {
- checkZyInfo(row.code, row.serial, true);
- }
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 西药
- * @param code
- * @param serial
- * @param groupNo
- * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
- */
- function checkYpInfo(code, serial, groupNo, needNotice) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, null, 0)) {
- return;
- }
- $("#current_groupNo").val(groupNo);
- //不需要每次都关闭这个帮助字典
- //$("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: needNotice,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
- initNavTabs(0);
- }
- var cfdesc = '普药';
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- //每个处方不能超过5个药品
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children().length;
- var currentGroupNo = $(tableId).find("input.current_groupNo").val();
- if (childrens === 5) {
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- // //选中药品后,光标默认到用法
- // $("#supplyType").next().click();
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- }
- } else if (currentGroupNo != null && currentGroupNo != '' && groupNo != currentGroupNo) {
- //当前编辑的处方与选中的品类非同一处方能保存的
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //是否需要新增处方页,以保存医材处方
- var needAddTable = true;
- for (var i = 0; i < currentGroupNos.length; i++) {
- if ($(currentGroupNos[i]).val() == groupNo) {
- var next = $(currentGroupNos[i]).next();
- if ($(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //因为存在没有满5个的处方页,直接保存到该页
- needAddTable = false;
- fitWesternMedicine(res, groupNo);
- }
- }
- }
- if (needAddTable) {
- //91 医材
- var message = "医材需要单独处方,是否需要新增医材处方?";
- if (groupNo == '71') {
- message = "普通西成药需要单独处方,是否需要新增处方?"
- } else if (groupNo == '111') {
- message = "麻、精一药物需要单独处方,是否需要新增处方?"
- } else if (groupNo == '131') {
- message = "精二药物需要单独处方,是否需要新增处方?"
- }
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- // //选中药品后,光标默认到用法
- // $("#supplyType").next().click();
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo);
- fitWesternMedicine(res, groupNo);
- }
- }
- //当前编辑的处方非普通西药处方
- } else {
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- fitWesternMedicine(res, groupNo);
- }
- // if (needNotice) {
- // //选中药品后,光标默认到用法
- // $("#supplyType").next().click();
- // // prevEleId = 'supplyType';
- // }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 中药
- * @param code
- * @param serial
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- function checkZyInfo(code, serial, async) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, null, 1)) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
- initNavTabs(1);
- $("input.zyfs").val(1);
- }
- $("#chinese_medicine_name").val(res.data.name);
- $("#chinese_medicine_name").blur();
- //$("#zy_drugWin").val(res.data.weight);
- $("#zy_packRetprice").val(res.data.packRetprice);
- $("#chinese_medicine_current_code").val(res.data.code);
- $("#chinese_medicine_current_serial").val(res.data.serial);
- if (async) {
- //选中药品后,光标默认到数量输入框
- $("#zy_drugWin").focus();
- // prevEleId = 'zy_drugWin';
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载辅助检查、检验列表
- * @param index
- */
- function loadjcJyItemList(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#tb_table_jc_jy_item').bootstrapTable('refresh');
- $('#tb_table_jc_jy_item').bootstrapTable({
- url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- commonParams: $("#jcJyItem").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'type',
- title: '项目类型',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == 1 || value == "1") {
- return "检验";
- }
- if (value == 2 || value == "2") {
- return "辅助检查";
- }
- if (value == 3 || value == "3") {
- return "诊疗";
- }
- return "";
- }
- },
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#jcJyItemPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#jcJyItem').webuiPopover('hide');
- $("#jcJyZltype").val(row.type);
- $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (row.type == 1) {
- //检验
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- if (row.sampleCode != null && row.sampleCode != "") {
- $("#jyZdSample").selectpicker('val', row.sampleCode);
- $('#jyZdSample').selectpicker('refresh');
- }
- } else if (row.type == 2) {
- //检查
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- if (row.bwCode != null && row.bwCode != "") {
- $("#yshPart").selectpicker('val', row.bwCode);
- $('#yshPart').selectpicker('refresh');
- }
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- checkJcJyItemInfo(row.code, row.name, row.type, true);
- }
- });
- }
- /**
- * 加载诊疗列表
- * @param index
- */
- function loadZlItemList(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- $('#tb_table_zl_item').bootstrapTable('refresh');
- $('#tb_table_zl_item').bootstrapTable({
- url: '/thmz/getZlItemByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- commonParams: $("#zlItem").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'type',
- title: '项目类型',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return "诊疗";
- }
- },
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#zlItem').webuiPopover('hide');
- $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#zlExecUnit").selectpicker('refresh');
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3);
- }
- $("#zlItem").val(row.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(row.chargeAmount);
- $("#chargeUnit").val(row.specification);
- $("#zl_current_code").val(row.code);
- $("#itemQuantity").val(1);
- $("#chargeUnit").focus();
- return;
- }
- });
- }
- /**
- * 诊疗与医技选中
- * @param code
- * @param name 回写的时候可以设置null
- * @param type 1 检验 2 检查 3 诊疗
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- //function checkJcJyItemInfo(code, name, type) {
- function checkJcJyItemInfo(code, name, type, async) {
- // //判断是否有重复的项目 返回true 说明有重复的
- // if (verifyRepeat(code, null, 2)) {
- // return;
- // }
- //不需要每次都关闭帮助树
- //$("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJcJyItemChargeByCode?code=' + code + '&jcJyZltype=' + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
- initNavTabs(2);
- }
- if (name == null) {
- name = res.name;
- }
- $("#jcJyItem").val(name);
- $("#jcJyItem").blur();
- $("#jcjyItemPrice").val(res.totalAmount);
- $("#jcjy_current_code").val(code);
- $("#execUnit").selectpicker('val', res.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- // if (async) {
- // if (type == 1) {
- // //选中项目后,光标默认到数量输入框
- // $("#jyZdSample").next().click();
- // // prevEleId = 'jyZdSample';
- // } else if (type == 2) {
- // $("#yshPart").next().click();
- // // prevEleId = 'yshPart';
- // }
- // }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询辅助检查、检验项目明细
- * @param code 编码
- * @param jcJyZltype 1 检验 2 检查
- */
- function getJcJyItemChargeByCode(code, jcJyZltype) {
- if (code != null) {
- $("#itemCodeSearch").val(code);
- $("#jcJyZltypeSearch").val(jcJyZltype);
- } else if ($("#jcjy_current_code").val() == null || $("#jcjy_current_code").val() == '') {
- errorMesageSimaple("未选中任何项目!");
- return;
- }
- $("#jcJyItemModal").modal("show");
- $('#jcJyItemTable').bootstrapTable('refresh');
- $('#jcJyItemTable').bootstrapTable({
- url: '/thmz/getJcJyItemChargeByCode', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var itemCodeSearch = $("#itemCodeSearch").val();
- var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
- if (itemCodeSearch == null || itemCodeSearch == "") {
- itemCodeSearch = $("#jcjy_current_code").val();
- jcJyZltypeSearch = $("#jcJyZltype").val();
- }
- var temp = {
- code: itemCodeSearch,
- jcJyZltype: jcJyZltypeSearch
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'tcCode',
- title: '项目编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'code',
- title: '收费编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'name',
- title: '收费名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'num',
- title: '数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '单价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }, {
- field: 'totalAmount',
- title: '总金额',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#itemCodeSearch").val(null);
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- }
- });
- }
- /**
- * 判断是否有重复的项目 返回true 说明有重复的
- * @param code 编码
- * @param serial 药品规格 null 时是非药品
- * @param chargeUnitCode 检查部位或者检验物 null 时是 诊疗
- * @param index
- */
- function verifyRepeat(code, serial, chargeUnitCode, index) {
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = null;
- if(index==0){
- updateFlag= $("#western_medicine_update_flag").val();
- }else if(index==1){
- updateFlag= $("#chinese_medicine_update_flag").val();
- }else if(index==2){
- updateFlag= $("#jcjy_update_flag").val();
- }else if(index==3){
- updateFlag= $("#zl_update_flag").val();
- }
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- if (updateFlag == "true" || updateFlag == true) {
- return false;
- }
- var tabId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- var items = $(tableId).find("div:eq(0)").find("div.form-group");
- var groupId = null;
- if (index == 0) {
- groupId = $("#groupId").val();
- }
- if (items != null && items.length > 0) {
- for (var i = 0; i < items.length; i++) {
- if (serial == null) {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_desc_value = $(items[i]).find("input.temporary_items_desc_value").val();
- if(chargeUnitCode==null && code === temporary_items_code){
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- if (code === temporary_items_code && chargeUnitCode === temporary_items_desc_value) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- if (index == 0) {
- //西药需要判断组号,因为可能会有不同组的皮试用药,需要相同的药品
- var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial && groupId === temporary_items_groupId) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- /**
- * 初始化处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- */
- function initNavTabs(index) {
- var tabId = null;
- var tabContentId = null;
- var paneId = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneId = "xycf_" + getUID();
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneId = "zycf_" + getUID();
- cfdesc = '中草药';
- } else if (index == 2) {
- //医技
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- paneId = "jcjycf_" + getUID();
- cfdesc = '辅助检查、检验';
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneId = "zlcf_" + getUID();
- cfdesc = '诊疗';
- } else if (index == 4) {
- //住院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneId = "zyReqcf_" + getUID();
- cfdesc = '入院';
- }
- $("#" + tabId).html('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>');
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
- html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
- html += '<input class="current_groupNo" type="hidden"/>';
- html += ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
- html += '<div style="width: 460px;">'
- if (index == 1) {
- html += ' <div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">付数:</label>' +
- ' <input type="text" class="form-control my_label_input_2 zyfs" id="zyfs"' +
- ' placeholder="请输入" style="padding-left: 10px;" onchange="calculateZyAmount()">' +
- ' </div>';
- html += '<div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">频次:</label>' +
- ' <div style="width: 85px;float: right;">' +
- ' <select class="form-control selectpicker show-tick zy_orderFrequency"' +
- ' title="请选择" data-live-search="true" onchange="calculate()" id="zy_orderFrequency_1">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += '<div style="width: 180px;float: left;">' +
- ' <label class="my_label_2">用法:</label>' +
- ' <div style="width: 135px;float: left;">' +
- ' <select class="form-control selectpicker show-tick useType"' +
- ' title="请选择" id="useType_1">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += '</div><div style="width: 460px;">'
- html += '<input id="singleAmount" type="hidden"/>';
- }
- html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- //html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;"></div>';
- if (index == 1) {
- html += '<div style="width: 130px;float: left;">' +
- ' <label class="my_label_2">液型:</label>' +
- ' <div style="width: 85px;float: right;">' +
- ' <select class="form-control selectpicker show-tick water" id="cyJssm">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += ' <div style="width: 180px;float: left;">' +
- ' <label class="my_label_2">煎法:</label>' +
- ' <div style="width: 135px;float: left;">' +
- ' <select class="form-control selectpicker show-tick zy_supplyType"' +
- ' title="请选择" id="zy_supplyType_1" onchange="calculateTotalAmount()">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- }
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- // else if (index == 1) {
- // html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品代煎所产生的费用!</div>';
- // }
- html += '</div></div></div>';
- $("#" + tabContentId).html(html);
- if (index == 1) {
- var useType = '<option value="1">饭前温服</option><option value="2">饭后温服</option><option value="3">饭前凉服</option><option value="4">饭后凉服</option><option value="5">顿服</option><option value="6">冲服</option><option value="7">外用</option>';
- $('.useType').html(useType);
- $('.useType').selectpicker('refresh');
- var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
- $('.water').html(water);
- $('.water').selectpicker('refresh');
- initOrderFrequencys("zy_orderFrequency_1", false);
- initZySupplyTypes("zy_supplyType_1", false);
- }
- }
- /**
- * 清空处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- */
- function clearNavTabs(index) {
- var tabId = null;
- var tabContentId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- }else if (index == 3) {
- //医技
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- } else if (index == 4) {
- //医技
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- }
- $("#" + tabId).html(null);
- $("#" + tabContentId).html(null);
- }
- /**
- * 添加处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- * @param groupNo 71 普通西药 91 医材 111 麻、精一 131 精二 151 诊疗
- */
- function refreshNavTabs(index, groupNo) {
- var tabId = null;
- var tabContentId = null;
- var paneIdPrfix = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneIdPrfix = "xycf_";
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneIdPrfix = "zycf_";
- cfdesc = '中草药';
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- paneIdPrfix = "jcjycf_";
- cfdesc = '辅助检查、检验';
- }else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneIdPrfix = "zlcf_";
- cfdesc = '诊疗';
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneIdPrfix = "zyReqcf_";
- cfdesc = '入院';
- }
- // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
- // var length = $(tableId).find("div:eq(0)").children().length;
- // if(length==0){
- // //当前处方是空白的,不需要新增处方
- // return;
- // }
- var cfTitle = "处方" + " <small class=\"cfdesc\">(" + cfdesc + ")</small>";
- var paneId = paneIdPrfix + getUID();
- //清除选中的样式
- $("#" + tabId).find("li.active").removeClass("active");
- $("#" + tabId).append('<li><a href="#' + paneId + '" role="tab" data-toggle="tab">' + cfTitle + '</a></li>');
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
- '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
- '<input class="current_groupNo" type="hidden"/>' +
- ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">' +
- '<div style="width: 460px;">' +
- '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- html += '</div></div>';
- $("#" + tabContentId).append(html);
- //切换处方
- $("#" + tabId).find("a[href='#" + paneId + "']").off("click").tab('show');
- }
- /**
- * 填充西药选中的内容
- * @param res
- * @param groupNo
- */
- function fitWesternMedicine(res, groupNo) {
- $("#western_medicine_name").val(res.data.name);
- $("#western_medicine_name").blur();
- var drugWinHtml = '';
- var index = null;
- if (res.data.weight != null) {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- index = res.data.weighUnit;
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- if (index == null) {
- index = res.data.volUnit;
- }
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- if (index == null) {
- index = res.data.miniUnit;
- }
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- $("#drugWinUnit").selectpicker('val', index);
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- $("#packUnit").selectpicker('val', res.data.packUnitDesc);
- $('#packUnit').selectpicker('refresh');
- }
- $("#packRetprice").val(res.data.packRetprice);
- $("#packSize").val(res.data.packSize);
- $("#western_medicine_current_code").val(res.data.code);
- $("#western_medicine_current_serial").val(res.data.serial);
- if ($("#dayNum").val() == null) {
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- }
- if ($("#supplyType").val() == null && res.data.supplyType != null) {
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', res.data.supplyType);
- $('#supplyType').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null && res.data.frequency != null) {
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', res.data.frequency);
- $('#orderFrequency').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null) {
- //频次编码 防止频次为空
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- $("#tryFlag").parent().addClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
- } else {
- $("#tryFlag").parent().removeClass("checked");
- $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
- }
- $("#manufactoryName").val(res.data.manufactoryName);
- $("#specification").val(res.data.specification);
- // if (groupNo == "91") {
- // //医材
- // $("#gross").removeAttr("readonly")
- // } else {
- // $("#gross").attr("readonly", "readonly");
- // }
- calculate();
- $("#western_medicine_name").focus();
- }
- /**
- * 剂量单位改变事件
- */
- function drugWinUnitChange() {
- var desc = $('#drugWinUnit').find("option:selected").attr('desc');
- $("#drugWin").val(desc);
- $("#drugWinDb").val(desc);
- calculate();
- }
- /**
- * 根据选择的内容计算总的用药量
- */
- function calculate() {
- //最小规格剂量
- var drugWinDb = $("#drugWinDb").val();
- //天数
- var dayNum = $("#dayNum").val();
- //当前使用的最小剂量
- var drugWin = $("#drugWin").val();
- //频率
- var times = $('#orderFrequency').find("option:selected").attr('desc');
- //包装规格数量
- var packSize = $("#packSize").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (drugWinDb == null || drugWinDb === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWinDb = 1;
- }
- if (dayNum == null || dayNum === "") {
- if (currentGroupNo == '71') {
- return;
- }
- dayNum = 1;
- }
- if (drugWin == null || drugWin === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWin = 1;
- }
- if (times == null || times === "") {
- if (currentGroupNo == '71') {
- return;
- }
- times = 1;
- }
- if (packSize == null || packSize === "") {
- return;
- }
- //拆零总量
- var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
- //整包装的数量
- var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
- $("#gross").val(totalNum);
- $("#totalRetprice").val(Multiply(totalNum, packRetprice).toFixed(2));
- }
- /**
- * 根据选择的总量计算金额 只有医材的时候需要计算
- */
- function calculateSimple() {
- //总量
- var gross = $("#gross").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- $("#totalRetprice").val(Multiply(gross, packRetprice).toFixed(2));
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (currentGroupNo == '91') {
- //医材默认天数为1
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- }
- /**
- * 根据中药付数计算金额
- */
- function calculateZyAmount() {
- var singleAmount = $("#singleAmount").val();
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //获取中药付数
- var zyfs = $(tableId).find("input.zyfs").val();
- var cfAmount = Multiply(zyfs, singleAmount);
- $(tableId).find("span.cf_amount").html(cfAmount);
- calculateTotalAmount();
- }
- /**
- * 将病人信息填入患者信息修改form
- * @param patinet
- */
- function fillPlusPatinet(patinet) {
- if (patinet != null) {
- $("#editUserCode").val(patinet.patientId);
- $("#editUserName").val(patinet.name);
- $("#editUserName").blur();
- $("#editUserAge").val(patinet.age);
- $("#editUserAge").blur();
- $("#editUserGender").selectpicker('val', patinet.sex);
- $("#editUserGender").selectpicker('refresh');
- $("#editUserGender").blur();
- $("#editUserBirthDay").val(patinet.birthDayStr);
- $("#editUserBirthDay").blur();
- $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(patinet.icCardNo);
- $("#editUserCardNo").attr("title", patinet.icCardNo);
- $("#editUserCardNo").blur();
- $("#editUserPhoneNum").val(patinet.phoneNo);
- $("#editUserPhoneNum").attr("title", patinet.phoneNo);
- $("#editUserPhoneNum").blur();
- $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserPatientsNature").blur();
- $("#editUserIdCard").val(patinet.socialNo);
- $("#editUserIdCard").attr("title", patinet.socialNo);
- $("#editUserIdCard").blur();
- $("#editUserAddress").val(patinet.address);
- $("#editUserAddress").blur();
- $("#editUserContact").val(patinet.relName);
- $("#editUserContactPhone").val(patinet.contractName);
- }
- }
- /**
- * 修改病人信息
- */
- function modifyPatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/modifyPatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#editUserName").val(),
- "age": $("#editUserAge").val(),
- "sex": $("#editUserGender").val(),
- "birthDay": $("#editUserBirthDay").val(),
- "certificateType": $("#editUserCertificateType").val(),
- "icCardNo": $("#editUserCardNo").val(),
- "phoneNo": $("#editUserPhoneNum").val(),
- "responseType": $("#editUserPatientsNature").val(),
- "socialNo": $("#editUserIdCard").val(),
- "address": $("#editUserAddress").val(),
- "patientId": $("#editUserCode").val(),
- "relName": $("#editUserContact").val(),
- "contractName": $("#editUserContactPhone").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#editUserModal').modal('hide');
- realClinicalReception($("#patientId").text(), $("#mzfzSerialNoInClick").val());
- clearPlusPatinet();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 将病人信息修改域置空
- * @param patinet
- */
- function clearPlusPatinet() {
- $("#editUserCode").val(null);
- $("#editUserName").val(null);
- $("#editUserAge").val(null);
- $("#editUserGender").selectpicker('val', '1');
- $("#editUserGender").selectpicker('refresh');
- $("#editUserBirthDay").val(null);
- $('#editUserCertificateType').selectpicker('val', '01');
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(null);
- $("#editUserCardNo").attr("title", null);
- $("#editUserPhoneNum").val(null);
- $("#editUserPhoneNum").attr("title", null);
- $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserIdCard").val(null);
- $("#editUserIdCard").attr("title", null);
- $("#editUserAddress").val(null);
- $("#editUserContact").val(null);
- $("#editUserContactPhone").val(null);
- }
- // /**
- // * 保存入院证
- // */
- // function saveBeHospitalized() {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/saveMzZyReq',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "patientId": $("#patientId").text(),
- // "icdCode": $("#icdCodeBeHospitalized").val(),
- // "icdText": $("#icdTextBeHospitalized").val(),
- // "reqDept": $("#inpatientWardBeHospitalized").val(),
- // "smallDept": $("#smallWardBeHospitalized").val(),
- // "admissStatus": $("#admissStatus").val()
- // }),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (res.code == 0) {
- // successMesage(res);
- // $('#beHospitalizedModal').modal('hide');
- // loadInClinicTableList();
- // loadClinicTableList();
- // clearWorkSpace();
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
- function getRePortRangeArr() {
- var rePortRange = $('#reportrange span').html();
- var rePortRangeArr = rePortRange.split(" - ");
- rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
- rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
- return rePortRangeArr;
- }
- /**
- * 初始医生工作太配置
- */
- function initWorkspaceConfigForCurrent() {
- $.ajax({
- type: "GET",
- url: '/thmz/getWorkspaceConfigForCurrent',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data.symptomFlag == 1) {
- $("#symptomFlag").removeClass("in").addClass("hide");
- if ($("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.symptomFlag == 0) {
- $("#symptomFlag").removeClass("hide").addClass("in");
- if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrHpiFlag == 1) {
- $("#emrHpiFlag").removeClass("in").addClass("hide");
- if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrHpiFlag == 0) {
- $("#emrHpiFlag").removeClass("hide").addClass("in");
- if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrPsFlag == 1) {
- $("#emrPsFlag").removeClass("in").addClass("hide");
- if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrPsFlag == 0) {
- $("#emrPsFlag").removeClass("hide").addClass("in");
- if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.personalHistoryFlag == 1) {
- $("#personalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.personalHistoryFlag == 0) {
- $("#personalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.familyHistoryFlag == 1) {
- $("#familyHistoryFlag").removeClass("in").addClass("hide");
- if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.familyHistoryFlag == 0) {
- $("#familyHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.obstericalHistoryFlag == 1) {
- $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.obstericalHistoryFlag == 0) {
- $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.pressureLeftFlag == 1) {
- $("#pressureLeftFlag").removeClass("in").addClass("hide");
- if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.pressureLeftFlag == 0) {
- $("#pressureLeftFlag").removeClass("hide").addClass("in");
- if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.tentativeDiagnosisFlag == 1) {
- $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
- if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.tentativeDiagnosisFlag == 0) {
- $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
- if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存医生工作台配置
- */
- function saveWorkspaceConfig() {
- var symptomFlag = $("#symptomFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrHpiFlag = $("#emrHpiFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrPsFlag = $("#emrPsFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var personalHistoryFlag = $("#personalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var familyHistoryFlag = $("#familyHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var obstericalHistoryFlag = $("#obstericalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var pressureLeftFlag = $("#pressureLeftFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var tentativeDiagnosisFlag = $("#tentativeDiagnosisFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- $.ajax({
- type: "POST",
- url: '/thmz/saveWorkspaceConfig',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "symptomFlag": symptomFlag,
- "emrHpiFlag": emrHpiFlag,
- "emrPsFlag": emrPsFlag,
- "personalHistoryFlag": personalHistoryFlag,
- "familyHistoryFlag": familyHistoryFlag,
- "obstericalHistoryFlag": obstericalHistoryFlag,
- "pressureLeftFlag": pressureLeftFlag,
- "tentativeDiagnosisFlag": tentativeDiagnosisFlag
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //successMesage(res);
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化药品,检查检验菜单树
- */
- function initzTree() {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- var webuiId = $("#treeButton").attr("data-target");
- var top = $("#" + webuiId).css("top");
- if (top.indexOf("-") == 0) {
- $("#" + webuiId).css("top", '0px');
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 2) {
- $("#jcJyItem").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJyJcZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- var webuiId = $("#treeButton").attr("data-target");
- var top = $("#" + webuiId).css("top");
- if (top.indexOf("-") == 0) {
- $("#" + webuiId).css("top", '0px');
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 1) {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("中药暂无帮助字典");
- } else if (index == 3) {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("诊疗暂无帮助字典");
- } else {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("入院暂无帮助字典");
- }
- }
- /**
- * 节点点击事件
- * @param event
- * @param treeId
- * @param treeNode
- */
- function zTreeOnClick(event, treeId, treeNode) {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").val(treeNode.id);
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0, null);
- } else if (index == 2) {
- $("#jcJyItem").val(treeNode.id);
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList(null);
- }
- }
- /**
- * 构建处方参数
- * @returns {any}
- */
- function getParamsForpPrescription() {
- var codes = $("#diagnoseValue").val();
- var icdCode = null;
- if (codes != null && codes.length > 0) {
- var arr = codes.split(",");
- if (arr != null) {
- for (i = 0; i < arr.length; i++) {
- if (arr[i] != "") {
- if (icdCode == null) {
- icdCode = arr[i];
- } else {
- icdCode += "," + arr[i];
- }
- }
- }
- }
- }
- var jsonData = JSON.parse('{"patientId": "","firstOrNot":"","icdCode": "","icdText": null,"jzFlag": "0","serialNo":"","mzBlRecord": {"firstOrNot": "","emrChiefComplaint": "","emrHpi": "","emrPs": "","emrPe": "","emrFzjc": null,"emrProcess": null,"emrXyy": "无","emrYypg": "无","emrGnpg": "无","emrJkjy": "","personalHistory": "","familyHistory": "","obstericalHistory": "","weight": "","temperature": "","sphygmus": "","breathe": "","pressureHigh": "","pressureFloor": "","pressureHighLeft": "","pressureFloorLeft": "","tentativeDiagnosis":"","prescriptionDetail":""},"mzChargeDetailList": [],"mzYjReqList": [],"mzZyReq": {"reqDept": "","smallDept": "","admissStatus": ""}}');
- jsonData.patientId = $("#patientId").text();
- jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
- jsonData.icdCode = icdCode;
- jsonData.serialNo = $("#mzfzSerialNoInClick").val();
- jsonData.mzBlRecord.firstOrNot = jsonData.firstOrNot;
- jsonData.mzBlRecord.emrChiefComplaint = $("#symptom").val();
- jsonData.mzBlRecord.emrHpi = $("#emrHpi").val();
- jsonData.mzBlRecord.emrPs = $("#emrPs").val();
- jsonData.mzBlRecord.emrPe = $("#otherCheck").val();
- jsonData.mzBlRecord.emrJkjy = $("#healthEducation").val();
- jsonData.mzBlRecord.personalHistory = $("#personalHistory").val();
- jsonData.mzBlRecord.familyHistory = $("#familyHistory").val();
- jsonData.mzBlRecord.obstericalHistory = $("#obstericalHistory").val();
- jsonData.mzBlRecord.weight = $("#weight").val();
- jsonData.mzBlRecord.temperature = $("#temperature").val();
- jsonData.mzBlRecord.sphygmus = $("#sphygmus").val();
- jsonData.mzBlRecord.breathe = $("#breathe").val();
- jsonData.mzBlRecord.pressureHigh = $("#pressure_high").val();
- jsonData.mzBlRecord.pressureFloor = $("#pressure_floor").val();
- jsonData.mzBlRecord.pressureHighLeft = $("#pressure_high_left").val();
- jsonData.mzBlRecord.pressureFloorLeft = $("#pressure_floor_left").val();
- jsonData.mzBlRecord.tentativeDiagnosis = $("#tentativeDiagnosis").val();
- //设置处方详情
- var emrFzjc = null;
- var xyTabContents = $("#xyTabContent").find("div.tab-pane");
- //处方号
- var orderNo = 0;
- var arrs = $("span.cf_amount");
- //西药设置
- if (xyTabContents != null && xyTabContents.length > 0) {
- for (var i = 0; i < xyTabContents.length; i++) {
- //当前药品类型
- var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "","frequency": "","orderDays": "","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":""}');
- tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(formGroups[j]).find("input.temporary_items_gross").val();
- tempJson.drugQuan = $(formGroups[j]).find("input.temporary_items_drugWin").val();
- tempJson.drugUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnit").val();
- tempJson.frequency = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
- tempJson.orderDays = $(formGroups[j]).find("input.temporary_items_dayNum").val();
- tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
- tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
- tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
- orderNo = i + 1;
- tempJson.orderNo = orderNo;
- tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
- tempJson.groupNo = currentGroupNo;
- var tryFlag = $(formGroups[j]).find("input.temporary_items_tryFlag").val();
- if (tryFlag == true || tryFlag == "true") {
- tempJson.tryFlag = 1;
- }
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- }
- }
- //中草药
- var zyTabContents = $("#zyTabContent").find("div.form-group");
- if (zyTabContents != null && zyTabContents.length > 0) {
- orderNo++;
- var zyfs = $("input.zyfs").val();
- //中药的类型
- var currentZyClassType = $("#current_zyClassType").val();
- for (var i = 0; i < zyTabContents.length; i++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "g","frequency": "","orderDays": "1","paySelf": "0","drugWin": "","instructionCode":"","instructionText":"","orderNo":"1","groupOrder":"1","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":""}');
- tempJson.chargeItemCode = $(zyTabContents[i]).find("input.temporary_items_code").val();
- tempJson.serial = $(zyTabContents[i]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugQuan = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugWin = zyfs;
- tempJson.frequency = $("#zy_orderFrequency_1").val();
- tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
- tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
- tempJson.cyFysm = $("#useType_1").val();
- tempJson.cyJssm = $("#cyJssm").val();
- tempJson.cyDj = $("#zy_supplyType_1").val();
- tempJson.orderNo = orderNo;
- tempJson.groupNo = currentZyClassType;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- //辅助检查、检验
- var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
- if (jcjyTabContents != null && jcjyTabContents.length > 0) {
- orderNo++;
- for (var i = 0; i < jcjyTabContents.length; i++) {
- if (emrFzjc == null) {
- emrFzjc = $(jcjyTabContents[i]).text();
- } else {
- emrFzjc += "," + $(jcjyTabContents[i]).text();
- }
- var tempJson = null;
- //项目类型
- var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
- //执行科室
- var execUnit = $(jcjyTabContents[i]).find("input.temporary_items_execUnit").val();
- tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":""}');
- tempJson.orderCode = $(jcjyTabContents[i]).find("input.temporary_items_code").val();
- if (itemsType == "1" || itemsType == 1) {
- //检验
- tempJson.inspectStuff = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
- } else if (itemsType == "2" || itemsType == 2) {
- //检查
- tempJson.inspectPart = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
- }
- tempJson.jyRemark = $(jcjyTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
- }
- }
- //诊疗
- var zlTabContents = $("#zlTabContent").find("div.form-group");
- if (zlTabContents != null && zlTabContents.length > 0) {
- orderNo++;
- for (var i = 0; i < zlTabContents.length; i++) {
- var tempJson = null;
- //执行科室
- var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
- //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
- tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "1","drugQuan": "1","drugUnit": "","frequency": "","orderDays": "1","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":"00","execDept":""}');
- tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
- tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- //入院
- var zyReqTabContents = $("#zyReqTabContent").find("div.form-group");
- if (zyReqTabContents != null && zyReqTabContents.length > 0) {
- jsonData.mzZyReq.reqDept = $(zyReqTabContents[0]).find("input.temporary_inpatient_ward").val();
- jsonData.mzZyReq.smallDept = $(zyReqTabContents[0]).find("input.temporary_items_small_ward").val();
- jsonData.mzZyReq.admissStatus = $(zyReqTabContents[0]).find("input.temporary_items_admiss_status").val();
- }
- //设置诊断名称
- var icdText = null;
- var tagsTexts = $("span.el-select__tags-text");
- if (tagsTexts != null && tagsTexts.length > 0) {
- for (var i = 0; i < tagsTexts.length; i++) {
- if (icdText == null) {
- icdText = $(tagsTexts[i]).text();
- } else {
- icdText += "," + $(tagsTexts[i]).text();
- }
- }
- }
- jsonData.icdText = icdText;
- jsonData.mzBlRecord.emrFzjc = emrFzjc;
- return jsonData;
- }
- /**
- * 保存处方
- */
- function savePrescription() {
- //关闭帮助框
- $("#treeButton").webuiPopover('hide');
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- $("#messageModal").modal();
- $("#messageContent").html("确认保存处方吗?");
- $("#messageButton").off("click").on("click", function (t) {
- //$("#messageModal").modal("hide");
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- clearWorkSpace();
- loadInClinicTableList();
- loadClinicTableList();
- //$("#messageModal").modal();
- $("#messageContent").html("门诊处方保存成功,是否打印处方和门诊指引单?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
- });
- $("#cancelButton").off("click");
- } else {
- $("#messageModal").modal("hide");
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 保存医疗范文
- */
- function saveapidAccepts() {
- var templateName = $("#templateName").val();
- if (templateName == null || templateName == "") {
- errorMesageSimaple("范文名称不能为空!");
- return;
- }
- var templateKindType = $("#templateKindType").val();
- if (templateKindType == null || templateKindType == "") {
- errorMesageSimaple("范文类型不能为空!");
- return;
- }
- var templateType = $("#templateType").val();
- if (templateType == null || templateType == "") {
- errorMesageSimaple("范文范围不能为空!");
- return;
- }
- var templateStatus = $("#templateStatus").val();
- if (templateStatus == null || templateStatus == "") {
- errorMesageSimaple("范文状态不能为空!");
- return;
- }
- $("#saveapidAcceptsModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认保存医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/saveTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#templateId").val(),
- "name": templateName,
- "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
- "templateKindType": templateKindType,
- "templateType": templateType,
- "templateStatus": templateStatus,
- "templateData": JSON.stringify(jsonData),
- "emrChiefComplaint": $("#symptom").val(),
- "emrHpi": $("#emrHpi").val(),
- "emrPs": $("#emrPs").val(),
- "icdCode": $("#diagnoseValue").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- //范本保存完不清空
- //clearWorkSpace();
- } else {
- $("#saveapidAcceptsModal").modal();
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 停用医疗范文
- */
- function removeTemplate() {
- $("#messageModal").modal();
- $("#messageContent").html("确认停用医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/removeTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#idTemplate").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#medicalModelModal").modal("hide");
- fitTemplateData();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 清空医疗范文模块内容
- */
- function clearApidAcceptsModal() {
- $("#templateId").val(null);
- $("#templateName").val(null);
- $("#templateKindType").selectpicker('val', 0);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', 0);
- $("#templateType").selectpicker('refresh');
- $("#templateStatus").selectpicker('val', 0);
- $("#templateStatus").selectpicker('refresh');
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- loadInClinicTableList();
- loadClinicTableList();
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- });
- }
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改 通用方法
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=5&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 0)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询病人已缴费处方信息 调用处方
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoPaid(patientId, times, clnicId) {
- $("#visitingDetailModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
- clearUser(false);
- clearWorkSpaceExcludeUser();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 2)
- $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 重复接诊
- * @param patientId
- * @param times
- * @param clnicId
- * @param deptCode 就诊科室编码
- */
- function repeatAccepts(patientId, times, clnicId, deptCode) {
- $.ajax({
- type: "GET",
- url: '/thmz/validMzyReqrec?patientId=' + patientId + "&deptCode=" + deptCode,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == 0) {
- $("#messageModal").modal();
- $("#messageContent").html("挂号失效,确定继续就诊?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- repeatAcceptsConfirm(patientId, times, clnicId);
- });
- $("#cancelButton").off("click");
- return;
- }
- repeatAcceptsConfirm(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 重复接诊提示方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsConfirm(patientId, times, clnicId) {
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- repeatAcceptsCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription();
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- repeatAcceptsCommon(patientId, times, clnicId);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- repeatAcceptsCommon(patientId, times, clnicId);
- });
- }
- }
- /**
- * 重复接诊通用方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=true&payMark=null&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 0)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 就诊详情 已诊患者列表发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- */
- function prescriptionDetail(patientId, times, clnicId, payMark) {
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 0);
- }
- /**
- * 就诊详情 历史轨迹发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param clinicStatus
- */
- function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
- var payMark = null;
- if (clinicStatus == 5) {
- payMark = 5;
- } else {
- payMark = 0;
- }
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
- }
- /**
- * 就诊详情通用方法
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param type 0 已诊患者列表发起 1 历史轨迹发起
- */
- function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
- $('#baseMzBlTimes').val(null);
- var oriPayMark = payMark;
- if (payMark == 1) {
- //退费时,查看的明细还是处方开立的情况
- payMark = 0;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#visitingDetailModal").modal();
- var jsonData = res.data;
- var mzPatientMi = res.mzPatientMi;
- $("#visitingDetailPatientName").text(mzPatientMi.name);
- $("#visitingDetailPatientAge").text(mzPatientMi.age);
- $("#visitingDetailPatientGender").val(mzPatientMi.gender);
- $("#prescriptionDetail_zd").html("");
- $("#prescriptionDetail_xyzlContent").html("");
- $("#prescriptionDetail_zyzlContent").html("");
- $("#prescriptionDetail_zlyjContent").html("");
- if (res.opDate != null) {
- $("#visitingDetailDate").text(res.opDate);
- }
- if (res.deptName != null) {
- $("#visitingDetailDept").text(res.deptName);
- }
- if (res.doctorName != null) {
- $("#visitingDetailDoctor").text(res.doctorName);
- }
- var firstOrNot = jsonData.mzBlRecord.firstOrNot;
- if (firstOrNot == 0) {
- $("#visitFlag").html("初诊");
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#visitFlag").html("复诊");
- $("#not").next().click();
- }
- if (oriPayMark == 0) {
- $("#chargeImage").attr("src", "/thmz/images/charge.png");
- } else if (oriPayMark == 1) {
- $("#chargeImage").attr("src", "/thmz/images/refund.png");
- } else if (oriPayMark == 5) {
- $("#chargeImage").attr("src", "/thmz/images/nocharge.png");
- }
- var icdText = jsonData.icdText;
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#prescriptionDetail_zd").html(html);
- } else {
- $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
- }
- var emrProcess = jsonData.mzBlRecord.emrProcess;
- if (emrProcess != null) {
- var xy = null;
- if (emrProcess.indexOf("西药治疗:") >= 0) {
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
- } else if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
- } else if (emrProcess.indexOf("诊疗:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
- } else if (emrProcess.indexOf("入院处理:") >= 0) {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("入院处理:"));
- } else {
- xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
- }
- var arr = xy.split("_");
- if (arr != null && arr.length > 0) {
- var xyhtml = "";
- for (var i = 0; i < arr.length; i++) {
- xyhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- xyhtml += arr[i];
- xyhtml += "</div>";
- }
- $("#prescriptionDetail_xyzlContent").html(xyhtml);
- $("#prescriptionDetail_xyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_xyzlTitle").removeClass("in").addClass("hide");
- }
- var zy = null;
- if (emrProcess.indexOf("中药治疗:") >= 0) {
- if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
- } else if (emrProcess.indexOf("诊疗:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
- } else if (emrProcess.indexOf("入院处理:") >= 0) {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("入院处理:"));
- } else {
- zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
- }
- var zyArr = zy.split("_");
- if (zyArr != null && zyArr.length > 0) {
- var zyhtml = "";
- for (var i = 1; i < zyArr.length; i++) {
- if (i % 4 == 1) {
- zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- }
- zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
- zyhtml += zyArr[i];
- zyhtml += "</div>";
- if (i % 4 == 0) {
- zyhtml += '</div>';
- }
- }
- var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
- if (zyfs != null && zyfs != "") {
- if (zyArr.length % 4 == 1) {
- zyhtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- }
- zyhtml += '<div class="col-md-3 col-sm-3 col-xs-12">';
- zyhtml += ' <div style="text-indent: 2em;">';
- zyhtml += ' <div>';
- zyhtml += 'X<span>';
- zyhtml += zyfs;
- zyhtml += '</span> 付</div></div>';
- zyhtml += '</div>';
- }
- $("#prescriptionDetail_zyzlContent").html(zyhtml);
- $("#prescriptionDetail_zyzlTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
- var zlyj = null;
- if (emrProcess.indexOf("诊疗:") >= 0) {
- zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
- } else if (emrProcess.indexOf("入院处理:") >= 0) {
- zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("入院处理:"));
- } else {
- zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
- }
- var zlyjArr = zlyj.split("_");
- if (zlyjArr != null && zlyjArr.length > 0) {
- var zlyjhtml = "";
- for (var i = 0; i < zlyjArr.length; i++) {
- zlyjhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- zlyjhtml += zlyjArr[i];
- zlyjhtml += "</div>";
- }
- $("#prescriptionDetail_zlyjContent").html(zlyjhtml);
- $("#prescriptionDetail_zlyjTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("诊疗:") >= 0) {
- var zl = null;
- if (emrProcess.indexOf("入院处理:") >= 0) {
- zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3, emrProcess.indexOf("入院处理:"));
- } else {
- zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
- }
- var zlArr = zl.split("_");
- if (zlArr != null && zlArr.length > 0) {
- var zlhtml = "";
- for (var i = 0; i < zlArr.length; i++) {
- zlhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- zlhtml += zlyjArr[i];
- zlhtml += "</div>";
- }
- $("#prescriptionDetail_zlContent").html(zlhtml);
- $("#prescriptionDetail_zlTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zlyjTitle").removeClass("in").addClass("hide");
- }
- if (emrProcess.indexOf("入院处理:") >= 0) {
- var zyReq = emrProcess.substring(emrProcess.indexOf("入院处理:") + 5);
- if (zyReq != null && zyReq != "") {
- var zyReqhtml = "<div style='margin-bottom: 5px;padding-left: 10px;'>";
- zyReqhtml += zyReq;
- zyReqhtml += "</div>";
- $("#prescriptionDetail_zyReqContent").html(zyReqhtml);
- $("#prescriptionDetail_zyReqTitle").removeClass("hide").addClass("in");
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- }
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- }
- }
- $("#printJcReq").removeClass("in").addClass("hide");
- $("#printJcReq").off("click");
- $("#printJyReq").removeClass("in").addClass("hide");
- $("#printJyReq").off("click");
- $("#printJcReqSetup").removeClass("in").addClass("hide");
- $("#printJcReqSetup").off("click");
- $("#printJyReqSetup").removeClass("in").addClass("hide");
- $("#printJyReqSetup").off("click");
- $("#previewYjReq").removeClass("in").addClass("hide");
- $("#previewYjReq").off("click");
- $("#previewYjReqAll").removeClass("in").addClass("hide");
- $("#previewYjReqAll").off("click");
- $("#deletePrescription").removeClass("in").addClass("hide");
- $("#deletePrescription").off("click");
- if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
- $("#previewYjReq").removeClass("hide").addClass("in");
- $("#previewYjReq").off("click").on("click", function (t) {
- previewYjReq(patientId, times);
- });
- }
- if (res.yjReqCount != null && res.yjReqCount > 0) {
- $("#previewYjReqAll").removeClass("hide").addClass("in");
- $("#previewYjReqAll").off("click").on("click", function (t) {
- previewYjReqAll(patientId);
- });
- }
- if (type == 0) {
- $("#callPrescription").removeClass("in").addClass("hide");
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- $("#printPrescription").removeClass("hide").addClass("in");
- $("#printPrescription").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 1);
- });
- $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- $("#printPrescriptionSetup").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 2);
- });
- }
- if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
- var hadJc = false;
- var hadJy = false;
- for (var i = 0; i < jsonData.mzYjReqList.length; i++) {
- var mzYjReq = jsonData.mzYjReqList[i];
- if (mzYjReq.reqType == 2) {
- hadJy = true;
- } else if (mzYjReq.reqType == 3) {
- hadJc = true;
- }
- }
- if (hadJc) {
- $("#printJcReq").removeClass("hide").addClass("in");
- $("#printJcReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 1);
- });
- $("#printJcReqSetup").removeClass("hide").addClass("in");
- $("#printJcReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 2);
- });
- }
- if (hadJy) {
- $("#printJyReq").removeClass("hide").addClass("in");
- $("#printJyReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 1);
- });
- $("#printJyReqSetup").removeClass("hide").addClass("in");
- $("#printJyReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 2);
- });
- }
- }
- if (jsonData.mzZyReq == null || jsonData.mzZyReq.reqDept == null || jsonData.mzZyReq.reqDept == "") {
- $("#printZyReq").removeClass("in").addClass("hide");
- $("#printZyReq").off("click");
- $("#printZyReqSetup").removeClass("in").addClass("hide");
- $("#printZyReqSetup").off("click");
- } else {
- $("#printZyReq").removeClass("hide").addClass("in");
- $("#printZyReq").off("click").on("click", function (t) {
- printZyReq(patientId, 1);
- });
- $("#printZyReqSetup").removeClass("hide").addClass("in");
- $("#printZyReqSetup").off("click").on("click", function (t) {
- printZyReq(patientId, 2);
- });
- }
- //未缴费状态的时候可以删除处方
- if (oriPayMark == 5 || oriPayMark == "5") {
- $("#deletePrescription").removeClass("hide").addClass("in");
- $("#deletePrescription").off("click").on("click", function (t) {
- deletePrescription(clnicId);
- });
- }
- } else {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printZyReq").removeClass("in").addClass("hide");
- $("#printBlRecord").removeClass("in").addClass("hide");
- $("#printJcReq").removeClass("in").addClass("hide");
- $("#printJyReq").removeClass("in").addClass("hide");
- $("#callPrescription").removeClass("hide").addClass("in");
- $("#callPrescription").off("click").on("click", function (t) {
- getMzPrescriptionVoPaid(patientId, times, clnicId);
- });
- }
- if (oriPayMark == 1) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0)) {
- $("#printPrescription").removeClass("in").addClass("hide");
- $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- } else {
- $("#printPrescription").removeClass("hide").addClass("in");
- $("#printPrescription").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 1);
- });
- $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- $("#printPrescriptionSetup").off("click").on("click", function (t) {
- printPrescription(patientId, times, clnicId, payMark, 2);
- });
- }
- }
- $("#printBlRecord").removeClass("hide").addClass("in");
- $("#printBlRecord").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 1);
- });
- $("#printBlRecordSetup").removeClass("hide").addClass("in");
- $("#printBlRecordSetup").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 2);
- });
- $("#showMzBlRecordModal").removeClass("hide").addClass("in");
- $("#showMzBlRecordModal").off("click").on("click", function (t) {
- showMzBlRecordModal(patientId, times, 1);
- });
- if ($("#setupId").hasClass("fa-chevron-up")) {
- //默认不展开打印设置
- $("#setupId").parent().click();
- }
- // setTimeout(function () {
- // if ($("#setupId").hasClass("fa-chevron-up")) {
- // //默认不展开打印设置
- // $("#setupId").parent().click();
- // }
- // }, 400);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询默认打印机
- */
- function setPrint() {
- if (printIndex >= 0) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getLastWindowsByCurrentUser',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- printIndex = res.data.cgPrintIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
- function setTableHtml(prescriptionDetail) {
- var html = "";
- for (var j = 0; j < prescriptionDetail.length; j++) {
- html += "<tr><td>";
- html += prescriptionDetail[j].substring(0, prescriptionDetail[j].indexOf("用法"));
- html += "</td></tr>";
- html += "<tr><td>";
- html += prescriptionDetail[j].substring(prescriptionDetail[j].indexOf("用法"));
- html += "</td></tr>";
- }
- html += "<tr><td> ------(以下空白)------</td></tr>";
- return {html: html, j: j};
- }
- // /**
- // * 打印门诊指引单
- // * @param patientId
- // * @param times
- // */
- // function printGuideCard(patientId, times) {
- //
- // }
- /**
- * 打印门诊处方
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printPrescription(patientId, times, clnicId, payMark, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null && prescriptionDetail != "") {
- var prescriptionDetailJson = JSON.parse(prescriptionDetail);
- //当前处方只开了住院证则只打印住院证
- if (prescriptionDetailJson.xyPrescription.jePrescription.length == 0 && prescriptionDetailJson.xyPrescription.mjPrescription.length == 0 && prescriptionDetailJson.xyPrescription.pyPrescription.length == 0 && prescriptionDetailJson.xyPrescription.ycPrescription.length == 0 && prescriptionDetailJson.zlPrescription.length == 0 && prescriptionDetailJson.zyPrescription.length == 0 && prescriptionDetailJson.zyReqPrescription.length > 0) {
- printZyReq(patientId, 1);
- return;
- }
- var index = 0;
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院处方笺");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- //LODOP.SET_SHOW_MODE("SETUP_ENABLESS",getCheckSS());
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientNamePrescription").text(mzPatientMi.name);
- $("#patientGenderPrescription").text(mzPatientMi.gender);
- $("#patientAgePrescription").text(mzPatientMi.age);
- $("#patientIdPrescription").text(mzPatientMi.patientId);
- $("#deptPrescription").text(res.deptName);
- $("#doctorPrescription").text(res.doctorName);
- $("#cfTime").text(res.opDate);
- $("#socialNo").text(mzPatientMi.socialNo);
- $("#zdPrescription").text(res.data.icdText);
- $("#patientIdGuideCard").text(mzPatientMi.patientId);
- $("#patientNameGuideCard").text(mzPatientMi.name);
- $("#patientDateGuideCard").text(format(new Date(), "yyyy-MM-dd"));
- //普药处方
- var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
- if (pyPrescription != null && pyPrescription.length > 0) {
- for (var i = 0; i < pyPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = pyPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("普通处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(pyPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //医材处方
- var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
- if (ycPrescription != null && ycPrescription.length > 0) {
- for (var i = 0; i < ycPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = ycPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("医材处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //麻精处方
- var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
- if (mjPrescription != null && mjPrescription.length > 0) {
- for (var i = 0; i < mjPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = mjPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("麻、精一处方");
- $("#cfTitle").text("麻、精一");
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //精二处方
- var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
- if (jePrescription != null && jePrescription.length > 0) {
- for (var i = 0; i < jePrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = jePrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("精二处方");
- $("#cfTitle").text("精二");
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //中药处方
- if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0) {
- var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;
- if (zyPrescription != null && zyPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zyPrescription.length; i++) {
- if (i % 3 == 0) {
- html += "<tr>";
- }
- html += "<td>";
- html += zyPrescription[i].trim();
- if (i % 3 == 2) {
- html += "</td></tr>";
- } else {
- html += "</td>";
- }
- }
- if (zyPrescription.length % 3 != 0) {
- html += "</tr>";
- }
- html += "<tr><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td>";
- var colNum = 1;
- var frequency = prescriptionDetailJson.zyPrescription[0].frequency;
- if (frequency != null && frequency != "") {
- html += "<td>频率:" + frequency + "</td>";
- colNum++;
- }
- var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
- if (cyJssm != null && cyJssm != "") {
- html += "<td>加水说明:" + cyJssm + "</td>";
- colNum++;
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
- if (cyFysm != null && cyFysm != "") {
- colNum++;
- if (colNum % 3 == 1) {
- html += "<tr>";
- }
- html += "<td>服用说明:" + cyFysm + "</td>";
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
- if (cyDj != null && cyDj != "") {
- colNum++;
- if (colNum % 3 == 1) {
- html += "<tr>";
- }
- html += "<td>" + cyDj + "</td>";
- if (colNum % 3 == 0) {
- html += "</tr>";
- }
- }
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("中药处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 (不含代煎费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //暂时不打印 诊疗了
- var printZlPrescription = false;
- if (printZlPrescription) {
- if (prescriptionDetailJson.zlPrescription != null && prescriptionDetailJson.zlPrescription.length > 0) {
- //诊疗处方
- var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
- if (zlPrescription != null && zlPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zlPrescription.length; i++) {
- html += "<tr><td>";
- html += zlPrescription[i];
- html += "</td></tr>";
- }
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("诊疗处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- }
- //检查申请单打印
- var mzYjReqList = res.data.mzYjReqList;
- if (mzYjReqList != null && mzYjReqList.length > 0) {
- $("#patientIdJcReq").text(mzPatientMi.patientId);
- $("#patientNameJcReq").text(mzPatientMi.name);
- $("#patientGenderJcReq").text(mzPatientMi.gender);
- $("#patientAgeJcReq").text(mzPatientMi.age + "岁");
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.icdText);
- var mzBlRecord = res.data.mzBlRecord;
- $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jcReqHis").text(mzBlRecord.emrHpi);
- var tz = getTz(mzBlRecord);
- $("#jcReqTz").text(tz);
- $("#jcReqReqDept").text(res.deptName);
- $("#jcReqReqDoctor").text(res.doctorName);
- for (var i = 0; i < mzYjReqList.length; i++) {
- var mzYjReq = mzYjReqList[i];
- if (i == 0) {
- var dateStr = format(mzYjReq.reqDate, "yyyy-MM-dd");
- $("#jcReqReqDate").text(dateStr);
- }
- if (mzYjReq == null || mzYjReq.reqType == 2) {
- continue;
- }
- if ((i == 0 && index > 0) || i > 0) {
- LODOP.NewPageA();
- }
- $("#reqNoJcReq").text(mzYjReq.reqNo);
- $("#jcReqItem").text(mzYjReq.groupName);
- $("#jcReqRemark").text(mzYjReq.jyRemark);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
- index++;
- }
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- var html = "";
- for (var i = 0; i < res.data.length; i++) {
- html += "<tr><td>" + res.data[i].itemType + "</td><td>" + Division(res.data[i].itemTotalFee, 100).toFixed(2) + "</td><td>" + res.data[i].execDeptName + "</td><td>" + res.data[i].execDeptAddress + "</td></tr>"
- }
- $("#guideCardDetail").html(html);
- }
- if (res.payQrcode != null && res.payQrcode != "") {
- $("#payQrcodeGuideCard").html(null);
- new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
- $("canvas").attr("id", "erw");
- var canvas = document.getElementById('erw');
- var src = canvas.toDataURL("image/png");
- //var strDataURI =canvas.toDataURL("image/png");
- $("#payQrcodeGuideCard").html("<img src='" + src + "' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>微信支付</div>");
- }
- $("#totalAmountGuideCard").text("¥" + res.totalAmount);
- // $("#imgcode").JsBarcode(patientId);
- console.log(patientId);
- JsBarcode('#imgcode', patientId, {
- lineColor: '#333', //线条颜色
- width: 2, //线宽
- height: 60, //条码高度
- displayValue: false, //是否显示文字信息
- });
- if (index > 0) {
- LODOP.NewPageA();
- }
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
- //LODOP.PRINT();
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else if (res.code == -2) {
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- // printGuideCard(patientId, times);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 构建体征描述
- * @param mzBlRecord
- * @returns {*}
- */
- function getTz(mzBlRecord) {
- var tz = null;
- if (mzBlRecord.weight != null && mzBlRecord.weight != 0) {
- var temp = "体重:" + mzBlRecord.weight + "kg ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.temperature != null && mzBlRecord.temperature != 0) {
- var temp = "体温:" + mzBlRecord.temperature + "℃ ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.sphygmus != null && mzBlRecord.sphygmus != 0) {
- var temp = "脉搏:" + mzBlRecord.sphygmus + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.breathe != null && mzBlRecord.breathe != 0) {
- var temp = "呼吸:" + mzBlRecord.breathe + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHigh != null && mzBlRecord.pressureFloor != null && mzBlRecord.pressureHigh != 0 && mzBlRecord.pressureFloor != 0) {
- var temp = "血压:" + mzBlRecord.pressureHigh + "/" + mzBlRecord.pressureFloor;
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHighLeft != null && mzBlRecord.pressureFloorLeft != null && mzBlRecord.pressureHighLeft != 0 && mzBlRecord.pressureFloorLeft != 0) {
- var temp = "左血压:" + mzBlRecord.pressureHighLeft + "/" + mzBlRecord.pressureFloorLeft;
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- return tz;
- }
- /**
- * 打印医技申请单
- * @param patientId
- * @param times
- * @param type 申请单类型:2:检验;3:检查
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printYjReq(patientId, times, type, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printYjReq?patientId=' + patientId + '×=' + times + "&reqType=" + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.mzYjReqList == null || res.data.mzYjReqList.length == 0) {
- errorMesageSimaple("没有医技申请单可以打印");
- return;
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院检查申请单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "检查申请单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.data.mzPatientMi;
- $("#patientIdJcReq").text(mzPatientMi.patientId);
- $("#patientNameJcReq").text(mzPatientMi.name);
- $("#patientGenderJcReq").text(mzPatientMi.gender);
- $("#patientAgeJcReq").text(mzPatientMi.age + "岁");
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.mzVisitTable.icdText);
- $("#patientIdJyReq").text(mzPatientMi.patientId);
- $("#patientNameJyReq").text(mzPatientMi.name);
- $("#patientGenderJyReq").text(mzPatientMi.gender);
- $("#patientAgeJyReq").text(mzPatientMi.age + "岁");
- $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
- $("#icdTextJyReq").text(res.data.mzVisitTable.icdText);
- var mzBlRecord = res.data.mzBlRecord;
- $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jcReqHis").text(mzBlRecord.emrHpi);
- $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jyReqHis").text(mzBlRecord.emrHpi);
- var tz = getTz(mzBlRecord);
- $("#jcReqTz").text(tz);
- $("#jcReqReqDept").text(res.data.deptName);
- $("#jcReqReqDoctor").text(res.data.doctorName);
- $("#jyReqTz").text(tz);
- $("#jyReqReqDept").text(res.data.deptName);
- $("#jyReqReqDoctor").text(res.data.doctorName);
- //检验报告列表名
- 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>';
- var jyContent = "";
- var needNewPageA = false;
- for (var i = 0; i < res.data.mzYjReqList.length; i++) {
- var obj = res.data.mzYjReqList[i];
- if (i == 0) {
- var dateStr = format(obj.reqDate, "yyyy-MM-dd");
- $("#jcReqReqDate").text(dateStr);
- $("#jyReqReqDate").text(dateStr);
- }
- if (obj.reqType == "3") {
- if (i > 0) {
- LODOP.NewPageA();
- }
- $("#reqNoJcReq").text(obj.reqNo);
- $("#jcReqItem").text(obj.groupName);
- $("#jcReqRemark").text(obj.jyRemark);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
- needNewPageA = true;
- } else if (obj.reqType == "2") {
- var inspectStuff = (obj.inspectStuff == null || obj.inspectStuff == "null") ? "" : obj.inspectStuff;
- jyContent += '<tr><td style="min-height: 30px;">' + obj.groupName + '</td><td>' + inspectStuff + '</td><td>' + obj.reqNo + '</td></tr>';
- }
- }
- if (jyContent != null && jyContent != "" && jyContent.length > 0) {
- if (needNewPageA) {
- LODOP.NewPageA();
- }
- jyContent = jyTitle + jyContent;
- $("#jyContent").html(jyContent);
- //检验
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jy_card_table").innerHTML);
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印门诊病历
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printBlRecord(patientId, times, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院门诊病历");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊病历");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientIdBlrecord").text(mzPatientMi.patientId);
- $("#patientNameBlrecord").text(mzPatientMi.name);
- $("#patientGenderBlrecord").text(mzPatientMi.gender);
- $("#patientAgeBlrecord").text(mzPatientMi.age + "岁");
- var mzBlRecord = res.mzBlRecord;
- if (mzBlRecord.firstOrNot == "1") {
- $("#firstOrNotTitle").text("复诊");
- } else {
- $("#firstOrNotTitle").text("初诊");
- }
- if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
- $("#emrChiefComplaintBlrecord").text(mzBlRecord.emrChiefComplaint);
- $("#emrChiefComplaintBlrecord").parent().css("display", "block");
- } else {
- $("#emrChiefComplaintBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
- $("#emrHpiBlrecord").text(mzBlRecord.emrHpi);
- $("#emrHpiBlrecord").parent().css("display", "block");
- } else {
- $("#emrHpiBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
- $("#emrPsBlrecord").text(mzBlRecord.emrPs);
- $("#emrPsBlrecord").parent().css("display", "block");
- } else {
- $("#emrPsBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
- $("#personalHistoryBlrecord").text(mzBlRecord.personalHistory);
- $("#personalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#personalHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
- $("#familyHistoryBlrecord").text(mzBlRecord.familyHistory);
- $("#familyHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#familyHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
- $("#obstericalHistoryBlrecord").text(mzBlRecord.obstericalHistory);
- $("#obstericalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#obstericalHistoryBlrecord").parent().css("display", "none");
- }
- var tz = getTz(mzBlRecord);
- if (tz != null && tz != "") {
- $("#tzjcBlrecord").text(tz);
- $("#tzjcBlrecord").parent().css("display", "block");
- } else {
- $("#tzjcBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- $("#emrPeBlrecord").text(mzBlRecord.emrPe);
- $("#emrPeBlrecord").parent().css("display", "block");
- } else {
- $("#emrPeBlrecord").parent().css("display", "none");
- }
- if (res.icdText != null && res.icdText != "") {
- $("#icdTextBlrecord").text(res.icdText);
- $("#icdTextBlrecord").parent().css("display", "block");
- } else {
- $("#icdTextBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
- $("#emrProcessBlrecord").parent().css("display", "block");
- } else {
- $("#emrProcessBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
- $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
- $("#emrJkjyBlrecord").parent().css("display", "block");
- } else {
- $("#emrJkjyBlrecord").parent().css("display", "none");
- }
- $("#visitDeptBlrecord").text(res.deptName);
- $("#visitDoctorBlrecord").text(res.doctorName);
- $("#visitDateBlrecord").text(res.visitDate);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 将内容拼接空格,这样才会有下划线
- * @param mzPatientMi
- * @param maxLength 最大长度
- * @returns {*}
- */
- function formatUnderline(params, maxLength) {
- var length = 0;
- if (params == null || params.length == 0) {
- length = maxLength;
- } else {
- length = maxLength - params.length;
- }
- for (var i = 0; i < length; i++) {
- params += " ";
- }
- return params;
- }
- /**
- * 打印入院通知单
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printZyReq(patientId, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printZyReq?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院入院通知单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var mzZyReq = res.mzZyReq;
- var mzPatientId = formatUnderline(mzPatientMi.patientId, 15);
- $("#patientIdZyReq").text(mzPatientId);
- var mzPatientMiName = formatUnderline(mzPatientMi.name, 22);
- $("#patientNameZyReq").text(mzPatientMiName);
- var mzPatientGender = formatUnderline(mzPatientMi.gender, 10);
- $("#patientGenderZyReq").text(mzPatientGender);
- var mzPatientAge = formatUnderline(mzPatientMi.age + "岁", 6);
- $("#patientAgeZyReq").text(mzPatientAge);
- var mzPatientSocialNo = formatUnderline(mzPatientMi.socialNo, 48);
- $("#sfzZyReq").text(mzPatientSocialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- var mzPatientPhoneNo = formatUnderline(mzPatientMi.phoneNo, 55);
- $("#phoneZyReq").text(mzPatientPhoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- var mzPatientMiAddress = formatUnderline(mzPatientMi.address, 31);
- $("#addressZyReq").text(mzPatientMiAddress);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- var mzPatientMiIcdText = formatUnderline(mzZyReq.icdText, 29);
- $("#icsTextZyReq").text(" " + mzPatientMiIcdText);
- } else {
- var mzPatientMiIcdCode = formatUnderline(mzZyReq.icdCode, 12);
- $("#icsCodeZyReq").text(mzPatientMiIcdCode);
- var mzPatientMiIcdText = formatUnderline(mzZyReq.icdText, 29);
- $("#icsTextZyReq").text(mzPatientMiIcdText);
- }
- var mzZyReqReqWard = formatUnderline(mzZyReq.reqWard, 6);
- $("#reqDeptZyReq").text(mzZyReqReqWard);
- var mzZyReqSmallDept = formatUnderline(mzZyReq.smallDept, 27);
- $("#smallDeptZyReq").text(mzZyReqSmallDept);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
- var mzZyReqVisitDate = formatUnderline(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"), 37);
- $("#visitDateZyReq").text(mzZyReqVisitDate);
- var mzZyReqDeptCode = formatUnderline(mzZyReq.deptCode, 15);
- $("#deptCodeZyReq").text(mzZyReqDeptCode);
- var mzZyReqDoctorCode = formatUnderline(mzZyReq.doctorCode, 16);
- $("#doctorCodeZyReq").text(mzZyReqDoctorCode);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开查看检查检验报告窗口(含往期)
- * @param patientId
- */
- function previewYjReqAll(patientId) {
- $("#visitingDetailModal").modal("hide");
- $("#previewYjReqModal").modal();
- $("#previewYjReqModalPatientId").val(patientId);
- $("#previewYjReqModalTimes").val(null);
- //重置参数
- retryCount = 0;
- initJcJyTable();
- }
- /**
- * 打开查看检查检验报告窗口
- * @param patientId 门诊病人ID
- * @param times 就诊次数
- */
- function previewYjReq(patientId, times) {
- $("#visitingDetailModal").modal("hide");
- $("#previewYjReqModal").modal();
- $("#previewYjReqModalPatientId").val(patientId);
- $("#previewYjReqModalTimes").val(times);
- //重置参数
- retryCount = 0;
- initJcJyTable();
- }
- /**
- * 删除本次处方
- * @param clnicId 就诊记录id
- */
- function deletePrescription(clnicId) {
- $("#visitingDetailModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认要删除本次处方信息吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/deletePrescription?clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#tb_table_clinic").bootstrapTable('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#visitingDetailModal").modal();
- });
- ;
- }
- /**
- * 检查检验列表类型按钮切换事件
- * @param object
- */
- function jcjyButtonChange(object) {
- $("#jcjy_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- initJcJyTable();
- }
- /**
- * 初始化检查检验报告列表
- */
- function initJcJyTable() {
- clearInspectionDetail();
- clearJcDetail();
- var typeIndex = getIndex("jcjy_group");
- if (typeIndex == 0) {
- //检查
- $('#tb_jy_pName_table_list').bootstrapTable("destroy");
- $('#tb_jy_table_list').bootstrapTable("destroy");
- initJcListTable();
- $("#jy_detail").removeClass("in").addClass("hide");
- $("#jc_detail").removeClass("hide").addClass("in");
- } else {
- $('#tb_table_list').bootstrapTable("destroy");
- initJyListTable();
- $("#jc_detail").removeClass("in").addClass("hide");
- $("#jy_detail").removeClass("hide").addClass("in");
- }
- }
- /**
- * 初始化检查报告列表
- */
- function initJcListTable() {
- $('#tb_table_list').bootstrapTable("destroy");
- $('#tb_table_list').bootstrapTable({
- url: '/thmz/getJcJyList', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'groupName',
- title: '项目名称',
- align: "center",
- valign: 'middle',
- }, {
- field: 'reqDate',
- title: '申请时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- onClickRow: function (row) {
- clearJcDetail();
- $("#patientId_t").text(row.patientId);
- $("#name_t").text(row.patientName);
- $("#date_t").text(format(row.reqDate, "yyyy-MM-dd HH:mm:ss"));
- fitJcDetail(row.reqNo, row.patientId);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- if (retryCount == 0) {
- retryCount++;
- $("#jyButton").click();
- return;
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- if (ress.count <= 0 && retryCount == 0) {
- retryCount++;
- $("#jyButton").click();
- return;
- }
- //有数据的时候,计数也需要加1,防止这时医生自己候点击检验没数据又跳回检查
- retryCount++;
- return {
- "total": ress.count,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- }
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @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}}
- */
- function queryParams(params) {
- var patientId = $("#previewYjReqModalPatientId").val();
- var times = $("#previewYjReqModalTimes").val();
- return {
- reqType: "3",
- patientId: patientId,
- times: times,
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit //页码
- };
- };
- /**
- * 加载检查明细
- * @param reqNo
- */
- function fitJcDetail(reqNo, patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getYjJcRecordReport?hisReqNo=' + reqNo + "&patientId=" + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- canBePrintJc = true;
- $("#jy_detail").removeClass("in").addClass("hide");
- $("#jc_detail").removeClass("hide").addClass("in");
- var mzPatientMi = res.data.mzPatientMi;
- $("#gender_jc").text(mzPatientMi.gender);
- $("#age_jc").text(mzPatientMi.age);
- var yjJcRecordReport = res.data.yjJcRecordReport;
- $("#groupName").text(res.data.groupName);
- $("#textJc").text(yjJcRecordReport.textJc);
- $("#textZd").text(yjJcRecordReport.textZd);
- var jcRecord = res.data.jcRecord;
- $("#report_no").text(jcRecord.reportNo);
- $("#reportId").text(jcRecord.reportId);
- if (jcRecord.reportDate == null || jcRecord.reportDate == "") {
- $("#reportDate").html(" ");
- } else {
- $("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
- }
- $("#confirmId").text(jcRecord.confirmId);
- if (jcRecord.confirmDate == null || jcRecord.confirmDate == "") {
- $("#confirmDate").html(" ");
- } else {
- $("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空检查明细
- * @param reqNo
- */
- function clearJcDetail() {
- canBePrintJc = false;
- $("#patientId_t").text("");
- $("#name_t").text("");
- $("#date_t").text("");
- $("#gender_jc").text("");
- $("#age_jc").text("");
- $("#groupName").text("");
- $("#textJc").text("");
- $("#textZd").text("");
- $("#report_no").text("");
- $("#reportId").text("");
- $("#reportDate").html(" ");
- $("#confirmId").text("");
- $("#confirmDate").html(" ");
- }
- /**
- * 初始化检验报告列表
- */
- function initJyListTable() {
- var patientId = $("#previewYjReqModalPatientId").val();
- var times = $("#previewYjReqModalTimes").val();
- $('#tb_table_list').bootstrapTable("destroy");
- $('#tb_table_list').bootstrapTable({
- url: '/thmz/getJyListByPatientIdAndTimes?patientId=' + patientId + "×=" + times, //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- //queryParams: queryJyPNameParams, //传递参数(*)
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'aply_CTNT',
- title: '检验名称',
- align: "center",
- valign: 'middle',
- }, {
- field: 'ordr_CREATE_DATE',
- title: '检验时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- onClickRow: function (row) {
- queryInspectionDetail(row.ordr_ID);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (retryCount == 0) {
- retryCount++;
- $("#jcButton").click();
- return;
- }
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- }
- if (ress.data.length <= 0 && retryCount == 0) {
- retryCount++;
- $("#jcButton").click();
- return;
- }
- //有数据的时候,计数也需要加1,防止这时医生自己候点击检查没数据又跳回检验
- retryCount++;
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $("#jy_table_table_div").find(".pagination-detail").css("display", "none");
- }
- });
- }
- /**
- * 清空检验明细
- * @param orderId
- */
- function clearInspectionDetail() {
- canBePrintJy = false;
- $("#patientId_t_jy").text("");
- $("#name_t_jy").text("");
- $("#gender_jy").text("");
- $("#age_jy").text("");
- $("#reqDept_t_jy").text("");
- $("#bed_no_jy").text("");
- $("#smpl_jy").text("");
- $("#item_jy").text("");
- $("#applyDate").text("");
- $("#orderCreateDate").text("");
- $("#auditTime").text("");
- $("#orderUsrName").text("");
- $("#testUsrName").text("");
- $("#auditUsrName").text("");
- $("#jyBody").html("");
- }
- /**
- * 加载检验明细
- * @param orderId
- */
- function queryInspectionDetail(orderId) {
- clearInspectionDetail();
- $.ajax({
- type: "GET",
- url: '/thmz/getInspectionDetail?orderId=' + orderId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- canBePrintJy = true;
- $("#jc_detail").removeClass("in").addClass("hide");
- $("#jy_detail").removeClass("hide").addClass("in");
- var mzPatientMi = res.mzPatientMi;
- $("#patientId_t_jy").text(mzPatientMi.patientId);
- $("#name_t_jy").text(mzPatientMi.name);
- $("#gender_jy").text(mzPatientMi.gender);
- $("#age_jy").text(mzPatientMi.age);
- var html = "";
- if (res.data != null) {
- var inspectionHeader = res.data.inspectionHeader;
- $("#reqDept_t_jy").text(inspectionHeader.dept_NAME);
- $("#bed_no_jy").text(inspectionHeader.ptnt_BED_NO);
- $("#smpl_jy").text(inspectionHeader.smpl_NAME);
- $("#item_jy").text(inspectionHeader.aply_CNTN);
- $("#applyDate").text(format(inspectionHeader.aply_DATE, "yyyy-MM-dd HH:mm:ss"));
- $("#orderCreateDate").text(format(inspectionHeader.ordr_CREATE_DATE, "yyyy-MM-dd HH:mm:ss"));
- $("#auditTime").text(format(inspectionHeader.audt_TIME, "yyyy-MM-dd HH:mm:ss"));
- $("#orderUsrName").text(inspectionHeader.ordr_USR_NAME);
- $("#testUsrName").text(inspectionHeader.test_USR_NAME);
- $("#auditUsrName").text(inspectionHeader.audt_USR_NAME);
- var inspectionItems = res.data.inspectionItems;
- if (inspectionItems != null && inspectionItems.length > 0) {
- for (var i = 0; i < inspectionItems.length; i++) {
- html += "<tr>";
- var obj = inspectionItems[i];
- var itm_VALUE = obj.itm_VALUE;
- if (itm_VALUE == null || itm_VALUE == "null") {
- itm_VALUE = "";
- }
- itm_VALUE += (obj.itm_STR_VALUE == null || obj.itm_STR_VALUE == "null") ? "" : obj.itm_STR_VALUE;
- var range = obj.range;
- if (range == null || range == "null") {
- range = "";
- }
- range += (obj.range_STR == null || obj.range_STR == "null") ? "" : obj.range_STR;
- html += "<td width='25%'>" + obj.itm_NAME + "</td>";
- html += "<td width='16.66%'>" + itm_VALUE + "</td>";
- html += "<td width='16.66%'>" + obj.itm_UNIT + "</td>";
- if (obj.itm_ALERT == null || obj.itm_ALERT == "") {
- html += "<td width='16.66%'><span style=\"color:#67C23A;font-weight:bold\"></span></td>";
- } else if (obj.itm_ALERT == "H") {
- html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↑</span></td>";
- } else if (obj.itm_ALERT == "L") {
- html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↓</span></td>";
- }
- html += "<td width='25%'>" + range + "</td>";
- html += "</tr>";
- var bacteriaResults = obj.bacteriaResults;
- if (bacteriaResults == null || bacteriaResults.length == 0) {
- continue;
- }
- var bacteriaResult = bacteriaResults[0];
- if (bacteriaResult == null || bacteriaResult.length == 0) {
- continue;
- }
- var antibioticResults = bacteriaResult.antibioticResults;
- if (antibioticResults == null || antibioticResults.length == 0) {
- continue;
- }
- 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>';
- for (var j = 0; j < antibioticResults.length; j++) {
- var antibioticResultsObj = antibioticResults[j];
- html += "<tr>";
- html += "<td width='35%' style='padding-left: 2%;";
- if (j == 0) {
- html += "border-top: 1px solid black;";
- }
- html += "'>" + antibioticResultsObj.anti_NAME_CN + "</td>";
- html += "<td width='20%' ";
- if (j == 0) {
- html += "style='border-top: 1px solid black;'";
- }
- html += ">" + antibioticResultsObj.anti_ABB + "</td>";
- html += "<td width='25%' ";
- if (j == 0) {
- html += "style='border-top: 1px solid black;'";
- }
- html += ">" + antibioticResultsObj.anti_MIC + "</td>";
- html += "<td width='20%' style='padding-right: 2%;";
- if (j == 0) {
- html += "border-top: 1px solid black;";
- }
- html += "'>" + antibioticResultsObj.anti_VALUE + "</td>";
- html += "</tr>";
- }
- }
- }
- }
- $("#jyBody").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印检查检验报告单
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printJyJcReport(printType) {
- var typeIndex = getIndex("jcjy_group");
- var title = "检查报告单";
- if (typeIndex == 1) {
- title = "检验报告单"
- if (!canBePrintJy) {
- warningMesageSimaple("没有任何【" + title + "】可供打印!");
- return;
- }
- } else {
- if (!canBePrintJc) {
- warningMesageSimaple("没有任何【" + title + "】可供打印!");
- return;
- }
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院" + title);
- LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
- if (typeIndex == 0) {
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_detail").innerHTML);
- }
- if (typeIndex == 1) {
- LODOP.ADD_PRINT_TABLE("37mm", "5mm", "130mm", "138mm", strStyle + document.getElementById("jy_detail_content").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_title").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- LODOP.ADD_PRINT_HTM("177mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- /**
- * 初始化科室下拉选
- */
- function initExecUnit() {
- //父科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $('#execUnit').empty(); //清空resText里面的所有内容
- $('#zlExecUnit').empty(); //清空resText里面的所有内容
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
- });
- $('#execUnit').html(html);
- $('#execUnit').selectpicker('refresh');
- $('#zlExecUnit').html(html);
- $('#zlExecUnit').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化证件类型下拉选
- */
- function initCertificateTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/listCertificateType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#rapidAcceptsUserCertificateType').append(html);
- $('#editUserCertificateType').append(html);
- });
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $('#editUserCertificateType').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载病历信息编辑预览
- * @param patientId
- * @param times
- * @param type 1 编辑 2 预览
- */
- function showMzBlRecordModal(patientId, times, type) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //$("#visitingDetailModal").modal("hide");
- var mzPatientMi = res.mzPatientMi;
- $("#editPatientId").text(mzPatientMi.patientId);
- $("#editPatientName").text(mzPatientMi.name);
- $("#editPatientGender").text(mzPatientMi.gender);
- $("#editPatientAge").text(mzPatientMi.age + "岁");
- var mzBlRecord = res.mzBlRecord;
- // if (mzBlRecord.firstOrNot == "1") {
- // $("#firstOrNotTitle").text("复诊");
- // } else {
- // $("#firstOrNotTitle").text("初诊");
- // }
- if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
- $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint);
- $("#editEmrChiefComplaint").parent().parent().parent().css("display", "block");
- } else {
- $("#editEmrChiefComplaint").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
- $("#editEmrHpi").val(mzBlRecord.emrHpi);
- $("#editEmrHpi").parent().parent().parent().css("display", "block");
- } else {
- $("#editEmrHpi").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
- $("#editEmrPs").val(mzBlRecord.emrPs);
- $("#editEmrPs").parent().parent().parent().css("display", "block");
- } else {
- $("#editEmrPs").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
- $("#editPersonalHistory").val(mzBlRecord.personalHistory);
- $("#editPersonalHistory").parent().parent().parent().css("display", "block");
- } else {
- $("#editPersonalHistory").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
- $("#editFamilyHistory").val(mzBlRecord.familyHistory);
- $("#editFamilyHistory").parent().parent().parent().css("display", "block");
- } else {
- $("#editFamilyHistory").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
- $("#editObstericalHistory").val(mzBlRecord.obstericalHistory);
- $("#editObstericalHistory").parent().parent().parent().css("display", "block");
- } else {
- $("#editObstericalHistory").parent().parent().parent().css("display", "none");
- }
- var tz = getTz(mzBlRecord);
- if (tz != null && tz != "") {
- $("#editTgjc").val(tz);
- $("#editTgjc").parent().parent().parent().css("display", "block");
- } else {
- $("#editTgjc").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- $("#editQtjc").val(mzBlRecord.emrPe);
- $("#editQtjc").parent().parent().parent().css("display", "block");
- } else {
- $("#editQtjc").parent().parent().parent().css("display", "none");
- }
- if (res.icdText != null && res.icdText != "") {
- $("#editZd").val(res.icdText);
- $("#editZd").parent().parent().parent().css("display", "block");
- } else {
- $("#editZd").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- var reg = new RegExp("</br>", "g");//g,表示全部替换。
- var editEmrProcess = mzBlRecord.emrProcess.replace(reg, "\n");
- reg = new RegExp(" ", "g");//g,表示全部替换。
- editEmrProcess = editEmrProcess.replace(reg, "");
- $("#editEmrProcess").val(editEmrProcess);
- $("#editEmrProcess").parent().parent().parent().css("display", "block");
- } else {
- $("#editEmrProcess").parent().parent().parent().css("display", "none");
- }
- if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "" && mzBlRecord.emrJkjy != "无") {
- $("#editEmrJkjy").val(mzBlRecord.emrJkjy);
- $("#editEmrJkjy").parent().parent().parent().css("display", "block");
- } else {
- $("#editEmrJkjy").parent().parent().parent().css("display", "none");
- }
- if (type == 1) {
- $("#mzBlRecorTitle").html("门诊病历【编辑】");
- $("#setOtherEmrProcess").removeClass("in").addClass("hide");
- $("#openBlRecordModel").removeClass("hide").addClass("in");
- $("#setEmrProcess").removeClass("hide").addClass("in");
- $("#newEmrProcessDiv").removeClass("hide").addClass("in");
- $("#visitingDetailModal").modal("hide");
- } else if (type == 2) {
- $("#mzBlRecorTitle").html("门诊病历【预览】");
- $("#setOtherEmrProcess").removeClass("hide").addClass("in");
- $("#openBlRecordModel").removeClass("in").addClass("hide");
- $("#setEmrProcess").removeClass("in").addClass("hide");
- $("#newEmrProcessDiv").removeClass("in").addClass("hide");
- //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
- if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
- $("#baseMzBlTimes").val($("#mzBlTimes").val());
- }
- $("#otherBlRecordModal").modal("hide");
- }
- $("#mzBlTimes").val(mzBlRecord.times);
- $("#editMzBlRecordModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空区域
- */
- function clearInput() {
- //编辑病历的时候,没有基础病历的就诊次数,如果是预览病历的时候,有基础病历的次数
- var baseMzBlTimes = $("#baseMzBlTimes").val();
- $("#editPatientId").text(null);
- $("#editPatientName").text(null);
- $("#editPatientGender").text(null);
- $("#editPatientAge").text(null);
- $("#editEmrChiefComplaint").val(null);
- $("#editEmrHpi").val(null);
- $("#editEmrPs").val(null);
- $("#editPersonalHistory").val(null);
- $("#editFamilyHistory").val(null);
- $("#editObstericalHistory").val(null);
- $("#editTgjc").val(null);
- $("#editQtjc").val(null);
- $("#editZd").val(null);
- $("#editEmrProcess").val(null);
- $("#editEmrJkjy").val(null);
- $("#newEmrProcess").val(null);
- $("#mzBlTimes").val(null);
- if (baseMzBlTimes != null && baseMzBlTimes != "") {
- $("#otherBlRecordModal").modal();
- }
- }
- /**
- * 保存门诊病历
- */
- function setEmrProcess() {
- $("#editMzBlRecordModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("是否保存并替换已有补充处理意见?");
- $("#messageButton").off("click").on("click", function (t) {
- if ($("#newEmrProcess").val() == null || $("#newEmrProcess").val() == "") {
- $("#messageContent").html("当前录入的补充处理为空,是否保存并替换已有补充处理意见?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- sendEmrProcess();
- });
- } else {
- $("#messageModal").modal("hide");
- sendEmrProcess();
- }
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editMzBlRecordModal").modal();
- });
- }
- /**
- * 提交保存门诊病历
- */
- function sendEmrProcess() {
- $.ajax({
- type: "POST",
- url: '/thmz/setEmrProcess',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": $("#editPatientId").text(),
- "times": $("#mzBlTimes").val(),
- "emrChiefComplaint": $("#editEmrChiefComplaint").val(),
- "emrHpi": $("#editEmrHpi").val(),
- "emrPs": $("#editEmrPs").val(),
- "personalHistory": $("#editPersonalHistory").val(),
- "familyHistory": $("#editFamilyHistory").val(),
- "obstericalHistory": $("#editObstericalHistory").val(),
- "emrJkjy": $("#editEmrJkjy").val(),
- "emrProcess": $("#newEmrProcess").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearInput();
- successMesage(res);
- $("#editMzBlRecordModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开待合并病历列表弹框
- */
- function openBlRecordModel() {
- $("#editMzBlRecordModal").modal("hide");
- $("#otherBlRecordModal").modal();
- initOtherMzBlRecordList();
- }
- /**
- * 关闭待合并病历列表
- */
- function closeBlRecordModel() {
- $('#baseMzBlTimes').val(null);
- $("#visitingDetailModal").modal();
- }
- /**
- * 病历列表
- */
- function initOtherMzBlRecordList() {
- $('#other_bl_record_table').bootstrapTable("destroy");
- $('#other_bl_record_table').bootstrapTable({
- url: '/thmz/getMzBlRecordList', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "desc", //排序方式
- queryParams: queryOtherParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- title: '操作',
- field: 'op',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- 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>';
- return [str].join('');
- }
- },
- {
- field: 'patientId',
- title: '门诊ID',
- align: "center",
- valign: 'middle'
- }, {
- field: 'patientName',
- title: '患者姓名',
- align: "center",
- valign: 'middle'
- }, {
- field: 'deptCode',
- title: '就诊科室',
- align: "center",
- valign: 'middle'
- }, {
- field: 'doctorCode',
- title: '接诊医师',
- align: "center",
- valign: 'middle'
- }, {
- field: 'firstOrNot',
- title: '初/复诊',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == '1') {
- return "复诊";
- }
- return "初诊";
- }
- }
- , {
- field: 'visitDate',
- title: '就诊时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @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}}
- */
- function queryOtherParams(params) {
- var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
- patientId: $("#editPatientId").text(),
- exceptTimes: $("#mzBlTimes").val(),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- return temp;
- }
- /**
- * 提取处理意见保存
- */
- function setOtherEmrProcess() {
- $("#editMzBlRecordModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确定要执行此次提取处理意见操作吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val() + '×=' + $("#mzBlTimes").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#editMzBlRecordModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editMzBlRecordModal").modal();
- });
- }
- /**
- * 医保电子凭证读卡
- */
- function siReadCard() {
- $.ajax({
- type: "GET",
- url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- //console.log(res);
- if (res.code == 200) {
- var data = JSON.parse(res.data);
- queryUserInfoBySocialNoNotFillPatient('rapidAcceptsUserCardNo',""+data.data.idNo+"",queryUserInfoByCardNo,'rapidAcceptsModal');
- } else {
- errorMesage(res);
- }
- }
- });
- // window.open('ReadCard://'+prm, '_self')
- }
|