1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615 |
- //@ 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;
- //是否在读卡中
- var mztczfSiReadCardStatus = false;
- //药品组号与处方号关系
- var gropuIdAndOrderNoMap = null;
- //上一个药品大类
- //var prevCategoriesFlag = null;
- //处方回调和修改的时候处方号与处方tab的关系
- var orderNoAndTableIdMap = null;
- //处方回调和修改的时候处方tab与处方号的关系
- var tableIdAndOrderNoMap = null;
- $(function () {
- initGenderSelect();
- iniAdmissStatus();
- initListDeptSelect();
- //initTryResultSelect();
- initResponceTypeSelect();
- initTemplateTypeSelect("templateType");
- initTemplateKindTypeSelect('templateKindType');
- initZyClassTypeSelect();
- initInstructionSelect();
- setSelectSize();
- initCertificateTypeSelect();
- initMztcSelect();
- $('#editUserBirthDayGroup').datetimepicker({
- format: 'yyyy-mm-dd',
- language: 'zh-CN',
- minView: "month",
- });
- initDaterangepickerWithId('reportrange', "right");
- formatCheck();
- //数据校验
- init_validator();
- //初始频次下拉选
- initOrderFrequencys("orderFrequency", true);
- //初始频次下拉选
- initOrderFrequencys("orderFrequencyZl", true);
- //初始用药方式下拉选
- initSupplyTypes();
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //加载已接诊患者列表
- loadClinicTableList();
- //每隔一分钟秒读加载候诊患者列表
- setInterval(function () {
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载已接诊患者列表 病人会缴费,需要刷新状态
- loadClinicTableList();
- }, 60000);
- //初始化快速接诊病人姓名栏事件
- initUserList();
- //初始化主诉弹出层
- initRecommendList();
- //卡号输入改变事件
- cardNoChange();
- //初始化省份
- initProvince(3);
- /**
- * 患者信息修改
- */
- $("#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) {
- $("#turnToConsultationIdInClick").val(res.data[0].turnToConsultationId);
- clinicalReception(patientIdDb, res.data[0].serialNo, res.data[0].reqType);
- } 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 = "";
- }
- var doctorCode = (res.data[i].doctorCode == null || res.data[i].doctorCode == 'null') ? '' : res.data[i].doctorCode;
- $("<tr data-target='" + res.data[i].serialNo + "' data-target-reqType='" + res.data[i].reqType + "' data-target-turnToConsultationId='" + res.data[i].turnToConsultationId + "'><td>" + res.data[i].patientId + "</td><td>" + res.data[i].name + "</td><td>" + res.data[i].deptCode + "</td><td>" + doctorCode + "</td><td>" + roomCode + "</td></tr>").appendTo("#mzfzPatientOrderTable").bind('click', function () {
- $("#mzfzPatientOrderModal").modal("hide");
- $("#turnToConsultationIdInClick").val($(this).attr("data-target-turnToConsultationId"));
- clinicalReception(patientIdDb, $(this).attr("data-target"), $(this).attr("data-target-reqType"));
- });
- }
- }
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- } else {
- errorMesageSimaple("当前病人没有分诊信息");
- }
- } else if (res.code == 200) {
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- clinicalReception(patientIdDb, null, null);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- /**
- * 存为范本
- */
- $("#saveapidAccepts").on("click", function (t) {
- //关闭帮助框
- $("#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) {
- var obj = $("#jcJyItemPopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#jcJyItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList(null);
- });
- /**
- * 诊疗点击事件
- */
- $("#zlItem").on("click", function (t) {
- var obj = $("#zlItemPopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#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();
- $("#chinese_medicine_name").focus();
- $("#chinese_medicine_name").click();
- }
- else if (id == 'cyJssm') {
- $("#cyJsl").focus();
- } else if (id == 'cyJsl') {
- $("#cyZql").focus();
- } else if (id == 'cyZql') {
- $("#cyFj").focus();
- } else if (id == 'cyFj') {
- $("#cyFfcs").focus();
- } else if (id == 'cyFj') {
- $("#cyFfcs").focus();
- } else if (id == 'cyFfcs') {
- $("#useType_1").next().click();
- } else if (id == 'useType_1') {
- $("#cyMtjs").focus();
- } else if (id == 'cyMtjs') {
- $("#zyfs").focus();
- } else if (id == 'zyfs') {
- $("#zy_supplyType_1").next().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') {
- $("#itemQuantity").focus();
- } else if (id == 'itemQuantity') {
- $("#dayZlNum").next().click();
- } else if (id == 'dayZlNum') {
- var ariaExpanded = $("#dayZlNum").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#dayZlNum").next().click();
- }
- $("#orderFrequencyZl").next().click();
- } else if (id == 'orderFrequencyZl') {
- var ariaExpanded = $("#orderFrequencyZl").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#orderFrequencyZl").next().click();
- }
- $("#totalNumZl").focus();
- } else if (id == 'totalNumZl') {
- $("#zlExecUnit").next().click();
- } else if (id == 'zlExecUnit') {
- var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#zlExecUnit").next().click();
- }
- $("#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") || $("#" + webuiID).css("display") == "block") {
- 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, null);
- $("#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") || $("#" + webuiID).css("display") == "block") {
- 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") || $("#" + webuiID).css("display") == "block") {
- 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") || $("#" + webuiID).css("display") == "block") {
- 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, null, null);
- }
- $("#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") || $("#" + webuiID).css("display") == "block") {
- 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") || $("#" + webuiID).css("display") == "block") {
- 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();
- });
- /**
- * 门诊统筹支付医保电子凭证读卡
- */
- $("#mztczfSiReadCard").on("click", function (t) {
- mztczfSiReadCard(true);
- });
- /**
- * 快速接诊页面 -未挂号患者信息查询处编辑患者信息
- */
- $("#rapidAcceptsEditUser").on("click", function (t) {
- editUserModal($("#rapidAcceptsUserCode").val(), 2);
- });
- //监听滚动停止处理逻辑开始
- let t1 = 0;
- let t2 = 0;
- let timer = null; // 定时器
- $("#scroll-wrap").on("scroll", function () {
- // 滚动
- clearTimeout(timer)
- timer = setTimeout(isScrollEnd, 100)
- t1 = $("#scroll-wrap").scrollTop();
- })
- function isScrollEnd() {
- t2 = $("#scroll-wrap").scrollTop();
- if (t2 == t1) {
- clearTimeout(timer)
- closeObjectWebui(true);
- console.log("滚动停止", t2) // 这里处理
- }
- }
- //监听滚动停止处理逻辑结束
- });
- /**
- * 打开配置页面
- */
- 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');
- $('#dayZlNum').html(html);
- $('#dayZlNum').selectpicker('refresh');
- }
- /**
- * 处方回调
- */
- function resetGroupIdSelect() {
- var groupIds = $("#groupId option");
- var usedGroupIdInputs = $("#xyTabContent").find("input.temporary_items_groupId");
- if (usedGroupIdInputs != null && usedGroupIdInputs.length > 0) {
- let lastGroupId = 0;
- for (var i = 0; i < usedGroupIdInputs.length; i++) {
- var groupId = Number($(usedGroupIdInputs[i]).val());
- if (groupId > lastGroupId) {
- lastGroupId = groupId;
- }
- }
- if (groupIds != null && groupIds.length > 1) {
- for (var i = 0; i < groupIds.length; i++) {
- var groupId = $(groupIds[i]).val();
- if (groupId <= lastGroupId) {
- continue;
- }
- $(groupIds[i]).remove();
- //删除给药方式与其他属性的缓存
- groupIdMap.remove(groupId);
- }
- appendGroupOrder();
- }
- } else if (groupIds != null && groupIds.length > 1) {
- initGroupOrder();
- }
- }
- /**
- * 初始化药品分组下拉选
- */
- 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();
- var keys = groupIdMap.keySet();
- if (keys.indexOf(groupId)<0) {
- //是新增药品清空药品输入区域
- 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();
- }
- /**
- * 关闭项目选择框
- * ReOpen 是否重新打开 true 打开 false 不打开
- */
- function closeObjectWebui(ReOpen) {
- var index = getIndex("bill_item_group");
- var currentCode = "western_medicine_name";
- if (index == 1) {
- currentCode = "chinese_medicine_name";
- } else if (index == 2) {
- currentCode = "jcJyItem";
- } else if (index == 3) {
- currentCode = "zlItem";
- }
- var webuiID = $("#" + currentCode).attr("data-target");
- if (webuiID != null && webuiID != "null" && webuiID != "") {
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- $("#" + currentCode).click();
- if (ReOpen) {
- $("#" + currentCode).click();
- }
- }
- }
- var symptomID = $("#symptom").attr("data-target");
- if (symptomID != null && symptomID != "null" && symptomID != "") {
- //选择框打开
- if ($("#" + symptomID).hasClass("in") || $("#" + symptomID).css("display") == "block") {
- $("#symptom").click();
- if (ReOpen) {
- $("#symptom").click();
- }
- }
- }
- var weightID = $("#weight").attr("data-target");
- if (weightID != null && weightID != "null" && weightID != "") {
- //选择框打开
- if ($("#" + weightID).hasClass("in") || $("#" + weightID).css("display") == "block") {
- $("#weight").click();
- if (ReOpen) {
- $("#weight").click();
- }
- }
- }
- var diagnoseID = $("#diagnose").attr("data-target");
- if (diagnoseID != null && diagnoseID != "null" && diagnoseID != "") {
- //选择框打开
- if ($("#" + diagnoseID).hasClass("in") || $("#" + diagnoseID).css("display") == "block") {
- $("#diagnose").click();
- if (ReOpen) {
- $("#diagnose").click();
- }
- }
- }
- }
- /**
- * 加载智能问诊弹框内容
- */
- function contentMethod() {
- setTimeout(function () {
- closeObjectWebui(false);
- $(".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;">' +
- ' <div class="col-md-6 col-sm-6 col-xs-12">' +
- ' <select class="form-control selectpicker show-tick" title="范文范围" onchange="fitTemplateData()"' +
- ' id="templateTypeForm">' +
- ' </select>' +
- ' </div>' +
- ' <div class="col-md-6 col-sm-6 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);
- initTemplateTypeSelect("templateTypeForm");
- 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({
- "commonParams": 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 == "") {
- if (res.mzPatientMi != null) {
- patientName = res.mzPatientMi.name;
- } else {
- patientName = patientId;
- }
- }
- $("#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() + '&templateType=' + $("#templateTypeForm").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);
- $('#rapidAcceptsProvinceCode').selectpicker('val', null);
- $('#rapidAcceptsProvinceCode').selectpicker('refresh');
- $('#rapidAcceptsCityCode').selectpicker('val', null);
- $('#rapidAcceptsCityCode').selectpicker('refresh');
- $('#rapidAcceptsDistrictCode').selectpicker('val', null);
- $('#rapidAcceptsDistrictCode').selectpicker('refresh');
- $("#rapidAcceptsDetail").val(null);
- $("#rapidAcceptsDetail").attr("title", null);
- $("#rapidAcceptsUserContact").val(null);
- $("#rapidAcceptsUserContactPhone").val(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) {
- $("#transferTreatment").css("display", "none");
- $("#consultation").css("display", "none");
- $("#mzfzSerialNoInClick").val(null);
- $("#mzfzReqTypeNoInClick").val(null);
- $("#turnToConsultationIdInClick").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();
- fitPatientHisData();
- }
- /**
- * 加载已接诊患者列表
- */
- 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) {
- var age = row.age;
- if (age == null || age == "null") {
- age = "";
- }
- return value + "/" + row.gender + "/" + 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 commonParams = $("#userName").val();
- var needDateParams = commonParams == null || commonParams == "null" || commonParams == "";
- var temp = {
- beginDate: needDateParams ? rePortRangeArr[0] : "2012-02-01 00:00:00",
- endDate: needDateParams ? rePortRangeArr[1] : format(new Date(), "yyyy-MM-dd HH:mm:ss"),
- commonParams: commonParams,
- 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: 2, //每页的记录行数(*)
- pageList: [2, 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 + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
- } else if (row.statusFlag == 8) {
- //TODO 继续接诊需要新方法
- return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" 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 + '\',' + row.reqType + ')" 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 分诊流水号
- * @param reqType 号表类别
- */
- function clinicalReception(patientId, serialNo, reqType) {
- 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(1);
- $.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, reqType);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- clearWorkSpace();
- realClinicalReception(patientId, serialNo, reqType);
- });
- });
- $("#cancelButton").off("click");
- } else {
- realClinicalReception(patientId, serialNo, reqType);
- }
- }
- /**
- * 取消接诊
- * @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();
- clearWorkSpace();
- }
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- };
- /**
- * 设置当前接诊病人信息
- * @param mzPatientMi
- */
- function setMzPatientInfo(mzPatientMi) {
- $.ajax({
- type: "GET",
- url: '/thmz/getDeptNoByCurrentPatientId?patientId=' + mzPatientMi.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) {
- //当前患者就诊科室编码
- localStorage.setItem("currentDeptNo", res.data);
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- $("#patientName").html(mzPatientMi.name);
- //var age = getAge(mzPatientMi);
- $("#patientAge").html(mzPatientMi.ageString);
- $("#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 res
- */
- function setMzSmtz(res) {
- var mzYshTzxx = res.mzYshTzxx;
- if (mzYshTzxx != null) {
- if (mzYshTzxx.valueTz != null) {
- $("#weight").val(mzYshTzxx.valueTz);
- }
- if (mzYshTzxx.valueTw != null) {
- $("#temperature").val(mzYshTzxx.valueTw);
- }
- if (mzYshTzxx.valueMb != null) {
- $("#sphygmus").val(mzYshTzxx.valueMb);
- }
- if (mzYshTzxx.valueHx != null) {
- $("#breathe").val(mzYshTzxx.valueHx);
- }
- if (mzYshTzxx.valueSsy != null) {
- $("#pressure_high").val(mzYshTzxx.valueSsy);
- }
- if (mzYshTzxx.valueSzy != null) {
- $("#pressure_floor").val(mzYshTzxx.valueSzy);
- }
- }
- }
- /**
- * 真实的接诊方法
- * @param patientId
- * @param serialNo 分诊流水号
- * @param reqType 号表类别
- */
- function realClinicalReception(patientId, serialNo, reqType) {
- var turnToConsultationIdInClick = $("#turnToConsultationIdInClick").val();
- if (turnToConsultationIdInClick == null || turnToConsultationIdInClick == "null") {
- turnToConsultationIdInClick = 0;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick,
- 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);
- setMzSmtz(res);
- $("#mzfzSerialNoInClick").val(serialNo);
- $("#mzfzReqTypeNoInClick").val(reqType);
- //有分诊流水号 且 不是简易门诊 或 会诊目标科室接诊
- if (serialNo != null && serialNo != "null") {
- if (!(reqType == 10 || reqType == "10" || reqType == "16" || reqType == 16 || reqType == -200)) {
- $("#transferTreatment").css("display", "inline-block");
- }
- $("#consultation").css("display", "inline-block");
- }
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //查询患者的门诊统筹信息
- queryInsuinfo(patientId);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询患者的门诊统筹信息
- * @param patientId
- */
- function queryInsuinfo(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/queryInsuinfo?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) {
- $("#zgmztczfDiv").removeClass("hide").addClass("in");
- $("#mztczfSiReadCard").removeClass("hide").addClass("in");
- var ybCode = localStorage.getItem("ybCode");
- if (ybCode != null && ybCode != "" && ybCode.length > 0) {
- $("#zgmztczf").selectpicker('val', 1);
- $("#zgmztczf").selectpicker('refresh');
- }
- if (res.balc != null) {
- var balc = Number(res.balc);
- if (balc > 0) {
- $("#grzhzfDiv").removeClass("hide").addClass("in");
- }
- }
- } else if (res.code == -1) {
- errorMesageSimaple(res.message);
- } else if (res.code == -2) {
- warningMesageSimaple(res.message);
- }
- }
- });
- }
- /**
- * 读医保电子凭证
- * @param asyncFlag true 异步 false 同步
- */
- function mztczfSiReadCard(asyncFlag) {
- mztczfSiReadCardStatus = true;
- $.ajax({
- type: "GET",
- url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: asyncFlag,
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- mztczfSiReadCardStatus = false;
- 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);
- $("#readCardResult").val(JSON.stringify(data.data));
- $("#messageContent").html("读卡成功,是否保存处方?");
- } else {
- $("#messageContent").html("读卡失败,是否保存处方(不享受门诊统筹)?");
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- mztczfSiReadCardStatus = false;
- $("#messageContent").html("读卡异常,是否保存处方(不享受门诊统筹)?");
- }
- });
- }
- /**
- * 实际读医保电子凭证
- * @param asyncFlag true 异步 false 同步
- */
- function realMztczfSiReadCard(asyncFlag) {
- }
- /**
- * 清空工作台
- */
- function clearWorkSpace() {
- clearUser(true);
- clearWorkSpaceExcludeUser(1);
- }
- /**
- * 清空工作台除了用户信息
- * @param source 1 清空工作台 2 调用模板 3 调用历史处方
- */
- function clearWorkSpaceExcludeUser(source) {
- var conciseRecordsFlag = false;
- if (source == 2) {
- conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
- } else if (source == 3) {
- conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
- }
- if (source == 1 || conciseRecordsFlag) {
- $("#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);
- }
- //清空工作台的时候需要调用
- if (source == 1) {
- clearWesternMedicine(true);
- clearChineseMedicine();
- clearJyJcItem();
- clearZlItem();
- clearZyReq();
- //initNavTabs(0);
- clearNavTabs(0);
- clearNavTabs(1);
- clearNavTabs(2);
- clearNavTabs(3);
- clearNavTabs(4);
- clearApidAcceptsModal();
- clearTurnToConsultationInput();
- clearZgtczfInput();
- gropuIdAndOrderNoMap = null;
- //prevCategoriesFlag = null;
- initGroupOrder();
- localStorage.removeItem("currentDeptNo");
- }
- $("#totalAmount").text(0);
- }
- /**
- * 构造西药处方详情和模板预览方法
- * @param pyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitxyContent(pyPrescription, contentId, titleId, checkBox) {
- if (pyPrescription != null && pyPrescription.length > 0) {
- var xypyHtml = "";
- for (var i = 0; i < pyPrescription.length; i++) {
- var py = pyPrescription[i];
- if (py == null || py.length == 0) {
- continue;
- }
- var detail = py.detail;
- if (detail == null || detail.length == 0) {
- continue;
- }
- for (var j = 0; j < detail.length; j++) {
- var pyDetail = detail[j];
- if (checkBox) {
- xypyHtml += "<div style='cursor: pointer;' data-id='" + pyDetail.orderCode + "'>";
- xypyHtml += "<input type='checkbox'/>";
- xypyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- xypyHtml += "<div>";
- }
- xypyHtml += "<span style='color: red;'>" + pyDetail.groupOrder + "." + "</span>";
- xypyHtml += pyDetail.name;
- xypyHtml += " ";
- xypyHtml += pyDetail.specification;
- xypyHtml += " X ";
- xypyHtml += pyDetail.quantity;
- xypyHtml += pyDetail.packUnit;
- xypyHtml += " 用法: ";
- xypyHtml += pyDetail.supplyName;
- xypyHtml += " ";
- xypyHtml += pyDetail.drugQuan;
- xypyHtml += pyDetail.unitDesc;
- xypyHtml += " ";
- xypyHtml += pyDetail.frequency;
- xypyHtml += " ";
- xypyHtml += pyDetail.orderDays;
- xypyHtml += "天 ";
- if (pyDetail.tryFlag != undefined && pyDetail.tryFlag != null && pyDetail.tryFlag != "null" && pyDetail.tryFlag != "") {
- xypyHtml += pyDetail.tryFlag;
- } else if (pyDetail.tryResult != undefined && pyDetail.tryResult != null && pyDetail.tryResult != "null" && pyDetail.tryResult != "") {
- xypyHtml += pyDetail.tryResult;
- }
- if (checkBox) {
- xypyHtml += "</span>";
- }
- xypyHtml += "</div>";
- }
- }
- afterFitContent(contentId, xypyHtml, titleId);
- } else {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- }
- }
- /**
- * 构造中药处方详情和模板预览方法
- * @param zyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitzyContent(zyPrescription, contentId, titleId, checkBox) {
- if (zyPrescription == null || zyPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zyDetail = zyPrescription[0];
- if (zyDetail == null || zyDetail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var detail = zyDetail.detail;
- if (detail == null || detail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zypyHtml = "";
- for (var i = 0; i < detail.length; i++) {
- //zypyHtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- var zy = detail[i];
- if (zy == null || zy.length == 0) {
- continue;
- }
- if (checkBox) {
- zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\" style='cursor: pointer;' data-id='" + zy.orderCode + "'>";
- zypyHtml += "<input type='checkbox'/>";
- zypyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\">";
- }
- zypyHtml += zy.name;
- var instructionText = zy.instructionText;
- if (instructionText != null && instructionText != "") {
- zypyHtml += "[";
- zypyHtml += instructionText;
- zypyHtml += "]";
- }
- zypyHtml += zy.quantity;
- zypyHtml += "g";
- if (checkBox) {
- zypyHtml += "</span>";
- }
- zypyHtml += "</div>";
- // if (i % 4 == 0) {
- // zypyHtml += '</div>';
- // }
- }
- // if(detail.length%4!=0){
- // for(var i=0;i<4-(detail.length%4);i++){
- // zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\"></div>";
- // }
- // }
- var zyfs = zyDetail.zyfs;
- if (zyfs != null && zyfs != "") {
- zypyHtml += " <div class=\"col-md-12 col-sm-12 col-xs-12\">";
- zypyHtml += ' <div style="text-indent: 2em;">';
- zypyHtml += ' <div>';
- zypyHtml += 'x<span>';
- zypyHtml += zyfs;
- zypyHtml += '</span> 付</div>';
- }
- afterFitContent(contentId, zypyHtml, titleId);
- }
- /**
- * 构造辅助检查、检验处方详情和模板预览方法
- * @param jcjyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitJcjyContent(jcjyPrescription, contentId, titleId, checkBox) {
- if (jcjyPrescription == null || jcjyPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var jcjyDetail = jcjyPrescription[0];
- if (jcjyDetail == null || jcjyDetail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var detail = jcjyDetail.detail;
- if (detail == null || detail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var jcjyHtml = "";
- for (var i = 0; i < detail.length; i++) {
- var jcjy = detail[i];
- if (jcjy == null || jcjy.length == 0) {
- continue;
- }
- if (checkBox) {
- jcjyHtml += "<div style='cursor: pointer;' data-id='" + jcjy.orderCode + "'>";
- jcjyHtml += "<input type='checkbox'/>";
- jcjyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- jcjyHtml += "<div>";
- }
- jcjyHtml += jcjy.index + ".";
- jcjyHtml += jcjy.name;
- var drugUnit = jcjy.drugUnit;
- if (drugUnit == undefined || drugUnit == null || drugUnit == "") {
- drugUnit = "";
- }
- var drugQuan = jcjy.drugQuan;
- if (drugQuan != undefined && drugQuan != null && drugQuan != "") {
- jcjyHtml += " 单量:" + drugQuan + drugUnit;
- }
- var orderDays = jcjy.orderDays;
- if (orderDays != undefined && orderDays != null && orderDays != "") {
- jcjyHtml += " 天数:" + orderDays + "天";
- }
- var frequency = jcjy.frequency;
- if (frequency != undefined && frequency != null && frequency != "") {
- jcjyHtml += " 频次:" + frequency;
- }
- var quantity = jcjy.quantity;
- if (quantity != undefined && quantity != null && quantity != "") {
- jcjyHtml += " 总量:" + quantity + drugUnit;
- }
- if (checkBox) {
- jcjyHtml += "</span>";
- }
- jcjyHtml += "</div>";
- }
- afterFitContent(contentId, jcjyHtml, titleId);
- }
- /**
- * 构造入院处方详情和模板预览方法
- * @param jcjyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitZyReqContent(zyReqPrescription, contentId, titleId, checkBox) {
- if (zyReqPrescription == null || zyReqPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zyReqHtml = "";
- if (checkBox) {
- zyReqHtml += "<div style='cursor: pointer;'>";
- zyReqHtml += "<input type='checkbox'/>";
- zyReqHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- zyReqHtml += "<div>";
- }
- zyReqHtml += "收住院 [";
- zyReqHtml += zyReqPrescription.reqDept;
- if (zyReqPrescription.smallDept != null && zyReqPrescription.smallDept != "") {
- zyReqHtml += "(" + zyReqPrescription.smallDept + ")";
- }
- zyReqHtml += "]";
- if (zyReqPrescription.admissStatus != null && zyReqPrescription.admissStatus != "") {
- zyReqHtml += zyReqPrescription.admissStatus;
- }
- zyReqHtml += " 侯床";
- if (checkBox) {
- zyReqHtml += "</span>";
- }
- zyReqHtml += "</div>";
- afterFitContent(contentId, zyReqHtml, titleId);
- }
- /**
- * 处方详情构造方法后续事件,如所有的复选框默认勾选
- * @param contentId
- * @param zyReqHtml
- * @param titleId
- */
- function afterFitContent(contentId, zyReqHtml, titleId) {
- $("#" + contentId).html(zyReqHtml);
- $("#" + titleId).removeClass("hide").addClass("in");
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#" + titleId).find("input[type='checkbox']").prop("checked", true);
- $("#" + contentId).find("input[type='checkbox']").each(function (index, obj) {
- $(obj).prop("checked", true);
- });
- } else {
- $("#" + titleId).find("input[type='checkbox']").prop("checked", false);
- }
- }
- /**
- * 模板、详情页行数据点击事件
- * @param obj
- */
- function rowDataClick(obj) {
- $(obj).prev().click();
- }
- /**
- * 模板、详情页治疗分类标题点击事件
- * @param obj
- * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
- */
- function titleClick(obj, source) {
- var contentObj = $(obj).parent().next();
- var check = $(obj).prop("checked");
- if (source == 0) {
- var prev = $(obj).prev();
- check = !$(prev).prop("checked");
- $(prev).prop("checked", check)
- }
- if (contentObj != null) {
- $(contentObj).children().each(function (index, object) {
- //以下两个方法,单独调用一个可能不行
- $(object).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- });
- }
- }
- /**
- * 处方明细复选框点击事件
- * @param obj
- * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
- */
- function prescriptionCfmxChosice(obj, source) {
- var check = $(obj).prop("checked");
- if (source == 0) {
- var prev = $(obj).prev();
- check = !$(prev).prop("checked");
- //以下两个方法,单独调用一个可能不行
- $(prev).prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- }
- var conents = $(obj).parent().parent().nextAll();
- if (conents == null || conents.length == 0) {
- return;
- }
- $(conents).each(function (index, object) {
- //以下两个方法,单独调用一个可能不行
- $(object).find("div:eq(0)").find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- var contentObj = $(object).find("div:eq(1)");
- if (contentObj != null) {
- $(contentObj).children().each(function (contentIndex, contentObject) {
- $(contentObject).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- });
- }
- });
- }
- /**
- * 简明病历标题点击事件
- * @param obj
- */
- function prescriptionJmblChosice(obj) {
- var prev = $(obj).prev();
- var check = !$(prev).prop("checked");
- $(prev).prop("checked", check); //如果鼠标点击选中了,执行后可以取消选中
- }
- /**
- * 医疗范文详情预览
- * @param id
- */
- function medicalModelModal(id) {
- closeObjectWebui(false);
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#conciseRecordsYlfw").prop("checked", true);
- $("#prescriptionSubsidiaryYlfw").prop("checked", true);
- } else {
- $("#conciseRecordsYlfw").prop("checked", false);
- $("#prescriptionSubsidiaryYlfw").prop("checked", false);
- }
- $.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);
- $("#tgjcTemplate").html(jsonData.mzBlRecord.emrPe);
- $("#jkjyTemplate").html(jsonData.mzBlRecord.emrJkjy);
- var icdText = res.data.icdText;
- $("#zdTemplate").html("");
- $("#xypyContent").html("");
- $("#xymjContent").html("");
- $("#xyjeContent").html("");
- $("#yczlContent").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 prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null && prescriptionDetail != "") {
- prescriptionDetail = JSON.parse(prescriptionDetail);
- var xyPrescription = prescriptionDetail.xyPrescription;
- if (xyPrescription != null) {
- fitxyContent(xyPrescription.pyPrescription, "xypyContent", "xypyTitle", true);
- fitxyContent(xyPrescription.mjPrescription, "xymjContent", "xymjTitle", true);
- fitxyContent(xyPrescription.jePrescription, "xyjeContent", "xyjeTitle", true);
- fitxyContent(xyPrescription.ycPrescription, "yczlContent", "yczlTitle", true);
- } else {
- $("#xypyTitle").removeClass("in").addClass("hide");
- $("#xypyContent").html("");
- $("#xymjTitle").removeClass("in").addClass("hide");
- $("#xymjContent").html("");
- $("#xyjeTitle").removeClass("in").addClass("hide");
- $("#xyjeContent").html("");
- $("#yczlTitle").removeClass("in").addClass("hide");
- $("#yczlContent").html("");
- }
- var zyPrescription = prescriptionDetail.zyPrescription;
- if (zyPrescription != null) {
- fitzyContent(zyPrescription, "zyzlContent", "zyzlTitle", true);
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- $("#zyzlContent").html("");
- }
- var jcjyPrescription = prescriptionDetail.jcjyPrescription;
- if (jcjyPrescription != null) {
- fitJcjyContent(jcjyPrescription, "jcjyContent", "jcjyTitle", true);
- } else {
- $("#jcjyTitle").removeClass("in").addClass("hide");
- $("#jcjyContent").html("");
- }
- var zlPrescription = prescriptionDetail.zlPrescription;
- if (zlPrescription != null) {
- fitJcjyContent(zlPrescription, "zlContent", "zlTitle", true);
- } else {
- $("#zlTitle").removeClass("in").addClass("hide");
- $("#zlContent").html("");
- }
- var zyReqPrescription = prescriptionDetail.zyReqPrescription;
- if (zyReqPrescription != null) {
- fitZyReqContent(zyReqPrescription, "zyReqContent", "zyReqTitle", true);
- } else {
- $("#zyReqTitle").removeClass("in").addClass("hide");
- $("#zyReqContent").html("");
- }
- } else {
- $("#xypyTitle").removeClass("in").addClass("hide");
- $("#xypyContent").html("");
- $("#xymjTitle").removeClass("in").addClass("hide");
- $("#xymjContent").html("");
- $("#xyjeTitle").removeClass("in").addClass("hide");
- $("#xyjeContent").html("");
- $("#yczlTitle").removeClass("in").addClass("hide");
- $("#yczlContent").html("");
- $("#zyzlTitle").removeClass("in").addClass("hide");
- $("#zyzlContent").html("");
- $("#jcjyTitle").removeClass("in").addClass("hide");
- $("#jcjyContent").html("");
- $("#zlTitle").removeClass("in").addClass("hide");
- $("#zlContent").html("");
- $("#zyReqTitle").removeClass("in").addClass("hide");
- $("#zyReqContent").html("");
- }
- } 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, null, null);
- }
- $("#zlItem").val(res.data.name);
- $("#zlItem").blur();
- $("#descriptions").val(res.data.descriptions);
- $("#zlItemPrice").val(res.data.chargeAmount);
- $("#chargeUnit").val(res.data.chargeUnit);
- $("#zl_current_code").val(res.data.code);
- $("#zlRemark").val(mzChargeDetail.instructionText);
- $("#dayZlNum").selectpicker('val', mzChargeDetail.orderDays);
- $('#dayZlNum').selectpicker('refresh');
- $("#orderFrequencyZl").selectpicker('val', mzChargeDetail.frequency);
- $('#orderFrequencyZl').selectpicker('refresh');
- if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
- $("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
- $('#zlExecUnit').selectpicker('refresh');
- }
- $("#itemQuantity").val(mzChargeDetail.drugQuan);
- $("#totalNumZl").val(mzChargeDetail.quantity);
- saveZlItem(false);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方回写
- * @param jsonData 处方数据
- * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
- */
- function editPrescription(jsonData, type) {
- orderNoAndTableIdMap = new Map();
- tableIdAndOrderNoMap = new Map();
- var firstOrNot = jsonData.firstOrNot;
- var conciseRecordsFlag = false;
- if (type == 1) {
- conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
- } else if (type == 2) {
- conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
- }
- if (firstOrNot == 0) {
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#not").next().click();
- }
- if (type == 0 || conciseRecordsFlag) {
- $("#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;
- if (icdCode != null && icdCode != "" && icdCode.length > 0) {
- $.ajax({
- type: "GET",
- url: '/thmz/getZdIcdByCodes?icdCode=' + icdCode,
- 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) {
- if (res.data != null && res.data.length > 0) {
- for (var i = 0; i < res.data.length; i++) {
- fitDiagnoseValue(res.data[i].name, res.data[i].code);
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
- }
- //西药选中的数据组
- var xyArrays = [];
- //中药选中的数据组
- var zyArrays = [];
- //辅助检查、检验选中的数据组
- var jcjyArrays = [];
- //诊疗选中的数据组
- var zlArrays = [];
- //住院选中的数据组
- var zyReqArrays = [];
- //组号与同组药数量的map
- var groupOrderAndLengthMap = new Map();
- //处方号与同处方号药数量的map
- var orderNoAndLengthMap = new Map();
- //住院回写
- var zyReqCallBack = false;
- if (type == 1) {
- setCallBackArrays("xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("zyzlContent", zyArrays, null, null);
- setCallBackArrays("jcjyContent", jcjyArrays, null, null);
- setCallBackArrays("zlContent", zlArrays, null, null);
- zyReqCallBack = $("#zyReqContent").find("input").prop("checked");
- } else if (type == 2) {
- setCallBackArrays("prescriptionDetail_xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_zyzlContent", zyArrays, null, null);
- setCallBackArrays("prescriptionDetail_jcjyContent", jcjyArrays, null, null);
- setCallBackArrays("prescriptionDetail_zlContent", zlArrays, null, null);
- zyReqCallBack = $("#prescriptionDetail_zyReqContent").find("input").prop("checked");
- } else if (type == 0) {
- zyReqCallBack = true;
- }
- var mzChargeDetailList = jsonData.mzChargeDetailList;
- var mzZyReq = jsonData.mzZyReq;
- //中药的公共参数是否已经设置了
- var hadSetZyFullParams = false;
- //西药,成药,医材,麻精,中药,诊疗
- if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
- //当前实际回写的组号
- var currentOrderNo = null;
- //处方号与药品类型关系
- var orderAndGroupNoMap = new Map();
- // mzChargeDetailList.sort(function (a, b) {
- // return a.groupNo - b.groupNo
- // });
- 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") {
- if (type != 0 && !isInArray(code, zlArrays)) {
- continue;
- }
- 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;
- }
- var orderNo = mzChargeDetail.orderNo;
- orderAndGroupNoMap.put(orderNo, groupNo);
- if (type != 0 && !isInArray(code + "_" + serial + "_" + groupOrder + "_" + orderNo, xyArrays)) {
- continue;
- }
- var lastGroupOrder = parseInt($("#groupId > option:last").val());
- while (lastGroupOrder < groupOrder) {
- appendGroupOrder();
- lastGroupOrder = parseInt($("#groupId > option:last").val());
- }
- //appendGroupOrder()
- $("#groupId").selectpicker('val', groupOrder);
- $('#groupId').selectpicker('refresh');
- //模板和历史轨迹回调的时候,如果前一个处方不满5个,就将后面的处方的药品添加到上一个处方中,但如果同一组药不能全部添加到上一个处方,就不会追加到该处方中
- var orderNoLength = orderNoAndLengthMap.get(orderNo);
- if (currentOrderNo == null) {
- currentOrderNo = orderNo;
- } else if (orderAndGroupNoMap.get(currentOrderNo) != orderAndGroupNoMap.get(orderNo)) {
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //查询还没有满5个的处方页
- var tempOrderNo = null;
- for (var k = 0; k < currentGroupNos.length; k++) {
- if ($(currentGroupNos[k]).val() == groupNo) {
- var next = $(currentGroupNos[k]).next();
- if ($(next).children().length < 4) {
- var parentId = $(currentGroupNos[k]).parent().attr("id");
- tempOrderNo = tableIdAndOrderNoMap.get(parentId);
- }
- }
- }
- currentOrderNo = tempOrderNo;
- } else if (currentOrderNo != orderNo && orderNoLength < 5) {
- var currentOrderNoLength = orderNoAndLengthMap.get(currentOrderNo);
- var groupOrderLength = groupOrderAndLengthMap.get(groupOrder);
- if (groupOrderLength + currentOrderNoLength <= 5) {
- currentOrderNoLength = currentOrderNoLength + 1;
- orderNoLength = orderNoLength - 1;
- groupOrderLength = groupOrderLength - 1;
- orderNoAndLengthMap.put(currentOrderNo, currentOrderNoLength);
- orderNoAndLengthMap.put(orderNo, orderNoLength);
- groupOrderAndLengthMap.put(groupOrder, groupOrderLength);
- orderNo = currentOrderNo;
- if (currentOrderNoLength == 5) {
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //查询还没有满5个的处方页,
- var tempOrderNo = null;
- for (var k = 0; k < currentGroupNos.length; k++) {
- if ($(currentGroupNos[k]).val() == groupNo) {
- var next = $(currentGroupNos[k]).next();
- //这里判断是4,是因为已经把组号设置了,所以要减去1
- if ($(next).children().length < 4) {
- var parentId = $(currentGroupNos[k]).parent().attr("id");
- tempOrderNo = tableIdAndOrderNoMap.get(parentId);
- }
- }
- }
- currentOrderNo = tempOrderNo;
- }
- } else {
- currentOrderNo = orderNo;
- }
- }
- checkYpInfo(code, serial, groupNo, false, orderNo);
- // 给药方式 同组药品给药方式相同
- $("#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") {
- $("#tryResult").selectpicker('val', 100);
- $('#tryResult').selectpicker('refresh');
- } else if (mzChargeDetail.tryResult != null && mzChargeDetail.tryResult != "null" && mzChargeDetail.tryResult != "") {
- $("#tryResult").selectpicker('val', mzChargeDetail.tryResult);
- $('#tryResult').selectpicker('refresh');
- }
- $("#gross").val(mzChargeDetail.quantity);
- $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()).toFixed(2));
- $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
- $('#medicalAdvice').selectpicker('refresh');
- saveWesternMedicineWithCheck(false, orderNo);
- $("#western_medicine_button").click();
- $("#xyTab").find("li:eq(0) a").off("click").click();
- } else {
- if (type != 0 && !isInArray(code + "_" + serial, zyArrays)) {
- continue;
- }
- //中药与颗粒剂
- 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');
- $("#cyJsl").val(mzChargeDetail.cyJsl);
- $("#cyZql").val(mzChargeDetail.cyZql);
- $("#cyFj").val(mzChargeDetail.cyFj);
- $("#cyFfcs").val(mzChargeDetail.cyFfcs);
- $("#cyMtjs").val(mzChargeDetail.cyMtjs);
- $("#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;
- if (type != 0 && !isInArray(code, jcjyArrays)) {
- continue;
- }
- 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 (zyReqCallBack && 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(false);
- }, 1000);
- //清空映射map
- orderNoAndTableIdMap = null;
- tableIdAndOrderNoMap = null;
- }
- /**
- * 根据勾选内容设置选中集合
- * @param id 区域id
- * @param arrays 集合
- * @param groupOrderAndLengthMap 组号与同组药数量的map
- * @param orderNoAndLengthMap 处方号与同处方号药数量的map
- */
- function setCallBackArrays(id, arrays, groupOrderAndLengthMap, orderNoAndLengthMap) {
- var contents = $("#" + id).children();
- if (contents == null || contents.length == 0) {
- return;
- }
- $(contents).each(function (index, obj) {
- var checked = $(obj).find("input").prop("checked");
- var data_id = $(obj).attr("data-id");
- if (checked && data_id != undefined && data_id != null && data_id != "null" && data_id != "") {
- arrays[arrays.length] = data_id;
- var dataArr = null;
- //设置组号与同组药品数量关系
- if (groupOrderAndLengthMap != null) {
- dataArr = data_id.split("_");
- if (dataArr != null && dataArr.length >= 3) {
- var groupOrder = Number(dataArr[2]);
- var length = groupOrderAndLengthMap.get(groupOrder);
- if (length == null || length == "") {
- length = 0;
- }
- length++;
- groupOrderAndLengthMap.put(groupOrder, length);
- }
- }
- //设置处方号与同处方号药品数量关系
- if (orderNoAndLengthMap != null) {
- if (dataArr == null) {
- dataArr = data_id.split("_");
- }
- if (dataArr != null && dataArr.length >= 4) {
- var orderNo = Number(dataArr[3]);
- var length = orderNoAndLengthMap.get(orderNo);
- if (length == null || length == "") {
- length = 0;
- }
- length++;
- orderNoAndLengthMap.put(orderNo, length);
- }
- }
- }
- });
- }
- /**
- * 调用医疗范文
- */
- function callTemplate() {
- clearWorkSpaceExcludeUser(2);
- $.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');
- $('#operationType').selectpicker('val', 1);
- $('#operationType').selectpicker('refresh');
- $("#operationTypeDiv").removeClass("hide").addClass("in");
- $("#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
- });
- //select 从后台加载数据,并保留之前选择的内容
- dynamicSelectWithOri("editZd", '/thmz/getAllZdIcdCommonParams?commonParams=');
- }
- /**
- * 初始化性别下拉选
- */
- 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');
- //医疗范文操作类型
- var operationType = '<option value="0">新增</option><option value="1">修改</option>';
- $('#operationType').html(operationType);
- $('#operationType').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');
- }
- /**
- * 初始化皮试结果下拉选
- * @param categoriesFlag 0 口服 2 注射针剂
- */
- function initTryResultSelect(categoriesFlag) {
- var tryResult = '';
- if (categoriesFlag == 2 || categoriesFlag == "2") {
- tryResult += '<option value="100">皮试</option>';
- }
- tryResult += '<option value="0">阴性</option><option value="3">免试</option>';
- //var tryResult = '<option value="100">皮试</option><option value="0">阴性</option><option value="3">免试</option>';
- $('#tryResult').html(tryResult);
- $('#tryResult').selectpicker('refresh');
- //口服药选择皮试结果
- $("#tryResult").parent().parent().parent().removeClass("hide").addClass("in");
- }
- /**
- * 初始化病人身份类别下拉选
- */
- 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() {
- let code = escape($('#inpatientWardBeHospitalized').val()).replace(/\+/g, '%2B');
- //小科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getSmallDeptByDept?code=' + code,
- 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=' + code,
- 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 initMztcSelect() {
- var selectHtml = '<option value="0">否</option><option value="1">是</option>';
- $('#zgmztczf').html(selectHtml);
- $('#zgmztczf').selectpicker('refresh');
- $('#grzhzf').html(selectHtml);
- $('#grzhzf').selectpicker('refresh');
- }
- /**
- * 初始化医疗范文范围下拉选
- * @param templateTypeId
- */
- function initTemplateTypeSelect(templateTypeId) {
- $.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>';
- $('#' + templateTypeId).append(html);
- });
- $('#' + templateTypeId).selectpicker('refresh');
- // $('#'+templateTypeId).selectpicker('val', "0");
- // $('#'+templateTypeId).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/getXyOrderFrequencys',
- 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');
- }
- });
- }
- /**
- * 初始中药频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initZyOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getZyOrderFrequencys',
- 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 initAllMzYshZdFysm() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAllMzYshZdFysm',
- 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;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.name.indexOf(",") < 0) {
- //过滤组合的用法
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- }
- });
- $('.useType').empty();
- $('.useType').html(html);
- $('.useType').selectpicker('refresh');
- $('.useType').selectpicker('val', "2");
- $('.useType').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) {
- saveWesternMedicineWithCheck(true, null);
- } else if (index == 1) {
- saveChineseMedicine(true);
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- * orderNoParmams
- */
- function saveWesternMedicineWithCheck(calculateTotalAmountFlag, orderNoParmams) {
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#western_medicine_update_flag").val();
- if (updateFlag == "true" || updateFlag == true) {
- saveWesternMedicine(calculateTotalAmountFlag);
- }else {
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
- initNavTabs(0, currentGroupNo, orderNoParmams);
- }
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children().length;
- var thisGroupNo = $(tableId).find("input.current_groupNo").val();
- var flag = childrens === 5;
- if (!calculateTotalAmountFlag) {
- flag = childrens === 5 && $(tableId).is(':last-child');
- }
- if (thisGroupNo != null && thisGroupNo != '' && currentGroupNo != thisGroupNo) {
- //当前编辑的处方与选中的品类非同一处方能保存的
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //是否需要新增处方页,以保存医材处方
- var needAddTable = true;
- for (var i = 0; i < currentGroupNos.length; i++) {
- if ($(currentGroupNos[i]).val() == currentGroupNo) {
- var next = $(currentGroupNos[i]).next();
- if (needAddTable && $(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- //因为存在没有满5个的处方页,直接保存到该页
- needAddTable = false;
- }
- }
- }
- if (needAddTable) {
- //91 医材
- var message = "医材需要单独处方,是否需要新增医材处方?";
- if (currentGroupNo == '71') {
- message = "普通西成药需要单独处方,是否需要新增处方?"
- } else if (currentGroupNo == '111') {
- message = "麻、精一药物需要单独处方,是否需要新增处方?"
- } else if (currentGroupNo == '131') {
- message = "精二药物需要单独处方,是否需要新增处方?"
- }
- if (calculateTotalAmountFlag) {
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, currentGroupNo, orderNoParmams);
- saveWesternMedicine(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click").on("click", function (t) {
- return;
- });
- }
- }
- } else if (flag) {
- if (calculateTotalAmountFlag) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, currentGroupNo, orderNoParmams);
- saveWesternMedicine(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click").on("click", function (t) {
- return;
- });
- }
- } else {
- saveWesternMedicine(calculateTotalAmountFlag);
- }
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveWesternMedicine(calculateTotalAmountFlag) {
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- //药品名称
- var westernMedicineNamme = $("#western_medicine_name").val();
- var tableId = $("#xyTab li.active").find("a").attr("href");
- if(tableId==undefined){
- refreshNavTabs(0, currentGroupNo, null);
- tableId = $("#xyTab li.active").find("a").attr("href");
- }
- var thisGroupNo = $(tableId).find("input.current_groupNo").val();
- if(currentGroupNo!=thisGroupNo){
- //91 医材
- var type="医材";
- if (currentGroupNo == '71') {
- type = "普通西成药"
- } else if (currentGroupNo == '111') {
- type = "麻、精一药物"
- } else if (currentGroupNo == '131') {
- type = "精二药物"
- }
- errorMesageSimaple("【"+westernMedicineNamme+"】是"+type+",无法保存到当前处方,请切换或者新增相应的处方进行保存。");
- return;
- }
- //当前处方选项卡下标
- var xyTabIndex = $("#xyTab li.active").index();
- //组号
- var groupId = $("#groupId").val();
- if (gropuIdAndOrderNoMap == null) {
- gropuIdAndOrderNoMap = new Map();
- }
- var exitIndex = gropuIdAndOrderNoMap.get(groupId);
- if (exitIndex == null) {
- exitIndex = xyTabIndex;
- gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
- }
- if (xyTabIndex != exitIndex) {
- var westernMedicineUpdateFlag = $("#western_medicine_update_flag").val();
- var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
- //非修改组号的情况下就需要切换组号
- if (!((westernMedicineUpdateFlag == true || westernMedicineUpdateFlag == "true") && westernMedicineOriGroupId != groupId)) {
- groupId = parseInt($("#groupId > option:last").val());
- $("#groupId").selectpicker('val', groupId);
- $('#groupId').selectpicker('refresh');
- gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
- appendGroupOrder();
- }
- warningMesageSimaple("同一组药必须出现在同一个处方中,当前组号已经被其他处方使用,系统已自动为您重新分配组号!");
- //return;
- }
- //当前药品编码
- var currentCode = $("#western_medicine_current_code").val();
- //当前药品规格
- var currentSerial = $("#western_medicine_current_serial").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 tryResult = $("#tryResult").val();
- //药品大类标志
- var categoriesFlag = $("#categoriesFlag").val();
- 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 (tryResult != null && tryResult != 'null' && tryResult != "") {
- if (tryResult == "100" || tryResult == 100) {
- html += '皮试 ';
- } else {
- html += '皮试结果: ' + $('#tryResult option:selected').text();
- }
- }
- if (medicalAdvice != null && medicalAdvice != '') {
- html += '医嘱:' + medicalAdviceText;
- }
- 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="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_tryResult" value="' + tryResult + '"/>';
- html += '<input type="hidden" class="temporary_items_currentGroupNo" value="' + currentGroupNo + '"/>';
- html += '<input type="hidden" class="temporary_items_categoriesFlag" value="' + categoriesFlag + '"/>';
- 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) {
- //药品有可能会修改,所以,判断的时候要用原药品编码
- var updateOriCode = $("#update_ori_code").val();
- //规格有可能会修改,所以,判断的时候要用原规格
- var updateOriSerial = $("#update_ori_serial").val();
- //组号有可能会修改,所以,判断的时候要用原组号
- var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
- 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();
- var temporaryItemsGroupId = $(formGroups[i]).find("input.temporary_items_groupId").val();
- if (temporaryItemsCode === updateOriCode && temporaryItemsSerial === updateOriSerial && temporaryItemsGroupId == westernMedicineOriGroupId) {
- //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(true);
- resetGroupIdSelect()
- }
- //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
- 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);
- resetGroupIdMap();
- }
- /**
- * 上移
- * @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) {
- clearWesternMedicine(true);
- //是新增药品还是编辑 true 修改 默认false
- $("#western_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //组号
- $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
- //组号有可能会修改,所以,判断的时候要用原组号
- $("#western_medicine_ori_group_id").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);
- //当前修改药品原始编码
- $("#update_ori_code").val(code);
- //当前修改的药品原始规格
- $("#update_ori_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 tryResult = $(parentObject).find("input.temporary_items_tryResult").val();
- //设置当前药品类型
- $("#current_groupNo").val($(parentObject).find("input.temporary_items_currentGroupNo").val());
- //设置当前药品大类
- $("#categoriesFlag").val($(parentObject).find("input.temporary_items_categoriesFlag").val());
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo"),
- 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")) {
- if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
- initTryResultSelect(res.data.categoriesFlag);
- $("#tryResult").val(tryResult);
- $('#tryResult').selectpicker('refresh');
- }
- }
- $("#packSize").val(res.data.packSize);
- //厂家名称
- $("#manufactoryName").val(res.data.manufactoryName);
- //规格
- $("#specification").val(res.data.specification);
- }
- } 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());
- //当前修改药品原始编码
- $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前修改的药品原始规格
- $("#update_ori_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());
- $("#update_ori_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());
- $("#update_ori_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();
- var descriptions = $(parentObject).find("input.temporary_items_code").val();
- if (descriptions != null && descriptions != "" && descriptions != 'null') {
- $("#descriptions").val(descriptions);
- }
- var dayZlNum = $(parentObject).find("input.temporary_items_dayZlNum").val();
- if (dayZlNum != null && dayZlNum != "" && dayZlNum != 'null') {
- $("#dayZlNum").selectpicker('val', dayZlNum);
- $('#dayZlNum').selectpicker('refresh');
- }
- var orderFrequencyZl = $(parentObject).find("input.temporary_items_orderFrequencyZl").val();
- if (orderFrequencyZl != null && orderFrequencyZl != "" && orderFrequencyZl != 'null') {
- $("#orderFrequencyZl").selectpicker('val', orderFrequencyZl);
- $('#orderFrequencyZl').selectpicker('refresh');
- }
- var totalNumZl = $(parentObject).find("input.temporary_items_totalNumZl").val();
- if (totalNumZl != null && totalNumZl != "" && totalNumZl != 'null') {
- $("#totalNumZl").val(totalNumZl);
- }
- $("#zlExecUnit").selectpicker('val', execUnit);
- $('#zlExecUnit').selectpicker('refresh');
- //描述
- $("#chargeUnit").val(chargeUnit);
- $("#itemQuantity").val(itemQuantity);
- calculateZl(true);
- }
- /**
- * 保存当前辅助检查、检验项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (calculateTotalAmountFlag && 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",
- 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) {
- 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(calculateTotalAmountFlag);
- });
- $("#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 ("003913" != currentCode && 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) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- 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>';
- 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>';
- 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 += '<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(true);
- }
- clearJyJcItem();
- }
- /**
- * 保存当前诊疗项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveZlItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (calculateTotalAmountFlag && 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")},
- async: false,
- 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(calculateTotalAmountFlag);
- });
- $("#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 descriptions = $("#descriptions").val();
- //天数
- var dayZlNum = $("#dayZlNum").val();
- //频次
- var orderFrequencyZl = $("#orderFrequencyZl").val();
- //总量
- var totalNumZl = $("#totalNumZl").val();
- //描述编码
- var chargeUnitCode = chargeUnit;
- //备注
- var remark = $("#zlRemark").val();
- if (calculateTotalAmountFlag == true) {
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何项目!");
- return;
- }
- if (totalNumZl == null || totalNumZl == "" || totalNumZl == "null") {
- 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) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- 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 + ' ';
- if (descriptions != null && descriptions != "") {
- html += " 规格:" + descriptions;
- }
- html += " 单量:" + itemQuantity;
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnit;
- }
- if (dayZlNum != null && dayZlNum != "") {
- html += " 天数:" + dayZlNum + "天";
- }
- if (orderFrequencyZl != null && orderFrequencyZl != "") {
- html += " 频次:" + orderFrequencyZl;
- }
- if (totalNumZl != null && totalNumZl != "") {
- html += " 总量:" + totalNumZl;
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnit;
- }
- }
- if (zlExecUnit != null && zlExecUnit != "") {
- html += " 执行科室:" + zlExecUnitName;
- }
- 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 += '<input type="hidden" class="temporary_items_descriptions" value="' + descriptions + '"/>';
- html += '<input type="hidden" class="temporary_items_dayZlNum" value="' + dayZlNum + '"/>';
- html += '<input type="hidden" class="temporary_items_orderFrequencyZl" value="' + orderFrequencyZl + '"/>';
- html += '<input type="hidden" class="temporary_items_totalNumZl" value="' + totalNumZl + '"/>';
- 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(true);
- }
- clearZlItem();
- }
- /**
- * 临时保存住院证
- * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
- */
- function saveZyReq(messageFlag) {
- //如果
- if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
- initNavTabs(4, null, null);
- }
- 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 检查检验 3诊疗
- * @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);
- }
- }
- }
- var temporaryItemsGroupId= $(obj).parent().find("input.temporary_items_groupId").val();
- var temporaryItemsGroupIds=$(obj).parent().parent().find("input.temporary_items_groupId");
- if(temporaryItemsGroupIds!=null && temporaryItemsGroupIds.length>0){
- var count=0;
- for(var i=0;i<temporaryItemsGroupIds.length;i++){
- if(temporaryItemsGroupId==$(temporaryItemsGroupIds[i]).val()){
- count++;
- }
- }
- //当前删除的药品组号是最后一个的时候,清空缓存
- if(count==1){
- groupIdMap.remove(temporaryItemsGroupId);
- gropuIdAndOrderNoMap.remove(temporaryItemsGroupId);
- }
- }
- $(obj).parent().remove();
- if (index != 4) {
- calculateTotalAmount(false);
- }
- 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);
- }
- }
- if(index==0){
- resetGroupIdMap();
- }
- }
- /**
- * 重置组号与用法、频率天数缓存关系
- */
- function resetGroupIdMap() {
- var temporaryItemsGroupIds=$("#xyTabContent").find("input.temporary_items_groupId");
- if(temporaryItemsGroupIds!=null && temporaryItemsGroupIds.length>0){
- var list=[];
- for(var i=0;i<temporaryItemsGroupIds.length;i++){
- var groupId=$(temporaryItemsGroupIds[i]).val();
- if(list.indexOf(groupId)<0){
- list.push(groupId);
- }
- }
- var keys = groupIdMap.keySet();
- for(var i=0;i<keys.length;i++){
- var key=keys[i];
- if(list.indexOf(key)<0){
- groupIdMap.remove(key);
- }
- }
- }
- }
- /**
- * 清空西药
- * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
- */
- function clearWesternMedicine(flag) {
- $("#western_medicine_update_flag").val(false);
- $("#western_medicine_ori_group_id").val(null);
- $("#update_ori_code").val(null);
- $("#update_ori_serial").val(null);
- //药品名称
- $("#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');
- $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
- //皮试结果
- $("#tryResult").selectpicker('val', null);
- $('#tryResult').selectpicker('refresh');
- //$("#gross").attr("readonly", "readonly");
- $("#manufactoryName").val(null);
- $("#specification").val(null);
- $("#categoriesFlag").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) {
- //药品有可能会修改,所以,判断的时候要用原药品编码
- var updateOriCode = $("#update_ori_code").val();
- //规格有可能会修改,所以,判断的时候要用原规格
- var updateOriSerial = $("#update_ori_serial").val();
- 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 === updateOriCode && temporaryItemsSerial === updateOriSerial) {
- 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(true);
- }
- clearChineseMedicine();
- }
- /**
- * 清空中药
- */
- function clearChineseMedicine() {
- $("#chinese_medicine_update_flag").val(false);
- $("#update_ori_code").val(null);
- $("#update_ori_serial").val(null);
- //药品名称
- $("#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() {
- $("#update_ori_code").val(null);
- $("#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() {
- $("#update_ori_code").val(null);
- $("#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);
- $("#descriptions").val(null);
- $("#dayZlNum").selectpicker('val', 1);
- $('#dayZlNum').selectpicker('refresh');
- $("#orderFrequencyZl").selectpicker('val', 'ONCE');
- $('#orderFrequencyZl').selectpicker('refresh');
- $("#totalNumZl").val(null);
- $("#totalAmountZl").val(null);
- $("#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();
- }
- /**
- * 计算总金额
- * @param needRemoveLastObject 是否需要删除最后一次加进来的项目
- */
- function calculateTotalAmount(needRemoveLastObject) {
- //调用后去除所有的验证提示
- $("div.alert ").each(function (index, obj) {
- $(obj).remove();
- });
- var jsonData = getParamsForpPrescription(3);
- $.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));
- }
- }
- } else {
- if (needRemoveLastObject) {
- var index = getIndex("bill_item_group");
- 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 last = $(tableId).find("div:eq(0)").find("div:last");
- if (last != null) {
- $(last).find("i:eq(2)").click();
- $(last).find("i:eq(3)").click();
- }
- }
- 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
- * @param type 1 患者详情处编辑 2 快速接诊处编辑 3 就诊详情预览
- */
- function editUserModal(patientId, type) {
- if (type == 3) {
- $("#editUserModalTitle").html("患者档案【预览】");
- $("#saveEditUser").removeClass("in").addClass("hide");
- } else {
- $("#editUserModalTitle").html("患者档案【修改】");
- $("#saveEditUser").removeClass("hide").addClass("in");
- }
- $("#openSource").val(type);
- if (patientId == null) {
- //医生工作台发起
- patientId = $("#patientId").text();
- }
- // else {
- // //快速接诊界面发起
- // clearRapidAccepts();
- // }
- if (patientId == null || patientId == "null" || patientId == "") {
- errorMesageSimaple("请输入需要编辑的患者信息");
- return;
- }
- $("#rapidAcceptsModal").modal("hide");
- $("#visitingDetailModal").modal("hide");
- $("#editUserModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?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) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res);
- $("#editUserModal").modal("hide");
- }
- }
- });
- }
- /**
- * 处方类型按钮切换事件
- * @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();
- //有时候调用药品多了以后,会导致一个药品处方名对应多个content显现
- var paneId = $("#xyTab li.active").find("a").attr("href");
- if (paneId != null) {
- //去除第一个字符 #
- paneId = paneId.slice(1);
- xyTableOnClick(paneId)
- }
- } 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);
- $('#rapidAcceptsProvinceCode').selectpicker('val', res.data.provinceCode);
- $('#rapidAcceptsProvinceCode').selectpicker('refresh');
- initCity(3, res.data.cityCode);
- initDistrict(3, res.data.cityCode, res.data.districtCode);
- $("#rapidAcceptsDetail").val(res.data.detail);
- $("#rapidAcceptsUserAddress").attr("title", res.data.address);
- $("#rapidAcceptsUserAddress").val(res.data.address);
- $("#rapidAcceptsUserContact").val(res.data.relName);
- $("#rapidAcceptsUserContactPhone").val(res.data.contractName);
- //查询分诊号
- $.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);
- $("#rapidAcceptsUserAddress").attr("title", null);
- $("#mzfzSerialNo").val(null);
- $("#rapidAcceptsUserCardNo").focus();
- $("#rapidAcceptsUserAddress").val(null);
- $("#rapidAcceptsUserContact").val(null);
- $("#rapidAcceptsUserContactPhone").val(null);
- }
- /**
- * 根据病人姓名输入框内容动态加载病人列表
- */
- 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 + ' ';
- html += mzPatientMi.ageString;
- 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;" onkeyup="debounce(loadDiagnose(this.value),100,true)" 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()));
- //中文会导致查询混乱
- $("#paramsDiagnose").on('compositionstart', function () {
- $("#paramsDiagnose").attr("isNeedPrevent", true);
- });
- $("#paramsDiagnose").on('compositionend', function () {
- $("#paramsDiagnose").attr("isNeedPrevent", false);
- });
- 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;
- }
- var isNeedPrevent = $("#paramsDiagnose").attr("isNeedPrevent");
- if (isNeedPrevent == "true") {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getIcdCodeByParams?commonParams=' + value,
- 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].name + '\',\'' + res.data[i].code + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
- html += res.data[i].name;
- html += '<small> (' + res.data[i].code + ')</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;
- // }
- $('#' + MedicineName).webuiPopover('show');
- $('#' + 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) {
- clearWesternMedicine(false);
- checkYpInfo(row.code, row.serial, row.ypType, true, null);
- }
- if (index == 1) {
- checkZyInfo(row.code, row.serial, true);
- }
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 西药
- * @param code
- * @param serial
- * @param groupNo
- * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
- * @param orderNo 处方号,回写的时候需要用,因为有的处方没有满5个
- */
- function checkYpInfo(code, serial, groupNo, needNotice, orderNo) {
- //判断是否有重复的项目 返回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 + "&deptNo=" + localStorage.getItem("currentDeptNo"),
- 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, groupNo, orderNo);
- }
- 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();
- var flag = childrens === 5;
- if (!needNotice) {
- flag = childrens === 5 && $(tableId).is(':last-child');
- }
- 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 (needAddTable && $(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- //因为存在没有满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, orderNo);
- fitWesternMedicine(res, groupNo);
- // //选中药品后,光标默认到用法
- // $("#supplyType").next().click();
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo);
- }
- }
- //当前编辑的处方非普通西药处方
- } else if (flag) {
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo);
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo);
- }
- } else {
- //修改药品
- if (orderNo != null) {
- //西药处方数量
- // var xyTabLiLength = $("#xyTab li").length;
- // if (xyTabLiLength < orderNo) {
- //
- // } else {
- // $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- // }
- var tableId = orderNoAndTableIdMap.get(orderNo);
- if (tableId != null && tableId != "") {
- //切换处方
- $("#xyTab").find("a[href='#" + tableId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- }
- fitWesternMedicine(res, groupNo);
- } else {
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- fitWesternMedicine(res, groupNo);
- }
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 药品与项目自费信息提示
- * @param res
- * @param projectDesc
- */
- function hintProjectSelfPayInfo(selfpayProp, projectDesc) {
- var zgmztczf = $("#zgmztczf").val();
- if ((zgmztczf == 1 || zgmztczf == "1") && selfpayProp != null) {
- selfpayProp = Number(selfpayProp);
- if (selfpayProp > 0) {
- var titile = "当前项目含自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
- if (selfpayProp < 1) {
- titile = "当前项目含部分自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
- }
- warningMesageSimaple(titile);
- }
- }
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 中药
- * @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 + "&deptNo=" + localStorage.getItem("currentDeptNo"),
- 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) {
- hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
- //如果
- if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
- initNavTabs(1, null, null);
- //$("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;
- // }
- $('#jcJyItem').webuiPopover('show');
- $('#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;
- }
- }
- $('#zlItem').webuiPopover('show');
- $('#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: 'chargeAmount',
- title: '价格',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return "0.00元";
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'descriptions',
- 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": {} //数据
- };
- }
- $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- hintProjectSelfPayInfo(row.selfpayProp, "诊疗");
- $('#zlItem').webuiPopover('hide');
- $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#zlExecUnit").selectpicker('refresh');
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3, null, null);
- }
- $("#zlItem").val(row.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(row.chargeAmount);
- $("#chargeUnit").val(row.specification);
- $("#zl_current_code").val(row.code);
- $("#itemQuantity").val(1);
- $("#descriptions").val(row.descriptions);
- $("#descriptions").attr('title', row.descriptions);
- $("#dayZlNum").selectpicker('val', 1);//默认不选中
- $("#dayZlNum").selectpicker('refresh');
- $("#orderFrequencyZl").selectpicker('val', 'ONCE');//默认不选中
- $("#orderFrequencyZl").selectpicker('refresh');
- calculateZl(false);
- $("#chargeUnit").focus();
- return;
- }
- });
- }
- /**
- * 诊疗与医技选中
- * @param code
- * @param name 回写的时候可以设置null
- * @param type 1 检验 2 检查
- * @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) {
- hintProjectSelfPayInfo(res.selfpayProp, type == 1 ? "检验" : "辅助检查");
- //如果
- if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
- initNavTabs(2, null, null);
- }
- 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 入院
- * @param groupNo 初始化时候的药房分类
- * @param orderNo 初始化时候的处方组号
- */
- function initNavTabs(index, groupNo, orderNo) {
- 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 = '入院';
- }
- var tabHtml = '<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab" ';
- if (index == 0) {
- tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
- }
- tabHtml += '>处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>';
- $("#" + tabId).html(tabHtml);
- 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;line-height: 34px;">' +
- ' <label class="my_label_2">复煎:</label>' +
- ' <div style="width: 69px;float: left;">' +
- ' <input type="number" class="form-control " id="cyFj" placeholder="请输入" value="1"/>' +
- ' </div>次' +
- ' </div>';
- html += '<div style="width: 130px;float: left;line-height: 34px;">' +
- ' <label class="my_label_2">分服:</label>' +
- ' <div style="width: 69px;float: left;">' +
- ' <input type="number" class="form-control " id="cyFfcs" placeholder="请输入" value="2"/>' +
- ' </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>';
- 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 water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
- $('#cyJssm').html(water);
- $('#cyJssm').selectpicker('refresh');
- $("#cyJssm").selectpicker('val', "加凉水");
- $('#cyJssm').selectpicker('refresh');
- initAllMzYshZdFysm();
- //initZyOrderFrequencys("zy_orderFrequency_1", false);
- initZySupplyTypes("zy_supplyType_1", false);
- }
- if (groupNo != null && groupNo != "") {
- //设置当前药品的品类
- $("#" + paneId).find("input.current_groupNo").val(groupNo);
- }
- if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
- orderNoAndTableIdMap.put(orderNo, paneId);
- tableIdAndOrderNoMap.put(paneId, orderNo);
- }
- }
- /**
- * 清空处方分页
- * @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";
- $("#cyJsl").val(400);
- $("#cyZql").val(200);
- $("#cyFj").val(1);
- $("#cyFfcs").val(2);
- $("#cyMtjs").val(1);
- $("#zyfs").val(null);
- $("#cyJssm").selectpicker('val', "加凉水");
- $('#cyJssm').selectpicker('refresh');
- $("#zy_supplyType_1").selectpicker('val', null);
- $('#zy_supplyType_1').selectpicker('refresh');
- } 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 诊疗
- * @param orderNo 处方号
- */
- function refreshNavTabs(index, groupNo, orderNo) {
- 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");
- var tabHtml = '<li><a href="#' + paneId + '" role="tab" data-toggle="tab"';
- if (index == 0) {
- tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
- }
- tabHtml += '>' + cfTitle + '</a';
- tabHtml += '</li>';
- $("#" + tabId).append(tabHtml);
- 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');
- if (groupNo != null && groupNo != "") {
- //设置当前药品的品类
- $("#" + paneId).find("input.current_groupNo").val(groupNo);
- }
- if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
- orderNoAndTableIdMap.put(orderNo, paneId);
- tableIdAndOrderNoMap.put(paneId, orderNo);
- }
- }
- /**
- * 判断是否需要自动增加组号
- * @param res
- */
- function autoAddGroupId(res) {
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children();
- var prevCategoriesFlag = null;
- if (childrens != null && childrens.length > 0) {
- prevCategoriesFlag = $(childrens[childrens.length - 1]).find("input.temporary_items_categoriesFlag").val();
- if (prevCategoriesFlag == "" || prevCategoriesFlag == undefined) {
- prevCategoriesFlag = null;
- }
- }
- if (!(res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2" || res.data.categoriesFlag == 1 || res.data.categoriesFlag == "1") ||
- ((res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2" || res.data.categoriesFlag == 1 || res.data.categoriesFlag == "1") && prevCategoriesFlag != null && prevCategoriesFlag != "1" && prevCategoriesFlag != 1 && prevCategoriesFlag != "2" && prevCategoriesFlag != 2)) {
- //非针剂默认要切换组号 或者 是针剂,但是上一个药品不是针剂,这时候也要新换一个组号
- var last = parseInt($("#groupId > option:last").val());
- $("#groupId").selectpicker('val', last);
- $('#groupId').selectpicker('refresh');
- }
- }
- /**
- * 填充西药选中的内容
- * @param res
- * @param groupNo
- */
- function fitWesternMedicine(res, groupNo) {
- hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
- autoAddGroupId(res);
- $("#categoriesFlag").val(res.data.categoriesFlag);
- //prevCategoriesFlag = res.data.categoriesFlag;
- $("#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 || $("#supplyType").val() == "") && res.data.supplyType != null) {
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', res.data.supplyType);
- $('#supplyType').selectpicker('refresh');
- }
- if (($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") && res.data.frequency != null) {
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', res.data.frequency);
- $('#orderFrequency').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") {
- //频次编码 防止频次为空
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
- initTryResultSelect(res.data.categoriesFlag);
- }
- }
- $("#manufactoryName").val(res.data.manufactoryName);
- $("#specification").val(res.data.specification);
- 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 zyfs = $("#zyfs").val();
- var cfAmount = Multiply(zyfs, singleAmount);
- $(tableId).find("span.cf_amount").html(cfAmount);
- calculateTotalAmount(false);
- }
- /**
- * 将病人信息填入患者信息修改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();
- $('#editUserProvinceCode').selectpicker('val', patinet.provinceCode);
- $('#editUserProvinceCode').selectpicker('refresh');
- initCity(2, patinet.cityCode);
- initDistrict(2, patinet.cityCode, patinet.districtCode);
- $("#editUserDetail").val(patinet.detail);
- $("#editUserDetail").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(),
- "provinceCode": $("#editUserProvinceCode").val(),
- "cityCode": $("#editCityCode").val(),
- "districtCode": $("#editUserDistrictCode").val(),
- "detail": $("#editUserDetail").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');
- var patientId = $("#patientId").text();
- if (patientId != null && patientId != 'null' && patientId != "") {
- realClinicalReception(patientId, $("#mzfzSerialNoInClick").val(), $("#mzfzReqTypeNoInClick").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);
- $('#editUserProvinceCode').selectpicker('val', null);
- $('#editUserProvinceCode').selectpicker('refresh');
- $('#editCityCode').selectpicker('val', null);
- $('#editCityCode').selectpicker('refresh');
- $('#editUserDistrictCode').selectpicker('val', null);
- $('#editUserDistrictCode').selectpicker('refresh');
- $("#editUserDetail").val(null);
- $("#editUserContact").val(null);
- $("#editUserContactPhone").val(null);
- var openSource = $("#openSource").val();
- if (openSource == 2 || openSource == '2') {
- $("#rapidAcceptsModal").modal();
- } else if (openSource == 3 || openSource == '3') {
- $("#visitingDetailModal").modal();
- }
- $("#openSource").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();//当前不选中改为选中
- }
- }
- if (res.data.checkboxFlag == 1) {
- if ($("#checkboxFlagCheck").parent().hasClass("checked")) {
- $("#checkboxFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.checkboxFlag == 0) {
- if (!$("#checkboxFlagCheck").parent().hasClass("checked")) {
- $("#checkboxFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.zlPrintFlag == 1) {
- if ($("#zlPrintFlagCheck").parent().hasClass("checked")) {
- $("#zlPrintFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.zlPrintFlag == 0) {
- if (!$("#zlPrintFlagCheck").parent().hasClass("checked")) {
- $("#zlPrintFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- //设置是否默认勾选处方回调
- localStorage.setItem("checkboxFlag", res.data.checkboxFlag);
- } 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;
- var checkboxFlag = $("#checkboxFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var zlPrintFlag = $("#zlPrintFlagCheck").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,
- "checkboxFlag": checkboxFlag,
- "zlPrintFlag": zlPrintFlag
- }),
- 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);
- }
- }
- /**
- * 构建处方参数
- * @param type 1 保存处方 2 保存模板 3 计算金额
- * @returns {any}
- */
- function getParamsForpPrescription(type) {
- 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": ""},' +
- '"zgmztczf":"",' +
- '"grzhzf":"",' +
- '"readCardResult":"",' +
- '"readCardType":"01"}');
- jsonData.patientId = $("#patientId").text();
- jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
- jsonData.icdCode = icdCode;
- jsonData.serialNo = $("#mzfzSerialNoInClick").val();
- if (type == 1) {
- jsonData.turnToConsultationId = $("#turnToConsultationIdInClick").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();
- //职工统筹部分参数
- jsonData.zgmztczf = $("#zgmztczf").val();
- jsonData.grzhzf = $("#grzhzf").val();
- jsonData.readCardResult = $("#readCardResult").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":"","tryFlag":"0","tryResult":"0","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
- 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 tryResult = $(formGroups[j]).find("input.temporary_items_tryResult").val();
- if (tryResult != undefined || tryResult != null || tryResult != "") {
- if (tryResult == 100 || tryResult == "100") {
- tempJson.tryFlag = 1;
- } else {
- tempJson.tryResult = tryResult;
- }
- }
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- }
- }
- //中草药
- var zyTabContents = $("#zyTabContent").find("div.form-group");
- if (zyTabContents != null && zyTabContents.length > 0) {
- orderNo++;
- var zyfs = $("#zyfs").val();
- if (zyfs == null || zyfs == "") {
- if (type == 3) {
- zyfs = 1;
- } else {
- errorMesageSimaple("中药付数为空,请设置!");
- $("#messageButton").attr("disabled", false);
- throw new Error('中药付数为空,请设置!');
- }
- }
- //中药的类型
- 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":"","tryFlag":"0","tryResult":"0","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
- 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.cyJsl = $("#cyJsl").val();
- tempJson.cyZql = $("#cyZql").val();
- tempJson.cyFj = $("#cyFj").val();
- tempJson.cyFfcs = $("#cyFfcs").val();
- tempJson.cyMtjs = $("#cyMtjs").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_totalNumZl").val();
- tempJson.drugQuan = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
- //因为收费表里的单位长度限制,无法存入库
- //tempJson.drugUnit = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
- tempJson.frequency = $(zlTabContents[i]).find("input.temporary_items_orderFrequencyZl").val();
- tempJson.orderDays = $(zlTabContents[i]).find("input.temporary_items_dayZlNum").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() {
- if (!verifyInsuranceInfo()) {
- return;
- }
- //关闭帮助框
- $("#treeButton").webuiPopover('hide');
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- var zgmztczf = $("#zgmztczf").val();
- var readCardResult = $("#readCardResult").val();
- if ((zgmztczf == 1 || zgmztczf == "1") && (readCardResult == null || readCardResult == "")) {
- $("#messageModal").modal();
- $("#messageContent").html("门诊统筹处方必须读卡,是否立即读卡?");
- $("#messageButton").off("click").bind("click", function (t) {
- mztczfSiReadCard(true);
- realSavePrescription(false);
- });
- $("#cancelButton").off("click").bind("click", function (t) {
- t.stopPropagation();
- t.preventDefault();
- realSavePrescription(false);
- });
- } else {
- realSavePrescription(true);
- }
- }
- /**
- * 最终保存处方方法
- * @param openModel 是否需要打开提示弹层 true 需要 false 不需要
- */
- function realSavePrescription(openModel) {
- if (openModel) {
- $("#messageModal").modal();
- }
- $("#messageContent").html("确认保存处方吗?");
- $("#messageButton").off("click").bind("click", function (t) {
- if (mztczfSiReadCardStatus) {
- $("#messageContent").html("门诊统筹正在读卡中,次操作需与医保中心交互,耗时较长,请耐心等待...");
- return;
- }
- $("#messageButton").attr("disabled", true);
- var jsonData = getParamsForpPrescription(1);
- $.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;
- }
- $("#messageButton").attr("disabled", false);
- 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(2);
- var operationType = $("#operationType").val();
- var templateId = $("#templateId").val();
- if (operationType == 0 || operationType == '0') {
- templateId = null;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/saveTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": templateId,
- "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');
- $('#operationType').selectpicker('val', 0);
- $('#operationType').selectpicker('refresh');
- $("#operationTypeDiv").removeClass("in").addClass("hide");
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改
- * @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(1);
- $.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);
- //查询患者的门诊统筹信息
- queryInsuinfo(patientId);
- } 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();
- var mzfzReqTypeNoInClick = $("#mzfzReqTypeNoInClick").val();
- clearUser(false);
- clearWorkSpaceExcludeUser(3);
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 2)
- $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
- $("#mzfzReqTypeNoInClick").val(mzfzReqTypeNoInClick);
- } 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(1);
- $.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);
- //查询患者的门诊统筹信息
- queryInsuinfo(patientId);
- } 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) {
- closeObjectWebui(false);
- 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;
- }
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#conciseRecordsJzxq").prop("checked", true);
- $("#prescriptionSubsidiaryJzxq").prop("checked", true);
- } else {
- $("#conciseRecordsJzxq").prop("checked", false);
- $("#prescriptionSubsidiaryJzxq").prop("checked", false);
- }
- $.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").html('<a onclick="editUserModal(\'' + mzPatientMi.patientId + '\',3)" style=\'cursor: pointer;\'>' + mzPatientMi.name + '</a>');
- $("#visitingDetailPatientAge").text(mzPatientMi.ageString);
- $("#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");
- }
- $("#prescriptionDetail_zs").html(jsonData.mzBlRecord.emrChiefComplaint);
- $("#prescriptionDetail_xbs").html(jsonData.mzBlRecord.emrHpi);
- $("#prescriptionDetail_tgjc").html(jsonData.mzBlRecord.emrPe);
- $("#prescriptionDetail_jkjy").html(jsonData.mzBlRecord.emrJkjy);
- 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 prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null) {
- var checkBox = type == 1;
- prescriptionDetail = JSON.parse(prescriptionDetail);
- var xyPrescription = prescriptionDetail.xyPrescription;
- if (xyPrescription != null) {
- fitxyContent(xyPrescription.pyPrescription, "prescriptionDetail_xypyContent", "prescriptionDetail_xypyTitle", checkBox);
- fitxyContent(xyPrescription.mjPrescription, "prescriptionDetail_xymjContent", "prescriptionDetail_xymjTitle", checkBox);
- fitxyContent(xyPrescription.jePrescription, "prescriptionDetail_xyjeContent", "prescriptionDetail_xyjeTitle", checkBox);
- fitxyContent(xyPrescription.ycPrescription, "prescriptionDetail_yczlContent", "prescriptionDetail_yczlTitle", checkBox);
- } else {
- $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xypyContent").html("");
- $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xymjContent").html("");
- $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xyjeContent").html("");
- $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_yczlContent").html("");
- }
- var zyPrescription = prescriptionDetail.zyPrescription;
- if (zyPrescription != null) {
- fitzyContent(zyPrescription, "prescriptionDetail_zyzlContent", "prescriptionDetail_zyzlTitle", checkBox);
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyzlContent").html("");
- }
- var jcjyPrescription = prescriptionDetail.jcjyPrescription;
- if (jcjyPrescription != null) {
- fitJcjyContent(jcjyPrescription, "prescriptionDetail_jcjyContent", "prescriptionDetail_jcjyTitle", checkBox);
- } else {
- ("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_jcjyContent").html("");
- }
- var zlPrescription = prescriptionDetail.zlPrescription;
- if (zlPrescription != null) {
- fitJcjyContent(zlPrescription, "prescriptionDetail_zlContent", "prescriptionDetail_zlTitle", checkBox);
- } else {
- $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zlContent").html("");
- }
- var zyReqPrescription = prescriptionDetail.zyReqPrescription;
- if (zyReqPrescription != null) {
- fitZyReqContent(zyReqPrescription, "prescriptionDetail_zyReqContent", "prescriptionDetail_zyReqTitle", true);
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyReqContent").html("");
- }
- } else {
- $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xypyContent").html("");
- $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xymjContent").html("");
- $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xyjeContent").html("");
- $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_yczlContent").html("");
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyzlContent").html("");
- $("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_jcjyContent").html("");
- $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zlContent").html("");
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyReqContent").html("");
- }
- $("#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");
- $("#consultationCliniced").removeClass("in").addClass("hide");
- $("#consultationCliniced").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);
- });
- }
- //已诊列表发起会诊
- $("#consultationCliniced").removeClass("hide").addClass("in");
- $("#consultationCliniced").off("click").on("click", function (t) {
- consultationCliniced(patientId);
- });
- } 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);
- //就诊详情的时候,隐藏复选框
- if (type == 0) {
- $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
- $(obj).css("display", "none");
- });
- } else {
- //历史处方显示复选框
- $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
- $(obj).css("display", "inline-block");
- });
- }
- } else {
- errorMesage(res);
- }
- }
- });
- $("#selfAmountView").html(0.00);
- $("#fundPayView").html(0.00);
- $("#acctPayView").html(0.00);
- $("#totalAmountView").html(0.00);
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailFee?patientId=×=&receiptNo=&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.fundPay != undefined && res.fundPay != null) {
- $("#fundPayView").text("¥" + res.fundPay);
- }
- if (res.acctPay != undefined && res.acctPay != null) {
- $("#acctPayView").text("¥" + res.acctPay);
- }
- $("#selfAmountView").text("¥" + res.selfAmount);
- $("#totalAmountView").text("¥" + res.totalAmount);
- } else {
- printIndex = -1;
- }
- }
- });
- }
- /**
- * 查询默认打印机
- */
- 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) {
- //设置成组处方符号
- if (prescriptionDetail.length > 1) {
- var map = new Map();
- var groupOrderlist = [];
- for (var j = 0; j < prescriptionDetail.length; j++) {
- var detail = prescriptionDetail[j];
- var list = map.get(detail.groupOrder);
- if (list == null) {
- list = [];
- map.put(detail.groupOrder, list);
- groupOrderlist[groupOrderlist.length] = detail.groupOrder;
- }
- list[list.length] = detail;
- }
- for (var j = 0; j < groupOrderlist.length; j++) {
- var list = map.get(groupOrderlist[j]);
- if (list.length == 1) {
- continue;
- }
- list[0].groupFlag = "┒";
- list[list.length - 1].groupFlag = "┛";
- if (list.length > 2) {
- for (var t = 1; t < list.length - 1; t++) {
- list[t].groupFlag = "┃";
- }
- }
- }
- }
- var html = "";
- for (var j = 0; j < prescriptionDetail.length; j++) {
- var detail = prescriptionDetail[j];
- html += "<tr><td>" + detail.groupOrder + "</td>";
- html += "<td colspan='2'>";
- html += detail.name + "(" + detail.specification + ")";
- html += "</td>";
- html += "<td colspan='2'></td>";
- html += "<td>X</td>";
- html += "<td rowspan='2' style='height: 100%;line-height: 100%;font-size: 40px;'>";
- if (detail.groupFlag != undefined && detail.groupFlag != null) {
- html += detail.groupFlag;
- }
- html += "</td><td>" + detail.quantity + detail.packUnit + "</td>";
- html += "</tr>";
- html += "<tr><td></td>";
- if (detail.tryResult != undefined && detail.tryResult != null && detail.tryResult != "null" && detail.tryResult != "") {
- html += "<td>" + detail.tryResult + "</td>";
- } else if (detail.tryFlag != undefined && detail.tryFlag != null && detail.tryFlag != "null" && detail.tryFlag != "") {
- html += "<td>" + detail.tryFlag + "</td>";
- } else {
- html += "<td></td>";
- }
- html += "<td style='font-weight: bold;text-align: right;'>用法:</td>";
- html += "<td>" + detail.drugQuan + detail.unitDesc + "/次</td>";
- html += "<td>" + detail.frequency + "</td>";
- html += "<td>" + detail.orderDays + "天</td>";
- html += "<td>" + detail.supplyName + "</td>";
- html += "</tr>";
- }
- html += "<tr><td colspan='7'> ------(以下空白)------</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.jcjyPrescription.length == 0 && prescriptionDetailJson.zyPrescription.length == 0 && prescriptionDetailJson.zyReqPrescription != null && 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;
- var deptName = res.deptName;
- $("#patientNamePrescription").text(mzPatientMi.name);
- $("#patientGenderPrescription").text(mzPatientMi.gender);
- $("#patientAgePrescription").text(mzPatientMi.ageString);
- $("#patientIdPrescription").text(mzPatientMi.patientId);
- $("#deptPrescription").text(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].name;
- html += zyPrescription[i].quantity + "g";
- if (zyPrescription[i].instructionText != null) {
- html += "[" + zyPrescription[i].instructionText + "]";
- }
- if (i % 3 == 2) {
- html += "</td></tr>";
- } else {
- html += "</td>";
- }
- }
- if (zyPrescription.length % 3 != 0) {
- html += "</tr>";
- }
- html += "<tr><td></td><td></td><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td></tr>";
- var cyMtjs = prescriptionDetailJson.zyPrescription[0].cyMtjs;
- if (cyMtjs == null || cyMtjs == "null") {
- cyMtjs = "";
- }
- var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
- if (cyJssm == null || cyJssm == "null") {
- cyJssm = "";
- }
- var cyJsl = prescriptionDetailJson.zyPrescription[0].cyJsl;
- if (cyJsl == null || cyJsl == "null") {
- cyJsl = "";
- }
- var cyZql = prescriptionDetailJson.zyPrescription[0].cyZql;
- if (cyZql == null || cyZql == "null") {
- cyZql = "";
- }
- var cyFj = prescriptionDetailJson.zyPrescription[0].cyFj;
- if (cyFj == null || cyFj == "null") {
- cyFj = "";
- }
- var cyFfcs = prescriptionDetailJson.zyPrescription[0].cyFfcs;
- if (cyFfcs == null || cyFfcs == "null") {
- cyFfcs = "";
- }
- var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
- if (cyFysm == null || cyFysm == "null") {
- cyFysm = "";
- }
- var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
- if (cyDj == null || cyDj == "null") {
- cyDj = "";
- } else {
- cyDj = "(" + cyDj + ")";
- }
- html += "<tr><td colspan='3'>每天" + cyMtjs + "剂," + cyJssm + cyJsl + "ml,煮取量" + cyZql + "ml,复煎" + cyFj + "次。分" + cyFfcs + "次" + cyFysm + " " + cyDj + "。</td></tr>";
- html += "<tr><td colspan='3'> ------(以下空白)------</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.zyPrescription[0].amount + "元 (不含代煎费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- var printZlPrescription = $("#zlPrintFlagCheck").parent().hasClass("checked") == true ? true : 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++) {
- var zlPrescriptionTemp=zlPrescription[i];
- html += "<tr>";
- html += "<td colspan='2'>"+zlPrescriptionTemp.index+"."+zlPrescriptionTemp.name+"</td>";
- html += "<td style='text-align: right;padding-right: 15px;'>X</td>";
- html += "<td>总量:"+zlPrescriptionTemp.quantity+"</td>";
- html += "</tr>";
- html += "<tr>";
- html += "<td width='40%'></td>";
- html += "<td width='20%'>单量:"+zlPrescriptionTemp.drugQuan+"</td>";
- html += "<td width='20%'>频率:"+zlPrescriptionTemp.frequency+"</td>";
- html += "<td width='20%'>天数:"+zlPrescriptionTemp.orderDays+"天</td>";
- 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.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.ageString);
- $("#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++;
- }
- }
- //住院证打印
- var mzZyReq = res.data.mzZyReq;
- if (mzZyReq != null) {
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.ageString);
- $("#sfzZyReq").text(mzPatientMi.socialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- $("#icsTextZyReq").text(mzZyReq.icdText);
- } else {
- $("#icsCodeZyReq").text(mzZyReq.icdCode);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- }
- $("#reqDeptZyReq").text(mzZyReq.reqWardName);
- $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptName);
- $("#doctorCodeZyReq").text(mzZyReq.doctorName);
- if (index > 0) {
- LODOP.NewPageA();
- }
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- index++;
- }
- $("#selfAmountGuideCard").html(0.00);
- $("#fundPayGuideCard").html(0.00);
- $("#acctPayGuideCard").html(0.00);
- $("#payQrcodeGuideCard").empty();
- $("#selfPayDetail").empty();
- $.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) {
- var selfPayList = res.selfPayList;
- if (selfPayList != null && selfPayList.length > 0) {
- $("#patientNameSelfPay").text(mzPatientMi.name);
- $("#patientGenderSelfPay").text(mzPatientMi.gender);
- $("#patientAgeSelfPay").text(mzPatientMi.ageString);
- $("#patientIdSelfPay").text(mzPatientMi.patientId);
- $("#deptSelfPay").text(deptName);
- $("#zdSelfPay").text(res.icdText);
- var selfPayListHtml = "";
- for (var i = 1; i <= selfPayList.length; i++) {
- selfPayListHtml += "<tr><td>";
- selfPayListHtml += i + "." + selfPayList[i - 1];
- selfPayListHtml += "</td></tr>";
- }
- $("#selfPayDetail").html(selfPayListHtml);
- if (index > 0) {
- LODOP.NewPageA();
- }
- //view-source:http://www.c-lodop.com/demolist/PrintSample43.html 分页看这里
- LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
- index++;
- }
- 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, 1).toFixed(1) + "</td><td>" + res.data[i].execDeptName + "</td><td>" + res.data[i].execDeptAddress + "</td></tr>"
- }
- $("#guideCardDetail").html(html);
- }
- if (res.payQrcode != null && res.payQrcode != "") {
- 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>");
- }
- if (res.fundPay != undefined && res.fundPay != null) {
- $("#fundPayGuideCard").text("¥" + res.fundPay);
- }
- if (res.acctPay != undefined && res.acctPay != null) {
- $("#acctPayGuideCard").text("¥" + res.acctPay);
- }
- $("#selfAmountGuideCard").text("¥" + res.selfAmount);
- $("#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;
- }
- }
- if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- if (tz == null) {
- tz = mzBlRecord.emrPe;
- } else {
- tz += "," + mzBlRecord.emrPe;
- }
- }
- 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.ageString);
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.icdText);
- $("#patientIdJyReq").text(mzPatientMi.patientId);
- $("#patientNameJyReq").text(mzPatientMi.name);
- $("#patientGenderJyReq").text(mzPatientMi.gender);
- $("#patientAgeJyReq").text(mzPatientMi.ageString);
- $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
- $("#icdTextJyReq").text(res.data.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.ageString);
- 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 != "") {
- $("#emrPeBlrecord").text(tz);
- $("#emrPeBlrecord").parent().css("display", "block");
- } else {
- $("#emrPeBlrecord").parent().css("display", "none");
- }
- // if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- // $("#emrPeBlrecord").text(mzBlRecord.emrPe);
- // $("#emrPeBlrecord").parent().css("display", "block");
- // } else {
- // $("#emrPeBlrecord").parent().css("display", "none");
- // }
- if (res.icdText != null && res.icdText != "") {
- $("#icdTextBlrecord").text(res.icdText);
- $("#icdTextBlrecord").parent().css("display", "block");
- } else {
- $("#icdTextBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
- $("#emrProcessBlrecord").parent().css("display", "block");
- } else {
- $("#emrProcessBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
- $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
- $("#emrJkjyBlrecord").parent().css("display", "block");
- } else {
- $("#emrJkjyBlrecord").parent().css("display", "none");
- }
- $("#visitDeptBlrecord").text(res.deptName);
- $("#visitDoctorBlrecord").text(res.doctorName);
- $("#visitDateBlrecord").text(res.visitDate);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印入院通知单
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printZyReq(patientId, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printZyReq?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院入院通知单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var mzZyReq = res.mzZyReq;
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.ageString);
- $("#sfzZyReq").text(mzPatientMi.socialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- $("#icsTextZyReq").text(mzZyReq.icdText);
- } else {
- $("#icsCodeZyReq").text(mzZyReq.icdCode);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- }
- $("#reqDeptZyReq").text(mzZyReq.reqWardName);
- $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptName);
- $("#doctorCodeZyReq").text(mzZyReq.doctorName);
- 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.ageString);
- 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.ageString);
- 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.doc_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) {
- var mzPatientMi = res.mzPatientMi;
- $("#editPatientId").text(mzPatientMi.patientId);
- $("#editPatientName").text(mzPatientMi.name);
- $("#editPatientGender").text(mzPatientMi.gender);
- $("#editPatientAge").text(mzPatientMi.ageString);
- var mzBlRecord = res.mzBlRecord;
- $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint == null ? "" : mzBlRecord.emrChiefComplaint);
- $("#editEmrHpi").val(mzBlRecord.emrHpi == null ? "" : mzBlRecord.emrHpi);
- $("#editEmrPs").val(mzBlRecord.emrPs == null ? "" : mzBlRecord.emrPs);
- $("#editPersonalHistory").val(mzBlRecord.personalHistory == null ? "" : mzBlRecord.personalHistory);
- $("#editFamilyHistory").val(mzBlRecord.familyHistory == null ? "" : mzBlRecord.familyHistory);
- $("#editObstericalHistory").val(mzBlRecord.obstericalHistory == null ? "" : mzBlRecord.obstericalHistory);
- $("#editQtjc").val(mzBlRecord.emrPe == null ? "" : mzBlRecord.emrPe);
- setSelectedAttr("editZd", mzBlRecord.icdCode, mzBlRecord.icdText);
- var tentativeDiagnosis=mzBlRecord.tentativeDiagnosis == null ? "" : mzBlRecord.tentativeDiagnosis;
- if((mzBlRecord.icdCode==null || mzBlRecord.icdCode=="") && mzBlRecord.icdText!=null && mzBlRecord.icdText!=""){
- if(tentativeDiagnosis==null || tentativeDiagnosis==""){
- tentativeDiagnosis=mzBlRecord.icdText;
- }else {
- tentativeDiagnosis=mzBlRecord.icdText+" "+tentativeDiagnosis;
- }
- }
- $("#edittentativeDiagnosis").val(tentativeDiagnosis);
- $("#editEmrJkjy").val(mzBlRecord.emrJkjy == null ? "" : mzBlRecord.emrJkjy);
- $("#bl_weight").val(mzBlRecord.weight == 0 ? null : mzBlRecord.weight);
- $("#bl_temperature").val(mzBlRecord.temperature == 0 ? null : mzBlRecord.temperature);
- $("#bl_sphygmus").val(mzBlRecord.sphygmus == 0 ? null : mzBlRecord.sphygmus);
- $("#bl_breathe").val(mzBlRecord.breathe == 0 ? null : mzBlRecord.breathe);
- $("#bl_pressure_high").val(mzBlRecord.pressureHigh == 0 ? null : mzBlRecord.pressureHigh);
- $("#bl_pressure_floor").val(mzBlRecord.pressureFloor == 0 ? null : mzBlRecord.pressureFloor);
- $("#bl_pressure_high_left").val(mzBlRecord.pressureHighLeft == 0 ? null : mzBlRecord.pressureHighLeft);
- $("#bl_pressure_floor_left").val(mzBlRecord.pressureFloorLeft == 0 ? null : mzBlRecord.pressureFloorLeft);
- 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);
- } else {
- $("#editEmrProcess").val("");
- }
- if (type == 1) {
- $("#mzBlRecorTitle").html("门诊病历【编辑】");
- $("#setOtherEmrProcess").removeClass("in").addClass("hide");
- $("#openBlRecordModel").removeClass("hide").addClass("in");
- $("#setEmrProcess").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");
- //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
- 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);
- $("#bl_weight").val(null);
- $("#bl_sphygmus").val(null);
- $("#bl_breathe").val(null);
- $("#bl_pressure_high").val(null);
- $("#bl_pressure_floor").val(null);
- $("#bl_pressure_high_left").val(null);
- $("#bl_pressure_floor_left").val(null);
- $("#editQtjc").val(null);
- $("#editZd").selectpicker('val', null);
- $("#editZd").selectpicker('refresh');
- $("#edittentativeDiagnosis").val(null);
- $("#editEmrProcess").val(null);
- $("#editEmrJkjy").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) {
- $("#messageModal").modal("hide");
- sendEmrProcess();
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editMzBlRecordModal").modal();
- });
- }
- /**
- * 提交保存门诊病历
- */
- function sendEmrProcess() {
- //修改告警人员
- var icdCodes = $("#editZd").val();
- var icdCodeStr = null;
- if (icdCodes != null && icdCodes.length > 0) {
- for (var i = 0; i < icdCodes.length; i++) {
- if (icdCodeStr == null) {
- icdCodeStr = icdCodes[i];
- } else {
- icdCodeStr += "," + icdCodes[i];
- }
- }
- }
- $.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(),
- "emrPe": $("#editQtjc").val(),
- "weight": $("#bl_weight").val(),
- "temperature": $("#bl_temperature").val(),
- "sphygmus": $("#bl_sphygmus").val(),
- "breathe": $("#bl_breathe").val(),
- "pressureHigh": $("#bl_pressure_high").val(),
- "pressureFloor": $("#bl_pressure_floor").val(),
- "pressureHighLeft": $("#bl_pressure_high_left").val(),
- "pressureFloorLeft": $("#bl_pressure_floor_left").val(),
- "icdCode": icdCodeStr,
- "icdText": $('#editZd').next().attr("title"),
- "tentativeDiagnosis": $("#edittentativeDiagnosis").val(),
- "emrJkjy": $("#editEmrJkjy").val(),
- "emrProcess": $("#editEmrProcess").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')
- }
- /**
- * 西药品类按钮点击事件 因为原插件有点未解决bug,点击title的时候,加载的列表非对应的,
- * @param paneId
- */
- function xyTableOnClick(paneId) {
- setTimeout(function () {
- $("#xyTabContent div.tab-pane").each(function (index, obj) {
- var targetId = $(obj).attr("id");
- //如果处方内容是空的,就删除没有处方
- if ($(obj).find("div.cf_content").children().length == 0) {
- $(obj).remove();
- $("[href='#" + targetId + "']").parent().remove();
- } else if (targetId == paneId) {
- $(obj).addClass("active").addClass("in");
- } else {
- $(obj).removeClass("active").removeClass("in");
- }
- });
- }, 400);
- }
- /**
- * 打开转诊弹层
- */
- function transferTreatment() {
- $("#turnDept").selectpicker({
- size: 5
- });
- $("#turnToConsultationTitle").html("转诊");
- $("#opType").val(1);
- $("#turnToConsultationDoctorDiv").removeClass("hide").addClass("in");
- $("#turnDeptDiv").removeClass("hide").addClass("in");
- $("#consultationDeptDiv").removeClass("in").addClass("hide");
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByRequestDay?ampm=',
- 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>';
- });
- $('#turnDept').empty();
- $('#turnDept').html(html);
- $('#turnDept').selectpicker('refresh');
- }
- });
- $("#turnToConsultationModal").modal();
- }
- /**
- * 打开会诊弹层
- */
- function consultation() {
- $("#consultationDept").selectpicker({
- size: 5
- });
- $("#turnToConsultationTitle").html("发起会诊");
- $("#opType").val(2);
- $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
- $("#consultationDeptDiv").removeClass("hide").addClass("in");
- $("#turnDeptDiv").removeClass("in").addClass("hide");
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allMzUnitCode',
- 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>';
- });
- $('#consultationDept').empty();
- $('#consultationDept').html(html);
- $('#consultationDept').selectpicker('refresh');
- $.ajax({
- type: "GET",
- url: '/thmz/getUnConsultation?serialNo=' + $("#mzfzSerialNoInClick").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 data = res.data;
- if (data != null && data.length > 0) {
- $('#consultationDept').selectpicker('val', data);
- $('#consultationDept').selectpicker('refresh');
- }
- }
- });
- }
- });
- $("#turnToConsultationModal").modal();
- }
- /**
- * 清空转诊和发起会诊区域
- */
- function clearTurnToConsultationInput() {
- $("#turnDept").selectpicker('val', null);
- $("#turnDept").selectpicker('refresh');
- $("#consultationDept").selectpicker('val', null);
- $("#consultationDept").selectpicker('refresh');
- $("#turnToConsultationDoctor").selectpicker('val', null);
- $("#turnToConsultationDoctor").selectpicker('refresh');
- $("#turnToConsultationId").val(null);
- $("#opType").val(null);
- $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
- $("#turnDeptDiv").removeClass("in").addClass("hide");
- $("#consultationDeptDiv").removeClass("in").addClass("hide");
- }
- /**
- * 清空门诊统筹支付参数区域
- */
- function clearZgtczfInput() {
- $("#zgmztczfDiv").removeClass("in").addClass("hide");
- $("#mztczfSiReadCard").removeClass("in").addClass("hide");
- $("#grzhzfDiv").removeClass("in").addClass("hide");
- $("#zgmztczf").selectpicker('val', null);
- $("#zgmztczf").selectpicker('refresh');
- $("#grzhzf").selectpicker('val', null);
- $("#grzhzf").selectpicker('refresh');
- $("#readCardResult").val(null);
- }
- /**
- * 保存转诊/会诊
- */
- function setTurnToConsultation() {
- $("#turnToConsultationModal").modal("hide");
- $("#messageModal").modal();
- var opType = $("#opType").val();
- var targetDeptNo = $("#turnDept").val();
- var title = "确认提交转诊操作吗,提交后您将无法继续接诊该患者?";
- if (opType == 2 || opType == "2") {
- title = "确认提交本次会诊操作吗?";
- var consultationDept = $("#consultationDept").val();
- if (consultationDept != null && consultationDept.length > 0) {
- targetDeptNo = null;
- for (var i = 0; i < consultationDept.length; i++) {
- if (targetDeptNo == null) {
- targetDeptNo = consultationDept[i];
- } else {
- targetDeptNo += "," + consultationDept[i];
- }
- }
- }
- }
- $("#messageContent").html(title);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/saveTurnToConsultation',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#turnToConsultationId").val(),
- "opType": opType,
- "targetDeptNo": targetDeptNo,
- "targetDoctorNo": $("#turnToConsultationDoctor").val(),
- "serialNo": $("#mzfzSerialNoInClick").val(),
- "remark": $("#turnToConsultationRemark").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);
- clearTurnToConsultationInput();
- if (opType == 1 || opType == "1") {
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- clearWorkSpace();
- }
- } else {
- $("#turnToConsultationModal").modal();
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 初始医生下拉选
- * @param ampm 时间段区间
- */
- function initEmployee() {
- var opType = $("#opType").val();
- if (opType == 2) {
- return;
- }
- $("#turnToConsultationDoctor").selectpicker({
- size: 5
- });
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#turnDept').val() + "&m=&chargeType=",
- 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 = '';
- var defaultCode = null;
- $.each(res.data, function (commentIndex, comment) {
- var employeeName = comment.employee.employeeName;
- if (comment.leftNum != null) {
- employeeName = employeeName + " 余号(" + comment.leftNum + ")"
- }
- html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + employeeName + '</option>';
- if (res.data.length == 1) {
- //如果只有一个号别,默认选中
- defaultCode = comment.employee.employeeCode;
- }
- });
- $('#turnToConsultationDoctor').empty();
- $('#turnToConsultationDoctor').html(html);
- $('#turnToConsultationDoctor').selectpicker('refresh');
- if (defaultCode != null) {
- //如果有无需选择医生的选项,默认选择
- $('#turnToConsultationDoctor').selectpicker('val', defaultCode);
- $('#turnToConsultationDoctor').selectpicker('refresh');
- }
- }
- });
- }
- /**
- * 选择门诊统筹支付时校验门诊诊断是否是标准诊断,校验医生是否具有医保编码
- */
- function verifyInsuranceInfo() {
- var zgmztczf = $("#zgmztczf").val();
- if (zgmztczf != null && (zgmztczf == 1 || zgmztczf == "1")) {
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
- errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- diagnoseValue = diagnoseValue.replace(/,/g, "");
- if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
- errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- var ybCode = localStorage.getItem("ybCode");
- if (ybCode == null || ybCode == "" || ybCode.length == 0) {
- errorMesageSimaple("您还没有医保赋码,无法进行门诊统筹接诊,请取消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- }
- return true;
- }
- /**
- * 已诊列表发起会诊
- * @param patientId
- */
- function consultationCliniced(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getLastClinicedFzOrder?patientId=' + patientId,
- 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");
- $("#mzfzSerialNoInClick").val(res.data.serialNo);
- consultation();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 计算诊疗金额
- * @param flag true ,直接计算总价, false 还要计算总量
- */
- function calculateZl(flag) {
- if (!flag) {
- var itemQuantity = $("#itemQuantity").val();
- if (itemQuantity == null) {
- return;
- }
- var dayZlNum = $("#dayZlNum").val();
- if (dayZlNum == null) {
- return;
- }
- //频率
- var times = $('#orderFrequencyZl').find("option:selected").attr('desc');
- if (times == null) {
- return;
- }
- var totalNumZl = Multiply(Multiply(itemQuantity, dayZlNum), times);
- $("#totalNumZl").val(totalNumZl);
- }
- //总量
- var totalNumZl = $("#totalNumZl").val();
- if (totalNumZl == null) {
- return;
- }
- //单价
- var zlItemPrice = $("#zlItemPrice").val();
- if (zlItemPrice == null) {
- return;
- }
- $("#totalAmountZl").val(Multiply(totalNumZl, zlItemPrice).toFixed(2));
- }
- /**
- *打印外伤无第三方责任承诺书
- */
- function printNoThirdParty() {
- printNoThirdPartyCommon(1);
- }
- /**
- * 打印外伤无第三方责任承诺书
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printNoThirdPartyCommon(printType) {
- warningMesageSimaple("请提醒患者至医保窗口审核,审核通过方能报销!");
- var title = "外伤无第三方责任承诺书";
- 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);//对新建的纸张重命名
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- // var strStyle = "<style>table{width: 96%;}</style>";
- var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>";
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("print_no_third_party_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- /**
- * 打印自费承诺书
- */
- function printSelfPay() {
- printSelfPayCommon(1);
- }
- /**
- * 打印自费承诺书
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printSelfPayCommon(printType) {
- var title = "参保人员门诊统筹医保支付告知审核表";
- 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);//对新建的纸张重命名
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- // var strStyle = "<style>table{width: 96%;}</style>";
- //table,th {border-width: 1px;border-style: solid;border-collapse: collapse}
- var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} </style>";
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
|