clinic.js 723 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689
  1. //@ sourceURL=clinic.js
  2. //判断病人列表是否在加载中,防止重复加载
  3. var msg_list_loading = false;
  4. //挂号卡片列表页面下标
  5. var pageIndex = 0;
  6. //药品使用方法,天数和频次的集合
  7. var groupIdMap = null;
  8. var LODOP; //声明为全局变量
  9. //默认打印机下标
  10. var printIndex = -1;
  11. // //上一個光标点击的元素ID
  12. var prevEleId = null;
  13. //打开检查检验报告的时候不知道哪个有报告,如果检查没有就自动打开检验,但是为了防止死循环,次数加到1就不在进行重试
  14. var retryCount = 0;
  15. //是否在读卡中
  16. var mztczfSiReadCardStatus = false;
  17. //药品组号与处方号关系
  18. var gropuIdAndOrderNoMap = null;
  19. //上一个药品大类
  20. //var prevCategoriesFlag = null;
  21. //处方回调和修改的时候处方号与处方tab的关系
  22. var orderNoAndTableIdMap = null;
  23. //处方回调和修改的时候处方tab与处方号的关系
  24. var tableIdAndOrderNoMap = null;
  25. //合理用药查询审核结果url
  26. var getResultUrl = null;
  27. //定时器
  28. var timer;
  29. var ksjzType = null;
  30. var hospitalName='沭阳铭和医院'
  31. var wpyHide = 0;
  32. //药房信息
  33. var groupNoList = []
  34. var currentPatientId = '';
  35. //就诊病人信息
  36. var currentPatientInfo = {} ;
  37. //就诊病人列表
  38. var patientList = [];
  39. //就诊病人过敏源
  40. var allergens = [];
  41. //影像平台YX02是否第一次调用
  42. var notFirstYX02 = false;
  43. //影像平台中患者近期有检查项目,判断是否发起第二次查询的依据
  44. var hasJcInYx = false;
  45. //记录医生一次调阅的唯一标识
  46. var viewRecordId = null;
  47. //记录检查项目列表用于判断是否调用重复验证检查接口YX03
  48. var jcItemList = null;
  49. $(function () {
  50. getAjaxRequst("/thmz/queryWpyOrderHide",{},true,function (res) {
  51. wpyHide = res.data
  52. if(res.data === 1){
  53. $('#wp_order_button').removeClass('in').addClass('hide');
  54. $('#healthEducationDiv').removeClass('in').addClass('hide');
  55. $('#ypHealthEducationDiv').removeClass('in').addClass('hide');
  56. }
  57. })
  58. getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
  59. hospitalName = res.data
  60. $('.hospitalName').text(hospitalName)
  61. })
  62. initCopy();
  63. initMzOrderTypeSelect();
  64. initGenderSelect();
  65. iniAdmissStatus();
  66. initListDeptSelect();
  67. initRelationSelect();
  68. //initTryResultSelect();
  69. initResponceTypeSelect();
  70. initTemplateTypeSelect("templateType");
  71. initTemplateKindTypeSelect('templateKindType');
  72. initZyClassTypeSelect();
  73. initInstructionSelect();
  74. initSelectWithParams();
  75. initCertificateTypeSelect();
  76. initMztcSelect();
  77. initMzssSelect();
  78. //setSelectSize();
  79. $('#editUserBirthDayGroup').datetimepicker({
  80. format: 'yyyy-mm-dd',
  81. language: 'zh-CN',
  82. minView: "month",
  83. });
  84. initDaterangepickerWithId('reportrange', "right");
  85. formatCheck();
  86. //数据校验
  87. init_validator();
  88. //初始频次下拉选
  89. initOrderFrequencys("orderFrequency", true);
  90. //初始频次下拉选
  91. initOrderFrequencys("orderFrequencyZl", true);
  92. //初始用药方式下拉选
  93. initSupplyTypes();
  94. //初始化外配药品用法
  95. initZdRxAll('rx_used_way','medcWayCodg');
  96. //初始化外配药品频次
  97. initZdRxAll('rx_used_frqu','usedFrquCodg');
  98. //初始外配药化剂型
  99. initDrugDosform();
  100. initAdvmPro('visitAdvmPro');
  101. //加载候诊患者列表
  102. loadUnClinicTableList();
  103. //加载接诊中患者列表
  104. loadInClinicTableList();
  105. //加载已接诊患者列表
  106. loadClinicTableList();
  107. //每隔一分钟秒读加载候诊患者列表
  108. refreshList();
  109. // setInterval(function () {
  110. // //加载候诊患者列表
  111. // loadUnClinicTableList();
  112. // //加载已接诊患者列表 病人会缴费,需要刷新状态
  113. // loadClinicTableList();
  114. // }, 60000);
  115. //初始化快速接诊病人姓名栏事件
  116. initUserList();
  117. //初始化主诉弹出层
  118. initRecommendList();
  119. //卡号输入改变事件
  120. cardNoChange();
  121. //初始化省份
  122. initProvince(3);
  123. //初始化省份
  124. initProvince(5);
  125. /**
  126. * 患者信息修改
  127. */
  128. $("#saveEditUser").on("click", function (t) {
  129. modifyPatient();
  130. });
  131. // /**
  132. // * 保存入院证
  133. // */
  134. // $("#saveBeHospitalized").on("click", function (t) {
  135. // saveBeHospitalized();
  136. // });
  137. /**
  138. * 打印入院证
  139. */
  140. $("#printBeHospitalized").on("click", function (t) {
  141. modifyPatient();
  142. });
  143. //折叠按钮初始化
  144. $('.collapse-link').on('click', function () {
  145. var $BOX_PANEL = $(this).closest('.x_panel_mine'),
  146. $ICON = $(this).find('i'),
  147. $BOX_CONTENT = $BOX_PANEL.find('.x_content');
  148. // fix for some div with hardcoded fix class
  149. if ($BOX_PANEL.attr('style')) {
  150. $BOX_CONTENT.slideToggle(200, function () {
  151. $BOX_PANEL.removeAttr('style');
  152. });
  153. } else {
  154. $BOX_CONTENT.slideToggle(200);
  155. $BOX_PANEL.css('height', 'auto');
  156. }
  157. $ICON.toggleClass('fa-chevron-up fa-chevron-down');
  158. });
  159. /**
  160. * 接诊
  161. */
  162. $("#clinicalReception").on("click", function (t) {
  163. var patientIdDb = $("#patientIdDb").val();
  164. if (patientIdDb == null || patientIdDb == "") {
  165. errorMesageSimaple("当前未选择病人,无法接诊");
  166. return;
  167. }
  168. $.ajax({
  169. type: "GET",
  170. url: '/thmz/getMzfzPatientOrderByPatientId?patientId=' + patientIdDb,
  171. contentType: "application/json;charset=UTF-8",
  172. dataType: "json",
  173. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  174. success: function (res) {
  175. if (res == '401' || res == 401) {
  176. window.location.href = '/thmz/login/view'
  177. return;
  178. }
  179. if (res.code == 0) {
  180. if (res.data != null && res.data.length > 0) {
  181. if (res.data.length == 1) {
  182. $("#turnToConsultationIdInClick").val(res.data[0].turnToConsultationId);
  183. clinicalReception(patientIdDb, res.data[0].serialNo, res.data[0].reqType);
  184. } else {
  185. $("#mzfzPatientOrderModal").modal();
  186. $("#mzfzPatientOrderTable").html(null);
  187. for (var i = 0; i < res.data.length; i++) {
  188. var roomCode = res.data[i].roomCode;
  189. if (roomCode == null || roomCode == "null") {
  190. roomCode = "";
  191. }
  192. var doctorCode = (res.data[i].doctorCode == null || res.data[i].doctorCode == 'null') ? '' : res.data[i].doctorCode;
  193. $("<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 () {
  194. $("#mzfzPatientOrderModal").modal("hide");
  195. $("#turnToConsultationIdInClick").val($(this).attr("data-target-turnToConsultationId"));
  196. clinicalReception(patientIdDb, $(this).attr("data-target"), $(this).attr("data-target-reqType"));
  197. });
  198. }
  199. }
  200. clearRapidAcceptsModal();
  201. $("#rapidAcceptsModal").modal("hide");
  202. } else {
  203. errorMesageSimaple("当前病人没有分诊信息");
  204. }
  205. } else if (res.code == 200) {
  206. clearRapidAcceptsModal();
  207. $("#rapidAcceptsModal").modal("hide");
  208. clinicalReception(patientIdDb, null, null);
  209. } else {
  210. errorMesage(res);
  211. }
  212. }
  213. });
  214. });
  215. /**
  216. * 存为范本
  217. */
  218. $("#saveapidAccepts").on("click", function (t) {
  219. //关闭帮助框
  220. $("#treeButton").webuiPopover('hide');
  221. $("#western_medicine_name").webuiPopover('hide');
  222. $("#chinese_medicine_name").webuiPopover('hide');
  223. $("#jcJyItem").webuiPopover('hide');
  224. $("#zlItem").webuiPopover('hide');
  225. $("#saveapidAcceptsModal").modal("show");
  226. });
  227. /**
  228. * 实例化智能问诊弹窗
  229. */
  230. // $("[data-toggle='popover']").popover();
  231. $("#box-arrow-left").popover({
  232. html: 'true',
  233. content: '<div id="smartAssistPopoverContent"></div>'
  234. });
  235. //初始化药品分组下拉选
  236. initGroupOrder();
  237. // 初始化用药天数下拉选
  238. initDayNum();
  239. //页面加载完成初始化西药处方
  240. //initNavTabs(0);
  241. //页面加载完成初始化住院处方
  242. //initNavTabs(3);
  243. //初始医生工作太配置
  244. initWorkspaceConfigForCurrent();
  245. initExecUnit();
  246. $("#rapidAcceptsUserName").blur(function (e) {
  247. queryUserInfoByName();
  248. });
  249. $("#rapidAcceptsUserName").on('keydown', function (event) {
  250. if (event.key === "Enter") {
  251. event.preventDefault(); // 阻止默认行为(如表单提交)
  252. queryUserInfoByName();
  253. }
  254. });
  255. /**
  256. * 西药点击事件
  257. */
  258. $("#western_medicine_name").on("click", function (t) {
  259. var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
  260. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  261. $('#western_medicine_name').webuiPopover('hide');
  262. $("#treeButton").webuiPopover('hide');
  263. return;
  264. }
  265. $('#western_medicine_name').webuiPopover('show');
  266. loadYpList(0, null);
  267. });
  268. /**
  269. * 中药点击事件
  270. */
  271. $("#chinese_medicine_name").on("click", function (t) {
  272. var obj = $("#chineseMedicinePopoverContent").parent().parent().parent();
  273. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  274. $('#chinese_medicine_name').webuiPopover('hide');
  275. $("#treeButton").webuiPopover('hide');
  276. return;
  277. }
  278. $('#chinese_medicine_name').webuiPopover('show');
  279. loadYpList(1, null);
  280. });
  281. /**
  282. * 辅助检查、检验点击事件
  283. */
  284. $("#jcJyItem").on("click", function (t) {
  285. var obj = $("#jcJyItemPopoverContent").parent().parent().parent();
  286. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  287. $('#jcJyItem').webuiPopover('hide');
  288. $("#treeButton").webuiPopover('hide');
  289. return;
  290. }
  291. $('#jcJyItem').webuiPopover('show');
  292. loadjcJyItemList(null);
  293. });
  294. /**
  295. * 诊疗点击事件
  296. */
  297. $("#zlItem").on("click", function (t) {
  298. var obj = $("#zlItemPopoverContent").parent().parent().parent();
  299. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  300. $('#zlItem').webuiPopover('hide');
  301. $("#treeButton").webuiPopover('hide');
  302. return;
  303. }
  304. $('#zlItem').webuiPopover('show');
  305. loadZlItemList(null);
  306. });
  307. //外配药点击事件
  308. $("#wp_medicine_name").on("click", function (t) {
  309. var obj = $("#wpMedicinePopoverContent").parent().parent().parent();
  310. if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
  311. $('#wp_medicine_name').webuiPopover('hide');
  312. $("#treeButton").webuiPopover('hide');
  313. return;
  314. }
  315. $('#wp_medicine_name').webuiPopover('show');
  316. loadWpMedicineList(null);
  317. });
  318. initYshPart();
  319. initJyZdSample();
  320. initClinicDeptNo();
  321. setTimeout(function () {
  322. getLodop();
  323. }, 800);
  324. //键盘监听回车键
  325. $(document).unbind("keyup").keyup(function (event) {
  326. var index = getIndex("bill_item_group");
  327. if (event.keyCode == 13) { //是否是回车
  328. var el = event.srcElement || event.target;
  329. var id = el.getAttribute("id");
  330. var current_code = null;
  331. if (index == 0) {
  332. current_code = $("#western_medicine_current_code").val();
  333. } else if (index == 1) {
  334. current_code = $("#chinese_medicine_current_code").val();
  335. } else if (index == 2) {
  336. current_code = $("#jcjy_current_code").val();
  337. } else if (index == 3) {
  338. current_code = $("#zl_current_code").val();
  339. }else if (index == 6) {
  340. current_code = $("#wp_medicine_current_code").val();
  341. }
  342. if (id == null || id == "") {
  343. id = el.getAttribute("data-id");
  344. }
  345. if (id == null || id == "") {
  346. var search = el.getAttribute("aria-label");
  347. if (search == "Search") {
  348. id = $(el).parent().parent().prev().attr("data-id");
  349. }
  350. }
  351. if (id != null && id != "") {
  352. //将当前点击的id记录下
  353. //prevEleId = id;
  354. } else if (prevEleId != null) {
  355. id = prevEleId;
  356. }
  357. //回车时,光标不在任何区域判断是不是在药品和诊疗开立区域
  358. if (id == null || id == "") {
  359. var index = getIndex("bill_item_group");
  360. if (index == 0) {
  361. if (current_code != null && current_code != "") {
  362. //当前页面是西药保存页面,且有药品选中
  363. $("#supplyType").next().click();
  364. }
  365. } else if (index == 1) {
  366. //当前页面是中草药保存页面,且有药品选中
  367. } else if (index == 2) {
  368. if (current_code != null && current_code != "") {
  369. //当前页面是医技保存页面,且有选中
  370. if ($("#jyZdSampleDiv").hasClass('in')) {
  371. //此时是检验
  372. $("#jyZdSample").next().click();
  373. } else if ($("#yshPartDiv").hasClass('in')) {
  374. //说明现在是检查
  375. $("#yshPart").next().click();
  376. }
  377. }
  378. } else if (index == 3) {
  379. //诊疗
  380. $("#yshPart").next().click();
  381. return;
  382. } else if (index == 4) {
  383. //当前页面是住院保存页面
  384. $("#inpatientWardBeHospitalized").next().click();
  385. return;
  386. }
  387. }
  388. var customization = $("div.customization").not(".hide");
  389. // //回车时,光标不在任何区域,默认点击主诉
  390. // if (id == null || id == "") {
  391. // var eleId = $(customization[0]).attr("target-id");
  392. // $("#" + eleId).focus();
  393. // if (eleId == 'symptom') {
  394. // $("#" + eleId).click();
  395. // }
  396. // console.log("eleId=" + eleId);
  397. // } else
  398. if (id == 'symptom' || id == 'emrHpi' || id == 'emrPs' || id == 'personalHistory' || id == 'familyHistory' || id == 'obstericalHistory' || id == 'otherCheck' || id == 'diagnose' || id == 'tentativeDiagnosis' || id == 'fzZl' || id == 'crbHistory' ) {
  399. console.log("1id=" + id);
  400. if (id != $(customization[customization.length - 1]).attr("target-id")) {
  401. var next = $("#" + id + "Flag").next();
  402. while ($(next).hasClass("foreclose") || $(next).hasClass("hide")) {
  403. next = $(next).next();
  404. }
  405. var eleId = $(next).attr("target-id");
  406. $("#" + eleId).focus();
  407. if (eleId == 'diagnose' || id == 'diagnose' || id == 'symptom') {
  408. $("#" + eleId).click();
  409. }
  410. console.log("1eleId=" + eleId);
  411. } else {
  412. var data_target = $("#symptom").attr("data-target");
  413. $("#" + data_target).find("a.close").click();
  414. data_target = $("#diagnose").attr("data-target");
  415. $("#" + data_target).find("a.close").click();
  416. if (index == 0) {
  417. $("#western_medicine_name").focus();
  418. } else if (index == 1) {
  419. $("#chinese_medicine_name").focus();
  420. } else if (index == 2) {
  421. $("#jcJyItem").focus();
  422. } else if (index == 3) {
  423. $("#zlItem").focus();
  424. } else if (index == 4) {
  425. $("#inpatientWardBeHospitalized").next().click();
  426. } else if (index == 5) {
  427. $("#opName").next().click();
  428. }else if (index == 6) {
  429. $("#wp_medicine_name").focus();
  430. }
  431. }
  432. } else if (id == 'zy_drugWin') {
  433. $("#zyInstruction").next().click();
  434. } else if (id == 'zyInstruction') {
  435. var ariaExpanded = $("#zyInstruction").next().attr("aria-expanded");
  436. if (ariaExpanded == true || ariaExpanded == "true") {
  437. $("#zyInstruction").next().click();
  438. }
  439. $("#saveChineseMedicine").click();
  440. $("#chinese_medicine_name").focus();
  441. $("#chinese_medicine_name").click();
  442. } else if (id == 'cyJssm') {
  443. $("#cyJsl").focus();
  444. } else if (id == 'cyJsl') {
  445. $("#cyZql").focus();
  446. } else if (id == 'cyZql') {
  447. $("#cyFj").focus();
  448. } else if (id == 'cyFj') {
  449. $("#cyFfcs").focus();
  450. } else if (id == 'cyFj') {
  451. $("#cyFfcs").focus();
  452. } else if (id == 'cyFfcs') {
  453. $("#useType_1").next().click();
  454. } else if (id == 'useType_1') {
  455. $("#cyMtjs").focus();
  456. } else if (id == 'cyMtjs') {
  457. $("#zyfs").focus();
  458. } else if (id == 'zyfs') {
  459. $("#zy_supplyType_1").next().click();
  460. } else if (id == 'supplyType') {
  461. $("#drugWinUnit").next().click();
  462. } else if (id == 'drugWinUnit') {
  463. $("#drugWin").focus();
  464. } else if (id == 'drugWin') {
  465. $("#dayNum").next().click();
  466. } else if (id == 'dayNum') {
  467. $("#orderFrequency").next().click();
  468. } else if (id == 'orderFrequency') {
  469. $("#gross").focus();
  470. } else if (id == 'gross') {
  471. $("#packUnit").next().click();
  472. } else if (id == 'packUnit') {
  473. $("#medicalAdvice").next().click();
  474. } else if (id == 'medicalAdvice') {
  475. var ariaExpanded = $("#medicalAdvice").next().attr("aria-expanded");
  476. if (ariaExpanded == true || ariaExpanded == "true") {
  477. $("#medicalAdvice").next().click();
  478. }
  479. saveMedicine(0);
  480. $("#western_medicine_name").focus();
  481. } else if (id == 'saveWesternMedicine') {
  482. $("#western_medicine_name").focus();
  483. $("#western_medicine_name").click();
  484. } else if (id == 'yshPart' || id == 'jyQuantity') {
  485. $("#execUnit").next().click();
  486. } else if (id == 'jyZdSample') {
  487. $("#jyQuantity").focus();
  488. } else if (id == 'execUnit') {
  489. var ariaExpanded = $("#execUnit").next().attr("aria-expanded");
  490. if (ariaExpanded == true || ariaExpanded == "true") {
  491. $("#execUnit").next().click();
  492. }
  493. $("#remark").focus();
  494. } else if (id == 'remark') {
  495. saveJyJcItem(true);
  496. $("#jcJyItem").focus();
  497. } else if (id == 'chargeUnit') {
  498. $("#itemQuantity").focus();
  499. } else if (id == 'itemQuantity') {
  500. $("#dayZlNum").next().click();
  501. } else if (id == 'dayZlNum') {
  502. var ariaExpanded = $("#dayZlNum").next().attr("aria-expanded");
  503. if (ariaExpanded == true || ariaExpanded == "true") {
  504. $("#dayZlNum").next().click();
  505. }
  506. $("#orderFrequencyZl").next().click();
  507. } else if (id == 'orderFrequencyZl') {
  508. var ariaExpanded = $("#orderFrequencyZl").next().attr("aria-expanded");
  509. if (ariaExpanded == true || ariaExpanded == "true") {
  510. $("#orderFrequencyZl").next().click();
  511. }
  512. $("#totalNumZl").focus();
  513. } else if (id == 'totalNumZl') {
  514. $("#zlExecUnit").next().click();
  515. } else if (id == 'zlExecUnit') {
  516. var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
  517. if (ariaExpanded == true || ariaExpanded == "true") {
  518. $("#zlExecUnit").next().click();
  519. }
  520. $("#zlRemark").focus();
  521. } else if (id == 'zlRemark') {
  522. saveZlItem(true);
  523. $("#zlItem").focus();
  524. } else if (id == 'inpatientWardBeHospitalized') {
  525. $("#smallWardBeHospitalized").next().click();
  526. } else if (id == 'smallWardBeHospitalized') {
  527. $("#conditionCode").next().click();
  528. } else if (id == 'conditionCode') {
  529. $("#routeOfAdmission").next().click();
  530. } else if (id == 'routeOfAdmission') {
  531. $("#admissStatus").next().click();
  532. } else if (id == 'admissStatus') {
  533. saveZyReq(true);
  534. $("#zy_req_button").focus();
  535. } else if (id == 'western_medicine_name') {
  536. var webuiID = $("#western_medicine_name").attr("data-target");
  537. if (webuiID == null || webuiID == "null" || webuiID == "") {
  538. //药品查询框是空白的,打开查询框
  539. $("#western_medicine_name").click();
  540. return;
  541. }
  542. //选择框打开
  543. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  544. var arr = $("#tb_table_western_medicine").find("tbody").find("tr.trhover");
  545. if (arr != undefined && arr != null && arr.length > 0) {
  546. var dataIndex = $(arr).attr("data-index");
  547. var tableData = $("#tb_table_western_medicine").bootstrapTable('getData');
  548. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  549. var trData = tableData[dataIndex];
  550. checkYpInfo(trData.code, trData.serial, trData.ypType, true, null, 3);
  551. $("#western_medicine_name").click();
  552. }
  553. } else {
  554. //药品查询框是空白的,打开查询框
  555. $("#western_medicine_name").click();
  556. }
  557. } else {
  558. if (current_code != null && current_code != "") {
  559. //已经选中药品,跳到用法
  560. $("#supplyType").next().click();
  561. } else {
  562. //药品查询框是空白的,打开查询框
  563. $("#western_medicine_name").click();
  564. }
  565. }
  566. } else if (id == 'chinese_medicine_name') {
  567. var webuiID = $("#chinese_medicine_name").attr("data-target");
  568. if (webuiID == null || webuiID == "null" || webuiID == "") {
  569. $("#chinese_medicine_name").click();
  570. return;
  571. }
  572. //选择框打开
  573. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  574. var arr = $("#tb_table_chinese_medicine").find("tbody").find("tr.trhover");
  575. if (arr != undefined && arr != null && arr.length > 0) {
  576. var dataIndex = $(arr).attr("data-index");
  577. var tableData = $("#tb_table_chinese_medicine").bootstrapTable('getData');
  578. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  579. var trData = tableData[dataIndex];
  580. checkZyInfo(trData.code, trData.serial, $("#zyClassType").val(), true);
  581. $("#chinese_medicine_name").click();
  582. }
  583. } else {
  584. //药品查询框是空白的,打开查询框
  585. $("#chinese_medicine_name").click();
  586. }
  587. } else {
  588. if (current_code != null && current_code != "") {
  589. //已经选中药品,跳到剂量
  590. $("#zy_drugWin").next().click();
  591. } else {
  592. //药品查询框是空白的,打开查询框
  593. $("#chinese_medicine_name").click();
  594. }
  595. }
  596. } else if (id == 'jcJyItem') {
  597. var webuiID = $("#jcJyItem").attr("data-target");
  598. if (webuiID == null || webuiID == "null" || webuiID == "") {
  599. $("#jcJyItem").click();
  600. return;
  601. }
  602. //选择框打开
  603. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  604. var arr = $("#tb_table_jc_jy_item").find("tbody").find("tr.trhover");
  605. if (arr != undefined && arr != null && arr.length > 0) {
  606. var dataIndex = $(arr).attr("data-index");
  607. var tableData = $("#tb_table_jc_jy_item").bootstrapTable('getData');
  608. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  609. var trData = tableData[dataIndex];
  610. $('#jcJyItem').webuiPopover('hide');
  611. $("#jcJyZltype").val(trData.type);
  612. $("#execUnit").selectpicker('val', trData.execUnit);//默认不选中
  613. $("#execUnit").selectpicker('refresh');
  614. if (trData.type == 1) {
  615. //检验
  616. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  617. $("#jyQuantityDiv").removeClass("hide").addClass("in");
  618. $("#chargeUnitDiv").removeClass("in").addClass("hide");
  619. $("#yshPartDiv").removeClass("in").addClass("hide");
  620. if (trData.sampleCode != null && trData.sampleCode != "") {
  621. $("#jyZdSample").selectpicker('val', trData.sampleCode);
  622. $('#jyZdSample').selectpicker('refresh');
  623. }
  624. } else if (trData.type == 2) {
  625. //检查
  626. $("#yshPartDiv").removeClass("hide").addClass("in");
  627. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  628. $("#jyQuantityDiv").removeClass("in").addClass("hide");
  629. $("#chargeUnitDiv").removeClass("in").addClass("hide");
  630. if (trData.bwCode != null && trData.bwCode != "") {
  631. $("#yshPart").selectpicker('val', trData.bwCode);
  632. $('#yshPart').selectpicker('refresh');
  633. }
  634. }
  635. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  636. checkJcJyItemInfo(trData.code, trData.name, trData.type, true);
  637. }
  638. } else {
  639. //药品查询框是空白的,打开查询框
  640. $("#jcJyItem").click();
  641. }
  642. } else {
  643. if (current_code != null && current_code != "") {
  644. //如果是保存失败的,重新打开输入框查询
  645. if (prevEleId == 'remark') {
  646. $("#jcJyItem").click();
  647. } else {
  648. //当前页面是医技保存页面,且有选中
  649. if ($("#jyZdSampleDiv").hasClass('in')) {
  650. //此时是检验
  651. $("#jyZdSample").next().click();
  652. } else if ($("#yshPartDiv").hasClass('in')) {
  653. //说明现在是检查
  654. $("#yshPart").next().click();
  655. }
  656. }
  657. } else {
  658. //药品查询框是空白的,打开查询框
  659. $("#jcJyItem").click();
  660. }
  661. }
  662. } else if (id == 'zlItem') {
  663. var webuiID = $("#zlItem").attr("data-target");
  664. if (webuiID == null || webuiID == "null" || webuiID == "") {
  665. $("#zlItem").click();
  666. return;
  667. }
  668. //选择框打开
  669. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  670. var arr = $("#tb_table_zl_item").find("tbody").find("tr.trhover");
  671. if (arr != undefined && arr != null && arr.length > 0) {
  672. var dataIndex = $(arr).attr("data-index");
  673. var tableData = $("#tb_table_zl_item").bootstrapTable('getData');
  674. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  675. var trData = tableData[dataIndex];
  676. $('#zlItem').webuiPopover('hide');
  677. $("#zlExecUnit").selectpicker('val', trData.execUnit);//默认不选中
  678. $("#zlExecUnit").selectpicker('refresh');
  679. //诊疗
  680. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  681. initNavTabs(3, null, null);
  682. }
  683. $("#zlItem").val(trData.name);
  684. $("#zlItem").blur();
  685. $("#zlItemPrice").val(trData.chargeAmount);
  686. $("#chargeUnit").val(trData.specification);
  687. $("#zl_current_code").val(trData.code);
  688. $("#itemQuantity").val(1);
  689. $("#chargeUnit").focus();
  690. }
  691. } else {
  692. //药品查询框是空白的,打开查询框
  693. $("#zlItem").click();
  694. }
  695. } else {
  696. if (current_code != null && current_code != "") {
  697. //如果是保存失败的,重新打开输入框查询
  698. if (prevEleId == 'zlRemark') {
  699. $("#zlItem").click();
  700. } else {
  701. $("#chargeUnit").focus();
  702. }
  703. } else {
  704. //药品查询框是空白的,打开查询框
  705. $("#zlItem").click();
  706. }
  707. }
  708. }else if (id == 'wp_medicine_name') {
  709. var webuiID = $("#wp_medicine_name").attr("data-target");
  710. if (webuiID == null || webuiID == "null" || webuiID == "") {
  711. $("#wp_medicine_name").click();
  712. return;
  713. }
  714. //选择框打开
  715. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  716. var arr = $("#tb_table_wp_medicine").find("tbody").find("tr.trhover");
  717. if (arr != undefined && arr != null && arr.length > 0) {
  718. var dataIndex = $(arr).attr("data-index");
  719. var tableData = $("#tb_table_wp_medicine").bootstrapTable('getData');
  720. if (tableData != null && tableData.length > 0 && dataIndex != null) {
  721. var trData = tableData[dataIndex];
  722. $('#wp_medicine_name').webuiPopover('hide');
  723. //外配药
  724. if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
  725. initNavTabs(6, null, null);
  726. }
  727. $("#wp_medicine_name").val(trData.genname);
  728. $("#wp_medicine_name").blur();
  729. $("#sinDosunt").val(trData.minPrepunt);
  730. $("#sinDoscnt").val('1');
  731. setSelectDefaultVal('usedFrquCodg','13')
  732. setSelectDefaultVal('drugDosform',trData.dosformName)
  733. $("#prdrName").val(trData.prdrName);
  734. $("#drugDosunt").val(trData.minPacunt);
  735. $("#drugSpec").val(trData.specName);
  736. $("#wp_medicine_current_code").val(trData.medListCodg);
  737. $("#sinDoscnt").focus();
  738. }
  739. } else {
  740. //药品查询框是空白的,打开查询框
  741. $("#wp_medicine_name").click();
  742. }
  743. } else {
  744. if (current_code != null && current_code != "") {
  745. //如果是保存失败的,重新打开输入框查询
  746. $("#medcWayCodg").next().click();
  747. } else {
  748. //药品查询框是空白的,打开查询框
  749. $("#wp_medicine_name").click();
  750. }
  751. }
  752. }
  753. else if (id == 'zy_req_button') {
  754. //当前页面是住院保存页面,此时光标在入院按钮上
  755. console.log("入院按钮")
  756. $("#inpatientWardBeHospitalized").next().click();
  757. } else if (id == 'op_record_button') {
  758. //当前页面是手术保存页面,此时光标在入院按钮上
  759. console.log("手术按钮")
  760. $("#opName").next().click();
  761. } else if (id == 'opName') {
  762. $("#opTime").click();
  763. var opTime = $("#opTime").val();
  764. if (opTime == null || opTime == "") {
  765. $("#opTime").datetimepicker('show');
  766. } else {
  767. $("#opTime").datetimepicker('hide');
  768. $("#urgentClinicFlag").next().click();
  769. }
  770. } else if (id == 'opTime') {
  771. $("#opTime").datetimepicker('hide');
  772. $("#urgentClinicFlag").next().click();
  773. } else if (id == 'urgentClinicFlag') {
  774. $("#ssbc").next().click();
  775. } else if (id == 'ssbc') {
  776. $("#partCode").next().click();
  777. } else if (id == 'partCode') {
  778. $("#opScale").next().click();
  779. } else if (id == 'opScale') {
  780. $("#hocusCode").next().click();
  781. } else if (id == 'hocusCode') {
  782. $("#doctorZd").next().click();
  783. } else if (id == 'doctorZd') {
  784. $("#opRecordRemark").click();
  785. } else if (id == 'opRecordRemark') {
  786. saveOpRecord(true);
  787. }
  788. if (id != null && id != "") {
  789. //将当前点击的id记录下
  790. prevEleId = id;
  791. }
  792. } else if (event.keyCode == 37) {
  793. // //左键事件
  794. // if(index==0){
  795. // return;
  796. // }
  797. // var prevObject=$("#bill_item_group").find("button")[index-1];
  798. // $(prevObject).click();
  799. } else if (event.keyCode == 38) {
  800. //上键事件
  801. var tableId = null;
  802. var inputId = null;
  803. var contentId = null;
  804. if (index == 0) {
  805. tableId = "tb_table_western_medicine";
  806. inputId = "western_medicine_name";
  807. contentId = "westernMedicinePopoverContent";
  808. } else if (index == 1) {
  809. tableId = "tb_table_chinese_medicine";
  810. inputId = "chinese_medicine_name";
  811. contentId = "chineseMedicinePopoverContent";
  812. } else if (index == 2) {
  813. tableId = "tb_table_jc_jy_item";
  814. inputId = "jcJyItem";
  815. contentId = "jcJyItemPopoverContent";
  816. } else if (index == 3) {
  817. tableId = "tb_table_zl_item";
  818. inputId = "zlItem";
  819. contentId = "zlItemPopoverContent";
  820. }else if (index == 6) {
  821. tableId = "tb_table_wp_medicine";
  822. inputId = "wp_medicine_name";
  823. contentId = "wpMedicinePopoverContent";
  824. }
  825. if (inputId == null) {
  826. return;
  827. }
  828. var webuiID = $("#" + inputId).attr("data-target");
  829. if (webuiID == null || webuiID == "null" || webuiID == "") {
  830. return;
  831. }
  832. //选择框打开
  833. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  834. var arr = $("#" + tableId).find("tbody").find("tr.trhover");
  835. var prev = $(arr).prev();
  836. if (arr != undefined && arr != null && arr.length > 0) {
  837. if (prev != undefined && prev != null && prev.length > 0) {
  838. $(arr).removeClass("trhover");
  839. $(prev).addClass("trhover");
  840. var height = $(arr).css("height");
  841. $("#" + contentId).parent().animate({scrollTop: "-=" + height}, 100);
  842. }
  843. } else {
  844. var arrs = $("#" + tableId).find("tbody").find("tr");
  845. $(arrs[0]).addClass("trhover");
  846. var height = $(arrs[0]).css("height");
  847. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  848. }
  849. }
  850. } else if (event.keyCode == 39) {
  851. // //右键事件
  852. // if(index==4){
  853. // return;
  854. // }
  855. // var nextObject=$("#bill_item_group").find("button")[index+1];
  856. // $(nextObject).click();
  857. } else if (event.keyCode == 40) {
  858. //下键事件
  859. var tableId = null;
  860. var inputId = null;
  861. var contentId = null;
  862. if (index == 0) {
  863. tableId = "tb_table_western_medicine";
  864. inputId = "western_medicine_name";
  865. contentId = "westernMedicinePopoverContent";
  866. } else if (index == 1) {
  867. tableId = "tb_table_chinese_medicine";
  868. inputId = "chinese_medicine_name";
  869. contentId = "chineseMedicinePopoverContent";
  870. } else if (index == 2) {
  871. tableId = "tb_table_jc_jy_item";
  872. inputId = "jcJyItem";
  873. contentId = "jcJyItemPopoverContent";
  874. } else if (index == 3) {
  875. tableId = "tb_table_zl_item";
  876. inputId = "zlItem";
  877. contentId = "zlItemPopoverContent";
  878. }else if (index == 6) {
  879. tableId = "tb_table_wp_medicine";
  880. inputId = "wp_medicine_name";
  881. contentId = "wpMedicinePopoverContent";
  882. }
  883. if (inputId == null) {
  884. return;
  885. }
  886. var webuiID = $("#" + inputId).attr("data-target");
  887. if (webuiID == null || webuiID == "null" || webuiID == "") {
  888. return;
  889. }
  890. //选择框打开
  891. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  892. var arr = $("#" + tableId).find("tbody").find("tr.trhover");
  893. var next = $(arr).next();
  894. if (arr != undefined && arr != null && arr.length > 0) {
  895. if (next != undefined && next != null && next.length > 0) {
  896. $(arr).removeClass("trhover");
  897. $(next).addClass("trhover");
  898. var height = $(arr).css("height");
  899. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  900. }
  901. } else {
  902. var arrs = $("#" + tableId).find("tbody").find("tr");
  903. $(arrs[0]).addClass("trhover");
  904. var height = $(arrs[0]).css("height");
  905. $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
  906. }
  907. }
  908. }
  909. });
  910. //打印检查检验报告单
  911. $('#btn_print').click(function () {
  912. printJyJcReport(1);
  913. });
  914. //打印设置检查检验报告单
  915. $('#btn_print_setup').click(function () {
  916. printJyJcReport(2);
  917. });
  918. /**
  919. * 医保电子凭证读卡
  920. */
  921. $("#siReadCard").on("click", function (t) {
  922. // siReadCard("qrcode_01101");
  923. siReadCard("jiangsu_qrcode_01101");
  924. });
  925. /**
  926. * 医保刷脸
  927. */
  928. $("#siReadCardFace").on("click", function (t) {
  929. // siReadCard("face_01101");
  930. siReadCard("jiangsu_face_01101");
  931. });
  932. /**
  933. * 门诊统筹支付医额外内容弹窗
  934. */
  935. $("#expContentRequired").on("click", function (t) {
  936. expContentRequiredModal();
  937. });
  938. /**
  939. * 门诊统筹支付医保电子凭证读卡
  940. */
  941. // $("#mztczfSiReadCard").on("click", function (t) {
  942. // mztczfSiReadCard(true, "qrcode_01101");
  943. // mztczfSiReadCard(true, "jiangsu_qrcode_01101");
  944. // });
  945. /**
  946. * 门诊统筹支付医保刷脸
  947. */
  948. // $("#mztczfSiReadCardFace").on("click", function (t) {
  949. // mztczfSiReadCard(true, "face_01101");
  950. // mztczfSiReadCard(true, "jiangsu_face_01101");
  951. // });
  952. /**
  953. * 快速接诊页面 -未挂号患者信息查询处编辑患者信息
  954. */
  955. $("#rapidAcceptsEditUser").on("click", function (t) {
  956. editUserModal($("#rapidAcceptsUserCode").val(), 2);
  957. ksjzType = 2 ;
  958. });
  959. //监听滚动停止处理逻辑开始
  960. let t1 = 0;
  961. let t2 = 0;
  962. let timer = null; // 定时器
  963. $("#scroll-wrap").on("scroll", function () {
  964. // 滚动
  965. clearTimeout(timer)
  966. timer = setTimeout(isScrollEnd, 100)
  967. t1 = $("#scroll-wrap").scrollTop();
  968. })
  969. function isScrollEnd() {
  970. t2 = $("#scroll-wrap").scrollTop();
  971. if (t2 == t1) {
  972. clearTimeout(timer)
  973. closeObjectWebui(true);
  974. console.log("滚动停止", t2) // 这里处理
  975. }
  976. }
  977. //监听滚动停止处理逻辑结束
  978. //合理用药预警系统(医药学知识查询助手)
  979. $("#hlyyButton").on("click", function (t) {
  980. $("#hlyyTitle").html("合理用药预警系统(医药学知识查询助手)");
  981. showHlyyModel('hlyysmsDiv', 'hlyysmsLoading', 'hlyysmsModal', "http://172.16.32.121:9097/index.html#");
  982. });
  983. //预约挂号日期控件注册
  984. $('#registrationTime').datetimepicker({
  985. language: 'zh-CN',
  986. //format: 'yyyy-mm-dd hh:ii:ss'
  987. format: 'yyyy-mm-dd',
  988. // showHour:false,
  989. // showMinute:false,
  990. // showSecond:false,
  991. // timeText:"",
  992. // timeFormat:"",
  993. minView: "month",
  994. autoclose: true,//选中自动关闭
  995. });
  996. //初始化号段下拉选
  997. initMzWorkTime();
  998. //挂号日期控件注册
  999. $('#opTime').datetimepicker({
  1000. language: 'zh-CN',
  1001. format: 'yyyy-mm-dd hh:ii:ss',
  1002. showHour: true,
  1003. showMinute: true,
  1004. showSecond: true,
  1005. minView: "1", // 1 小时 2 日视图 3 月视图 4 年视图
  1006. autoclose: true,//选中自动关闭
  1007. });
  1008. //出生日期控件注册
  1009. $('#crbMainCardBirthDay').datetimepicker({
  1010. language: 'zh-CN',
  1011. format: 'yyyy-mm-dd',
  1012. minView: "month",
  1013. autoclose: true,//选中自动关闭
  1014. });
  1015. //发病日期控件注册
  1016. $('#illStartDate').datetimepicker({
  1017. language: 'zh-CN',
  1018. format: 'yyyy-mm-dd',
  1019. minView: "month",
  1020. autoclose: true,//选中自动关闭
  1021. });
  1022. //诊断日期控件注册
  1023. $('#illFirstDate').datetimepicker({
  1024. language: 'zh-CN',
  1025. format: 'yyyy-mm-dd',
  1026. minView: "month",
  1027. autoclose: true,//选中自动关闭
  1028. });
  1029. //死亡日期控件注册
  1030. $('#deathDate').datetimepicker({
  1031. language: 'zh-CN',
  1032. format: 'yyyy-mm-dd',
  1033. minView: "month",
  1034. autoclose: true,//选中自动关闭
  1035. });
  1036. });
  1037. /**
  1038. * 刷新列表,解决越来越快的问题
  1039. */
  1040. function refreshList() {
  1041. //clearInterval要放在方法开始,不然的话,下面的代码还没运行到clearInterval,又开始了循环了。
  1042. clearInterval(timer);
  1043. //加载候诊患者列表
  1044. loadUnClinicTableList();
  1045. //加载已接诊患者列表 病人会缴费,需要刷新状态
  1046. // loadClinicTableList();
  1047. timer = setInterval(() => {
  1048. refreshList()
  1049. }, 60000);
  1050. }
  1051. /**
  1052. * 门诊统筹额外内容
  1053. */
  1054. function expContentRequiredModal() {
  1055. $("#expContentRequiredModal").modal("show");
  1056. }
  1057. /**
  1058. * 打开科室选择页面
  1059. */
  1060. function selectDeptModal() {
  1061. $("#selectDeptModal").modal("show");
  1062. }
  1063. /**
  1064. * 打开配置页面
  1065. */
  1066. function configWorkspaceModal() {
  1067. initWorkspaceConfigForCurrent();
  1068. $("#configWorkspaceModal").modal("show");
  1069. }
  1070. /**
  1071. * 打开配置页面
  1072. */
  1073. function jumpToFy() {
  1074. //console.log("val()",$("#clinicDeptNo").val())
  1075. if (currentPatientInfo.patientId) {
  1076. let data = {
  1077. "healthNo":"",
  1078. "patientNo":currentPatientInfo.patientId,
  1079. "hospitalNo":"",
  1080. "outpatientNo":"",
  1081. "name":currentPatientInfo.name,
  1082. "cardType":"01",
  1083. "cardNo":currentPatientInfo.socialNo?currentPatientInfo.socialNo:"",
  1084. "birthday":"",
  1085. "age":"",
  1086. "tel":currentPatientInfo.phoneNo?currentPatientInfo.phoneNo:"",
  1087. "workOrgan":"",
  1088. "lmp":""
  1089. }
  1090. const utf8Bytes = encodeURIComponent(JSON.stringify(data)).replace(/%([0-9A-F]{2})/g, (_, hex) => {
  1091. return String.fromCharCode(parseInt(hex, 16));
  1092. });
  1093. let url = "http://192.168.100.140:18080/mchis-web/?token=321322199206140414&module=M102&data=" + btoa(utf8Bytes);
  1094. window.open(url, "_blank");
  1095. }
  1096. }
  1097. /**
  1098. * 初始化用药天数下拉选
  1099. */
  1100. function initDayNum() {
  1101. var html = '';
  1102. for (var i = 1; i <= 112; i++) {
  1103. html += '<option value="' + i + '">' + i + '</option>';
  1104. }
  1105. $('#dayNum').html(html);
  1106. $('#dayNum').selectpicker('refresh');
  1107. $('#dayZlNum').html(html);
  1108. $('#dayZlNum').selectpicker('refresh');
  1109. $('#medcDays').html(html);
  1110. $('#medcDays').selectpicker('refresh');
  1111. setSelectDefaultVal('medcDays',1)
  1112. }
  1113. /**
  1114. * 根据病人姓名查询病人信息
  1115. */
  1116. function queryUserInfoByName() {
  1117. var userName = $('#rapidAcceptsUserName').val();
  1118. // var cardNo=$("#cardNo").val();
  1119. if (userName == null || userName == "") {
  1120. return;
  1121. }
  1122. if (userName.length > 0) {
  1123. clearRapidAcceptsModal();
  1124. $.ajax({
  1125. type: "GET",
  1126. url: '/thmz/getPatientMiByName?name=' + userName,
  1127. contentType: "application/json;charset=UTF-8",
  1128. dataType: "json",
  1129. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1130. success: function (res) {
  1131. if (res == '401' || res == 401) {
  1132. window.location.href = '/thmz/login/view'
  1133. return;
  1134. }
  1135. if (res.code == 0) {
  1136. fitPatient(res,"icCardNo");
  1137. }
  1138. }
  1139. });
  1140. }
  1141. }
  1142. /**
  1143. * 按照病人id查询病人信息
  1144. * @param patientId
  1145. */
  1146. function fillPatinet(value) {
  1147. $("#rapidAcceptsUserCardNo").val(value);
  1148. queryUserInfoByCardNo()
  1149. }
  1150. /**
  1151. * 下拉框设置默认值
  1152. * @param id
  1153. * @param val
  1154. */
  1155. function setSelectDefaultVal(id,val) {
  1156. $('#'+id).val(val)
  1157. $('#'+id).selectpicker('refresh');
  1158. }
  1159. /**
  1160. * 处方回调
  1161. */
  1162. function resetGroupIdSelect() {
  1163. var groupIds = $("#groupId option");
  1164. var usedGroupIdInputs = $("#xyTabContent").find("input.temporary_items_groupId");
  1165. if (usedGroupIdInputs != null && usedGroupIdInputs.length > 0) {
  1166. let lastGroupId = 0;
  1167. for (var i = 0; i < usedGroupIdInputs.length; i++) {
  1168. var groupId = Number($(usedGroupIdInputs[i]).val());
  1169. if (groupId > lastGroupId) {
  1170. lastGroupId = groupId;
  1171. }
  1172. }
  1173. if (groupIds != null && groupIds.length > 1) {
  1174. for (var i = 0; i < groupIds.length; i++) {
  1175. var groupId = $(groupIds[i]).val();
  1176. if (groupId <= lastGroupId) {
  1177. continue;
  1178. }
  1179. $(groupIds[i]).remove();
  1180. //删除给药方式与其他属性的缓存
  1181. groupIdMap.remove(groupId);
  1182. }
  1183. appendGroupOrder();
  1184. }
  1185. } else if (groupIds != null && groupIds.length > 1) {
  1186. initGroupOrder();
  1187. }
  1188. }
  1189. /**
  1190. * 初始化药品分组下拉选
  1191. */
  1192. function initGroupOrder() {
  1193. var html = '<option value="1">1</option>';
  1194. $('#groupId').html(html);
  1195. $('#groupId').selectpicker('refresh');
  1196. $("#groupId").selectpicker('val', 1);
  1197. $('#groupId').selectpicker('refresh');
  1198. groupIdMap = new MyMap();
  1199. }
  1200. /**
  1201. * 追加分组
  1202. */
  1203. function appendGroupOrder() {
  1204. var last = parseInt($("#groupId > option:last").val());
  1205. last++;
  1206. var html = '<option value="' + last + '">' + last + '</option>';
  1207. $('#groupId').append(html);
  1208. $('#groupId').selectpicker('refresh');
  1209. }
  1210. /**
  1211. * 组号改变事件
  1212. */
  1213. function groupIdChange() {
  1214. //var last = parseInt($("#groupId > option:last").val());
  1215. var groupId = $("#groupId").val();
  1216. var keys = groupIdMap.keySet();
  1217. if (keys.indexOf(groupId) < 0) {
  1218. //是新增药品清空药品输入区域
  1219. var updateFlag = $("#western_medicine_update_flag").val();
  1220. var currentCode = $("#western_medicine_current_code").val();
  1221. //当前时新增药品,而且没有选择药品的时候,组号变更,清空区域
  1222. if ((updateFlag == undefined || updateFlag == null || updateFlag == "false" || updateFlag == false) && (currentCode == null || currentCode == "")) {
  1223. clearWesternMedicine(true);
  1224. }
  1225. } else {
  1226. var map = groupIdMap.get(groupId);
  1227. if (map != null) {
  1228. var supplyType = map.get("supplyType");
  1229. var orderFrequency = map.get("orderFrequency");
  1230. var dayNum = map.get("dayNum");
  1231. //用法编码
  1232. $("#supplyType").selectpicker('val', supplyType);
  1233. $('#supplyType').selectpicker('refresh');
  1234. //$("#supplyType").attr("disabled", "disabled");
  1235. //天数
  1236. $("#dayNum").selectpicker('val', dayNum);
  1237. $('#dayNum').selectpicker('refresh');
  1238. // $("#dayNum").attr("disabled", "disabled");
  1239. //频次编码
  1240. $("#orderFrequency").selectpicker('val', orderFrequency);
  1241. $('#orderFrequency').selectpicker('refresh');
  1242. // $("#orderFrequency").attr("disabled", "disabled");
  1243. }
  1244. }
  1245. }
  1246. /**
  1247. * 关闭智能问诊弹框
  1248. */
  1249. function closePopover() {
  1250. //$(".popover").popover('hide');
  1251. $("#box-arrow-left").click();
  1252. }
  1253. /**
  1254. * 关闭项目选择框
  1255. * ReOpen 是否重新打开 true 打开 false 不打开
  1256. */
  1257. function closeObjectWebui(ReOpen) {
  1258. var index = getIndex("bill_item_group");
  1259. var currentCode = "western_medicine_name";
  1260. if (index == 1) {
  1261. currentCode = "chinese_medicine_name";
  1262. } else if (index == 2) {
  1263. currentCode = "jcJyItem";
  1264. } else if (index == 3) {
  1265. currentCode = "zlItem";
  1266. }
  1267. var webuiID = $("#" + currentCode).attr("data-target");
  1268. if (webuiID != null && webuiID != "null" && webuiID != "") {
  1269. //选择框打开
  1270. if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
  1271. $("#" + currentCode).click();
  1272. if (ReOpen) {
  1273. $("#" + currentCode).click();
  1274. }
  1275. }
  1276. }
  1277. var symptomID = $("#symptom").attr("data-target");
  1278. if (symptomID != null && symptomID != "null" && symptomID != "") {
  1279. //选择框打开
  1280. if ($("#" + symptomID).hasClass("in") || $("#" + symptomID).css("display") == "block") {
  1281. $("#symptom").click();
  1282. if (ReOpen) {
  1283. $("#symptom").click();
  1284. }
  1285. }
  1286. }
  1287. var weightID = $("#weight").attr("data-target");
  1288. if (weightID != null && weightID != "null" && weightID != "") {
  1289. //选择框打开
  1290. if ($("#" + weightID).hasClass("in") || $("#" + weightID).css("display") == "block") {
  1291. $("#weight").click();
  1292. if (ReOpen) {
  1293. $("#weight").click();
  1294. }
  1295. }
  1296. }
  1297. var diagnoseID = $("#diagnose").attr("data-target");
  1298. if (diagnoseID != null && diagnoseID != "null" && diagnoseID != "") {
  1299. //选择框打开
  1300. if ($("#" + diagnoseID).hasClass("in") || $("#" + diagnoseID).css("display") == "block") {
  1301. $("#diagnose").click();
  1302. if (ReOpen) {
  1303. $("#diagnose").click();
  1304. }
  1305. }
  1306. }
  1307. }
  1308. /**
  1309. * 加载智能问诊弹框内容
  1310. */
  1311. function contentMethod() {
  1312. setTimeout(function () {
  1313. closeObjectWebui(false);
  1314. $(".popover div.arrow").css("display", "none");
  1315. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1316. if (popoverId == undefined) {
  1317. return;
  1318. }
  1319. var left = $("#" + popoverId).css("left");
  1320. left = left.replace("px", "");
  1321. left = parseInt(left);
  1322. left = left + 55;
  1323. $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
  1324. $("#" + popoverId + " .popover-content").css("height", "100%");
  1325. $("#smartAssistPopoverContent").css("height", "100%");
  1326. var html = ' <div style="height: 24%;padding-left: 15px;width: 100%;">' +
  1327. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
  1328. ' class="btn btn-primary">' +
  1329. ' <span id="patientHisData"></span>就医轨迹' +
  1330. ' </button>' +
  1331. ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
  1332. ' </button>' +
  1333. ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
  1334. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  1335. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
  1336. ' </form>' +
  1337. ' </div>' +
  1338. ' </div>' +
  1339. ' <div style="height: 23%;padding-left: 15px;width: 100%;">' +
  1340. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
  1341. ' class="btn btn-primary">' +
  1342. ' <span id="recommendType"></span>推荐' +
  1343. ' </button>' +
  1344. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
  1345. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  1346. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
  1347. ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
  1348. ' </form>' +
  1349. ' </div>' +
  1350. ' </div>' +
  1351. ' <div style="height: 53%;padding-left: 15px;width: 100%;">' +
  1352. ' <button type="button"' +
  1353. ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
  1354. ' class="btn btn-primary">' +
  1355. ' 医疗范本' +
  1356. ' </button>' +
  1357. ' <div class="item" style="width: 230px;height: 35px;float: right;line-height: 35px;margin-right: 40px;">' +
  1358. ' <div class="col-md-6 col-sm-6 col-xs-12">' +
  1359. ' <select class="form-control selectpicker show-tick" title="范文范围" onchange="fitTemplateData()"' +
  1360. ' id="templateTypeForm">' +
  1361. ' </select>' +
  1362. ' </div>' +
  1363. ' <div class="col-md-6 col-sm-6 col-xs-12">' +
  1364. ' <select class="form-control selectpicker show-tick" title="范文类型" onchange="fitTemplateData()"' +
  1365. ' id="templateKindTypeForm">' +
  1366. ' </select>' +
  1367. ' </div>' +
  1368. ' </div>' +
  1369. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;position: relative;">' +
  1370. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  1371. ' style="height: 100%;overflow-y: auto;width: 100%;" id="TemplateData">' +
  1372. ' </form>' +
  1373. ' </div>' +
  1374. ' </div>';
  1375. $("#smartAssistPopoverContent").html(html);
  1376. initTemplateTypeSelect("templateTypeForm");
  1377. initTemplateKindTypeSelect('templateKindTypeForm');
  1378. fitPatientHisData();
  1379. fitSymptomData();
  1380. fitEmrHpiData();
  1381. fitEmrPsData();
  1382. fitDiagnoseData();
  1383. fitTemplateData();
  1384. }, 100);
  1385. // setTimeout(function () {
  1386. // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
  1387. // },1000);
  1388. }
  1389. /**
  1390. * 设置患者的就诊轨迹
  1391. */
  1392. function fitPatientHisData() {
  1393. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1394. if (!$("#" + popoverId).hasClass("in")) {
  1395. return;
  1396. }
  1397. var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  1398. if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
  1399. $("#patientHisDataForm").html(emptyHtml);
  1400. return;
  1401. }
  1402. var patientId = $("#patientId").text();
  1403. if (patientId == null || patientId == "") {
  1404. patientId = $("#userName").val();
  1405. }
  1406. $.ajax({
  1407. type: "POST",
  1408. url: '/thmz/getClinicWithPage',
  1409. contentType: "application/json;charset=UTF-8",
  1410. dataType: "json",
  1411. data: JSON.stringify({
  1412. "commonParams": patientId,
  1413. //"clinicStatuses": [5, 6],
  1414. "clinicStatuses": [6],
  1415. "pageSize": 10000,
  1416. "offset": 0,
  1417. "beginDate": "2012-02-01 00:00:00",
  1418. "endDate": "",
  1419. "doctorCode": "-1"
  1420. }),
  1421. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1422. success: function (res) {
  1423. if (res == '401' || res == 401) {
  1424. window.location.href = '/thmz/login/view'
  1425. return;
  1426. }
  1427. if (res.code == 0) {
  1428. var html = '';
  1429. var data = res.data;
  1430. if (data == null || data.length == 0) {
  1431. html += emptyHtml;
  1432. } else {
  1433. for (var i = 0; i < data.length; i++) {
  1434. var icdText = data[i].icdText;
  1435. if (icdText == null) {
  1436. // continue;
  1437. icdText = "空白诊断";
  1438. }
  1439. icdText = icdText.trim();
  1440. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  1441. html += ' <div style="float: left;width: 172px;">';
  1442. html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
  1443. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  1444. html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
  1445. html += ' </div>';
  1446. html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
  1447. html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
  1448. html += ' onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
  1449. html += ' </div>';
  1450. html += ' </div>';
  1451. }
  1452. }
  1453. var patientName = $("#patientName").text();
  1454. if (patientName == null || patientName == "") {
  1455. if (res.mzPatientMi != null) {
  1456. patientName = res.mzPatientMi.name;
  1457. } else {
  1458. patientName = patientId;
  1459. }
  1460. }
  1461. $("#patientHisData").text(patientName + "的");
  1462. if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
  1463. $("#patientHisDataForm").html(emptyHtml);
  1464. } else {
  1465. $("#patientHisDataForm").html(html);
  1466. }
  1467. } else {
  1468. errorMesage(res);
  1469. }
  1470. }
  1471. });
  1472. }
  1473. /**
  1474. * 设置主诉推荐
  1475. */
  1476. function fitSymptomData() {
  1477. fitRecommendData(12);
  1478. }
  1479. /**
  1480. * 设置现病史推荐
  1481. */
  1482. function fitEmrHpiData() {
  1483. fitRecommendData(5);
  1484. }
  1485. /**
  1486. * 设置既往史推荐
  1487. */
  1488. function fitEmrPsData() {
  1489. fitRecommendData(6);
  1490. }
  1491. /**
  1492. * 设置诊断推荐
  1493. */
  1494. function fitDiagnoseData() {
  1495. fitRecommendData(13);
  1496. }
  1497. /**
  1498. * 设置推荐通用方法
  1499. */
  1500. function fitRecommendData(paramsType) {
  1501. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1502. if (!$("#" + popoverId).hasClass("in")) {
  1503. return;
  1504. }
  1505. var inputId = "symptom";
  1506. var text = "主诉";
  1507. if (paramsType == 5) {
  1508. inputId = "emrHpi";
  1509. text = "现病史";
  1510. } else if (paramsType == 6) {
  1511. inputId = "emrPs";
  1512. text = "既往史";
  1513. } else if (paramsType == 13) {
  1514. inputId = "diagnose";
  1515. text = "诊断";
  1516. }
  1517. //光标不在现病史上
  1518. if (document.activeElement.id != inputId) {
  1519. return;
  1520. }
  1521. $("#recommendType").html(text);
  1522. var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  1523. $.ajax({
  1524. type: "GET",
  1525. url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
  1526. contentType: "application/json;charset=UTF-8",
  1527. dataType: "json",
  1528. async: false,
  1529. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1530. success: function (res) {
  1531. if (res == '401' || res == 401) {
  1532. window.location.href = '/thmz/login/view'
  1533. return;
  1534. }
  1535. if (res.code == 0) {
  1536. var html = '';
  1537. var data = res.data;
  1538. if (data == null || data.length == 0) {
  1539. html += emptyHtml;
  1540. } else {
  1541. for (var i = 0; i < data.length; i++) {
  1542. var paramsContent = data[i].paramsContent;
  1543. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  1544. html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
  1545. html += paramsContent;
  1546. html += ' </div>';
  1547. html += ' <div style="float: left;width: 36px;cursor: pointer;"';
  1548. html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ',' + data[i].id + ')">';
  1549. html += ' <img';
  1550. html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
  1551. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  1552. html += ' </div>';
  1553. html += ' </div>';
  1554. }
  1555. }
  1556. $("#recommendForm").html(html);
  1557. } else {
  1558. errorMesage(res);
  1559. }
  1560. }
  1561. });
  1562. }
  1563. /**
  1564. * 设置医疗范文方法
  1565. */
  1566. function fitTemplateData() {
  1567. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  1568. if (!$("#" + popoverId).hasClass("in")) {
  1569. return;
  1570. }
  1571. 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;">';
  1572. $.ajax({
  1573. type: "GET",
  1574. url: '/thmz/getTemplate?templateKindType=' + $("#templateKindTypeForm").val() + '&templateType=' + $("#templateTypeForm").val(),
  1575. contentType: "application/json;charset=UTF-8",
  1576. dataType: "json",
  1577. async: false,
  1578. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1579. success: function (res) {
  1580. if (res == '401' || res == 401) {
  1581. window.location.href = '/thmz/login/view'
  1582. return;
  1583. }
  1584. if (res.code == 0) {
  1585. var html = '';
  1586. var data = res.data;
  1587. if (data == null || data.length == 0) {
  1588. html += emptyHtml;
  1589. } else {
  1590. for (var i = 0; i < data.length; i++) {
  1591. var template = data[i];
  1592. var icdText = (template.icdText == null || template.icdText == "") ? "无" : template.icdText;
  1593. html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
  1594. html += ' <div title="' + template.name + '"';
  1595. html += ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">';
  1596. html += template.name;
  1597. html += ' </div>';
  1598. html += ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"';
  1599. html += ' title="' + template.icdText + '">诊断:<a';
  1600. html += ' style="cursor: pointer; color: #2e69eb;"';
  1601. html += ' onclick="medicalModelModal(' + template.id + ')">' + icdText + '</a>';
  1602. html += ' </div>';
  1603. html += ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(' + template.id + ')"><img';
  1604. html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
  1605. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  1606. html += ' </div>';
  1607. html += ' </div>';
  1608. }
  1609. }
  1610. $("#TemplateData").html(html);
  1611. } else {
  1612. errorMesage(res);
  1613. }
  1614. }
  1615. });
  1616. }
  1617. /**
  1618. * 清空快速接诊弹窗
  1619. */
  1620. function clearRapidAcceptsModal() {
  1621. $("#rapidAcceptsUserName").val(null);
  1622. $("#rapidAcceptsUserCode").val(null);
  1623. $("#patientIdDb").val(null);
  1624. $("#rapidAcceptsUserCardNo").val(null);
  1625. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  1626. $("#rapidAcceptsUserGender").selectpicker('refresh');
  1627. $("#rapidAcceptsUserPhoneNum").val(null);
  1628. $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
  1629. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  1630. $("#rapidAcceptsUserIdCard").val(null);
  1631. $("#rapidAcceptsUserIdCard").attr("title", null);
  1632. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  1633. $('#rapidAcceptsProvinceCode').selectpicker('val', null);
  1634. $('#rapidAcceptsProvinceCode').selectpicker('refresh');
  1635. $('#rapidAcceptsCityCode').selectpicker('val', null);
  1636. $('#rapidAcceptsCityCode').selectpicker('refresh');
  1637. $('#rapidAcceptsDistrictCode').selectpicker('val', null);
  1638. $('#rapidAcceptsDistrictCode').selectpicker('refresh');
  1639. $("#rapidAcceptsDetail").val(null);
  1640. $("#rapidAcceptsDetail").attr("title", null);
  1641. $("#rapidAcceptsUserContact").val(null);
  1642. $("#rapidAcceptsUserContactPhone").val(null);
  1643. }
  1644. /**
  1645. * 清空接诊台用户信息
  1646. * @param flag 是否清空分诊流水哈 true 清空
  1647. */
  1648. function clearUser(flag) {
  1649. $("#patientName").html("");
  1650. $("#patientAge").html("");
  1651. $("#patientGender").html("");
  1652. $("#patientId").text(null);
  1653. $("#visitTimes").val(null);
  1654. $("#crbMainCard").css("display", "none");
  1655. $("#editUser").css("display", "none");
  1656. $("#clearUser").css("display", "none");
  1657. $("#discountLvCard").css("display", "none");
  1658. $("#mallTcCard").css("display", "none");
  1659. // $("#fetchSpcSlwinfo").css("display", "none");
  1660. $("#patientPhone").html("");
  1661. $("#patientPhoneLabel").hide();
  1662. $("#patientResponseType").html("");
  1663. $("#first").next().click();
  1664. $("#patientHisData").text("");
  1665. initGhFeeSelect()
  1666. $('#mzOrderTypeSelect').val('1');
  1667. $('#mzOrderTypeSelect').selectpicker('refresh');
  1668. $("#mzReqTypeName").text(null);
  1669. $("#mzReqType").val(null);
  1670. if (flag) {
  1671. $("#transferTreatment").css("display", "none");
  1672. $("#consultation").css("display", "none");
  1673. $("#mzfzSerialNoInClick").val(null);
  1674. $("#mzfzReqTypeNoInClick").val(null);
  1675. $("#turnToConsultationIdInClick").val(null);
  1676. }
  1677. }
  1678. /**
  1679. * 卡号输入改变事件
  1680. */
  1681. function cardNoChange() {
  1682. // if (window.ActiveXObject || "ActiveXObject" in window) {
  1683. // $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
  1684. // queryUserInfoByCardNo();
  1685. // });
  1686. // } else {
  1687. // $("#rapidAcceptsUserCardNo").on('input οninput', function () {
  1688. // queryUserInfoByCardNo();
  1689. // });
  1690. // }
  1691. $("#rapidAcceptsUserCardNo").on('keydown', function (event) {
  1692. if (event.key === "Enter") {
  1693. event.preventDefault(); // 阻止默认行为(如表单提交)
  1694. queryUserInfoByCardNo();
  1695. }
  1696. });
  1697. // $("#rapidAcceptsUserCardNo").on('blur', function (event) {
  1698. // queryUserInfoByCardNo();
  1699. // });
  1700. $("#rapidAcceptsUserCardNoBtn").on('click', function (event) {
  1701. queryUserInfoByCardNo();
  1702. });
  1703. }
  1704. /**
  1705. * 刷新就诊列表
  1706. */
  1707. function refreshClinic() {
  1708. loadInClinicTableList();
  1709. loadClinicTableList();
  1710. fitPatientHisData();
  1711. }
  1712. /**
  1713. * 加载已接诊患者列表
  1714. */
  1715. function loadClinicTableList() {
  1716. //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
  1717. loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
  1718. initZyClassTypeSelect()
  1719. }
  1720. /**
  1721. * 加载患者列表通用方法
  1722. * @param id
  1723. * @param queryParams
  1724. */
  1725. function loadCommonClinicTableList(id, queryParams) {
  1726. $('#' + id).bootstrapTable('refresh');
  1727. $('#' + id).bootstrapTable({
  1728. url: "/thmz/getClinicWithPage", //请求后台的URL(*)
  1729. method: 'post', //请求方式(*)
  1730. toolbar: '#toolbar', //工具按钮用哪个容器
  1731. striped: true, //是否显示行间隔色
  1732. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1733. pagination: true, //是否显示分页(*)
  1734. sortable: true, //是否启用排序
  1735. sortOrder: "asc", //排序方式
  1736. queryParams: queryParams, //传递参数(*)
  1737. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1738. pageNumber: 1, //初始化加载第一页,默认第一页
  1739. pageSize: 5, //每页的记录行数(*)
  1740. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  1741. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1742. strictSearch: true,
  1743. showColumns: false, //是否显示所有的列
  1744. showRefresh: false, //是否显示刷新按钮
  1745. minimumCountColumns: 2, //最少允许的列数
  1746. clickToSelect: true, //是否启用点击选中行
  1747. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1748. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1749. cardView: false, //是否显示详细视图
  1750. detailView: false,
  1751. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1752. ajaxOptions: {
  1753. headers: {
  1754. 'Accept': 'application/json',
  1755. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1756. }
  1757. },
  1758. columns: [
  1759. {
  1760. field: 'patientName',
  1761. title: '姓名/性别/年龄',
  1762. align: "center",
  1763. valign: 'middle',
  1764. // sortable: true
  1765. formatter: function (value, row, index) {
  1766. var age = row.age;
  1767. if (age == null || age == "null") {
  1768. age = "";
  1769. }
  1770. let tfName = ''
  1771. if(row.clinicStatus == 7){
  1772. tfName = '/退'
  1773. }
  1774. return value + "/" + row.gender + "/" + age+ tfName;
  1775. }
  1776. }, {
  1777. field: 'opDay',
  1778. title: '接诊时间',
  1779. align: "center",
  1780. valign: 'middle',
  1781. // sortable: true
  1782. formatter: function (value, row, index) {
  1783. return format(value, "MM/dd HH:mm");
  1784. }
  1785. }
  1786. , {
  1787. title: '操作',
  1788. align: "center",
  1789. valign: 'middle',
  1790. // sortable: true,
  1791. formatter: function (value, row, index) {
  1792. if (row.clinicStatus == 5) {
  1793. return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
  1794. // return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a>&nbsp;<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
  1795. } else if (row.clinicStatus == 6) {
  1796. return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',0)">详情</a>';
  1797. } else if (row.clinicStatus == 7) {
  1798. return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a>&nbsp;<a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',1)">详情</a>';
  1799. }
  1800. }
  1801. }
  1802. ],
  1803. responseHandler: function (res) {
  1804. if (res == '401' || res == 401) {
  1805. window.location.href = '/thmz/login/view'
  1806. return;
  1807. }
  1808. var ress = eval(res);
  1809. if (ress.code == -1) {
  1810. new PNotify({
  1811. title: '错误提示',
  1812. text: ress.message,
  1813. type: 'error',
  1814. hide: false,
  1815. styling: 'bootstrap3'
  1816. });
  1817. return {
  1818. "total": 0,//总页数
  1819. "rows": {} //数据
  1820. };
  1821. }
  1822. return {
  1823. "total": ress.total,//总页数
  1824. "rows": ress.data //数据
  1825. };
  1826. },
  1827. onLoadSuccess: function (data) {
  1828. patientList = data.rows
  1829. $(".pagination-detail").css("display", "none");
  1830. if (id == "tb_table_clinic") {
  1831. $("#ClinicNum").html(data.total);
  1832. } else {
  1833. $("#inClinicNum").html(data.total);
  1834. }
  1835. }
  1836. });
  1837. }
  1838. /**
  1839. * 得到查询的参数 接诊中
  1840. * @param params
  1841. * @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}}
  1842. */
  1843. function queryParamsInClinic(params) {
  1844. var temp = {
  1845. pageSize: params.limit,
  1846. pageIndex: params.offset / params.limit, //页码
  1847. statusFlagList: [8]
  1848. };
  1849. return temp;
  1850. };
  1851. /**
  1852. * 得到查询的参数
  1853. * @param params
  1854. * @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}}
  1855. */
  1856. function queryParamsClinic(params) {
  1857. var rePortRangeArr = getRePortRangeArr();
  1858. var commonParams = $("#userName").val();
  1859. var needDateParams = commonParams == null || commonParams == "null" || commonParams == "";
  1860. var temp = {
  1861. beginDate: needDateParams ? rePortRangeArr[0] : "2012-02-01 00:00:00" ,
  1862. endDate: needDateParams ? rePortRangeArr[1]: format(new Date(),"yyyy-MM-dd HH:mm:ss"),
  1863. commonParams: commonParams,
  1864. clinicStatuses: [5, 6, 7],
  1865. pageSize: params.limit,
  1866. offset: params.offset
  1867. };
  1868. return temp;
  1869. };
  1870. /**
  1871. * 加载待诊患者列表方法
  1872. */
  1873. function loadUnClinicTableList() {
  1874. loadCanClinicTableList("tb_table_un_clinic", queryParamsUnClinic);
  1875. }
  1876. /**
  1877. * 加载接诊中患者列表方法
  1878. */
  1879. function loadInClinicTableList() {
  1880. loadCanClinicTableList("tb_table_in_clinic", queryParamsInClinic);
  1881. }
  1882. /**
  1883. * 加载待诊和接诊中患者列表通用方法方法
  1884. */
  1885. function loadCanClinicTableList(id, queryParams) {
  1886. $('#' + id).bootstrapTable('refresh');
  1887. $('#' + id).bootstrapTable({
  1888. url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
  1889. method: 'post', //请求方式(*)
  1890. toolbar: '#toolbar', //工具按钮用哪个容器
  1891. striped: true, //是否显示行间隔色
  1892. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1893. pagination: true, //是否显示分页(*)
  1894. sortable: true, //是否启用排序
  1895. sortOrder: "asc", //排序方式
  1896. queryParams: queryParams, //传递参数(*)
  1897. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1898. pageNumber: 1, //初始化加载第一页,默认第一页
  1899. pageSize: 5, //每页的记录行数(*)
  1900. pageList: [2, 5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  1901. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1902. strictSearch: true,
  1903. showColumns: false, //是否显示所有的列
  1904. showRefresh: false, //是否显示刷新按钮
  1905. minimumCountColumns: 2, //最少允许的列数
  1906. clickToSelect: true, //是否启用点击选中行
  1907. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1908. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1909. cardView: false, //是否显示详细视图
  1910. detailView: false,
  1911. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1912. ajaxOptions: {
  1913. headers: {
  1914. 'Accept': 'application/json',
  1915. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1916. }
  1917. },
  1918. columns: [
  1919. {
  1920. field: 'name',
  1921. title: '姓名/性别/年龄',
  1922. align: "center",
  1923. valign: 'middle',
  1924. // sortable: true
  1925. formatter: function (value, row, index) {
  1926. return value + "/" + row.gender + "/" + row.age;
  1927. }
  1928. }, {
  1929. field: 'visitDate',
  1930. title: '分诊时间',
  1931. align: "center",
  1932. valign: 'middle',
  1933. // sortable: true
  1934. formatter: function (value, row, index) {
  1935. return format(value, "MM/dd HH:mm");
  1936. }
  1937. }
  1938. , {
  1939. title: '操作',
  1940. align: "center",
  1941. valign: 'middle',
  1942. // sortable: true,
  1943. formatter: function (value, row, index) {
  1944. if (row.statusFlag == 0) {
  1945. return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
  1946. } else if (row.statusFlag == 8) {
  1947. //TODO 继续接诊需要新方法
  1948. 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>';
  1949. } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
  1950. var userIdCode = localStorage.getItem("userIdCode");
  1951. if (userIdCode === row.doctorCode) {
  1952. return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a>&nbsp;<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
  1953. }
  1954. return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
  1955. }
  1956. }
  1957. }
  1958. ],
  1959. responseHandler: function (res) {
  1960. if (res == '401' || res == 401) {
  1961. window.location.href = '/thmz/login/view'
  1962. return;
  1963. }
  1964. var ress = eval(res);
  1965. if (ress.code == -1) {
  1966. new PNotify({
  1967. title: '错误提示',
  1968. text: ress.message,
  1969. type: 'error',
  1970. hide: false,
  1971. styling: 'bootstrap3'
  1972. });
  1973. return {
  1974. "total": 0,//总页数
  1975. "rows": {} //数据
  1976. };
  1977. }
  1978. return {
  1979. "total": ress.total,//总页数
  1980. "rows": ress.data //数据
  1981. };
  1982. },
  1983. onLoadSuccess: function (data) {
  1984. $(".pagination-detail").css("display", "none");
  1985. $("#unClinicNum").html(data.total);
  1986. }
  1987. });
  1988. }
  1989. /**
  1990. * 得到查询的参数
  1991. * @param params
  1992. * @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}}
  1993. */
  1994. function queryParamsUnClinic(params) {
  1995. var temp = {
  1996. pageSize: params.limit,
  1997. pageIndex: params.offset / params.limit, //页码
  1998. statusFlagList: [0, 1, 2, 3]
  1999. };
  2000. return temp;
  2001. };
  2002. /**
  2003. * 通知叫号
  2004. * @param serialNo
  2005. */
  2006. function clinicCallNumber(serialNo) {
  2007. $.ajax({
  2008. type: "GET",
  2009. url: '/thmz/clinicCallNumber?serialNo=' + serialNo,
  2010. contentType: "application/json;charset=UTF-8",
  2011. dataType: "json",
  2012. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2013. success: function (res) {
  2014. if (res == '401' || res == 401) {
  2015. window.location.href = '/thmz/login/view'
  2016. return;
  2017. }
  2018. if (res.code == 0) {
  2019. successMesage(res);
  2020. } else {
  2021. errorMesage(res);
  2022. }
  2023. }
  2024. });
  2025. }
  2026. /**
  2027. * 接诊方法
  2028. * @param patientId 门诊id
  2029. * @param serialNo 分诊流水号
  2030. * @param reqType 号表类别
  2031. */
  2032. function clinicalReception(patientId, serialNo, reqType) {
  2033. var existPatientId = $("#patientId").text();
  2034. if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
  2035. $("#messageModal").modal();
  2036. $("#messageContent").html("当前有病人正在接诊,是否切换?");
  2037. $("#messageButton").off("click").on("click", function (t) {
  2038. $("#messageModal").modal("hide");
  2039. //当前有人在接诊,提示是否需要切换和保存
  2040. $("#messagePrescriptionModal").modal();
  2041. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  2042. $("#messagePrescriptionModal").modal("hide");
  2043. //先保存目前接诊信息,再切换就诊人
  2044. var jsonData = getParamsForpPrescription(1);
  2045. $.ajax({
  2046. type: "POST",
  2047. url: '/thmz/savePrescription',
  2048. contentType: "application/json;charset=UTF-8",
  2049. dataType: "json",
  2050. data: JSON.stringify(jsonData),
  2051. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2052. success: function (res) {
  2053. if (res == '401' || res == 401) {
  2054. window.location.href = '/thmz/login/view'
  2055. return;
  2056. }
  2057. if (res.code == 0) {
  2058. clearWorkSpace();
  2059. realClinicalReception(patientId, serialNo, reqType);
  2060. //加载已接诊患者列表
  2061. loadClinicTableList();
  2062. } else {
  2063. errorMesage(res);
  2064. }
  2065. }
  2066. });
  2067. });
  2068. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  2069. $("#messagePrescriptionModal").modal("hide");
  2070. clearWorkSpace();
  2071. realClinicalReception(patientId, serialNo, reqType);
  2072. });
  2073. });
  2074. $("#cancelButton").off("click");
  2075. } else {
  2076. realClinicalReception(patientId, serialNo, reqType);
  2077. }
  2078. }
  2079. /**
  2080. * 取消接诊
  2081. * @param patientId
  2082. */
  2083. function cancelClinic(patientId, times) {
  2084. $("#messageModal").modal();
  2085. $("#messageContent").html("确认取消当前病人的接诊记录吗?");
  2086. $("#messageButton").off("click").on("click", function (t) {
  2087. $("#messageModal").modal("hide");
  2088. $.ajax({
  2089. type: "GET",
  2090. url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
  2091. contentType: "application/json;charset=UTF-8",
  2092. dataType: "json",
  2093. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2094. success: function (res) {
  2095. if (res == '401' || res == 401) {
  2096. window.location.href = '/thmz/login/view'
  2097. return;
  2098. }
  2099. if (res.code == 0) {
  2100. if (res.data == null || res.data.length == 0) {
  2101. return;
  2102. }
  2103. successMesage(res);
  2104. if (times > 0) {
  2105. notFirstYX02 = false
  2106. hasJcInYx = false
  2107. viewRecordId = null
  2108. jcItemList = null
  2109. loadUnClinicTableList();
  2110. loadInClinicTableList();
  2111. clearWorkSpace();
  2112. }
  2113. } else if (res.code == -1) {
  2114. errorMesage(res);
  2115. }
  2116. }
  2117. });
  2118. });
  2119. $("#cancelButton").off("click");
  2120. };
  2121. /**
  2122. * 设置当前接诊病人信息
  2123. * @param mzPatientMi
  2124. */
  2125. function setMzPatientInfo(mzPatientMi) {
  2126. postAjaxJsonHttpRequst("/thmz/getSqGhfFlag",{patientId:mzPatientMi.patientId},true,function (res) {
  2127. $("#ghFeeSelect").val(res.data)
  2128. $('#ghFeeSelect').selectpicker('refresh');
  2129. })
  2130. $.ajax({
  2131. type: "GET",
  2132. url: '/thmz/getDeptNoByCurrentPatientId?patientId=' + mzPatientMi.patientId,
  2133. contentType: "application/json;charset=UTF-8",
  2134. dataType: "json",
  2135. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2136. success: function (res) {
  2137. if (res == '401' || res == 401) {
  2138. window.location.href = '/thmz/login/view'
  2139. return;
  2140. }
  2141. if (res.code == 0) {
  2142. //当前患者就诊科室编码
  2143. localStorage.setItem("currentDeptNo", res.data.code);
  2144. $("#deptCode").val(res.data.code);
  2145. $("#deptName").val(res.data.name);
  2146. } else if (res.code == -1) {
  2147. errorMesage(res);
  2148. }
  2149. }
  2150. });
  2151. //处理影像平台接口需要数据
  2152. $("#identityNo").val(mzPatientMi.socialNo);
  2153. $("#visitCardNo").val(mzPatientMi.icCardNo);
  2154. $("#birthDay").val(mzPatientMi.birthDay);
  2155. $("#sex").val(mzPatientMi.sex);
  2156. $("#mobile").val(mzPatientMi.phoneNo);
  2157. notFirstYX02 = false
  2158. hasJcInYx = false
  2159. viewRecordId = null;
  2160. jcItemList = null;
  2161. currentPatientInfo = mzPatientMi
  2162. $("#patientName").html(mzPatientMi.name);
  2163. //var age = getAge(mzPatientMi);
  2164. $("#patientAge").html(mzPatientMi.ageString);
  2165. setVisitTypeName(mzPatientMi.patientId);
  2166. $("#visitTimes").val(mzPatientMi.times);
  2167. $("#patientGender").html(mzPatientMi.gender);
  2168. $("#patientId").text(mzPatientMi.patientId);
  2169. $("#crbMainCard").css("display", "inline-block");
  2170. $("#editUser").css("display", "inline-block");
  2171. $("#clearUser").css("display", "inline-block");
  2172. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
  2173. $("#patientPhone").html(mzPatientMi.phoneNo);
  2174. $("#patientPhoneLabel").show();
  2175. } else {
  2176. $("#patientPhoneLabel").hide();
  2177. }
  2178. $("#patientResponseType").html(mzPatientMi.responseTypeName);
  2179. if (mzPatientMi.times == 1) {
  2180. $("#first").next().click();
  2181. } else {
  2182. $("#not").next().click();
  2183. }
  2184. $("#patientHisData").text(mzPatientMi.name);
  2185. fitPatientHisData();
  2186. // setTmResponseType(mzPatientMi.patientId);
  2187. }
  2188. //设置病人身份
  2189. function setVisitTypeName(patientId) {
  2190. if(stringIsBlank(patientId)){
  2191. return
  2192. }
  2193. postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
  2194. if(res.code ==0){
  2195. $("#patientVisitType").text(res.data);
  2196. if(!stringIsBlank(res.data)){
  2197. $("#discountLvCard").css("display", "inline-block");
  2198. }
  2199. }
  2200. $("#crmType").text(res.crmTypeName);
  2201. })
  2202. postAjaxJsonHttpRequst("/thmz/queryWxmallPackagePurchasedItem",{patNo:patientId},true,function (res) {
  2203. if(res.code == 0 && res.data != null && res.data.length > 0){
  2204. $("#mallTcCard").css("display", "inline-block");
  2205. }
  2206. })
  2207. }
  2208. function closeMallTcDetailModal() {
  2209. $("#mallTcDetailModal").modal("hide");
  2210. }
  2211. //保存商城套餐处方
  2212. function saveMallTcOrder() {
  2213. let allSelecteds = $('#mall_tc_detail_table').bootstrapTable('getAllSelections');
  2214. if(allSelecteds == null && allSelecteds.length == 0){
  2215. errorMesageSimaple('请选择需要开具的商城项目!')
  2216. return
  2217. }
  2218. realSavePrescription(false,true);
  2219. }
  2220. //商城套餐
  2221. function openMallTc() {
  2222. $("#mallTcDetailModal").modal();
  2223. initMallTcDetailTable();
  2224. }
  2225. //初始化
  2226. function initMallTcDetailTable() {
  2227. let patNo = $("#patientId").text();
  2228. if(stringIsBlank(patNo)){
  2229. errorMesageSimaple("请先就诊!")
  2230. return
  2231. }
  2232. $('#mall_tc_detail_table').bootstrapTable("destroy");
  2233. $('#mall_tc_detail_table').bootstrapTable({
  2234. url: '/thmz/queryWxmallPackagePurchasedItem', //请求后台的URL(*)
  2235. method: 'post', //请求方式(*)
  2236. toolbar: '#toolbar', //工具按钮用哪个容器
  2237. striped: true, //是否显示行间隔色
  2238. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  2239. pagination: false, //是否显示分页(*)
  2240. sortable: true, //是否启用排序
  2241. sortOrder: "asc", //排序方式
  2242. // sortName: 'orderNo', //排序字段
  2243. queryParams: function () {
  2244. return {
  2245. patNo:patNo
  2246. }
  2247. }, //传递参数(*)
  2248. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  2249. pageNumber: 1, //初始化加载第一页,默认第一页
  2250. pageSize: 25, //每页的记录行数(*)
  2251. pageList: [25, 50, 75, 100], //可供选择的每页的行数(*)
  2252. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  2253. strictSearch: true,
  2254. showColumns: false, //是否显示所有的列
  2255. showRefresh: false, //是否显示刷新按钮
  2256. minimumCountColumns: 2, //最少允许的列数
  2257. clickToSelect: true, //是否启用点击选中行
  2258. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  2259. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  2260. cardView: false, //是否显示详细视图
  2261. detailView: false,
  2262. //rowStyle:rowStyle,//通过自定义函数设置行样式
  2263. ajaxOptions: {
  2264. headers: {
  2265. 'Accept': 'application/json',
  2266. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2267. }
  2268. },
  2269. columns: [
  2270. {
  2271. checkbox: true,
  2272. },
  2273. {
  2274. field: 'hisCode',
  2275. title: '项目编码',
  2276. align: "center",
  2277. valign: 'middle'
  2278. }, {
  2279. field: 'hisName',
  2280. title: '项目名称',
  2281. align: "center",
  2282. valign: 'middle',
  2283. }, {
  2284. field: 'quantity',
  2285. title: '购买的数量',
  2286. align: "center",
  2287. valign: 'middle',
  2288. },
  2289. {
  2290. field: 'usableQuantity',
  2291. title: '可使用数量',
  2292. align: "center",
  2293. valign: 'middle',
  2294. },{
  2295. field: 'originPrice',
  2296. title: '原价(元)',
  2297. align: "center",
  2298. valign: 'middle',
  2299. }, {
  2300. field: 'price',
  2301. title: '优惠单价(元)',
  2302. align: "center",
  2303. valign: 'middle',
  2304. },
  2305. {
  2306. field: 'costAmt',
  2307. title: '总价',
  2308. align: "center",
  2309. valign: 'middle'
  2310. }, {
  2311. field: 'type',
  2312. title: '项目类型',
  2313. align: "center",
  2314. valign: 'middle',
  2315. formatter: function (value, row, index) {
  2316. if (value == 'JY') {
  2317. return '检验';
  2318. }else if(value == 'JC'){
  2319. return '检查';
  2320. }
  2321. else if(value == 'ZL'){
  2322. return '诊疗';
  2323. }
  2324. return "";
  2325. }
  2326. }
  2327. , {
  2328. field: 'lastUseTime',
  2329. title: '最后使用时间',
  2330. align: "center",
  2331. valign: 'middle',
  2332. formatter: function (value, row, index) {
  2333. if (value != null && value != "") {
  2334. return format(value, "yyyy-MM-dd HH:mm:ss");
  2335. }
  2336. return "";
  2337. }
  2338. }
  2339. ],
  2340. responseHandler: function (res) {
  2341. if (res == '401' || res == 401) {
  2342. window.location.href = '/thmz/login/view'
  2343. return;
  2344. }
  2345. var ress = eval(res);
  2346. if (ress.code == -1) {
  2347. new PNotify({
  2348. title: '错误提示',
  2349. text: ress.message,
  2350. type: 'error',
  2351. hide: true,
  2352. styling: 'bootstrap3'
  2353. });
  2354. return {
  2355. "total": 0,//总页数
  2356. "rows": {} //数据
  2357. };
  2358. }
  2359. return {
  2360. //"total": ress.pageViewVo.total,//总页数
  2361. "rows": ress.data //数据
  2362. };
  2363. },
  2364. });
  2365. }
  2366. /**
  2367. * 判断是否是特门病人
  2368. * @param patientId
  2369. */
  2370. function setTmResponseType(patientId) {
  2371. postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":"","readCardResult":""},true,function (res) {
  2372. if (res == '401' || res == 401) {
  2373. window.location.href = '/thmz/login/view'
  2374. return;
  2375. }
  2376. if (res.code == 0) {
  2377. if (res.data != null && res.data.length > 0) {
  2378. $("#patientResponseType").html("特殊门诊");
  2379. $("#fetchSpcSlwinfo").css("display", "inline-block");
  2380. }
  2381. }
  2382. })
  2383. }
  2384. //删除股东卡身份
  2385. // function deleteShareholderCard() {
  2386. // let patientId = $("#patientId").text();
  2387. // if(stringIsBlank(patientId)){
  2388. // errorMesageSimaple("请先选择就诊病人")
  2389. // return
  2390. // }
  2391. // postAjaxJsonHttpRequst("/thmz/deleteShareholderCard",{patientId:patientId},true,function (res) {
  2392. // if(res.code ==0){
  2393. // $("#patientVisitType").text("");
  2394. // successMesageSimaple(res.message)
  2395. // }else {
  2396. // errorMesage(res)
  2397. // }
  2398. // })
  2399. // }
  2400. //慢病建档
  2401. function cmrCreate() {
  2402. $.ajax({
  2403. type: "GET",
  2404. url: '/thmz/getMzjsdHost',
  2405. dataType: "json",
  2406. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2407. success: function (res) {
  2408. if (res == '401' || res == 401) {
  2409. window.location.href = '/thmz/login/view'
  2410. return;
  2411. }
  2412. if (res.code == 0) {
  2413. let patientId = $("#patientId").text();
  2414. if(stringIsBlank(patientId)){
  2415. return errorMesageSimaple('门诊号不能为空,请先接诊')
  2416. }
  2417. getAjaxRequst("/thmz/getByPatientId",{patientId:patientId},true,function (ress) {
  2418. if(ress.code ==0){
  2419. let cmrType ;
  2420. let userIdCode = localStorage.getItem("userIdCode");
  2421. if(stringIsBlank($("#crmType").text())){
  2422. cmrType = '2'
  2423. }else {
  2424. cmrType = '1'
  2425. }
  2426. window.open(`${res.data}/outpatient/chronicDisease/chronicDiseaseRegister?socialNo=${ress.data.socialNo}&type=${cmrType}&userCode=${userIdCode}`, '_blank');
  2427. }
  2428. })
  2429. }
  2430. }
  2431. });
  2432. }
  2433. var curOpspDiseCode =null;
  2434. var curOpspDiseName =null;
  2435. function openFetchSpcSlwinfoModal() {
  2436. $("#fetchSpcSlwinfoModal").modal();
  2437. $("#fetchSpcSlwinfoTable").html(null);
  2438. clearOpspDiseData();
  2439. }
  2440. /**
  2441. * 清除特门数据
  2442. */
  2443. function clearOpspDiseData() {
  2444. curOpspDiseCode =null;
  2445. curOpspDiseName =null;
  2446. visitMtCardResult = null;
  2447. }
  2448. /**
  2449. * 关闭门特窗口
  2450. */
  2451. function closeFetchSpcSlwinfoModal() {
  2452. $("#fetchSpcSlwinfoModal").modal("hide");
  2453. clearOpspDiseData();
  2454. }
  2455. /**
  2456. * 特门详情
  2457. * @param patientId
  2458. */
  2459. function fetchSpcSlwinfo() {
  2460. let patientId = $("#patientId").text();
  2461. let visitAdvmCity = $("#visitAdvmCity").val();
  2462. postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":visitAdvmCity,"readCardResult":visitMtCardResult},true,function (res) {
  2463. if (res == '401' || res == 401) {
  2464. window.location.href = '/thmz/login/view'
  2465. return;
  2466. }
  2467. if (res.code == 0) {
  2468. if (res.data == null || res.data.length == 0 ){
  2469. errorMesageSimaple("该患者没有特门信息");
  2470. }
  2471. if (res.data != null && res.data.length > 0) {
  2472. for (var i = 0; i < res.data.length; i++) {
  2473. var begndate = res.data[i].begndate;
  2474. if (begndate == null || begndate == "null") {
  2475. begndate = "";
  2476. }
  2477. var enddate = res.data[i].enddate;
  2478. if (enddate == null || enddate == "null") {
  2479. enddate = "";
  2480. }
  2481. var opspDiseName = res.data[i].opspDiseName;
  2482. if (opspDiseName == null || opspDiseName == "null") {
  2483. opspDiseName = "";
  2484. }
  2485. var opspDiseCode = res.data[i].opspDiseCode;
  2486. if (opspDiseCode == null || opspDiseCode == "null") {
  2487. opspDiseCode = "";
  2488. }
  2489. var ideFixmedinsName = res.data[i].ideFixmedinsName;
  2490. if (ideFixmedinsName == null || ideFixmedinsName == "null") {
  2491. ideFixmedinsName = "";
  2492. }
  2493. $("<tr data-target-opspDiseCode='" + opspDiseCode + "' data-target-opspDiseName='" + opspDiseName + "' data-target-ideFixmedinsName='" + ideFixmedinsName + "'><td>" + begndate + "</td><td>" + enddate + "</td><td>" + opspDiseCode + "</td><td>" + opspDiseName + "</td><td>" + ideFixmedinsName + "</td></tr>").appendTo("#fetchSpcSlwinfoTable").bind('click',function () {
  2494. $("#fetchSpcSlwinfoModal").modal("hide");
  2495. curOpspDiseCode = $(this).attr("data-target-opspDiseCode");
  2496. curOpspDiseName = $(this).attr("data-target-opspDiseName");
  2497. //设置特殊门诊值
  2498. $("#mzOrderTypeSelect").val('3')
  2499. $('#mzOrderTypeSelect').selectpicker('refresh');
  2500. });
  2501. }
  2502. } else {
  2503. errorMesage(res);
  2504. }
  2505. } else {
  2506. errorMesage(res);
  2507. }
  2508. })
  2509. }
  2510. function initAdvmPro(proId) {
  2511. getAjaxRequst("/thmz/queryProvinceCodes",{},true,function (res) {
  2512. if(res.code == 0 && res.data !=null && res.data.length > 0){
  2513. let selectHtml = '';
  2514. for (let i=0 ; i <res.data.length; i++ ){
  2515. selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
  2516. }
  2517. $('#'+proId).html(selectHtml);
  2518. $('#'+proId).selectpicker('refresh');
  2519. $('#'+proId).val(430000);
  2520. $('#'+proId).selectpicker('refresh');
  2521. cityChange('visitAdvmPro','visitAdvmCity',430100)
  2522. }
  2523. })
  2524. }
  2525. function cityChange(proId,cityId,defalultVal) {
  2526. let code = $('#'+proId).val()
  2527. postAjaxJsonHttpRequst("/thmz/queryCityCodes",{code:code},true,function (res) {
  2528. if(res.code == 0 && res.data !=null && res.data.length > 0){
  2529. let selectHtml = '';
  2530. for (let i=0 ; i <res.data.length; i++ ){
  2531. selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
  2532. }
  2533. $('#'+cityId).html(selectHtml);
  2534. $('#'+cityId).selectpicker('refresh');
  2535. if(!stringIsBlank(defalultVal)){
  2536. $('#'+cityId).val(defalultVal);
  2537. $('#'+cityId).selectpicker('refresh');
  2538. }
  2539. }
  2540. })
  2541. }
  2542. var visitMtCardResult = null;
  2543. function readVisitPatientCard() {
  2544. $.ajax({
  2545. type: "GET",
  2546. // url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
  2547. url: 'http://localhost:8321/api/entry?param=jiangsu_qrcode_01101',
  2548. contentType: "application/json;charset=UTF-8",
  2549. dataType: "json",
  2550. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2551. success: function (res) {
  2552. if (res == '401' || res == 401) {
  2553. window.location.href = '/thmz/login/view'
  2554. return;
  2555. }
  2556. if (res.code == 200) {
  2557. visitMtCardResult = res.data
  2558. fetchSpcSlwinfo()
  2559. } else {
  2560. errorMesage(res);
  2561. }
  2562. }
  2563. });
  2564. }
  2565. /**
  2566. * 初诊的时候设置患者生命体征
  2567. * @param res
  2568. */
  2569. function setMzSmtz(res) {
  2570. var mzYshTzxx = res.mzYshTzxx;
  2571. if (mzYshTzxx != null) {
  2572. if (mzYshTzxx.valueTz != null) {
  2573. $("#weight").val(mzYshTzxx.valueTz);
  2574. }
  2575. if (mzYshTzxx.valueTw != null) {
  2576. $("#temperature").val(mzYshTzxx.valueTw);
  2577. }
  2578. if (mzYshTzxx.valueMb != null) {
  2579. $("#sphygmus").val(mzYshTzxx.valueMb);
  2580. }
  2581. if (mzYshTzxx.valueHx != null) {
  2582. $("#breathe").val(mzYshTzxx.valueHx);
  2583. }
  2584. if (mzYshTzxx.valueSsy != null) {
  2585. $("#pressure_high").val(mzYshTzxx.valueSsy);
  2586. }
  2587. if (mzYshTzxx.valueSzy != null) {
  2588. $("#pressure_floor").val(mzYshTzxx.valueSzy);
  2589. }
  2590. }
  2591. }
  2592. /**
  2593. * 真实的接诊方法
  2594. * @param patientId
  2595. * @param serialNo 分诊流水号
  2596. * @param reqType 号表类别
  2597. */
  2598. function realClinicalReception(patientId, serialNo, reqType) {
  2599. var turnToConsultationIdInClick = $("#turnToConsultationIdInClick").val();
  2600. if (turnToConsultationIdInClick == null || turnToConsultationIdInClick == "null") {
  2601. turnToConsultationIdInClick = 0;
  2602. }
  2603. var userIdCode = localStorage.getItem("userIdCode");
  2604. var deptNo = localStorage.getItem(userIdCode);
  2605. if (deptNo == null) {
  2606. deptNo = "";
  2607. }
  2608. $.ajax({
  2609. type: "GET",
  2610. url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick + "&deptNo=" + deptNo,
  2611. contentType: "application/json;charset=UTF-8",
  2612. dataType: "json",
  2613. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2614. success: function (res) {
  2615. if (res == '401' || res == 401) {
  2616. window.location.href = '/thmz/login/view'
  2617. return;
  2618. }
  2619. if (res.code == 0) {
  2620. if (res.data != null) {
  2621. setMzReqType(null,null,reqType);
  2622. var mzPatientMi = res.data;
  2623. setMzPatientInfo(mzPatientMi);
  2624. setMzSmtz(res);
  2625. $("#identityNo").val(mzPatientMi.socialNo);
  2626. $("#visitCardNo").val(mzPatientMi.icCardNo);
  2627. $("#birthDay").val(mzPatientMi.birthDay);
  2628. $("#sex").val(mzPatientMi.sex);
  2629. $("#mobile").val(mzPatientMi.phoneNo);
  2630. // tb_table_un_clinic
  2631. $("#mzfzSerialNoInClick").val(serialNo);
  2632. $("#mzfzReqTypeNoInClick").val(reqType);
  2633. //有分诊流水号 且 不是简易门诊 或 会诊目标科室接诊
  2634. if (serialNo != null && serialNo != "null") {
  2635. if (!(reqType == "16" || reqType == 16 || reqType == -200)) {
  2636. $("#transferTreatment").css("display", "inline-block");
  2637. }
  2638. $("#consultation").css("display", "inline-block");
  2639. }
  2640. notFirstYX02 = false
  2641. hasJcInYx = false
  2642. viewRecordId = null;
  2643. jcItemList = null;
  2644. //加载候诊患者列表
  2645. loadUnClinicTableList();
  2646. //加载接诊中患者列表
  2647. loadInClinicTableList();
  2648. //查询患者的门诊统筹信息
  2649. // queryInsuinfo(patientId);
  2650. }
  2651. } else {
  2652. errorMesage(res);
  2653. }
  2654. }
  2655. });
  2656. }
  2657. /**
  2658. * 查询患者的门诊统筹信息
  2659. * @param patientId
  2660. */
  2661. function queryInsuinfo(patientId) {
  2662. getAjaxRequst("/thmz/queryInsuinfo",{patientId: patientId},true,function (insurRes) {
  2663. if(insurRes.code == 0){
  2664. var ybCode = localStorage.getItem("ybCode");
  2665. if(ybCode !=null && ybCode !="" && ybCode.length > 0){
  2666. $("#zgmztczf").selectpicker('val',1);
  2667. $("#zgmztczf").selectpicker('refresh');
  2668. if($("#mzOrderTypeSelect").val() !='4'){
  2669. $("#mzOrderTypeSelect").selectpicker('val','2');
  2670. $("#mzOrderTypeSelect").selectpicker('refresh');
  2671. }else {
  2672. $("#zgmztczf").selectpicker('val',0);
  2673. $("#zgmztczf").selectpicker('refresh');
  2674. }
  2675. postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
  2676. if(res.code ==0){
  2677. if(!stringIsBlank(res.data)){
  2678. warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
  2679. }
  2680. }
  2681. })
  2682. }else {
  2683. $("#zgmztczf").selectpicker('val',0);
  2684. $("#zgmztczf").selectpicker('refresh');
  2685. }
  2686. }else if(insurRes.code == -1){
  2687. errorMesageSimaple(insurRes.message);
  2688. }else if(insurRes.code == -2){
  2689. warningMesageSimaple(insurRes.message);
  2690. }
  2691. })
  2692. }
  2693. /**
  2694. * 读医保电子凭证
  2695. * @param asyncFlag true 异步 false 同步
  2696. * @param params
  2697. */
  2698. function mztczfSiReadCard(asyncFlag, params) {
  2699. mztczfSiReadCardStatus = true;
  2700. $.ajax({
  2701. type: "GET",
  2702. url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
  2703. contentType: "application/json;charset=UTF-8",
  2704. dataType: "json",
  2705. async: asyncFlag,
  2706. headers: {
  2707. 'Accept': 'application/json',
  2708. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2709. },
  2710. success: function (res) {
  2711. mztczfSiReadCardStatus = false;
  2712. if (res == '401' || res == 401) {
  2713. window.location.href = '/thmz/login/view'
  2714. return;
  2715. }
  2716. //console.log(res);
  2717. if (res.code == 200) {
  2718. var data = JSON.parse(res.data);
  2719. $("#readCardResult").val(JSON.stringify(data.data));
  2720. $("#messageContent").html("读卡成功,是否保存处方?");
  2721. } else {
  2722. $("#messageContent").html("读卡失败,是否保存处方(不享受门诊统筹)?");
  2723. errorMesage(res);
  2724. }
  2725. },
  2726. error: function (XMLHttpRequest, textStatus, errorThrown) {
  2727. mztczfSiReadCardStatus = false;
  2728. $("#messageContent").html("读卡异常,是否保存处方(不享受门诊统筹)?");
  2729. }
  2730. });
  2731. }
  2732. /**
  2733. * 实际读医保电子凭证
  2734. * @param asyncFlag true 异步 false 同步
  2735. */
  2736. function realMztczfSiReadCard(asyncFlag) {
  2737. }
  2738. /**
  2739. * 清空工作台
  2740. */
  2741. function clearWorkSpace() {
  2742. clearUser(true);
  2743. clearWorkSpaceExcludeUser(1);
  2744. }
  2745. /**
  2746. * 清空工作台除了用户信息
  2747. * @param source 1 清空工作台 2 调用模板 3 调用历史处方
  2748. */
  2749. function clearWorkSpaceExcludeUser(source) {
  2750. var conciseRecordsFlag = false;
  2751. if (source == 2) {
  2752. conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
  2753. } else if (source == 3) {
  2754. conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
  2755. }
  2756. if (source == 1 || conciseRecordsFlag) {
  2757. $("#symptom").val(null);
  2758. $("#emrHpi").val(null);
  2759. $("#emrPs").val(null);
  2760. $("#personalHistory").val(null);
  2761. $("#familyHistory").val(null);
  2762. $("#fzZl").val(null);
  2763. $("#crbHistory").val(null);
  2764. $("#obstericalHistory").val(null);
  2765. $("#weight").val(null);
  2766. $("#temperature").val(null);
  2767. $("#sphygmus").val(null);
  2768. $("#breathe").val(null);
  2769. $("#pressure_high").val(null);
  2770. $("#pressure_floor").val(null);
  2771. $("#pressure_high_left").val(null);
  2772. $("#pressure_floor_left").val(null);
  2773. $("#tentativeDiagnosis").val(null);
  2774. $("#otherCheck").val(null);
  2775. $("#diagnoseValue").val(null);
  2776. $("#diagnoseTags").html(null);
  2777. $("#tcmDiagnoseValue").val(null);
  2778. $("#tcmDiagnoseTags").html(null);
  2779. $("#healthEducation").val(null);
  2780. $("#zdAllergen").selectpicker('val', null);
  2781. $("#zdAllergen").selectpicker('refresh');
  2782. $("#ypDitList").selectpicker('val', null);
  2783. $("#ypDitList").selectpicker('refresh');
  2784. }
  2785. //清空工作台的时候需要调用
  2786. if (source == 1) {
  2787. clearWesternMedicine(true);
  2788. clearChineseMedicine();
  2789. clearJyJcItem();
  2790. clearZlItem();
  2791. clearZyReq();
  2792. //initNavTabs(0);
  2793. clearNavTabs(0);
  2794. clearNavTabs(1);
  2795. clearNavTabs(2);
  2796. clearNavTabs(3);
  2797. clearNavTabs(4);
  2798. clearNavTabs(5);
  2799. clearNavTabs(6);
  2800. clearApidAcceptsModal();
  2801. clearTurnToConsultationInput();
  2802. clearZgtczfInput();
  2803. clearOpspDiseData();
  2804. clearExpContentRequired();
  2805. gropuIdAndOrderNoMap = null;
  2806. //prevCategoriesFlag = null;
  2807. initGroupOrder();
  2808. localStorage.removeItem("currentDeptNo");
  2809. getResultUrl = null;
  2810. }
  2811. $("#totalAmount").text(0);
  2812. }
  2813. /**
  2814. * 构造西药处方详情和模板预览方法
  2815. * @param pyPrescription
  2816. * @param contentId 内容ID
  2817. * @param titleId 标题ID
  2818. * @param checkBox 是否需要增加ckeckBox
  2819. */
  2820. function fitxyContent(pyPrescription, contentId, titleId, checkBox) {
  2821. if (pyPrescription != null && pyPrescription.length > 0) {
  2822. var xypyHtml = "";
  2823. for (var i = 0; i < pyPrescription.length; i++) {
  2824. var py = pyPrescription[i];
  2825. if (py == null || py.length == 0) {
  2826. continue;
  2827. }
  2828. var detail = py.detail;
  2829. if (detail == null || detail.length == 0) {
  2830. continue;
  2831. }
  2832. for (var j = 0; j < detail.length; j++) {
  2833. var pyDetail = detail[j];
  2834. if (checkBox) {
  2835. xypyHtml += "<div style='cursor: pointer;' data-id='" + pyDetail.orderCode + "'>";
  2836. xypyHtml += "<input type='checkbox'/>";
  2837. xypyHtml += "<span onclick='rowDataClick(this)'>";
  2838. } else {
  2839. xypyHtml += "<div>";
  2840. }
  2841. xypyHtml += "<span style='color: red;'>" + pyDetail.groupOrder + "." + "</span>";
  2842. xypyHtml += pyDetail.name;
  2843. xypyHtml += " ";
  2844. xypyHtml += pyDetail.specification;
  2845. xypyHtml += " X ";
  2846. xypyHtml += pyDetail.quantity;
  2847. xypyHtml += pyDetail.packUnit;
  2848. xypyHtml += " 用法: ";
  2849. xypyHtml += pyDetail.supplyName;
  2850. xypyHtml += " ";
  2851. xypyHtml += pyDetail.drugQuan;
  2852. xypyHtml += pyDetail.unitDesc;
  2853. xypyHtml += " ";
  2854. xypyHtml += pyDetail.frequency;
  2855. xypyHtml += " ";
  2856. xypyHtml += pyDetail.orderDays;
  2857. xypyHtml += "天 ";
  2858. if (pyDetail.tryFlag != undefined && pyDetail.tryFlag != null && pyDetail.tryFlag != "null" && pyDetail.tryFlag != "") {
  2859. xypyHtml += pyDetail.tryFlag;
  2860. } else if (pyDetail.tryResult != undefined && pyDetail.tryResult != null && pyDetail.tryResult != "null" && pyDetail.tryResult != "") {
  2861. xypyHtml += pyDetail.tryResult;
  2862. }
  2863. if (checkBox) {
  2864. xypyHtml += "</span>";
  2865. }
  2866. xypyHtml += "</div>";
  2867. }
  2868. }
  2869. afterFitContent(contentId, xypyHtml, titleId);
  2870. } else {
  2871. $("#" + titleId).removeClass("in").addClass("hide");
  2872. $("#" + contentId).html("");
  2873. }
  2874. }
  2875. /**
  2876. * 构造中药处方详情和模板预览方法
  2877. * @param zyPrescription
  2878. * @param contentId 内容ID
  2879. * @param titleId 标题ID
  2880. * @param checkBox 是否需要增加ckeckBox
  2881. */
  2882. function fitzyContent(zyPrescription, contentId, titleId, checkBox) {
  2883. if (zyPrescription == null || zyPrescription.length == 0) {
  2884. $("#" + titleId).removeClass("in").addClass("hide");
  2885. $("#" + contentId).html("");
  2886. return;
  2887. }
  2888. var zyDetail = zyPrescription[0];
  2889. if (zyDetail == null || zyDetail.length == 0) {
  2890. $("#" + titleId).removeClass("in").addClass("hide");
  2891. $("#" + contentId).html("");
  2892. return;
  2893. }
  2894. var detail = zyDetail.detail;
  2895. if (detail == null || detail.length == 0) {
  2896. $("#" + titleId).removeClass("in").addClass("hide");
  2897. $("#" + contentId).html("");
  2898. return;
  2899. }
  2900. var zypyHtml = "";
  2901. for (var i = 0; i < detail.length; i++) {
  2902. //zypyHtml += '<div class="item form-group" style="margin-bottom: -5px;">';
  2903. var zy = detail[i];
  2904. if (zy == null || zy.length == 0) {
  2905. continue;
  2906. }
  2907. if (checkBox) {
  2908. zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\" style='cursor: pointer;' data-id='" + zy.orderCode + "'>";
  2909. zypyHtml += "<input type='checkbox'/>";
  2910. zypyHtml += "<span onclick='rowDataClick(this)'>";
  2911. } else {
  2912. zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\">";
  2913. }
  2914. zypyHtml += zy.name;
  2915. if(zy.spec){
  2916. zypyHtml += "("+zy.spec+")";
  2917. }
  2918. var instructionText = zy.instructionText;
  2919. if (instructionText != null && instructionText != "") {
  2920. zypyHtml += "[";
  2921. zypyHtml += instructionText;
  2922. zypyHtml += "]";
  2923. }
  2924. zypyHtml += zy.quantity;
  2925. if(zyDetail.groupNo =='83'){
  2926. zypyHtml += "袋";
  2927. }else {
  2928. zypyHtml += "g";
  2929. }
  2930. if (checkBox) {
  2931. zypyHtml += "</span>";
  2932. }
  2933. zypyHtml += "</div>";
  2934. // if (i % 4 == 0) {
  2935. // zypyHtml += '</div>';
  2936. // }
  2937. }
  2938. // if(detail.length%4!=0){
  2939. // for(var i=0;i<4-(detail.length%4);i++){
  2940. // zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\"></div>";
  2941. // }
  2942. // }
  2943. var zyfs = zyDetail.zyfs;
  2944. if (zyfs != null && zyfs != "") {
  2945. zypyHtml += " <div class=\"col-md-12 col-sm-12 col-xs-12\">";
  2946. zypyHtml += ' <div style="text-indent: 2em;">';
  2947. zypyHtml += ' <div>';
  2948. zypyHtml += 'x<span>';
  2949. zypyHtml += zyfs;
  2950. zypyHtml += '</span> 付</div>';
  2951. }
  2952. afterFitContent(contentId, zypyHtml, titleId);
  2953. }
  2954. /**
  2955. * 构造辅助检查、检验处方详情和模板预览方法
  2956. * @param jcjyPrescription
  2957. * @param contentId 内容ID
  2958. * @param titleId 标题ID
  2959. * @param checkBox 是否需要增加ckeckBox
  2960. */
  2961. function fitJcjyContent(jcjyPrescription, contentId, titleId, checkBox) {
  2962. if (jcjyPrescription == null || jcjyPrescription.length == 0) {
  2963. $("#" + titleId).removeClass("in").addClass("hide");
  2964. $("#" + contentId).html("");
  2965. return;
  2966. }
  2967. var jcjyDetail = jcjyPrescription[0];
  2968. if (jcjyDetail == null || jcjyDetail.length == 0) {
  2969. $("#" + titleId).removeClass("in").addClass("hide");
  2970. $("#" + contentId).html("");
  2971. return;
  2972. }
  2973. var detail = jcjyDetail.detail;
  2974. if (detail == null || detail.length == 0) {
  2975. $("#" + titleId).removeClass("in").addClass("hide");
  2976. $("#" + contentId).html("");
  2977. return;
  2978. }
  2979. var jcjyHtml = "";
  2980. for (var i = 0; i < detail.length; i++) {
  2981. var jcjy = detail[i];
  2982. if (jcjy == null || jcjy.length == 0) {
  2983. continue;
  2984. }
  2985. if (checkBox) {
  2986. jcjyHtml += "<div style='cursor: pointer;' data-id='" + jcjy.orderCode + "'>";
  2987. jcjyHtml += "<input type='checkbox'/>";
  2988. jcjyHtml += "<span onclick='rowDataClick(this)'>";
  2989. } else {
  2990. jcjyHtml += "<div>";
  2991. }
  2992. jcjyHtml += jcjy.index + ".";
  2993. jcjyHtml += jcjy.name;
  2994. var drugUnit = jcjy.drugUnit;
  2995. if (drugUnit == undefined || drugUnit == null || drugUnit == "") {
  2996. drugUnit = "";
  2997. }
  2998. var drugQuan = jcjy.drugQuan;
  2999. if (drugQuan != undefined && drugQuan != null && drugQuan != "") {
  3000. jcjyHtml += " 单量:" + drugQuan + drugUnit;
  3001. }
  3002. var orderDays = jcjy.orderDays;
  3003. if (orderDays != undefined && orderDays != null && orderDays != "") {
  3004. jcjyHtml += " 天数:" + orderDays + "天";
  3005. }
  3006. var frequency = jcjy.frequency;
  3007. if (frequency != undefined && frequency != null && frequency != "") {
  3008. jcjyHtml += " 频次:" + frequency;
  3009. }
  3010. var quantity = jcjy.quantity;
  3011. if (quantity != undefined && quantity != null && quantity != "") {
  3012. jcjyHtml += " 总量:" + quantity + drugUnit;
  3013. }
  3014. if (checkBox) {
  3015. jcjyHtml += "</span>";
  3016. }
  3017. jcjyHtml += "</div>";
  3018. }
  3019. afterFitContent(contentId, jcjyHtml, titleId);
  3020. }
  3021. /**
  3022. * 构造入院处方详情和模板预览方法
  3023. * @param jcjyPrescription
  3024. * @param contentId 内容ID
  3025. * @param titleId 标题ID
  3026. * @param checkBox 是否需要增加ckeckBox
  3027. */
  3028. function fitZyReqContent(zyReqPrescription, contentId, titleId, checkBox) {
  3029. if (zyReqPrescription == null || zyReqPrescription.length == 0) {
  3030. $("#" + titleId).removeClass("in").addClass("hide");
  3031. $("#" + contentId).html("");
  3032. return;
  3033. }
  3034. var zyReqHtml = "";
  3035. if (checkBox) {
  3036. zyReqHtml += "<div style='cursor: pointer;'>";
  3037. zyReqHtml += "<input type='checkbox'/>";
  3038. zyReqHtml += "<span onclick='rowDataClick(this)'>";
  3039. } else {
  3040. zyReqHtml += "<div>";
  3041. }
  3042. zyReqHtml += "收住院 [";
  3043. zyReqHtml += zyReqPrescription.reqDept;
  3044. if (zyReqPrescription.smallDept != null && zyReqPrescription.smallDept != "") {
  3045. zyReqHtml += "(" + zyReqPrescription.smallDept + ")";
  3046. }
  3047. zyReqHtml += "]";
  3048. if (zyReqPrescription.admissStatus != null && zyReqPrescription.admissStatus != "") {
  3049. zyReqHtml += zyReqPrescription.admissStatus;
  3050. }
  3051. if (zyReqPrescription.conditionCode != null && zyReqPrescription.conditionCode != "") {
  3052. zyReqHtml += " " + zyReqPrescription.conditionCode;
  3053. }
  3054. if (zyReqPrescription.routeOfAdmission != null && zyReqPrescription.routeOfAdmission != "") {
  3055. zyReqHtml += " " + zyReqPrescription.routeOfAdmission;
  3056. }
  3057. zyReqHtml += " 侯床";
  3058. if (checkBox) {
  3059. zyReqHtml += "</span>";
  3060. }
  3061. zyReqHtml += "</div>";
  3062. afterFitContent(contentId, zyReqHtml, titleId);
  3063. }
  3064. /**
  3065. * 构造门诊外配药处方详情和模板预览方法
  3066. * @param wpMedicinePrescription
  3067. * @param contentId 内容ID
  3068. * @param titleId 标题ID
  3069. * @param checkBox 是否需要增加ckeckBox
  3070. */
  3071. function fitWpMedicineContent(wpMedicinePrescription, contentId, titleId, checkBox) {
  3072. if (wpMedicinePrescription == null || wpMedicinePrescription.length == 0) {
  3073. $("#" + titleId).removeClass("in").addClass("hide");
  3074. $("#" + contentId).html("");
  3075. return;
  3076. }
  3077. var wpMedicineHtml = "";
  3078. for (var i = 0; i < wpMedicinePrescription.length; i++) {
  3079. var wpMedicine = wpMedicinePrescription[i];
  3080. if (wpMedicine == null || wpMedicine.length == 0) {
  3081. continue;
  3082. }
  3083. if (checkBox) {
  3084. wpMedicineHtml += "<div style='cursor: pointer;' data-id='" + wpMedicine.code + "'>";
  3085. wpMedicineHtml += "<input type='checkbox'/>";
  3086. wpMedicineHtml += "<span onclick='rowDataClick(this)'>";
  3087. } else {
  3088. wpMedicineHtml += "<div>";
  3089. }
  3090. wpMedicineHtml += "<span style='color: red;'>" + (i+1) + "." + "</span>";
  3091. wpMedicineHtml += wpMedicine.name;
  3092. wpMedicineHtml += " ";
  3093. wpMedicineHtml += wpMedicine.drugSpec;
  3094. wpMedicineHtml += " X ";
  3095. wpMedicineHtml += wpMedicine.drugCnt;
  3096. wpMedicineHtml += wpMedicine.drugDosunt;
  3097. wpMedicineHtml += " 用法 ";
  3098. wpMedicineHtml += wpMedicine.medcWayDscr;
  3099. wpMedicineHtml += " ";
  3100. wpMedicineHtml += wpMedicine.sinDoscnt;
  3101. wpMedicineHtml += wpMedicine.sinDosunt;
  3102. wpMedicineHtml += " ";
  3103. wpMedicineHtml += wpMedicine.usedFrquName;
  3104. wpMedicineHtml += " ";
  3105. wpMedicineHtml += wpMedicine.medcDays;
  3106. wpMedicineHtml += "天";
  3107. if (checkBox) {
  3108. wpMedicineHtml += "</span>";
  3109. }
  3110. wpMedicineHtml += "</div>";
  3111. }
  3112. afterFitContent(contentId, wpMedicineHtml, titleId);
  3113. }
  3114. /**
  3115. * 构造门诊手术处方详情和模板预览方法
  3116. * @param jcjyPrescription
  3117. * @param contentId 内容ID
  3118. * @param titleId 标题ID
  3119. * @param checkBox 是否需要增加ckeckBox
  3120. */
  3121. function fitOpRecordContent(opRecordPrescription, contentId, titleId, checkBox) {
  3122. if (opRecordPrescription == null || opRecordPrescription.length == 0) {
  3123. $("#" + titleId).removeClass("in").addClass("hide");
  3124. $("#" + contentId).html("");
  3125. return;
  3126. }
  3127. var opHtml = "";
  3128. for (var i = 0; i < opRecordPrescription.length; i++) {
  3129. var opRecord = opRecordPrescription[i];
  3130. if (opRecord == null || opRecord.length == 0) {
  3131. continue;
  3132. }
  3133. if (checkBox) {
  3134. opHtml += "<div style='cursor: pointer;' data-id='" + opRecord.opCode + "'>";
  3135. opHtml += "<input type='checkbox'/>";
  3136. opHtml += "<span onclick='rowDataClick(this)'>";
  3137. } else {
  3138. opHtml += "<div>";
  3139. }
  3140. opHtml += opRecord.opName;
  3141. var urgentClinicFlag = opRecord.urgentClinicFlag;
  3142. if (urgentClinicFlag != undefined && urgentClinicFlag != null && urgentClinicFlag != "") {
  3143. opHtml += " 急诊标志:" + urgentClinicFlag;
  3144. }
  3145. var ssbc = opRecord.ssbc;
  3146. if (ssbc != undefined && ssbc != null && ssbc != "") {
  3147. opHtml += " 班次:" + ssbc;
  3148. }
  3149. var partName = opRecord.partName;
  3150. if (partName != undefined && partName != null && partName != "") {
  3151. opHtml += " 手术部位:" + partName;
  3152. }
  3153. var opScale = opRecord.opScale;
  3154. if (opScale != undefined && opScale != null && opScale != "") {
  3155. opHtml += " 手术等级:" + opScale;
  3156. }
  3157. var hocusCode = opRecord.hocusCode;
  3158. if (hocusCode != undefined && hocusCode != null && hocusCode != "") {
  3159. opHtml += " 麻醉方式:" + hocusCode;
  3160. }
  3161. var doctorZd = opRecord.doctorZd;
  3162. if (doctorZd != undefined && doctorZd != null && doctorZd != "") {
  3163. opHtml += " 主刀医生:" + doctorZd;
  3164. }
  3165. if (checkBox) {
  3166. opHtml += "</span>";
  3167. }
  3168. opHtml += "</div>";
  3169. }
  3170. afterFitContent(contentId, opHtml, titleId);
  3171. }
  3172. /**
  3173. * 处方详情构造方法后续事件,如所有的复选框默认勾选
  3174. * @param contentId
  3175. * @param zyReqHtml
  3176. * @param titleId
  3177. */
  3178. function afterFitContent(contentId, zyReqHtml, titleId) {
  3179. $("#" + contentId).html(zyReqHtml);
  3180. $("#" + titleId).removeClass("hide").addClass("in");
  3181. //是否默认勾选处方回调
  3182. var checkboxFlag = localStorage.getItem("checkboxFlag");
  3183. if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
  3184. $("#" + titleId).find("input[type='checkbox']").prop("checked", true);
  3185. $("#" + contentId).find("input[type='checkbox']").each(function (index, obj) {
  3186. $(obj).prop("checked", true);
  3187. });
  3188. } else {
  3189. $("#" + titleId).find("input[type='checkbox']").prop("checked", false);
  3190. }
  3191. }
  3192. /**
  3193. * 模板、详情页行数据点击事件
  3194. * @param obj
  3195. */
  3196. function rowDataClick(obj) {
  3197. $(obj).prev().click();
  3198. }
  3199. /**
  3200. * 模板、详情页治疗分类标题点击事件
  3201. * @param obj
  3202. * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
  3203. */
  3204. function titleClick(obj, source) {
  3205. var contentObj = $(obj).parent().next();
  3206. var check = $(obj).prop("checked");
  3207. if (source == 0) {
  3208. var prev = $(obj).prev();
  3209. check = !$(prev).prop("checked");
  3210. $(prev).prop("checked", check)
  3211. }
  3212. if (contentObj != null) {
  3213. $(contentObj).children().each(function (index, object) {
  3214. //以下两个方法,单独调用一个可能不行
  3215. $(object).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
  3216. });
  3217. }
  3218. }
  3219. /**
  3220. * 开单互认提醒服务
  3221. * @param
  3222. * @param
  3223. */
  3224. function HR02(jyItemArr) {
  3225. let identityTypeCode = handleIdentityTypeCode($("#rapidAcceptsUserCertificateType").val())
  3226. let diagCode = []
  3227. let diagName = []
  3228. $("#diagnoseTags").children("span").each(function() {
  3229. var title = $(this).attr("title");
  3230. var id = $(this).attr("id");
  3231. diagCode.push(id)
  3232. diagName.push(title)
  3233. // console.log("Span - ID: " + id + ", Title: " + title);
  3234. });
  3235. // return
  3236. let params = {
  3237. url: 'http://20.46.201.94:9999/pmemr/productMutualRecognition/checkApply',
  3238. reqBody: {
  3239. " messages": {
  3240. "EVN": {
  3241. "eventTypeCode": "02",
  3242. "eventTypeName": "开单互认提醒服务"
  3243. },
  3244. "PID": {
  3245. "patientId": $("#patientId").text(),
  3246. "identityTypeCode": identityTypeCode,
  3247. "identityNo": $("#identityNo").val(),
  3248. "visitCardTypeCode": "94", // 院内就诊卡
  3249. "visitCardNo": $("#visitCardNo").val(),
  3250. "personalName": $("#patientName").text(),
  3251. "birthDate": formatDateToDate8(new Date(($("#birthDay").val()))),
  3252. "sexCode": $("#sex").val(),
  3253. "mobile": $("#mobile").val()
  3254. },
  3255. "PV1": {
  3256. "visitTypeCode": "1", //门诊
  3257. "visitNo": $("#mzfzSerialNoInClick").val(),
  3258. "visitDate": formatDateToDate8(new Date()),
  3259. "orgCode": "321322049",
  3260. "orgName": "沭阳铭和医院",
  3261. "deptCode": $("#deptCode").val(),
  3262. "deptName": $("#deptName").val(),
  3263. "wardCode": "",
  3264. "wardName": "",
  3265. "bedNo": "",
  3266. "doctorId": localStorage.getItem("userID"),
  3267. "doctorName": localStorage.getItem("userName"),
  3268. "doctorIdentityNo": localStorage.getItem("socialNo"),
  3269. "computerMac": "",
  3270. "computerIp": ""
  3271. },
  3272. "DG1":{
  3273. "chiefCompliant": $("#symptom").val(),
  3274. "diagCode": diagCode.join(","),
  3275. "diagName": diagName.join(",")
  3276. },
  3277. "OBR": {
  3278. "lab": jyItemArr
  3279. },
  3280. "closeMethod": "", //0 跳转固定页blank.html
  3281. "closeReminder": "" //1:关闭互认有效期内本院报告提醒,不传参数则默认提醒
  3282. }
  3283. }
  3284. }
  3285. $.ajax({
  3286. type: "POST",
  3287. url: '/thmz/JyYunAPI',
  3288. contentType: "application/json;charset=UTF-8",
  3289. dataType: "json",
  3290. data: JSON.stringify(params),
  3291. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3292. success: function (res) {
  3293. if (res == '401' || res == 401) {
  3294. window.location.href = '/thmz/login/view'
  3295. return;
  3296. }
  3297. if (res.code == 0) {
  3298. } else {
  3299. errorMesage(res);
  3300. }
  3301. }
  3302. });
  3303. }
  3304. /**
  3305. * 处方明细复选框点击事件
  3306. * @param obj
  3307. * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
  3308. */
  3309. function prescriptionCfmxChosice(obj, source) {
  3310. var check = $(obj).prop("checked");
  3311. if (source == 0) {
  3312. var prev = $(obj).prev();
  3313. check = !$(prev).prop("checked");
  3314. //以下两个方法,单独调用一个可能不行
  3315. $(prev).prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
  3316. }
  3317. var conents = $(obj).parent().parent().nextAll();
  3318. if (conents == null || conents.length == 0) {
  3319. return;
  3320. }
  3321. $(conents).each(function (index, object) {
  3322. //以下两个方法,单独调用一个可能不行
  3323. $(object).find("div:eq(0)").find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
  3324. var contentObj = $(object).find("div:eq(1)");
  3325. if (contentObj != null) {
  3326. $(contentObj).children().each(function (contentIndex, contentObject) {
  3327. $(contentObject).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
  3328. });
  3329. }
  3330. });
  3331. }
  3332. /**
  3333. * 简明病历标题点击事件
  3334. * @param obj
  3335. */
  3336. function prescriptionJmblChosice(obj) {
  3337. var prev = $(obj).prev();
  3338. var check = !$(prev).prop("checked");
  3339. $(prev).prop("checked", check); //如果鼠标点击选中了,执行后可以取消选中
  3340. }
  3341. /**
  3342. * 医疗范文详情预览
  3343. * @param id
  3344. */
  3345. function medicalModelModal(id) {
  3346. closeObjectWebui(false);
  3347. //是否默认勾选处方回调
  3348. var checkboxFlag = localStorage.getItem("checkboxFlag");
  3349. if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
  3350. $("#conciseRecordsYlfw").prop("checked", true);
  3351. $("#prescriptionSubsidiaryYlfw").prop("checked", true);
  3352. } else {
  3353. $("#conciseRecordsYlfw").prop("checked", false);
  3354. $("#prescriptionSubsidiaryYlfw").prop("checked", false);
  3355. }
  3356. $.ajax({
  3357. type: "GET",
  3358. url: '/thmz/getTemplateById?id=' + id,
  3359. contentType: "application/json;charset=UTF-8",
  3360. dataType: "json",
  3361. async: false,
  3362. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3363. success: function (res) {
  3364. if (res == '401' || res == 401) {
  3365. window.location.href = '/thmz/login/view'
  3366. return;
  3367. }
  3368. if (res.code == 0) {
  3369. var jsonData = JSON.parse(res.data.templateData);
  3370. $("#vmedicalModelName").text(res.data.name);
  3371. $("#idTemplate").val(res.data.id);
  3372. $("#zsTemplate").html(jsonData.mzBlRecord.emrChiefComplaint);
  3373. $("#xbsTemplate").html(jsonData.mzBlRecord.emrHpi);
  3374. $("#tgjcTemplate").html(jsonData.mzBlRecord.emrPe);
  3375. $("#jkjyTemplate").html(jsonData.mzBlRecord.emrJkjy);
  3376. var icdText = res.data.icdText;
  3377. $("#zdTemplate").html("");
  3378. $("#xypyContent").html("");
  3379. $("#xymjContent").html("");
  3380. $("#xyjeContent").html("");
  3381. $("#yczlContent").html("");
  3382. $("#zyzlContent").html("");
  3383. $("#zlyjContent").html("");
  3384. if (icdText != null) {
  3385. var arr = icdText.split(",");
  3386. var html = "";
  3387. for (var i = 0; i < arr.length; i++) {
  3388. if (i == 0) {
  3389. html += ' <div class="tagZdy tagZdy-back">';
  3390. } else {
  3391. html += ' <div class="tagZdy tagZdy-back-green">';
  3392. }
  3393. html += arr[i];
  3394. html += '</div>';
  3395. }
  3396. $("#zdTemplate").html(html);
  3397. }
  3398. var prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
  3399. if (prescriptionDetail != null && prescriptionDetail != "") {
  3400. prescriptionDetail = JSON.parse(prescriptionDetail);
  3401. var xyPrescription = prescriptionDetail.xyPrescription;
  3402. if (xyPrescription != null) {
  3403. fitxyContent(xyPrescription.pyPrescription, "xypyContent", "xypyTitle", true);
  3404. fitxyContent(xyPrescription.mjPrescription, "xymjContent", "xymjTitle", true);
  3405. fitxyContent(xyPrescription.jePrescription, "xyjeContent", "xyjeTitle", true);
  3406. fitxyContent(xyPrescription.ycPrescription, "yczlContent", "yczlTitle", true);
  3407. } else {
  3408. $("#xypyTitle").removeClass("in").addClass("hide");
  3409. $("#xypyContent").html("");
  3410. $("#xymjTitle").removeClass("in").addClass("hide");
  3411. $("#xymjContent").html("");
  3412. $("#xyjeTitle").removeClass("in").addClass("hide");
  3413. $("#xyjeContent").html("");
  3414. $("#yczlTitle").removeClass("in").addClass("hide");
  3415. $("#yczlContent").html("");
  3416. }
  3417. var zyPrescription = prescriptionDetail.zyPrescription;
  3418. if (zyPrescription != null) {
  3419. fitzyContent(zyPrescription, "zyzlContent", "zyzlTitle", true);
  3420. } else {
  3421. $("#zyzlTitle").removeClass("in").addClass("hide");
  3422. $("#zyzlContent").html("");
  3423. }
  3424. var jcjyPrescription = prescriptionDetail.jcjyPrescription;
  3425. if (jcjyPrescription != null) {
  3426. fitJcjyContent(jcjyPrescription, "jcjyContent", "jcjyTitle", true);
  3427. } else {
  3428. $("#jcjyTitle").removeClass("in").addClass("hide");
  3429. $("#jcjyContent").html("");
  3430. }
  3431. var zlPrescription = prescriptionDetail.zlPrescription;
  3432. if (zlPrescription != null) {
  3433. fitJcjyContent(zlPrescription, "zlContent", "zlTitle", true);
  3434. } else {
  3435. $("#zlTitle").removeClass("in").addClass("hide");
  3436. $("#zlContent").html("");
  3437. }
  3438. var zyReqPrescription = prescriptionDetail.zyReqPrescription;
  3439. if (zyReqPrescription != null) {
  3440. fitZyReqContent(zyReqPrescription, "zyReqContent", "zyReqTitle", true);
  3441. } else {
  3442. $("#zyReqTitle").removeClass("in").addClass("hide");
  3443. $("#zyReqContent").html("");
  3444. }
  3445. var opRecordPrescription = prescriptionDetail.opRecordPrescription;
  3446. if (opRecordPrescription != null) {
  3447. fitOpRecordContent(opRecordPrescription, "opRecordContent", "opRecordTitle", true);
  3448. } else {
  3449. $("#opRecordTitle").removeClass("in").addClass("hide");
  3450. $("#opRecordContent").html("");
  3451. }
  3452. } else {
  3453. $("#xypyTitle").removeClass("in").addClass("hide");
  3454. $("#xypyContent").html("");
  3455. $("#xymjTitle").removeClass("in").addClass("hide");
  3456. $("#xymjContent").html("");
  3457. $("#xyjeTitle").removeClass("in").addClass("hide");
  3458. $("#xyjeContent").html("");
  3459. $("#yczlTitle").removeClass("in").addClass("hide");
  3460. $("#yczlContent").html("");
  3461. $("#zyzlTitle").removeClass("in").addClass("hide");
  3462. $("#zyzlContent").html("");
  3463. $("#jcjyTitle").removeClass("in").addClass("hide");
  3464. $("#jcjyContent").html("");
  3465. $("#zlTitle").removeClass("in").addClass("hide");
  3466. $("#zlContent").html("");
  3467. $("#zyReqTitle").removeClass("in").addClass("hide");
  3468. $("#zyReqContent").html("");
  3469. }
  3470. } else {
  3471. errorMesage(res);
  3472. }
  3473. }
  3474. });
  3475. $("#medicalModelModal").modal();
  3476. }
  3477. /**
  3478. * 诊疗项目回写
  3479. * @param code
  3480. * @param mzChargeDetail
  3481. */
  3482. function callBackZlDetail(code, mzChargeDetail) {
  3483. //诊疗项目
  3484. $.ajax({
  3485. type: "GET",
  3486. url: '/thmz/getZdChargeItemByCode?code=' + code,
  3487. contentType: "application/json;charset=UTF-8",
  3488. dataType: "json",
  3489. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3490. async: false,
  3491. success: function (res) {
  3492. if (res == '401' || res == 401) {
  3493. window.location.href = '/thmz/login/view'
  3494. return;
  3495. }
  3496. if (res.code == 0) {
  3497. //如果
  3498. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  3499. initNavTabs(3, null, null);
  3500. }
  3501. $("#zlItem").val(res.data.name);
  3502. $("#zlItem").blur();
  3503. $("#descriptions").val(res.data.descriptions);
  3504. $("#zlItemPrice").val(res.data.chargeAmount);
  3505. $("#chargeUnit").val(res.data.chargeUnit);
  3506. $("#zl_current_code").val(res.data.code);
  3507. $("#zlRemark").val(mzChargeDetail.instructionText);
  3508. $("#dayZlNum").selectpicker('val', mzChargeDetail.orderDays);
  3509. $('#dayZlNum').selectpicker('refresh');
  3510. if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
  3511. $("#zlHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
  3512. $('#zlHospApprFlag').selectpicker('refresh');
  3513. }
  3514. $("#orderFrequencyZl").selectpicker('val', mzChargeDetail.frequency);
  3515. $('#orderFrequencyZl').selectpicker('refresh');
  3516. if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
  3517. $("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
  3518. $('#zlExecUnit').selectpicker('refresh');
  3519. }
  3520. $("#itemQuantity").val(mzChargeDetail.drugQuan);
  3521. $("#totalNumZl").val(mzChargeDetail.quantity);
  3522. saveZlItem(false);
  3523. } else {
  3524. errorMesage(res);
  3525. }
  3526. }
  3527. });
  3528. }
  3529. /**
  3530. * 处方模板回调和历史处方调用自动重置组号
  3531. * @param type
  3532. */
  3533. function resetNewGroupId(type) {
  3534. if (type == 1 || type == 2) {
  3535. var xyTabContents = $("#xyTabContent").find("div.tab-pane");
  3536. //西药设置
  3537. if (xyTabContents != null && xyTabContents.length > 0) {
  3538. groupIdMap = new MyMap();
  3539. gropuIdAndOrderNoMap = new MyMap();
  3540. var newGroupId = 1;
  3541. gropuIdAndOrderNoMap.put(1, 0);
  3542. var prevGroupId = null;
  3543. for (var i = 0; i < xyTabContents.length; i++) {
  3544. var formGroups = $(xyTabContents[i]).find("div.form-group");
  3545. if (formGroups != null && formGroups.length > 0) {
  3546. for (var j = 0; j < formGroups.length; j++) {
  3547. var tempGroupId = $(formGroups[j]).find("input.temporary_items_groupId").val();
  3548. if (prevGroupId != null && tempGroupId != prevGroupId) {
  3549. newGroupId++;
  3550. gropuIdAndOrderNoMap.put(newGroupId, i);
  3551. }
  3552. $(formGroups[j]).find("span.groupId").text(newGroupId);
  3553. $(formGroups[j]).find("input.temporary_items_groupId").val(newGroupId);
  3554. var map = groupIdMap.get(newGroupId + '');
  3555. if (map == null) {
  3556. map = new MyMap();
  3557. map.put("supplyType", $(formGroups[j]).find("input.temporary_items_supplyType").val());
  3558. map.put("orderFrequency", $(formGroups[j]).find("input.temporary_items_orderFrequency").val());
  3559. map.put("dayNum", $(formGroups[j]).find("input.temporary_items_dayNum").val());
  3560. groupIdMap.put(newGroupId + '', map);
  3561. }
  3562. if (prevGroupId == null || tempGroupId != prevGroupId) {
  3563. prevGroupId = tempGroupId;
  3564. }
  3565. }
  3566. }
  3567. }
  3568. resetGroupIdSelect();
  3569. }
  3570. }
  3571. }
  3572. /**
  3573. * 处方回写
  3574. * @param jsonData 处方数据
  3575. * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
  3576. */
  3577. function editPrescription(jsonData, type) {
  3578. orderNoAndTableIdMap = new MyMap();
  3579. tableIdAndOrderNoMap = new MyMap();
  3580. var firstOrNot = jsonData.firstOrNot;
  3581. var conciseRecordsFlag = false;
  3582. if (type == 1) {
  3583. conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
  3584. } else if (type == 2) {
  3585. conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
  3586. }
  3587. if (firstOrNot == 0) {
  3588. $("#first").next().click();
  3589. } else if (firstOrNot == 1) {
  3590. $("#not").next().click();
  3591. }
  3592. if (type == 0 || conciseRecordsFlag) {
  3593. $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
  3594. $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
  3595. $("#emrPs").val(jsonData.mzBlRecord.emrPs);
  3596. $("#personalHistory").val(jsonData.mzBlRecord.personalHistory);
  3597. $("#familyHistory").val(jsonData.mzBlRecord.familyHistory);
  3598. $("#fzZl").val(jsonData.mzBlRecord.fzZl);
  3599. $("#crbHistory").val(jsonData.mzBlRecord.crbHistory);
  3600. $("#obstericalHistory").val(jsonData.mzBlRecord.obstericalHistory);
  3601. if (jsonData.mzBlRecord.weight != null && jsonData.mzBlRecord.weight != 0) {
  3602. $("#weight").val(jsonData.mzBlRecord.weight);
  3603. } else {
  3604. $("#weight").val("");
  3605. }
  3606. if (jsonData.mzBlRecord.temperature != null && jsonData.mzBlRecord.temperature != 0) {
  3607. $("#temperature").val(jsonData.mzBlRecord.temperature);
  3608. } else {
  3609. $("#temperature").val("");
  3610. }
  3611. if (jsonData.mzBlRecord.sphygmus != null && jsonData.mzBlRecord.sphygmus != 0) {
  3612. $("#sphygmus").val(jsonData.mzBlRecord.sphygmus);
  3613. } else {
  3614. $("#sphygmus").val("");
  3615. }
  3616. if (jsonData.mzBlRecord.breathe != null && jsonData.mzBlRecord.breathe != 0) {
  3617. $("#breathe").val(jsonData.mzBlRecord.breathe);
  3618. } else {
  3619. $("#breathe").val("");
  3620. }
  3621. if (jsonData.mzBlRecord.pressureHigh != null && jsonData.mzBlRecord.pressureHigh != 0) {
  3622. $("#pressure_high").val(jsonData.mzBlRecord.pressureHigh);
  3623. } else {
  3624. $("#pressure_high").val("");
  3625. }
  3626. if (jsonData.mzBlRecord.pressureFloor != null && jsonData.mzBlRecord.pressureFloor != 0) {
  3627. $("#pressure_floor").val(jsonData.mzBlRecord.pressureFloor);
  3628. } else {
  3629. $("#pressure_floor").val("");
  3630. }
  3631. if (jsonData.mzBlRecord.pressureHighLeft != null && jsonData.mzBlRecord.pressureHighLeft != 0) {
  3632. $("#pressure_high_left").val(jsonData.mzBlRecord.pressureHighLeft);
  3633. } else {
  3634. $("#pressure_high_left").val("");
  3635. }
  3636. if (jsonData.mzBlRecord.pressureFloorLeft != null && jsonData.mzBlRecord.pressureFloorLeft != 0) {
  3637. $("#pressure_floor_left").val(jsonData.mzBlRecord.pressureFloorLeft);
  3638. } else {
  3639. $("#pressure_floor_left").val("");
  3640. }
  3641. $("#tentativeDiagnosis").val(jsonData.mzBlRecord.tentativeDiagnosis);
  3642. $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
  3643. var icdCode = jsonData.icdCode;
  3644. if (icdCode != null && icdCode != "" && icdCode.length > 0) {
  3645. $.ajax({
  3646. type: "POST",
  3647. url: '/thmz/getZdIcdByCodes',
  3648. contentType: "application/json;charset=UTF-8",
  3649. dataType: "json",
  3650. async: false,
  3651. data: JSON.stringify({
  3652. "icdCode": icdCode
  3653. }),
  3654. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3655. success: function (res) {
  3656. if (res == '401' || res == 401) {
  3657. window.location.href = '/thmz/login/view'
  3658. return;
  3659. }
  3660. if (res.code == 0) {
  3661. if (res.data != null && res.data.length > 0) {
  3662. for (var i = 0; i < res.data.length; i++) {
  3663. fitDiagnoseValue(res.data[i].name, res.data[i].code);
  3664. }
  3665. }
  3666. } else {
  3667. errorMesage(res);
  3668. }
  3669. }
  3670. });
  3671. }
  3672. $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
  3673. if(!stringIsBlank(jsonData.tcmIcdCode)){
  3674. let tcmIcdCodes = jsonData.tcmIcdCode.split(",");
  3675. let tcmIcdTexts = jsonData.tcmIcdText.split(",");
  3676. for (let i = 0; i < tcmIcdCodes.length; i++) {
  3677. fitTcmDiagnoseValue(tcmIcdTexts[i],tcmIcdCodes[i])
  3678. }
  3679. }
  3680. }
  3681. if(jsonData.ghFeeFlag === '1'){
  3682. $("#ghFeeSelect").val('1')
  3683. $('#ghFeeSelect').selectpicker('refresh');
  3684. }
  3685. var patientAllergenInfoList = jsonData.patientAllergenInfoList;
  3686. if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
  3687. var zdAllergen = [];
  3688. var ypDitList = [];
  3689. var zdAllergenHtml = '';
  3690. var ypDitListHtml = '';
  3691. var zdAllergeCodes = null;
  3692. var zdAllergeTexts = null;
  3693. var ypDitListodes = null;
  3694. var ypDitListTexts = null;
  3695. for (var i = 0; i < patientAllergenInfoList.length; i++) {
  3696. var patientAllergenInfo = patientAllergenInfoList[i];
  3697. if (patientAllergenInfo.type == 0 || patientAllergenInfo.type == '0') {
  3698. zdAllergen[zdAllergen.length] = patientAllergenInfo.allergenCode;
  3699. zdAllergenHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
  3700. if (zdAllergeCodes == null) {
  3701. zdAllergeCodes = patientAllergenInfo.allergenCode;
  3702. zdAllergeTexts = patientAllergenInfo.allergenName;
  3703. } else {
  3704. zdAllergeCodes += "," + patientAllergenInfo.allergenCode;
  3705. zdAllergeTexts += "," + patientAllergenInfo.allergenName;
  3706. }
  3707. } else if (patientAllergenInfo.type == 1 || patientAllergenInfo.type == '1') {
  3708. ypDitList[ypDitList.length] = patientAllergenInfo.allergenCode;
  3709. ypDitListHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
  3710. if (zdAllergeCodes == null) {
  3711. ypDitListodes = patientAllergenInfo.allergenCode;
  3712. ypDitListTexts = patientAllergenInfo.allergenName;
  3713. } else {
  3714. ypDitListodes += "," + patientAllergenInfo.allergenCode;
  3715. ypDitListTexts += "," + patientAllergenInfo.allergenName;
  3716. }
  3717. }
  3718. }
  3719. $("#zdAllergen").empty();
  3720. $('#zdAllergen').append(zdAllergenHtml);
  3721. $('#zdAllergen').selectpicker('refresh');
  3722. $("#ypDitList").empty();
  3723. $('#ypDitList').append(ypDitListHtml);
  3724. $('#ypDitList').selectpicker('refresh');
  3725. $("#zdAllergen").selectpicker('val', zdAllergen);
  3726. $("#zdAllergen").selectpicker('refresh');
  3727. $("#ypDitList").selectpicker('val', ypDitList);
  3728. $("#ypDitList").selectpicker('refresh');
  3729. $("#zdAllergen").attr("selectedCodes", zdAllergeCodes);
  3730. $("#zdAllergen").attr("selectedTexts", zdAllergeTexts);
  3731. $("#ypDitList").attr("selectedCodes", ypDitListodes);
  3732. $("#ypDitList").attr("selectedTexts", ypDitListTexts);
  3733. }
  3734. //西药选中的数据组
  3735. var xyArrays = [];
  3736. //中药选中的数据组
  3737. var zyArrays = [];
  3738. //辅助检查、检验选中的数据组
  3739. var jcjyArrays = [];
  3740. //诊疗选中的数据组
  3741. var zlArrays = [];
  3742. //住院选中的数据组
  3743. var zyReqArrays = [];
  3744. //门诊手术选中的数据组
  3745. var opRecordArrays = [];
  3746. //外配药选中的数据组
  3747. var wpMedicinedArrays = [];
  3748. //组号与同组药数量的map
  3749. var groupOrderAndLengthMap = new MyMap();
  3750. //处方号与同处方号药数量的map
  3751. var orderNoAndLengthMap = new MyMap();
  3752. //住院回写
  3753. var zyReqCallBack = false;
  3754. if (type == 1) {
  3755. setCallBackArrays("xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3756. setCallBackArrays("xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3757. setCallBackArrays("xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3758. setCallBackArrays("yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3759. setCallBackArrays("zyzlContent", zyArrays, null, null);
  3760. setCallBackArrays("jcjyContent", jcjyArrays, null, null);
  3761. setCallBackArrays("zlContent", zlArrays, null, null);
  3762. zyReqCallBack = $("#zyReqContent").find("input").prop("checked");
  3763. setCallBackArrays("opRecordContent", opRecordArrays, null, null);
  3764. setCallBackArrays("wpMedicineContent", wpMedicinedArrays, null, null);
  3765. } else if (type == 2) {
  3766. setCallBackArrays("prescriptionDetail_xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3767. setCallBackArrays("prescriptionDetail_xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3768. setCallBackArrays("prescriptionDetail_xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3769. setCallBackArrays("prescriptionDetail_yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
  3770. setCallBackArrays("prescriptionDetail_zyzlContent", zyArrays, null, null);
  3771. setCallBackArrays("prescriptionDetail_jcjyContent", jcjyArrays, null, null);
  3772. setCallBackArrays("prescriptionDetail_zlContent", zlArrays, null, null);
  3773. zyReqCallBack = $("#prescriptionDetail_zyReqContent").find("input").prop("checked");
  3774. setCallBackArrays("prescriptionDetail_opRecordContent", opRecordArrays, null, null);
  3775. setCallBackArrays("prescriptionDetail_wpMedicineContent", wpMedicinedArrays, null, null);
  3776. } else if (type == 0) {
  3777. zyReqCallBack = true;
  3778. }
  3779. var mzChargeDetailList = jsonData.mzChargeDetailList;
  3780. var mzZyReq = jsonData.mzZyReq;
  3781. //中药的公共参数是否已经设置了
  3782. var hadSetZyFullParams = false;
  3783. //西药,成药,医材,麻精,中药,诊疗
  3784. if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
  3785. //当前实际回写的组号
  3786. var currentOrderNo = null;
  3787. //处方号与药品类型关系
  3788. var orderAndGroupNoMap = new MyMap();
  3789. // mzChargeDetailList.sort(function (a, b) {
  3790. // return a.groupNo - b.groupNo
  3791. // });
  3792. for (var i = 0; i < mzChargeDetailList.length; i++) {
  3793. var mzChargeDetail = mzChargeDetailList[i];
  3794. var groupNo = mzChargeDetail.groupNo;
  3795. var code = mzChargeDetail.chargeItemCode;
  3796. var serial = mzChargeDetail.serial;
  3797. if (groupNo == "00") {
  3798. if (type != 0 && !isInArray(code, zlArrays)) {
  3799. continue;
  3800. }
  3801. callBackZlDetail(code, mzChargeDetail);
  3802. } else if (groupNo == "71" || groupNo == "91" || groupNo == "111" || groupNo == "131") {
  3803. // 71 西成药 91 医材 111 精一 131 精二
  3804. var groupOrder = mzChargeDetail.groupOrder;
  3805. if (groupOrder == null || groupOrder == 'null' || groupOrder == "") {
  3806. groupOrder = 1;
  3807. }
  3808. var orderNo = mzChargeDetail.orderNo;
  3809. orderAndGroupNoMap.put(orderNo, groupNo);
  3810. if (type != 0 && !isInArray(code + "_" + serial + "_" + groupOrder + "_" + orderNo, xyArrays)) {
  3811. continue;
  3812. }
  3813. var lastGroupOrder = parseInt($("#groupId > option:last").val());
  3814. while (lastGroupOrder < groupOrder) {
  3815. appendGroupOrder();
  3816. lastGroupOrder = parseInt($("#groupId > option:last").val());
  3817. }
  3818. //appendGroupOrder()
  3819. $("#groupId").selectpicker('val', groupOrder);
  3820. $('#groupId').selectpicker('refresh');
  3821. if (type == 1 || type == 2) {
  3822. //模板和历史轨迹回调的时候,如果前一个处方不满5个,就将后面的处方的药品添加到上一个处方中,但如果同一组药不能全部添加到上一个处方,就不会追加到该处方中
  3823. var orderNoLength = orderNoAndLengthMap.get(orderNo);
  3824. if (currentOrderNo == null) {
  3825. currentOrderNo = orderNo;
  3826. } else if (orderAndGroupNoMap.get(currentOrderNo) != orderAndGroupNoMap.get(orderNo)) {
  3827. var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
  3828. //查询还没有满5个的处方页
  3829. var tempOrderNo = null;
  3830. for (var k = 0; k < currentGroupNos.length; k++) {
  3831. if ($(currentGroupNos[k]).val() == groupNo) {
  3832. var next = $(currentGroupNos[k]).next();
  3833. if ($(next).children().length < 4) {
  3834. var parentId = $(currentGroupNos[k]).parent().attr("id");
  3835. tempOrderNo = tableIdAndOrderNoMap.get(parentId);
  3836. }
  3837. }
  3838. }
  3839. currentOrderNo = tempOrderNo;
  3840. } else if (currentOrderNo != orderNo && orderNoLength < 5) {
  3841. var currentOrderNoLength = orderNoAndLengthMap.get(currentOrderNo);
  3842. var groupOrderLength = groupOrderAndLengthMap.get(groupOrder);
  3843. if (groupOrderLength + currentOrderNoLength <= 5) {
  3844. currentOrderNoLength = currentOrderNoLength + 1;
  3845. orderNoLength = orderNoLength - 1;
  3846. groupOrderLength = groupOrderLength - 1;
  3847. orderNoAndLengthMap.put(currentOrderNo, currentOrderNoLength);
  3848. orderNoAndLengthMap.put(orderNo, orderNoLength);
  3849. groupOrderAndLengthMap.put(groupOrder, groupOrderLength);
  3850. orderNo = currentOrderNo;
  3851. if (currentOrderNoLength == 5) {
  3852. var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
  3853. //查询还没有满5个的处方页,
  3854. var tempOrderNo = null;
  3855. for (var k = 0; k < currentGroupNos.length; k++) {
  3856. if ($(currentGroupNos[k]).val() == groupNo) {
  3857. var next = $(currentGroupNos[k]).next();
  3858. //这里判断是4,是因为已经把组号设置了,所以要减去1
  3859. if ($(next).children().length < 4) {
  3860. var parentId = $(currentGroupNos[k]).parent().attr("id");
  3861. tempOrderNo = tableIdAndOrderNoMap.get(parentId);
  3862. }
  3863. }
  3864. }
  3865. currentOrderNo = tempOrderNo;
  3866. }
  3867. } else {
  3868. currentOrderNo = orderNo;
  3869. }
  3870. }
  3871. }
  3872. checkYpInfo(code, serial, groupNo, false, orderNo, type);
  3873. // 给药方式 同组药品给药方式相同
  3874. $("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
  3875. $('#supplyType').selectpicker('refresh');
  3876. $("#drugWin").val(mzChargeDetail.drugQuan);
  3877. $("#drugWinUnit").selectpicker('val', mzChargeDetail.drugUnit);
  3878. $('#drugWinUnit').selectpicker('refresh');
  3879. //天数 同组药品天数相同
  3880. $("#dayNum").selectpicker('val', mzChargeDetail.orderDays);
  3881. $('#dayNum').selectpicker('refresh');
  3882. //频次编码 同组药品频次编码相同
  3883. $("#orderFrequency").selectpicker('val', mzChargeDetail.frequency);
  3884. $('#orderFrequency').selectpicker('refresh');
  3885. if (mzChargeDetail.tryFlag == 1 || mzChargeDetail.tryFlag == "1") {
  3886. $("#tryResult").selectpicker('val', 100);
  3887. $('#tryResult').selectpicker('refresh');
  3888. } else if (mzChargeDetail.tryResult != null && mzChargeDetail.tryResult != "null" && mzChargeDetail.tryResult != "") {
  3889. $("#tryResult").selectpicker('val', mzChargeDetail.tryResult);
  3890. $('#tryResult').selectpicker('refresh');
  3891. }
  3892. $("#gross").val(mzChargeDetail.quantity);
  3893. $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()));
  3894. $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
  3895. $('#medicalAdvice').selectpicker('refresh');
  3896. if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
  3897. $("#xyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
  3898. $('#xyHospApprFlag').selectpicker('refresh');
  3899. }
  3900. saveWesternMedicineWithCheck(false, orderNo);
  3901. $("#western_medicine_button").click();
  3902. $("#xyTab").find("li:eq(0) a").off("click").click();
  3903. } else {
  3904. if (type != 0 && !isInArray(code + "_" + serial, zyArrays)) {
  3905. continue;
  3906. }
  3907. //中药与颗粒剂
  3908. checkZyInfo(code, serial, groupNo, false);
  3909. //类型
  3910. $("#zyClassType").selectpicker('val', groupNo);
  3911. $('#zyClassType').selectpicker('refresh');
  3912. $("#zy_drugWin").val(mzChargeDetail.quantity);
  3913. $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
  3914. $('#zyInstruction').selectpicker('refresh');
  3915. if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
  3916. $("#zyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
  3917. $('#zyHospApprFlag').selectpicker('refresh');
  3918. }
  3919. saveChineseMedicine(false);
  3920. if (!hadSetZyFullParams) {
  3921. hadSetZyFullParams = true;
  3922. $("input.zyfs").val(mzChargeDetail.drugWin);
  3923. // $("#zy_orderFrequency_1").selectpicker('val', mzChargeDetail.frequency);
  3924. // $('#zy_orderFrequency_1').selectpicker('refresh');
  3925. $("#useType_1").selectpicker('val', mzChargeDetail.cyFysm);
  3926. $('#useType_1').selectpicker('refresh');
  3927. $("#cyJssm").selectpicker('val', mzChargeDetail.cyJssm);
  3928. $('#cyJssm').selectpicker('refresh');
  3929. $("#cyJsl").val(mzChargeDetail.cyJsl);
  3930. $("#cyZql").val(mzChargeDetail.cyZql);
  3931. $("#cyFj").val(mzChargeDetail.cyFj);
  3932. $("#cyFfcs").val(mzChargeDetail.cyFfcs);
  3933. $("#cyMtjs").val(mzChargeDetail.cyMtjs);
  3934. $("#zy_supplyType_1").selectpicker('val', mzChargeDetail.cyDj);
  3935. $('#zy_supplyType_1').selectpicker('refresh');
  3936. }
  3937. $("#chinese_medicine_button").click();
  3938. }
  3939. }
  3940. }
  3941. //检验与检查
  3942. var mzYjReqList = jsonData.mzYjReqList;
  3943. if (mzYjReqList != null && mzYjReqList.length > 0) {
  3944. for (var i = 0; i < mzYjReqList.length; i++) {
  3945. var mzYjReq = mzYjReqList[i];
  3946. var code = mzYjReq.orderCode;
  3947. if (type != 0 && !isInArray(code, jcjyArrays)) {
  3948. continue;
  3949. }
  3950. var jcJyZltype = null;
  3951. if (mzYjReq.reqType == 2) {
  3952. jcJyZltype = 1;
  3953. $("#jyZdSample").selectpicker('val', mzYjReq.inspectStuff);
  3954. $('#jyZdSample').selectpicker('refresh');
  3955. } else if (mzYjReq.reqType == 3) {
  3956. jcJyZltype = 2;
  3957. $("#yshPart").selectpicker('val', mzYjReq.inspectPart);
  3958. $('#yshPart').selectpicker('refresh');
  3959. }
  3960. $("#jcJyZltype").val(jcJyZltype);
  3961. checkJcJyItemInfo(code, null, jcJyZltype, false);
  3962. $("#remark").val(mzYjReq.jyRemark);
  3963. if (mzYjReq.execDept != null && mzYjReq.execDept != "") {
  3964. $("#execUnit").selectpicker('val', mzYjReq.execDept);
  3965. $('#execUnit').selectpicker('refresh');
  3966. }
  3967. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  3968. saveJyJcItem(false);
  3969. $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
  3970. }
  3971. $("#yj_req_button").click();
  3972. }
  3973. //入院证
  3974. if (zyReqCallBack && mzZyReq != null && mzZyReq.reqDept != null && mzZyReq.reqDept != "") {
  3975. $("#inpatientWardBeHospitalized").selectpicker('val', mzZyReq.reqDept);
  3976. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  3977. initSmallDeptByDept();
  3978. $("#admissStatus").selectpicker('val', mzZyReq.admissStatus);
  3979. $('#admissStatus').selectpicker('refresh');
  3980. $("#conditionCode").selectpicker('val', mzZyReq.conditionCode);
  3981. $('#conditionCode').selectpicker('refresh');
  3982. $("#routeOfAdmission").selectpicker('val', mzZyReq.routeOfAdmission);
  3983. $('#routeOfAdmission').selectpicker('refresh');
  3984. $("#contacterName").val(mzZyReq.contacterName);
  3985. $("#contacterRelationship").selectpicker('val', mzZyReq.contacterRelationship);
  3986. $('#contacterRelationship').selectpicker('refresh');
  3987. $("#contacterPhone").val(mzZyReq.contacterPhone);
  3988. $("#contacterAddress").val(mzZyReq.contacterAddress);
  3989. $("#deposit").val(mzZyReq.deposit);
  3990. setTimeout(function () {
  3991. $("#smallWardBeHospitalized").selectpicker('val', mzZyReq.smallDept);
  3992. $('#smallWardBeHospitalized').selectpicker('refresh');
  3993. saveZyReq(false);
  3994. }, 500);
  3995. $("#zy_req_button").click();
  3996. }
  3997. //门诊手术
  3998. var opRecordList = jsonData.opRecordList;
  3999. if (opRecordList != null && opRecordList.length > 0) {
  4000. for (var i = 0; i < opRecordList.length; i++) {
  4001. var opRecord = opRecordList[i];
  4002. var opCode = opRecord.opCode;
  4003. if (type != 0 && !isInArray(opCode, opRecordArrays)) {
  4004. continue;
  4005. }
  4006. var opNameHtml = '<option value="' + opRecord.opCode + '">' + opRecord.opName + '</option>';
  4007. $('#opName').html(opNameHtml);
  4008. $('#opName').selectpicker('refresh');
  4009. $('#opName').selectpicker('val', opRecord.opCode);
  4010. $('#opName').selectpicker('refresh');
  4011. $("#opTime").val(opRecord.opDatetimeStr);
  4012. $('#urgentClinicFlag').selectpicker('val', opRecord.urgentClinicFlag);
  4013. $('#urgentClinicFlag').selectpicker('refresh');
  4014. $('#ssbc').selectpicker('val', opRecord.ssbc);
  4015. $('#ssbc').selectpicker('refresh');
  4016. $('#partCode').selectpicker('val', opRecord.partCode);
  4017. $('#partCode').selectpicker('refresh');
  4018. $('#opScale').selectpicker('val', opRecord.opScale);
  4019. $('#opScale').selectpicker('refresh');
  4020. $('#hocusCode').selectpicker('val', opRecord.hocusCode);
  4021. $('#hocusCode').selectpicker('refresh');
  4022. $('#doctorZd').selectpicker('val', opRecord.doctorZd);
  4023. $('#doctorZd').selectpicker('refresh');
  4024. $("#opRecordRemark").val(opRecord.remark);
  4025. saveOpRecord(false);
  4026. }
  4027. $("#op_record_button").click();
  4028. }
  4029. //外配药
  4030. let rxDruginfoList = jsonData.rxDruginfoList;
  4031. if(rxDruginfoList != null && rxDruginfoList.length > 0){
  4032. for (let i = 0; i < rxDruginfoList.length; i++) {
  4033. let rxDruginfo = rxDruginfoList[i];
  4034. let medListCodg = rxDruginfo.medListCodg;
  4035. if (type != 0 && !isInArray(medListCodg, wpMedicinedArrays)) {
  4036. continue;
  4037. }
  4038. $("#wp_medicine_name").val(rxDruginfo.drugGenname)
  4039. $("#wp_medicine_current_code").val(rxDruginfo.medListCodg)
  4040. setSelectDefaultVal('rxItemTypeCode',rxDruginfo.rxItemTypeCode)
  4041. setSelectDefaultVal('medcWayCodg',rxDruginfo.medcWayCodg)
  4042. $("#medcDays").val(rxDruginfo.medcDays)
  4043. $("#sinDosunt").val(rxDruginfo.sinDosunt)
  4044. $("#sinDoscnt").val(rxDruginfo.sinDoscnt)
  4045. $("#drugDosform").val(rxDruginfo.drugDosform)
  4046. setSelectDefaultVal('usedFrquCodg',rxDruginfo.usedFrquCodg)
  4047. $("#drugDosunt").val(rxDruginfo.drugDosunt)
  4048. $("#drugCnt").val(rxDruginfo.drugCnt)
  4049. $("#drugSpec").val(rxDruginfo.drugSpec)
  4050. $("#wpHospApprFlag").val(rxDruginfo.hospApprFlag)
  4051. saveWpOrder(false)
  4052. }
  4053. $("#wp_order_button").click();
  4054. }
  4055. setTimeout(function () {
  4056. //设置总金额 计算金额的时候,可能处方还没有回写完
  4057. calculateTotalAmount(false);
  4058. }, 1000);
  4059. //清空映射map
  4060. orderNoAndTableIdMap = null;
  4061. tableIdAndOrderNoMap = null;
  4062. resetNewGroupId(type);
  4063. }
  4064. /**
  4065. * 根据勾选内容设置选中集合
  4066. * @param id 区域id
  4067. * @param arrays 集合
  4068. * @param groupOrderAndLengthMap 组号与同组药数量的map
  4069. * @param orderNoAndLengthMap 处方号与同处方号药数量的map
  4070. */
  4071. function setCallBackArrays(id, arrays, groupOrderAndLengthMap, orderNoAndLengthMap) {
  4072. var contents = $("#" + id).children();
  4073. if (contents == null || contents.length == 0) {
  4074. return;
  4075. }
  4076. $(contents).each(function (index, obj) {
  4077. var checked = $(obj).find("input").prop("checked");
  4078. var data_id = $(obj).attr("data-id");
  4079. if (checked && data_id != undefined && data_id != null && data_id != "null" && data_id != "") {
  4080. arrays[arrays.length] = data_id;
  4081. var dataArr = null;
  4082. //设置组号与同组药品数量关系
  4083. if (groupOrderAndLengthMap != null) {
  4084. dataArr = data_id.split("_");
  4085. if (dataArr != null && dataArr.length >= 3) {
  4086. var groupOrder = Number(dataArr[2]);
  4087. var length = groupOrderAndLengthMap.get(groupOrder);
  4088. if (length == null || length == "") {
  4089. length = 0;
  4090. }
  4091. length++;
  4092. groupOrderAndLengthMap.put(groupOrder, length);
  4093. }
  4094. }
  4095. //设置处方号与同处方号药品数量关系
  4096. if (orderNoAndLengthMap != null) {
  4097. if (dataArr == null) {
  4098. dataArr = data_id.split("_");
  4099. }
  4100. if (dataArr != null && dataArr.length >= 4) {
  4101. var orderNo = Number(dataArr[3]);
  4102. var length = orderNoAndLengthMap.get(orderNo);
  4103. if (length == null || length == "") {
  4104. length = 0;
  4105. }
  4106. length++;
  4107. orderNoAndLengthMap.put(orderNo, length);
  4108. }
  4109. }
  4110. }
  4111. });
  4112. }
  4113. /**
  4114. * 调用医疗范文
  4115. */
  4116. function callTemplate() {
  4117. clearWorkSpaceExcludeUser(2);
  4118. $.ajax({
  4119. type: "GET",
  4120. url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(),
  4121. contentType: "application/json;charset=UTF-8",
  4122. dataType: "json",
  4123. async: false,
  4124. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4125. success: function (res) {
  4126. if (res == '401' || res == 401) {
  4127. window.location.href = '/thmz/login/view'
  4128. return;
  4129. }
  4130. if (res.code == 0) {
  4131. var jsonData = JSON.parse(res.data.templateData);
  4132. editPrescription(jsonData, 1);
  4133. $("#templateId").val(res.data.id);
  4134. $("#templateName").val(res.data.name);
  4135. $("#templateKindType").selectpicker('val', res.data.templateKindType);
  4136. $("#templateKindType").selectpicker('refresh');
  4137. $("#templateType").selectpicker('val', res.data.templateType);
  4138. $("#templateType").selectpicker('refresh');
  4139. $('#operationType').selectpicker('val', 1);
  4140. $('#operationType').selectpicker('refresh');
  4141. $("#operationTypeDiv").removeClass("hide").addClass("in");
  4142. $("#medicalModelModal").modal("hide");
  4143. closePopover();
  4144. } else {
  4145. errorMesage(res);
  4146. }
  4147. }
  4148. });
  4149. }
  4150. /**
  4151. * 底层填充推荐方法
  4152. * @param paramsType
  4153. * @param appeal
  4154. * @param inputId
  4155. */
  4156. function extracted(paramsType, appeal, inputId) {
  4157. if (paramsType == 13) {
  4158. var contentArr = appeal.split(",");
  4159. if (contentArr != null && contentArr.length > 0) {
  4160. for (var i = 0; i < contentArr.length; i++) {
  4161. var content = contentArr[i].replace(")", "").replace("(", "-");
  4162. var diagnoseArr = content.split("-");
  4163. if (diagnoseArr == null || diagnoseArr.length == 0) {
  4164. continue;
  4165. }
  4166. fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
  4167. }
  4168. }
  4169. } else {
  4170. $("#" + inputId).val(appeal);
  4171. }
  4172. }
  4173. /**
  4174. * 填充推荐
  4175. * @param appeal
  4176. * @param paramsType
  4177. * @param id
  4178. */
  4179. function fitAppeal(appeal, paramsType, id) {
  4180. var inputId = "symptom";
  4181. var text = "主诉项已经录入,是否覆盖?";
  4182. if (paramsType == 5) {
  4183. inputId = "emrHpi";
  4184. text = "现病史项已经录入,是否覆盖?";
  4185. } else if (paramsType == 6) {
  4186. inputId = "emrPs";
  4187. text = "既往史项已经录入,是否覆盖?";
  4188. } else if (paramsType == 13) {
  4189. inputId = "diagnoseValue";
  4190. text = "诊断项已经录入,是否覆盖?";
  4191. }
  4192. var symptom = $("#" + inputId).val();
  4193. if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
  4194. symptom = null;
  4195. }
  4196. if (symptom != null && symptom != "") {
  4197. $("#messageModal").modal();
  4198. $("#messageContent").html(text);
  4199. $("#messageButton").off("click").on("click", function (t) {
  4200. $("#messageModal").modal("hide");
  4201. if (paramsType == 13) {
  4202. $("#" + inputId).val(null);
  4203. $("#diagnoseTags").html(null);
  4204. }
  4205. extracted(paramsType, appeal, inputId);
  4206. });
  4207. $("#cancelButton").off("click");
  4208. } else {
  4209. extracted(paramsType, appeal, inputId);
  4210. }
  4211. $.ajax({
  4212. type: "GET",
  4213. url: '/thmz/increaseTcCommonParamsNumber?id=' + id,
  4214. contentType: "application/json;charset=UTF-8",
  4215. dataType: "json",
  4216. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4217. success: function (res) {
  4218. }
  4219. });
  4220. }
  4221. /**
  4222. * 初始嘱托下拉选
  4223. */
  4224. function initInstructionSelect() {
  4225. //西药医嘱
  4226. $.ajax({
  4227. type: "GET",
  4228. url: '/thmz/getMzZdInstructionByType?instructionType=0',
  4229. contentType: "application/json;charset=UTF-8",
  4230. dataType: "json",
  4231. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4232. success: function (res) {
  4233. if (res == '401' || res == 401) {
  4234. window.location.href = '/thmz/login/view'
  4235. return;
  4236. }
  4237. if (res.code == 0) {
  4238. res.data.forEach(function (item, index) {
  4239. var html = '<option value="' + item.code + '">' + item.instructionText + '</option>';
  4240. $('#medicalAdvice').append(html);
  4241. });
  4242. $('#medicalAdvice').selectpicker('refresh');
  4243. } else {
  4244. errorMesage(res);
  4245. }
  4246. }
  4247. });
  4248. //中药医嘱
  4249. $.ajax({
  4250. type: "GET",
  4251. url: '/thmz/getMzZdInstructionByType?instructionType=1',
  4252. contentType: "application/json;charset=UTF-8",
  4253. dataType: "json",
  4254. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4255. success: function (res) {
  4256. if (res == '401' || res == 401) {
  4257. window.location.href = '/thmz/login/view'
  4258. return;
  4259. }
  4260. if (res.code == 0) {
  4261. res.data.forEach(function (item, index) {
  4262. var html = '<option value="' + item.code + '">' + item.instructionText.trim() + '</option>';
  4263. $('#zyInstruction').append(html);
  4264. });
  4265. $('#zyInstruction').selectpicker('refresh');
  4266. } else {
  4267. errorMesage(res);
  4268. }
  4269. }
  4270. });
  4271. }
  4272. // /**
  4273. // * 设置下拉选的尺寸
  4274. // */
  4275. // function setSelectSize() {
  4276. // $(".selectpicker").selectpicker({
  4277. // dropuAuto: false,
  4278. // size: 10
  4279. // });
  4280. // }
  4281. /**
  4282. * 初始化下拉选
  4283. */
  4284. function initSelectWithParams() {
  4285. $(".selectpicker").selectpicker({
  4286. dropuAuto: false,
  4287. size: 10
  4288. });
  4289. //select 从后台加载数据,并保留之前选择的内容
  4290. dynamicSelectWithOri("editZd", '/thmz/getAllZdIcdCommonParams?commonParams=', false);
  4291. //中医诊断
  4292. dynamicSelectWithOri("editTcmZd", '/thmz/getAllTcmIcdCodeByParams?name=',false);
  4293. //手术名称下拉选实现
  4294. dynamicSelect("opName", '/thmz/getZdIcd9Cm3ListByCode?code=', false);
  4295. //手术部位
  4296. dynamicSelect("partCode", '/thmz/getAllOpZdPartNewByCode?code=', true);
  4297. //手术等级
  4298. dynamicSelect("opScale", '/thmz/getAllOpZdScaleByCode?code=', true);
  4299. //麻醉方式
  4300. dynamicSelect("hocusCode", '/thmz/getAllZdAnaesthesiaByCode?code=', true);
  4301. //主刀医生
  4302. dynamicSelect("doctorZd", '/thmz/getEmployeeByCommon?code=', true);
  4303. //过敏源
  4304. dynamicSelectWithOri("zdAllergen", '/thmz/getZdAllergenListByCode?code=', false);
  4305. //过敏源
  4306. dynamicSelectWithOri("editZdAllergen", '/thmz/getZdAllergenListByCode?code=', false);
  4307. //药品列表
  4308. dynamicSelectWithOri("ypDitList", '/thmz/getYpZdDictListByCode?code=', false);
  4309. //药品列表
  4310. dynamicSelectWithOri("editYpDitList", '/thmz/getYpZdDictListByCode?code=', false);
  4311. }
  4312. /**
  4313. * 初始化性别下拉选
  4314. */
  4315. function initGenderSelect() {
  4316. var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
  4317. $('#rapidAcceptsUserGender').html(gender);
  4318. $('#rapidAcceptsUserGender').selectpicker('refresh');
  4319. $('#editUserGender').html(gender);
  4320. $('#editUserGender').selectpicker('refresh');
  4321. $('#crbMainCardGender').html(gender);
  4322. $('#crbMainCardGender').selectpicker('refresh');
  4323. //医疗范文状态
  4324. var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
  4325. $('#templateStatus').html(templateStatus);
  4326. $('#templateStatus').selectpicker('refresh');
  4327. //医疗范文操作类型
  4328. var operationType = '<option value="0">新增</option><option value="1">修改</option>';
  4329. $('#operationType').html(operationType);
  4330. $('#operationType').selectpicker('refresh');
  4331. //入院病情
  4332. var conditionCode = '<option value="1">有</option><option value="2">临床未确定</option><option value="3">情况不明</option><option value="4">无</option>';
  4333. $('#conditionCode').html(conditionCode);
  4334. $('#conditionCode').selectpicker('refresh');
  4335. //入院途径
  4336. initRouteOfAdmission()
  4337. // 初始化收取挂号费默认值
  4338. initGhFeeSelect()
  4339. //就诊人群类型
  4340. var mdtrtGrpType = '<option value="-1">无</option><option value="1">新冠肺炎确诊患者</option><option value="2">其他国家突发公共事件</option><option value="3">新冠肺炎疑似患者</option><option value="4">无症状感染者</option>';
  4341. $('#mdtrtGrpType').html(mdtrtGrpType);
  4342. $('#mdtrtGrpType').selectpicker('refresh');
  4343. //外伤标志
  4344. var trumFlag = '<option value="0">否</option><option value="1">是</option>';
  4345. $('#trumFlag').html(trumFlag);
  4346. $('#trumFlag').selectpicker('refresh');
  4347. //涉及第三方标志
  4348. var relTtpFlag = '<option value="0">否</option><option value="1">是</option>';
  4349. $('#relTtpFlag').html(relTtpFlag);
  4350. $('#relTtpFlag').selectpicker('refresh');
  4351. //门诊急诊转诊标志
  4352. var otpErReflFlag = '<option value="-1">无</option><option value="1">急诊</option><option value="2">转诊</option><option value="3">转诊合并急诊</option>';
  4353. $('#otpErReflFlag').html(otpErReflFlag);
  4354. $('#otpErReflFlag').selectpicker('refresh');
  4355. }
  4356. /**
  4357. * 初始化中药类型下拉选
  4358. */
  4359. function initZyClassTypeSelect() {
  4360. // let html = '<option selected="selected" value="81">普通</option><option value="83">颗粒剂</option>';
  4361. // $('#zyClassType').html(html);
  4362. // $('#zyClassType').selectpicker('refresh');
  4363. getAjaxRequst("/thmz/selectYfAllByTime",{},true,function (res) {
  4364. let html = '';
  4365. $.each(res.data, function (commentIndex, comment) {
  4366. groupNoList = res.data
  4367. if(comment.mzFlag ==='1' && (comment.zcyFlag==='1' || comment.klFlag==='1')){
  4368. html += '<option value="' + comment.groupNo + '">' + comment.groupName + '</option>';
  4369. }
  4370. });
  4371. $('#zyClassType').html(html);
  4372. $('#zyClassType').selectpicker('refresh');
  4373. })
  4374. }
  4375. /**
  4376. * 初始化皮试结果下拉选
  4377. * @param categoriesFlag 0 口服 2 注射针剂
  4378. */
  4379. function initTryResultSelect(categoriesFlag) {
  4380. var tryResult = '';
  4381. if (categoriesFlag == 2 || categoriesFlag == "2") {
  4382. tryResult += '<option value="100">皮试</option>';
  4383. }
  4384. tryResult += '<option value="0">阴性</option><option value="3">免试</option>';
  4385. //var tryResult = '<option value="100">皮试</option><option value="0">阴性</option><option value="3">免试</option>';
  4386. $('#tryResult').html(tryResult);
  4387. $('#tryResult').selectpicker('refresh');
  4388. //口服药选择皮试结果
  4389. $("#tryResult").parent().parent().parent().removeClass("hide").addClass("in");
  4390. }
  4391. /**
  4392. * 初始化病人身份类别下拉选
  4393. */
  4394. function initResponceTypeSelect() {
  4395. $.ajax({
  4396. type: "GET",
  4397. url: '/thmz/getMzResponceType',
  4398. contentType: "application/json;charset=UTF-8",
  4399. dataType: "json",
  4400. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4401. success: function (res) {
  4402. if (res == '401' || res == 401) {
  4403. window.location.href = '/thmz/login/view'
  4404. return;
  4405. }
  4406. if (res.code == 0) {
  4407. res.data.forEach(function (item, index) {
  4408. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  4409. $('#patientsNature').append(html);
  4410. $('#editUserPatientsNature').append(html);
  4411. $('#crbMainCardPatientsNature').append(html);
  4412. // $('#responeTypeBeHospitalized').append(html);
  4413. });
  4414. $('#patientsNature').selectpicker('refresh');
  4415. $('#editUserPatientsNature').selectpicker('refresh');
  4416. $('#crbMainCardPatientsNature').selectpicker('refresh');
  4417. } else {
  4418. errorMesage(res);
  4419. }
  4420. }
  4421. });
  4422. }
  4423. /**
  4424. * 所有的入院状态
  4425. */
  4426. function iniAdmissStatus() {
  4427. $.ajax({
  4428. type: "GET",
  4429. url: '/thmz/getAdmissStatus',
  4430. dataType: "json",
  4431. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4432. success: function (res) {
  4433. if (res == '401' || res == 401) {
  4434. window.location.href = '/thmz/login/view'
  4435. return;
  4436. }
  4437. var html = '';
  4438. $.each(res.data, function (commentIndex, comment) {
  4439. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4440. });
  4441. $('#admissStatus').empty();
  4442. $('#admissStatus').html(html);
  4443. $('#admissStatus').selectpicker('destroy').selectpicker('refresh');
  4444. }
  4445. });
  4446. }
  4447. /**
  4448. * 初始化收取挂号费
  4449. */
  4450. function initGhFeeSelect() {
  4451. getAjaxRequst("/thmz/getGhFeeValue",{},true,function (res) {
  4452. $("#ghFeeSelect").val(res.data)
  4453. $('#ghFeeSelect').selectpicker('refresh');
  4454. })
  4455. }
  4456. /**
  4457. * 初始化入院途径
  4458. */
  4459. function initRouteOfAdmission() {
  4460. getAjaxRequst("/thmz/queryRouteOfAdmission",{},true,function (res) {
  4461. if (res == '401' || res == 401) {
  4462. window.location.href = '/thmz/login/view'
  4463. return;
  4464. }
  4465. var html = '';
  4466. $.each(res.data, function (commentIndex, comment) {
  4467. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4468. });
  4469. $('#routeOfAdmission').empty();
  4470. $('#routeOfAdmission').html(html);
  4471. $('#routeOfAdmission').selectpicker('destroy').selectpicker('refresh');
  4472. })
  4473. }
  4474. /**
  4475. * 入院登记的病区列表
  4476. */
  4477. function initListDeptSelect() {
  4478. //科室列表
  4479. $.ajax({
  4480. type: "GET",
  4481. url: '/thmz/allInpatientWard',
  4482. dataType: "json",
  4483. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4484. success: function (data) {
  4485. if (data == '401' || data == 401) {
  4486. window.location.href = '/thmz/login/view'
  4487. return;
  4488. }
  4489. var html = '';
  4490. $.each(data.data, function (commentIndex, comment) {
  4491. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  4492. });
  4493. $('#inpatientWardBeHospitalized').empty();
  4494. $('#inpatientWardBeHospitalized').html(html);
  4495. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  4496. initSmallDeptByDept();
  4497. }
  4498. });
  4499. }
  4500. /**
  4501. * 关系列表初始化
  4502. */
  4503. function initRelationSelect() {
  4504. //医生列表
  4505. $.ajax({
  4506. type: "GET",
  4507. url: '/thmz/getRelation',
  4508. dataType: "json",
  4509. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4510. success: function (res) {
  4511. if (res == '401' || res == 401) {
  4512. window.location.href = '/thmz/login/view'
  4513. return;
  4514. }
  4515. var html = '';
  4516. $.each(res.data, function (commentIndex, comment) {
  4517. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4518. });
  4519. $('#contacterRelationship').empty();
  4520. $('#contacterRelationship').html(html);
  4521. $('#contacterRelationship').selectpicker('destroy').selectpicker('refresh');
  4522. }
  4523. });
  4524. }
  4525. /**
  4526. * 小科室列表
  4527. */
  4528. function initSmallDeptByDept() {
  4529. let code = escape($('#inpatientWardBeHospitalized').val()).replace(/\+/g, '%2B');
  4530. //小科室列表
  4531. $.ajax({
  4532. type: "GET",
  4533. url: '/thmz/getSmallDeptByDept?code=' + code,
  4534. dataType: "json",
  4535. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4536. success: function (res) {
  4537. if (res == '401' || res == 401) {
  4538. window.location.href = '/thmz/login/view'
  4539. return;
  4540. }
  4541. var html = '';
  4542. $.each(res.data, function (commentIndex, comment) {
  4543. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4544. });
  4545. $('#smallWardBeHospitalized').empty();
  4546. $('#smallWardBeHospitalized').html(html);
  4547. $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
  4548. }
  4549. });
  4550. //病床数
  4551. $.ajax({
  4552. type: "GET",
  4553. url: '/thmz/getBedStatusNumByDept?code=' + code,
  4554. dataType: "json",
  4555. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4556. success: function (res) {
  4557. if (res == '401' || res == 401) {
  4558. window.location.href = '/thmz/login/view'
  4559. return;
  4560. }
  4561. if (res.code == 0) {
  4562. var data = res.data;
  4563. if (data == null) {
  4564. $("#totalBedNum").val(0);
  4565. $("#freeBedNum").val(0);
  4566. $("#occupationBedNum").val(0);
  4567. } else {
  4568. $("#totalBedNum").val(data.total);
  4569. $("#freeBedNum").val(data.free);
  4570. $("#occupationBedNum").val(data.occupation);
  4571. }
  4572. } else {
  4573. errorMesage(res);
  4574. }
  4575. }
  4576. });
  4577. }
  4578. /**
  4579. * 初始化门诊统筹下拉选
  4580. */
  4581. function initMztcSelect() {
  4582. var selectHtml = '<option value="0">否</option><option value="1">是</option>';
  4583. $('#zgmztczf').html(selectHtml);
  4584. $('#zgmztczf').selectpicker('refresh');
  4585. var gzZfSelectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
  4586. $('#grzhzf').html(gzZfSelectHtml);
  4587. $('#grzhzf').selectpicker('refresh');
  4588. }
  4589. /**
  4590. * 初始化手术下拉选
  4591. */
  4592. function initMzssSelect() {
  4593. var selectHtml = '<option value="0">否</option><option value="1">是</option>';
  4594. $('#urgentClinicFlag').html(selectHtml);
  4595. $('#urgentClinicFlag').selectpicker('refresh');
  4596. $('#urgentClinicFlag').selectpicker('val', "0");
  4597. $('#urgentClinicFlag').selectpicker('refresh');
  4598. var bcHtml = '<option value="1">正常</option><option value="2">加班</option>';
  4599. $('#ssbc').html(bcHtml);
  4600. $('#ssbc').selectpicker('refresh');
  4601. $('#ssbc').selectpicker('val', "1");
  4602. $('#ssbc').selectpicker('refresh');
  4603. }
  4604. /**
  4605. * 初始化医疗范文范围下拉选
  4606. * @param templateTypeId
  4607. */
  4608. function initTemplateTypeSelect(templateTypeId) {
  4609. $.ajax({
  4610. type: "GET",
  4611. url: '/thmz/getTemplateTypes',
  4612. contentType: "application/json;charset=UTF-8",
  4613. dataType: "json",
  4614. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4615. success: function (res) {
  4616. if (res == '401' || res == 401) {
  4617. window.location.href = '/thmz/login/view'
  4618. return;
  4619. }
  4620. if (res.code == 0) {
  4621. res.data.forEach(function (item) {
  4622. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  4623. $('#' + templateTypeId).append(html);
  4624. });
  4625. $('#' + templateTypeId).selectpicker('refresh');
  4626. if(templateTypeId =='templateTypeForm'){
  4627. $('#'+templateTypeId).selectpicker('val', "0");
  4628. $('#'+templateTypeId).selectpicker('refresh');
  4629. fitTemplateData()
  4630. }
  4631. } else {
  4632. errorMesage(res);
  4633. }
  4634. }
  4635. });
  4636. }
  4637. /**
  4638. * 初始化医疗范文类型下拉选
  4639. * @param templateKindTypeId
  4640. */
  4641. function initTemplateKindTypeSelect(templateKindTypeId) {
  4642. $.ajax({
  4643. type: "GET",
  4644. url: '/thmz/getTemplateKindTypes',
  4645. contentType: "application/json;charset=UTF-8",
  4646. dataType: "json",
  4647. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4648. success: function (res) {
  4649. if (res == '401' || res == 401) {
  4650. window.location.href = '/thmz/login/view'
  4651. return;
  4652. }
  4653. if (res.code == 0) {
  4654. res.data.forEach(function (item) {
  4655. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  4656. $('#' + templateKindTypeId).append(html);
  4657. });
  4658. $('#' + templateKindTypeId).selectpicker('refresh');
  4659. $('#' + templateKindTypeId).selectpicker({
  4660. dropuAuto: false,
  4661. size: 5
  4662. });
  4663. } else {
  4664. errorMesage(res);
  4665. }
  4666. }
  4667. });
  4668. }
  4669. /**
  4670. * 初始频次下拉选
  4671. * @param id
  4672. * @param async 是否是异步 true 异步 false 同步
  4673. */
  4674. function initOrderFrequencys(id, async) {
  4675. $.ajax({
  4676. type: "GET",
  4677. url: '/thmz/getXyOrderFrequencys',
  4678. dataType: "json",
  4679. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4680. async: async,
  4681. success: function (res) {
  4682. if (res == '401' || res == 401) {
  4683. window.location.href = '/thmz/login/view'
  4684. return;
  4685. }
  4686. var html = '';
  4687. $.each(res.data, function (commentIndex, comment) {
  4688. html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
  4689. });
  4690. $('#' + id).empty();
  4691. $('#' + id).html(html);
  4692. $('#' + id).selectpicker('refresh');
  4693. }
  4694. });
  4695. }
  4696. /**
  4697. * 初始中药频次下拉选
  4698. * @param id
  4699. * @param async 是否是异步 true 异步 false 同步
  4700. */
  4701. function initZyOrderFrequencys(id, async) {
  4702. $.ajax({
  4703. type: "GET",
  4704. url: '/thmz/getZyOrderFrequencys',
  4705. dataType: "json",
  4706. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4707. async: async,
  4708. success: function (res) {
  4709. if (res == '401' || res == 401) {
  4710. window.location.href = '/thmz/login/view'
  4711. return;
  4712. }
  4713. var html = '';
  4714. $.each(res.data, function (commentIndex, comment) {
  4715. html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
  4716. });
  4717. $('#' + id).empty();
  4718. $('#' + id).html(html);
  4719. $('#' + id).selectpicker('refresh');
  4720. }
  4721. });
  4722. }
  4723. /**
  4724. * 初始中药服用说明
  4725. */
  4726. function initAllMzYshZdFysm() {
  4727. $.ajax({
  4728. type: "GET",
  4729. url: '/thmz/getAllMzYshZdFysm',
  4730. dataType: "json",
  4731. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4732. async: false,
  4733. success: function (res) {
  4734. if (res == '401' || res == 401) {
  4735. window.location.href = '/thmz/login/view'
  4736. return;
  4737. }
  4738. var html = '';
  4739. $.each(res.data, function (commentIndex, comment) {
  4740. if (comment.name.indexOf(",") < 0) {
  4741. //过滤组合的用法
  4742. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4743. }
  4744. });
  4745. $('.useType').empty();
  4746. $('.useType').html(html);
  4747. $('.useType').selectpicker('refresh');
  4748. $('.useType').selectpicker('val', "2");
  4749. $('.useType').selectpicker('refresh');
  4750. }
  4751. });
  4752. }
  4753. /**
  4754. * 初始用药方式下拉选
  4755. */
  4756. function initSupplyTypes() {
  4757. $.ajax({
  4758. type: "GET",
  4759. url: '/thmz/getSupplyTypes',
  4760. dataType: "json",
  4761. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4762. success: function (res) {
  4763. if (res == '401' || res == 401) {
  4764. window.location.href = '/thmz/login/view'
  4765. return;
  4766. }
  4767. var html = '';
  4768. $.each(res.data, function (commentIndex, comment) {
  4769. if (comment.supplyOcc === "71") {
  4770. html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
  4771. }
  4772. });
  4773. $('#supplyType').empty();
  4774. $('#supplyType').html(html);
  4775. $('#supplyType').selectpicker('refresh');
  4776. }
  4777. });
  4778. }
  4779. /**
  4780. * 初始化外配药剂型
  4781. */
  4782. function initDrugDosform() {
  4783. getAjaxRequst("/thmz/wpMzPrescription/queryYpZdDosage",{},true ,function (res) {
  4784. var html = '';
  4785. $.each(res.data, function (commentIndex, comment) {
  4786. html += '<option value="' + comment.name + '">' + comment.name + '</option>';
  4787. });
  4788. $('#drugDosform').html(html);
  4789. $('#drugDosform').selectpicker('refresh');
  4790. })
  4791. }
  4792. /**
  4793. * 初始化外配处方字典
  4794. */
  4795. function initZdRxAll(label,id) {
  4796. getAjaxRequst("/thmz/wpMzPrescription/queryZdRxAllByLabel",{label:label},true ,function (res) {
  4797. var html = '';
  4798. $.each(res.data, function (commentIndex, comment) {
  4799. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4800. });
  4801. $('#'+id).html(html);
  4802. $('#'+id).selectpicker('refresh');
  4803. })
  4804. }
  4805. /**
  4806. * 初始煎药方式下拉选
  4807. * @param async 是否是异步 true 异步 false 同步
  4808. */
  4809. function initZySupplyTypes(id, async) {
  4810. $.ajax({
  4811. type: "GET",
  4812. url: '/thmz/getSupplyTypes',
  4813. dataType: "json",
  4814. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4815. async: async,
  4816. success: function (res) {
  4817. if (res == '401' || res == 401) {
  4818. window.location.href = '/thmz/login/view'
  4819. return;
  4820. }
  4821. var html = '';
  4822. $.each(res.data, function (commentIndex, comment) {
  4823. if (comment.supplyOcc === "81") {
  4824. // html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4825. html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
  4826. }
  4827. });
  4828. $('#' + id).empty();
  4829. $('#' + id).html(html);
  4830. $('#' + id).selectpicker('refresh');
  4831. $('#' + id).selectpicker({
  4832. dropuAuto: false,
  4833. size: 10
  4834. });
  4835. }
  4836. });
  4837. }
  4838. /**
  4839. * 初始查检查部位
  4840. */
  4841. function initYshPart() {
  4842. $.ajax({
  4843. type: "GET",
  4844. url: '/thmz/getYshPart',
  4845. dataType: "json",
  4846. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4847. success: function (res) {
  4848. if (res == '401' || res == 401) {
  4849. window.location.href = '/thmz/login/view'
  4850. return;
  4851. }
  4852. var html = '';
  4853. $.each(res.data, function (commentIndex, comment) {
  4854. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
  4855. });
  4856. $('#yshPart').empty();
  4857. $('#yshPart').html(html);
  4858. $('#yshPart').selectpicker('refresh');
  4859. $('#yshPart').selectpicker({
  4860. dropuAuto: false,
  4861. size: 10
  4862. });
  4863. }
  4864. });
  4865. }
  4866. /**
  4867. * 初始化验物下拉选
  4868. */
  4869. function initJyZdSample() {
  4870. $.ajax({
  4871. type: "GET",
  4872. url: '/thmz/getJyZdSample',
  4873. dataType: "json",
  4874. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4875. success: function (res) {
  4876. if (res == '401' || res == 401) {
  4877. window.location.href = '/thmz/login/view'
  4878. return;
  4879. }
  4880. var html = '';
  4881. $.each(res.data, function (commentIndex, comment) {
  4882. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
  4883. });
  4884. $('#jyZdSample').empty();
  4885. $('#jyZdSample').html(html);
  4886. $('#jyZdSample').selectpicker('refresh');
  4887. $('#jyZdSample').selectpicker({
  4888. dropuAuto: false,
  4889. size: 10
  4890. });
  4891. }
  4892. });
  4893. }
  4894. /**
  4895. * 初始化当前医生说书科室
  4896. */
  4897. function initClinicDeptNo() {
  4898. $.ajax({
  4899. type: "GET",
  4900. url: '/thmz/getUnitCodeByCurrentUser',
  4901. dataType: "json",
  4902. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  4903. success: function (res) {
  4904. if (res == '401' || res == 401) {
  4905. window.location.href = '/thmz/login/view'
  4906. return;
  4907. }
  4908. var html = '';
  4909. $.each(res.data, function (commentIndex, comment) {
  4910. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  4911. });
  4912. $('#clinicDeptNo').empty();
  4913. $('#clinicDeptNo').html(html);
  4914. $('#clinicDeptNo').selectpicker('refresh');
  4915. var userIdCode = localStorage.getItem("userIdCode");
  4916. var deptNo = localStorage.getItem(userIdCode);
  4917. if (deptNo != null && deptNo != "") {
  4918. $('#clinicDeptNo').selectpicker('val', deptNo);
  4919. $('#clinicDeptNo').selectpicker('refresh');
  4920. }
  4921. }
  4922. });
  4923. }
  4924. /**
  4925. * 保存当前药品到右边处方区域
  4926. * @param index 0 西药 1中药 2 诊疗和社备
  4927. */
  4928. function saveMedicine(index) {
  4929. if (index == 0) {
  4930. saveWesternMedicineWithCheck(true, null);
  4931. } else if (index == 1) {
  4932. saveChineseMedicine(true);
  4933. }
  4934. }
  4935. /**
  4936. * 保存当前药品到右边处方区域 西药
  4937. * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  4938. * orderNoParmams
  4939. */
  4940. function saveWesternMedicineWithCheck(calculateTotalAmountFlag, orderNoParmams) {
  4941. //是新增药品还是编辑 true 修改 默认false
  4942. var updateFlag = $("#western_medicine_update_flag").val();
  4943. if (updateFlag == "true" || updateFlag == true) {
  4944. saveWesternMedicine(calculateTotalAmountFlag);
  4945. } else {
  4946. //当前药房编码
  4947. var currentGroupNo = $("#current_groupNo").val();
  4948. if (currentGroupNo == "") {
  4949. errorMesageSimaple("您未选择任何药品");
  4950. return;
  4951. }
  4952. if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
  4953. initNavTabs(0, currentGroupNo, orderNoParmams);
  4954. }
  4955. var tableId = $("#xyTab li.active").find("a").attr("href");
  4956. var childrens = $(tableId).find("div:eq(0)").children().length;
  4957. var thisGroupNo = $(tableId).find("input.current_groupNo").val();
  4958. var flag = childrens === 5;
  4959. if (!calculateTotalAmountFlag) {
  4960. flag = childrens === 5 && $(tableId).is(':last-child');
  4961. }
  4962. if (thisGroupNo != null && thisGroupNo != '' && currentGroupNo != thisGroupNo) {
  4963. //当前编辑的处方与选中的品类非同一处方能保存的
  4964. var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
  4965. //是否需要新增处方页,以保存医材处方
  4966. var needAddTable = true;
  4967. for (var i = 0; i < currentGroupNos.length; i++) {
  4968. if ($(currentGroupNos[i]).val() == currentGroupNo) {
  4969. var next = $(currentGroupNos[i]).next();
  4970. if (needAddTable && $(next).children().length < 5) {
  4971. var parentId = $(currentGroupNos[i]).parent().attr("id");
  4972. //切换处方
  4973. $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
  4974. //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
  4975. //因为存在没有满5个的处方页,直接保存到该页
  4976. needAddTable = false;
  4977. }
  4978. }
  4979. }
  4980. if (needAddTable) {
  4981. //91 医材
  4982. var message = "医材需要单独处方,是否需要新增医材处方?";
  4983. if (currentGroupNo == '71') {
  4984. message = "普通西成药需要单独处方,是否需要新增处方?"
  4985. } else if (currentGroupNo == '111') {
  4986. message = "麻、精一药物需要单独处方,是否需要新增处方?"
  4987. } else if (currentGroupNo == '131') {
  4988. message = "精二药物需要单独处方,是否需要新增处方?"
  4989. }
  4990. if (calculateTotalAmountFlag) {
  4991. $("#messageModal").modal();
  4992. $("#messageContent").html(message);
  4993. $("#messageButton").off("click").on("click", function (t) {
  4994. $("#messageModal").modal("hide");
  4995. refreshNavTabs(0, currentGroupNo, orderNoParmams);
  4996. saveWesternMedicine(calculateTotalAmountFlag);
  4997. });
  4998. $("#cancelButton").off("click").on("click", function (t) {
  4999. return;
  5000. });
  5001. }
  5002. }
  5003. } else if (flag) {
  5004. if (calculateTotalAmountFlag) {
  5005. $("#messageModal").modal();
  5006. $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
  5007. $("#messageButton").off("click").on("click", function (t) {
  5008. $("#messageModal").modal("hide");
  5009. refreshNavTabs(0, currentGroupNo, orderNoParmams);
  5010. saveWesternMedicine(calculateTotalAmountFlag);
  5011. });
  5012. $("#cancelButton").off("click").on("click", function (t) {
  5013. return;
  5014. });
  5015. }
  5016. } else {
  5017. saveWesternMedicine(calculateTotalAmountFlag);
  5018. }
  5019. }
  5020. }
  5021. /**
  5022. * 保存当前药品到右边处方区域 西药
  5023. * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  5024. */
  5025. function saveWesternMedicine(calculateTotalAmountFlag) {
  5026. //当前药房编码
  5027. var currentGroupNo = $("#current_groupNo").val();
  5028. //药品名称
  5029. var westernMedicineNamme = $("#western_medicine_name").val();
  5030. var tableId = $("#xyTab li.active").find("a").attr("href");
  5031. if (tableId == undefined) {
  5032. refreshNavTabs(0, currentGroupNo, null);
  5033. tableId = $("#xyTab li.active").find("a").attr("href");
  5034. }
  5035. var thisGroupNo = $(tableId).find("input.current_groupNo").val();
  5036. if (currentGroupNo != thisGroupNo) {
  5037. //91 医材
  5038. var type = "医材";
  5039. if (currentGroupNo == '71') {
  5040. type = "普通西成药"
  5041. } else if (currentGroupNo == '111') {
  5042. type = "麻、精一药物"
  5043. } else if (currentGroupNo == '131') {
  5044. type = "精二药物"
  5045. }
  5046. errorMesageSimaple("【" + westernMedicineNamme + "】是" + type + ",无法保存到当前处方,请切换或者新增相应的处方进行保存。");
  5047. return;
  5048. }
  5049. //当前处方选项卡下标
  5050. var xyTabIndex = $("#xyTab li.active").index();
  5051. //组号
  5052. var groupId = $("#groupId").val();
  5053. if (groupId == null || groupId == '') {
  5054. errorMesageSimaple("组号为空,请选择组号!");
  5055. return;
  5056. }
  5057. groupId = parseInt(groupId);
  5058. if (groupId == null || isNaN(groupId)) {
  5059. errorMesageSimaple("组号为空,请选择组号!");
  5060. return;
  5061. }
  5062. if (gropuIdAndOrderNoMap == null) {
  5063. gropuIdAndOrderNoMap = new MyMap();
  5064. }
  5065. var exitIndex = gropuIdAndOrderNoMap.get(groupId);
  5066. if (exitIndex == null) {
  5067. exitIndex = xyTabIndex;
  5068. gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
  5069. }
  5070. if (xyTabIndex != exitIndex) {
  5071. var westernMedicineUpdateFlag = $("#western_medicine_update_flag").val();
  5072. var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
  5073. //非修改组号的情况下就需要切换组号
  5074. if (!((westernMedicineUpdateFlag == true || westernMedicineUpdateFlag == "true") && westernMedicineOriGroupId != groupId)) {
  5075. groupId = parseInt($("#groupId > option:last").val());
  5076. $("#groupId").selectpicker('val', groupId);
  5077. $('#groupId').selectpicker('refresh');
  5078. gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
  5079. appendGroupOrder();
  5080. }
  5081. warningMesageSimaple("同一组药必须出现在同一个处方中,当前组号已经被其他处方使用,系统已自动为您重新分配组号!");
  5082. //return;
  5083. }
  5084. //当前药品编码
  5085. var currentCode = $("#western_medicine_current_code").val();
  5086. //当前药品规格
  5087. var currentSerial = $("#western_medicine_current_serial").val();
  5088. //用法编码
  5089. var supplyType = $("#supplyType").val();
  5090. //用法描述
  5091. var supplyTypeText = $('#supplyType option:selected').text();
  5092. supplyTypeText = supplyTypeText.substring(0, supplyTypeText.indexOf("["));
  5093. //药品默认单次使用剂量
  5094. var drugWinDb = $("#drugWinDb").val();
  5095. //处方实际单次使用剂量
  5096. var drugWin = $("#drugWin").val();
  5097. //剂量单位
  5098. var drugWinUnit = $('#drugWinUnit option:selected').text();
  5099. //drugWinUnit = drugWinUnit.substring(0, drugWinUnit.indexOf("("));
  5100. //天数
  5101. var dayNum = $("#dayNum").val();
  5102. //频次编码
  5103. var orderFrequency = $("#orderFrequency").val();
  5104. //频次描述
  5105. var orderFrequencyText = $('#orderFrequency option:selected').text();
  5106. orderFrequencyText = orderFrequencyText.substring(0, orderFrequencyText.indexOf("("));
  5107. //总量
  5108. var gross = $("#gross").val();
  5109. //包装单位
  5110. var packUnit = $("#packUnit").val();
  5111. if (packUnit == null) {
  5112. packUnit = "";
  5113. }
  5114. //医嘱码
  5115. var medicalAdvice = $("#medicalAdvice").val();
  5116. //医嘱内容
  5117. var medicalAdviceText = $('#medicalAdvice option:selected').text();
  5118. let tmpMedicalAdviceText = medicalAdviceText.substring(0, medicalAdviceText.indexOf("("));
  5119. //金额
  5120. var totalRetprice = parseFloat($("#totalRetprice").val());
  5121. //单价
  5122. var packRetprice = $("#packRetprice").val();
  5123. //皮试结果
  5124. var tryResult = $("#tryResult").val();
  5125. //药品大类标志
  5126. var categoriesFlag = $("#categoriesFlag").val();
  5127. //报销自费标识
  5128. var xyHospApprFlag = $("#xyHospApprFlag").val();
  5129. if (currentCode == null || currentCode == '') {
  5130. if (calculateTotalAmountFlag) {
  5131. errorMesageSimaple("未选择任何药品!");
  5132. }
  5133. return;
  5134. }
  5135. if (currentGroupNo != '91') {
  5136. if (supplyType == null || supplyType == "") {
  5137. errorMesageSimaple("用法为空!");
  5138. return;
  5139. }
  5140. if (drugWin == null || drugWin == "") {
  5141. errorMesageSimaple("剂量为空!");
  5142. return;
  5143. }
  5144. if (dayNum == null || dayNum == "") {
  5145. errorMesageSimaple("天数为空!");
  5146. return;
  5147. }
  5148. if (orderFrequency == null || orderFrequency == "") {
  5149. errorMesageSimaple("频次为空!");
  5150. return;
  5151. }
  5152. }
  5153. if (gross == null || gross == "") {
  5154. errorMesageSimaple("总量为空!");
  5155. return;
  5156. }
  5157. var manufactoryName = $("#manufactoryName").val();
  5158. var html = '<div class="form-group">';
  5159. html += '<span class="groupId">' + groupId + '</span>' + '.<span style="margin-left: 5px"></span>';
  5160. html += westernMedicineNamme;
  5161. if (manufactoryName != null && manufactoryName != 'null' && manufactoryName != "") {
  5162. html += "(" + manufactoryName + ")"
  5163. }
  5164. html += '&nbsp;&nbsp;&nbsp;&nbsp;';
  5165. html += $("#specification").val();
  5166. html += '&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;';
  5167. //html += drugWinDb + drugWinUnit + ' 共';
  5168. html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
  5169. html += '用法:' + supplyTypeText + ' ';
  5170. html += drugWin + drugWinUnit + ' ';
  5171. html += '频次:' + orderFrequencyText + ' ';
  5172. html += dayNum + '天 ';
  5173. if (tryResult != null && tryResult != 'null' && tryResult != "") {
  5174. if (tryResult == "100" || tryResult == 100) {
  5175. html += '皮试 ';
  5176. } else {
  5177. html += '皮试结果: ' + $('#tryResult option:selected').text();
  5178. }
  5179. }
  5180. if (medicalAdvice != null && medicalAdvice != '') {
  5181. html += '医嘱:' + tmpMedicalAdviceText;
  5182. }
  5183. 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>';
  5184. 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>';
  5185. 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>';
  5186. 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>';
  5187. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  5188. html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
  5189. html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
  5190. html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
  5191. html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
  5192. html += '<input type="hidden" class="temporary_items_supplyTypeText" value="' + supplyTypeText + '"/>';
  5193. html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
  5194. html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
  5195. html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
  5196. html += '<input type="hidden" class="temporary_items_drugWinUnitText" value="' + drugWinUnit+ '"/>';
  5197. html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
  5198. html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
  5199. html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
  5200. html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
  5201. html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
  5202. html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
  5203. html += '<input type="hidden" class="temporary_items_medicalAdviceText" value="' + medicalAdviceText + '"/>';
  5204. html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
  5205. html += '<input type="hidden" class="temporary_items_tryResult" value="' + tryResult + '"/>';
  5206. html += '<input type="hidden" class="temporary_items_currentGroupNo" value="' + currentGroupNo + '"/>';
  5207. html += '<input type="hidden" class="temporary_items_categoriesFlag" value="' + categoriesFlag + '"/>';
  5208. html += '<input type="hidden" class="temporary_items_xyHospApprFlag" value="' + xyHospApprFlag + '"/>';
  5209. html += '</div>';
  5210. var tableId = $("#xyTab li.active").find("a").attr("href");
  5211. //是新增药品还是编辑 true 修改 默认false
  5212. var updateFlag = $("#western_medicine_update_flag").val();
  5213. if (updateFlag == undefined || updateFlag == null) {
  5214. updateFlag = false;
  5215. }
  5216. // //原药品金额 如果是修改则需要设置
  5217. // var temporaryItemsAmount = 0;
  5218. //当前需要被移除元素的下个兄弟节点
  5219. var nextObj = null;
  5220. //当前修改的药品是不是最后一个
  5221. var isLast = false;
  5222. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  5223. if (formGroups != null && formGroups.length > 0) {
  5224. //如果是修改,需要减去原来的费用
  5225. if (updateFlag == "true" || updateFlag == true) {
  5226. //药品有可能会修改,所以,判断的时候要用原药品编码
  5227. var updateOriCode = $("#update_ori_code").val();
  5228. //规格有可能会修改,所以,判断的时候要用原规格
  5229. var updateOriSerial = $("#update_ori_serial").val();
  5230. //组号有可能会修改,所以,判断的时候要用原组号
  5231. var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
  5232. for (var i = 0; i < formGroups.length; i++) {
  5233. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  5234. var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
  5235. var temporaryItemsGroupId = $(formGroups[i]).find("input.temporary_items_groupId").val();
  5236. if (temporaryItemsCode === updateOriCode && temporaryItemsSerial === updateOriSerial && temporaryItemsGroupId == westernMedicineOriGroupId) {
  5237. //temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  5238. if (formGroups.length > 1) {
  5239. nextObj = $(formGroups[i]).next();
  5240. }
  5241. isLast = (i + 1) === formGroups.length;
  5242. $(formGroups[i]).remove();
  5243. break;
  5244. }
  5245. }
  5246. } else {
  5247. //因为药品可以换组号,要保证相同组号的在一起
  5248. for (var i = 0; i < formGroups.length; i++) {
  5249. var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
  5250. //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
  5251. if (temporaryItemsGroupId > groupId) {
  5252. nextObj = $(formGroups[i]);
  5253. break;
  5254. }
  5255. }
  5256. }
  5257. }
  5258. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  5259. if (nextObj == null || isLast) {
  5260. $(tableId).find("div:eq(0)").append(html);
  5261. } else {
  5262. $(nextObj).before(html);
  5263. }
  5264. //设置当前处方金额
  5265. //calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
  5266. if (calculateTotalAmountFlag) {
  5267. //设置总金额
  5268. calculateTotalAmount(true);
  5269. resetGroupIdSelect();
  5270. }
  5271. //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
  5272. var groupIdLast = $("#groupId option:last-child").text();
  5273. if (groupId === groupIdLast) {
  5274. appendGroupOrder();
  5275. }
  5276. //设置药品的用法,频次,天数
  5277. var map = groupIdMap.get(groupId);
  5278. if (map == null) {
  5279. map = new MyMap();
  5280. map.put("supplyType", supplyType);
  5281. map.put("orderFrequency", orderFrequency);
  5282. map.put("dayNum", dayNum);
  5283. groupIdMap.put(groupId, map);
  5284. }
  5285. //设置当前药品的品类
  5286. $(tableId).find("input.current_groupNo").val($("#current_groupNo").val());
  5287. $("#supplyType").selectpicker('val', null);
  5288. $('#supplyType').selectpicker('refresh');
  5289. clearWesternMedicine(false);
  5290. resetGroupIdMap();
  5291. }
  5292. /**
  5293. * 上移
  5294. * @param obj
  5295. */
  5296. function arrowUp(obj) {
  5297. var parentObject = $(obj).parent();
  5298. if ($(parentObject).prev() == null) {
  5299. return;
  5300. }
  5301. //当前元素的序号
  5302. var thisJcjyItemGroupId = null;
  5303. //前一个兄弟节点的序号
  5304. var prevJcjyItemGroupId = null;
  5305. //当是项目时有序号,进行序号调整
  5306. if ($(parentObject).find("span.jcjyItemGroupId") != null) {
  5307. thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
  5308. prevJcjyItemGroupId = $(parentObject).prev().find("span.jcjyItemGroupId").html();
  5309. $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
  5310. $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
  5311. }
  5312. $(parentObject).prev().before($(parentObject));
  5313. }
  5314. /**
  5315. * 下移
  5316. * @param obj
  5317. */
  5318. function arrowDown(obj) {
  5319. var parentObject = $(obj).parent();
  5320. if ($(parentObject).next() == null) {
  5321. return;
  5322. }
  5323. //当前元素的序号
  5324. var thisJcjyItemGroupId = null;
  5325. //后一个兄弟节点的序号
  5326. var afterJcjyItemGroupId = null;
  5327. //当是项目时有序号,进行序号调整
  5328. if ($(parentObject).find("span.jcjyItemGroupId") != null) {
  5329. thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
  5330. afterJcjyItemGroupId = $(parentObject).after().find("span.jcjyItemGroupId").html();
  5331. $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
  5332. $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
  5333. }
  5334. $(parentObject).next().after($(parentObject));
  5335. }
  5336. /**
  5337. * 修改西药
  5338. * @param obj
  5339. */
  5340. function editWesternMedicine(obj) {
  5341. clearWesternMedicine(true);
  5342. //是新增药品还是编辑 true 修改 默认false
  5343. $("#western_medicine_update_flag").val(true);
  5344. var parentObject = $(obj).parent();
  5345. //组号
  5346. $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
  5347. //组号有可能会修改,所以,判断的时候要用原组号
  5348. $("#western_medicine_ori_group_id").val($(parentObject).find("input.temporary_items_groupId").val());
  5349. $('#groupId').selectpicker('refresh');
  5350. //药品名称
  5351. $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
  5352. var code = $(parentObject).find("input.temporary_items_code").val();
  5353. var serial = $(parentObject).find("input.temporary_items_serial").val();
  5354. //当前药品编码
  5355. $("#western_medicine_current_code").val(code);
  5356. //当前药品规格
  5357. $("#western_medicine_current_serial").val(serial);
  5358. //当前修改药品原始编码
  5359. $("#update_ori_code").val(code);
  5360. //当前修改的药品原始规格
  5361. $("#update_ori_serial").val(serial);
  5362. //用法编码
  5363. $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
  5364. $('#supplyType').selectpicker('refresh');
  5365. $("#xyHospApprFlag").val($(parentObject).find("input.temporary_items_xyHospApprFlag").val());
  5366. $('#xyHospApprFlag').selectpicker('refresh');
  5367. //药品默认单次使用剂量
  5368. $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
  5369. //处方实际单次使用剂量
  5370. $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
  5371. //天数
  5372. $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
  5373. $('#dayNum').selectpicker('refresh');
  5374. //频次编码
  5375. $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
  5376. $('#orderFrequency').selectpicker('refresh');
  5377. //总量
  5378. $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
  5379. //医嘱
  5380. $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
  5381. $('#medicalAdvice').selectpicker('refresh');
  5382. //金额
  5383. $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
  5384. //单价
  5385. $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
  5386. //皮试结果
  5387. var tryResult = $(parentObject).find("input.temporary_items_tryResult").val();
  5388. //设置当前药品类型
  5389. $("#current_groupNo").val($(parentObject).find("input.temporary_items_currentGroupNo").val());
  5390. //设置当前药品大类
  5391. $("#categoriesFlag").val($(parentObject).find("input.temporary_items_categoriesFlag").val());
  5392. $.ajax({
  5393. type: "GET",
  5394. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=71",
  5395. contentType: "application/json;charset=UTF-8",
  5396. dataType: "json",
  5397. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  5398. success: function (res) {
  5399. if (res == '401' || res == 401) {
  5400. window.location.href = '/thmz/login/view'
  5401. return;
  5402. }
  5403. if (res.code == 0) {
  5404. if (res.data != null) {
  5405. var drugWinHtml = '';
  5406. if (res.data.weight != null) {
  5407. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  5408. $("#drugWin").val(res.data.weight);
  5409. $("#drugWinDb").val(res.data.weight);
  5410. }
  5411. drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
  5412. }
  5413. if (res.data.volum != null) {
  5414. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  5415. $("#drugWin").val(res.data.volum);
  5416. $("#drugWinDb").val(res.data.volum);
  5417. }
  5418. drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
  5419. }
  5420. if (res.data.miniUnit != null && res.data.miniUnit != "") {
  5421. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  5422. $("#drugWin").val(1);
  5423. $("#drugWinDb").val(1);
  5424. }
  5425. drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
  5426. }
  5427. $('#drugWinUnit').html(drugWinHtml);
  5428. $('#drugWinUnit').selectpicker('refresh');
  5429. //剂量单位
  5430. $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
  5431. $('#drugWinUnit').selectpicker('refresh');
  5432. if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
  5433. var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
  5434. $('#packUnit').html(html);
  5435. $('#packUnit').selectpicker('refresh');
  5436. //包装单位
  5437. $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
  5438. $('#packUnit').selectpicker('refresh');
  5439. }
  5440. if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
  5441. if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
  5442. initTryResultSelect(res.data.categoriesFlag);
  5443. $("#tryResult").val(tryResult);
  5444. $('#tryResult').selectpicker('refresh');
  5445. }
  5446. }
  5447. $("#packSize").val(res.data.packSize);
  5448. //厂家名称
  5449. $("#manufactoryName").val(res.data.manufactoryName);
  5450. //规格
  5451. $("#specification").val(res.data.specification);
  5452. }
  5453. } else {
  5454. errorMesage(res);
  5455. }
  5456. }
  5457. });
  5458. }
  5459. /**
  5460. * 修改中药
  5461. * @param obj
  5462. */
  5463. function editChineseMedicine(obj) {
  5464. //是新增药品还是编辑 true 修改 默认false
  5465. $("#chinese_medicine_update_flag").val(true);
  5466. var parentObject = $(obj).parent();
  5467. //当前药品编码
  5468. $("#chinese_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
  5469. //当前药品规格
  5470. $("#chinese_medicine_current_serial").val($(parentObject).find("input.temporary_items_serial").val());
  5471. //当前修改药品原始编码
  5472. $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
  5473. //当前修改的药品原始规格
  5474. $("#update_ori_serial").val($(parentObject).find("input.temporary_items_serial").val());
  5475. //中药类型
  5476. $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
  5477. $('#zyClassType').selectpicker('refresh');
  5478. //药品名称
  5479. $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
  5480. //单价
  5481. $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
  5482. //处方实际单次使用剂量
  5483. $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
  5484. //医嘱码
  5485. $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
  5486. $('#zyInstruction').selectpicker('refresh');
  5487. $("#zyHospApprFlag").val($(parentObject).find("input.temporary_items_zyHospApprFlag").val());
  5488. $('#zyHospApprFlag').selectpicker('refresh');
  5489. }
  5490. /**
  5491. * 修改辅助检查、检验项目
  5492. * @param obj
  5493. */
  5494. function editJyJcItem(obj) {
  5495. //是新增药品还是编辑 true 修改 默认false
  5496. $("#jcjy_update_flag").val(true);
  5497. var parentObject = $(obj).parent();
  5498. //当前项目编码
  5499. $("#jcjy_current_code").val($(parentObject).find("input.temporary_items_code").val());
  5500. //当前项目国家医保编码
  5501. $("#jy_national_code").val($(parentObject).find("input.temporary_jy_national_code").val());
  5502. //当前项目国家医保名称
  5503. $("#jy_national_name").val($(parentObject).find("input.temporary_jy_national_name").val());
  5504. $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
  5505. //项目名称
  5506. $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
  5507. //单价
  5508. $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
  5509. //备注
  5510. $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
  5511. var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
  5512. var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
  5513. //执行科室
  5514. var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
  5515. $("#execUnit").selectpicker('val', execUnit);
  5516. $('#execUnit').selectpicker('refresh');
  5517. if (jcJyZltype == 1 || jcJyZltype == "1") {
  5518. $("#jyZdSample").selectpicker('val', chargeUnit);
  5519. $('#jyZdSample').selectpicker('refresh');
  5520. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  5521. $("#jyQuantityDiv").removeClass("hide").addClass("in");
  5522. $("#yshPartDiv").removeClass("in").addClass("hide");
  5523. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  5524. //数量
  5525. var jyQuantity = $(parentObject).find("input.temporary_items_jyQuantity").val();
  5526. $("#jyQuantity").val(jyQuantity);
  5527. } else if (jcJyZltype == 2 || jcJyZltype == "2") {
  5528. $("#yshPart").selectpicker('val', chargeUnit);
  5529. $('#yshPart').selectpicker('refresh');
  5530. $("#yshPartDiv").removeClass("hide").addClass("in");
  5531. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  5532. $("#jyQuantityDiv").removeClass("in").addClass("hide");
  5533. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  5534. }
  5535. $("#jcJyZltype").val(jcJyZltype);
  5536. }
  5537. /**
  5538. * 修改外配药
  5539. * @param obj
  5540. */
  5541. function editWpMedicine(obj) {
  5542. //是新增药品还是编辑 true 修改 默认false
  5543. $("#wp_medicine_update_flag").val(true);
  5544. var parentObject = $(obj).parent();
  5545. //当前编码
  5546. $("#wp_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
  5547. //类别
  5548. $("#rxItemTypeCode").val($(parentObject).find("input.temporary_items_rxItemTypeCode").val());
  5549. $('#rxItemTypeCode').selectpicker('refresh');
  5550. //用法
  5551. $("#medcWayCodg").val($(parentObject).find("input.temporary_items_medcWayCodg").val());
  5552. $('#medcWayCodg').selectpicker('refresh');
  5553. //天数
  5554. $("#medcDays").val($(parentObject).find("input.temporary_items_medcDays").val())
  5555. $('#medcDays').selectpicker('refresh');
  5556. //药品名称
  5557. $("#wp_medicine_name").val($(parentObject).find("input.temporary_items_wpMedicineName").val())
  5558. //最小剂量单位
  5559. $("#sinDosunt").val($(parentObject).find("input.temporary_items_sinDosunt").val())
  5560. //剂型
  5561. $("#drugDosform").val($(parentObject).find("input.temporary_items_drugDosform").val())
  5562. //最小剂量
  5563. $("#sinDoscnt").val($(parentObject).find("input.temporary_items_sinDoscnt").val())
  5564. //频次
  5565. $("#usedFrquCodg").val($(parentObject).find("input.temporary_items_usedFrquCodg").val());
  5566. $('#usedFrquCodg').selectpicker('refresh');
  5567. //单位
  5568. $("#drugDosunt").val($(parentObject).find("input.temporary_items_drugDosunt").val())
  5569. //总量
  5570. $("#drugCnt").val($(parentObject).find("input.temporary_items_drugCnt").val())
  5571. //规格
  5572. $("#drugSpec").val($(parentObject).find("input.temporary_items_drugSpec").val())
  5573. //报销自费标识
  5574. $("#wpHospApprFlag").val($(parentObject).find("input.temporary_items_wpHospApprFlag").val())
  5575. $('#wpHospApprFlag').selectpicker('refresh');
  5576. //厂家
  5577. $("#prdrName").val($(parentObject).find("input.temporary_items_prdrName").val())
  5578. }
  5579. /**
  5580. * 修改诊疗项目
  5581. * @param obj
  5582. */
  5583. function editZlItem(obj) {
  5584. //是新增药品还是编辑 true 修改 默认false
  5585. $("#zl_update_flag").val(true);
  5586. var parentObject = $(obj).parent();
  5587. //当前项目编码
  5588. $("#zl_current_code").val($(parentObject).find("input.temporary_items_code").val());
  5589. $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
  5590. //项目名称
  5591. $("#zlItem").val($(parentObject).find("input.temporary_items_zlItemName").val());
  5592. //单价
  5593. $("#zlItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
  5594. //备注
  5595. $("#zlRemark").val($(parentObject).find("input.temporary_items_remark").val());
  5596. var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
  5597. //数量
  5598. var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
  5599. //执行科室
  5600. var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
  5601. $("#zlHospApprFlag").val($(parentObject).find("input.temporary_items_zlHospApprFlag").val());
  5602. $('#zlHospApprFlag').selectpicker('refresh');
  5603. var descriptions = $(parentObject).find("input.temporary_items_code").val();
  5604. if (descriptions != null && descriptions != "" && descriptions != 'null') {
  5605. $("#descriptions").val(descriptions);
  5606. }
  5607. var dayZlNum = $(parentObject).find("input.temporary_items_dayZlNum").val();
  5608. if (dayZlNum != null && dayZlNum != "" && dayZlNum != 'null') {
  5609. $("#dayZlNum").selectpicker('val', dayZlNum);
  5610. $('#dayZlNum').selectpicker('refresh');
  5611. }
  5612. var orderFrequencyZl = $(parentObject).find("input.temporary_items_orderFrequencyZl").val();
  5613. if (orderFrequencyZl != null && orderFrequencyZl != "" && orderFrequencyZl != 'null') {
  5614. $("#orderFrequencyZl").selectpicker('val', orderFrequencyZl);
  5615. $('#orderFrequencyZl').selectpicker('refresh');
  5616. }
  5617. var totalNumZl = $(parentObject).find("input.temporary_items_totalNumZl").val();
  5618. if (totalNumZl != null && totalNumZl != "" && totalNumZl != 'null') {
  5619. $("#totalNumZl").val(totalNumZl);
  5620. }
  5621. $("#zlExecUnit").selectpicker('val', execUnit);
  5622. $('#zlExecUnit').selectpicker('refresh');
  5623. //描述
  5624. $("#chargeUnit").val(chargeUnit);
  5625. $("#itemQuantity").val(itemQuantity);
  5626. calculateZl(true);
  5627. }
  5628. /**
  5629. * 保存当前辅助检查、检验项目到右边处方区域 需要提示加价
  5630. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  5631. */
  5632. function saveJyJcItem(calculateTotalAmountFlag) {
  5633. //6岁内提示加价
  5634. var patientAge = $("#patientAge").text();
  5635. if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge <= 6) {
  5636. $.ajax({
  5637. type: "GET",
  5638. url: '/thmz/checkAdditionally?code=' + $("#jcjy_current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
  5639. contentType: "application/json;charset=UTF-8",
  5640. dataType: "json",
  5641. async: false,
  5642. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  5643. success: function (res) {
  5644. if (res == '401' || res == 401) {
  5645. window.location.href = '/thmz/login/view'
  5646. return;
  5647. }
  5648. if (res.code == 0) {
  5649. if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
  5650. var xlCode = res.data.xlCode;
  5651. xlCode = Multiply(100, xlCode);
  5652. $("#messageModal").modal();
  5653. $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,不满7周岁的儿童诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
  5654. $("#messageButton").off("click").on("click", function (t) {
  5655. $("#messageModal").modal("hide");
  5656. saveJyJcItemReal(calculateTotalAmountFlag);
  5657. });
  5658. $("#cancelButton").off("click");
  5659. } else {
  5660. //虽然是不满6岁,但是也没有需要加收的项目,直接保存
  5661. saveJyJcItemReal(calculateTotalAmountFlag);
  5662. }
  5663. } else {
  5664. errorMesage(res);
  5665. }
  5666. }
  5667. });
  5668. } else {
  5669. saveJyJcItemReal(calculateTotalAmountFlag);
  5670. }
  5671. }
  5672. /**
  5673. * 保存当前项目到右边处方区域
  5674. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  5675. */
  5676. function saveJyJcItemReal(calculateTotalAmountFlag) {
  5677. var tableId = $("#jcjyTab li.active").find("a").attr("href");
  5678. //组号
  5679. var groupId = $(tableId).find("div:eq(0)").children().length + 1;
  5680. //项目名称
  5681. var jcJyItem = $("#jcJyItem").val();
  5682. //当前项目编码
  5683. var currentCode = $("#jcjy_current_code").val();
  5684. //当前项目价格
  5685. var jcjyItemPrice = $("#jcjyItemPrice").val();
  5686. //执行科室
  5687. var execUnit = $("#execUnit").val();
  5688. //执行科室
  5689. var execUnitName = $('#execUnit option:selected').text();
  5690. execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
  5691. //描述编码
  5692. var chargeUnitCode = null;
  5693. var chargeUnitName = "";
  5694. //检验物或者检查部位
  5695. var chargeUnit = null;
  5696. var chargeUnitString = null;
  5697. //检验数量
  5698. var jyQuantity = null;
  5699. //备注
  5700. var remark = $("#remark").val();
  5701. //项目类型
  5702. var jcJyZltype = $("#jcJyZltype").val();
  5703. //检验项目国家医保
  5704. var jyNationalCode = null;
  5705. var jyNationalName = null;
  5706. if (jcJyZltype == "1" || jcJyZltype == 1) {
  5707. //检验
  5708. chargeUnit = $('#jyZdSample option:selected').text();
  5709. chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
  5710. chargeUnitCode = $('#jyZdSample').val();
  5711. chargeUnitName = " 检验物:";
  5712. jyQuantity = $('#jyQuantity').val();
  5713. jyNationalCode = $("#jy_national_code").val();
  5714. jyNationalName = $("#jy_national_name").val();
  5715. if (calculateTotalAmountFlag == true) {
  5716. if (jyQuantity == null || jyQuantity == "") {
  5717. errorMesageSimaple("检验项目数量为空!");
  5718. return;
  5719. }
  5720. if (jyQuantity <= 0) {
  5721. errorMesageSimaple("检验项目数量不能小于1!");
  5722. return;
  5723. }
  5724. }
  5725. } else if (jcJyZltype == "2" || jcJyZltype == 2) {
  5726. //检查
  5727. chargeUnit = $('#yshPart option:selected').text();
  5728. chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
  5729. chargeUnitCode = $('#yshPart').val();
  5730. chargeUnitString = $('button[data-id="yshPart"]').attr('title');
  5731. chargeUnitName = " 检查部位:";
  5732. }
  5733. if (currentCode == null || currentCode == '') {
  5734. if (calculateTotalAmountFlag == true) {
  5735. errorMesageSimaple("未选择任何项目!");
  5736. }
  5737. return;
  5738. }
  5739. //判断是否有重复的项目 返回true 说明有重复的
  5740. //彩超加收一个部位的不限制多开
  5741. if ("003913" != currentCode && verifyRepeat(currentCode, null, chargeUnitCode, 2)) {
  5742. return;
  5743. }
  5744. //原药品金额 如果是修改则需要设置
  5745. var temporaryItemsAmount = 0;
  5746. //当前需要被移除元素的下个兄弟节点
  5747. var nextObj = null;
  5748. //当前修改的药品是不是最后一个
  5749. var isLast = false;
  5750. //是新增药品还是编辑 true 修改 默认false
  5751. var updateFlag = $("#jcjy_update_flag").val();
  5752. if (updateFlag == undefined || updateFlag == null) {
  5753. updateFlag = false;
  5754. }
  5755. //如果是修改,需要减去原来的费用
  5756. //原组号
  5757. var oriGroupId = null;
  5758. if (updateFlag == "true" || updateFlag == true) {
  5759. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  5760. if (formGroups != null && formGroups.length > 0) {
  5761. var updateOriCode = $("#update_ori_code").val();
  5762. for (var i = 0; i < formGroups.length; i++) {
  5763. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  5764. if (temporaryItemsCode === updateOriCode) {
  5765. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  5766. if (formGroups.length > 1) {
  5767. nextObj = $(formGroups[i]).next();
  5768. }
  5769. isLast = (i + 1) === formGroups.length;
  5770. oriGroupId = $(formGroups[i]).find("span.jcjyItemGroupId").text();
  5771. $(formGroups[i]).remove();
  5772. break;
  5773. }
  5774. }
  5775. }
  5776. }
  5777. if (oriGroupId != null) {
  5778. groupId = oriGroupId;
  5779. }
  5780. var html = '<div class="form-group">';
  5781. html += '<span class="jcjyItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
  5782. html += jcJyItem + ' ';
  5783. if (jcJyZltype == "3" || jcJyZltype == 3) {
  5784. html += " 数量:" + itemQuantity;
  5785. }
  5786. if (execUnit != null && execUnit != "") {
  5787. html += " 执行科室:" + execUnitName;
  5788. }
  5789. if (chargeUnit != null && chargeUnit != '') {
  5790. html += chargeUnitName + chargeUnit;
  5791. }
  5792. if (remark != null && remark != '') {
  5793. html += ' 备注:' + remark;
  5794. }
  5795. 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>';
  5796. 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>';
  5797. 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>';
  5798. 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>';
  5799. if ($("#jcJyItemChargeDetail").hasClass("in")) {
  5800. 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>';
  5801. }
  5802. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  5803. html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
  5804. html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
  5805. html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
  5806. html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
  5807. html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
  5808. html += '<input type="hidden" class="temporary_items_desc_name" value="' + chargeUnitString + '"/>';
  5809. html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
  5810. html += '<input type="hidden" class="temporary_jy_national_code" value="' + jyNationalCode + '"/>';
  5811. html += '<input type="hidden" class="temporary_jy_national_name" value="' + jyNationalName + '"/>';
  5812. if (jyQuantity != null) {
  5813. html += '<input type="hidden" class="temporary_items_jyQuantity" value="' + jyQuantity + '"/>';
  5814. }
  5815. html += '</div>';
  5816. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  5817. if (nextObj == null || isLast) {
  5818. $(tableId).find("div:eq(0)").append(html);
  5819. } else {
  5820. $(nextObj).before(html);
  5821. }
  5822. //设置当前处方金额
  5823. //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
  5824. if (calculateTotalAmountFlag) {
  5825. //设置总金额
  5826. calculateTotalAmount(true);
  5827. }
  5828. clearJyJcItem();
  5829. }
  5830. /**
  5831. * 保存外配处方到右方区域
  5832. */
  5833. function saveWpOrder(needCalcu) {
  5834. if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
  5835. initNavTabs(6, null, null);
  5836. }
  5837. var tableId = $("#wpMedicineTab li.active").find("a").attr("href");
  5838. //组号
  5839. var groupId = $(tableId).find("div:eq(0)").children().length + 1;
  5840. //药品名称
  5841. var wpMedicineName = $("#wp_medicine_name").val();
  5842. //当前药品编码
  5843. var currentCode = $("#wp_medicine_current_code").val();
  5844. //药品类别
  5845. var rxItemTypeCode = $("#rxItemTypeCode").val();
  5846. //用法
  5847. var medcWayCodg = $("#medcWayCodg").val();
  5848. //天数
  5849. var medcDays = $("#medcDays").val();
  5850. //最小剂量单位
  5851. var sinDosunt = $("#sinDosunt").val();
  5852. //剂量
  5853. var sinDoscnt = $("#sinDoscnt").val();
  5854. //剂型
  5855. var drugDosform = $("#drugDosform").val();
  5856. //用法名称
  5857. var medcWayCodgName = $('#medcWayCodg option:selected').text();
  5858. //频次
  5859. var usedFrquCodg = $("#usedFrquCodg").val();
  5860. var usedFrquCodgName = $('#usedFrquCodg option:selected').text();
  5861. //单位
  5862. var drugDosunt = $("#drugDosunt").val();
  5863. //总量
  5864. var drugCnt = $("#drugCnt").val();
  5865. //规格
  5866. var drugSpec = $("#drugSpec").val();
  5867. //报销自费标识
  5868. var wpHospApprFlag = $("#wpHospApprFlag").val();
  5869. if (currentCode == null || currentCode == '') {
  5870. errorMesageSimaple("未选择任何药品!");
  5871. return;
  5872. }
  5873. if(stringIsBlank(rxItemTypeCode)){
  5874. errorMesageSimaple("未选择药品类别!");
  5875. return;
  5876. }
  5877. if(stringIsBlank(medcWayCodg)){
  5878. errorMesageSimaple("未选择用法!");
  5879. return;
  5880. }
  5881. if(stringIsBlank(usedFrquCodg)){
  5882. errorMesageSimaple("未选择频次!");
  5883. return;
  5884. }
  5885. if(stringIsBlank(medcDays)){
  5886. errorMesageSimaple("未选择天数!");
  5887. return;
  5888. }
  5889. if(stringIsBlank(sinDoscnt)){
  5890. errorMesageSimaple("未填写剂量!");
  5891. return;
  5892. }
  5893. if(stringIsBlank(drugCnt)){
  5894. errorMesageSimaple("未填写总量!");
  5895. return;
  5896. }
  5897. //判断是否有重复的项目 返回true 说明有重复的
  5898. if (verifyRepeat(currentCode, null, null, 6)) {
  5899. return;
  5900. }
  5901. //当前需要被移除元素的下个兄弟节点
  5902. var nextObj = null;
  5903. //当前修改的药品是不是最后一个
  5904. var isLast = false;
  5905. //是新增药品还是编辑 true 修改 默认false
  5906. var updateFlag = $("#wp_medicine_update_flag").val();
  5907. if (updateFlag == undefined || updateFlag == null) {
  5908. updateFlag = false;
  5909. }
  5910. if (updateFlag == "true" || updateFlag == true) {
  5911. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  5912. if (formGroups != null && formGroups.length > 0) {
  5913. var updateOriCode = $("#update_ori_code").val();
  5914. for (var i = 0; i < formGroups.length; i++) {
  5915. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  5916. if (temporaryItemsCode === updateOriCode) {
  5917. if (formGroups.length > 1) {
  5918. nextObj = $(formGroups[i]).next();
  5919. }
  5920. isLast = (i + 1) === formGroups.length;
  5921. $(formGroups[i]).remove();
  5922. break;
  5923. }
  5924. }
  5925. }
  5926. }
  5927. //厂家
  5928. var prdrName = $("#prdrName").val();
  5929. var html = '<div class="form-group">';
  5930. html += wpMedicineName;
  5931. if (prdrName != null && prdrName != 'null' && prdrName != "") {
  5932. html += "(" + prdrName + ")"
  5933. }
  5934. html += '&nbsp;&nbsp;&nbsp;&nbsp;';
  5935. html += drugSpec;
  5936. html += '&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;';
  5937. html += drugCnt + drugDosunt + " " + '<br/><span style="margin-left: 15px"></span>';
  5938. html += '用法:' + medcWayCodgName + ' ';
  5939. html += sinDoscnt + sinDosunt + ' ';
  5940. html += '频次:' + usedFrquCodgName + ' ';
  5941. html += medcDays + '天 ';
  5942. 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>';
  5943. 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>';
  5944. html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editWpMedicine(this)"></i>';
  5945. html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(6,this)"></i>';
  5946. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  5947. html += '<input type="hidden" class="temporary_items_wpMedicineGroupId" value="' + groupId + '"/>';
  5948. html += '<input type="hidden" class="temporary_items_wpMedicineName" value="' + wpMedicineName + '"/>';
  5949. html += '<input type="hidden" class="temporary_items_rxItemTypeCode" value="' + rxItemTypeCode + '"/>';
  5950. html += '<input type="hidden" class="temporary_items_medcWayCodg" value="' + medcWayCodg + '"/>';
  5951. html += '<input type="hidden" class="temporary_items_medcDays" value="' + medcDays + '"/>';
  5952. html += '<input type="hidden" class="temporary_items_prdrName" value="' + prdrName + '"/>';
  5953. html += '<input type="hidden" class="temporary_items_sinDosunt" value="' + sinDosunt + '"/>';
  5954. html += '<input type="hidden" class="temporary_items_drugDosform" value="' + drugDosform + '"/>';
  5955. html += '<input type="hidden" class="temporary_items_sinDoscnt" value="' + sinDoscnt + '"/>';
  5956. html += '<input type="hidden" class="temporary_items_usedFrquCodg" value="' + usedFrquCodg + '"/>';
  5957. html += '<input type="hidden" class="temporary_items_drugDosunt" value="' + drugDosunt + '"/>';
  5958. html += '<input type="hidden" class="temporary_items_drugCnt" value="' + drugCnt + '"/>';
  5959. html += '<input type="hidden" class="temporary_items_drugSpec" value="' + drugSpec + '"/>';
  5960. html += '<input type="hidden" class="temporary_items_wpHospApprFlag" value="' + wpHospApprFlag + '"/>';
  5961. html += '</div>';
  5962. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  5963. if (nextObj == null || isLast) {
  5964. $(tableId).find("div:eq(0)").append(html);
  5965. } else {
  5966. $(nextObj).before(html);
  5967. }
  5968. if(needCalcu){
  5969. calculateTotalAmount(true)
  5970. }
  5971. clearWpOrder();
  5972. }
  5973. /**
  5974. * 保存当前诊疗项目到右边处方区域 需要提示加价
  5975. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  5976. */
  5977. function saveZlItem(calculateTotalAmountFlag) {
  5978. //6岁内提示加价
  5979. var patientAge = $("#patientAge").text();
  5980. if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge <= 6) {
  5981. $.ajax({
  5982. type: "GET",
  5983. url: '/thmz/checkAdditionally?code=' + $("#zl_current_code").val() + "&jcJyZltype=3",
  5984. contentType: "application/json;charset=UTF-8",
  5985. dataType: "json",
  5986. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  5987. async: false,
  5988. success: function (res) {
  5989. if (res == '401' || res == 401) {
  5990. window.location.href = '/thmz/login/view'
  5991. return;
  5992. }
  5993. if (res.code == 0) {
  5994. if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
  5995. var xlCode = res.data.xlCode;
  5996. xlCode = Multiply(100, xlCode);
  5997. $("#messageModal").modal();
  5998. $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,不满7周岁的儿童诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
  5999. $("#messageButton").off("click").on("click", function (t) {
  6000. $("#messageModal").modal("hide");
  6001. saveZlItemReal(calculateTotalAmountFlag);
  6002. });
  6003. $("#cancelButton").off("click");
  6004. } else {
  6005. //虽然是不满6岁,但是也没有需要加收的项目,直接保存
  6006. saveZlItemReal(calculateTotalAmountFlag);
  6007. }
  6008. } else {
  6009. errorMesage(res);
  6010. }
  6011. }
  6012. });
  6013. } else {
  6014. saveZlItemReal(calculateTotalAmountFlag);
  6015. }
  6016. }
  6017. /**
  6018. * 保存当前项目到右边处方区域
  6019. * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  6020. */
  6021. function saveZlItemReal(calculateTotalAmountFlag) {
  6022. var tableId = $("#zlTab li.active").find("a").attr("href");
  6023. //组号
  6024. var groupId = $(tableId).find("div:eq(0)").children().length + 1;
  6025. //项目名称
  6026. var zlItem = $("#zlItem").val();
  6027. //当前项目编码
  6028. var currentCode = $("#zl_current_code").val();
  6029. //当前项目价格
  6030. var zlItemPrice = $("#zlItemPrice").val();
  6031. //单位
  6032. var chargeUnit = $("#chargeUnit").val();
  6033. //执行科室
  6034. var zlExecUnit = $("#zlExecUnit").val();
  6035. //执行科室
  6036. var zlExecUnitName = $('#zlExecUnit option:selected').text();
  6037. zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
  6038. //单量
  6039. var itemQuantity = $("#itemQuantity").val();
  6040. //规格
  6041. var descriptions = $("#descriptions").val();
  6042. //天数
  6043. var dayZlNum = $("#dayZlNum").val();
  6044. //频次
  6045. var orderFrequencyZl = $("#orderFrequencyZl").val();
  6046. //总量
  6047. var totalNumZl = $("#totalNumZl").val();
  6048. //描述编码
  6049. var chargeUnitCode = chargeUnit;
  6050. //备注
  6051. var remark = $("#zlRemark").val();
  6052. //报销自费标识
  6053. var zlHospApprFlag = $("#zlHospApprFlag").val();
  6054. if (calculateTotalAmountFlag == true) {
  6055. if (currentCode == null || currentCode == '') {
  6056. errorMesageSimaple("未选择任何项目!");
  6057. return;
  6058. }
  6059. if (totalNumZl == null || totalNumZl == "" || totalNumZl == "null") {
  6060. errorMesageSimaple("项目使用总量为空!");
  6061. return;
  6062. }
  6063. }
  6064. //判断是否有重复的项目 返回true 说明有重复的
  6065. if (verifyRepeat(currentCode, null, null, 3)) {
  6066. return;
  6067. }
  6068. //原药品金额 如果是修改则需要设置
  6069. var temporaryItemsAmount = 0;
  6070. //当前需要被移除元素的下个兄弟节点
  6071. var nextObj = null;
  6072. //当前修改的药品是不是最后一个
  6073. var isLast = false;
  6074. //是新增药品还是编辑 true 修改 默认false
  6075. var updateFlag = $("#zl_update_flag").val();
  6076. if (updateFlag == undefined || updateFlag == null) {
  6077. updateFlag = false;
  6078. }
  6079. //如果是修改,需要减去原来的费用
  6080. //原组号
  6081. var oriGroupId = null;
  6082. if (updateFlag == "true" || updateFlag == true) {
  6083. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  6084. if (formGroups != null && formGroups.length > 0) {
  6085. var updateOriCode = $("#update_ori_code").val();
  6086. for (var i = 0; i < formGroups.length; i++) {
  6087. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  6088. if (temporaryItemsCode === updateOriCode) {
  6089. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  6090. if (formGroups.length > 1) {
  6091. nextObj = $(formGroups[i]).next();
  6092. }
  6093. isLast = (i + 1) === formGroups.length;
  6094. oriGroupId = $(formGroups[i]).find("span.zlItemGroupId").text();
  6095. $(formGroups[i]).remove();
  6096. break;
  6097. }
  6098. }
  6099. }
  6100. }
  6101. if (oriGroupId != null) {
  6102. groupId = oriGroupId;
  6103. }
  6104. var html = '<div class="form-group">';
  6105. html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
  6106. html += zlItem + ' ';
  6107. if (descriptions != null && descriptions != "") {
  6108. html += " 规格:" + descriptions;
  6109. }
  6110. html += " 单量:" + itemQuantity;
  6111. if (chargeUnit != null && chargeUnit != '') {
  6112. html += chargeUnit;
  6113. }
  6114. if (dayZlNum != null && dayZlNum != "") {
  6115. html += " 天数:" + dayZlNum + "天";
  6116. }
  6117. if (orderFrequencyZl != null && orderFrequencyZl != "") {
  6118. html += " 频次:" + orderFrequencyZl;
  6119. }
  6120. if (totalNumZl != null && totalNumZl != "") {
  6121. html += " 总量:" + totalNumZl;
  6122. if (chargeUnit != null && chargeUnit != '') {
  6123. html += chargeUnit;
  6124. }
  6125. }
  6126. if (zlExecUnit != null && zlExecUnit != "") {
  6127. html += " 执行科室:" + zlExecUnitName;
  6128. }
  6129. if (remark != null && remark != '') {
  6130. html += ' 备注:' + remark;
  6131. }
  6132. 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>';
  6133. 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>';
  6134. 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>';
  6135. 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>';
  6136. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  6137. html += '<input type="hidden" class="temporary_items_zlItemName" value="' + zlItem + '"/>';
  6138. html += '<input type="hidden" class="temporary_items_amount" value="' + zlItemPrice + '"/>';
  6139. html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
  6140. html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
  6141. html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
  6142. html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
  6143. html += '<input type="hidden" class="temporary_items_descriptions" value="' + descriptions + '"/>';
  6144. html += '<input type="hidden" class="temporary_items_dayZlNum" value="' + dayZlNum + '"/>';
  6145. html += '<input type="hidden" class="temporary_items_orderFrequencyZl" value="' + orderFrequencyZl + '"/>';
  6146. html += '<input type="hidden" class="temporary_items_zlHospApprFlag" value="' + zlHospApprFlag + '"/>';
  6147. html += '<input type="hidden" class="temporary_items_totalNumZl" value="' + totalNumZl + '"/>';
  6148. html += '</div>';
  6149. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  6150. if (nextObj == null || isLast) {
  6151. $(tableId).find("div:eq(0)").append(html);
  6152. } else {
  6153. $(nextObj).before(html);
  6154. }
  6155. //设置当前处方金额
  6156. //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
  6157. if (calculateTotalAmountFlag) {
  6158. //设置总金额
  6159. calculateTotalAmount(true);
  6160. }
  6161. clearZlItem();
  6162. }
  6163. /**
  6164. * 临时保存住院证
  6165. * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
  6166. */
  6167. function saveZyReq(messageFlag) {
  6168. //如果
  6169. if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
  6170. initNavTabs(4, null, null);
  6171. }
  6172. var tableId = $("#zyReqTab li.active").find("a").attr("href");
  6173. //病区编码
  6174. var inpatientWardBeHospitalized = $("#inpatientWardBeHospitalized").val();
  6175. //小病室编码
  6176. var smallWardBeHospitalized = $("#smallWardBeHospitalized").val();
  6177. //入院状态编码
  6178. var admissStatus = $("#admissStatus").val();
  6179. //病区名称
  6180. var inpatientWardText = $('#inpatientWardBeHospitalized option:selected').text();
  6181. //小科室名称
  6182. var smallWardText = $('#smallWardBeHospitalized option:selected').text();
  6183. //入院状态名称
  6184. var admissStatusText = $('#admissStatus option:selected').text();
  6185. //入院病情代码
  6186. var conditionCode = $("#conditionCode").val();
  6187. //入院途径代码
  6188. var routeOfAdmission = $("#routeOfAdmission").val();
  6189. //联系人姓名
  6190. var contacterName = $("#contacterName").val();
  6191. //联系人关系
  6192. var contacterRelationship = $("#contacterRelationship").val();
  6193. //联系人电话
  6194. var contacterPhone = $("#contacterPhone").val();
  6195. //联系人地址
  6196. var contacterAddress = $("#contacterAddress").val();
  6197. //押金
  6198. var deposit = $("#deposit").val();
  6199. //入院病情代码
  6200. var conditionCodeText = $('#conditionCode option:selected').text();
  6201. //入院途径代码
  6202. var routeOfAdmissionText = $('#routeOfAdmission option:selected').text();
  6203. if (admissStatusText == null || admissStatusText == '') {
  6204. errorMesageSimaple("未选择入院状态!");
  6205. return;
  6206. }
  6207. if (conditionCode == null || conditionCode == '') {
  6208. errorMesageSimaple("未选择入院病情!");
  6209. return;
  6210. }
  6211. if (routeOfAdmission == null || routeOfAdmission == '') {
  6212. errorMesageSimaple("未选择入院途径!");
  6213. return;
  6214. }
  6215. if (inpatientWardBeHospitalized == null || inpatientWardBeHospitalized == '') {
  6216. errorMesageSimaple("未选择入院病区!");
  6217. return;
  6218. }
  6219. if (admissStatus == null || admissStatus == '') {
  6220. errorMesageSimaple("未选择入院状态!");
  6221. return;
  6222. }
  6223. if (messageFlag == "true" || messageFlag == true) {
  6224. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  6225. if (formGroups != null && formGroups.length > 0) {
  6226. $("#messageModal").modal();
  6227. $("#messageContent").html("当前病人已经有一个暂存的入院申请,是否需要替换该申请?");
  6228. $("#messageButton").off("click").on("click", function (t) {
  6229. $("#messageModal").modal("hide");
  6230. saveZyReq(false);
  6231. });
  6232. $("#cancelButton").off("click");
  6233. return;
  6234. }
  6235. }
  6236. var html = '<div class="form-group"> 收住院';
  6237. if (inpatientWardText != null) {
  6238. html += " [" + inpatientWardText;
  6239. }
  6240. if (smallWardText != null) {
  6241. html += " (" + smallWardText + ") ";
  6242. }
  6243. if (inpatientWardText != null) {
  6244. html += "]";
  6245. }
  6246. if (admissStatusText != null) {
  6247. html += " " + admissStatusText;
  6248. }
  6249. if (conditionCodeText != null) {
  6250. html += " " + conditionCodeText;
  6251. }
  6252. if (routeOfAdmissionText != null) {
  6253. html += " " + routeOfAdmissionText;
  6254. }
  6255. html += ' 侯床';
  6256. //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>';
  6257. 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>';
  6258. html += '<input type="hidden" class="temporary_inpatient_ward" value="' + inpatientWardBeHospitalized + '"/>';
  6259. html += '<input type="hidden" class="temporary_items_small_ward" value="' + smallWardBeHospitalized + '"/>';
  6260. html += '<input type="hidden" class="temporary_items_admiss_status" value="' + admissStatus + '"/>';
  6261. html += '<input type="hidden" class="temporary_items_condition_code" value="' + conditionCode + '"/>';
  6262. html += '<input type="hidden" class="temporary_items_route_of_admission" value="' + routeOfAdmission + '"/>';
  6263. html += '<input type="hidden" class="temporary_items_contacter_name" value="' + contacterName + '"/>';
  6264. html += '<input type="hidden" class="temporary_items_contacter_relationship" value="' + contacterRelationship + '"/>';
  6265. html += '<input type="hidden" class="temporary_items_contacter_phone" value="' + contacterPhone + '"/>';
  6266. html += '<input type="hidden" class="temporary_items_contacter_address" value="' + contacterAddress + '"/>';
  6267. html += '<input type="hidden" class="temporary_items_deposit" value="' + deposit + '"/>';
  6268. html += '</div>';
  6269. $(tableId).find("div:eq(0)").html(html);
  6270. clearZyReq();
  6271. }
  6272. /**
  6273. * 临时保存门诊手术
  6274. * @param messageFlag 是否需要提醒已经存在的相同诊间手术申请 true 提示
  6275. */
  6276. function saveOpRecord(messageFlag) {
  6277. //如果
  6278. if ($("#opRecordTab").find("li") == null || $("#opRecordTab").find("li").length == 0) {
  6279. initNavTabs(5, null, null);
  6280. }
  6281. var tableId = $("#opRecordTab li.active").find("a").attr("href");
  6282. //手术名称编码
  6283. var opCode = $("#opName").val();
  6284. //手术名称
  6285. var opNameText = $('#opName option:selected').text();
  6286. //手术时间
  6287. var opTime = $("#opTime").val();
  6288. //急诊标志
  6289. var urgentClinicFlag = $("#urgentClinicFlag").val();
  6290. //急诊标志名称
  6291. var urgentClinicFlagText = $('#urgentClinicFlag option:selected').text();
  6292. //班次
  6293. var ssbc = $("#ssbc").val();
  6294. //班次名称
  6295. var ssbcText = $('#ssbc option:selected').text();
  6296. //手术部位
  6297. var partCode = $("#partCode").val();
  6298. //手术部位名称
  6299. var partCodeText = $('#partCode option:selected').text();
  6300. //手术等级
  6301. var opScale = $("#opScale").val();
  6302. //手术等级名称
  6303. var opScaleText = $('#opScale option:selected').text();
  6304. //麻醉方式
  6305. var hocusCode = $("#hocusCode").val();
  6306. //麻醉方式名称
  6307. var hocusCodeText = $('#hocusCode option:selected').text();
  6308. //主刀医生
  6309. var doctorZd = $("#doctorZd").val();
  6310. //主刀医生名称
  6311. var doctorZdText = $('#doctorZd option:selected').text();
  6312. var opRecordRemark = $("#opRecordRemark").val();
  6313. if (opCode == null || opCode == '') {
  6314. errorMesageSimaple("手术名称为空!");
  6315. return;
  6316. }
  6317. if (opTime == null || opTime == '') {
  6318. errorMesageSimaple("手术时间为空!");
  6319. return;
  6320. }
  6321. if (urgentClinicFlag == null || urgentClinicFlag == '') {
  6322. errorMesageSimaple("急诊标志为空!");
  6323. return;
  6324. }
  6325. if (ssbc == null || ssbc == '') {
  6326. errorMesageSimaple("班次为空!");
  6327. return;
  6328. }
  6329. if (partCode == null || partCode == '') {
  6330. errorMesageSimaple("手术部位为空!");
  6331. return;
  6332. }
  6333. if (opScale == null || opScale == '') {
  6334. errorMesageSimaple("手术等级为空!");
  6335. return;
  6336. }
  6337. if (hocusCode == null || hocusCode == '') {
  6338. errorMesageSimaple("麻醉方式为空!");
  6339. return;
  6340. }
  6341. if (doctorZd == null || doctorZd == '') {
  6342. errorMesageSimaple("主刀医生为空!");
  6343. return;
  6344. }
  6345. //判断是否有重复的项目 返回true 说明有重复的
  6346. if (verifyRepeat(opName, null, null, 5)) {
  6347. return;
  6348. }
  6349. //当前需要被移除元素的下个兄弟节点
  6350. var nextObj = null;
  6351. //当前修改的手术是不是最后一个
  6352. var isLast = false;
  6353. //是新增药品还是编辑 true 修改 默认false
  6354. var updateFlag = $("#op_record_update_flag").val();
  6355. if (updateFlag == undefined || updateFlag == null) {
  6356. updateFlag = false;
  6357. }
  6358. //如果是修改
  6359. if (updateFlag == "true" || updateFlag == true) {
  6360. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  6361. if (formGroups != null && formGroups.length > 0) {
  6362. var updateOriCode = $("#update_ori_code").val();
  6363. for (var i = 0; i < formGroups.length; i++) {
  6364. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  6365. if (temporaryItemsCode === updateOriCode) {
  6366. if (formGroups.length > 1) {
  6367. nextObj = $(formGroups[i]).next();
  6368. }
  6369. isLast = (i + 1) === formGroups.length;
  6370. $(formGroups[i]).remove();
  6371. break;
  6372. }
  6373. }
  6374. }
  6375. }
  6376. var html = '<div class="form-group"> 手术名称:' + opNameText + ' 时间:' + opTime + ' 急诊标志:' + urgentClinicFlagText + ' 班次:' + ssbcText + ' 手术部位:' + partCodeText + ' 手术等级:' + opScaleText + ' 麻醉方式:' + hocusCodeText + ' 主刀医生:' + doctorZdText + ' 附注说明:' + opRecordRemark;
  6377. 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>';
  6378. 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>';
  6379. html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editOpRecord(this)"></i>';
  6380. 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>';
  6381. html += '<input type="hidden" class="temporary_items_code" value="' + opCode + '"/>';
  6382. html += '<input type="hidden" class="temporary_items_op_name" value="' + opNameText + '"/>';
  6383. html += '<input type="hidden" class="temporary_items_op_time" value="' + opTime + '"/>';
  6384. html += '<input type="hidden" class="temporary_items_urgent_clinic_flag" value="' + urgentClinicFlag + '"/>';
  6385. html += '<input type="hidden" class="temporary_items_ssbc" value="' + ssbc + '"/>';
  6386. html += '<input type="hidden" class="temporary_items_part_code" value="' + partCode + '"/>';
  6387. html += '<input type="hidden" class="temporary_items_op_scale" value="' + opScale + '"/>';
  6388. html += '<input type="hidden" class="temporary_items_hocus_code" value="' + hocusCode + '"/>';
  6389. html += '<input type="hidden" class="temporary_items_doctor_zd" value="' + doctorZd + '"/>';
  6390. html += '<input type="hidden" class="temporary_items_op_record_remark" value="' + opRecordRemark + '"/>';
  6391. html += '</div>';
  6392. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  6393. if (nextObj == null || isLast) {
  6394. $(tableId).find("div:eq(0)").append(html);
  6395. } else {
  6396. $(nextObj).before(html);
  6397. }
  6398. clearOpRecord();
  6399. }
  6400. /**
  6401. * 修改门诊手术
  6402. * @param obj
  6403. */
  6404. function editOpRecord(obj) {
  6405. //是新增药品还是编辑 true 修改 默认false
  6406. $("#op_record_update_flag").val(true);
  6407. var parentObject = $(obj).parent();
  6408. //当前项目编码
  6409. $("#opName").selectpicker('val', $(parentObject).find("input.temporary_items_code").val());
  6410. $('#opName').selectpicker('refresh');
  6411. $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
  6412. //手术时间
  6413. $("#opTime").val($(parentObject).find("input.temporary_items_op_time").val());
  6414. //急诊标志
  6415. $("#urgentClinicFlag").selectpicker('val', $(parentObject).find("input.temporary_items_urgent_clinic_flag").val());
  6416. $('#urgentClinicFlag').selectpicker('refresh');
  6417. //班次
  6418. $("#ssbc").selectpicker('val', $(parentObject).find("input.temporary_items_ssbc").val());
  6419. $('#ssbc').selectpicker('refresh');
  6420. //部位
  6421. $("#partCode").selectpicker('val', $(parentObject).find("input.temporary_items_part_code").val());
  6422. $('#partCode').selectpicker('refresh');
  6423. //等级
  6424. $("#opScale").selectpicker('val', $(parentObject).find("input.temporary_items_op_scale").val());
  6425. $('#opScale').selectpicker('refresh');
  6426. //麻醉方式
  6427. $("#hocusCode").selectpicker('val', $(parentObject).find("input.temporary_items_hocus_code").val());
  6428. $('#hocusCode').selectpicker('refresh');
  6429. //麻醉方式
  6430. $("#doctorZd").selectpicker('val', $(parentObject).find("input.temporary_items_doctor_zd").val());
  6431. $('#doctorZd').selectpicker('refresh');
  6432. $("#opRecordRemark").val($(parentObject).find("input.temporary_items_op_record_remark").val());
  6433. }
  6434. /**
  6435. * 删除药品或者项目
  6436. * @param index 0 西药 1 中药 2 检查检验 3诊疗 6外配药
  6437. * @param obj 当前点击的对象
  6438. */
  6439. function removeYpOrProject(index, obj) {
  6440. var tabId = null;
  6441. var className = null;
  6442. //西药
  6443. if (index == 0) {
  6444. tabId = "xyTab";
  6445. } else if (index == 1) {
  6446. //中成药
  6447. tabId = "zyTab";
  6448. } else if (index == 2) {
  6449. //辅助检查、检验
  6450. className = ".jcjyItemGroupId";
  6451. tabId = "jcjyTab";
  6452. } else if (index == 3) {
  6453. //诊疗
  6454. className = ".zlItemGroupId";
  6455. tabId = "zlTab";
  6456. }
  6457. else if (index == 4) {
  6458. //入院
  6459. tabId = "zyReqTab";
  6460. }
  6461. else if (index == 6) {
  6462. //外配药
  6463. className = ".wpMedicineGroupId";
  6464. tabId = "wpMedicineTab";
  6465. }
  6466. var tableId = $("#" + tabId + " li.active").find("a").attr("href");
  6467. //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
  6468. //calculateCfAmount(tableId, totalRetprice, null, index, 1);
  6469. //医技和诊疗的序号调整一下
  6470. if (index == 2 || index == 3) {
  6471. var nextAll = $(obj).parent().nextAll();
  6472. if (nextAll != null && nextAll.length > 0) {
  6473. for (var i = 0; i < nextAll.length; i++) {
  6474. var index = $(nextAll[i]).find(className).text();
  6475. $(nextAll[i]).find(className).text(index - 1);
  6476. }
  6477. }
  6478. }
  6479. var temporaryItemsGroupId = $(obj).parent().find("input.temporary_items_groupId").val();
  6480. var temporaryItemsGroupIds = $(obj).parent().parent().find("input.temporary_items_groupId");
  6481. if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
  6482. var count = 0;
  6483. for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
  6484. if (temporaryItemsGroupId == $(temporaryItemsGroupIds[i]).val()) {
  6485. count++;
  6486. }
  6487. }
  6488. //当前删除的药品组号是最后一个的时候,清空缓存
  6489. if (count == 1) {
  6490. groupIdMap.remove(temporaryItemsGroupId);
  6491. gropuIdAndOrderNoMap.remove(temporaryItemsGroupId);
  6492. }
  6493. }
  6494. $(obj).parent().remove();
  6495. if (index != 4) {
  6496. calculateTotalAmount(false);
  6497. }
  6498. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  6499. if (formGroups == null || formGroups.length == 0) {
  6500. if (index == 0) {
  6501. //西药被清空后,重置药房类型编码
  6502. $(tableId).find("input.current_groupNo").val(null);
  6503. //当本处方内容都被删除完后,也删除处方table
  6504. $("#" + tabId).find("a[href=\"" + tableId + "\"]").parent().remove();
  6505. $(tableId).remove();
  6506. //切换处方 最后一个被选中
  6507. $("#" + tabId).find("li:last > a").off("click").tab('show');
  6508. } else if (index == 1) {
  6509. //当中药处方被清空完后,重置当前中药类型为空
  6510. $("#current_zyClassType").val(null);
  6511. }
  6512. }
  6513. if (index == 0) {
  6514. resetGroupIdMap();
  6515. }
  6516. }
  6517. /**
  6518. * 重置组号与用法、频率天数缓存关系
  6519. */
  6520. function resetGroupIdMap() {
  6521. var temporaryItemsGroupIds = $("#xyTabContent").find("input.temporary_items_groupId");
  6522. if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
  6523. var list = [];
  6524. for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
  6525. var groupId = $(temporaryItemsGroupIds[i]).val();
  6526. if (list.indexOf(groupId) < 0) {
  6527. list.push(groupId);
  6528. }
  6529. }
  6530. var keys = groupIdMap.keySet();
  6531. for (var i = 0; i < keys.length; i++) {
  6532. var key = keys[i];
  6533. if (list.indexOf(key) < 0) {
  6534. groupIdMap.remove(key);
  6535. }
  6536. }
  6537. }
  6538. }
  6539. /**
  6540. * 清空西药
  6541. * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
  6542. */
  6543. function clearWesternMedicine(flag) {
  6544. $("#addPDiv").css("margin-left", "125px");
  6545. $("#hlyyypsms").removeClass("in").addClass("hide");
  6546. $("#western_medicine_update_flag").val(false);
  6547. $("#western_medicine_ori_group_id").val(null);
  6548. $("#update_ori_code").val(null);
  6549. $("#update_ori_serial").val(null);
  6550. //药品名称
  6551. $("#western_medicine_name").val(null);
  6552. //当前药品编码
  6553. $("#western_medicine_current_code").val(null);
  6554. //当前药品规格
  6555. $("#western_medicine_current_serial").val(null);
  6556. //当前药房编码
  6557. $("#current_groupNo").val(null);
  6558. if (flag) {
  6559. //用法编码
  6560. $("#supplyType").selectpicker('val', null);
  6561. $('#supplyType').selectpicker('refresh');
  6562. //$("#supplyType").removeAttr("disabled");
  6563. //天数
  6564. $("#dayNum").selectpicker('val', null);
  6565. $('#dayNum').selectpicker('refresh');
  6566. // $("#dayNum").removeAttr("disabled");
  6567. //频次编码
  6568. $("#orderFrequency").selectpicker('val', null);
  6569. $('#orderFrequency').selectpicker('refresh');
  6570. // $("#orderFrequency").removeAttr("disabled");
  6571. }
  6572. //药品默认单次使用剂量
  6573. $("#drugWinDb").val(null);
  6574. //处方实际单次使用剂量
  6575. $("#drugWin").val(null);
  6576. //剂量单位
  6577. $("#drugWinUnit").selectpicker('val', null);
  6578. $('#drugWinUnit').selectpicker('refresh');
  6579. //总量
  6580. $("#gross").val(null);
  6581. //包装单位
  6582. $("#packUnit").selectpicker('val', null);
  6583. $('#packUnit').selectpicker('refresh');
  6584. //单价
  6585. $("#packRetprice").val(null);
  6586. //金额
  6587. $("#totalRetprice").val(null);
  6588. //医嘱
  6589. $("#medicalAdvice").selectpicker('val', null);
  6590. $('#medicalAdvice').selectpicker('refresh');
  6591. $("#xyHospApprFlag").selectpicker('val', '0');
  6592. $('#xyHospApprFlag').selectpicker('refresh');
  6593. $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
  6594. //皮试结果
  6595. $("#tryResult").selectpicker('val', null);
  6596. $('#tryResult').selectpicker('refresh');
  6597. //$("#gross").attr("readonly", "readonly");
  6598. $("#manufactoryName").val(null);
  6599. $("#specification").val(null);
  6600. $("#categoriesFlag").val(null);
  6601. }
  6602. /**
  6603. * 保存当前药品到右边处方区域 中药
  6604. * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  6605. */
  6606. function saveChineseMedicine(calculateTotalAmountFlag) {
  6607. //药品名称
  6608. var chineseMedicineNamme = $("#chinese_medicine_name").val();
  6609. //当前药品编码
  6610. var currentCode = $("#chinese_medicine_current_code").val();
  6611. //当前药品规格
  6612. var currentSerial = $("#chinese_medicine_current_serial").val();
  6613. //处方实际单次使用剂量
  6614. var drugWin = $("#zy_drugWin").val();
  6615. //医嘱码
  6616. var zyInstruction = $("#zyInstruction").val();
  6617. //医嘱
  6618. var zyInstructionText = $('#zyInstruction option:selected').text();
  6619. //单价
  6620. var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
  6621. //当前中药的总价
  6622. var totalRetprice = Multiply(drugWin, zyPackRetprice);
  6623. //中药类型
  6624. var zyClassType = $("#zyClassType").val();
  6625. //
  6626. var zyHospApprFlag = $("#zyHospApprFlag").val();
  6627. //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
  6628. var currentYyClassType = $("#current_zyClassType").val();
  6629. if (currentYyClassType == null || currentYyClassType == "") {
  6630. //中药此时是第一次选择药品,不控制类型
  6631. $("#current_zyClassType").val(zyClassType);
  6632. } else if (currentYyClassType != zyClassType) {
  6633. errorMesageSimaple("同一个中药处方不允许同时出现普通中药和颗粒剂中药!");
  6634. return;
  6635. }
  6636. if (currentCode == null || currentCode == '') {
  6637. errorMesageSimaple("未选择任何药品!");
  6638. return;
  6639. }
  6640. //颗粒 剂量只能为整数
  6641. if(zyClassType == '83' && !(/(^[1-9]\d*$)/.test(drugWin))){
  6642. errorMesageSimaple("颗粒剂处方剂量只能为大于等于1的正整数!");
  6643. return;
  6644. }
  6645. var html = '<div class="form-group" style="float: left;">';
  6646. html += chineseMedicineNamme;
  6647. if (zyInstruction != null && zyInstruction != '') {
  6648. html += '[' + zyInstructionText + ']';
  6649. }
  6650. html += '<span style="margin-left: 5px"></span>';
  6651. html += drugWin + $("#zyUnit").text();
  6652. 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>';
  6653. 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>';
  6654. 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>';
  6655. 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>';
  6656. html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
  6657. html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
  6658. html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
  6659. html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
  6660. html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
  6661. html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
  6662. html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
  6663. html += '<input type="hidden" class="temporary_items_drugUnit" value="' + $("#zyUnit").text() + '"/>';
  6664. html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
  6665. html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
  6666. html += '<input type="hidden" class="temporary_items_zyHospApprFlag" value="' + zyHospApprFlag + '"/>';
  6667. html += '</div>';
  6668. var tableId = $("#zyTab li.active").find("a").attr("href");
  6669. //原药品金额 如果是修改则需要设置
  6670. var temporaryItemsAmount = 0;
  6671. //当前需要被移除元素的下个兄弟节点
  6672. var nextObj = null;
  6673. //当前修改的药品是不是最后一个
  6674. var isLast = false;
  6675. //是新增药品还是编辑 true 修改 默认false
  6676. var updateFlag = $("#chinese_medicine_update_flag").val();
  6677. if (updateFlag == undefined || updateFlag == null) {
  6678. updateFlag = false;
  6679. }
  6680. //如果是修改,需要减去原来的费用
  6681. if (updateFlag == "true" || updateFlag == true) {
  6682. var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
  6683. if (formGroups != null && formGroups.length > 0) {
  6684. //药品有可能会修改,所以,判断的时候要用原药品编码
  6685. var updateOriCode = $("#update_ori_code").val();
  6686. //规格有可能会修改,所以,判断的时候要用原规格
  6687. var updateOriSerial = $("#update_ori_serial").val();
  6688. for (var i = 0; i < formGroups.length; i++) {
  6689. var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
  6690. var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
  6691. if (temporaryItemsCode === updateOriCode && temporaryItemsSerial === updateOriSerial) {
  6692. temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
  6693. if (formGroups.length > 1) {
  6694. nextObj = $(formGroups[i]).next();
  6695. }
  6696. isLast = (i + 1) === formGroups.length;
  6697. $(formGroups[i]).remove();
  6698. break;
  6699. }
  6700. }
  6701. }
  6702. }
  6703. //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
  6704. if (nextObj == null || isLast) {
  6705. $(tableId).find("div:eq(0)").append(html);
  6706. } else {
  6707. $(nextObj).before(html);
  6708. }
  6709. //设置当前处方金额
  6710. // calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
  6711. if (calculateTotalAmountFlag) {
  6712. //设置总金额
  6713. calculateTotalAmount(true);
  6714. }
  6715. clearChineseMedicine();
  6716. }
  6717. /**
  6718. * 清空中药
  6719. */
  6720. function clearChineseMedicine() {
  6721. $("#chinese_medicine_update_flag").val(false);
  6722. $("#update_ori_code").val(null);
  6723. $("#update_ori_serial").val(null);
  6724. //药品名称
  6725. $("#chinese_medicine_name").val(null);
  6726. //当前药品编码
  6727. $("#chinese_medicine_current_code").val(null);
  6728. //当前药品规格
  6729. $("#chinese_medicine_current_serial").val(null);
  6730. //医嘱
  6731. $("#zyInstruction").selectpicker('val', null);
  6732. $('#zyInstruction').selectpicker('refresh');
  6733. $("#zyHospApprFlag").selectpicker('val', '0');
  6734. $('#zyHospApprFlag').selectpicker('refresh');
  6735. //剂量
  6736. $("#zy_drugWin").val(null);
  6737. //单价
  6738. $("#zy_packRetprice").val(null);
  6739. zyUnitChange()
  6740. }
  6741. //中药单位改变
  6742. function zyUnitChange() {
  6743. var zyClassTypeTemp = $("#zyClassType").val()
  6744. if(zyClassTypeTemp == '83'){
  6745. $("#zyUnit").text('袋')
  6746. //煮取 剪法 隐藏
  6747. $("#cyZqlDiv").removeClass("in").addClass("hide");
  6748. $("#ZySupplyTypeDiv").removeClass("in").addClass("hide");
  6749. if($("#cyFjDiv")){
  6750. $("#cyFjDiv").removeClass("in").addClass("hide");
  6751. }
  6752. }else {
  6753. $("#zyUnit").text('g')
  6754. $("#cyZqlDiv").removeClass("hide").addClass("in");
  6755. $("#ZySupplyTypeDiv").removeClass("hide").addClass("in");
  6756. if($("#cyFjDiv")){
  6757. $("#cyFjDiv").removeClass("hide").addClass("in");
  6758. }
  6759. }
  6760. }
  6761. /**
  6762. * 清空辅助检查、检验项目
  6763. */
  6764. function clearJyJcItem() {
  6765. $("#update_ori_code").val(null);
  6766. $("#jcjy_update_flag").val(false);
  6767. //项目名称
  6768. $("#jcJyItem").val(null);
  6769. //当前项目编码
  6770. $("#jcjy_current_code").val(null);
  6771. //项目国家医保
  6772. $("#jy_national_code").val(null);
  6773. $("#jy_national_name").val(null);
  6774. //单价
  6775. $("#jcjyItemPrice").val(null);
  6776. //备注
  6777. $("#remark").val(null);
  6778. $("#jcJyZltype").val(null);
  6779. $("#jyZdSample").selectpicker('val', null);
  6780. $('#jyZdSample').selectpicker('refresh');
  6781. $("#yshPart").selectpicker('val', null);
  6782. $('#yshPart').selectpicker('refresh');
  6783. $("#execUnit").selectpicker('val', null);
  6784. $('#execUnit').selectpicker('refresh');
  6785. $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
  6786. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  6787. $("#jyQuantityDiv").removeClass("in").addClass("hide");
  6788. $("#yshPartDiv").removeClass("in").addClass("hide");
  6789. $("#jyQuantity").val(null);
  6790. }
  6791. /**
  6792. * 清空外配处方
  6793. */
  6794. function clearWpOrder() {
  6795. $("#wp_medicine_name").val(null);
  6796. $("#wp_medicine_update_flag").val(false);
  6797. $("#rxItemTypeCode").selectpicker('val', '11');
  6798. $('#rxItemTypeCode').selectpicker('refresh');
  6799. $('#medcWayCodg').val(null)
  6800. $('#medcWayCodg').selectpicker('refresh');
  6801. setSelectDefaultVal('medcDays',1)
  6802. $('#usedFrquCodg').val(null)
  6803. $('#usedFrquCodg').selectpicker('refresh');
  6804. $('#sinDosunt').val(null)
  6805. $('#prdrName').val(null)
  6806. $('#sinDoscnt').val('1')
  6807. setSelectDefaultVal('usedFrquCodg','13')
  6808. $('#drugDosunt').val(null)
  6809. $('#drugSpec').val(null)
  6810. $('#drugCnt').val(null)
  6811. $('#drugDosform').val(null)
  6812. $('#drugDosform').selectpicker('refresh');
  6813. $('#wpHospApprFlag').val('1')
  6814. $('#wpHospApprFlag').selectpicker('refresh');
  6815. }
  6816. /**
  6817. * 清空诊疗项目
  6818. */
  6819. function clearZlItem() {
  6820. $("#update_ori_code").val(null);
  6821. $("#zl_update_flag").val(false);
  6822. //项目名称
  6823. $("#zlItem").val(null);
  6824. //当前项目编码
  6825. $("#zl_current_code").val(null);
  6826. //单价
  6827. $("#zlItemPrice").val(null);
  6828. //备注
  6829. $("#zlRemark").val(null);
  6830. //描述
  6831. $("#chargeUnit").val(null);
  6832. $("#itemQuantity").val(1);
  6833. $("#descriptions").val(null);
  6834. $("#dayZlNum").selectpicker('val', 1);
  6835. $('#dayZlNum').selectpicker('refresh');
  6836. $("#zlHospApprFlag").selectpicker('val', '0');
  6837. $('#zlHospApprFlag').selectpicker('refresh');
  6838. $("#orderFrequencyZl").selectpicker('val', 'ONCE');
  6839. $('#orderFrequencyZl').selectpicker('refresh');
  6840. $("#totalNumZl").val(null);
  6841. $("#totalAmountZl").val(null);
  6842. $("#zlExecUnit").selectpicker('val', null);
  6843. $('#zlExecUnit').selectpicker('refresh');
  6844. }
  6845. /**
  6846. * 清空入院证输入框
  6847. */
  6848. function clearZyReq() {
  6849. $("#inpatientWardBeHospitalized").selectpicker('val', null);
  6850. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  6851. $("#smallWardBeHospitalized").selectpicker('val', null);
  6852. $('#smallWardBeHospitalized').selectpicker('refresh');
  6853. $("#admissStatus").selectpicker('val', null);
  6854. $('#admissStatus').selectpicker('refresh');
  6855. $("#conditionCode").selectpicker('val', null);
  6856. $('#conditionCode').selectpicker('refresh');
  6857. $("#routeOfAdmission").selectpicker('val', null);
  6858. $('#routeOfAdmission').selectpicker('refresh');
  6859. $("#totalBedNum").val(null);
  6860. $("#freeBedNum").val(null);
  6861. $("#occupationBedNum").val(null);
  6862. $("#contacterName").val(null);
  6863. $("#contacterRelationship").selectpicker('val', null);
  6864. $('#contacterRelationship').selectpicker('refresh');
  6865. $("#contacterPhone").val(null);
  6866. $("#contacterAddress").val(null);
  6867. $("#deposit").val(null);
  6868. initSmallDeptByDept();
  6869. }
  6870. /**
  6871. * 清空门诊手术输入框
  6872. */
  6873. function clearOpRecord() {
  6874. $("#op_record_update_flag").val(false);
  6875. $("#opName").selectpicker('val', null);
  6876. $('#opName').selectpicker('refresh');
  6877. $("#urgentClinicFlag").selectpicker('val', null);
  6878. $('#urgentClinicFlag').selectpicker('refresh');
  6879. $("#ssbc").selectpicker('val', null);
  6880. $('#ssbc').selectpicker('refresh');
  6881. $("#partCode").selectpicker('val', null);
  6882. $('#partCode').selectpicker('refresh');
  6883. $("#opScale").selectpicker('val', null);
  6884. $('#opScale').selectpicker('refresh');
  6885. $("#opTime").val(null);
  6886. $("#hocusCode").selectpicker('val', null);
  6887. $('#hocusCode').selectpicker('refresh');
  6888. $("#doctorZd").selectpicker('val', null);
  6889. $('#doctorZd').selectpicker('refresh');
  6890. $("#opRecordRemark").val(null);
  6891. }
  6892. /**
  6893. * 计算总金额
  6894. * @param needRemoveLastObject 是否需要删除最后一次加进来的项目
  6895. */
  6896. function calculateTotalAmount(needRemoveLastObject) {
  6897. //调用后去除所有的验证提示
  6898. $("div.alert ").each(function (index, obj) {
  6899. $(obj).remove();
  6900. });
  6901. var jsonData = getParamsForpPrescription(3);
  6902. if(stringIsBlank(jsonData.visitDeptCode)){
  6903. jsonData.visitDeptCode = localStorage.getItem("currentDeptNo")
  6904. }
  6905. $.ajax({
  6906. type: "POST",
  6907. url: '/thmz/getAmountForTempPrescription',
  6908. contentType: "application/json;charset=UTF-8",
  6909. dataType: "json",
  6910. data: JSON.stringify(jsonData),
  6911. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  6912. success: function (res) {
  6913. if (res == '401' || res == 401) {
  6914. window.location.href = '/thmz/login/view'
  6915. return;
  6916. }
  6917. if (res.code == 0) {
  6918. if(!stringIsBlank(res.discountWarningMessage)){
  6919. warningMesageSimaple(res.discountWarningMessage)
  6920. }
  6921. if(!stringIsBlank(res.ypHealthEducation)){
  6922. $("#ypHealthEducation").val(res.ypHealthEducation)
  6923. }else {
  6924. $("#ypHealthEducation").val(null)
  6925. }
  6926. $("#totalAmount").html(res.data.amount.toFixed(2));
  6927. var arrs = $("span.cf_amount");
  6928. for (var i = 0; i < arrs.length; i++) {
  6929. if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
  6930. $(arrs[i]).html(res.data.amountList[i].toFixed(2));
  6931. }
  6932. }
  6933. } else {
  6934. if (needRemoveLastObject) {
  6935. var index = getIndex("bill_item_group");
  6936. var tabId = null;
  6937. //西药
  6938. if (index == 0) {
  6939. tabId = "xyTab";
  6940. } else if (index == 1) {
  6941. //中成药
  6942. tabId = "zyTab";
  6943. } else if (index == 2) {
  6944. //辅助检查、检验
  6945. tabId = "jcjyTab";
  6946. } else if (index == 3) {
  6947. //诊疗
  6948. tabId = "zlTab";
  6949. } else if (index == 4) {
  6950. //入院
  6951. tabId = "zyReqTab";
  6952. } else if (index == 5) {
  6953. //手术
  6954. tabId = "opRecordTab";
  6955. }else if (index == 6) {
  6956. //手术
  6957. tabId = "wpMedicineTab";
  6958. }
  6959. var tableId = $("#" + tabId + " li.active").find("a").attr("href");
  6960. var last = $(tableId).find("div:eq(0)").find("div:last");
  6961. if (last != null) {
  6962. $(last).find("i:eq(2)").click();
  6963. $(last).find("i:eq(3)").click();
  6964. }
  6965. }
  6966. errorMesage(res);
  6967. }
  6968. }
  6969. });
  6970. }
  6971. // /**
  6972. // * 打开住院处理窗口
  6973. // * @param data
  6974. // */
  6975. // function beHospitalized() {
  6976. // $("#beHospitalizedModal").modal();
  6977. // //根据病人门诊id查询病人的入院申请
  6978. // $.ajax({
  6979. // type: "GET",
  6980. // url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
  6981. // contentType: "application/json;charset=UTF-8",
  6982. // dataType: "json",
  6983. // headers: {
  6984. // 'Accept': 'application/json',
  6985. // 'Authorization': 'Bearer ' + localStorage.getItem("token")
  6986. // },
  6987. // success: function (resZyz) {
  6988. // if (resZyz == '401' || resZyz == 401) {
  6989. // window.location.href = '/thmz/login/view'
  6990. // return;
  6991. // }
  6992. // if (resZyz.code == 0) {
  6993. // $("#icdCodeInputBeHospitalized").val(resZyz.data.icdCode);
  6994. // $("#icdTextBeHospitalized").val(resZyz.data.icdText);
  6995. // $("#icdTextBeHospitalized").attr("title", resZyz.data.icdText);
  6996. // $("#inpatientWardBeHospitalized").selectpicker('val', resZyz.data.reqDept);
  6997. // $("#inpatientWardBeHospitalized").selectpicker('refresh');
  6998. // initSmallDeptByDept();
  6999. // $("#smallWardBeHospitalized").selectpicker('val', resZyz.data.smallDept);
  7000. // $("#smallWardBeHospitalized").selectpicker('refresh');
  7001. // $("#admissStatus").selectpicker('val', resZyz.data.admissStatus);
  7002. // $("#admissStatus").selectpicker('refresh');
  7003. // $("#zyReqVisitDate").val(format(resZyz.data.visitDate, "yyyy-MM-dd HH:mm:ss"));
  7004. // }
  7005. // }
  7006. // });
  7007. // }
  7008. /**
  7009. * 打开编辑用户信息窗口
  7010. * @param data
  7011. * @param type 1 患者详情处编辑 2 快速接诊处编辑 3 就诊详情预览
  7012. */
  7013. function editUserModal(patientId, type) {
  7014. if (type == 3) {
  7015. $("#editUserModalTitle").html("患者档案【预览】");
  7016. $("#saveEditUser").removeClass("in").addClass("hide");
  7017. } else {
  7018. $("#editUserModalTitle").html("患者档案【修改】");
  7019. $("#saveEditUser").removeClass("hide").addClass("in");
  7020. }
  7021. $("#openSource").val(type);
  7022. if (patientId == null) {
  7023. //医生工作台发起
  7024. patientId = $("#patientId").text();
  7025. }
  7026. // else {
  7027. // //快速接诊界面发起
  7028. // clearRapidAccepts();
  7029. // }
  7030. if (patientId == null || patientId == "null" || patientId == "") {
  7031. errorMesageSimaple("请输入需要编辑的患者信息");
  7032. return;
  7033. }
  7034. $("#rapidAcceptsModal").modal("hide");
  7035. $("#visitingDetailModal").modal("hide");
  7036. $("#editUserModal").modal();
  7037. $.ajax({
  7038. type: "GET",
  7039. url: '/thmz/getByPatientId?patientId=' + patientId,
  7040. contentType: "application/json;charset=UTF-8",
  7041. dataType: "json",
  7042. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7043. success: function (res) {
  7044. if (res == '401' || res == 401) {
  7045. window.location.href = '/thmz/login/view'
  7046. return;
  7047. }
  7048. if (res.code == 0) {
  7049. if (res.data != null) {
  7050. //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
  7051. setTimeout(function () {
  7052. fillPlusPatinet(res.data);
  7053. }, 400);
  7054. }
  7055. } else {
  7056. errorMesage(res);
  7057. $("#editUserModal").modal("hide");
  7058. }
  7059. }
  7060. });
  7061. }
  7062. /**
  7063. * 处方类型按钮切换事件
  7064. * @param object
  7065. * @param objectIndex
  7066. */
  7067. function billItemButtonChange(object, objectIndex) {
  7068. $(".nav-tabs").removeClass("in").addClass("hide");
  7069. $(".tab-content").removeClass("in").addClass("hide");
  7070. $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
  7071. $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
  7072. $("#bill_item_group").find("button").each(function (index, element) {
  7073. if ($(element).hasClass("btn-primary")) {
  7074. $(element).removeClass("btn-primary").addClass("btn-default");
  7075. }
  7076. $("#rp_form" + index).removeClass("show").addClass("hide");
  7077. });
  7078. $("#rp_form" + objectIndex).removeClass("hide").addClass("show");
  7079. $(object).removeClass("btn-default").addClass("btn-primary");
  7080. $("#western_medicine_name").webuiPopover('hide');
  7081. $("#chinese_medicine_name").webuiPopover('hide');
  7082. $("#jcJyItem").webuiPopover('hide');
  7083. $("#zlItem").webuiPopover('hide');
  7084. if (objectIndex == 0) {
  7085. $("#western_medicine_name").focus();
  7086. //有时候调用药品多了以后,会导致一个药品处方名对应多个content显现
  7087. var paneId = $("#xyTab li.active").find("a").attr("href");
  7088. if (paneId != null) {
  7089. //去除第一个字符 #
  7090. paneId = paneId.slice(1);
  7091. xyTableOnClick(paneId)
  7092. }
  7093. } else if (objectIndex == 1) {
  7094. $("#chinese_medicine_name").focus();
  7095. } else if (objectIndex == 2) {
  7096. $("#jcJyItem").focus();
  7097. YX02()
  7098. } else if (objectIndex == 3) {
  7099. $("#zlItem").focus();
  7100. } else if (objectIndex == 4) {
  7101. // $("#inpatientWardBeHospitalized").next().click();
  7102. prevEleId = "zy_req_button";
  7103. } else if (objectIndex == 5) {
  7104. prevEleId = "op_record_button";
  7105. }else if (objectIndex == 6) {
  7106. $("#wp_medicine_name").focus();
  7107. }
  7108. }
  7109. /**
  7110. * 打开快速接诊窗口
  7111. * @param data
  7112. */
  7113. function rapidAcceptsModal() {
  7114. $("#rapidAcceptsModal").modal();
  7115. //延迟触发 默认光标在卡号输入框
  7116. setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
  7117. }
  7118. /**
  7119. * checkBox样式
  7120. */
  7121. function formatCheck() {
  7122. if ($("input.flat")[0]) {
  7123. $(document).ready(function () {
  7124. $('input.flat').iCheck({
  7125. checkboxClass: 'icheckbox_flat-blue',
  7126. radioClass: 'iradio_flat-blue'
  7127. });
  7128. });
  7129. }
  7130. }
  7131. /**
  7132. * 卡号有变化后查询病人信息
  7133. */
  7134. function queryUserInfoByCardNo() {
  7135. //当反写的id不存在,说明不是查询后的改变事件,触发查询
  7136. var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
  7137. clearRapidAcceptsModal();
  7138. // console.log("queryUserInfoByCardNo",rapidAcceptsUserCardNo)
  7139. if (rapidAcceptsUserCardNo == null || rapidAcceptsUserCardNo == "") {
  7140. return;
  7141. }
  7142. // var index = rapidAcceptsUserCardNo.indexOf("-");
  7143. // if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "")) {
  7144. $("#cardNo").attr("title", rapidAcceptsUserCardNo);
  7145. $.ajax({
  7146. type: "GET",
  7147. url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
  7148. contentType: "application/json;charset=UTF-8",
  7149. dataType: "json",
  7150. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7151. success: function (res) {
  7152. console.log("rapidAcceptsUserCardNo",res)
  7153. if (res == '401' || res == 401) {
  7154. window.location.href = '/thmz/login/view'
  7155. return;
  7156. }
  7157. if (res.code == 0) {
  7158. if (res.data != null) {
  7159. $("#rapidAcceptsUserName").val(res.data.name);
  7160. $("#rapidAcceptsUserCode").val(res.data.patientId);
  7161. $("#patientIdDb").val(res.data.patientId);
  7162. $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
  7163. $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
  7164. $("#rapidAcceptsUserGender").selectpicker('refresh');
  7165. $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
  7166. $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
  7167. $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
  7168. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  7169. $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
  7170. $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
  7171. $('#rapidAcceptsProvinceCode').selectpicker('val', res.data.provinceCode);
  7172. $('#rapidAcceptsProvinceCode').selectpicker('refresh');
  7173. initCity(3, res.data.cityCode);
  7174. initDistrict(3, res.data.cityCode, res.data.districtCode);
  7175. $("#rapidAcceptsDetail").val(res.data.detail);
  7176. $("#rapidAcceptsUserAddress").attr("title", res.data.address);
  7177. $("#rapidAcceptsUserAddress").val(res.data.address);
  7178. $("#rapidAcceptsUserContact").val(res.data.relName);
  7179. $("#rapidAcceptsUserContactPhone").val(res.data.contractName);
  7180. //查询分诊号
  7181. $.ajax({
  7182. type: "POST",
  7183. url: '/thmz/getUnClinicWithPage',
  7184. contentType: "application/json;charset=UTF-8",
  7185. dataType: "json",
  7186. data: JSON.stringify({"patientId": res.data.patientId}),
  7187. headers: {
  7188. 'Accept': 'application/json',
  7189. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  7190. },
  7191. success: function (resFz) {
  7192. if (resFz == '401' || resFz == 401) {
  7193. window.location.href = '/thmz/login/view'
  7194. return;
  7195. }
  7196. if (resFz.code == 0) {
  7197. if (resFz.data == null || resFz.data.length == 0) {
  7198. errorMesageSimaple("没有查询到符合条件的分诊记录!");
  7199. clearRapidAcceptsModal();
  7200. return;
  7201. }
  7202. $("#mzfzSerialNo").val(resFz.data[0].serialNo);
  7203. }
  7204. }
  7205. });
  7206. } else {
  7207. errorMesageSimaple("病人信息不存在!");
  7208. }
  7209. } else {
  7210. errorMesage(res);
  7211. }
  7212. }
  7213. });
  7214. // }
  7215. }
  7216. /**
  7217. * 清空快速接诊查询框
  7218. */
  7219. function clearRapidAccepts() {
  7220. $("#rapidAcceptsUserName").val(null);
  7221. $("#rapidAcceptsUserCode").val(null);
  7222. $("#patientIdDb").val(null);
  7223. $("#rapidAcceptsUserCardNo").val(null);
  7224. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  7225. $("#rapidAcceptsUserGender").selectpicker('refresh');
  7226. $("#rapidAcceptsUserPhoneNum").val(null);
  7227. $("#rapidAcceptsUserIdCard").val(null);
  7228. $("#rapidAcceptsUserIdCard").attr("title", null);
  7229. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  7230. $("#rapidAcceptsUserAddress").attr("title", null);
  7231. $("#mzfzSerialNo").val(null);
  7232. $("#rapidAcceptsUserCardNo").focus();
  7233. $("#rapidAcceptsUserAddress").val(null);
  7234. $("#rapidAcceptsUserContact").val(null);
  7235. $("#rapidAcceptsUserContactPhone").val(null);
  7236. }
  7237. /**
  7238. * 根据病人姓名输入框内容动态加载病人列表
  7239. */
  7240. function initUserList() {
  7241. //var width=$("#userName").css("width");
  7242. var settings = {
  7243. trigger: 'click',
  7244. content: '',
  7245. width: 170,
  7246. multi: true,
  7247. closeable: false,
  7248. style: '',
  7249. delay: 300,
  7250. padding: true,
  7251. height: 300,
  7252. };
  7253. var webuiPopover = $('#symptomFlagCheck').webuiPopover('destroy').webuiPopover(settings);
  7254. //用户姓名选中事件
  7255. // $("#rapidAcceptsUserName").on("click", function (t) {
  7256. // if ($(webuiPopover).css("display") == "block") {
  7257. // refeshPatinetList(true);
  7258. // }
  7259. // });
  7260. }
  7261. /**
  7262. * 刷新候诊病人列表
  7263. */
  7264. function refeshPatinetList(flag) {
  7265. //如果是重新加载病人列表,需要重置下标
  7266. if (flag) {
  7267. //重置下标
  7268. pageIndex = 0;
  7269. msg_list_loading = true;
  7270. }
  7271. var userName = $('#rapidAcceptsUserName').val();
  7272. if (!(userName == null || userName == "" || isChinese(userName))) {
  7273. return;
  7274. }
  7275. $.ajax({
  7276. type: "POST",
  7277. url: '/thmz/getUnClinicWithPage',
  7278. contentType: "application/json;charset=UTF-8",
  7279. dataType: "json",
  7280. data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
  7281. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7282. success: function (res) {
  7283. if (res == '401' || res == 401) {
  7284. window.location.href = '/thmz/login/view'
  7285. return;
  7286. }
  7287. if (res.code == 0) {
  7288. if (res.data != null && res.data.length > 0) {
  7289. // $("#webuiPopover0").css("display", "block");
  7290. // $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
  7291. var html = '<div class="list-group">';
  7292. for (var i = 0; i < res.data.length; i++) {
  7293. var mzPatientMi = res.data[i];
  7294. html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
  7295. if (mzPatientMi.gender == "男") {
  7296. html += '<img src="/thmz/images/boy.png"/>'
  7297. } else if (mzPatientMi.gender == "女") {
  7298. html += '<img src="/thmz/images/girl.png"/>'
  7299. } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
  7300. html += '<img src="/thmz/images/girl_or_boy.png"/>'
  7301. }
  7302. html += '<div>' + mzPatientMi.name + '&nbsp;' + mzPatientMi.gender + '&nbsp;';
  7303. html += mzPatientMi.ageString;
  7304. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
  7305. html += '<span>' + mzPatientMi.phoneNo + '</span>';
  7306. }
  7307. html += '</div></a>';
  7308. }
  7309. html += '</div>';
  7310. // if (flag) {
  7311. // $("#webuiPopover0 div.webui-popover-content").html("");
  7312. // }
  7313. // $("#webuiPopover0 div.webui-popover-content").append(html);
  7314. // $("#webuiPopover0 div.arrow").css("left", "23px");
  7315. refeshPatinetListScrollEvent();
  7316. } else {
  7317. // $("#webuiPopover0").css("display", "none");
  7318. }
  7319. }
  7320. //查询完成,设置加载完成
  7321. msg_list_loading = false;
  7322. }
  7323. });
  7324. }
  7325. /**
  7326. * 病人下拉列表滚动条滚动到底部时继续加载新纪录
  7327. */
  7328. function refeshPatinetListScrollEvent() {
  7329. // $('.webui-popover-content').scroll(function (event) {
  7330. // var top = $(this).scrollTop();
  7331. // var height = $(this).height();
  7332. // var scrollHeight = $(this).get(0).scrollHeight;
  7333. // if (scrollHeight <= top + height) {
  7334. // if (!msg_list_loading) {
  7335. // msg_list_loading = true;
  7336. // pageIndex = pageIndex + 1;
  7337. // refeshPatinetList(false);
  7338. // }
  7339. // }
  7340. // });
  7341. }
  7342. /**
  7343. * 按照病人id查询病人信息
  7344. * @param patientId
  7345. */
  7346. function fillUnClinicPatinet(patientId) {
  7347. $("#rapidAcceptsUserCardNo").val(patientId);
  7348. // $("#webuiPopover0").css("display", "none");
  7349. queryUserInfoByCardNo();
  7350. }
  7351. /**
  7352. * 加载主诉,体格检查,诊断窗口
  7353. */
  7354. function initRecommendList() {
  7355. var width = $("#symptom").parent().css("width");
  7356. var settings = {
  7357. placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  7358. trigger: 'click', //值:click,hover 触发方式 manual 手动
  7359. content: '',//内容,内容可以是函数
  7360. width: width,
  7361. //arrow:false,//是否显示箭头
  7362. multi: true,//在页面允许其他弹出层
  7363. closeable: true,//显示关闭按钮
  7364. style: '', //值:'',inverse
  7365. delay: 300,//延迟时间, 悬浮属性才执行
  7366. padding: true,//内容填充
  7367. height: 320,
  7368. //offsetTop:10,
  7369. cache: true,//如果缓存设置为false,则popover将销毁并重新创建
  7370. };
  7371. //主诉弹窗
  7372. var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
  7373. //体格检查弹窗
  7374. settings.height = 260;
  7375. $('#weight').webuiPopover('destroy').webuiPopover(settings);
  7376. //诊断弹窗
  7377. settings.height = 320;
  7378. var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
  7379. //中医诊断弹窗
  7380. var tcmDiagnoseWebuiPopover = $('#tcmDiagnose').webuiPopover('destroy').webuiPopover(settings);
  7381. //西药弹窗
  7382. settings.width = 680;
  7383. settings.closeable = false;
  7384. settings.arrow = false;//显示箭头或不显示箭头
  7385. settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
  7386. //手动触发
  7387. settings.trigger = 'manual';
  7388. var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
  7389. //中药弹窗
  7390. settings.trigger = 'click';
  7391. settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
  7392. //手动触发
  7393. settings.trigger = 'manual';
  7394. var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
  7395. //辅助检查、检验弹窗
  7396. settings.trigger = 'manual';
  7397. settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
  7398. var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
  7399. //诊疗弹窗
  7400. settings.trigger = 'manual';
  7401. settings.content = '<div id="zlItemPopoverContent"><table id="tb_table_zl_item"></table></div>';
  7402. var zlItemWebuiPopover = $('#zlItem').webuiPopover('destroy').webuiPopover(settings);
  7403. //外配药弹窗
  7404. settings.trigger = 'manual';
  7405. settings.content = '<div id="wpMedicinePopoverContent"><table id="tb_table_wp_medicine"></table></div>';
  7406. var zlItemWebuiPopover = $('#wp_medicine_name').webuiPopover('destroy').webuiPopover(settings);
  7407. //主诉选中事件
  7408. $("#symptom").on("click", function (t) {
  7409. if ($(symptomWebuiPopover).css("display") == "block") {
  7410. $("#webuiPopover1 div.arrow").css("left", "23px");
  7411. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
  7412. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
  7413. html += "</div>";
  7414. html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
  7415. '<div style="float: left">' +
  7416. '<span style="margin-left: 20px;">内容:</span> ' +
  7417. '</div>' +
  7418. '<div style="float: left;">' +
  7419. '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
  7420. '<option label="常用症状" value="0">常用症状</option>' +
  7421. '<option label="常用时间" value="1">常用时间</option>' +
  7422. '<option label="常用标点" value="2">常用标点</option>' +
  7423. '<option label="常用词" value="3">常用词</option>' +
  7424. '</select> ' +
  7425. '</div>' +
  7426. '<div style="width: 200px;float: left;margin-left: 10px;">' +
  7427. '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
  7428. '</div>' +
  7429. '<div style="float: left;margin-left: 10px;">' +
  7430. ' <button type="button" class="btn" onclick="saveParams();"' +
  7431. ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
  7432. ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
  7433. ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
  7434. ' </svg>' +
  7435. '新增' +
  7436. ' </button>' +
  7437. ' </div>' +
  7438. '</div>';
  7439. $("#webuiPopover1 div.webui-popover-content").html(html);
  7440. $('#paramsType').selectpicker('refresh');
  7441. $("#paramsType").parent().css("width", "140px").css("height", "34px");
  7442. $("#webuiPopover1").css("z-index", "10");
  7443. if ($("#webuiPopover1").hasClass("in")) {
  7444. loadSymptom();
  7445. }
  7446. }
  7447. //加载智能接诊模块的主诉推荐
  7448. fitSymptomData();
  7449. });
  7450. //体格检查各输入框选中事件
  7451. $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor,#pressure_high_left,#pressure_floor_left").on("click", function (t) {
  7452. if ($("#webuiPopover2").css("display") == "block") {
  7453. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  7454. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
  7455. $("#webuiPopover2 div.arrow").css("left", "23px");
  7456. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  7457. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  7458. html += "</div>";
  7459. $("#webuiPopover2 div.webui-popover-content").html(html);
  7460. $("#webuiPopover2").css("z-index", "10");
  7461. if ($("#webuiPopover2").hasClass("in")) {
  7462. loadHealthCheckup();
  7463. }
  7464. }
  7465. //loadSymptom();
  7466. } else {
  7467. $('#weight').webuiPopover('show');
  7468. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  7469. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
  7470. $("#webuiPopover2 div.arrow").css("left", "23px");
  7471. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  7472. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  7473. html += "</div>";
  7474. $("#webuiPopover2 div.webui-popover-content").html(html);
  7475. $("#webuiPopover2").css("z-index", "10");
  7476. if ($("#webuiPopover2").hasClass("in")) {
  7477. loadHealthCheckup();
  7478. }
  7479. }
  7480. }
  7481. return false;
  7482. });
  7483. //诊断选中事件
  7484. $("#diagnose").on("click", function (t) {
  7485. $("#western_medicine_name").webuiPopover('hide');
  7486. $("#chinese_medicine_name").webuiPopover('hide');
  7487. $("#jcJyItem").webuiPopover('hide');
  7488. $("#zlItem").webuiPopover('hide');
  7489. if ($(diagnoseWebuiPopover).css("display") == "block") {
  7490. $("#webuiPopover3 div.arrow").css("left", "23px");
  7491. $("#webuiPopover3 a.close").css("margin-top", "15px");
  7492. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
  7493. html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
  7494. ' <input type="text" class="form-control has-feedback-left" ' +
  7495. ' placeholder="搜索" style="padding-left: 10px;" onkeyup="debounce(loadDiagnose(this.value),100,true)" id="paramsDiagnose">' +
  7496. ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
  7497. ' </div>';
  7498. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
  7499. html += "</div>";
  7500. $("#webuiPopover3 div.webui-popover-content").html(html);
  7501. $("#webuiPopover3").css("z-index", "10");
  7502. //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
  7503. //中文会导致查询混乱
  7504. $("#paramsDiagnose").on('compositionstart', function () {
  7505. $("#paramsDiagnose").attr("isNeedPrevent", true);
  7506. });
  7507. $("#paramsDiagnose").on('compositionend', function () {
  7508. $("#paramsDiagnose").attr("isNeedPrevent", false);
  7509. });
  7510. loadDiagnose("");
  7511. }
  7512. //加载智能接诊模块的诊断推荐推荐
  7513. fitDiagnoseData();
  7514. });
  7515. //中医诊断
  7516. $("#tcmDiagnose").on("click", function (t) {
  7517. $("#western_medicine_name").webuiPopover('hide');
  7518. $("#chinese_medicine_name").webuiPopover('hide');
  7519. $("#jcJyItem").webuiPopover('hide');
  7520. $("#zlItem").webuiPopover('hide');
  7521. if ($(tcmDiagnoseWebuiPopover).css("display") == "block") {
  7522. $("#webuiPopover4 div.arrow").css("left", "23px");
  7523. $("#webuiPopover4 a.close").css("margin-top", "15px");
  7524. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
  7525. html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
  7526. ' <input type="text" class="form-control has-feedback-left" ' +
  7527. ' placeholder="搜索" style="padding-left: 10px;" onkeyup="debounce(loadtcmDiagnose(this.value),100,true)" id="paramstcmDiagnose">' +
  7528. ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
  7529. ' </div>';
  7530. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='tcmDiagnoseContentHtml'>";
  7531. html += "</div>";
  7532. $("#webuiPopover4 div.webui-popover-content").html(html);
  7533. $("#webuiPopover4").css("z-index", "10");
  7534. //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
  7535. //中文会导致查询混乱
  7536. $("#paramstcmDiagnose").on('compositionstart', function () {
  7537. $("#paramstcmDiagnose").attr("isNeedPrevent", true);
  7538. });
  7539. $("#paramstcmDiagnose").on('compositionend', function () {
  7540. $("#paramstcmDiagnose").attr("isNeedPrevent", false);
  7541. });
  7542. loadtcmDiagnose("");
  7543. }
  7544. //加载智能接诊模块的诊断推荐推荐
  7545. // fitDiagnoseData();
  7546. });
  7547. //现病史选中事件
  7548. $("#emrHpi").on("click", function (t) {
  7549. //加载智能接诊模块的现病史推荐推荐
  7550. fitEmrHpiData();
  7551. });
  7552. //既往史选中事件
  7553. $("#emrPs").on("click", function (t) {
  7554. //加载智能接诊模块的既往史推荐推荐
  7555. fitEmrPsData();
  7556. });
  7557. // //西药选中事件
  7558. // $("#western_medicine_name").on("click", function (t) {
  7559. // if ($(westernMedicineWebuiPopover).css("display") == "block") {
  7560. // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
  7561. // loadYpList(0);
  7562. // }
  7563. // });
  7564. // //中药选中事件
  7565. // $("#chinese_medicine_name").on("click", function (t) {
  7566. // if ($(chineseMedicineWebuiPopover).css("display") == "block") {
  7567. // $("#chineseMedicinePopoverContent").parent().parent().prev().css("left", "23px");
  7568. // loadYpList(1);
  7569. // }
  7570. // });
  7571. // //诊疗与医技弹窗选中事件
  7572. // $("#jcJyItem").on("click", function (t) {
  7573. // if ($(jcJyItemWebuiPopover).css("display") == "block") {
  7574. // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
  7575. // loadjcJyItemList();
  7576. // }
  7577. // });
  7578. //帮助字典弹窗
  7579. settings.width = 450;
  7580. settings.height = 500;
  7581. settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  7582. settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
  7583. settings.trigger = 'click';
  7584. var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
  7585. $("#treeButton").on("click", function (t) {
  7586. // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
  7587. //初始化药品,检查检验菜单树
  7588. initzTree();
  7589. });
  7590. }
  7591. /**
  7592. * 新增通用参数
  7593. */
  7594. function saveParams() {
  7595. $.ajax({
  7596. type: "POST",
  7597. url: '/thmz/saveTCommonParams',
  7598. contentType: "application/json;charset=UTF-8",
  7599. dataType: "json",
  7600. data: JSON.stringify({
  7601. "paramsType": $("#paramsType").val(),
  7602. "paramsName": $("#paramsNameInput").val()
  7603. }),
  7604. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7605. success: function (res) {
  7606. if (res == '401' || res == 401) {
  7607. window.location.href = '/thmz/login/view'
  7608. return;
  7609. }
  7610. if (res.code == 0) {
  7611. successMesage(res);
  7612. loadSymptom();
  7613. $("#paramsNameInput").val(null);
  7614. // $("#paramsType").selectpicker('val', 0);
  7615. // $("#paramsType").selectpicker('refresh');
  7616. } else {
  7617. errorMesage(res);
  7618. }
  7619. }
  7620. });
  7621. }
  7622. /**
  7623. * 加载主诉参数列表
  7624. */
  7625. function loadSymptom() {
  7626. $.ajax({
  7627. type: "GET",
  7628. url: '/thmz/loadSymptom',
  7629. contentType: "application/json;charset=UTF-8",
  7630. dataType: "json",
  7631. async: false,
  7632. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7633. success: function (res) {
  7634. if (res == '401' || res == 401) {
  7635. window.location.href = '/thmz/login/view'
  7636. return;
  7637. }
  7638. var html = '';
  7639. if (res.code == 0) {
  7640. if (res.featureList != null && res.featureList.length > 0) {
  7641. html += '<div id="feature">';
  7642. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
  7643. html += '<div style="width: calc(100% - 80px); float: left;">';
  7644. for (var i = 0; i < res.featureList.length; i++) {
  7645. 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;">';
  7646. html += res.featureList[i].paramsName;
  7647. html += '</span></button>';
  7648. }
  7649. html += '</div><div style="clear:both"></div></div>';
  7650. }
  7651. if (res.timeList != null && res.timeList.length > 0) {
  7652. html += '<div id="time">';
  7653. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
  7654. html += '<div style="width: calc(100% - 80px); float: left;">';
  7655. for (var i = 0; i < res.timeList.length; i++) {
  7656. 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;">';
  7657. html += res.timeList[i].paramsName;
  7658. html += '</span></button>';
  7659. }
  7660. html += '</div><div style="clear:both"></div></div>';
  7661. }
  7662. if (res.characterList != null && res.characterList.length > 0) {
  7663. html += '<div id="character">';
  7664. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
  7665. html += '<div style="width: calc(100% - 80px); float: left;">';
  7666. for (var i = 0; i < res.characterList.length; i++) {
  7667. 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;">';
  7668. html += res.characterList[i].paramsName;
  7669. html += '</span></button>';
  7670. }
  7671. html += '</div><div style="clear:both"></div></div>';
  7672. }
  7673. if (res.wordsList != null && res.wordsList.length > 0) {
  7674. html += '<div id="words">';
  7675. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
  7676. html += '<div style="width: calc(100% - 80px); float: left;">';
  7677. for (var i = 0; i < res.wordsList.length; i++) {
  7678. 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;">';
  7679. html += res.wordsList[i].paramsName;
  7680. html += '</span></button>';
  7681. }
  7682. html += '</div><div style="clear:both"></div></div>';
  7683. }
  7684. } else {
  7685. errorMesage(res);
  7686. }
  7687. $("#contentHtml").html(html);
  7688. }
  7689. });
  7690. }
  7691. /**
  7692. * 加载体格检查参数列表
  7693. */
  7694. function loadHealthCheckup() {
  7695. $.ajax({
  7696. type: "GET",
  7697. url: '/thmz/loadHealthCheckup',
  7698. contentType: "application/json;charset=UTF-8",
  7699. dataType: "json",
  7700. async: false,
  7701. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7702. success: function (res) {
  7703. if (res == '401' || res == 401) {
  7704. window.location.href = '/thmz/login/view'
  7705. return;
  7706. }
  7707. var html = '';
  7708. if (res.code == 0) {
  7709. if (res.weightList != null && res.weightList.length > 0) {
  7710. html += '<div id="weightDiv">';
  7711. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
  7712. html += '<div style="width: calc(100% - 80px); float: left;">';
  7713. for (var i = 0; i < res.weightList.length; i++) {
  7714. 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;">';
  7715. html += res.weightList[i].paramsName;
  7716. html += '</span></button>';
  7717. }
  7718. html += '</div><div style="clear:both"></div></div>';
  7719. }
  7720. if (res.temperatureList != null && res.temperatureList.length > 0) {
  7721. html += '<div id="temperatureDiv">';
  7722. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
  7723. html += '<div style="width: calc(100% - 80px); float: left;">';
  7724. for (var i = 0; i < res.temperatureList.length; i++) {
  7725. 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;">';
  7726. html += res.temperatureList[i].paramsName;
  7727. html += '</span></button>';
  7728. }
  7729. html += '</div><div style="clear:both"></div></div>';
  7730. }
  7731. if (res.sphygmusList != null && res.sphygmusList.length > 0) {
  7732. html += '<div id="sphygmusDiv">';
  7733. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
  7734. html += '<div style="width: calc(100% - 80px); float: left;">';
  7735. for (var i = 0; i < res.sphygmusList.length; i++) {
  7736. 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;">';
  7737. html += res.sphygmusList[i].paramsName;
  7738. html += '</span></button>';
  7739. }
  7740. html += '</div><div style="clear:both"></div></div>';
  7741. }
  7742. if (res.breatheList != null && res.breatheList.length > 0) {
  7743. html += '<div id="breatheDiv">';
  7744. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
  7745. html += '<div style="width: calc(100% - 80px); float: left;">';
  7746. for (var i = 0; i < res.breatheList.length; i++) {
  7747. 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;">';
  7748. html += res.breatheList[i].paramsName;
  7749. html += '</span></button>';
  7750. }
  7751. html += '</div><div style="clear:both"></div></div>';
  7752. }
  7753. if (res.pressureList != null && res.pressureList.length > 0) {
  7754. html += '<div id="pressureDiv">';
  7755. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">血压:</div>';
  7756. html += '<div style="width: calc(100% - 80px); float: left;">';
  7757. for (var i = 0; i < res.pressureList.length; i++) {
  7758. 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;">';
  7759. html += res.pressureList[i].paramsName;
  7760. html += '</span></button>';
  7761. }
  7762. html += '</div><div style="clear:both"></div></div>';
  7763. }
  7764. } else {
  7765. errorMesage(res);
  7766. }
  7767. $("#healthCheckupContentHtml").html(html);
  7768. }
  7769. });
  7770. }
  7771. /**
  7772. * 加载中医诊断参数列表
  7773. */
  7774. function loadtcmDiagnose(value) {
  7775. if (!$("#webuiPopover4").hasClass("in")) {
  7776. return;
  7777. }
  7778. let isNeedPrevent = $("#paramstcmDiagnose").attr("isNeedPrevent");
  7779. if (isNeedPrevent == "true") {
  7780. return;
  7781. }
  7782. postAjaxJsonHttpRequst("/thmz/getTcmIcdCodeByParams",{name:value},true,function (res) {
  7783. var html = '';
  7784. if (res.code == 0) {
  7785. if (res.data != null && res.data.length > 0) {
  7786. html += '<div>';
  7787. for (var i = 0; i < res.data.length; i++) {
  7788. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitTcmDiagnoseValue(\'' + res.data[i].name + '\',\'' + res.data[i].code + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
  7789. html += res.data[i].name;
  7790. html += '<small>&nbsp;&nbsp;(' + res.data[i].code + ')</small>';
  7791. html += '</span></button>';
  7792. }
  7793. html += '</div>';
  7794. }
  7795. } else {
  7796. errorMesage(res);
  7797. }
  7798. $("#tcmDiagnoseContentHtml").html(html);
  7799. })
  7800. }
  7801. /**
  7802. * 加载诊断参数列表
  7803. * @param value
  7804. */
  7805. function loadDiagnose(value) {
  7806. if (!$("#webuiPopover3").hasClass("in")) {
  7807. return;
  7808. }
  7809. var isNeedPrevent = $("#paramsDiagnose").attr("isNeedPrevent");
  7810. if (isNeedPrevent == "true") {
  7811. return;
  7812. }
  7813. $.ajax({
  7814. type: "GET",
  7815. url: '/thmz/getIcdCodeByParams?commonParams=' + value,
  7816. contentType: "application/json;charset=UTF-8",
  7817. dataType: "json",
  7818. async: false,
  7819. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  7820. success: function (res) {
  7821. if (res == '401' || res == 401) {
  7822. window.location.href = '/thmz/login/view'
  7823. return;
  7824. }
  7825. var html = '';
  7826. if (res.code == 0) {
  7827. let crbFlag = '1'
  7828. if (res.data != null && res.data.length > 0) {
  7829. html += '<div>';
  7830. for (var i = 0; i < res.data.length; i++) {
  7831. 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 + '\',\'' + crbFlag + '\',\'' + res.data[i].infectiousdiseasesFlag + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
  7832. html += res.data[i].name;
  7833. html += '<small>&nbsp;&nbsp;(' + res.data[i].code + ')</small>';
  7834. html += '</span></button>';
  7835. }
  7836. html += '</div>';
  7837. }
  7838. } else {
  7839. errorMesage(res);
  7840. }
  7841. $("#diagnoseContentHtml").html(html);
  7842. }
  7843. });
  7844. }
  7845. /**
  7846. * 填充中医诊断
  7847. */
  7848. function fitTcmDiagnoseValue(name, code) {
  7849. if (code === null || code === "") {
  7850. return;
  7851. }
  7852. let html = '';
  7853. let childrenNum = $("#tcmDiagnoseTags").children().length;
  7854. if (childrenNum == 6) {
  7855. errorMesageSimaple("最多填写六个诊断!");
  7856. return;
  7857. }
  7858. let diagnoseValue = $("#tcmDiagnoseValue").val();
  7859. if (diagnoseValue == null || diagnoseValue == "") {
  7860. diagnoseValue = code;
  7861. } else {
  7862. if (diagnoseValue.indexOf(code) != -1) {
  7863. errorMesageSimaple("诊断已存在,请勿重复添加!");
  7864. return;
  7865. }
  7866. diagnoseValue += "," + code;
  7867. }
  7868. $("#tcmDiagnoseValue").val(diagnoseValue);
  7869. if (childrenNum == 0) {
  7870. html += '<span class="el-tag--mainDiagnosis" ';
  7871. } else {
  7872. html += '<span class="el-tag--secondaryDiagnosis" ';
  7873. }
  7874. html += ' title="' + name + '(' + code + ')" id="' + code + '"><span class="el-select__tcmtags-text">' + name + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removetcmDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
  7875. $("#tcmDiagnoseTags").append(html);
  7876. $("#tcmDiagnoseTags").parent().parent().css("height", $("#tcmDiagnoseTags").height());
  7877. }
  7878. /**
  7879. * 填充诊断
  7880. * @param value
  7881. * @param code
  7882. */
  7883. function fitDiagnoseValue(value, code,crbFlag,infectiousdiseasesFlag) {
  7884. if (code === null || code === "") {
  7885. return;
  7886. }
  7887. var html = '';
  7888. var childrenNum = $("#diagnoseTags").children().length;
  7889. if (childrenNum == 6) {
  7890. errorMesageSimaple("最多填写六个诊断!");
  7891. return;
  7892. }
  7893. var diagnoseValue = $("#diagnoseValue").val();
  7894. if (diagnoseValue == null || diagnoseValue == "") {
  7895. diagnoseValue = code;
  7896. } else {
  7897. if (diagnoseValue.indexOf(code) != -1) {
  7898. errorMesageSimaple("诊断已存在,请勿重复添加!");
  7899. return;
  7900. }
  7901. diagnoseValue += "," + code;
  7902. }
  7903. $("#diagnoseValue").val(diagnoseValue);
  7904. if (childrenNum == 0) {
  7905. html += '<span class="el-tag--mainDiagnosis" ';
  7906. } else {
  7907. html += '<span class="el-tag--secondaryDiagnosis" ';
  7908. }
  7909. 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>';
  7910. $("#diagnoseTags").append(html);
  7911. $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
  7912. if(stringNotBlank($("#patientId").text()) && crbFlag =='1' && infectiousdiseasesFlag == 1){
  7913. crbMainCard()
  7914. }
  7915. }
  7916. /**
  7917. * 删除中医诊断
  7918. */
  7919. function removetcmDiagnoseValue(code) {
  7920. var childrenIndex = 0;
  7921. var children = $("#tcmDiagnoseTags").children();
  7922. for (var i = 0; i < children.length; i++) {
  7923. if ($(children[i]).attr("id") == code) {
  7924. childrenIndex = i;
  7925. break;
  7926. }
  7927. }
  7928. $($("#tcmDiagnoseTags").children("span")[childrenIndex]).remove();
  7929. if (childrenIndex == 0) {
  7930. $($("#tcmDiagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
  7931. }
  7932. let tcmDiagnoseValue = $("#tcmDiagnoseValue").val();
  7933. $("#tcmDiagnoseValue").val(tcmDiagnoseValue.replace(code, ""));
  7934. $("#tcmDiagnoseTags").parent().parent().css("height", $("#tcmDiagnoseTags").height());
  7935. }
  7936. /**
  7937. * 移除诊断
  7938. * @param code
  7939. */
  7940. function removeDiagnoseValue(code) {
  7941. var childrenIndex = 0;
  7942. var children = $("#diagnoseTags").children();
  7943. for (var i = 0; i < children.length; i++) {
  7944. if ($(children[i]).attr("id") == code) {
  7945. childrenIndex = i;
  7946. break;
  7947. }
  7948. }
  7949. $($("#diagnoseTags").children("span")[childrenIndex]).remove();
  7950. if (childrenIndex == 0) {
  7951. $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
  7952. }
  7953. var diagnoseValue = $("#diagnoseValue").val();
  7954. $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
  7955. $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
  7956. }
  7957. /**
  7958. * 点击通用参数属性值时设置值到对应的区域
  7959. * @param value
  7960. * @param id
  7961. */
  7962. function fitValue(value, id) {
  7963. //当选择的是血压时
  7964. if (id == "pressure_") {
  7965. var arr = value.split("/");
  7966. $("#pressure_high").val(arr[0]);
  7967. $("#pressure_floor").val(arr[1]);
  7968. if ($("#pressureLeftFlag").hasClass("in")) {
  7969. $("#pressure_high_left").val(arr[0]);
  7970. $("#pressure_floor_left").val(arr[1]);
  7971. }
  7972. //当选的是体重,体温,脉搏和呼吸时
  7973. } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
  7974. $("#" + id).val(value);
  7975. } else {
  7976. //主诉拼写时
  7977. var valueExist = $("#" + id).val();
  7978. if (valueExist != null && valueExist != "") {
  7979. value = valueExist + value;
  7980. }
  7981. $("#" + id).val(value);
  7982. }
  7983. }
  7984. /**
  7985. * 加载药品列表数列表
  7986. * @param index
  7987. */
  7988. function loadYpList(index, event) {
  7989. if (event != null) {
  7990. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  7991. //上下键不刷新表格
  7992. return;
  7993. }
  7994. }
  7995. var medicinePopoverContent = null;
  7996. var tableMedicine = null;
  7997. var MedicineName = null;
  7998. //var groupNo=null;
  7999. if (index == 0) {
  8000. medicinePopoverContent = "westernMedicinePopoverContent";
  8001. tableMedicine = "tb_table_western_medicine";
  8002. MedicineName = "western_medicine_name";
  8003. // groupNo=71;
  8004. }
  8005. if (index == 1) {
  8006. medicinePopoverContent = "chineseMedicinePopoverContent";
  8007. tableMedicine = "tb_table_chinese_medicine";
  8008. MedicineName = "chinese_medicine_name";
  8009. // groupNo=$("#zyClassType").val();
  8010. }
  8011. // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
  8012. // return;
  8013. // }
  8014. $('#' + MedicineName).webuiPopover('show');
  8015. $('#' + tableMedicine).bootstrapTable('refresh');
  8016. $('#' + tableMedicine).bootstrapTable({
  8017. url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
  8018. method: 'GET', //请求方式(*)
  8019. toolbar: '#toolbar', //工具按钮用哪个容器
  8020. striped: true, //是否显示行间隔色
  8021. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8022. pagination: false, //是否显示分页(*)
  8023. sortable: true, //是否启用排序
  8024. sortOrder: "asc", //排序方式
  8025. queryParams: function (params) {
  8026. var groupNo = null;
  8027. if (index == 0) {
  8028. groupNoListMz = groupNoList.filter((ere)=>{
  8029. return "1" == ere.mzFlag && "1" == ere.xyFlag
  8030. })
  8031. // console.log("groupNoListMz",groupNoListMz[0].groupNo)
  8032. groupNo = groupNoListMz[0].groupNo;
  8033. }
  8034. if (index == 1) {
  8035. groupNo = $("#zyClassType").val();
  8036. }
  8037. var temp = {
  8038. groupNo: groupNo,
  8039. commonParams: $("#" + MedicineName).val()
  8040. };
  8041. return temp;
  8042. }, //传递参数(*)
  8043. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  8044. pageNumber: 1, //初始化加载第一页,默认第一页
  8045. pageSize: 5, //每页的记录行数(*)
  8046. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8047. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8048. strictSearch: true,
  8049. showColumns: false, //是否显示所有的列
  8050. showRefresh: false, //是否显示刷新按钮
  8051. minimumCountColumns: 2, //最少允许的列数
  8052. clickToSelect: true, //是否启用点击选中行
  8053. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8054. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8055. cardView: false, //是否显示详细视图
  8056. detailView: false,
  8057. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8058. ajaxOptions: {
  8059. headers: {
  8060. 'Accept': 'application/json',
  8061. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8062. }
  8063. },
  8064. columns: [
  8065. // {
  8066. // title: '药品说明书',
  8067. // field: 'op',
  8068. // align: "center",
  8069. // valign: 'middle',
  8070. // formatter: function (value, row, index) {
  8071. // var str = '<button type="button" class="btn btn-primary btn-sm" onclick="hlyyypsms(\'' + row.code + '\',\'' + row.serial + '\')">说明书</button>';
  8072. // return [str].join('');
  8073. // }
  8074. // },
  8075. {
  8076. field: 'code',
  8077. title: '编码',
  8078. align: "center",
  8079. valign: 'middle',
  8080. // sortable: true
  8081. }, {
  8082. field: 'name',
  8083. title: '药品名称',
  8084. align: "center",
  8085. valign: 'middle',
  8086. // sortable: true
  8087. }
  8088. , {
  8089. field: 'specification',
  8090. title: '规格',
  8091. align: "center",
  8092. valign: 'middle',
  8093. // sortable: true
  8094. }, {
  8095. field: 'manufactory',
  8096. title: '生产厂家',
  8097. align: "center",
  8098. valign: 'middle',
  8099. // sortable: true
  8100. }, {
  8101. field: 'miniUnitName',
  8102. title: '单位',
  8103. align: "center",
  8104. valign: 'middle',
  8105. // sortable: true
  8106. }, {
  8107. field: 'chargeAmount',
  8108. title: '零售价',
  8109. align: "center",
  8110. valign: 'middle',
  8111. // sortable: true
  8112. formatter: function (value, row, index) {
  8113. if (value == null) {
  8114. return '0.0元';
  8115. }
  8116. return value.toFixed(2) + "元";
  8117. }
  8118. }, {
  8119. field: 'drugWinDesc',
  8120. title: '剂量',
  8121. align: "center",
  8122. valign: 'middle',
  8123. // sortable: true
  8124. }, {
  8125. field: 'stockAmountVirtual',
  8126. title: '库存数量',
  8127. align: "center",
  8128. valign: 'middle',
  8129. // sortable: true
  8130. }, {
  8131. field: 'ybBlNew',
  8132. title: '医保报销比例',
  8133. align: "center",
  8134. valign: 'middle',
  8135. // sortable: true
  8136. // formatter: function (value, row, index) {
  8137. // if (value != null) {
  8138. // return value + '%';
  8139. // }
  8140. // }
  8141. }, {
  8142. field: 'ybComment',
  8143. title: '医保说明',
  8144. align: "center",
  8145. valign: 'middle',
  8146. // sortable: true
  8147. }, {
  8148. field: 'nationalCode',
  8149. title: '医保编码',
  8150. align: "left",
  8151. valign: 'middle',
  8152. // sortable: true
  8153. }
  8154. ],
  8155. responseHandler: function (res) {
  8156. if (res == '401' || res == 401) {
  8157. window.location.href = '/thmz/login/view'
  8158. return;
  8159. }
  8160. var ress = eval(res);
  8161. if (ress.code == -1) {
  8162. errorMesage(res);
  8163. return {
  8164. "total": 0,//总页数
  8165. "rows": {} //数据
  8166. };
  8167. }
  8168. $("#" + medicinePopoverContent).parent().css("background", "#EBEBE4");
  8169. return {
  8170. "total": ress.data.length,//总页数
  8171. "rows": ress.data //数据
  8172. };
  8173. },
  8174. onClickRow: function (row, $element) {
  8175. postAjaxJsonHttpRequst("/thmz/checkKssByUserCode",{code:row.code,ypName:row.name,serial:row.serial,patientId:$("#patientId").text(),ypType:row.ypType},true,function (cres) {
  8176. if(cres.code == 0){
  8177. $('#' + MedicineName).webuiPopover('hide');
  8178. console.log("row",row)
  8179. console.log("index",index)
  8180. if (index == 0) {
  8181. clearWesternMedicine(false);
  8182. checkYpInfo(row.code, row.serial, row. groupNo, true, null, 3);
  8183. }
  8184. if (index == 1) {
  8185. checkZyInfo(row.code, row.serial, $("#zyClassType").val(), true);
  8186. }
  8187. }else if(cres.code == -2) {
  8188. errorMesageSimaple(`没有${row.code}/${row.name}的抗生素使用级别权限,不能开具此药品`)
  8189. }else if(cres.code == -3) {
  8190. errorMesageSimaple(cres.message)
  8191. } else {
  8192. errorMesage(cres)
  8193. }
  8194. })
  8195. }
  8196. });
  8197. }
  8198. /**
  8199. * 按照药品的编码 和药品拆零规格查询药品信息 西药
  8200. * @param code
  8201. * @param serial
  8202. * @param groupNo
  8203. * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
  8204. * @param orderNo 处方号,回写的时候需要用,因为有的处方没有满5个
  8205. * @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
  8206. */
  8207. function checkYpInfo(code, serial, groupNo, needNotice, orderNo, type) {
  8208. //判断是否有重复的项目 返回true 说明有重复的
  8209. if (verifyRepeat(code, serial, null, 0)) {
  8210. return;
  8211. }
  8212. $("#current_groupNo").val(groupNo);
  8213. //不需要每次都关闭这个帮助字典
  8214. //$("#treeButton").webuiPopover('hide');
  8215. $.ajax({
  8216. type: "GET",
  8217. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=" + groupNo,
  8218. contentType: "application/json;charset=UTF-8",
  8219. dataType: "json",
  8220. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8221. async: needNotice,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  8222. success: function (res) {
  8223. if (res == '401' || res == 401) {
  8224. window.location.href = '/thmz/login/view'
  8225. return;
  8226. }
  8227. if (res.code == 0) {
  8228. if (res.data != null) {
  8229. //如果
  8230. if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
  8231. initNavTabs(0, groupNo, orderNo);
  8232. }
  8233. var cfdesc = '普药';
  8234. if (groupNo == '91') {
  8235. cfdesc = '医材';
  8236. } else if (groupNo == '111') {
  8237. cfdesc = '麻、精一';
  8238. } else if (groupNo == '131') {
  8239. cfdesc = '精二';
  8240. }
  8241. // else if(groupNo=='151'){
  8242. // cfdesc='诊疗';
  8243. // }
  8244. //每个处方不能超过5个药品
  8245. var tableId = $("#xyTab li.active").find("a").attr("href");
  8246. var childrens = $(tableId).find("div:eq(0)").children().length;
  8247. var currentGroupNo = $(tableId).find("input.current_groupNo").val();
  8248. var flag = childrens === 5;
  8249. if (!needNotice) {
  8250. flag = childrens === 5 && $(tableId).is(':last-child');
  8251. }
  8252. if (currentGroupNo != null && currentGroupNo != '' && groupNo != currentGroupNo) {
  8253. //当前编辑的处方与选中的品类非同一处方能保存的
  8254. var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
  8255. //是否需要新增处方页,以保存医材处方
  8256. var needAddTable = true;
  8257. for (var i = 0; i < currentGroupNos.length; i++) {
  8258. if ($(currentGroupNos[i]).val() == groupNo) {
  8259. var next = $(currentGroupNos[i]).next();
  8260. if (needAddTable && $(next).children().length < 5) {
  8261. var parentId = $(currentGroupNos[i]).parent().attr("id");
  8262. //切换处方
  8263. $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
  8264. //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
  8265. //因为存在没有满5个的处方页,直接保存到该页
  8266. needAddTable = false;
  8267. fitWesternMedicine(res, groupNo, type);
  8268. }
  8269. }
  8270. }
  8271. if (needAddTable) {
  8272. //91 医材
  8273. var message = "医材需要单独处方,是否需要新增医材处方?";
  8274. if (groupNo == '71') {
  8275. message = "普通西成药需要单独处方,是否需要新增处方?"
  8276. } else if (groupNo == '111') {
  8277. message = "麻、精一药物需要单独处方,是否需要新增处方?"
  8278. } else if (groupNo == '131') {
  8279. message = "精二药物需要单独处方,是否需要新增处方?"
  8280. }
  8281. if (needNotice) {
  8282. $("#messageModal").modal();
  8283. $("#messageContent").html(message);
  8284. $("#messageButton").off("click").on("click", function (t) {
  8285. $("#messageModal").modal("hide");
  8286. refreshNavTabs(0, groupNo, orderNo);
  8287. fitWesternMedicine(res, groupNo, type);
  8288. // //选中药品后,光标默认到用法
  8289. // $("#supplyType").next().click();
  8290. });
  8291. $("#cancelButton").off("click");
  8292. } else {
  8293. refreshNavTabs(0, groupNo, orderNo);
  8294. fitWesternMedicine(res, groupNo, type);
  8295. }
  8296. }
  8297. //当前编辑的处方非普通西药处方
  8298. } else if (flag) {
  8299. if (needNotice) {
  8300. $("#messageModal").modal();
  8301. $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
  8302. $("#messageButton").off("click").on("click", function (t) {
  8303. $("#messageModal").modal("hide");
  8304. refreshNavTabs(0, groupNo, orderNo);
  8305. fitWesternMedicine(res, groupNo, type);
  8306. });
  8307. $("#cancelButton").off("click");
  8308. } else {
  8309. refreshNavTabs(0, groupNo, orderNo);
  8310. fitWesternMedicine(res, groupNo, type);
  8311. }
  8312. } else {
  8313. //修改药品
  8314. if (orderNo != null) {
  8315. //西药处方数量
  8316. // var xyTabLiLength = $("#xyTab li").length;
  8317. // if (xyTabLiLength < orderNo) {
  8318. //
  8319. // } else {
  8320. // $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
  8321. // }
  8322. var tableId = orderNoAndTableIdMap.get(orderNo);
  8323. if (tableId != null && tableId != "") {
  8324. //切换处方
  8325. $("#xyTab").find("a[href='#" + tableId + "']").off("click").tab('show');
  8326. //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
  8327. $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
  8328. } else {
  8329. refreshNavTabs(0, groupNo, orderNo);
  8330. }
  8331. fitWesternMedicine(res, groupNo, type);
  8332. } else {
  8333. $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
  8334. fitWesternMedicine(res, groupNo, type);
  8335. }
  8336. }
  8337. }
  8338. } else {
  8339. errorMesage(res);
  8340. }
  8341. }
  8342. });
  8343. }
  8344. /**
  8345. * 项目限制提示
  8346. * @param res
  8347. * @param projectDesc
  8348. */
  8349. function checkProjectSelfInfo(row) {
  8350. // console.log("checkProjectSelfInfo",row,ele)
  8351. var code = 0;
  8352. var age = currentPatientInfo.age;
  8353. var sex = currentPatientInfo.sex;
  8354. console.log("currentPatientInfo",currentPatientInfo)
  8355. if (row.genderRestriction && row.genderRestriction != 0 && sex != row.genderRestriction) {
  8356. warningMesageSimaple('项目'+row.name+'要求性别为'+row.genderRestriction == '1'?'男':'女'+'请重新选择!');
  8357. code = 1;
  8358. }
  8359. if (row.maxAgeRestriction && age > row.maxAgeRestriction) {
  8360. warningMesageSimaple('项目'+row.name+'要求年龄小于或等于'+row.maxAgeRestriction+'岁,请重新选择!');
  8361. code = 1;
  8362. }
  8363. if (row.minAgeRestriction && age < row.minAgeRestriction) {
  8364. warningMesageSimaple('项目'+row.name+'要求年龄大于或等于'+row.minAgeRestriction+'岁,请重新选择!');
  8365. code = 1;
  8366. }
  8367. return code;
  8368. }
  8369. /**
  8370. * 药品与项目自费信息提示
  8371. * @param res
  8372. * @param projectDesc
  8373. */
  8374. function hintProjectSelfPayInfo(selfpayProp, projectDesc) {
  8375. var zgmztczf = $("#zgmztczf").val();
  8376. if ((zgmztczf == 1 || zgmztczf == "1") && selfpayProp != null) {
  8377. selfpayProp = Number(selfpayProp);
  8378. if (selfpayProp > 0) {
  8379. var titile = "当前项目含自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
  8380. if (selfpayProp < 1) {
  8381. titile = "当前项目含部分自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
  8382. }
  8383. warningMesageSimaple(titile);
  8384. }
  8385. }
  8386. }
  8387. /**
  8388. * 按照药品的编码 和药品拆零规格查询药品信息 中药
  8389. * @param code
  8390. * @param serial
  8391. * @param groupNo 药房信息
  8392. * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  8393. */
  8394. function checkZyInfo(code, serial, groupNo, async) {
  8395. //判断是否有重复的项目 返回true 说明有重复的
  8396. if (verifyRepeat(code, serial, null, 1)) {
  8397. return;
  8398. }
  8399. let tcmDiagnoseValue = $("#tcmDiagnoseValue").val()
  8400. if(stringIsBlank(tcmDiagnoseValue)){
  8401. errorMesageSimaple('开中药必须要写中医诊断')
  8402. return;
  8403. }
  8404. $.ajax({
  8405. type: "GET",
  8406. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=" + groupNo,
  8407. contentType: "application/json;charset=UTF-8",
  8408. dataType: "json",
  8409. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8410. async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  8411. success: function (res) {
  8412. if (res == '401' || res == 401) {
  8413. window.location.href = '/thmz/login/view'
  8414. return;
  8415. }
  8416. if (res.code == 0) {
  8417. if (res.data != null) {
  8418. hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
  8419. //如果
  8420. if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
  8421. initNavTabs(1, null, null);
  8422. //$("input.zyfs").val(1);
  8423. }
  8424. $("#chinese_medicine_name").val(res.data.name);
  8425. $("#chinese_medicine_name").blur();
  8426. //$("#zy_drugWin").val(res.data.weight);
  8427. $("#zy_packRetprice").val(res.data.packRetprice);
  8428. $("#chinese_medicine_current_code").val(res.data.code);
  8429. $("#chinese_medicine_current_serial").val(res.data.serial);
  8430. if (async) {
  8431. //选中药品后,光标默认到数量输入框
  8432. $("#zy_drugWin").focus();
  8433. // prevEleId = 'zy_drugWin';
  8434. }
  8435. }
  8436. } else {
  8437. errorMesage(res);
  8438. }
  8439. }
  8440. });
  8441. }
  8442. /**
  8443. * 加载辅助检查、检验列表
  8444. * @param index
  8445. */
  8446. function loadjcJyItemList(event) {
  8447. if (event != null) {
  8448. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  8449. //上下键不刷新表格
  8450. return;
  8451. }
  8452. }
  8453. // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
  8454. // return;
  8455. // }
  8456. $('#jcJyItem').webuiPopover('show');
  8457. $('#tb_table_jc_jy_item').bootstrapTable('refresh');
  8458. $('#tb_table_jc_jy_item').bootstrapTable({
  8459. url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
  8460. method: 'GET', //请求方式(*)
  8461. toolbar: '#toolbar', //工具按钮用哪个容器
  8462. striped: true, //是否显示行间隔色
  8463. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8464. pagination: false, //是否显示分页(*)
  8465. sortable: true, //是否启用排序
  8466. sortOrder: "asc", //排序方式
  8467. queryParams: function (params) {
  8468. var temp = {
  8469. commonParams: $("#jcJyItem").val()
  8470. };
  8471. return temp;
  8472. }, //传递参数(*)
  8473. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  8474. pageNumber: 1, //初始化加载第一页,默认第一页
  8475. pageSize: 5, //每页的记录行数(*)
  8476. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8477. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8478. strictSearch: true,
  8479. showColumns: false, //是否显示所有的列
  8480. showRefresh: false, //是否显示刷新按钮
  8481. minimumCountColumns: 2, //最少允许的列数
  8482. clickToSelect: true, //是否启用点击选中行
  8483. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8484. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8485. cardView: false, //是否显示详细视图
  8486. detailView: false,
  8487. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8488. ajaxOptions: {
  8489. headers: {
  8490. 'Accept': 'application/json',
  8491. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8492. }
  8493. },
  8494. columns: [
  8495. {
  8496. field: 'code',
  8497. title: '编码',
  8498. align: "center",
  8499. valign: 'middle',
  8500. // sortable: true
  8501. }, {
  8502. field: 'name',
  8503. title: '名称',
  8504. align: "center",
  8505. valign: 'middle',
  8506. // sortable: true
  8507. }
  8508. , {
  8509. field: 'execUnitName',
  8510. title: '执行科室',
  8511. align: "center",
  8512. valign: 'middle',
  8513. // sortable: true
  8514. }, {
  8515. field: 'type',
  8516. title: '项目类型',
  8517. align: "center",
  8518. valign: 'middle',
  8519. // sortable: true
  8520. formatter: function (value, row, index) {
  8521. if (value == 1 || value == "1") {
  8522. return "检验";
  8523. }
  8524. if (value == 2 || value == "2") {
  8525. return "辅助检查";
  8526. }
  8527. if (value == 3 || value == "3") {
  8528. return "诊疗";
  8529. }
  8530. return "";
  8531. }
  8532. },
  8533. ],
  8534. responseHandler: function (res) {
  8535. if (res == '401' || res == 401) {
  8536. window.location.href = '/thmz/login/view'
  8537. return;
  8538. }
  8539. var ress = eval(res);
  8540. if (ress.code == -1) {
  8541. errorMesage(res);
  8542. return {
  8543. "total": 0,//总页数
  8544. "rows": {} //数据
  8545. };
  8546. }
  8547. $("#jcJyItemPopoverContent").parent().css("background", "#EBEBE4");
  8548. return {
  8549. "total": ress.data.length,//总页数
  8550. "rows": ress.data //数据
  8551. };
  8552. },
  8553. onClickRow: function (row, $element) {
  8554. postAjaxJsonHttpRequst("/thmz/checkJyJcGenderAndAge",{
  8555. patientId: $("#patientId").text(),
  8556. type:row.type,
  8557. code:row.code
  8558. },true,function (resJyJc) {
  8559. if(resJyJc.code == 0){
  8560. $('#jcJyItem').webuiPopover('hide');
  8561. $("#jcJyZltype").val(row.type);
  8562. $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
  8563. $("#execUnit").selectpicker('refresh');
  8564. if (row.type == 1) {
  8565. //检验
  8566. $("#jyZdSampleDiv").removeClass("hide").addClass("in");
  8567. $("#jyQuantityDiv").removeClass("hide").addClass("in");
  8568. $("#yshPartDiv").removeClass("in").addClass("hide");
  8569. if (row.sampleCode != null && row.sampleCode != "") {
  8570. $("#jyZdSample").selectpicker('val', row.sampleCode);
  8571. $('#jyZdSample').selectpicker('refresh');
  8572. }
  8573. } else if (row.type == 2) {
  8574. //检查
  8575. $("#yshPartDiv").removeClass("hide").addClass("in");
  8576. $("#jyZdSampleDiv").removeClass("in").addClass("hide");
  8577. $("#jyQuantityDiv").removeClass("in").addClass("hide");
  8578. if (row.bwCode != null && row.bwCode != "") {
  8579. $("#yshPart").selectpicker('val', row.bwCode);
  8580. $('#yshPart').selectpicker('refresh');
  8581. }
  8582. }
  8583. $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
  8584. checkJcJyItemInfo(row.code, row.name, row.type, true);
  8585. }else {
  8586. errorMesage(resJyJc)
  8587. }
  8588. })
  8589. }
  8590. });
  8591. }
  8592. /**
  8593. * 加载外配药品
  8594. * @param event
  8595. */
  8596. function loadWpMedicineList(event) {
  8597. if (event != null) {
  8598. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  8599. //上下键不刷新表格
  8600. return;
  8601. }
  8602. }
  8603. $('#wp_medicine_name').webuiPopover('show');
  8604. $('#tb_table_wp_medicine').bootstrapTable('refresh');
  8605. $('#tb_table_wp_medicine').bootstrapTable({
  8606. url: '/thmz/wpMzPrescription/queryRxMedicine', //请求后台的URL(*)
  8607. method: 'post', //请求方式(*)
  8608. toolbar: '#toolbar', //工具按钮用哪个容器
  8609. striped: true, //是否显示行间隔色
  8610. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8611. pagination: false, //是否显示分页(*)
  8612. sortable: true, //是否启用排序
  8613. sortOrder: "asc", //排序方式
  8614. queryParams: function (params) {
  8615. var temp = {
  8616. keyWard: $("#wp_medicine_name").val()
  8617. };
  8618. return temp;
  8619. }, //传递参数(*)
  8620. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  8621. pageNumber: 1, //初始化加载第一页,默认第一页
  8622. pageSize: 5, //每页的记录行数(*)
  8623. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8624. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8625. strictSearch: true,
  8626. showColumns: false, //是否显示所有的列
  8627. showRefresh: false, //是否显示刷新按钮
  8628. minimumCountColumns: 2, //最少允许的列数
  8629. clickToSelect: true, //是否启用点击选中行
  8630. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8631. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8632. cardView: false, //是否显示详细视图
  8633. detailView: false,
  8634. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8635. ajaxOptions: {
  8636. headers: {
  8637. 'Accept': 'application/json',
  8638. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8639. }
  8640. },
  8641. columns: [
  8642. {
  8643. field: 'medListCodg',
  8644. title: '医保码',
  8645. align: "center",
  8646. valign: 'middle',
  8647. width: 250,
  8648. // sortable: true
  8649. },
  8650. {
  8651. field: 'genname',
  8652. title: '药品名称',
  8653. align: "center",
  8654. valign: 'middle',
  8655. width: 150,
  8656. // sortable: true
  8657. }
  8658. , {
  8659. field: 'specName',
  8660. title: '规格',
  8661. align: "center",
  8662. valign: 'middle',
  8663. // sortable: true
  8664. }, {
  8665. field: 'prdrName',
  8666. title: '生产厂家',
  8667. align: "center",
  8668. valign: 'middle',
  8669. // sortable: true
  8670. }, {
  8671. field: 'aprvno',
  8672. title: '批准文号',
  8673. align: "center",
  8674. valign: 'middle',
  8675. // sortable: true
  8676. }, {
  8677. field: 'dualchnlFlag',
  8678. title: '是否双通道标志',
  8679. align: "center",
  8680. valign: 'middle',
  8681. formatter: function (value, row, index) {
  8682. if(value == 1 || value == "1"){
  8683. return "是";
  8684. }
  8685. return "否";
  8686. }
  8687. // sortable: true
  8688. }, {
  8689. field: 'minPrepunt',
  8690. title: '最小制剂单位',
  8691. align: "center",
  8692. valign: 'middle',
  8693. // sortable: true
  8694. }
  8695. , {
  8696. field: 'minPacunt',
  8697. title: '最小包装单位',
  8698. align: "center",
  8699. valign: 'middle',
  8700. // sortable: true
  8701. }
  8702. ],
  8703. responseHandler: function (res) {
  8704. if (res == '401' || res == 401) {
  8705. window.location.href = '/thmz/login/view'
  8706. return;
  8707. }
  8708. var ress = eval(res);
  8709. if (ress.code == -1) {
  8710. errorMesage(res);
  8711. return {
  8712. "total": 0,//总页数
  8713. "rows": {} //数据
  8714. };
  8715. }
  8716. $("#wpMedicinePopoverContent").parent().css("background", "#EBEBE4");
  8717. return {
  8718. "total": ress.data.length,//总页数
  8719. "rows": ress.data //数据
  8720. };
  8721. },
  8722. onClickRow: function (row, $element) {
  8723. $('#wp_medicine_name').webuiPopover('hide');
  8724. //诊疗
  8725. if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
  8726. initNavTabs(6, null, null);
  8727. }
  8728. $("#wp_medicine_name").val(row.genname);
  8729. $("#wp_medicine_name").blur();
  8730. $("#sinDosunt").val(row.minPrepunt);
  8731. $("#sinDoscnt").val('1');
  8732. setSelectDefaultVal('usedFrquCodg','13')
  8733. setSelectDefaultVal('drugDosform',row.dosformName)
  8734. $("#prdrName").val(row.prdrName);
  8735. $("#drugDosunt").val(row.minPacunt);
  8736. $("#drugSpec").val(row.specName);
  8737. $("#wp_medicine_current_code").val(row.medListCodg);
  8738. $("#sinDoscnt").focus();
  8739. return;
  8740. }
  8741. });
  8742. }
  8743. /**
  8744. * 加载诊疗列表
  8745. * @param index
  8746. */
  8747. function loadZlItemList(event) {
  8748. if (event != null) {
  8749. if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
  8750. //上下键不刷新表格
  8751. return;
  8752. }
  8753. }
  8754. $('#zlItem').webuiPopover('show');
  8755. $('#tb_table_zl_item').bootstrapTable('refresh');
  8756. $('#tb_table_zl_item').bootstrapTable({
  8757. url: '/thmz/getZlItemByCommonParams', //请求后台的URL(*)
  8758. method: 'GET', //请求方式(*)
  8759. toolbar: '#toolbar', //工具按钮用哪个容器
  8760. striped: true, //是否显示行间隔色
  8761. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  8762. pagination: false, //是否显示分页(*)
  8763. sortable: true, //是否启用排序
  8764. sortOrder: "asc", //排序方式
  8765. queryParams: function (params) {
  8766. var temp = {
  8767. commonParams: $("#zlItem").val()
  8768. };
  8769. return temp;
  8770. }, //传递参数(*)
  8771. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  8772. pageNumber: 1, //初始化加载第一页,默认第一页
  8773. pageSize: 5, //每页的记录行数(*)
  8774. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  8775. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  8776. strictSearch: true,
  8777. showColumns: false, //是否显示所有的列
  8778. showRefresh: false, //是否显示刷新按钮
  8779. minimumCountColumns: 2, //最少允许的列数
  8780. clickToSelect: true, //是否启用点击选中行
  8781. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  8782. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  8783. cardView: false, //是否显示详细视图
  8784. detailView: false,
  8785. //rowStyle:rowStyle,//通过自定义函数设置行样式
  8786. ajaxOptions: {
  8787. headers: {
  8788. 'Accept': 'application/json',
  8789. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  8790. }
  8791. },
  8792. columns: [
  8793. {
  8794. field: 'code',
  8795. title: '编码',
  8796. align: "center",
  8797. valign: 'middle',
  8798. // sortable: true
  8799. }, {
  8800. field: 'name',
  8801. title: '名称',
  8802. align: "center",
  8803. valign: 'middle',
  8804. // sortable: true
  8805. }
  8806. , {
  8807. field: 'execUnitName',
  8808. title: '执行科室',
  8809. align: "center",
  8810. valign: 'middle',
  8811. // sortable: true
  8812. }
  8813. , {
  8814. field: 'chargeAmount',
  8815. title: '价格',
  8816. align: "center",
  8817. valign: 'middle',
  8818. // sortable: true
  8819. formatter: function (value, row, index) {
  8820. if (value == null) {
  8821. return "0.00元";
  8822. }
  8823. return value.toFixed(2) + "元";
  8824. }
  8825. }, {
  8826. field: 'descriptions',
  8827. title: '规格',
  8828. align: "center",
  8829. valign: 'middle',
  8830. // sortable: true
  8831. }, {
  8832. field: 'selfpayProp',
  8833. title: '自付比例',
  8834. align: "center",
  8835. valign: 'middle',
  8836. // sortable: true
  8837. formatter: function (value, row, index) {
  8838. if (value != null) {
  8839. return value + '%';
  8840. }
  8841. }
  8842. }, {
  8843. field: 'connotation',
  8844. title: '医保说明',
  8845. align: "center",
  8846. valign: 'middle',
  8847. // sortable: true
  8848. }, {
  8849. field: 'nationalCode',
  8850. title: '医保编码',
  8851. align: "left",
  8852. valign: 'middle',
  8853. // sortable: true
  8854. }
  8855. ],
  8856. responseHandler: function (res) {
  8857. if (res == '401' || res == 401) {
  8858. window.location.href = '/thmz/login/view'
  8859. return;
  8860. }
  8861. var ress = eval(res);
  8862. if (ress.code == -1) {
  8863. errorMesage(res);
  8864. return {
  8865. "total": 0,//总页数
  8866. "rows": {} //数据
  8867. };
  8868. }
  8869. $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
  8870. return {
  8871. "total": ress.data.length,//总页数
  8872. "rows": ress.data //数据
  8873. };
  8874. },
  8875. onClickRow: function (row, $element) {
  8876. //判断是否验证失败,0通过1失败
  8877. // console.log("checkProjectSelfInfo(row)",checkProjectSelfInfo(row))
  8878. if(checkProjectSelfInfo(row) == 1){
  8879. return;
  8880. }
  8881. hintProjectSelfPayInfo(row.selfpayProp, "诊疗");
  8882. $('#zlItem').webuiPopover('hide');
  8883. $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
  8884. $("#zlExecUnit").selectpicker('refresh');
  8885. //诊疗
  8886. if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
  8887. initNavTabs(3, null, null);
  8888. }
  8889. $("#zlItem").val(row.name);
  8890. $("#zlItem").blur();
  8891. $("#zlItemPrice").val(row.chargeAmount);
  8892. zlItemPriceIsReadonly(row.chargeAmount);
  8893. $("#chargeUnit").val(row.specification);
  8894. $("#zl_current_code").val(row.code);
  8895. $("#itemQuantity").val(1);
  8896. $("#descriptions").val(row.descriptions);
  8897. $("#descriptions").attr('title', row.descriptions);
  8898. $("#dayZlNum").selectpicker('val', 1);//默认不选中
  8899. $("#dayZlNum").selectpicker('refresh');
  8900. $("#orderFrequencyZl").selectpicker('val', 'ONCE');//默认不选中
  8901. $("#orderFrequencyZl").selectpicker('refresh');
  8902. calculateZl(false);
  8903. $("#chargeUnit").focus();
  8904. return;
  8905. }
  8906. });
  8907. }
  8908. /**
  8909. * 诊疗单价输入框是否只读
  8910. */
  8911. function zlItemPriceIsReadonly(val) {
  8912. if(val !=null && Number(val) > 0 ){
  8913. $("#zlItemPrice").attr("readonly","readonly")
  8914. }else {
  8915. $("#zlItemPrice").removeAttr("readonly")
  8916. }
  8917. }
  8918. /**
  8919. * 诊疗与医技选中
  8920. * @param code
  8921. * @param name 回写的时候可以设置null
  8922. * @param type 1 检验 2 检查
  8923. * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  8924. */
  8925. //function checkJcJyItemInfo(code, name, type) {
  8926. function checkJcJyItemInfo(code, name, type, async) {
  8927. // //判断是否有重复的项目 返回true 说明有重复的
  8928. // if (verifyRepeat(code, null, 2)) {
  8929. // return;
  8930. // }
  8931. //不需要每次都关闭帮助树
  8932. //$("#treeButton").webuiPopover('hide');
  8933. $.ajax({
  8934. type: "GET",
  8935. url: '/thmz/getJcJyItemChargeByCode?code=' + code + '&jcJyZltype=' + type,
  8936. contentType: "application/json;charset=UTF-8",
  8937. dataType: "json",
  8938. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  8939. async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  8940. success: function (res) {
  8941. if (res == '401' || res == 401) {
  8942. window.location.href = '/thmz/login/view'
  8943. return;
  8944. }
  8945. if (res.code == 0) {
  8946. if (res.data != null) {
  8947. hintProjectSelfPayInfo(res.selfpayProp, type == 1 ? "检验" : "辅助检查");
  8948. //如果
  8949. if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
  8950. initNavTabs(2, null, null);
  8951. }
  8952. if (name == null) {
  8953. name = res.name;
  8954. }
  8955. $("#jcJyItem").val(name);
  8956. $("#jcJyItem").blur();
  8957. $("#jcjyItemPrice").val(res.totalAmount);
  8958. $("#jcjy_current_code").val(code);
  8959. $("#jy_national_code").val(res.data[0].nationalCode);
  8960. $("#jy_national_name").val(res.data[0].nationalName);
  8961. $("#jyQuantity").val(1);
  8962. $("#execUnit").selectpicker('val', res.execUnit);//默认不选中
  8963. $("#execUnit").selectpicker('refresh');
  8964. // if (async) {
  8965. // if (type == 1) {
  8966. // //选中项目后,光标默认到数量输入框
  8967. // $("#jyZdSample").next().click();
  8968. // // prevEleId = 'jyZdSample';
  8969. // } else if (type == 2) {
  8970. // $("#yshPart").next().click();
  8971. // // prevEleId = 'yshPart';
  8972. // }
  8973. // }
  8974. }
  8975. $("#jyjcNote").val(res.note)
  8976. } else {
  8977. errorMesage(res);
  8978. }
  8979. }
  8980. });
  8981. }
  8982. /**
  8983. * 查询辅助检查、检验项目明细
  8984. * @param code 编码
  8985. * @param jcJyZltype 1 检验 2 检查
  8986. */
  8987. function getJcJyItemChargeByCode(code, jcJyZltype) {
  8988. if (code != null) {
  8989. $("#itemCodeSearch").val(code);
  8990. $("#jcJyZltypeSearch").val(jcJyZltype);
  8991. } else if ($("#jcjy_current_code").val() == null || $("#jcjy_current_code").val() == '') {
  8992. errorMesageSimaple("未选中任何项目!");
  8993. return;
  8994. }
  8995. $("#jcJyItemModal").modal("show");
  8996. $('#jcJyItemTable').bootstrapTable('refresh');
  8997. $('#jcJyItemTable').bootstrapTable({
  8998. url: '/thmz/getJcJyItemChargeByCode', //请求后台的URL(*)
  8999. method: 'GET', //请求方式(*)
  9000. toolbar: '#toolbar', //工具按钮用哪个容器
  9001. striped: true, //是否显示行间隔色
  9002. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  9003. pagination: false, //是否显示分页(*)
  9004. sortable: true, //是否启用排序
  9005. sortOrder: "asc", //排序方式
  9006. queryParams: function (params) {
  9007. var itemCodeSearch = $("#itemCodeSearch").val();
  9008. var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
  9009. if (itemCodeSearch == null || itemCodeSearch == "") {
  9010. itemCodeSearch = $("#jcjy_current_code").val();
  9011. jcJyZltypeSearch = $("#jcJyZltype").val();
  9012. }
  9013. var temp = {
  9014. code: itemCodeSearch,
  9015. jcJyZltype: jcJyZltypeSearch
  9016. };
  9017. return temp;
  9018. }, //传递参数(*)
  9019. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  9020. pageNumber: 1, //初始化加载第一页,默认第一页
  9021. pageSize: 5, //每页的记录行数(*)
  9022. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  9023. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  9024. strictSearch: true,
  9025. showColumns: false, //是否显示所有的列
  9026. showRefresh: false, //是否显示刷新按钮
  9027. minimumCountColumns: 2, //最少允许的列数
  9028. clickToSelect: true, //是否启用点击选中行
  9029. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  9030. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  9031. cardView: false, //是否显示详细视图
  9032. detailView: false,
  9033. //rowStyle:rowStyle,//通过自定义函数设置行样式
  9034. ajaxOptions: {
  9035. headers: {
  9036. 'Accept': 'application/json',
  9037. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  9038. }
  9039. },
  9040. columns: [
  9041. {
  9042. field: 'tcCode',
  9043. title: '项目编码',
  9044. align: "center",
  9045. valign: 'middle',
  9046. // sortable: true
  9047. }, {
  9048. field: 'code',
  9049. title: '收费编码',
  9050. align: "center",
  9051. valign: 'middle',
  9052. // sortable: true
  9053. }
  9054. , {
  9055. field: 'name',
  9056. title: '收费名称',
  9057. align: "center",
  9058. valign: 'middle',
  9059. // sortable: true
  9060. }, {
  9061. field: 'num',
  9062. title: '数量',
  9063. align: "center",
  9064. valign: 'middle',
  9065. // sortable: true
  9066. }, {
  9067. field: 'chargeAmount',
  9068. title: '单价',
  9069. align: "center",
  9070. valign: 'middle',
  9071. // sortable: true
  9072. formatter: function (value, row, index) {
  9073. if (value == null || value == "") {
  9074. return 0;
  9075. }
  9076. return value.toFixed(2);
  9077. }
  9078. }, {
  9079. field: 'totalAmount',
  9080. title: '总金额',
  9081. align: "center",
  9082. valign: 'middle',
  9083. // sortable: true
  9084. formatter: function (value, row, index) {
  9085. if (value == null || value == "") {
  9086. return 0;
  9087. }
  9088. return value.toFixed(2);
  9089. }
  9090. }, {
  9091. field: 'selfpayProp',
  9092. title: '自付比例',
  9093. align: "center",
  9094. valign: 'middle',
  9095. // sortable: true
  9096. formatter: function (value, row, index) {
  9097. if (value != null) {
  9098. return value + '%';
  9099. }
  9100. }
  9101. }, {
  9102. field: 'connotation',
  9103. title: '医保说明',
  9104. align: "center",
  9105. valign: 'middle',
  9106. // sortable: true
  9107. }
  9108. ],
  9109. responseHandler: function (res) {
  9110. if (res == '401' || res == 401) {
  9111. window.location.href = '/thmz/login/view'
  9112. return;
  9113. }
  9114. $("#itemCodeSearch").val(null);
  9115. $("#jyjcNote").val(res.note)
  9116. var ress = eval(res);
  9117. if (ress.code == -1) {
  9118. errorMesage(res);
  9119. return {
  9120. "total": 0,//总页数
  9121. "rows": {} //数据
  9122. };
  9123. }
  9124. return {
  9125. "total": ress.data.length,//总页数
  9126. "rows": ress.data //数据
  9127. };
  9128. }
  9129. });
  9130. }
  9131. function getJyJcCodeParam() {
  9132. var itemCodeSearch = $("#itemCodeSearch").val();
  9133. var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
  9134. if (itemCodeSearch == null || itemCodeSearch == "") {
  9135. itemCodeSearch = $("#jcjy_current_code").val();
  9136. jcJyZltypeSearch = $("#jcJyZltype").val();
  9137. }
  9138. var temp = {
  9139. code: itemCodeSearch,
  9140. jcJyZltype: jcJyZltypeSearch
  9141. };
  9142. return temp;
  9143. }
  9144. /**
  9145. * 判断是否有重复的项目 返回true 说明有重复的
  9146. * @param code 编码
  9147. * @param serial 药品规格 null 时是非药品
  9148. * @param chargeUnitCode 检查部位或者检验物 null 时是 诊疗
  9149. * @param index
  9150. */
  9151. function verifyRepeat(code, serial, chargeUnitCode, index) {
  9152. //是新增药品还是编辑 true 修改 默认false
  9153. var updateFlag = null;
  9154. if (index == 0) {
  9155. updateFlag = $("#western_medicine_update_flag").val();
  9156. } else if (index == 1) {
  9157. updateFlag = $("#chinese_medicine_update_flag").val();
  9158. } else if (index == 2) {
  9159. updateFlag = $("#jcjy_update_flag").val();
  9160. } else if (index == 3) {
  9161. updateFlag = $("#zl_update_flag").val();
  9162. } else if (index == 5) {
  9163. updateFlag = $("#op_record_update_flag").val();
  9164. }else if (index == 6) {
  9165. updateFlag = $("#wp_medicine_update_flag").val();
  9166. }
  9167. if (updateFlag == undefined || updateFlag == null) {
  9168. updateFlag = false;
  9169. }
  9170. if (updateFlag == "true" || updateFlag == true) {
  9171. return false;
  9172. }
  9173. var tabId = null;
  9174. //西药
  9175. if (index == 0) {
  9176. tabId = "xyTab";
  9177. } else if (index == 1) {
  9178. //中成药
  9179. tabId = "zyTab";
  9180. } else if (index == 2) {
  9181. //辅助检查、检验
  9182. tabId = "jcjyTab";
  9183. } else if (index == 3) {
  9184. //诊疗
  9185. tabId = "zlTab";
  9186. } else if (index == 4) {
  9187. //入院
  9188. tabId = "zyReqTab";
  9189. } else if (index == 5) {
  9190. //手术
  9191. tabId = "opRecordTab";
  9192. }else if (index == 6) {
  9193. //外配药
  9194. tabId = "wpMedicineTab";
  9195. }
  9196. var tableId = $("#" + tabId + " li.active").find("a").attr("href");
  9197. var items = $(tableId).find("div:eq(0)").find("div.form-group");
  9198. var groupId = null;
  9199. if (index == 0) {
  9200. groupId = $("#groupId").val();
  9201. }
  9202. if (items != null && items.length > 0) {
  9203. for (var i = 0; i < items.length; i++) {
  9204. if (serial == null) {
  9205. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  9206. var temporary_items_desc_value = $(items[i]).find("input.temporary_items_desc_value").val();
  9207. if (chargeUnitCode == null && code === temporary_items_code) {
  9208. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  9209. return true;
  9210. }
  9211. if (code === temporary_items_code && chargeUnitCode === temporary_items_desc_value) {
  9212. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  9213. return true;
  9214. }
  9215. } else {
  9216. if (index == 0) {
  9217. //西药需要判断组号,因为可能会有不同组的皮试用药,需要相同的药品
  9218. var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
  9219. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  9220. var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
  9221. if (code === temporary_items_code && serial === temporary_items_serial && groupId === temporary_items_groupId) {
  9222. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  9223. return true;
  9224. }
  9225. } else {
  9226. var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
  9227. var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
  9228. if (code === temporary_items_code && serial === temporary_items_serial) {
  9229. errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
  9230. return true;
  9231. }
  9232. }
  9233. }
  9234. }
  9235. }
  9236. return false;
  9237. }
  9238. /**
  9239. * 初始化处方分页
  9240. * @param index 0 西药 1 中药 2 诊疗 3 入院
  9241. * @param groupNo 初始化时候的药房分类
  9242. * @param orderNo 初始化时候的处方组号
  9243. */
  9244. function initNavTabs(index, groupNo, orderNo) {
  9245. var tabId = null;
  9246. var tabContentId = null;
  9247. var paneId = null;
  9248. var cfdesc = '普药';
  9249. //西药
  9250. if (index == 0) {
  9251. tabId = "xyTab";
  9252. tabContentId = "xyTabContent";
  9253. paneId = "xycf_" + getUID();
  9254. } else if (index == 1) {
  9255. //中草药
  9256. tabId = "zyTab";
  9257. tabContentId = "zyTabContent";
  9258. paneId = "zycf_" + getUID();
  9259. cfdesc = '中草药';
  9260. } else if (index == 2) {
  9261. //医技
  9262. tabId = "jcjyTab";
  9263. tabContentId = "jcjyTabContent";
  9264. paneId = "jcjycf_" + getUID();
  9265. cfdesc = '辅助检查、检验';
  9266. } else if (index == 3) {
  9267. //诊疗
  9268. tabId = "zlTab";
  9269. tabContentId = "zlTabContent";
  9270. paneId = "zlcf_" + getUID();
  9271. cfdesc = '诊疗';
  9272. } else if (index == 4) {
  9273. //住院
  9274. tabId = "zyReqTab";
  9275. tabContentId = "zyReqTabContent";
  9276. paneId = "zyReqcf_" + getUID();
  9277. cfdesc = '入院';
  9278. } else if (index == 5) {
  9279. //手术
  9280. tabId = "opRecordTab";
  9281. tabContentId = "opRecordTabContent";
  9282. paneId = "opRecordcf_" + getUID();
  9283. cfdesc = '手术';
  9284. }else if (index == 6) {
  9285. //外配药
  9286. tabId = "wpMedicineTab";
  9287. tabContentId = "wpMedicineTabContent";
  9288. paneId = "wpMedicinecf_" + getUID();
  9289. cfdesc = '外配药';
  9290. }
  9291. var tabHtml = '<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab" ';
  9292. if (index == 0) {
  9293. tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
  9294. }
  9295. tabHtml += '>处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>';
  9296. $("#" + tabId).html(tabHtml);
  9297. var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
  9298. html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
  9299. html += '<input class="current_groupNo" type="hidden"/>';
  9300. html += ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
  9301. ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
  9302. html += '<div style="width: 460px;">'
  9303. if (index == 1) {
  9304. html += '<div id="cyFjDiv" style="width: 130px;float: left;line-height: 34px;">' +
  9305. ' <label class="my_label_2">复煎:</label>' +
  9306. ' <div style="width: 69px;float: left;">' +
  9307. ' <input type="number" class="form-control " id="cyFj" placeholder="请输入" value="1"/>' +
  9308. ' </div>次' +
  9309. ' </div>';
  9310. html += '<div style="width: 130px;float: left;line-height: 34px;">' +
  9311. ' <label class="my_label_2">分服:</label>' +
  9312. ' <div style="width: 69px;float: left;">' +
  9313. ' <input type="number" class="form-control " id="cyFfcs" placeholder="请输入" value="2"/>' +
  9314. ' </div>次' +
  9315. ' </div>';
  9316. html += '<div style="width: 180px;float: left;">' +
  9317. ' <label class="my_label_2">用法:</label>' +
  9318. ' <div style="width: 135px;float: left;">' +
  9319. ' <select class="form-control selectpicker show-tick useType"' +
  9320. ' title="请选择" id="useType_1">' +
  9321. ' </select>' +
  9322. ' </div>' +
  9323. ' </div>';
  9324. html += '</div><div style="width: 460px;">'
  9325. html += '<input id="singleAmount" type="hidden"/>';
  9326. }
  9327. html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
  9328. if (index == 0) {
  9329. html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
  9330. }
  9331. // else if (index == 1) {
  9332. // html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品代煎所产生的费用!</div>';
  9333. // }
  9334. html += '</div></div></div>';
  9335. $("#" + tabContentId).html(html);
  9336. if (index == 1) {
  9337. var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
  9338. $('#cyJssm').html(water);
  9339. $('#cyJssm').selectpicker('refresh');
  9340. $("#cyJssm").selectpicker('val', "加凉水");
  9341. $('#cyJssm').selectpicker('refresh');
  9342. if($("#zyClassType").val() =='83'){
  9343. $("#cyFjDiv").removeClass("in").addClass("hide");
  9344. }else {
  9345. $("#cyFjDiv").removeClass("hide").addClass("in");
  9346. }
  9347. initAllMzYshZdFysm();
  9348. //initZyOrderFrequencys("zy_orderFrequency_1", false);
  9349. initZySupplyTypes("zy_supplyType_1", false);
  9350. }
  9351. if (groupNo != null && groupNo != "") {
  9352. //设置当前药品的品类
  9353. $("#" + paneId).find("input.current_groupNo").val(groupNo);
  9354. }
  9355. if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
  9356. orderNoAndTableIdMap.put(orderNo, paneId);
  9357. tableIdAndOrderNoMap.put(paneId, orderNo);
  9358. }
  9359. }
  9360. /**
  9361. * 清空处方分页
  9362. * @param index 0 西药 1 中药 2 诊疗 3 入院 5 手术 6外配药
  9363. */
  9364. function clearNavTabs(index) {
  9365. var tabId = null;
  9366. var tabContentId = null;
  9367. //西药
  9368. if (index == 0) {
  9369. tabId = "xyTab";
  9370. tabContentId = "xyTabContent";
  9371. } else if (index == 1) {
  9372. //中草药
  9373. tabId = "zyTab";
  9374. tabContentId = "zyTabContent";
  9375. $("#cyJsl").val(400);
  9376. $("#cyZql").val(200);
  9377. $("#cyFj").val(1);
  9378. $("#cyFfcs").val(2);
  9379. $("#cyMtjs").val(1);
  9380. $("#zyfs").val(null);
  9381. $("#cyJssm").selectpicker('val', "加凉水");
  9382. $('#cyJssm').selectpicker('refresh');
  9383. $("#zy_supplyType_1").selectpicker('val', null);
  9384. $('#zy_supplyType_1').selectpicker('refresh');
  9385. } else if (index == 2) {
  9386. //辅助检查、检验
  9387. tabId = "jcjyTab";
  9388. tabContentId = "jcjyTabContent";
  9389. } else if (index == 3) {
  9390. //医技
  9391. tabId = "zlTab";
  9392. tabContentId = "zlTabContent";
  9393. } else if (index == 4) {
  9394. //住院
  9395. tabId = "zyReqTab";
  9396. tabContentId = "zyReqTabContent";
  9397. } else if (index == 5) {
  9398. //手术
  9399. tabId = "opRecordTab";
  9400. tabContentId = "opRecordTabContent";
  9401. }else if (index == 6) {
  9402. //手术
  9403. tabId = "wpMedicineTab";
  9404. tabContentId = "wpMedicineTabContent";
  9405. }
  9406. $("#" + tabId).html(null);
  9407. $("#" + tabContentId).html(null);
  9408. }
  9409. /**
  9410. * 添加处方分页
  9411. * @param index 0 西药 1 中药 2 诊疗 3 入院
  9412. * @param groupNo 71 普通西药 91 医材 111 麻、精一 131 精二 151 诊疗
  9413. * @param orderNo 处方号
  9414. */
  9415. function refreshNavTabs(index, groupNo, orderNo) {
  9416. var tabId = null;
  9417. var tabContentId = null;
  9418. var paneIdPrfix = null;
  9419. var cfdesc = '普药';
  9420. //西药
  9421. if (index == 0) {
  9422. tabId = "xyTab";
  9423. tabContentId = "xyTabContent";
  9424. paneIdPrfix = "xycf_";
  9425. if (groupNo == '91') {
  9426. cfdesc = '医材';
  9427. } else if (groupNo == '111') {
  9428. cfdesc = '麻、精一';
  9429. } else if (groupNo == '131') {
  9430. cfdesc = '精二';
  9431. }
  9432. // else if(groupNo=='151'){
  9433. // cfdesc='诊疗';
  9434. // }
  9435. } else if (index == 1) {
  9436. //中草药
  9437. tabId = "zyTab";
  9438. tabContentId = "zyTabContent";
  9439. paneIdPrfix = "zycf_";
  9440. cfdesc = '中草药';
  9441. } else if (index == 2) {
  9442. //辅助检查、检验
  9443. tabId = "jcjyTab";
  9444. tabContentId = "jcjyTabContent";
  9445. paneIdPrfix = "jcjycf_";
  9446. cfdesc = '辅助检查、检验';
  9447. } else if (index == 3) {
  9448. //诊疗
  9449. tabId = "zlTab";
  9450. tabContentId = "zlTabContent";
  9451. paneIdPrfix = "zlcf_";
  9452. cfdesc = '诊疗';
  9453. } else if (index == 4) {
  9454. //入院
  9455. tabId = "zyReqTab";
  9456. tabContentId = "zyReqTabContent";
  9457. paneIdPrfix = "zyReqcf_";
  9458. cfdesc = '入院';
  9459. } else if (index == 5) {
  9460. //手术
  9461. tabId = "opRecordTab";
  9462. tabContentId = "opRecordTabContent";
  9463. paneIdPrfix = "opRecordcf_";
  9464. cfdesc = '手术';
  9465. }else if (index == 6) {
  9466. //手术
  9467. tabId = "wpMedicineTab";
  9468. tabContentId = "wpMedicineTabContent";
  9469. paneIdPrfix = "wpMedicinecf_";
  9470. cfdesc = '外配药';
  9471. }
  9472. // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
  9473. // var length = $(tableId).find("div:eq(0)").children().length;
  9474. // if(length==0){
  9475. // //当前处方是空白的,不需要新增处方
  9476. // return;
  9477. // }
  9478. var cfTitle = "处方" + " <small class=\"cfdesc\">(" + cfdesc + ")</small>";
  9479. var paneId = paneIdPrfix + getUID();
  9480. //清除选中的样式
  9481. $("#" + tabId).find("li.active").removeClass("active");
  9482. var tabHtml = '<li><a href="#' + paneId + '" role="tab" data-toggle="tab"';
  9483. if (index == 0) {
  9484. tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
  9485. }
  9486. tabHtml += '>' + cfTitle + '</a';
  9487. tabHtml += '</li>';
  9488. $("#" + tabId).append(tabHtml);
  9489. var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
  9490. '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
  9491. '<input class="current_groupNo" type="hidden"/>' +
  9492. ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
  9493. ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">' +
  9494. '<div style="width: 460px;">' +
  9495. '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
  9496. if (index == 0) {
  9497. html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
  9498. }
  9499. html += '</div></div>';
  9500. $("#" + tabContentId).append(html);
  9501. //切换处方
  9502. $("#" + tabId).find("a[href='#" + paneId + "']").off("click").tab('show');
  9503. if (groupNo != null && groupNo != "") {
  9504. //设置当前药品的品类
  9505. $("#" + paneId).find("input.current_groupNo").val(groupNo);
  9506. }
  9507. if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
  9508. orderNoAndTableIdMap.put(orderNo, paneId);
  9509. tableIdAndOrderNoMap.put(paneId, orderNo);
  9510. }
  9511. }
  9512. /**
  9513. * 判断是否需要自动增加组号
  9514. * @param res
  9515. */
  9516. function autoAddGroupId(res) {
  9517. var tableId = $("#xyTab li.active").find("a").attr("href");
  9518. var childrens = $(tableId).find("div:eq(0)").children();
  9519. var prevCategoriesFlag = null;
  9520. if (childrens != null && childrens.length > 0) {
  9521. prevCategoriesFlag = $(childrens[childrens.length - 1]).find("input.temporary_items_categoriesFlag").val();
  9522. if (prevCategoriesFlag == "" || prevCategoriesFlag == undefined) {
  9523. prevCategoriesFlag = null;
  9524. }
  9525. }
  9526. if (!(res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2" || res.data.categoriesFlag == 1 || res.data.categoriesFlag == "1") ||
  9527. ((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)) {
  9528. //非针剂默认要切换组号 或者 是针剂,但是上一个药品不是针剂,这时候也要新换一个组号
  9529. var last = parseInt($("#groupId > option:last").val());
  9530. $("#groupId").selectpicker('val', last);
  9531. $('#groupId').selectpicker('refresh');
  9532. }
  9533. }
  9534. /**
  9535. * 填充西药选中的内容
  9536. * @param res
  9537. * @param groupNo
  9538. * @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
  9539. */
  9540. function fitWesternMedicine(res, groupNo, type) {
  9541. hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
  9542. if (type != 0) {
  9543. //处方修改的时候不改变组号
  9544. autoAddGroupId(res);
  9545. }
  9546. $("#categoriesFlag").val(res.data.categoriesFlag);
  9547. //prevCategoriesFlag = res.data.categoriesFlag;
  9548. $("#western_medicine_name").val(res.data.name);
  9549. $("#western_medicine_name").blur();
  9550. var drugWinHtml = '';
  9551. var index = null;
  9552. if (res.data.weight != null) {
  9553. $("#drugWin").val(res.data.weight);
  9554. $("#drugWinDb").val(res.data.weight);
  9555. drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
  9556. index = res.data.weighUnit;
  9557. }
  9558. if (res.data.volum != null) {
  9559. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  9560. $("#drugWin").val(res.data.volum);
  9561. $("#drugWinDb").val(res.data.volum);
  9562. }
  9563. drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
  9564. if (index == null) {
  9565. index = res.data.volUnit;
  9566. }
  9567. }
  9568. if (res.data.miniUnit != null && res.data.miniUnit != "") {
  9569. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  9570. $("#drugWin").val(1);
  9571. $("#drugWinDb").val(1);
  9572. }
  9573. drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
  9574. if (index == null) {
  9575. index = res.data.miniUnit;
  9576. }
  9577. }
  9578. $('#drugWinUnit').html(drugWinHtml);
  9579. $('#drugWinUnit').selectpicker('refresh');
  9580. $("#drugWinUnit").selectpicker('val', index);
  9581. $('#drugWinUnit').selectpicker('refresh');
  9582. if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
  9583. var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
  9584. $('#packUnit').html(html);
  9585. $('#packUnit').selectpicker('refresh');
  9586. $("#packUnit").selectpicker('val', res.data.packUnitDesc);
  9587. $('#packUnit').selectpicker('refresh');
  9588. }
  9589. $("#packRetprice").val(res.data.packRetprice);
  9590. $("#packSize").val(res.data.packSize);
  9591. $("#western_medicine_current_code").val(res.data.code);
  9592. $("#western_medicine_current_serial").val(res.data.serial);
  9593. if ($("#dayNum").val() == null) {
  9594. //天数 同组药品天数相同
  9595. $("#dayNum").selectpicker('val', 1);
  9596. $('#dayNum').selectpicker('refresh');
  9597. }
  9598. if (($("#supplyType").val() == null || $("#supplyType").val() == "") && res.data.supplyType != null) {
  9599. // 给药方式 同组药品给药方式相同
  9600. $("#supplyType").selectpicker('val', res.data.supplyType);
  9601. $('#supplyType').selectpicker('refresh');
  9602. }
  9603. if (($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") && res.data.frequency != null) {
  9604. //频次编码 同组药品频次编码相同
  9605. $("#orderFrequency").selectpicker('val', res.data.frequency);
  9606. $('#orderFrequency').selectpicker('refresh');
  9607. }
  9608. if ($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") {
  9609. //频次编码 防止频次为空
  9610. $("#orderFrequency").selectpicker('val', "ONCE");
  9611. $('#orderFrequency').selectpicker('refresh');
  9612. }
  9613. $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
  9614. if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
  9615. if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
  9616. initTryResultSelect(res.data.categoriesFlag);
  9617. }
  9618. }
  9619. $("#manufactoryName").val(res.data.manufactoryName);
  9620. $("#specification").val(res.data.specification);
  9621. calculate();
  9622. $("#addPDiv").css("margin-left", "50px");
  9623. $("#hlyyypsms").removeClass("hide").addClass("in");
  9624. $("#western_medicine_name").focus();
  9625. }
  9626. /**
  9627. * 剂量单位改变事件
  9628. */
  9629. function drugWinUnitChange() {
  9630. var desc = $('#drugWinUnit').find("option:selected").attr('desc');
  9631. $("#drugWin").val(desc);
  9632. $("#drugWinDb").val(desc);
  9633. calculate();
  9634. }
  9635. /**
  9636. * 根据选择的内容计算总的用药量
  9637. */
  9638. function calculate() {
  9639. //最小规格剂量
  9640. var drugWinDb = $("#drugWinDb").val();
  9641. //天数
  9642. var dayNum = $("#dayNum").val();
  9643. //当前使用的最小剂量
  9644. var drugWin = $("#drugWin").val();
  9645. //频率
  9646. var times = $('#orderFrequency').find("option:selected").attr('desc');
  9647. //包装规格数量
  9648. var packSize = $("#packSize").val();
  9649. //单价
  9650. var packRetprice = $("#packRetprice").val();
  9651. //当前药房编码
  9652. var currentGroupNo = $("#current_groupNo").val();
  9653. if (drugWinDb == null || drugWinDb === "") {
  9654. if (currentGroupNo == '71') {
  9655. return;
  9656. }
  9657. drugWinDb = 1;
  9658. }
  9659. if (dayNum == null || dayNum === "") {
  9660. if (currentGroupNo == '71') {
  9661. return;
  9662. }
  9663. dayNum = 1;
  9664. }
  9665. if (drugWin == null || drugWin === "") {
  9666. if (currentGroupNo == '71') {
  9667. return;
  9668. }
  9669. drugWin = 1;
  9670. }
  9671. if (times == null || times === "") {
  9672. if (currentGroupNo == '71') {
  9673. return;
  9674. }
  9675. times = 1;
  9676. }
  9677. if (packSize == null || packSize === "") {
  9678. return;
  9679. }
  9680. //拆零总量
  9681. var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
  9682. //整包装的数量
  9683. var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
  9684. $("#gross").val(totalNum);
  9685. $("#totalRetprice").val(Multiply(totalNum, packRetprice));
  9686. }
  9687. /**
  9688. * 根据选择的总量计算金额 只有医材的时候需要计算
  9689. */
  9690. function calculateSimple() {
  9691. //总量
  9692. var gross = $("#gross").val();
  9693. //单价
  9694. var packRetprice = $("#packRetprice").val();
  9695. $("#totalRetprice").val(Multiply(gross, packRetprice));
  9696. //当前药房编码
  9697. var currentGroupNo = $("#current_groupNo").val();
  9698. if (currentGroupNo == '91') {
  9699. var dayNum = $("#dayNum").val();
  9700. if (dayNum == null || dayNum == "") {
  9701. //医材默认天数为1
  9702. $("#dayNum").selectpicker('val', 1);
  9703. $('#dayNum').selectpicker('refresh');
  9704. }
  9705. var orderFrequency = $("#orderFrequency").val();
  9706. if (orderFrequency == null || orderFrequency == "") {
  9707. $("#orderFrequency").selectpicker('val', "ONCE");
  9708. $('#orderFrequency').selectpicker('refresh');
  9709. }
  9710. }
  9711. }
  9712. /**
  9713. * 根据中药付数计算金额
  9714. */
  9715. function calculateZyAmount() {
  9716. var singleAmount = $("#singleAmount").val();
  9717. var tableId = $("#zyTab li.active").find("a").attr("href");
  9718. //获取中药付数
  9719. //var zyfs = $(tableId).find("input.zyfs").val();
  9720. var zyfs = $("#zyfs").val();
  9721. var cfAmount = Multiply(zyfs, singleAmount);
  9722. $(tableId).find("span.cf_amount").html(cfAmount);
  9723. calculateTotalAmount(false);
  9724. }
  9725. /**
  9726. * 将病人信息填入患者信息修改form
  9727. * @param patinet
  9728. */
  9729. function fillPlusPatinet(patinet) {
  9730. if (patinet != null) {
  9731. $("#editUserCode").val(patinet.patientId);
  9732. $("#editUserName").val(patinet.name);
  9733. $("#editUserName").blur();
  9734. $("#editUserAge").val(patinet.age);
  9735. $("#editUserAge").blur();
  9736. $("#editUserGender").selectpicker('val', patinet.sex);
  9737. $("#editUserGender").selectpicker('refresh');
  9738. $("#editUserGender").blur();
  9739. $("#editUserBirthDay").val(patinet.birthDayStr);
  9740. $("#editUserBirthDay").blur();
  9741. $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
  9742. $('#editUserCertificateType').selectpicker('refresh');
  9743. $("#editUserCardNo").val(patinet.icCardNo);
  9744. $("#editUserCardNo").attr("title", patinet.icCardNo);
  9745. $("#editUserCardNo").blur();
  9746. $("#editUserPhoneNum").val(patinet.phoneNo);
  9747. $("#editUserPhoneNum").attr("title", patinet.phoneNo);
  9748. $("#editUserPhoneNum").blur();
  9749. $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
  9750. $('#editUserPatientsNature').selectpicker('refresh');
  9751. $("#editUserPatientsNature").blur();
  9752. $("#editUserIdCard").val(patinet.socialNo);
  9753. $("#editUserIdCard").attr("title", patinet.socialNo);
  9754. $("#editUserIdCard").blur();
  9755. $('#editUserProvinceCode').selectpicker('val', patinet.provinceCode);
  9756. $('#editUserProvinceCode').selectpicker('refresh');
  9757. initCity(2, patinet.cityCode);
  9758. initDistrict(2, patinet.cityCode, patinet.districtCode);
  9759. $("#editUserDetail").val(patinet.detail);
  9760. $("#editUserDetail").blur();
  9761. $("#editUserContact").val(patinet.relName);
  9762. $("#editUserContactPhone").val(patinet.contractName);
  9763. }
  9764. }
  9765. /**
  9766. * 修改病人信息
  9767. */
  9768. function modifyPatient() {
  9769. $.ajax({
  9770. type: "POST",
  9771. url: '/thmz/modifyPatient',
  9772. contentType: "application/json;charset=UTF-8",
  9773. dataType: "json",
  9774. data: JSON.stringify({
  9775. "name": $("#editUserName").val(),
  9776. "age": $("#editUserAge").val(),
  9777. "sex": $("#editUserGender").val(),
  9778. "birthDay": $("#editUserBirthDay").val(),
  9779. "certificateType": $("#editUserCertificateType").val(),
  9780. "icCardNo": $("#editUserCardNo").val(),
  9781. "phoneNo": $("#editUserPhoneNum").val(),
  9782. "responseType": $("#editUserPatientsNature").val(),
  9783. "socialNo": $("#editUserIdCard").val(),
  9784. "provinceCode": $("#editUserProvinceCode").val(),
  9785. "cityCode": $("#editCityCode").val(),
  9786. "districtCode": $("#editUserDistrictCode").val(),
  9787. "detail": $("#editUserDetail").val(),
  9788. "patientId": $("#editUserCode").val(),
  9789. "relName": $("#editUserContact").val(),
  9790. "contractName": $("#editUserContactPhone").val()
  9791. }),
  9792. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9793. success: function (res) {
  9794. if (res == '401' || res == 401) {
  9795. window.location.href = '/thmz/login/view'
  9796. return;
  9797. }
  9798. if (res.code == 0) {
  9799. $('#editUserModal').modal('hide');
  9800. var patientId = $("#patientId").text();
  9801. let tempMzfzSerialNo = $("#mzfzSerialNoInClick").val();
  9802. if (patientId != null && patientId != 'null' && patientId != "" && tempMzfzSerialNo.indexOf("clnicId_") < 0 ) {
  9803. realClinicalReception(patientId, $("#mzfzSerialNoInClick").val(), $("#mzfzReqTypeNoInClick").val());
  9804. } else {
  9805. if(ksjzType == 2){
  9806. let tempPatientId = $("#editUserCode").val();
  9807. clearRapidAccepts();
  9808. $("#rapidAcceptsUserCardNo").val(tempPatientId);
  9809. queryUserInfoByCardNo();
  9810. ksjzType = null;
  9811. }
  9812. }
  9813. clearPlusPatinet();
  9814. } else {
  9815. errorMesage(res);
  9816. }
  9817. }
  9818. });
  9819. }
  9820. /**
  9821. * 将病人信息修改域置空
  9822. * @param patinet
  9823. */
  9824. function clearPlusPatinet() {
  9825. ksjzType = null;
  9826. $("#editUserCode").val(null);
  9827. $("#editUserName").val(null);
  9828. $("#editUserAge").val(null);
  9829. $("#editUserGender").selectpicker('val', '1');
  9830. $("#editUserGender").selectpicker('refresh');
  9831. $("#editUserBirthDay").val(null);
  9832. $('#editUserCertificateType').selectpicker('val', '01');
  9833. $('#editUserCertificateType').selectpicker('refresh');
  9834. $("#editUserCardNo").val(null);
  9835. $("#editUserCardNo").attr("title", null);
  9836. $("#editUserPhoneNum").val(null);
  9837. $("#editUserPhoneNum").attr("title", null);
  9838. $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
  9839. $('#editUserPatientsNature').selectpicker('refresh');
  9840. $("#editUserIdCard").val(null);
  9841. $("#editUserIdCard").attr("title", null);
  9842. $('#editUserProvinceCode').selectpicker('val', null);
  9843. $('#editUserProvinceCode').selectpicker('refresh');
  9844. $('#editCityCode').selectpicker('val', null);
  9845. $('#editCityCode').selectpicker('refresh');
  9846. $('#editUserDistrictCode').selectpicker('val', null);
  9847. $('#editUserDistrictCode').selectpicker('refresh');
  9848. $("#editUserDetail").val(null);
  9849. $("#editUserContact").val(null);
  9850. $("#editUserContactPhone").val(null);
  9851. var openSource = $("#openSource").val();
  9852. if (openSource == 2 || openSource == '2') {
  9853. $("#rapidAcceptsModal").modal();
  9854. } else if (openSource == 3 || openSource == '3') {
  9855. $("#visitingDetailModal").modal();
  9856. }
  9857. $("#openSource").val(null);
  9858. }
  9859. // /**
  9860. // * 保存入院证
  9861. // */
  9862. // function saveBeHospitalized() {
  9863. // $.ajax({
  9864. // type: "POST",
  9865. // url: '/thmz/saveMzZyReq',
  9866. // contentType: "application/json;charset=UTF-8",
  9867. // dataType: "json",
  9868. // data: JSON.stringify({
  9869. // "patientId": $("#patientId").text(),
  9870. // "icdCode": $("#icdCodeBeHospitalized").val(),
  9871. // "icdText": $("#icdTextBeHospitalized").val(),
  9872. // "reqDept": $("#inpatientWardBeHospitalized").val(),
  9873. // "smallDept": $("#smallWardBeHospitalized").val(),
  9874. // "admissStatus": $("#admissStatus").val()
  9875. // }),
  9876. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9877. // success: function (res) {
  9878. // if (res == '401' || res == 401) {
  9879. // window.location.href = '/thmz/login/view'
  9880. // return;
  9881. // }
  9882. // if (res.code == 0) {
  9883. // successMesage(res);
  9884. // $('#beHospitalizedModal').modal('hide');
  9885. // loadInClinicTableList();
  9886. // loadClinicTableList();
  9887. // clearWorkSpace();
  9888. // } else {
  9889. // errorMesage(res);
  9890. // }
  9891. // }
  9892. // });
  9893. // }
  9894. /**
  9895. * 获取按钮组选择的下标
  9896. * @param id
  9897. * @returns {number}
  9898. */
  9899. function getIndex(id) {
  9900. var index = 0;
  9901. var item = $("#" + id).find("button");
  9902. for (var i = 0; i <= item.length; i++) {
  9903. if ($(item[i]).hasClass("btn-primary")) {
  9904. index = i;
  9905. break;
  9906. }
  9907. }
  9908. return index;
  9909. }
  9910. /**
  9911. * 获取时间选择器的时间数组
  9912. * @returns {string[]}
  9913. */
  9914. function getRePortRangeArr() {
  9915. var rePortRange = $('#reportrange span').html();
  9916. var rePortRangeArr = rePortRange.split(" - ");
  9917. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  9918. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  9919. return rePortRangeArr;
  9920. }
  9921. /**
  9922. * 初始医生工作太配置
  9923. */
  9924. function initWorkspaceConfigForCurrent() {
  9925. $.ajax({
  9926. type: "GET",
  9927. url: '/thmz/getWorkspaceConfigForCurrent',
  9928. dataType: "json",
  9929. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  9930. success: function (res) {
  9931. if (res == '401' || res == 401) {
  9932. window.location.href = '/thmz/login/view'
  9933. return;
  9934. }
  9935. if (res.code == 0) {
  9936. if (res.data.symptomFlag == 1) {
  9937. $("#symptomFlag").removeClass("in").addClass("hide");
  9938. if ($("#symptomFlagCheck").parent().hasClass("checked")) {
  9939. $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
  9940. }
  9941. } else if (res.data.symptomFlag == 0) {
  9942. $("#symptomFlag").removeClass("hide").addClass("in");
  9943. if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
  9944. $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
  9945. }
  9946. }
  9947. if (res.data.emrHpiFlag == 1) {
  9948. $("#emrHpiFlag").removeClass("in").addClass("hide");
  9949. if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
  9950. $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
  9951. }
  9952. } else if (res.data.emrHpiFlag == 0) {
  9953. $("#emrHpiFlag").removeClass("hide").addClass("in");
  9954. if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
  9955. $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
  9956. }
  9957. }
  9958. if (res.data.emrPsFlag == 1) {
  9959. $("#emrPsFlag").removeClass("in").addClass("hide");
  9960. if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
  9961. $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
  9962. }
  9963. } else if (res.data.emrPsFlag == 0) {
  9964. $("#emrPsFlag").removeClass("hide").addClass("in");
  9965. if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
  9966. $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
  9967. }
  9968. }
  9969. if (res.data.personalHistoryFlag == 1) {
  9970. $("#personalHistoryFlag").removeClass("in").addClass("hide");
  9971. if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
  9972. $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  9973. }
  9974. } else if (res.data.personalHistoryFlag == 0) {
  9975. $("#personalHistoryFlag").removeClass("hide").addClass("in");
  9976. if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
  9977. $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  9978. }
  9979. }
  9980. if (res.data.fzZlFlag == 1) {
  9981. $("#fzZlFlag").removeClass("in").addClass("hide");
  9982. if ($("#fzZlFlagCheck").parent().hasClass("checked")) {
  9983. $("#fzZlFlagCheck").parent().parent().click();//当前选中改为不选中
  9984. }
  9985. } else if (res.data.fzZlFlag == 0) {
  9986. $("#fzZlFlag").removeClass("hide").addClass("in");
  9987. if (!$("#fzZlFlagCheck").parent().hasClass("checked")) {
  9988. $("#fzZlFlagCheck").parent().parent().click();//当前不选中改为选中
  9989. }
  9990. }
  9991. if (res.data.crbHistoryFlag == 1) {
  9992. $("#crbHistoryFlag").removeClass("in").addClass("hide");
  9993. if ($("#crbHistoryFlagCheck").parent().hasClass("checked")) {
  9994. $("#crbHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  9995. }
  9996. } else if (res.data.crbHistoryFlag == 0) {
  9997. $("#crbHistoryFlag").removeClass("hide").addClass("in");
  9998. if (!$("#crbHistoryFlagCheck").parent().hasClass("checked")) {
  9999. $("#crbHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  10000. }
  10001. }
  10002. if (res.data.familyHistoryFlag == 1) {
  10003. $("#familyHistoryFlag").removeClass("in").addClass("hide");
  10004. if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
  10005. $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  10006. }
  10007. } else if (res.data.familyHistoryFlag == 0) {
  10008. $("#familyHistoryFlag").removeClass("hide").addClass("in");
  10009. if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
  10010. $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  10011. }
  10012. }
  10013. if (res.data.obstericalHistoryFlag == 1) {
  10014. $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
  10015. if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
  10016. $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
  10017. }
  10018. } else if (res.data.obstericalHistoryFlag == 0) {
  10019. $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
  10020. if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
  10021. $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
  10022. }
  10023. }
  10024. if (res.data.pressureLeftFlag == 1) {
  10025. $("#pressureLeftFlag").removeClass("in").addClass("hide");
  10026. if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
  10027. $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
  10028. }
  10029. } else if (res.data.pressureLeftFlag == 0) {
  10030. $("#pressureLeftFlag").removeClass("hide").addClass("in");
  10031. if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
  10032. $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
  10033. }
  10034. }
  10035. if (res.data.tentativeDiagnosisFlag == 1) {
  10036. $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
  10037. if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
  10038. $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
  10039. }
  10040. } else if (res.data.tentativeDiagnosisFlag == 0) {
  10041. $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
  10042. if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
  10043. $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
  10044. }
  10045. }
  10046. if (res.data.checkboxFlag == 1) {
  10047. if ($("#checkboxFlagCheck").parent().hasClass("checked")) {
  10048. $("#checkboxFlagCheck").parent().parent().click();//当前选中改为不选中
  10049. }
  10050. } else if (res.data.checkboxFlag == 0) {
  10051. if (!$("#checkboxFlagCheck").parent().hasClass("checked")) {
  10052. $("#checkboxFlagCheck").parent().parent().click();//当前不选中改为选中
  10053. }
  10054. }
  10055. if (res.data.zlPrintFlag == 1) {
  10056. if ($("#zlPrintFlagCheck").parent().hasClass("checked")) {
  10057. $("#zlPrintFlagCheck").parent().parent().click();//当前选中改为不选中
  10058. }
  10059. } else if (res.data.zlPrintFlag == 0) {
  10060. if (!$("#zlPrintFlagCheck").parent().hasClass("checked")) {
  10061. $("#zlPrintFlagCheck").parent().parent().click();//当前不选中改为选中
  10062. }
  10063. }
  10064. //设置是否默认勾选处方回调
  10065. localStorage.setItem("checkboxFlag", res.data.checkboxFlag);
  10066. } else {
  10067. errorMesage(res);
  10068. }
  10069. }
  10070. });
  10071. }
  10072. /**
  10073. * 保存医生工作台配置
  10074. */
  10075. function saveWorkspaceConfig() {
  10076. var symptomFlag = $("#symptomFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10077. var emrHpiFlag = $("#emrHpiFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10078. var emrPsFlag = $("#emrPsFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10079. var personalHistoryFlag = $("#personalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10080. var familyHistoryFlag = $("#familyHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10081. var fzZlFlag = $("#fzZlFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10082. var crbHistoryFlag = $("#crbHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10083. var obstericalHistoryFlag = $("#obstericalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10084. var pressureLeftFlag = $("#pressureLeftFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10085. var tentativeDiagnosisFlag = $("#tentativeDiagnosisFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10086. var checkboxFlag = $("#checkboxFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10087. var zlPrintFlag = $("#zlPrintFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
  10088. $.ajax({
  10089. type: "POST",
  10090. url: '/thmz/saveWorkspaceConfig',
  10091. contentType: "application/json;charset=UTF-8",
  10092. dataType: "json",
  10093. data: JSON.stringify({
  10094. "symptomFlag": symptomFlag,
  10095. "emrHpiFlag": emrHpiFlag,
  10096. "emrPsFlag": emrPsFlag,
  10097. "personalHistoryFlag": personalHistoryFlag,
  10098. "familyHistoryFlag": familyHistoryFlag,
  10099. "fzZlFlag": fzZlFlag,
  10100. "crbHistoryFlag": crbHistoryFlag,
  10101. "obstericalHistoryFlag": obstericalHistoryFlag,
  10102. "pressureLeftFlag": pressureLeftFlag,
  10103. "tentativeDiagnosisFlag": tentativeDiagnosisFlag,
  10104. "checkboxFlag": checkboxFlag,
  10105. "zlPrintFlag": zlPrintFlag
  10106. }),
  10107. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  10108. success: function (res) {
  10109. if (res == '401' || res == 401) {
  10110. window.location.href = '/thmz/login/view'
  10111. return;
  10112. }
  10113. if (res.code == 0) {
  10114. successMesage(res);
  10115. initWorkspaceConfigForCurrent();
  10116. $("#configWorkspaceModal").modal("hide");
  10117. } else {
  10118. errorMesage(res);
  10119. }
  10120. }
  10121. });
  10122. }
  10123. /**
  10124. * 初始化药品,检查检验菜单树
  10125. */
  10126. function initzTree() {
  10127. var index = getIndex("bill_item_group");
  10128. if (index == 0) {
  10129. $("#western_medicine_name").webuiPopover('hide');
  10130. $.ajax({
  10131. type: "GET",
  10132. url: '/thmz/getYpZdClasses',
  10133. contentType: "application/json;charset=UTF-8",
  10134. dataType: "json",
  10135. async: false,
  10136. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  10137. success: function (res) {
  10138. if (res == '401' || res == 401) {
  10139. window.location.href = '/thmz/login/view'
  10140. return;
  10141. }
  10142. if (res.code == 0) {
  10143. // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
  10144. var setting = {
  10145. callback: {
  10146. onClick: zTreeOnClick
  10147. }
  10148. };
  10149. $.fn.zTree.init($("#treeDemo"), setting, res.data);
  10150. var webuiId = $("#treeButton").attr("data-target");
  10151. var top = $("#" + webuiId).css("top");
  10152. if (top.indexOf("-") == 0) {
  10153. $("#" + webuiId).css("top", '0px');
  10154. }
  10155. } else {
  10156. errorMesage(res);
  10157. }
  10158. }
  10159. });
  10160. } else if (index == 2) {
  10161. $("#jcJyItem").webuiPopover('hide');
  10162. $.ajax({
  10163. type: "GET",
  10164. url: '/thmz/getJyJcZdClasses',
  10165. contentType: "application/json;charset=UTF-8",
  10166. dataType: "json",
  10167. async: false,
  10168. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  10169. success: function (res) {
  10170. if (res == '401' || res == 401) {
  10171. window.location.href = '/thmz/login/view'
  10172. return;
  10173. }
  10174. if (res.code == 0) {
  10175. // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
  10176. var setting = {
  10177. callback: {
  10178. onClick: zTreeOnClick
  10179. }
  10180. };
  10181. $.fn.zTree.init($("#treeDemo"), setting, res.data);
  10182. var webuiId = $("#treeButton").attr("data-target");
  10183. var top = $("#" + webuiId).css("top");
  10184. if (top.indexOf("-") == 0) {
  10185. $("#" + webuiId).css("top", '0px');
  10186. }
  10187. } else {
  10188. errorMesage(res);
  10189. }
  10190. }
  10191. });
  10192. } else if (index == 1) {
  10193. $("#treeButton").webuiPopover('hide');
  10194. warningMesageSimaple("中药暂无帮助字典");
  10195. } else if (index == 3) {
  10196. $("#treeButton").webuiPopover('hide');
  10197. warningMesageSimaple("诊疗暂无帮助字典");
  10198. } else {
  10199. $("#treeButton").webuiPopover('hide');
  10200. warningMesageSimaple("入院暂无帮助字典");
  10201. }
  10202. }
  10203. /**
  10204. * 节点点击事件
  10205. * @param event
  10206. * @param treeId
  10207. * @param treeNode
  10208. */
  10209. function zTreeOnClick(event, treeId, treeNode) {
  10210. var index = getIndex("bill_item_group");
  10211. if (index == 0) {
  10212. $("#western_medicine_name").val(treeNode.id);
  10213. $('#western_medicine_name').webuiPopover('show');
  10214. loadYpList(0, null);
  10215. } else if (index == 2) {
  10216. $("#jcJyItem").val(treeNode.id);
  10217. $('#jcJyItem').webuiPopover('show');
  10218. loadjcJyItemList(null);
  10219. }
  10220. }
  10221. /**
  10222. * 构建处方参数
  10223. * @param type 1 保存处方 2 保存模板 3 计算金额
  10224. * @returns {any}
  10225. */
  10226. function getParamsForpPrescription(type) {
  10227. var codes = $("#diagnoseValue").val();
  10228. var icdCode = null;
  10229. if (codes != null && codes.length > 0) {
  10230. var arr = codes.split(",");
  10231. if (arr != null) {
  10232. for (i = 0; i < arr.length; i++) {
  10233. if (arr[i] != "") {
  10234. if (icdCode == null) {
  10235. icdCode = arr[i];
  10236. } else {
  10237. icdCode += "," + arr[i];
  10238. }
  10239. }
  10240. }
  10241. }
  10242. }
  10243. let tcmCodes = $("#tcmDiagnoseValue").val();
  10244. let tcmIcdCodes = null;
  10245. if (tcmCodes != null && tcmCodes.length > 0) {
  10246. let arr = tcmCodes.split(",");
  10247. if (arr != null) {
  10248. for (i = 0; i < arr.length; i++) {
  10249. if (arr[i] != "") {
  10250. if (tcmIcdCodes == null) {
  10251. tcmIcdCodes = arr[i];
  10252. } else {
  10253. tcmIcdCodes += "," + arr[i];
  10254. }
  10255. }
  10256. }
  10257. }
  10258. }
  10259. var jsonData = JSON.parse('' +
  10260. '{"patientId": "",' +
  10261. '"visitDeptCode":"",' +
  10262. '"firstOrNot":"",' +
  10263. '"icdCode": "",' +
  10264. '"icdText": null,' +
  10265. '"tcmIcdCode": "",' +
  10266. '"tcmIcdText": null,' +
  10267. '"jzFlag": "0",' +
  10268. '"serialNo":"",' +
  10269. '"mzBlRecord": ' +
  10270. '{"firstOrNot": "",' +
  10271. '"emrChiefComplaint": "",' +
  10272. '"emrHpi": "",' +
  10273. '"emrPs": "",' +
  10274. '"emrPe": "",' +
  10275. '"emrFzjc": null,' +
  10276. '"emrProcess": null,' +
  10277. '"emrXyy": "无",' +
  10278. '"emrYypg": "无",' +
  10279. '"emrGnpg": "无",' +
  10280. '"emrJkjy": "",' +
  10281. '"personalHistory": "",' +
  10282. '"familyHistory": "",' +
  10283. '"fzZl": "",' +
  10284. '"crbHistory": "",' +
  10285. '"obstericalHistory": "",' +
  10286. '"weight": "",' +
  10287. '"temperature": "",' +
  10288. '"sphygmus": "",' +
  10289. '"breathe": "",' +
  10290. '"pressureHigh": "",' +
  10291. '"pressureFloor": "",' +
  10292. '"pressureHighLeft": "",' +
  10293. '"pressureFloorLeft": "",' +
  10294. '"tentativeDiagnosis":"",' +
  10295. '"prescriptionDetail":""},' +
  10296. '"mzChargeDetailList": [],' +
  10297. '"rxDruginfoList": [],' +
  10298. '"wxmallPackagePurchasedItemList": [],' +
  10299. '"mzYjReqList": [],' +
  10300. '"mzZyReq": {"reqDept": "","smallDept": "","admissStatus": "","conditionCode": "","routeOfAdmission": "", "contacterName":null , "contacterRelationship": "", "contacterPhone":null , "contacterAddress":null , "deposit":null },' +
  10301. '"opRecordList": [],' +
  10302. '"patientAllergenInfoList": [],' +
  10303. '"zgmztczf":"",' +
  10304. '"opspDisecode":"",' +
  10305. '"opspDiseName":"",' +
  10306. '"reqType":"",' +
  10307. '"orderType":"",' +
  10308. '"ghFeeFlag":"",' +
  10309. '"grzhzf":"",' +
  10310. '"readCardResult":"",' +
  10311. '"readCardType":"01"}');
  10312. jsonData.patientId = $("#patientId").text();
  10313. var userIdCode = localStorage.getItem("userIdCode");
  10314. var visitDeptCode = localStorage.getItem(userIdCode);
  10315. if (visitDeptCode == null) {
  10316. visitDeptCode = "";
  10317. }
  10318. jsonData.visitDeptCode = visitDeptCode;
  10319. jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
  10320. jsonData.icdCode = icdCode;
  10321. jsonData.tcmIcdCode = tcmIcdCodes;
  10322. jsonData.serialNo = $("#mzfzSerialNoInClick").val();
  10323. if (type == 1) {
  10324. jsonData.turnToConsultationId = $("#turnToConsultationIdInClick").val();
  10325. var mdtrtGrpType = $("#mdtrtGrpType").val();
  10326. var trumFlag = $("#trumFlag").val();
  10327. var relTtpFlag = $("#relTtpFlag").val();
  10328. if (trumFlag == "1" && relTtpFlag == "") {
  10329. errorMesageSimaple("请注意【外伤标志】为【是】,【涉及第三方标志】不能为空!");
  10330. $("#messageButton").attr("disabled", false);
  10331. $("#messageModal").modal("hide");
  10332. throw new Error("请注意【外伤标志】为【是】,【涉及第三方标志】不能为空!");
  10333. }
  10334. var otpErReflFlag = $("#otpErReflFlag").val();
  10335. var expContent = JSON.parse("{}");
  10336. if (mdtrtGrpType != "" && mdtrtGrpType != "-1") {
  10337. expContent.MDTRT_GRP_TYPE = mdtrtGrpType;
  10338. }
  10339. if (trumFlag != "") {
  10340. expContent.TRUM_FLAG = trumFlag;
  10341. }
  10342. if (relTtpFlag != "") {
  10343. expContent.REL_TTP_FLAG = relTtpFlag;
  10344. }
  10345. if (otpErReflFlag != "" && otpErReflFlag != "-1") {
  10346. expContent.OTP_ER_REFL_FLAG = otpErReflFlag;
  10347. }
  10348. jsonData.expContent = JSON.stringify(expContent);
  10349. }
  10350. jsonData.mzBlRecord.firstOrNot = jsonData.firstOrNot;
  10351. jsonData.mzBlRecord.emrChiefComplaint = $("#symptom").val();
  10352. jsonData.mzBlRecord.emrHpi = $("#emrHpi").val();
  10353. jsonData.mzBlRecord.emrPs = $("#emrPs").val();
  10354. jsonData.mzBlRecord.emrPe = $("#otherCheck").val();
  10355. jsonData.mzBlRecord.emrJkjy = $("#healthEducation").val();
  10356. jsonData.mzBlRecord.personalHistory = $("#personalHistory").val();
  10357. jsonData.mzBlRecord.familyHistory = $("#familyHistory").val();
  10358. jsonData.mzBlRecord.fzZl = $("#fzZl").val();
  10359. jsonData.mzBlRecord.crbHistory = $("#crbHistory").val();
  10360. jsonData.mzBlRecord.obstericalHistory = $("#obstericalHistory").val();
  10361. jsonData.mzBlRecord.weight = $("#weight").val();
  10362. jsonData.mzBlRecord.temperature = $("#temperature").val();
  10363. jsonData.mzBlRecord.sphygmus = $("#sphygmus").val();
  10364. jsonData.mzBlRecord.breathe = $("#breathe").val();
  10365. jsonData.mzBlRecord.pressureHigh = $("#pressure_high").val();
  10366. jsonData.mzBlRecord.pressureFloor = $("#pressure_floor").val();
  10367. jsonData.mzBlRecord.pressureHighLeft = $("#pressure_high_left").val();
  10368. jsonData.mzBlRecord.pressureFloorLeft = $("#pressure_floor_left").val();
  10369. jsonData.mzBlRecord.tentativeDiagnosis = $("#tentativeDiagnosis").val();
  10370. //职工统筹部分参数
  10371. jsonData.zgmztczf = $("#zgmztczf").val();
  10372. jsonData.grzhzf = $("#grzhzf").val();
  10373. jsonData.readCardResult = $("#readCardResult").val();
  10374. jsonData.reqType = $("#mzReqType").val();
  10375. jsonData.orderType = $("#mzOrderTypeSelect").val();
  10376. jsonData.ghFeeFlag = $("#ghFeeSelect").val();
  10377. jsonData.opspDisecode = curOpspDiseCode;
  10378. jsonData.opspDiseName = curOpspDiseName;
  10379. //设置过敏源
  10380. var zdAllergen = $("#zdAllergen").val();
  10381. var ypDitList = $("#ypDitList").val();
  10382. if (zdAllergen != null && zdAllergen.length > 0) {
  10383. for (var i = 0; i < zdAllergen.length; i++) {
  10384. var tempJson = JSON.parse('{}');
  10385. tempJson.allergenCode = zdAllergen[i];
  10386. tempJson.type = 0;
  10387. jsonData.patientAllergenInfoList[jsonData.patientAllergenInfoList.length] = tempJson;
  10388. }
  10389. }
  10390. if (ypDitList != null && ypDitList.length > 0) {
  10391. for (var i = 0; i < ypDitList.length; i++) {
  10392. var tempJson = JSON.parse('{}');
  10393. tempJson.allergenCode = ypDitList[i];
  10394. tempJson.type = 1;
  10395. jsonData.patientAllergenInfoList[jsonData.patientAllergenInfoList.length] = tempJson;
  10396. }
  10397. }
  10398. //设置处方详情
  10399. var emrFzjc = null;
  10400. var xyTabContents = $("#xyTabContent").find("div.tab-pane");
  10401. //处方号
  10402. var orderNo = 0;
  10403. var arrs = $("span.cf_amount");
  10404. //西药设置
  10405. if (xyTabContents != null && xyTabContents.length > 0) {
  10406. for (var i = 0; i < xyTabContents.length; i++) {
  10407. //当前药品类型
  10408. var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
  10409. var formGroups = $(xyTabContents[i]).find("div.form-group");
  10410. if (formGroups != null && formGroups.length > 0) {
  10411. for (var j = 0; j < formGroups.length; j++) {
  10412. var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "","frequency": "","orderDays": "","paySelf": "0","drugWin": "1","instructionCode":"",' +
  10413. '"instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","tryFlag":"","tryResult":"","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
  10414. tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
  10415. tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
  10416. tempJson.quantity = $(formGroups[j]).find("input.temporary_items_gross").val();
  10417. tempJson.drugQuan = $(formGroups[j]).find("input.temporary_items_drugWin").val();
  10418. tempJson.drugUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnit").val();
  10419. tempJson.frequency = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
  10420. tempJson.orderDays = $(formGroups[j]).find("input.temporary_items_dayNum").val();
  10421. tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
  10422. tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
  10423. tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
  10424. tempJson.hospApprFlag = $(formGroups[j]).find("input.temporary_items_xyHospApprFlag").val();
  10425. orderNo = i + 1;
  10426. tempJson.orderNo = orderNo;
  10427. tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
  10428. tempJson.groupNo = currentGroupNo;
  10429. var tryResult = $(formGroups[j]).find("input.temporary_items_tryResult").val();
  10430. if (tryResult != undefined || tryResult != null || tryResult != "") {
  10431. if (tryResult == 100 || tryResult == "100") {
  10432. tempJson.tryFlag = 1;
  10433. } else {
  10434. tempJson.tryResult = tryResult;
  10435. }
  10436. }
  10437. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  10438. }
  10439. }
  10440. }
  10441. }
  10442. //中草药
  10443. var zyTabContents = $("#zyTabContent").find("div.form-group");
  10444. if (zyTabContents != null && zyTabContents.length > 0) {
  10445. orderNo++;
  10446. var zyfs = $("#zyfs").val();
  10447. if (zyfs == null || zyfs == "") {
  10448. if (type == 3) {
  10449. zyfs = 1;
  10450. } else {
  10451. errorMesageSimaple("中药付数为空,请设置!");
  10452. $("#messageButton").attr("disabled", false);
  10453. throw new Error('中药付数为空,请设置!');
  10454. }
  10455. }
  10456. //中药的类型
  10457. var currentZyClassType = $("#current_zyClassType").val();
  10458. for (var i = 0; i < zyTabContents.length; i++) {
  10459. var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "g","frequency": "","orderDays": "1","paySelf": "0","drugWin": "","instructionCode":"",' +
  10460. '"instructionText":"","orderNo":"1","groupOrder":"1","supplyCode":"","tryFlag":"0","tryResult":"0","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
  10461. tempJson.chargeItemCode = $(zyTabContents[i]).find("input.temporary_items_code").val();
  10462. tempJson.serial = $(zyTabContents[i]).find("input.temporary_items_serial").val();
  10463. tempJson.quantity = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
  10464. tempJson.drugQuan = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
  10465. tempJson.drugWin = zyfs;
  10466. tempJson.drugUnit=$(zyTabContents[i]).find("input.temporary_items_drugUnit").val();
  10467. //tempJson.frequency = $("#zy_orderFrequency_1").val();
  10468. tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
  10469. tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
  10470. tempJson.hospApprFlag = $(zyTabContents[i]).find("input.temporary_items_zyHospApprFlag").val();
  10471. tempJson.cyFysm = $("#useType_1").val();
  10472. tempJson.cyJssm = $("#cyJssm").val();
  10473. tempJson.cyJsl = $("#cyJsl").val();
  10474. if(currentZyClassType !='83'){
  10475. tempJson.cyZql = $("#cyZql").val();
  10476. tempJson.cyFj = $("#cyFj").val();
  10477. tempJson.cyDj = $("#zy_supplyType_1").val();
  10478. }
  10479. tempJson.cyFfcs = $("#cyFfcs").val();
  10480. tempJson.cyMtjs = $("#cyMtjs").val();
  10481. tempJson.orderNo = orderNo;
  10482. tempJson.groupNo = currentZyClassType;
  10483. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  10484. }
  10485. }
  10486. //辅助检查、检验
  10487. var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
  10488. if (jcjyTabContents != null && jcjyTabContents.length > 0) {
  10489. orderNo++;
  10490. for (var i = 0; i < jcjyTabContents.length; i++) {
  10491. if (emrFzjc == null) {
  10492. emrFzjc = $(jcjyTabContents[i]).text();
  10493. } else {
  10494. emrFzjc += "," + $(jcjyTabContents[i]).text();
  10495. }
  10496. var tempJson = null;
  10497. //项目类型
  10498. var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
  10499. //执行科室
  10500. var execUnit = $(jcjyTabContents[i]).find("input.temporary_items_execUnit").val();
  10501. tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":"","quantity":""}');
  10502. tempJson.orderCode = $(jcjyTabContents[i]).find("input.temporary_items_code").val();
  10503. tempJson.jyRemark = $(jcjyTabContents[i]).find("input.temporary_items_remark").val();
  10504. tempJson.orderNo = orderNo;
  10505. tempJson.execDept = execUnit;
  10506. if (itemsType == "1" || itemsType == 1) {
  10507. //检验
  10508. tempJson.inspectStuff = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
  10509. tempJson.quantity = $(jcjyTabContents[i]).find("input.temporary_items_jyQuantity").val();
  10510. // console.log('tempJson------------',tempJson)
  10511. // //检验云处理数据
  10512. // hasJyData = true
  10513. // let tempJyItem = {
  10514. // "labItemCode": tempJson.orderCode,
  10515. // "labItemName": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
  10516. // "labRecognCode": "",
  10517. // "labRecognName": "",
  10518. // "insuranceItemCode": $(jcjyTabContents[i]).find("input.temporary_jy_national_code").val(),
  10519. // "insuranceItemName": $(jcjyTabContents[i]).find("input.temporary_jy_national_name").val()
  10520. // }
  10521. // jyItemArr.push(tempJyItem)
  10522. } else if (itemsType == "2" || itemsType == 2) {
  10523. //检查
  10524. tempJson.inspectPart = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
  10525. }
  10526. jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
  10527. jsonData.hasJcItem = true
  10528. }
  10529. }
  10530. //诊疗
  10531. var zlTabContents = $("#zlTabContent").find("div.form-group");
  10532. if (zlTabContents != null && zlTabContents.length > 0) {
  10533. orderNo++;
  10534. for (var i = 0; i < zlTabContents.length; i++) {
  10535. var tempJson = null;
  10536. //执行科室
  10537. var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
  10538. //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
  10539. tempJson = JSON.parse('{"unitPrice": "0","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":""}');
  10540. tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
  10541. tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
  10542. tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_totalNumZl").val();
  10543. tempJson.drugQuan = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
  10544. tempJson.zlUnitPrice = $(zlTabContents[i]).find("input.temporary_items_amount").val();
  10545. //因为收费表里的单位长度限制,无法存入库
  10546. //tempJson.drugUnit = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
  10547. tempJson.frequency = $(zlTabContents[i]).find("input.temporary_items_orderFrequencyZl").val();
  10548. tempJson.hospApprFlag = $(zlTabContents[i]).find("input.temporary_items_zlHospApprFlag").val();
  10549. tempJson.orderDays = $(zlTabContents[i]).find("input.temporary_items_dayZlNum").val();
  10550. tempJson.orderNo = orderNo;
  10551. tempJson.execDept = execUnit;
  10552. jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
  10553. }
  10554. }
  10555. //外配药
  10556. var wpMedicineTabContents = $("#wpMedicineTabContent").find("div.form-group");
  10557. if (wpMedicineTabContents != null && wpMedicineTabContents.length > 0) {
  10558. for (var i = 0; i < wpMedicineTabContents.length; i++) {
  10559. var tempJson = JSON.parse('{"medListCodg": "","drugGenname": "","rxItemTypeCode": "","medcWayCodg": "","medcDays": "1","prdrName": "","sinDosunt": "","sinDoscnt": "1","usedFrquCodg": "","drugDosunt": "","drugCnt":"","drugSpec":"","hospApprFlag":"","drugDosform":""}');
  10560. tempJson.medListCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_code").val();
  10561. tempJson.drugGenname = $(wpMedicineTabContents[i]).find("input.temporary_items_wpMedicineName").val();
  10562. tempJson.rxItemTypeCode = $(wpMedicineTabContents[i]).find("input.temporary_items_rxItemTypeCode").val();
  10563. tempJson.medcWayCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_medcWayCodg").val();
  10564. tempJson.medcDays = $(wpMedicineTabContents[i]).find("input.temporary_items_medcDays").val();
  10565. tempJson.prdrName = $(wpMedicineTabContents[i]).find("input.temporary_items_prdrName").val();
  10566. tempJson.sinDosunt = $(wpMedicineTabContents[i]).find("input.temporary_items_sinDosunt").val();
  10567. tempJson.drugDosform = $(wpMedicineTabContents[i]).find("input.temporary_items_drugDosform").val();
  10568. tempJson.sinDoscnt = $(wpMedicineTabContents[i]).find("input.temporary_items_sinDoscnt").val();
  10569. tempJson.usedFrquCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_usedFrquCodg").val();
  10570. tempJson.drugCnt = $(wpMedicineTabContents[i]).find("input.temporary_items_drugCnt").val();
  10571. tempJson.drugDosunt = $(wpMedicineTabContents[i]).find("input.temporary_items_drugDosunt").val();
  10572. tempJson.drugSpec = $(wpMedicineTabContents[i]).find("input.temporary_items_drugSpec").val();
  10573. tempJson.hospApprFlag = $(wpMedicineTabContents[i]).find("input.temporary_items_wpHospApprFlag").val();
  10574. jsonData.rxDruginfoList[jsonData.rxDruginfoList.length] = tempJson;
  10575. }
  10576. }
  10577. //入院
  10578. var zyReqTabContents = $("#zyReqTabContent").find("div.form-group");
  10579. if (zyReqTabContents != null && zyReqTabContents.length > 0) {
  10580. jsonData.mzZyReq.reqDept = $(zyReqTabContents[0]).find("input.temporary_inpatient_ward").val();
  10581. jsonData.mzZyReq.smallDept = $(zyReqTabContents[0]).find("input.temporary_items_small_ward").val();
  10582. jsonData.mzZyReq.admissStatus = $(zyReqTabContents[0]).find("input.temporary_items_admiss_status").val();
  10583. jsonData.mzZyReq.conditionCode = $(zyReqTabContents[0]).find("input.temporary_items_condition_code").val();
  10584. jsonData.mzZyReq.routeOfAdmission = $(zyReqTabContents[0]).find("input.temporary_items_route_of_admission").val();
  10585. jsonData.mzZyReq.contacterName = $(zyReqTabContents[0]).find("input.temporary_items_contacter_name").val();
  10586. jsonData.mzZyReq.contacterRelationship = $(zyReqTabContents[0]).find("input.temporary_items_contacter_relationship").val();
  10587. jsonData.mzZyReq.contacterPhone = $(zyReqTabContents[0]).find("input.temporary_items_contacter_phone").val();
  10588. jsonData.mzZyReq.contacterAddress = $(zyReqTabContents[0]).find("input.temporary_items_contacter_address").val();
  10589. jsonData.mzZyReq.deposit = $(zyReqTabContents[0]).find("input.temporary_items_deposit").val();
  10590. }
  10591. //门诊手术
  10592. var opRecordTabContents = $("#opRecordTabContent").find("div.form-group");
  10593. if (opRecordTabContents != null && opRecordTabContents.length > 0) {
  10594. for (var i = 0; i < opRecordTabContents.length; i++) {
  10595. var tempJson = null;
  10596. var execUnit = $(opRecordTabContents[i]).find("input.temporary_items_execUnit").val();
  10597. tempJson = JSON.parse('{"opCode": "","opName": "","opDatetimeStr": "","urgentClinicFlag": "","ssbc": "","partCode": "","opScale": "","hocusCode": "","doctorZd": "","remark":""}');
  10598. tempJson.opCode = $(opRecordTabContents[i]).find("input.temporary_items_code").val();
  10599. tempJson.opName = $(opRecordTabContents[i]).find("input.temporary_items_op_name").val();
  10600. tempJson.opDatetimeStr = $(opRecordTabContents[i]).find("input.temporary_items_op_time").val();
  10601. tempJson.urgentClinicFlag = $(opRecordTabContents[i]).find("input.temporary_items_urgent_clinic_flag").val();
  10602. tempJson.ssbc = $(opRecordTabContents[i]).find("input.temporary_items_ssbc").val();
  10603. tempJson.partCode = $(opRecordTabContents[i]).find("input.temporary_items_part_code").val();
  10604. tempJson.opScale = $(opRecordTabContents[i]).find("input.temporary_items_op_scale").val();
  10605. tempJson.hocusCode = $(opRecordTabContents[i]).find("input.temporary_items_hocus_code").val();
  10606. tempJson.doctorZd = $(opRecordTabContents[i]).find("input.temporary_items_doctor_zd").val();
  10607. tempJson.remark = $(opRecordTabContents[i]).find("input.temporary_items_op_record_remark").val();
  10608. jsonData.opRecordList[jsonData.opRecordList.length] = tempJson;
  10609. }
  10610. }
  10611. //设置诊断名称
  10612. var icdText = null;
  10613. var tagsTexts = $("span.el-select__tags-text");
  10614. if (tagsTexts != null && tagsTexts.length > 0) {
  10615. for (var i = 0; i < tagsTexts.length; i++) {
  10616. if (icdText == null) {
  10617. icdText = $(tagsTexts[i]).text();
  10618. } else {
  10619. icdText += "," + $(tagsTexts[i]).text();
  10620. }
  10621. }
  10622. }
  10623. jsonData.icdText = icdText;
  10624. //设置中医诊断名称
  10625. let tcmIcdText = null;
  10626. let tcmTagsTexts = $("span.el-select__tcmtags-text");
  10627. if (tcmTagsTexts != null && tcmTagsTexts.length > 0) {
  10628. for (var i = 0; i < tcmTagsTexts.length; i++) {
  10629. if (tcmIcdText == null) {
  10630. tcmIcdText = $(tcmTagsTexts[i]).text();
  10631. } else {
  10632. tcmIcdText += "," + $(tcmTagsTexts[i]).text();
  10633. }
  10634. }
  10635. }
  10636. jsonData.tcmIcdText = tcmIcdText;
  10637. jsonData.mzBlRecord.emrFzjc = emrFzjc;
  10638. return jsonData;
  10639. }
  10640. function getParamsHlyy() {
  10641. let loginUserCode = localStorage.getItem("userID")
  10642. let loginUserName = localStorage.getItem("userName")
  10643. let loginUserDept = localStorage.getItem("currentDeptNo")
  10644. // let currentPatient = patientList.find(item=> item.patientId == currentPatientId)
  10645. console.log("currentPatientId",currentPatientId)
  10646. console.log("currentPatientInfo",currentPatientInfo)
  10647. // //设置过敏源
  10648. let patientAllergenInfoList = []
  10649. let zdAllergen = $("#zdAllergen").find(":selected");
  10650. const zdAllergenValue = [];
  10651. const zdAllergenName = [];
  10652. zdAllergen.each(function() {
  10653. zdAllergenValue.push($(this).val()); // 选中的值
  10654. zdAllergenName.push($(this).text()); // 显示的文本
  10655. });
  10656. console.log("zdAllergenValue",zdAllergenValue)
  10657. console.log("zdAllergenName",zdAllergenName)
  10658. let ypDitList = $("#ypDitList").find(":selected");
  10659. const ypDitListValue = [];
  10660. const ypDitListName = [];
  10661. ypDitList.each(function() {
  10662. ypDitListValue.push($(this).val()); // 选中的值
  10663. ypDitListName.push($(this).text()); // 显示的文本
  10664. });
  10665. console.log("ypDitListValue",ypDitListValue)
  10666. console.log("ypDitListName",ypDitListName)
  10667. if (zdAllergen != null && zdAllergen.length > 0) {
  10668. for (let i = 0; i < zdAllergen.length; i++) {
  10669. let tempJson = JSON.parse('{}');
  10670. tempJson.code = zdAllergenValue[i];
  10671. tempJson.name = zdAllergenName[i];
  10672. patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
  10673. }
  10674. }
  10675. if (ypDitList != null && ypDitList.length > 0) {
  10676. for (let i = 0; i < ypDitList.length; i++) {
  10677. let tempJson = JSON.parse('{}');
  10678. tempJson.code = ypDitListValue[i];
  10679. tempJson.name = ypDitListName[i];
  10680. patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
  10681. }
  10682. }
  10683. var diagnoseChildren = $("#diagnoseTags").children();
  10684. var patientDiag = [];
  10685. for (var i = 0; i < diagnoseChildren.length; i++) {
  10686. var child = diagnoseChildren[i]; // 直接获取 DOM 元素
  10687. patientDiag.push({
  10688. code: child.id,
  10689. name: child.getAttribute("title") // 或 child.title
  10690. });
  10691. }
  10692. //设置处方详情
  10693. var orderList = [];
  10694. var emrFzjc = null;
  10695. var xyTabContents = $("#xyTabContent").find("div.tab-pane");
  10696. //西药设置
  10697. if (xyTabContents != null && xyTabContents.length > 0) {
  10698. for (var i = 0; i < xyTabContents.length; i++) {
  10699. //当前药品类型
  10700. var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
  10701. var formGroups = $(xyTabContents[i]).find("div.form-group");
  10702. if (formGroups != null && formGroups.length > 0) {
  10703. for (var j = 0; j < formGroups.length; j++) {
  10704. var tempJson = JSON.parse('{"id": "","code": "","route": "","name": "","dose": "","doseUnit": "","freq": "","amount": "","unit": "","repeat":"0",' +
  10705. '"startDateTime":"","dayCount":"","group":""}');
  10706. tempJson.id = $(formGroups[j]).find("input.temporary_items_code").val();
  10707. tempJson.code = $(formGroups[j]).find("input.temporary_items_code").val();
  10708. tempJson.route = $(formGroups[j]).find("input.temporary_items_supplyTypeText").val();
  10709. tempJson.name = $(formGroups[j]).find("input.temporary_items_westernMedicineNamme").val();
  10710. tempJson.dose = $(formGroups[j]).find("input.temporary_items_drugWin").val();
  10711. tempJson.doseUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnitText").val();
  10712. tempJson.freq = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
  10713. tempJson.amount = $(formGroups[j]).find("input.temporary_items_gross").val();
  10714. tempJson.unit = $(formGroups[j]).find("input.temporary_items_packUnit").val();
  10715. const timer = new Date();
  10716. tempJson.startDateTime = timer.toLocaleString();
  10717. tempJson.dayCount = $(formGroups[j]).find("input.temporary_items_dayNum").val();
  10718. tempJson.group = $(formGroups[j]).find("input.temporary_items_groupId").val();
  10719. orderList.push(tempJson)
  10720. }
  10721. }
  10722. }
  10723. }
  10724. //外配药设置
  10725. var wpMedicineTabContents = $("#wpMedicineTabContent").find("div.form-group");
  10726. if (wpMedicineTabContents != null && wpMedicineTabContents.length > 0) {
  10727. console.log("wpMedicineTabContent",wpMedicineTabContent)
  10728. for (var i = 0; i < xyTabContents.length; i++) {
  10729. //当前药品类型
  10730. var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
  10731. var formGroups = $(xyTabContents[i]).find("div.form-group");
  10732. if (formGroups != null && formGroups.length > 0) {
  10733. for (var j = 0; j < formGroups.length; j++) {
  10734. var tempJson = JSON.parse('{"id": "","code": "","route": "","name": "","dose": "","doseUnit": "","freq": "","amount": "","unit": "","repeat":"0",' +
  10735. '"startDateTime":"","dayCount":"","group":""}');
  10736. tempJson.id = $(formGroups[j]).find("input.temporary_items_code").val();
  10737. tempJson.code = $(formGroups[j]).find("input.temporary_items_code").val();
  10738. tempJson.route = $(formGroups[j]).find("input.temporary_items_medcWayCodg").val();
  10739. tempJson.name = $(formGroups[j]).find("input.temporary_items_wpMedicineName").val();
  10740. tempJson.dose = $(formGroups[j]).find("input.temporary_items_sinDoscnt").val();
  10741. tempJson.doseUnit = $(formGroups[j]).find("input.temporary_items_sinDosunt").val();
  10742. tempJson.freq = $(formGroups[j]).find("input.temporary_items_usedFrquCodg").val();
  10743. tempJson.amount = $(formGroups[j]).find("input.temporary_items_drugCnt").val();
  10744. tempJson.unit = $(formGroups[j]).find("input.temporary_items_drugDosunt").val();
  10745. const timer = new Date();
  10746. tempJson.startDateTime = timer.toLocaleString();
  10747. tempJson.dayCount = $(formGroups[j]).find("input.temporary_items_medcDays").val();
  10748. tempJson.group = $(formGroups[j]).find("input.temporary_items_groupId").val();
  10749. orderList.push(tempJson)
  10750. }
  10751. }
  10752. }
  10753. }
  10754. let params = {
  10755. station : {
  10756. type : "2"
  10757. },
  10758. doctor : {
  10759. code : loginUserCode ,
  10760. name : loginUserName ,
  10761. deptCode : loginUserDept
  10762. },
  10763. patient : {
  10764. id: currentPatientInfo.patientId ,
  10765. code: currentPatientInfo.patientId ,
  10766. visitId:"" ,
  10767. name : currentPatientInfo.name,
  10768. chargeType : currentPatientInfo.responseTypeName,
  10769. sex : currentPatientInfo.gender,
  10770. deptCode : loginUserDept,
  10771. birthday : currentPatientInfo.birthDayStr,
  10772. height :"",
  10773. weight :"",
  10774. medconds :{
  10775. diag : patientDiag,
  10776. allergens : patientAllergenInfoList
  10777. }
  10778. },
  10779. orders : orderList,
  10780. }
  10781. return params
  10782. console.log("params",params)
  10783. }
  10784. /**
  10785. * 影像云平台判断检查项目
  10786. */
  10787. function handleYx03Data() {
  10788. //辅助检查
  10789. var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
  10790. let hasYxData = false;
  10791. let yxItemArr = [];
  10792. if (jcjyTabContents != null && jcjyTabContents.length > 0) {
  10793. for (var i = 0; i < jcjyTabContents.length; i++) {
  10794. //项目类型
  10795. var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
  10796. //检查
  10797. if (itemsType == "2" || itemsType == 2) {
  10798. //影像云平台处理数据
  10799. hasYxData = true
  10800. let ckptName = $(jcjyTabContents[i]).find("input.temporary_items_desc_name").val()
  10801. let ckpt = ckptName && ckptName !== '' ? ckptName : $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val();
  10802. let tempYxObj=
  10803. {
  10804. // "chk_modality": "", //非必传 检查设备类型:ct、dr或mri
  10805. "proj_name": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
  10806. // "hos_medi_no": $(jcjyTabContents[i]).find("input.temporary_jy_national_code").val(), //非必传 检查项目医保编码
  10807. "hos_proj_no": $(jcjyTabContents[i]).find("input.temporary_items_code").val(), //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
  10808. "ckpt_name": ckpt, //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
  10809. // "chk_methodname": "", //非必传 检查方法名称
  10810. "chk_advice": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(), //检查申请名称
  10811. }
  10812. yxItemArr.push(tempYxObj)
  10813. }
  10814. }
  10815. }
  10816. if(hasYxData) {
  10817. let currentJcItemList = yxItemArr.map(i=> i.proj_name)
  10818. const newJcItem = jcItemList && jcItemList.length > 0 ? currentJcItemList.filter(item => !jcItemList.includes(item)) : currentJcItemList;
  10819. if (newJcItem && newJcItem.length > 0) {
  10820. YX03(yxItemArr)
  10821. } else {
  10822. savePrescription()
  10823. }
  10824. } else {
  10825. savePrescription()
  10826. }
  10827. }
  10828. function handleHlyyResult() {
  10829. if (hasJcInYx) { //患者近期检查项目数量>0
  10830. handleYx03Data()
  10831. } else { //直接开单
  10832. savePrescription()
  10833. }
  10834. // function getHlyyResult(res) {
  10835. // $("#messageButton").attr("disabled", false);
  10836. // if(res.beSave) {
  10837. // if (hasJcInYx) { //患者近期检查项目数量>0
  10838. // handleYx03Data()
  10839. // } else { //直接开单
  10840. // savePrescription()
  10841. // }
  10842. // } else {
  10843. // errorMesageSimaple("合理用药未通过!");
  10844. // }
  10845. // }
  10846. //
  10847. // var hlyyParams = getParamsHlyy()
  10848. // MLRKON_CLIENT.doCall("srv_screen", JSON.stringify(hlyyParams), { "api": false, "timeout": 10000}, getHlyyResult)
  10849. }
  10850. /**
  10851. * 保存处方
  10852. */
  10853. function savePrescription() {
  10854. var jsonData = getParamsForpPrescription(1);
  10855. let wpMedicineFlag = jsonData.rxDruginfoList ==null || jsonData.rxDruginfoList.length ==0 ? false : true;
  10856. savePrescriptionForReadCard(wpMedicineFlag);
  10857. // var jsonData = getParamsForpPrescription(1);
  10858. // console.log("savePrescription",jsonData)
  10859. // let wpMedicineFlag = jsonData.rxDruginfoList ==null || jsonData.rxDruginfoList.length ==0 ? false : true;
  10860. // $.ajax({
  10861. // type: "POST",
  10862. // url: '/thmz/rationalUseOfMedicine',
  10863. // contentType: "application/json;charset=UTF-8",
  10864. // dataType: "json",
  10865. // data: JSON.stringify(jsonData),
  10866. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  10867. // success: function (res) {
  10868. // if (res == '401' || res == 401) {
  10869. // window.location.href = '/thmz/login/view'
  10870. // return;
  10871. // }
  10872. // $("#messageButton").attr("disabled", false);
  10873. // if (res.code == 0) {
  10874. // var rationalUseMap = res.data;
  10875. // var result_lv = rationalUseMap.result_lv;
  10876. // if (result_lv == 0 || result_lv == "0") {
  10877. // savePrescriptionForReadCard(wpMedicineFlag);
  10878. // } else {
  10879. // var showUrl = rationalUseMap.ShowUrl;
  10880. // getResultUrl = rationalUseMap.getResultUrl;
  10881. // showHlyyModel('hlyyDiv', 'loading', 'hlyyModal', showUrl);
  10882. // }
  10883. // } else {
  10884. // savePrescriptionForReadCard(wpMedicineFlag);
  10885. // }
  10886. // }
  10887. // });
  10888. }
  10889. /**
  10890. * 合理用药结果查询
  10891. */
  10892. function getResult() {
  10893. $.ajax({
  10894. type: "POST",
  10895. url: '/thmz/auditingInterface',
  10896. contentType: "application/json;charset=UTF-8",
  10897. dataType: "json",
  10898. data: JSON.stringify({"getResultUrl": getResultUrl}),
  10899. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  10900. success: function (res) {
  10901. if (res == '401' || res == 401) {
  10902. window.location.href = '/thmz/login/view'
  10903. return;
  10904. }
  10905. $("#messageButton").attr("disabled", false);
  10906. $("#hlyyModal").modal("hide");
  10907. if (res.code == 0) {
  10908. var rationalUseMap = res.data;
  10909. if (rationalUseMap.length == 0) {
  10910. savePrescriptionForReadCard(false);
  10911. } else {
  10912. var resultcode = rationalUseMap.resultcode;
  10913. var success = rationalUseMap.success;
  10914. var sh_msg = rationalUseMap.sh_msg;
  10915. if (resultcode == -1) {
  10916. //为处方不存在分析结果 直接忽略
  10917. savePrescriptionForReadCard(false);
  10918. } else if (resultcode == 0) {
  10919. //2.success:药师审核完成标志,false未审核,true已审核/无需审核
  10920. if (success == true || success == "true") {
  10921. savePrescriptionForReadCard(false);
  10922. } else {
  10923. //提示消息
  10924. $("#messageModal").modal();
  10925. $("#messageContent").html("药师未审核,请点击右上方【继续保存】提交审核!");
  10926. $("#messageButton").off("click").bind("click", function (t) {
  10927. $("#messageModal").modal("hide");
  10928. $("#hlyyModal").modal();
  10929. });
  10930. $("#cancelButton").off("click").bind("click", function (t) {
  10931. $("#hlyyModal").modal();
  10932. });
  10933. ;
  10934. }
  10935. } else if (resultcode == 1) {
  10936. //提示消息
  10937. $("#messageModal").modal();
  10938. $("#messageContent").html(sh_msg);
  10939. $("#messageButton").off("click").bind("click", function (t) {
  10940. $("#messageModal").modal("hide");
  10941. });
  10942. $("#cancelButton").off("click");
  10943. }
  10944. }
  10945. } else {
  10946. savePrescriptionForReadCard(false);
  10947. }
  10948. }
  10949. });
  10950. }
  10951. /**
  10952. * 合理用药结果弹窗
  10953. * @param hlyyDiv
  10954. * @param loading
  10955. * @param hlyyModal
  10956. * @param showUrl
  10957. */
  10958. function showHlyyModel(hlyyDiv, loading, hlyyModal, showUrl) {
  10959. const iframeEle = document.getElementById(hlyyDiv);
  10960. const loadingEle = document.getElementById(loading);
  10961. //设置ififrame透明
  10962. iframeEle.style.opacity = 0;
  10963. loadingEle.style.display = 'block';
  10964. $("#" + hlyyDiv).attr("src", showUrl);
  10965. iframeEle.addEventListener('load', function () {
  10966. // Hide the loading indicator
  10967. loadingEle.style.display = 'none';
  10968. // Bring the iframe back
  10969. iframeEle.style.opacity = 1;
  10970. });
  10971. setTimeout(function () {
  10972. // iframe 重复加载不会触发上述事件
  10973. loadingEle.style.display = 'none';
  10974. iframeEle.style.opacity = 1;
  10975. }, 1000);
  10976. $("#" + hlyyModal).modal();
  10977. }
  10978. /**
  10979. * 点击保存处方时提示是否读卡 wpMedicineFlag true 是外配处方 false 否
  10980. */
  10981. function savePrescriptionForReadCard(wpMedicineFlag) {
  10982. console.log("savePrescriptionForReadCard")
  10983. if (!verifyInsuranceInfo()) {
  10984. return;
  10985. }
  10986. //关闭帮助框
  10987. $("#treeButton").webuiPopover('hide');
  10988. $("#western_medicine_name").webuiPopover('hide');
  10989. $("#chinese_medicine_name").webuiPopover('hide');
  10990. $("#jcJyItem").webuiPopover('hide');
  10991. $("#zlItem").webuiPopover('hide');
  10992. getAjaxRequst("/thmz/zaiYuanByPatientId",{ patientId:$("#patientId").text()},true,function (response) {
  10993. if(response.code == 0){
  10994. if(response.data == "0"){
  10995. if(wpMedicineFlag){
  10996. let readCardResult = $("#readCardResult").val();
  10997. if(stringIsBlank(readCardResult)){
  10998. $("#messageModalYb").modal();
  10999. $("#messageContent").html("门诊统筹处方必须读卡,是否立即读卡?");
  11000. $("#ybdzpz").off("click").bind("click", function (t) {
  11001. // mztczfSiReadCard(true, "qrcode_01101");
  11002. mztczfSiReadCard(true, "jiangsu_qrcode_01101");
  11003. realSavePrescription(wpMedicineFlag,false);
  11004. });
  11005. $("#ybsl").off("click").bind("click", function (t) {
  11006. // mztczfSiReadCard(true, "face_01101");
  11007. mztczfSiReadCard(true, "jiangsu_face_01101");
  11008. realSavePrescription(wpMedicineFlag,false);
  11009. });
  11010. $("#cancelButtonYb").off("click").bind("click", function (t) {
  11011. t.stopPropagation();
  11012. t.preventDefault();
  11013. realSavePrescription(wpMedicineFlag,false);
  11014. });
  11015. }else {
  11016. realSavePrescription(wpMedicineFlag,false);
  11017. }
  11018. }else{
  11019. realSavePrescription(wpMedicineFlag,false);
  11020. }
  11021. }else {
  11022. realSavePrescription(wpMedicineFlag,false);
  11023. }
  11024. }else {
  11025. errorMesage(response)
  11026. }
  11027. })
  11028. }
  11029. /**
  11030. * 最终保存处方方法
  11031. */
  11032. function realSavePrescription(wpMedicineFlag,mallFlag) {
  11033. $("#messageModalYb").modal('hide');
  11034. $("#messageModal").modal();
  11035. $("#messageContent").html("确认保存处方吗?");
  11036. $("#messageButton").off("click").bind("click", function (t) {
  11037. if (mztczfSiReadCardStatus && wpMedicineFlag) {
  11038. $("#messageContent").html("门诊统筹正在读卡中,此次操作需与医保中心交互,耗时较长,请耐心等待...");
  11039. return;
  11040. }
  11041. $("#messageButton").attr("disabled", true);
  11042. var jsonData = getParamsForpPrescription(1);
  11043. //商城处方
  11044. if(mallFlag){
  11045. jsonData.orderType = 5;
  11046. jsonData.wxmallPackagePurchasedItemList = $('#mall_tc_detail_table').bootstrapTable('getAllSelections');
  11047. }
  11048. $.ajax({
  11049. type: "POST",
  11050. url: '/thmz/savePrescription',
  11051. contentType: "application/json;charset=UTF-8",
  11052. dataType: "json",
  11053. data: JSON.stringify(jsonData),
  11054. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11055. success: function (res) {
  11056. if (res == '401' || res == 401) {
  11057. window.location.href = '/thmz/login/view'
  11058. return;
  11059. }
  11060. $("#messageButton").attr("disabled", false);
  11061. if (res.code == 0) {
  11062. successMesage(res);
  11063. if (jsonData.hasJcItem) {
  11064. YX04()
  11065. }
  11066. if(mallFlag){
  11067. $("#mallTcDetailModal").modal("hide");
  11068. }
  11069. clearWorkSpace();
  11070. loadInClinicTableList();
  11071. loadClinicTableList();
  11072. //$("#messageModal").modal();
  11073. if(wpyHide === 0){
  11074. $("#messageContent").html("门诊处方保存成功,是否打印门诊指引单?");
  11075. $("#messageButton").off("click").on("click", function (t) {
  11076. $("#messageModal").modal("hide");
  11077. if(mallFlag){
  11078. // printPrescription(res.data.patientId, res.data.times, res.data.id, 0, 1);
  11079. printGuideCard(res.data.patientId, res.data.times, res.data.id, 0, 1);
  11080. }else {
  11081. // printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
  11082. printGuideCard(res.data.patientId, res.data.times, res.data.id, 5, 1);
  11083. }
  11084. });
  11085. $("#cancelButton").off("click");
  11086. }else {
  11087. successMesageSimaple('门诊处方保存成功')
  11088. $("#messageModal").modal("hide");
  11089. }
  11090. } else {
  11091. $("#messageModal").modal("hide");
  11092. errorMesage(res);
  11093. }
  11094. }
  11095. });
  11096. });
  11097. $("#cancelButton").off("click");
  11098. }
  11099. /**
  11100. * 保存医疗范文
  11101. */
  11102. function saveapidAccepts() {
  11103. var templateName = $("#templateName").val();
  11104. if (templateName == null || templateName == "") {
  11105. errorMesageSimaple("范文名称不能为空!");
  11106. return;
  11107. }
  11108. var templateKindType = $("#templateKindType").val();
  11109. if (templateKindType == null || templateKindType == "") {
  11110. errorMesageSimaple("范文类型不能为空!");
  11111. return;
  11112. }
  11113. var templateType = $("#templateType").val();
  11114. if (templateType == null || templateType == "") {
  11115. errorMesageSimaple("范文范围不能为空!");
  11116. return;
  11117. }
  11118. var templateStatus = $("#templateStatus").val();
  11119. if (templateStatus == null || templateStatus == "") {
  11120. errorMesageSimaple("范文状态不能为空!");
  11121. return;
  11122. }
  11123. $("#saveapidAcceptsModal").modal("hide");
  11124. $("#messageModal").modal();
  11125. $("#messageContent").html("确认保存医疗范文吗?");
  11126. $("#messageButton").off("click").on("click", function (t) {
  11127. $("#messageModal").modal("hide");
  11128. var jsonData = getParamsForpPrescription(2);
  11129. var operationType = $("#operationType").val();
  11130. var templateId = $("#templateId").val();
  11131. if (operationType == 0 || operationType == '0') {
  11132. templateId = null;
  11133. }
  11134. $.ajax({
  11135. type: "POST",
  11136. url: '/thmz/saveTemplate',
  11137. contentType: "application/json;charset=UTF-8",
  11138. dataType: "json",
  11139. data: JSON.stringify({
  11140. "id": templateId,
  11141. "name": templateName,
  11142. "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
  11143. "templateKindType": templateKindType,
  11144. "templateType": templateType,
  11145. "templateStatus": templateStatus,
  11146. "templateData": JSON.stringify(jsonData),
  11147. "emrChiefComplaint": $("#symptom").val(),
  11148. "emrHpi": $("#emrHpi").val(),
  11149. "emrPs": $("#emrPs").val(),
  11150. "icdCode": $("#diagnoseValue").val()
  11151. }),
  11152. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11153. success: function (res) {
  11154. if (res == '401' || res == 401) {
  11155. window.location.href = '/thmz/login/view'
  11156. return;
  11157. }
  11158. if (res.code == 0) {
  11159. successMesage(res);
  11160. //范本保存完不清空
  11161. //clearWorkSpace();
  11162. } else {
  11163. $("#saveapidAcceptsModal").modal();
  11164. errorMesage(res);
  11165. }
  11166. }
  11167. });
  11168. });
  11169. $("#cancelButton").off("click");
  11170. }
  11171. /**
  11172. * 停用医疗范文
  11173. */
  11174. function removeTemplate() {
  11175. $("#messageModal").modal();
  11176. $("#messageContent").html("确认停用医疗范文吗?");
  11177. $("#messageButton").off("click").on("click", function (t) {
  11178. $("#messageModal").modal("hide");
  11179. $.ajax({
  11180. type: "POST",
  11181. url: '/thmz/removeTemplate',
  11182. contentType: "application/json;charset=UTF-8",
  11183. dataType: "json",
  11184. data: JSON.stringify({
  11185. "id": $("#idTemplate").val()
  11186. }),
  11187. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11188. success: function (res) {
  11189. if (res == '401' || res == 401) {
  11190. window.location.href = '/thmz/login/view'
  11191. return;
  11192. }
  11193. if (res.code == 0) {
  11194. successMesage(res);
  11195. $("#medicalModelModal").modal("hide");
  11196. fitTemplateData();
  11197. } else {
  11198. errorMesage(res);
  11199. }
  11200. }
  11201. });
  11202. });
  11203. $("#cancelButton").off("click");
  11204. }
  11205. /**
  11206. * 清空医疗范文模块内容
  11207. */
  11208. function clearApidAcceptsModal() {
  11209. $("#templateId").val(null);
  11210. $("#templateName").val(null);
  11211. $("#templateKindType").selectpicker('val', 0);
  11212. $("#templateKindType").selectpicker('refresh');
  11213. $("#templateType").selectpicker('val', 0);
  11214. $("#templateType").selectpicker('refresh');
  11215. $("#templateStatus").selectpicker('val', 0);
  11216. $("#templateStatus").selectpicker('refresh');
  11217. $('#operationType').selectpicker('val', 0);
  11218. $('#operationType').selectpicker('refresh');
  11219. $("#operationTypeDiv").removeClass("in").addClass("hide");
  11220. }
  11221. /**
  11222. * 查询病人未缴费处方信息 加载到处方修改
  11223. * @param patientId
  11224. * @param times
  11225. * @param clnicId 就诊记录id
  11226. */
  11227. function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
  11228. currentPatientId = patientId;
  11229. console.log("currentPatientId1",currentPatientId)
  11230. if (!confirm("请确认要修改处方吗?如只修改病历,请取消,点击【详情】再【修改病历】")) {
  11231. return;
  11232. }
  11233. var currentPatientId = $("#patientId").text();
  11234. //当前接诊的用户和操作接诊的是同一个人,不做任何操作
  11235. if (currentPatientId == patientId) {
  11236. warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
  11237. return;
  11238. }
  11239. //效验是否有修改处方权限
  11240. postAjaxJsonHttpRequst("/thmz/queryPrescriptionModifyPermission",{"patientId":patientId,"times":times},false,function (re) {
  11241. if (re == '401' || re == 401) {
  11242. window.location.href = '/thmz/login/view'
  11243. return;
  11244. }
  11245. if(re.code != 0){
  11246. errorMesageSimaple(re.message);
  11247. return;
  11248. }
  11249. if (currentPatientId == null || currentPatientId == "") {
  11250. //当前没有人接诊,直接接诊
  11251. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  11252. } else {
  11253. //当前有人在接诊,提示是否需要切换和保存
  11254. $("#messagePrescriptionModal").modal();
  11255. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  11256. $("#messagePrescriptionModal").modal("hide");
  11257. //先保存目前接诊信息,再切换就诊人
  11258. var jsonData = getParamsForpPrescription(1);
  11259. $.ajax({
  11260. type: "POST",
  11261. url: '/thmz/savePrescription',
  11262. contentType: "application/json;charset=UTF-8",
  11263. dataType: "json",
  11264. data: JSON.stringify(jsonData),
  11265. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11266. success: function (res) {
  11267. if (res == '401' || res == 401) {
  11268. window.location.href = '/thmz/login/view'
  11269. return;
  11270. }
  11271. if (res.code == 0) {
  11272. loadInClinicTableList();
  11273. loadClinicTableList();
  11274. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  11275. } else {
  11276. errorMesage(res);
  11277. }
  11278. }
  11279. });
  11280. });
  11281. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  11282. $("#messagePrescriptionModal").modal("hide");
  11283. getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
  11284. });
  11285. }
  11286. })
  11287. }
  11288. /**
  11289. * 查询病人未缴费处方信息 加载到处方修改 通用方法
  11290. * @param patientId
  11291. * @param times
  11292. * @param clnicId 就诊记录id
  11293. */
  11294. function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
  11295. $.ajax({
  11296. type: "GET",
  11297. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=false&payMark=5&clnicId=null",
  11298. contentType: "application/json;charset=UTF-8",
  11299. dataType: "json",
  11300. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11301. success: function (res) {
  11302. if (res == '401' || res == 401) {
  11303. window.location.href = '/thmz/login/view'
  11304. return;
  11305. }
  11306. if (res.code == 0) {
  11307. clearWorkSpace();
  11308. setMzReqType(patientId,times,null)
  11309. setMzPatientInfo(res.mzPatientMi);
  11310. setTimeout(()=>{
  11311. editPrescription(res.data, 0)
  11312. },1000)
  11313. //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
  11314. $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
  11315. //查询患者的门诊统筹信息
  11316. // queryInsuinfo(patientId);
  11317. } else {
  11318. errorMesage(res);
  11319. }
  11320. }
  11321. });
  11322. }
  11323. /**
  11324. * 查询病人已缴费处方信息 调用处方
  11325. * @param patientId
  11326. * @param times
  11327. * @param clnicId 就诊记录id
  11328. */
  11329. function getMzPrescriptionVoPaid(patientId, times, clnicId) {
  11330. $("#visitingDetailModal").modal("hide");
  11331. $("#messageModal").modal();
  11332. $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
  11333. $("#messageButton").off("click").on("click", function (t) {
  11334. $("#messageModal").modal("hide");
  11335. $.ajax({
  11336. type: "GET",
  11337. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
  11338. contentType: "application/json;charset=UTF-8",
  11339. dataType: "json",
  11340. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11341. success: function (res) {
  11342. if (res == '401' || res == 401) {
  11343. window.location.href = '/thmz/login/view'
  11344. return;
  11345. }
  11346. if (res.code == 0) {
  11347. var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
  11348. var mzfzReqTypeNoInClick = $("#mzfzReqTypeNoInClick").val();
  11349. clearUser(false);
  11350. clearWorkSpaceExcludeUser(3);
  11351. setMzPatientInfo(res.mzPatientMi);
  11352. editPrescription(res.data, 2)
  11353. $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
  11354. $("#mzfzReqTypeNoInClick").val(mzfzReqTypeNoInClick);
  11355. } else {
  11356. errorMesage(res);
  11357. }
  11358. }
  11359. });
  11360. });
  11361. $("#cancelButton").off("click");
  11362. }
  11363. /**
  11364. * 重复接诊
  11365. * @param patientId
  11366. * @param times
  11367. * @param clnicId
  11368. * @param deptCode 就诊科室编码
  11369. */
  11370. function repeatAccepts(patientId, times, clnicId, deptCode) {
  11371. $.ajax({
  11372. type: "GET",
  11373. url: '/thmz/validMzyReqrec?patientId=' + patientId + "&deptCode=" + deptCode,
  11374. contentType: "application/json;charset=UTF-8",
  11375. dataType: "json",
  11376. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11377. success: function (res) {
  11378. if (res == '401' || res == 401) {
  11379. window.location.href = '/thmz/login/view'
  11380. return;
  11381. }
  11382. if (res.code == 0) {
  11383. if (res.data == 0) {
  11384. // $("#messageModal").modal();
  11385. // $("#messageContent").html("挂号失效,确定继续就诊?");
  11386. // $("#messageButton").off("click").on("click", function (t) {
  11387. // $("#messageModal").modal("hide");
  11388. // repeatAcceptsConfirm(patientId, times, clnicId);
  11389. // });
  11390. // $("#cancelButton").off("click");
  11391. // warningMesageSimaple(res.message);
  11392. // return;
  11393. }
  11394. repeatAcceptsConfirm(patientId, times, clnicId);
  11395. } else {
  11396. errorMesage(res);
  11397. }
  11398. }
  11399. });
  11400. }
  11401. /**
  11402. * 重复接诊提示方法
  11403. * @param patientId
  11404. * @param times
  11405. * @param clnicId
  11406. */
  11407. function repeatAcceptsConfirm(patientId, times, clnicId) {
  11408. var currentPatientId = $("#patientId").text();
  11409. //当前接诊的用户和操作接诊的是同一个人,不做任何操作
  11410. if (currentPatientId == patientId) {
  11411. return;
  11412. }
  11413. if (currentPatientId == null || currentPatientId == "") {
  11414. //当前没有人接诊,直接接诊
  11415. repeatAcceptsCommon(patientId, times, clnicId);
  11416. } else {
  11417. //当前有人在接诊,提示是否需要切换和保存
  11418. $("#messagePrescriptionModal").modal();
  11419. $("#confirmPrescriptionButton").off("click").on("click", function (t) {
  11420. $("#messagePrescriptionModal").modal("hide");
  11421. //先保存目前接诊信息,再切换就诊人
  11422. var jsonData = getParamsForpPrescription(1);
  11423. $.ajax({
  11424. type: "POST",
  11425. url: '/thmz/savePrescription',
  11426. contentType: "application/json;charset=UTF-8",
  11427. dataType: "json",
  11428. data: JSON.stringify(jsonData),
  11429. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11430. success: function (res) {
  11431. if (res == '401' || res == 401) {
  11432. window.location.href = '/thmz/login/view'
  11433. return;
  11434. }
  11435. if (res.code == 0) {
  11436. repeatAcceptsCommon(patientId, times, clnicId);
  11437. //加载已接诊患者列表
  11438. loadClinicTableList();
  11439. } else {
  11440. errorMesage(res);
  11441. }
  11442. }
  11443. });
  11444. });
  11445. $("#cancelPrescriptionButton").off("click").on("click", function (t) {
  11446. $("#messagePrescriptionModal").modal("hide");
  11447. repeatAcceptsCommon(patientId, times, clnicId);
  11448. });
  11449. }
  11450. }
  11451. /**
  11452. * 重复接诊通用方法
  11453. * @param patientId
  11454. * @param times
  11455. * @param clnicId
  11456. */
  11457. function repeatAcceptsCommon(patientId, times, clnicId) {
  11458. $.ajax({
  11459. type: "GET",
  11460. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=true&payMark=null&clnicId=null",
  11461. contentType: "application/json;charset=UTF-8",
  11462. dataType: "json",
  11463. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11464. success: function (res) {
  11465. if (res == '401' || res == 401) {
  11466. window.location.href = '/thmz/login/view'
  11467. return;
  11468. }
  11469. if (res.code == 0) {
  11470. clearWorkSpace();
  11471. setMzReqType(patientId,times,null);
  11472. setMzPatientInfo(res.mzPatientMi);
  11473. editPrescription(res.data, 0)
  11474. //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
  11475. $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
  11476. //查询患者的门诊统筹信息
  11477. // queryInsuinfo(patientId);
  11478. } else {
  11479. errorMesage(res);
  11480. }
  11481. }
  11482. });
  11483. }
  11484. /**
  11485. * 就诊详情 已诊患者列表发起
  11486. * @param patientId
  11487. * @param times
  11488. * @param clnicId
  11489. * @param payMark
  11490. */
  11491. function prescriptionDetail(patientId, times, clnicId, payMark) {
  11492. prescriptionDetailCommon(patientId, times, clnicId, payMark, 0);
  11493. }
  11494. /**
  11495. * 就诊详情 历史轨迹发起
  11496. * @param patientId
  11497. * @param times
  11498. * @param clnicId
  11499. * @param clinicStatus
  11500. */
  11501. function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
  11502. closeObjectWebui(false);
  11503. var payMark = null;
  11504. if (clinicStatus == 5) {
  11505. payMark = 5;
  11506. } else {
  11507. payMark = 0;
  11508. }
  11509. prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
  11510. }
  11511. function setmzPrescriptionPrintFlag(patientId, times) {
  11512. postAjaxJsonHttpRequst("/thmz/mzPrescriptionPrint/getPrintFlag",{patientId:patientId,times:times},true,function (res) {
  11513. if(res.data !=null){
  11514. if(res.data == '1'){
  11515. $("#printImage").attr("src", "/thmz/images/yiprint.png");
  11516. }else {
  11517. $("#printImage").attr("src", "/thmz/images/no_print.png");
  11518. }
  11519. }else {
  11520. $("#printImage").attr("src", "/thmz/images/yiprint.png");
  11521. }
  11522. })
  11523. }
  11524. /**
  11525. * 就诊详情通用方法
  11526. * @param patientId
  11527. * @param times
  11528. * @param clnicId
  11529. * @param payMark
  11530. * @param type 0 已诊患者列表发起 1 历史轨迹发起
  11531. */
  11532. function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
  11533. $('#baseMzBlTimes').val(null);
  11534. var oriPayMark = payMark;
  11535. if (payMark == 1) {
  11536. //退费时,查看的明细还是处方开立的情况
  11537. payMark = 0;
  11538. }
  11539. //是否默认勾选处方回调
  11540. var checkboxFlag = localStorage.getItem("checkboxFlag");
  11541. if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
  11542. $("#conciseRecordsJzxq").prop("checked", true);
  11543. $("#prescriptionSubsidiaryJzxq").prop("checked", true);
  11544. } else {
  11545. $("#conciseRecordsJzxq").prop("checked", false);
  11546. $("#prescriptionSubsidiaryJzxq").prop("checked", false);
  11547. }
  11548. $.ajax({
  11549. type: "GET",
  11550. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
  11551. contentType: "application/json;charset=UTF-8",
  11552. dataType: "json",
  11553. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11554. success: function (res) {
  11555. if (res == '401' || res == 401) {
  11556. window.location.href = '/thmz/login/view'
  11557. return;
  11558. }
  11559. if (res.code == 0) {
  11560. $("#visitingDetailModal").modal();
  11561. var jsonData = res.data;
  11562. var mzPatientMi = res.mzPatientMi;
  11563. $("#visitingDetailPatientName").html('<a onclick="editUserModal(\'' + mzPatientMi.patientId + '\',3)" style=\'cursor: pointer;\'>' + mzPatientMi.name + '</a>');
  11564. $("#visitingDetailPatientAge").text(mzPatientMi.ageString);
  11565. $("#visitingDetailPatientGender").val(mzPatientMi.gender);
  11566. $("#prescriptionDetail_zd").html("");
  11567. $("#prescriptionDetail_xyzlContent").html("");
  11568. $("#prescriptionDetail_zyzlContent").html("");
  11569. $("#prescriptionDetail_zlyjContent").html("");
  11570. if (res.opDate != null) {
  11571. $("#visitingDetailDate").text(res.opDate);
  11572. }
  11573. if (res.deptName != null) {
  11574. $("#visitingDetailDept").text(res.deptName);
  11575. }
  11576. if (res.doctorName != null) {
  11577. $("#visitingDetailDoctor").text(res.doctorName);
  11578. }
  11579. var firstOrNot = jsonData.mzBlRecord.firstOrNot;
  11580. if (firstOrNot == 0) {
  11581. $("#visitFlag").html("初诊");
  11582. $("#first").next().click();
  11583. } else if (firstOrNot == 1) {
  11584. $("#visitFlag").html("复诊");
  11585. $("#not").next().click();
  11586. }
  11587. if (oriPayMark == 0) {
  11588. $("#chargeImage").attr("src", "/thmz/images/charge.png");
  11589. } else if (oriPayMark == 1) {
  11590. $("#chargeImage").attr("src", "/thmz/images/refund.png");
  11591. } else if (oriPayMark == 5) {
  11592. $("#chargeImage").attr("src", "/thmz/images/nocharge.png");
  11593. }
  11594. setmzPrescriptionPrintFlag(patientId, times);
  11595. $("#prescriptionDetail_zs").html(jsonData.mzBlRecord.emrChiefComplaint);
  11596. $("#prescriptionDetail_xbs").html(jsonData.mzBlRecord.emrHpi);
  11597. $("#prescriptionDetail_tgjc").html(jsonData.mzBlRecord.emrPe);
  11598. $("#prescriptionDetail_jkjy").html(jsonData.mzBlRecord.emrJkjy);
  11599. var icdText = jsonData.icdText;
  11600. if (icdText != null) {
  11601. var arr = icdText.split(",");
  11602. var html = "";
  11603. for (var i = 0; i < arr.length; i++) {
  11604. if (i == 0) {
  11605. html += ' <div class="tagZdy tagZdy-back">';
  11606. } else {
  11607. html += ' <div class="tagZdy tagZdy-back-green">';
  11608. }
  11609. html += arr[i];
  11610. html += '</div>';
  11611. }
  11612. $("#prescriptionDetail_zd").html(html);
  11613. } else {
  11614. $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
  11615. }
  11616. let tcmIcdText = jsonData.tcmIcdText
  11617. if(tcmIcdText != null){
  11618. let arr = tcmIcdText.split(",");
  11619. let html = "";
  11620. for (let i = 0; i < arr.length; i++) {
  11621. if (i == 0) {
  11622. html += ' <div class="tagZdy tagZdy-back">';
  11623. } else {
  11624. html += ' <div class="tagZdy tagZdy-back-green">';
  11625. }
  11626. html += arr[i];
  11627. html += '</div>';
  11628. }
  11629. $("#prescriptionDetail_tcmzd").html(html);
  11630. }
  11631. var prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
  11632. if (prescriptionDetail != null) {
  11633. var checkBox = type == 1;
  11634. prescriptionDetail = JSON.parse(prescriptionDetail);
  11635. var xyPrescription = prescriptionDetail.xyPrescription;
  11636. if (xyPrescription != null) {
  11637. fitxyContent(xyPrescription.pyPrescription, "prescriptionDetail_xypyContent", "prescriptionDetail_xypyTitle", checkBox);
  11638. fitxyContent(xyPrescription.mjPrescription, "prescriptionDetail_xymjContent", "prescriptionDetail_xymjTitle", checkBox);
  11639. fitxyContent(xyPrescription.jePrescription, "prescriptionDetail_xyjeContent", "prescriptionDetail_xyjeTitle", checkBox);
  11640. fitxyContent(xyPrescription.ycPrescription, "prescriptionDetail_yczlContent", "prescriptionDetail_yczlTitle", checkBox);
  11641. } else {
  11642. $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
  11643. $("#prescriptionDetail_xypyContent").html("");
  11644. $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
  11645. $("#prescriptionDetail_xymjContent").html("");
  11646. $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
  11647. $("#prescriptionDetail_xyjeContent").html("");
  11648. $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
  11649. $("#prescriptionDetail_yczlContent").html("");
  11650. }
  11651. var zyPrescription = prescriptionDetail.zyPrescription;
  11652. if (zyPrescription != null) {
  11653. fitzyContent(zyPrescription, "prescriptionDetail_zyzlContent", "prescriptionDetail_zyzlTitle", checkBox);
  11654. } else {
  11655. $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
  11656. $("#prescriptionDetail_zyzlContent").html("");
  11657. }
  11658. var jcjyPrescription = prescriptionDetail.jcjyPrescription;
  11659. if (jcjyPrescription != null) {
  11660. fitJcjyContent(jcjyPrescription, "prescriptionDetail_jcjyContent", "prescriptionDetail_jcjyTitle", checkBox);
  11661. } else {
  11662. ("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
  11663. $("#prescriptionDetail_jcjyContent").html("");
  11664. }
  11665. var zlPrescription = prescriptionDetail.zlPrescription;
  11666. if (zlPrescription != null) {
  11667. fitJcjyContent(zlPrescription, "prescriptionDetail_zlContent", "prescriptionDetail_zlTitle", checkBox);
  11668. } else {
  11669. $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
  11670. $("#prescriptionDetail_zlContent").html("");
  11671. }
  11672. var zyReqPrescription = prescriptionDetail.zyReqPrescription;
  11673. if (zyReqPrescription != null) {
  11674. fitZyReqContent(zyReqPrescription, "prescriptionDetail_zyReqContent", "prescriptionDetail_zyReqTitle", true);
  11675. } else {
  11676. $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
  11677. $("#prescriptionDetail_zyReqContent").html("");
  11678. }
  11679. var opRecordPrescription = prescriptionDetail.opRecordPrescription;
  11680. if (opRecordPrescription != null) {
  11681. fitOpRecordContent(opRecordPrescription, "prescriptionDetail_opRecordContent", "prescriptionDetail_opRecordTitle", true);
  11682. } else {
  11683. $("#prescriptionDetail_opRecordTitle").removeClass("in").addClass("hide");
  11684. $("#prescriptionDetail_opRecordContent").html("");
  11685. }
  11686. let wpMedicinePrescription = prescriptionDetail.wpMedicinePrescription;
  11687. if (wpMedicinePrescription != null) {
  11688. fitWpMedicineContent(wpMedicinePrescription, "prescriptionDetail_wpMedicineContent", "prescriptionDetail_wpMedicineTitle", true);
  11689. } else {
  11690. $("#prescriptionDetail_wpMedicineTitle").removeClass("in").addClass("hide");
  11691. $("#prescriptionDetail_wpMedicineContent").html("");
  11692. }
  11693. } else {
  11694. $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
  11695. $("#prescriptionDetail_xypyContent").html("");
  11696. $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
  11697. $("#prescriptionDetail_xymjContent").html("");
  11698. $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
  11699. $("#prescriptionDetail_xyjeContent").html("");
  11700. $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
  11701. $("#prescriptionDetail_yczlContent").html("");
  11702. $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
  11703. $("#prescriptionDetail_zyzlContent").html("");
  11704. $("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
  11705. $("#prescriptionDetail_jcjyContent").html("");
  11706. $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
  11707. $("#prescriptionDetail_zlContent").html("");
  11708. $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
  11709. $("#prescriptionDetail_zyReqContent").html("");
  11710. $("#prescriptionDetail_wpMedicineTitle").removeClass("in").addClass("hide");
  11711. $("#prescriptionDetail_wpMedicineContent").html("");
  11712. }
  11713. $("#printJcReq").removeClass("in").addClass("hide");
  11714. $("#printJcReq").off("click");
  11715. $("#printJyReq").removeClass("in").addClass("hide");
  11716. $("#printJyReq").off("click");
  11717. $("#printJcReqSetup").removeClass("in").addClass("hide");
  11718. $("#printJcReqSetup").off("click");
  11719. $("#printJyReqSetup").removeClass("in").addClass("hide");
  11720. $("#printJyReqSetup").off("click");
  11721. $("#previewYjReq").removeClass("in").addClass("hide");
  11722. $("#previewYjReq").off("click");
  11723. $("#previewYjReqAll").removeClass("in").addClass("hide");
  11724. $("#previewYjReqAll").off("click");
  11725. $("#deletePrescription").removeClass("in").addClass("hide");
  11726. $("#deletePrescription").off("click");
  11727. $("#consultationCliniced").removeClass("in").addClass("hide");
  11728. $("#consultationCliniced").off("click");
  11729. if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
  11730. $("#previewYjReq").removeClass("hide").addClass("in");
  11731. $("#previewYjReq").off("click").on("click", function (t) {
  11732. previewYjReq(patientId, times);
  11733. });
  11734. }
  11735. if (res.yjReqCount != null && res.yjReqCount > 0) {
  11736. $("#previewYjReqAll").removeClass("hide").addClass("in");
  11737. $("#previewYjReqAll").off("click").on("click", function (t) {
  11738. previewYjReqAll(patientId);
  11739. });
  11740. }
  11741. if (type == 0) {
  11742. $("#callPrescription").removeClass("in").addClass("hide");
  11743. if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
  11744. // $("#printPrescription").removeClass("in").addClass("hide");
  11745. // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  11746. $("#printGuideCard").removeClass("in").addClass("hide");
  11747. $("#printGuideCardSetup").removeClass("in").addClass("hide");
  11748. } else {
  11749. // $("#printPrescription").removeClass("hide").addClass("in");
  11750. // $("#printPrescription").off("click").on("click", function (t) {
  11751. // printPrescription(patientId, times, clnicId, payMark, 1);
  11752. // });
  11753. $("#printGuideCard").removeClass("hide").addClass("in");
  11754. $("#printGuideCard").off("click").on("click", function (t) {
  11755. printGuideCard(patientId, times, clnicId, payMark, 1);
  11756. });
  11757. // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
  11758. // $("#printPrescriptionSetup").off("click").on("click", function (t) {
  11759. // printPrescription(patientId, times, clnicId, payMark, 2);
  11760. // });
  11761. $("#printGuideCardSetup").removeClass("hide").addClass("in");
  11762. $("#printGuideCardSetup").off("click").on("click", function (t) {
  11763. printGuideCard(patientId, times, clnicId, payMark, 2);
  11764. });
  11765. }
  11766. if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
  11767. var hadJc = false;
  11768. var hadJy = false;
  11769. for (var i = 0; i < jsonData.mzYjReqList.length; i++) {
  11770. var mzYjReq = jsonData.mzYjReqList[i];
  11771. if (mzYjReq.reqType == 2) {
  11772. hadJy = true;
  11773. } else if (mzYjReq.reqType == 3) {
  11774. hadJc = true;
  11775. }
  11776. }
  11777. if (hadJc) {
  11778. $("#printJcReq").removeClass("hide").addClass("in");
  11779. $("#printJcReq").off("click").on("click", function (t) {
  11780. printYjReq(patientId, times, 3, 1);
  11781. });
  11782. $("#printJcReqSetup").removeClass("hide").addClass("in");
  11783. $("#printJcReqSetup").off("click").on("click", function (t) {
  11784. printYjReq(patientId, times, 3, 2);
  11785. });
  11786. }
  11787. if (hadJy) {
  11788. $("#printJyReq").removeClass("hide").addClass("in");
  11789. $("#printJyReq").off("click").on("click", function (t) {
  11790. printYjReq(patientId, times, 2, 1);
  11791. });
  11792. $("#printJyReqSetup").removeClass("hide").addClass("in");
  11793. $("#printJyReqSetup").off("click").on("click", function (t) {
  11794. printYjReq(patientId, times, 2, 2);
  11795. });
  11796. }
  11797. }
  11798. if (jsonData.mzZyReq == null || jsonData.mzZyReq.reqDept == null || jsonData.mzZyReq.reqDept == "") {
  11799. $("#printZyReq").removeClass("in").addClass("hide");
  11800. $("#printZyReq").off("click");
  11801. $("#printZyReqSetup").removeClass("in").addClass("hide");
  11802. $("#printZyReqSetup").off("click");
  11803. } else {
  11804. $("#printZyReq").removeClass("hide").addClass("in");
  11805. $("#printZyReq").off("click").on("click", function (t) {
  11806. printZyReq(patientId, 1);
  11807. });
  11808. $("#printZyReqSetup").removeClass("hide").addClass("in");
  11809. $("#printZyReqSetup").off("click").on("click", function (t) {
  11810. printZyReq(patientId, 2);
  11811. });
  11812. }
  11813. //门诊手术
  11814. if (jsonData.opRecordList != null && jsonData.opRecordList.length > 0) {
  11815. $("#printOpRecord").removeClass("hide").addClass("in");
  11816. $("#printOpRecord").off("click").on("click", function (t) {
  11817. printOpRecord(patientId, times, 1);
  11818. });
  11819. $("#printOpRecordSetup").removeClass("hide").addClass("in");
  11820. $("#printOpRecordSetup").off("click").on("click", function (t) {
  11821. printOpRecord(patientId, times, 2);
  11822. });
  11823. } else {
  11824. $("#printOpRecord").removeClass("in").addClass("hide");
  11825. $("#printOpRecord").off("click");
  11826. $("#printOpRecordSetup").removeClass("in").addClass("hide");
  11827. $("#printOpRecordSetup").off("click");
  11828. }
  11829. //未缴费状态的时候可以删除处方
  11830. if (oriPayMark == 5 || oriPayMark == "5") {
  11831. $("#deletePrescription").removeClass("hide").addClass("in");
  11832. $("#deletePrescription").off("click").on("click", function (t) {
  11833. deletePrescription(clnicId);
  11834. });
  11835. }
  11836. //已诊列表发起会诊
  11837. $("#consultationCliniced").removeClass("hide").addClass("in");
  11838. $("#consultationCliniced").off("click").on("click", function (t) {
  11839. consultationCliniced(patientId);
  11840. });
  11841. //已诊列表发起预约挂号
  11842. $("#registration").off("click").on("click", function (t) {
  11843. registration(patientId);
  11844. });
  11845. } else {
  11846. // $("#printPrescription").removeClass("in").addClass("hide");
  11847. $("#printGuideCard").removeClass("in").addClass("hide");
  11848. $("#printZyReq").removeClass("in").addClass("hide");
  11849. $("#printBlRecord").removeClass("in").addClass("hide");
  11850. $("#printJcReq").removeClass("in").addClass("hide");
  11851. $("#printJyReq").removeClass("in").addClass("hide");
  11852. $("#registration").removeClass("in").addClass("hide");
  11853. $("#callPrescription").removeClass("hide").addClass("in");
  11854. $("#callPrescription").off("click").on("click", function (t) {
  11855. getMzPrescriptionVoPaid(patientId, times, clnicId);
  11856. });
  11857. }
  11858. if (oriPayMark == 1) {
  11859. // $("#printPrescription").removeClass("in").addClass("hide");
  11860. // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  11861. $("#printGuideCard").removeClass("in").addClass("hide");
  11862. $("#printGuideCardSetup").removeClass("in").addClass("hide");
  11863. } else {
  11864. if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
  11865. // $("#printPrescription").removeClass("in").addClass("hide");
  11866. // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
  11867. $("#printGuideCard").removeClass("in").addClass("hide");
  11868. $("#printGuideCardSetup").removeClass("in").addClass("hide");
  11869. } else {
  11870. // $("#printPrescription").removeClass("hide").addClass("in");
  11871. // $("#printPrescription").off("click").on("click", function (t) {
  11872. // printPrescription(patientId, times, clnicId, payMark, 1);
  11873. // });
  11874. // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
  11875. // $("#printPrescriptionSetup").off("click").on("click", function (t) {
  11876. // printPrescription(patientId, times, clnicId, payMark, 2);
  11877. // });
  11878. $("#printGuideCard").removeClass("hide").addClass("in");
  11879. $("#printGuideCard").off("click").on("click", function (t) {
  11880. printGuideCard(patientId, times, clnicId, payMark, 1);
  11881. });
  11882. $("#printGuideCardSetup").removeClass("hide").addClass("in");
  11883. $("#printGuideCardSetup").off("click").on("click", function (t) {
  11884. printGuideCard(patientId, times, clnicId, payMark, 2);
  11885. });
  11886. }
  11887. }
  11888. $("#previewBlbg").off("click").on("click", function (t) {
  11889. window.open("http://172.16.32.192:801/PIMSWebView.asp?mid=" + patientId);
  11890. });
  11891. $("#printBlRecord").removeClass("hide").addClass("in");
  11892. $("#printBlRecord").off("click").on("click", function (t) {
  11893. printBlRecord(patientId, times, 1);
  11894. });
  11895. $("#printBlRecordSetup").removeClass("hide").addClass("in");
  11896. $("#printBlRecordSetup").off("click").on("click", function (t) {
  11897. printBlRecord(patientId, times, 2);
  11898. });
  11899. $("#showMzBlRecordModal").removeClass("hide").addClass("in");
  11900. $("#showMzBlRecordModal").off("click").on("click", function (t) {
  11901. showMzBlRecordModal(patientId, times, 1);
  11902. });
  11903. if ($("#setupId").hasClass("fa-chevron-up")) {
  11904. //默认不展开打印设置
  11905. $("#setupId").parent().click();
  11906. }
  11907. // setTimeout(function () {
  11908. // if ($("#setupId").hasClass("fa-chevron-up")) {
  11909. // //默认不展开打印设置
  11910. // $("#setupId").parent().click();
  11911. // }
  11912. // }, 400);
  11913. //就诊详情的时候,隐藏复选框
  11914. if (type == 0) {
  11915. $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
  11916. $(obj).css("display", "none");
  11917. });
  11918. } else {
  11919. //历史处方显示复选框
  11920. $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
  11921. $(obj).css("display", "inline-block");
  11922. });
  11923. }
  11924. } else {
  11925. errorMesage(res);
  11926. }
  11927. }
  11928. });
  11929. $("#selfAmountView").html(0.00);
  11930. $("#fundPayView").html(0.00);
  11931. $("#acctPayView").html(0.00);
  11932. $("#totalAmountView").html(0.00);
  11933. $.ajax({
  11934. type: "GET",
  11935. url: '/thmz/getChargeDetailFee?patientId=&times=&receiptNo=&clnicId=' + clnicId,
  11936. contentType: "application/json;charset=UTF-8",
  11937. dataType: "json",
  11938. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11939. async: true,
  11940. success: function (res) {
  11941. if (res == '401' || res == 401) {
  11942. window.location.href = '/thmz/login/view'
  11943. return;
  11944. }
  11945. if (res.code == 0) {
  11946. if (res.fundPay != undefined && res.fundPay != null) {
  11947. $("#fundPayView").text("¥" + res.fundPay);
  11948. }
  11949. if (res.acctPay != undefined && res.acctPay != null) {
  11950. $("#acctPayView").text("¥" + res.acctPay);
  11951. }
  11952. $("#selfAmountView").text("¥" + res.selfAmount);
  11953. $("#totalAmountView").text("¥" + res.totalAmount);
  11954. } else {
  11955. printIndex = -1;
  11956. }
  11957. }
  11958. });
  11959. }
  11960. /**
  11961. * 查询默认打印机
  11962. */
  11963. function setPrint() {
  11964. if (printIndex >= 0) {
  11965. return;
  11966. }
  11967. $.ajax({
  11968. type: "GET",
  11969. url: '/thmz/getLastWindowsByCurrentUser',
  11970. contentType: "application/json;charset=UTF-8",
  11971. dataType: "json",
  11972. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  11973. async: false,
  11974. success: function (res) {
  11975. if (res == '401' || res == 401) {
  11976. window.location.href = '/thmz/login/view'
  11977. return;
  11978. }
  11979. if (res.code == 0) {
  11980. printIndex = res.data.cgPrintIndex;
  11981. } else {
  11982. printIndex = -1;
  11983. }
  11984. }
  11985. });
  11986. }
  11987. //获取处方编码
  11988. function getOrderNum(patientId,times,prescriptionDetail) {
  11989. let num = '1'
  11990. if(prescriptionDetail.length > 0){
  11991. if(!stringIsBlank(prescriptionDetail[0].orderCode)){
  11992. num = prescriptionDetail[0].orderCode.split("_")[3]
  11993. }
  11994. }
  11995. return patientId + times + num;
  11996. }
  11997. //设置外配药打印页面
  11998. function setWpMedicineTableHtml(wpMedicinePrescription) {
  11999. let html = "";
  12000. for (let i = 0; i <wpMedicinePrescription.length ; i++) {
  12001. let detail = wpMedicinePrescription[i];
  12002. html += "<tr><td>" + (i+1) + "</td>";
  12003. html += "<td colspan='2'>";
  12004. html += detail.name + "(" + detail.drugSpec + ")";
  12005. html += "</td>";
  12006. html += "<td colspan='2'></td>";
  12007. html += "<td>X</td>";
  12008. html += "<td rowspan='2' style='height: 100%;line-height: 100%;font-size: 40px;'>";
  12009. html += "</td><td>" + detail.drugCnt + detail.drugDosunt + "</td>";
  12010. html += "</tr>";
  12011. html += "<tr><td></td>";
  12012. html += "<td></td>";
  12013. html += "<td style='font-weight: bold;text-align: right;'>用法:</td>";
  12014. html += "<td>" + detail.sinDoscnt + detail.sinDosunt + "/次</td>";
  12015. html += "<td>" + detail.usedFrquName + "</td>";
  12016. html += "<td>" + detail.medcDays + "天</td>";
  12017. html += "<td>" + detail.medcWayDscr + "</td>";
  12018. html += "</tr>";
  12019. }
  12020. return html;
  12021. }
  12022. function setTableHtml(prescriptionDetail) {
  12023. //设置成组处方符号
  12024. if (prescriptionDetail.length > 1) {
  12025. var map = new MyMap();
  12026. var groupOrderlist = [];
  12027. for (var j = 0; j < prescriptionDetail.length; j++) {
  12028. var detail = prescriptionDetail[j];
  12029. var list = map.get(detail.groupOrder);
  12030. if (list == null) {
  12031. list = [];
  12032. map.put(detail.groupOrder, list);
  12033. groupOrderlist[groupOrderlist.length] = detail.groupOrder;
  12034. }
  12035. list[list.length] = detail;
  12036. }
  12037. for (var j = 0; j < groupOrderlist.length; j++) {
  12038. var list = map.get(groupOrderlist[j]);
  12039. if (list.length == 1) {
  12040. continue;
  12041. }
  12042. list[0].groupFlag = "┒";
  12043. list[list.length - 1].groupFlag = "┛";
  12044. if (list.length > 2) {
  12045. for (var t = 1; t < list.length - 1; t++) {
  12046. list[t].groupFlag = "┃";
  12047. }
  12048. }
  12049. }
  12050. }
  12051. var html = "";
  12052. for (var j = 0; j < prescriptionDetail.length; j++) {
  12053. var detail = prescriptionDetail[j];
  12054. html += "<tr><td>" + (j+1) + "</td>";
  12055. html += "<td colspan='2'>";
  12056. html += detail.name + "(" + detail.specification + ")";
  12057. html += "</td>";
  12058. html += "<td colspan='2'></td>";
  12059. html += "<td>X</td>";
  12060. html += "<td rowspan='2' style='height: 100%;line-height: 100%;font-size: 40px;'>";
  12061. if (detail.groupFlag != undefined && detail.groupFlag != null) {
  12062. html += detail.groupFlag;
  12063. }
  12064. html += "</td><td>" + detail.quantity + detail.packUnit + "</td>";
  12065. html += "</tr>";
  12066. html += "<tr><td></td>";
  12067. if (detail.tryResult != undefined && detail.tryResult != null && detail.tryResult != "null" && detail.tryResult != "") {
  12068. html += "<td>" + detail.tryResult + "</td>";
  12069. } else if (detail.tryFlag != undefined && detail.tryFlag != null && detail.tryFlag != "null" && detail.tryFlag != "") {
  12070. html += "<td>" + detail.tryFlag + "</td>";
  12071. } else {
  12072. html += "<td></td>";
  12073. }
  12074. html += "<td style='font-weight: bold;text-align: right;'>用法:</td>";
  12075. html += "<td>" + detail.drugQuan + detail.unitDesc + "/次</td>";
  12076. html += "<td>" + detail.frequency + "</td>";
  12077. html += "<td>" + detail.orderDays + "天</td>";
  12078. html += "<td>" + detail.supplyName + "</td>";
  12079. html += "</tr>";
  12080. }
  12081. html += "<tr><td colspan='7'>&nbsp;&nbsp;&nbsp;&nbsp;------(以下空白)------</td></tr>";
  12082. return {html: html, j: j};
  12083. }
  12084. /**
  12085. * 保存门诊处方打印记录
  12086. * @param patientId
  12087. * @param times
  12088. */
  12089. function saveMzPrescriptionPrint(patientId, times) {
  12090. postAjaxJsonHttpRequst("/thmz/mzPrescriptionPrint/saveData",{patientId:patientId,times:times},true,function (res) {
  12091. })
  12092. }
  12093. /**
  12094. * 打印门诊处方
  12095. * @param patientId
  12096. * @param times
  12097. * @param clnicId
  12098. * @param payMark
  12099. * @param printType 打印模式 1 预览打印 2 打印设置
  12100. */
  12101. function printPrescription(patientId, times, clnicId, payMark, printType) {
  12102. if(printType == 1){
  12103. saveMzPrescriptionPrint(patientId,times)
  12104. }
  12105. $.ajax({
  12106. type: "GET",
  12107. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
  12108. contentType: "application/json;charset=UTF-8",
  12109. dataType: "json",
  12110. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  12111. success: function (res) {
  12112. if (res == '401' || res == 401) {
  12113. window.location.href = '/thmz/login/view'
  12114. return;
  12115. }
  12116. if (res.code == 0) {
  12117. var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
  12118. if (prescriptionDetail != null && prescriptionDetail != "") {
  12119. var prescriptionDetailJson = JSON.parse(prescriptionDetail);
  12120. //当前处方只开了住院证则只打印住院证
  12121. 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) {
  12122. printZyReq(patientId, 1);
  12123. return;
  12124. }
  12125. var index = 0;
  12126. setPrint();
  12127. LODOP = getLodop();
  12128. LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
  12129. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"处方笺");
  12130. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  12131. //设置默认打印机
  12132. LODOP.SET_PRINTER_INDEX(printIndex);
  12133. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  12134. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  12135. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  12136. //LODOP.SET_SHOW_MODE("SETUP_ENABLESS",getCheckSS());
  12137. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
  12138. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  12139. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  12140. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  12141. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  12142. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  12143. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  12144. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  12145. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  12146. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  12147. var mzPatientMi = res.mzPatientMi;
  12148. var deptName = res.deptName;
  12149. $("#patientNamePrescription").text(mzPatientMi.name);
  12150. $("#patientGenderPrescription").text(mzPatientMi.gender);
  12151. $("#patientAgePrescription").text(mzPatientMi.ageString);
  12152. $("#patientIdPrescription").text(mzPatientMi.patientId);
  12153. $("#deptPrescription").text(deptName);
  12154. // $("#doctorPrescription").text(res.doctorName);
  12155. getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:res.doctorCode},false,function (postRes) {
  12156. if(postRes.code ==0){
  12157. $("#doctorPrescription").html("<img src='" + postRes.data + "' style='width:100px;height:23px;'/>")
  12158. }else {
  12159. $("#doctorPrescription").text(res.doctorName);
  12160. }
  12161. })
  12162. $("#cfTime").text(res.opDate);
  12163. $("#socialNo").text(mzPatientMi.socialNo);
  12164. $("#sfTypeId").text(mzPatientMi.responseTypeName);
  12165. $("#zdPrescription").text(res.data.icdText);
  12166. $("#patientIdGuideCard").text(mzPatientMi.patientId);
  12167. $("#doctorGuideCard").text(res.data.mzBlRecord.doctorName);
  12168. $("#patientNameGuideCard").text(mzPatientMi.name);
  12169. $("#patientDateGuideCard").text(format(new Date(), "yyyy/MM/dd/HH:mm"));
  12170. JsBarcode("#cfBarcode", patientId, {
  12171. lineColor: '#000000', //线条颜色
  12172. width: 1, //线宽
  12173. height: 26, //条码高度
  12174. displayValue: false, //是否显示文字信息
  12175. });
  12176. //普药处方
  12177. var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
  12178. if (pyPrescription != null && pyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.py_print =="1") {
  12179. for (var i = 0; i < pyPrescription.length; i++) {
  12180. if (index > 0) {
  12181. LODOP.NewPageA();
  12182. }
  12183. var prescriptionDetail = pyPrescription[i].detail;
  12184. var __ret = setTableHtml(prescriptionDetail);
  12185. var html = __ret.html;
  12186. var j = __ret.j;
  12187. if (res.deptName != undefined && res.deptName != null) {
  12188. if (res.deptName.indexOf("儿") > 0) {
  12189. $("#typePrescription").text("儿科");
  12190. $("#cfTitle").text("儿科");
  12191. } else if (res.deptName.indexOf("急诊科") > 0) {
  12192. $("#typePrescription").text("急诊");
  12193. $("#cfTitle").text("急诊");
  12194. } else {
  12195. $("#typePrescription").text("普通处方");
  12196. $("#cfTitle").text("普通");
  12197. }
  12198. }
  12199. $("#prescriptionDetail").html(html);
  12200. $("#cfAmountPrint").text(pyPrescription[i].amount + "元 (不含注射费)");
  12201. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12202. index++;
  12203. }
  12204. }
  12205. let wpMedicinePrescription = prescriptionDetailJson.wpMedicinePrescription;
  12206. if(wpMedicinePrescription !=null && wpMedicinePrescription.length > 0){
  12207. if (index > 0) {
  12208. LODOP.NewPageA();
  12209. }
  12210. let _html = setWpMedicineTableHtml(wpMedicinePrescription);
  12211. $("#typePrescription").text("院外调配处方");
  12212. $("#cfTitle").text("院外调配");
  12213. $("#prescriptionDetail").html(_html);
  12214. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12215. }
  12216. //医材处方
  12217. var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
  12218. if (ycPrescription != null && ycPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.yc_print =="1") {
  12219. for (var i = 0; i < ycPrescription.length; i++) {
  12220. if (index > 0) {
  12221. LODOP.NewPageA();
  12222. }
  12223. var prescriptionDetail = ycPrescription[i].detail;
  12224. var __ret = setTableHtml(prescriptionDetail);
  12225. var html = __ret.html;
  12226. var j = __ret.j;
  12227. if (res.deptName != undefined && res.deptName != null) {
  12228. if (res.deptName.indexOf("儿") > 0) {
  12229. $("#typePrescription").text("儿科");
  12230. $("#cfTitle").text("儿科");
  12231. } else if (res.deptName.indexOf("急诊科") > 0) {
  12232. $("#typePrescription").text("急诊");
  12233. $("#cfTitle").text("急诊");
  12234. } else {
  12235. $("#typePrescription").text("医材处方");
  12236. $("#cfTitle").text("普通");
  12237. }
  12238. }
  12239. $("#prescriptionDetail").html(html);
  12240. $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
  12241. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12242. index++;
  12243. }
  12244. }
  12245. //麻精处方
  12246. var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
  12247. if (mjPrescription != null && mjPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
  12248. for (var i = 0; i < mjPrescription.length; i++) {
  12249. if (index > 0) {
  12250. LODOP.NewPageA();
  12251. }
  12252. var prescriptionDetail = mjPrescription[i].detail;
  12253. var __ret = setTableHtml(prescriptionDetail);
  12254. var html = __ret.html;
  12255. var j = __ret.j;
  12256. $("#typePrescription").text("麻、精一处方");
  12257. $("#cfTitle").text("麻、精一");
  12258. $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
  12259. $("#prescriptionDetail").html(html);
  12260. $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
  12261. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12262. index++;
  12263. }
  12264. }
  12265. //精二处方
  12266. var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
  12267. if (jePrescription != null && jePrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
  12268. for (var i = 0; i < jePrescription.length; i++) {
  12269. if (index > 0) {
  12270. LODOP.NewPageA();
  12271. }
  12272. var prescriptionDetail = jePrescription[i].detail;
  12273. var __ret = setTableHtml(prescriptionDetail);
  12274. var html = __ret.html;
  12275. var j = __ret.j;
  12276. $("#typePrescription").text("精二处方");
  12277. $("#cfTitle").text("精二");
  12278. $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
  12279. $("#prescriptionDetail").html(html);
  12280. $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
  12281. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12282. index++;
  12283. }
  12284. }
  12285. $("#cfOrderNumTitle").text(null)
  12286. //中药处方
  12287. if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.zy_print =="1") {
  12288. var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;zyPrescription
  12289. var zyGroupNo = prescriptionDetailJson.zyPrescription[0].groupNo;
  12290. if (zyPrescription != null && zyPrescription.length > 0) {
  12291. var html = "";
  12292. for (var i = 0; i < zyPrescription.length; i++) {
  12293. if (i % 2 == 0) {
  12294. html += "<tr><td></td><td></td></tr><tr>";
  12295. }
  12296. html += "<td>";
  12297. html += zyPrescription[i].name;
  12298. if(zyPrescription[i].spec){
  12299. html += "("+zyPrescription[i].spec+")";
  12300. }
  12301. if(zyGroupNo=='83'){
  12302. html += zyPrescription[i].quantity + "袋";
  12303. }else {
  12304. html += zyPrescription[i].quantity + "g";
  12305. }
  12306. if (zyPrescription[i].instructionText != null) {
  12307. html += "[" + zyPrescription[i].instructionText + "]";
  12308. }
  12309. if (i % 2 == 1) {
  12310. html += "</td></tr>";
  12311. } else {
  12312. html += "</td>";
  12313. }
  12314. }
  12315. if (zyPrescription.length % 2 != 0) {
  12316. html += "</tr>";
  12317. }
  12318. html += "<tr><td></td><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td></tr>";
  12319. var cyMtjs = prescriptionDetailJson.zyPrescription[0].cyMtjs;
  12320. if (cyMtjs == null || cyMtjs == "null") {
  12321. cyMtjs = "";
  12322. }
  12323. var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
  12324. if (cyJssm == null || cyJssm == "null") {
  12325. cyJssm = "";
  12326. }
  12327. var cyJsl = prescriptionDetailJson.zyPrescription[0].cyJsl;
  12328. if (cyJsl == null || cyJsl == "null") {
  12329. cyJsl = "";
  12330. }
  12331. var cyZql = prescriptionDetailJson.zyPrescription[0].cyZql;
  12332. if (cyZql == null || cyZql == "null") {
  12333. cyZql = "";
  12334. }
  12335. var cyFj = prescriptionDetailJson.zyPrescription[0].cyFj;
  12336. if (cyFj == null || cyFj == "null") {
  12337. cyFj = "";
  12338. }
  12339. var cyFfcs = prescriptionDetailJson.zyPrescription[0].cyFfcs;
  12340. if (cyFfcs == null || cyFfcs == "null") {
  12341. cyFfcs = "";
  12342. }
  12343. var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
  12344. if (cyFysm == null || cyFysm == "null") {
  12345. cyFysm = "";
  12346. }
  12347. var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
  12348. if (cyDj == null || cyDj == "null") {
  12349. cyDj = "";
  12350. } else {
  12351. cyDj = "(" + cyDj + ")";
  12352. }
  12353. if(zyGroupNo =='83'){
  12354. html += "<tr><td colspan='2'>每天" + cyMtjs + "剂," + cyJssm + cyJsl + "ml。分" + cyFfcs + "次" + cyFysm + "。</td></tr>";
  12355. }else {
  12356. html += "<tr><td colspan='2'>每天" + cyMtjs + "剂," + cyJssm + cyJsl + "ml,煮取量" + cyZql + "ml,复煎" + cyFj + "次。分" + cyFfcs + "次" + cyFysm + " " + cyDj + "。</td></tr>";
  12357. }
  12358. html += "<tr><td colspan='2'>&nbsp;&nbsp;&nbsp;&nbsp;------(以下空白)------</td></tr>";
  12359. if (index > 0) {
  12360. LODOP.NewPageA();
  12361. }
  12362. if (res.deptName != undefined && res.deptName != null) {
  12363. if (res.deptName.indexOf("儿") > 0) {
  12364. $("#typePrescription").text("儿科");
  12365. $("#cfTitle").text("儿科");
  12366. } else if (res.deptName.indexOf("急诊科") > 0) {
  12367. $("#typePrescription").text("急诊");
  12368. $("#cfTitle").text("急诊");
  12369. } else {
  12370. $("#typePrescription").text("中药处方");
  12371. $("#cfTitle").text("普通");
  12372. }
  12373. }
  12374. $("#prescriptionDetail").html(html);
  12375. $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 (不含代煎费)");
  12376. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12377. index++;
  12378. }
  12379. }
  12380. var printZlPrescription = $("#zlPrintFlagCheck").parent().hasClass("checked") == true ? true : false;
  12381. if (printZlPrescription) {
  12382. if (prescriptionDetailJson.zlPrescription != null && prescriptionDetailJson.zlPrescription.length > 0) {
  12383. //诊疗处方
  12384. var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
  12385. if (zlPrescription != null && zlPrescription.length > 0) {
  12386. var html = "";
  12387. for (var i = 0; i < zlPrescription.length; i++) {
  12388. var zlPrescriptionTemp = zlPrescription[i];
  12389. html += "<tr>";
  12390. html += "<td colspan='2'>" + zlPrescriptionTemp.index + "." + zlPrescriptionTemp.name + "</td>";
  12391. html += "<td style='text-align: right;padding-right: 15px;'>X</td>";
  12392. html += "<td>总量:" + zlPrescriptionTemp.quantity + "</td>";
  12393. html += "</tr>";
  12394. html += "<tr>";
  12395. html += "<td width='40%'></td>";
  12396. html += "<td width='20%'>单量:" + zlPrescriptionTemp.drugQuan + "</td>";
  12397. html += "<td width='20%'>频率:" + zlPrescriptionTemp.frequency + "</td>";
  12398. html += "<td width='20%'>天数:" + zlPrescriptionTemp.orderDays + "天</td>";
  12399. html += "</tr>";
  12400. }
  12401. if (index > 0) {
  12402. LODOP.NewPageA();
  12403. }
  12404. if (res.deptName != undefined && res.deptName != null) {
  12405. if (res.deptName.indexOf("儿") > 0) {
  12406. $("#typePrescription").text("儿科");
  12407. $("#cfTitle").text("儿科");
  12408. } else if (res.deptName.indexOf("急诊科") > 0) {
  12409. $("#typePrescription").text("急诊");
  12410. $("#cfTitle").text("急诊");
  12411. } else {
  12412. $("#typePrescription").text("诊疗处方");
  12413. $("#cfTitle").text("普通");
  12414. }
  12415. }
  12416. $("#prescriptionDetail").html(html);
  12417. $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
  12418. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
  12419. index++;
  12420. }
  12421. }
  12422. }
  12423. //检查申请单打印
  12424. var mzYjReqList = res.data.mzYjReqList;
  12425. if (mzYjReqList != null && mzYjReqList.length > 0) {
  12426. $("#patientIdJcReq").text(mzPatientMi.patientId);
  12427. $("#patientNameJcReq").text(mzPatientMi.name);
  12428. $("#patientGenderJcReq").text(mzPatientMi.gender);
  12429. $("#patientAgeJcReq").text(mzPatientMi.ageString);
  12430. $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
  12431. $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
  12432. $("#icdTextJcReq").text(res.data.icdText);
  12433. var mzBlRecord = res.data.mzBlRecord;
  12434. $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  12435. $("#jcReqHis").text(mzBlRecord.emrHpi);
  12436. var tz = getTz(mzBlRecord);
  12437. $("#jcReqTz").text(tz);
  12438. $("#jcReqReqDept").text(res.deptName);
  12439. $("#jcReqReqDoctor").text(res.doctorName);
  12440. // $("#patientIdJyReq").text(mzPatientMi.patientId);
  12441. // $("#patientNameJyReq").text(mzPatientMi.name);
  12442. // $("#patientGenderJyReq").text(mzPatientMi.gender);
  12443. // $("#patientAgeJyReq").text(mzPatientMi.ageString);
  12444. // $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
  12445. // $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
  12446. // $("#icdTextJyReq").text(res.data.icdText);
  12447. // $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  12448. // $("#jyReqHis").text(mzBlRecord.emrHpi);
  12449. // $("#jyReqTz").text(tz);
  12450. // $("#jyReqReqDept").text(res.deptName);
  12451. // $("#jyReqReqDoctor").text(res.doctorName);
  12452. for (var i = 0; i < mzYjReqList.length; i++) {
  12453. var mzYjReq = mzYjReqList[i];
  12454. if (mzYjReq == null) {
  12455. continue;
  12456. }
  12457. if (i == 0) {
  12458. var dateStr = format(mzYjReq.reqDate, "yyyy-MM-dd");
  12459. $("#jcReqReqDate").text(dateStr);
  12460. // $("#jyReqReqDoctor").text(dateStr);
  12461. }
  12462. if (mzYjReq.reqType == 2) {
  12463. continue;
  12464. }
  12465. if ((i == 0 && index > 0) || i > 0) {
  12466. LODOP.NewPageA();
  12467. }
  12468. JsBarcode("#JcBarcode", mzYjReq.reqNo, {
  12469. lineColor: '#000000', //线条颜色
  12470. width: 1, //线宽
  12471. height: 26, //条码高度
  12472. displayValue: false, //是否显示文字信息
  12473. });
  12474. $("#reqNoJcReq").text(mzYjReq.reqNo);
  12475. $("#jcReqItem").text(mzYjReq.groupName);
  12476. $("#jcReqRemark").text(mzYjReq.jyRemark);
  12477. $("#jcComment8").text(mzYjReq.comment8);
  12478. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
  12479. index++;
  12480. }
  12481. }
  12482. //住院证打印
  12483. var mzZyReq = res.data.mzZyReq;
  12484. if (mzZyReq != null) {
  12485. $("#patientIdZyReq").text(mzPatientMi.patientId);
  12486. $("#patientNameZyReq").text(mzPatientMi.name);
  12487. $("#patientGenderZyReq").text(mzPatientMi.gender);
  12488. $("#patientAgeZyReq").text(mzPatientMi.ageString);
  12489. $("#sfzZyReq").text(mzPatientMi.socialNo);
  12490. $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
  12491. $("#phoneZyReq").text(mzPatientMi.phoneNo);
  12492. $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
  12493. $("#addressZyReq").text(mzPatientMi.address);
  12494. if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
  12495. $("#icsCodeZyReq").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  12496. $("#icsTextZyReq").text(mzZyReq.icdText);
  12497. } else {
  12498. $("#icsCodeZyReq").text(mzZyReq.icdCode);
  12499. $("#icsTextZyReq").text(mzZyReq.icdText);
  12500. }
  12501. $("#reqDeptZyReq").text(mzZyReq.reqWardName);
  12502. $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
  12503. $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
  12504. $("#depositZyReq").text(mzZyReq.deposit);
  12505. //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
  12506. // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
  12507. $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
  12508. $(this).removeAttr("checked");
  12509. if ($(this).val() == Number(mzZyReq.admissStatus) || $(this).val() == mzZyReq.admissStatus) {
  12510. $(this).attr("checked", true)
  12511. }
  12512. });
  12513. $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
  12514. $("#deptCodeZyReq").text(mzZyReq.deptName);
  12515. getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
  12516. if(signRes.code == 0){
  12517. $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
  12518. }else {
  12519. $("#doctorCodeZyReq").text(mzZyReq.doctorName);
  12520. }
  12521. })
  12522. if (index > 0) {
  12523. LODOP.NewPageA();
  12524. }
  12525. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
  12526. index++;
  12527. }
  12528. //手术申请单打印
  12529. var opRecordList = res.data.opRecordList;
  12530. if (opRecordList != null && opRecordList.length > 0) {
  12531. $("#patientIdOpRecord").text(mzPatientMi.patientId);
  12532. $("#patientNameOpRecord").text(mzPatientMi.name);
  12533. $("#patientGenderOpRecord").text(mzPatientMi.gender);
  12534. $("#patientAgeOpRecord").text(mzPatientMi.ageString);
  12535. $("#responseTypeOpRecord").text(mzPatientMi.responseTypeName);
  12536. $("#patientCardNoOpRecord").text(mzPatientMi.icCardNo);
  12537. for (var i = 0; i < opRecordList.length; i++) {
  12538. var obj = opRecordList[i];
  12539. //$("#reqNoOpRecord").text(obj.recordId);
  12540. $("#icdTextOpRecord").text(obj.diagBeforeOp);
  12541. $("#opNameOpRecord").text(obj.opName);
  12542. $("#hocusCodeOpRecord").text(obj.hocusCodeName);
  12543. $("#opScaleOpRecord").text(obj.opScaleName);
  12544. var dateStr = format(obj.applyDate, "yyyy-MM-dd HH:mm:ss");
  12545. $("#applyDateOpRecord").text(dateStr);
  12546. $("#opDatetimeOpRecord").text(obj.opDatetimeStr);
  12547. $("#doctorZdOpRecord").text(obj.doctorZdName);
  12548. $("#remarkOpRecord").text(obj.remark);
  12549. if (index > 0) {
  12550. LODOP.NewPageA();
  12551. }
  12552. JsBarcode("#JcBarcode", obj.recordId, {
  12553. lineColor: '#000000', //线条颜色
  12554. width: 1, //线宽
  12555. height: 26, //条码高度
  12556. displayValue: false, //是否显示文字信息
  12557. });
  12558. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("op_record_card_table").innerHTML);
  12559. index++;
  12560. }
  12561. }
  12562. // $("#selfAmountGuideCard").html(0.00);
  12563. // $("#fundPayGuideCard").html(0.00);
  12564. // $("#acctPayGuideCard").html(0.00);
  12565. $("#payQrcodeGuideCard").empty();
  12566. $("#selfPayDetail").empty();
  12567. infoMessage("获取支付信息耗时较长,请耐心等待")
  12568. $.ajax({
  12569. type: "GET",
  12570. url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '&times=' + times,
  12571. contentType: "application/json;charset=UTF-8",
  12572. dataType: "json",
  12573. headers: {
  12574. 'Accept': 'application/json',
  12575. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  12576. },
  12577. success: function (res) {
  12578. if (res == '401' || res == 401) {
  12579. window.location.href = '/thmz/login/view'
  12580. return;
  12581. }
  12582. if (res.code == 0) {
  12583. var selfPayList = res.selfPayList;
  12584. $("#zfcns_time").text("时间:" + res.zfcns_time);
  12585. if (selfPayList != null && selfPayList.length > 0) {
  12586. $("#patientNameSelfPay").text(mzPatientMi.name);
  12587. $("#patientGenderSelfPay").text(mzPatientMi.gender);
  12588. $("#patientAgeSelfPay").text(mzPatientMi.ageString);
  12589. $("#patientIdSelfPay").text(mzPatientMi.patientId);
  12590. $("#deptSelfPay").text(deptName);
  12591. $("#zdSelfPay").text(res.icdText);
  12592. var selfPayListHtml = "";
  12593. for (var i = 1; i <= selfPayList.length; i++) {
  12594. selfPayListHtml += "<tr><td>";
  12595. selfPayListHtml += i + "." + selfPayList[i - 1];
  12596. selfPayListHtml += "</td></tr>";
  12597. }
  12598. $("#selfPayDetail").html(selfPayListHtml);
  12599. if (index > 0) {
  12600. LODOP.NewPageA();
  12601. }
  12602. //view-source:http://www.c-lodop.com/demolist/PrintSample43.html 分页看这里
  12603. LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
  12604. LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
  12605. LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
  12606. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  12607. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
  12608. LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
  12609. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  12610. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
  12611. // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
  12612. index++;
  12613. }
  12614. let html = `<tr style="font-weight: 700"><td>项目</td><td>地点</td></tr>`;
  12615. if (res.guideCardData != null && res.guideCardData.length > 0) {
  12616. if(res.guideCardData.length > 0){
  12617. for (var i = 0; i < res.guideCardData.length; i++) {
  12618. html += "<tr><td>" + res.guideCardData[i].name + "</td><td>" + res.guideCardData[i].address + "</td></tr>"
  12619. }
  12620. }
  12621. }
  12622. $("#guideCardDetail").html(html);
  12623. let totalAmount = res.totalAmount;
  12624. let jsonData = {
  12625. "subject": '门诊收费',
  12626. "body": '门诊收费_' + patientId,
  12627. "patientId": patientId,
  12628. "times" : times,
  12629. "amount" : totalAmount
  12630. }
  12631. $.ajax({
  12632. type: "POST",
  12633. url: '/thmz/NongPay/unifiedOrderByCodeImgUrl',
  12634. contentType: "application/json;charset=UTF-8",
  12635. dataType: "json",
  12636. data: JSON.stringify(jsonData),
  12637. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  12638. success: function (res) {
  12639. if (res == '401' || res == 401) {
  12640. window.location.href = '/thmz/login/view'
  12641. return;
  12642. }
  12643. if (res.data != null && res.data != "" && res.data.payData != null && res.data.payData != "") {
  12644. // new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
  12645. // $("canvas").attr("id", "erw");
  12646. // let canvas = document.getElementById('erw');
  12647. // let src = canvas.toDataURL("image/png");
  12648. let payQrcodeGuideCardHtml = `<img src="${res.data.payData}" style="width: 100px;height: 100px;margin: 20px 0"/><div style="width: 140px;margin-top: 2px;">微信扫码支付</div>`;
  12649. $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
  12650. }
  12651. $("#totalAmountGuideCard").text("¥" + totalAmount +"元");
  12652. JsBarcode('#imgcode', patientId, {
  12653. lineColor: '#000000', //线条颜色
  12654. width: 2, //线宽
  12655. height: 60, //条码高度
  12656. displayValue: false, //是否显示文字信息
  12657. });
  12658. if (index > 0) {
  12659. LODOP.NewPageA();
  12660. }
  12661. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
  12662. //LODOP.PREVIEW();
  12663. if (printType == 1) {
  12664. LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
  12665. LODOP.PREVIEW();
  12666. } else if (printType == 2) {
  12667. LODOP.PRINT_SETUP();
  12668. }
  12669. }
  12670. })
  12671. // if (res.payQrcode != null && res.payQrcode != "") {
  12672. // new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
  12673. // $("canvas").attr("id", "erw");
  12674. // let canvas = document.getElementById('erw');
  12675. // let src = canvas.toDataURL("image/png");
  12676. // let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(自费)</div>`;
  12677. // $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
  12678. // }
  12679. // if(!stringIsBlank(res.healthEducationUrl)){
  12680. // new QRCode(document.getElementById("healthEducationCard"), res.healthEducationUrl); // 设置要生成二维码的链接
  12681. // $("canvas").attr("id", "erw");
  12682. // let canvas = document.getElementById('erw');
  12683. // let src = canvas.toDataURL("image/png");
  12684. // let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 120px;margin-top: 2px;">健康宣教</div>`;
  12685. // $("#healthEducationCard").html(wxPayQrCardHtml);
  12686. // }
  12687. // if(!stringIsBlank(res.wxPayQrUrl)){
  12688. // new QRCode(document.getElementById("wxPayQrCard"), res.wxPayQrUrl); // 设置要生成二维码的链接
  12689. // $("canvas").attr("id", "erw");
  12690. // let canvas = document.getElementById('erw');
  12691. // let src = canvas.toDataURL("image/png");
  12692. // let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(医保统筹)</div>`;
  12693. // $("#wxPayQrCard").html(wxPayQrCardHtml);
  12694. // }
  12695. } else if (res.code == -2) {
  12696. if (printType == 1) {
  12697. LODOP.PREVIEW();
  12698. } else if (printType == 2) {
  12699. LODOP.PRINT_SETUP();
  12700. }
  12701. } else {
  12702. errorMesage(res);
  12703. }
  12704. }
  12705. });
  12706. }
  12707. } else {
  12708. errorMesage(res);
  12709. }
  12710. }
  12711. });
  12712. }
  12713. function printGuideCard(patientId, times, clnicId, payMark, printType) {
  12714. $.ajax({
  12715. type: "GET",
  12716. url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
  12717. contentType: "application/json;charset=UTF-8",
  12718. dataType: "json",
  12719. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  12720. success: function (res) {
  12721. if (res == '401' || res == 401) {
  12722. window.location.href = '/thmz/login/view'
  12723. return;
  12724. }
  12725. if(res.code == 0){
  12726. var mzPatientMi = res.mzPatientMi;
  12727. $("#patientIdGuideCard").text(mzPatientMi.patientId);
  12728. $("#doctorGuideCard").text(res.data.mzBlRecord.doctorName);
  12729. $("#patientNameGuideCard").text(mzPatientMi.name);
  12730. $("#patientSexGuideCard").text(mzPatientMi.gender);
  12731. $("#patientAgeGuideCard").text(mzPatientMi.ageString);
  12732. $("#patientDateGuideCard").text(format(new Date(), "yyyy/MM/dd/HH:mm"));
  12733. console.log("mzPatientMi",mzPatientMi);
  12734. console.log("res",res);
  12735. $("#payQrcodeGuideCard").empty();
  12736. $("#selfPayDetail").empty();
  12737. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  12738. $.ajax({
  12739. type: "GET",
  12740. url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '&times=' + times,
  12741. contentType: "application/json;charset=UTF-8",
  12742. dataType: "json",
  12743. headers: {
  12744. 'Accept': 'application/json',
  12745. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  12746. },
  12747. success: function (res) {
  12748. setPrint();
  12749. LODOP = getLodop();
  12750. LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
  12751. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"门诊导引单");
  12752. if (res == '401' || res == 401) {
  12753. window.location.href = '/thmz/login/view'
  12754. return;
  12755. }
  12756. if (res.code == 0) {
  12757. var selfPayList = res.selfPayList;
  12758. $("#zfcns_time").text("时间:" + res.zfcns_time);
  12759. if (selfPayList != null && selfPayList.length > 0) {
  12760. $("#patientNameSelfPay").text(mzPatientMi.name);
  12761. $("#patientGenderSelfPay").text(mzPatientMi.gender);
  12762. $("#patientAgeSelfPay").text(mzPatientMi.ageString);
  12763. $("#patientIdSelfPay").text(mzPatientMi.patientId);
  12764. $("#deptSelfPay").text(deptName);
  12765. $("#zdSelfPay").text(res.icdText);
  12766. var selfPayListHtml = "";
  12767. for (var i = 1; i <= selfPayList.length; i++) {
  12768. selfPayListHtml += "<tr><td>";
  12769. selfPayListHtml += i + "." + selfPayList[i - 1];
  12770. selfPayListHtml += "</td></tr>";
  12771. }
  12772. $("#selfPayDetail").html(selfPayListHtml);
  12773. if (index > 0) {
  12774. LODOP.NewPageA();
  12775. }
  12776. //view-source:http://www.c-lodop.com/demolist/PrintSample43.html 分页看这里
  12777. LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
  12778. LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
  12779. LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
  12780. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  12781. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
  12782. LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
  12783. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  12784. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
  12785. // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
  12786. index++;
  12787. }
  12788. let html = `<tr style="font-weight: 700"><td>项目</td><td>地点</td></tr>`;
  12789. if (res.guideCardData != null && res.guideCardData.length > 0) {
  12790. if(res.guideCardData.length > 0){
  12791. for (var i = 0; i < res.guideCardData.length; i++) {
  12792. html += "<tr><td>" + res.guideCardData[i].name + "</td><td>" + res.guideCardData[i].address + "</td></tr>"
  12793. }
  12794. }
  12795. }
  12796. $("#guideCardDetail").html(html);
  12797. let totalAmount = res.totalAmount;
  12798. let jsonData = {
  12799. // "subject": "1234",
  12800. // "body": '门诊收费_' + patientId,
  12801. "patientId": patientId,
  12802. "times" : times,
  12803. "amount" : totalAmount
  12804. }
  12805. // infoMessage("获取支付信息耗时较长,请耐心等待")
  12806. // $.ajax({
  12807. // type: "POST",
  12808. // url: '/thmz/NongPay/unifiedOrderByCodeImgUrl',
  12809. // contentType: "application/json;charset=UTF-8",
  12810. // dataType: "json",
  12811. // data: JSON.stringify(jsonData),
  12812. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  12813. // success: function (res) {
  12814. // if (res == '401' || res == 401) {
  12815. // window.location.href = '/thmz/login/view'
  12816. // return;
  12817. // }
  12818. //
  12819. // }
  12820. // })
  12821. // + JSON.stringify(jsonData)
  12822. // 1. 生成二维码(使用临时容器,避免直接操作目标元素)
  12823. const tempContainer = document.createElement('div');
  12824. let qrCodeUrl = `https://hadln.net:20443/#/cashier?queryJson=${JSON.stringify(jsonData)}`
  12825. // console.log("jsonData",JSON.stringify(jsonData))
  12826. // console.log("qrCodeUrl",qrCodeUrl)
  12827. // document.getElementById("payQrcodeGuideCard")
  12828. new QRCode(tempContainer,{
  12829. text: qrCodeUrl,
  12830. width: 120,
  12831. height: 120,
  12832. version: 40,
  12833. colorDark: '#000000',
  12834. colorLight: '#ffffff',
  12835. correctLevel: QRCode.CorrectLevel.L // 最低容错,最大化容量
  12836. }); // 设置要生成二维码的链接
  12837. // 2. 获取生成的 canvas(直接从临时容器中获取,避免全局选择器冲突)
  12838. const canvas = tempContainer.querySelector('canvas');
  12839. if (!canvas) {
  12840. console.error('未生成二维码canvas');
  12841. return;
  12842. }
  12843. // 3. 立即导出 dataURL(在DOM操作前完成,避免污染)
  12844. let src;
  12845. try {
  12846. src = canvas.toDataURL("image/png");
  12847. } catch (e) {
  12848. console.error('导出二维码失败:', e);
  12849. return;
  12850. }
  12851. // $("canvas").attr("id", "erw");
  12852. // let canvas = document.getElementById('erw');
  12853. // let src = canvas.toDataURL("image/png");
  12854. let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px;margin: 20px 0"/><div style="width: 140px;margin-top: 2px;">微信扫码支付</div>`;
  12855. $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
  12856. $("#totalAmountGuideCard").text("¥" + totalAmount +"元");
  12857. JsBarcode('#imgcode', patientId, {
  12858. lineColor: '#000000', //线条颜色
  12859. width: 2, //线宽
  12860. height: 60, //条码高度
  12861. displayValue: false, //是否显示文字信息
  12862. });
  12863. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
  12864. //LODOP.PRINT();
  12865. if (printType == 1) {
  12866. LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
  12867. LODOP.PREVIEW();
  12868. } else if (printType == 2) {
  12869. LODOP.PRINT_SETUP();
  12870. }
  12871. } else if (res.code == -2) {
  12872. warningMesageSimaple(res.message)
  12873. } else {
  12874. errorMesage(res);
  12875. }
  12876. }
  12877. });
  12878. } else {
  12879. errorMesage(res);
  12880. }
  12881. }})
  12882. }
  12883. /**
  12884. * 构建体征描述
  12885. * @param mzBlRecord
  12886. * @returns {*}
  12887. */
  12888. function getTz(mzBlRecord) {
  12889. var tz = null;
  12890. if (mzBlRecord.weight != null && mzBlRecord.weight != 0) {
  12891. var temp = "体重:" + mzBlRecord.weight + "kg ";
  12892. if (tz == null) {
  12893. tz = temp;
  12894. } else {
  12895. tz += " " + temp;
  12896. }
  12897. }
  12898. if (mzBlRecord.temperature != null && mzBlRecord.temperature != 0) {
  12899. var temp = "体温:" + mzBlRecord.temperature + "℃ ";
  12900. if (tz == null) {
  12901. tz = temp;
  12902. } else {
  12903. tz += " " + temp;
  12904. }
  12905. }
  12906. if (mzBlRecord.sphygmus != null && mzBlRecord.sphygmus != 0) {
  12907. var temp = "脉搏:" + mzBlRecord.sphygmus + "次/分 ";
  12908. if (tz == null) {
  12909. tz = temp;
  12910. } else {
  12911. tz += " " + temp;
  12912. }
  12913. }
  12914. if (mzBlRecord.breathe != null && mzBlRecord.breathe != 0) {
  12915. var temp = "呼吸:" + mzBlRecord.breathe + "次/分 ";
  12916. if (tz == null) {
  12917. tz = temp;
  12918. } else {
  12919. tz += " " + temp;
  12920. }
  12921. }
  12922. if (mzBlRecord.pressureHigh != null && mzBlRecord.pressureFloor != null && mzBlRecord.pressureHigh != 0 && mzBlRecord.pressureFloor != 0) {
  12923. var temp = "血压:" + mzBlRecord.pressureHigh + "/" + mzBlRecord.pressureFloor + " mmhg";
  12924. if (tz == null) {
  12925. tz = temp;
  12926. } else {
  12927. tz += " " + temp;
  12928. }
  12929. }
  12930. if (mzBlRecord.pressureHighLeft != null && mzBlRecord.pressureFloorLeft != null && mzBlRecord.pressureHighLeft != 0 && mzBlRecord.pressureFloorLeft != 0) {
  12931. var temp = "左血压:" + mzBlRecord.pressureHighLeft + "/" + mzBlRecord.pressureFloorLeft;
  12932. if (tz == null) {
  12933. tz = temp;
  12934. } else {
  12935. tz += " " + temp;
  12936. }
  12937. }
  12938. if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
  12939. if (tz == null) {
  12940. tz = mzBlRecord.emrPe;
  12941. } else {
  12942. tz += "," + mzBlRecord.emrPe;
  12943. }
  12944. }
  12945. return tz;
  12946. }
  12947. /**
  12948. * 打印医技申请单
  12949. * @param patientId
  12950. * @param times
  12951. * @param type 申请单类型:2:检验;3:检查
  12952. * @param printType 打印模式 1 预览打印 2 打印设置
  12953. */
  12954. function printYjReq(patientId, times, type, printType) {
  12955. $.ajax({
  12956. type: "GET",
  12957. url: '/thmz/printYjReq?patientId=' + patientId + '&times=' + times + "&reqType=" + type,
  12958. contentType: "application/json;charset=UTF-8",
  12959. dataType: "json",
  12960. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  12961. success: function (res) {
  12962. if (res == '401' || res == 401) {
  12963. window.location.href = '/thmz/login/view'
  12964. return;
  12965. }
  12966. if (res.code == 0) {
  12967. if (res.data == null || res.data.mzYjReqList == null || res.data.mzYjReqList.length == 0) {
  12968. errorMesageSimaple("没有医技申请单可以打印");
  12969. return;
  12970. }
  12971. setPrint();
  12972. LODOP = getLodop();
  12973. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"检查申请单");
  12974. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  12975. //设置默认打印机
  12976. LODOP.SET_PRINTER_INDEX(printIndex);
  12977. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  12978. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  12979. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  12980. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "检查申请单");//对新建的纸张重命名
  12981. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  12982. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  12983. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  12984. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  12985. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  12986. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  12987. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  12988. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  12989. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  12990. var mzPatientMi = res.data.mzPatientMi;
  12991. $("#patientIdJcReq").text(mzPatientMi.patientId);
  12992. $("#patientNameJcReq").text(mzPatientMi.name);
  12993. $("#patientGenderJcReq").text(mzPatientMi.gender);
  12994. $("#patientAgeJcReq").text(mzPatientMi.ageString);
  12995. $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
  12996. $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
  12997. $("#icdTextJcReq").text(res.data.icdText);
  12998. $("#patientIdJyReq").text(mzPatientMi.patientId);
  12999. $("#patientNameJyReq").text(mzPatientMi.name);
  13000. $("#patientGenderJyReq").text(mzPatientMi.gender);
  13001. $("#patientAgeJyReq").text(mzPatientMi.ageString);
  13002. $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
  13003. $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
  13004. $("#icdTextJyReq").text(res.data.icdText);
  13005. var mzBlRecord = res.data.mzBlRecord;
  13006. $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  13007. $("#jcReqHis").text(mzBlRecord.emrHpi);
  13008. $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
  13009. $("#jyReqHis").text(mzBlRecord.emrHpi);
  13010. var tz = getTz(mzBlRecord);
  13011. $("#jcReqTz").text(tz);
  13012. $("#jcReqReqDept").text(res.data.deptName);
  13013. $("#jcReqReqDoctor").text(res.data.doctorName);
  13014. $("#jyReqTz").text(tz);
  13015. $("#jyReqReqDept").text(res.data.deptName);
  13016. $("#jyReqReqDoctor").text(res.data.doctorName);
  13017. //检验报告列表名
  13018. 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><th style="min-height: 30px;border-bottom: 1px solid black;">单号</th></tr>';
  13019. var jyContent = "";
  13020. var needNewPageA = false;
  13021. for (var i = 0; i < res.data.mzYjReqList.length; i++) {
  13022. var obj = res.data.mzYjReqList[i];
  13023. if (i == 0) {
  13024. var dateStr = format(obj.reqDate, "yyyy-MM-dd");
  13025. $("#jcReqReqDate").text(dateStr);
  13026. $("#jyReqReqDate").text(dateStr);
  13027. }
  13028. if (obj.reqType == "3") {
  13029. if (i > 0) {
  13030. LODOP.NewPageA();
  13031. }
  13032. JsBarcode("#JcBarcode", obj.reqNo, {
  13033. lineColor: '#000000', //线条颜色
  13034. width: 1, //线宽
  13035. height: 26, //条码高度
  13036. displayValue: false, //是否显示文字信息
  13037. });
  13038. $("#reqNoJcReq").text(obj.reqNo);
  13039. $("#jcReqItem").text(obj.groupName);
  13040. $("#jcReqRemark").text(obj.jyRemark);
  13041. $("#jcComment8").text(obj.comment8);
  13042. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
  13043. needNewPageA = true;
  13044. } else if (obj.reqType == "2") {
  13045. let inspectName = (obj.inspectName == null || obj.inspectName == "null") ? "" : obj.inspectName;
  13046. jyContent += '<tr><td>' + obj.execName + '</td><td style="min-height: 30px;">' + obj.groupName + '</td><td>' + inspectName + '</td><td>' + obj.reqNo + '</td></tr>';
  13047. JsBarcode("#JyBarcode", obj.reqNo, {
  13048. lineColor: '#000000', //线条颜色
  13049. width: 1, //线宽
  13050. height: 26, //条码高度
  13051. displayValue: false, //是否显示文字信息
  13052. });
  13053. }
  13054. }
  13055. if (jyContent != null && jyContent != "" && jyContent.length > 0) {
  13056. if (needNewPageA) {
  13057. LODOP.NewPageA();
  13058. }
  13059. jyContent = jyTitle + jyContent;
  13060. $("#jyContent").html(jyContent);
  13061. //检验
  13062. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jy_card_table").innerHTML);
  13063. }
  13064. if (printType == 1) {
  13065. LODOP.PREVIEW();
  13066. } else if (printType == 2) {
  13067. LODOP.PRINT_SETUP();
  13068. }
  13069. } else {
  13070. errorMesage(res);
  13071. }
  13072. }
  13073. });
  13074. }
  13075. /**
  13076. * 打印门诊病历
  13077. * @param patientId
  13078. * @param times
  13079. * @param clnicId
  13080. * @param payMark
  13081. * @param printType 打印模式 1 预览打印 2 打印设置
  13082. */
  13083. function printBlRecord(patientId, times, printType) {
  13084. if(printType == 1){
  13085. saveMzPrescriptionPrint(patientId,times)
  13086. }
  13087. $.ajax({
  13088. type: "GET",
  13089. url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times,
  13090. contentType: "application/json;charset=UTF-8",
  13091. dataType: "json",
  13092. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13093. success: function (res) {
  13094. if (res == '401' || res == 401) {
  13095. window.location.href = '/thmz/login/view'
  13096. return;
  13097. }
  13098. if (res.code == 0) {
  13099. setPrint();
  13100. LODOP = getLodop();
  13101. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"门诊病历");
  13102. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  13103. //设置默认打印机
  13104. LODOP.SET_PRINTER_INDEX(printIndex);
  13105. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  13106. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  13107. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  13108. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊病历");//对新建的纸张重命名
  13109. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  13110. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  13111. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  13112. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  13113. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  13114. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  13115. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  13116. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  13117. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  13118. var mzPatientMi = res.mzPatientMi;
  13119. $("#patientIdBlrecord").text(mzPatientMi.patientId);
  13120. $("#patientNameBlrecord").text(mzPatientMi.name);
  13121. $("#patientGenderBlrecord").text(mzPatientMi.gender);
  13122. $("#patientAgeBlrecord").text(mzPatientMi.ageString);
  13123. var mzBlRecord = res.mzBlRecord;
  13124. if (mzBlRecord.firstOrNot == "1") {
  13125. $("#firstOrNotTitle").text("复诊");
  13126. } else {
  13127. $("#firstOrNotTitle").text("初诊");
  13128. }
  13129. if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
  13130. $("#emrChiefComplaintBlrecord").text(mzBlRecord.emrChiefComplaint);
  13131. $("#emrChiefComplaintBlrecord").parent().css("display", "block");
  13132. } else {
  13133. $("#emrChiefComplaintBlrecord").parent().css("display", "none");
  13134. }
  13135. if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
  13136. $("#emrHpiBlrecord").text(mzBlRecord.emrHpi);
  13137. $("#emrHpiBlrecord").parent().css("display", "block");
  13138. } else {
  13139. $("#emrHpiBlrecord").parent().css("display", "none");
  13140. }
  13141. if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
  13142. $("#emrPsBlrecord").text(mzBlRecord.emrPs);
  13143. $("#emrPsBlrecord").parent().css("display", "block");
  13144. } else {
  13145. $("#emrPsBlrecord").parent().css("display", "none");
  13146. }
  13147. if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
  13148. $("#personalHistoryBlrecord").text(mzBlRecord.personalHistory);
  13149. $("#personalHistoryBlrecord").parent().css("display", "block");
  13150. } else {
  13151. $("#personalHistoryBlrecord").parent().css("display", "none");
  13152. }
  13153. if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
  13154. $("#familyHistoryBlrecord").text(mzBlRecord.familyHistory);
  13155. $("#familyHistoryBlrecord").parent().css("display", "block");
  13156. } else {
  13157. $("#familyHistoryBlrecord").parent().css("display", "none");
  13158. }
  13159. if (mzBlRecord.fzZl != null && mzBlRecord.fzZl != "") {
  13160. $("#fzZlBlrecord").text(mzBlRecord.fzZl);
  13161. $("#fzZlBlrecord").parent().css("display", "block");
  13162. } else {
  13163. $("#fzZlBlrecord").parent().css("display", "none");
  13164. }
  13165. if (mzBlRecord.crbHistory != null && mzBlRecord.crbHistory != "") {
  13166. $("#crbHistoryBlrecord").text(mzBlRecord.crbHistory);
  13167. } else {
  13168. $("#crbHistoryBlrecord").text('无');
  13169. }
  13170. if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
  13171. $("#obstericalHistoryBlrecord").text(mzBlRecord.obstericalHistory);
  13172. $("#obstericalHistoryBlrecord").parent().css("display", "block");
  13173. } else {
  13174. $("#obstericalHistoryBlrecord").parent().css("display", "none");
  13175. }
  13176. var patientAllergenInfoList = res.patientAllergenInfoList;
  13177. if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
  13178. var zdAllergen = null;
  13179. for (var i = 0; i < patientAllergenInfoList.length; i++) {
  13180. var patientAllergenInfo = patientAllergenInfoList[i];
  13181. if (zdAllergen == null) {
  13182. zdAllergen = patientAllergenInfo.allergenName;
  13183. } else {
  13184. zdAllergen += "," + patientAllergenInfo.allergenName;
  13185. }
  13186. }
  13187. $("#zdAllergenBlrecord").text(zdAllergen);
  13188. } else {
  13189. $("#zdAllergenBlrecord").text('无');
  13190. }
  13191. var tz = getTz(mzBlRecord);
  13192. if (tz != null && tz != "") {
  13193. $("#emrPeBlrecord").text(tz);
  13194. $("#emrPeBlrecord").parent().css("display", "block");
  13195. } else {
  13196. $("#emrPeBlrecord").parent().css("display", "none");
  13197. }
  13198. // if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
  13199. // $("#emrPeBlrecord").text(mzBlRecord.emrPe);
  13200. // $("#emrPeBlrecord").parent().css("display", "block");
  13201. // } else {
  13202. // $("#emrPeBlrecord").parent().css("display", "none");
  13203. // }
  13204. if (res.icdText != null && res.icdText != "") {
  13205. $("#icdTextBlrecord").text(res.icdText);
  13206. $("#icdTextBlrecord").parent().css("display", "block");
  13207. } else {
  13208. $("#icdTextBlrecord").parent().css("display", "none");
  13209. }
  13210. if (mzBlRecord.tcmIcdText != null && mzBlRecord.tcmIcdText != "") {
  13211. $("#tcmIcdTextBlrecord").text(mzBlRecord.tcmIcdText);
  13212. } else {
  13213. $("#tcmIcdTextBlrecord").text("无");
  13214. }
  13215. if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
  13216. $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
  13217. $("#emrProcessBlrecord").parent().css("display", "block");
  13218. } else {
  13219. $("#emrProcessBlrecord").parent().css("display", "none");
  13220. }
  13221. if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
  13222. $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
  13223. $("#emrJkjyBlrecord").parent().css("display", "block");
  13224. } else {
  13225. $("#emrJkjyBlrecord").parent().css("display", "none");
  13226. }
  13227. $("#visitDeptBlrecord").text(res.deptName);
  13228. $("#visitDateBlrecord").text(res.visitDate);
  13229. getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzBlRecord.doctorCode},false,function (hostRes) {
  13230. if(hostRes.code ==0){
  13231. $("#doctorSignBlrecord").html("<img src='" + hostRes.data + "' style='width:150px;height:25px;'/>")
  13232. }
  13233. })
  13234. //LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
  13235. //上边距 左边距 宽 高
  13236. LODOP.ADD_PRINT_HTM("20mm", "5mm", "130mm", "168mm", strStyle + document.getElementById("mz_bl_content").innerHTML);
  13237. LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
  13238. LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "20mm", strStyle + document.getElementById("mz_bl_title").innerHTML);
  13239. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  13240. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  13241. LODOP.ADD_PRINT_HTM("190mm", "5mm", "130mm", "20mm", strStyle + document.getElementById("mz_bl_foot").innerHTML);
  13242. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  13243. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  13244. if (printType == 1) {
  13245. LODOP.PREVIEW();
  13246. } else if (printType == 2) {
  13247. LODOP.PRINT_SETUP();
  13248. }
  13249. } else {
  13250. errorMesage(res);
  13251. }
  13252. }
  13253. });
  13254. }
  13255. /**
  13256. * 打印入院通知单
  13257. * @param patientId
  13258. * @param times
  13259. * @param clnicId
  13260. * @param payMark
  13261. * @param printType 打印模式 1 预览打印 2 打印设置
  13262. */
  13263. function printZyReq(patientId, printType) {
  13264. $.ajax({
  13265. type: "GET",
  13266. url: '/thmz/printZyReq?patientId=' + patientId,
  13267. contentType: "application/json;charset=UTF-8",
  13268. dataType: "json",
  13269. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13270. success: function (res) {
  13271. if (res == '401' || res == 401) {
  13272. window.location.href = '/thmz/login/view'
  13273. return;
  13274. }
  13275. if (res.code == 0) {
  13276. setPrint();
  13277. LODOP = getLodop();
  13278. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"入院通知单");
  13279. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  13280. //设置默认打印机
  13281. LODOP.SET_PRINTER_INDEX(printIndex);
  13282. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  13283. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  13284. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  13285. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
  13286. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  13287. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  13288. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  13289. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  13290. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  13291. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  13292. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  13293. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  13294. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  13295. var mzPatientMi = res.mzPatientMi;
  13296. var mzZyReq = res.mzZyReq;
  13297. $("#patientIdZyReq").text(mzPatientMi.patientId);
  13298. $("#patientNameZyReq").text(mzPatientMi.name);
  13299. $("#patientGenderZyReq").text(mzPatientMi.gender);
  13300. $("#patientAgeZyReq").text(mzPatientMi.ageString);
  13301. $("#sfzZyReq").text(mzPatientMi.socialNo);
  13302. $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
  13303. $("#phoneZyReq").text(mzPatientMi.phoneNo);
  13304. $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
  13305. $("#addressZyReq").text(mzPatientMi.address);
  13306. if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
  13307. $("#icsCodeZyReq").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  13308. $("#icsTextZyReq").text(mzZyReq.icdText);
  13309. } else {
  13310. $("#icsCodeZyReq").text(mzZyReq.icdCode);
  13311. $("#icsTextZyReq").text(mzZyReq.icdText);
  13312. }
  13313. $("#reqDeptZyReq").text(mzZyReq.reqWardName);
  13314. $("#depositZyReq").text(mzZyReq.deposit);
  13315. $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
  13316. $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
  13317. //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
  13318. // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
  13319. $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
  13320. $(this).removeAttr("checked");
  13321. if ($(this).val() == Number(mzZyReq.admissStatus) || $(this).val() == mzZyReq.admissStatus) {
  13322. $(this).attr("checked", true)
  13323. }
  13324. });
  13325. $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
  13326. $("#deptCodeZyReq").text(mzZyReq.deptName);
  13327. getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
  13328. if(signRes.code == 0){
  13329. $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
  13330. }else {
  13331. $("#doctorCodeZyReq").text(mzZyReq.doctorName);
  13332. }
  13333. })
  13334. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
  13335. if (printType == 1) {
  13336. LODOP.PREVIEW();
  13337. } else if (printType == 2) {
  13338. LODOP.PRINT_SETUP();
  13339. }
  13340. } else {
  13341. errorMesage(res);
  13342. }
  13343. }
  13344. });
  13345. }
  13346. /**
  13347. * 打印门诊手术请单
  13348. * @param patientId
  13349. * @param times
  13350. * @param printType 打印模式 1 预览打印 2 打印设置
  13351. */
  13352. function printOpRecord(patientId, times, printType) {
  13353. $.ajax({
  13354. type: "GET",
  13355. url: '/thmz/printOpRecord?patientId=' + patientId + '&times=' + times,
  13356. contentType: "application/json;charset=UTF-8",
  13357. dataType: "json",
  13358. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13359. success: function (res) {
  13360. if (res == '401' || res == 401) {
  13361. window.location.href = '/thmz/login/view'
  13362. return;
  13363. }
  13364. if (res.code == 0) {
  13365. if (res.data == null || res.data.length == 0) {
  13366. errorMesageSimaple("没有手术申请单可以打印");
  13367. return;
  13368. }
  13369. setPrint();
  13370. LODOP = getLodop();
  13371. LODOP.PRINT_INITA(6, 0, "148mm", "210mm",hospitalName+"门诊手术申请单");
  13372. LODOP.SET_PRINT_STYLE("FontSize", 13); //字体大小
  13373. //设置默认打印机
  13374. LODOP.SET_PRINTER_INDEX(printIndex);
  13375. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  13376. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  13377. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  13378. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊手术申请单");//对新建的纸张重命名
  13379. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  13380. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  13381. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  13382. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  13383. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  13384. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  13385. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  13386. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  13387. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  13388. var mzPatientMi = res.mzPatientMi;
  13389. $("#patientIdOpRecord").text(mzPatientMi.patientId);
  13390. $("#patientNameOpRecord").text(mzPatientMi.name);
  13391. $("#patientGenderOpRecord").text(mzPatientMi.gender);
  13392. $("#patientAgeOpRecord").text(mzPatientMi.ageString);
  13393. $("#responseTypeOpRecord").text(mzPatientMi.responseTypeName);
  13394. $("#patientCardNoOpRecord").text(mzPatientMi.icCardNo);
  13395. var needNewPageA = false;
  13396. for (var i = 0; i < res.data.length; i++) {
  13397. var obj = res.data[i];
  13398. //$("#reqNoOpRecord").text(obj.recordId);
  13399. $("#icdTextOpRecord").text(obj.diagBeforeOp);
  13400. $("#opNameOpRecord").text(obj.opName);
  13401. $("#hocusCodeOpRecord").text(obj.hocusCodeName);
  13402. $("#opScaleOpRecord").text(obj.opScaleName);
  13403. var dateStr = format(obj.applyDate, "yyyy-MM-dd HH:mm:ss");
  13404. $("#applyDateOpRecord").text(dateStr);
  13405. $("#opDatetimeOpRecord").text(obj.opDatetimeStr);
  13406. $("#doctorZdOpRecord").text(obj.doctorZdName);
  13407. $("#remarkOpRecord").text(obj.remark);
  13408. if (i > 0) {
  13409. LODOP.NewPageA();
  13410. }
  13411. JsBarcode("#JcBarcode", obj.recordId, {
  13412. lineColor: '#000000', //线条颜色
  13413. width: 1, //线宽
  13414. height: 26, //条码高度
  13415. displayValue: false, //是否显示文字信息
  13416. });
  13417. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("op_record_card_table").innerHTML);
  13418. needNewPageA = true;
  13419. }
  13420. if (printType == 1) {
  13421. LODOP.PREVIEW();
  13422. } else if (printType == 2) {
  13423. LODOP.PRINT_SETUP();
  13424. }
  13425. } else {
  13426. errorMesage(res);
  13427. }
  13428. }
  13429. });
  13430. }
  13431. /**
  13432. * 打开查看检查检验报告窗口(含往期)
  13433. * @param patientId
  13434. */
  13435. function previewYjReqAll(patientId) {
  13436. $("#visitingDetailModal").modal("hide");
  13437. $("#previewYjReqModal").modal();
  13438. $("#previewYjReqModalPatientId").val(patientId);
  13439. $("#previewYjReqModalTimes").val(null);
  13440. //重置参数
  13441. retryCount = 0;
  13442. initJcJyTable();
  13443. }
  13444. /**
  13445. * 打开查看检查检验报告窗口
  13446. * @param patientId 门诊病人ID
  13447. * @param times 就诊次数
  13448. */
  13449. function previewYjReq(patientId, times) {
  13450. $("#visitingDetailModal").modal("hide");
  13451. $("#previewYjReqModal").modal();
  13452. $("#previewYjReqModalPatientId").val(patientId);
  13453. $("#previewYjReqModalTimes").val(times);
  13454. //重置参数
  13455. retryCount = 0;
  13456. initJcJyTable();
  13457. }
  13458. /**
  13459. * 删除本次处方
  13460. * @param clnicId 就诊记录id
  13461. */
  13462. function deletePrescription(clnicId) {
  13463. $("#visitingDetailModal").modal("hide");
  13464. $("#messageModal").modal();
  13465. $("#messageContent").html("确认要删除本次处方信息吗?");
  13466. $("#messageButton").off("click").on("click", function (t) {
  13467. $("#messageModal").modal("hide");
  13468. $.ajax({
  13469. type: "GET",
  13470. url: '/thmz/deletePrescription?clnicId=' + clnicId,
  13471. contentType: "application/json;charset=UTF-8",
  13472. dataType: "json",
  13473. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13474. success: function (res) {
  13475. if (res == '401' || res == 401) {
  13476. window.location.href = '/thmz/login/view'
  13477. return;
  13478. }
  13479. if (res.code == 0) {
  13480. successMesage(res);
  13481. $("#tb_table_clinic").bootstrapTable('refresh');
  13482. } else {
  13483. errorMesage(res);
  13484. }
  13485. }
  13486. });
  13487. });
  13488. $("#cancelButton").off("click").on("click", function (t) {
  13489. $("#visitingDetailModal").modal();
  13490. });
  13491. ;
  13492. }
  13493. /**
  13494. * 检查检验列表类型按钮切换事件
  13495. * @param object
  13496. */
  13497. function jcjyButtonChange(object) {
  13498. $("#jcjy_group").find("button").each(function (index, element) {
  13499. if ($(element).hasClass("btn-primary")) {
  13500. $(element).removeClass("btn-primary").addClass("btn-default");
  13501. }
  13502. });
  13503. $(object).removeClass("btn-default").addClass("btn-primary");
  13504. initJcJyTable();
  13505. }
  13506. /**
  13507. * 初始化检查检验报告列表
  13508. */
  13509. function initJcJyTable() {
  13510. clearInspectionDetail();
  13511. clearJcDetail();
  13512. var typeIndex = getIndex("jcjy_group");
  13513. if (typeIndex == 0) {
  13514. //检查
  13515. $('#tb_jy_pName_table_list').bootstrapTable("destroy");
  13516. $('#tb_jy_table_list').bootstrapTable("destroy");
  13517. initJcListTable();
  13518. $("#jy_detail").removeClass("in").addClass("hide");
  13519. $("#jc_detail").removeClass("hide").addClass("in");
  13520. } else {
  13521. $('#tb_table_list').bootstrapTable("destroy");
  13522. initJyListTable();
  13523. $("#jc_detail").removeClass("in").addClass("hide");
  13524. $("#jy_detail").removeClass("hide").addClass("in");
  13525. }
  13526. }
  13527. /**
  13528. * 初始化检查报告列表
  13529. */
  13530. function initJcListTable() {
  13531. $('#tb_table_list').bootstrapTable("destroy");
  13532. $('#tb_table_list').bootstrapTable({
  13533. url: '/thmz/getJcJyList', //请求后台的URL(*)
  13534. method: 'post', //请求方式(*)
  13535. toolbar: '#toolbar', //工具按钮用哪个容器
  13536. striped: true, //是否显示行间隔色
  13537. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  13538. pagination: true, //是否显示分页(*)
  13539. sortable: true, //是否启用排序
  13540. sortOrder: "asc", //排序方式
  13541. queryParams: queryParams, //传递参数(*)
  13542. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  13543. pageNumber: 1, //初始化加载第一页,默认第一页
  13544. pageSize: 5, //每页的记录行数(*)
  13545. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  13546. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  13547. strictSearch: true,
  13548. showColumns: false, //是否显示所有的列
  13549. showRefresh: false, //是否显示刷新按钮
  13550. minimumCountColumns: 2, //最少允许的列数
  13551. clickToSelect: true, //是否启用点击选中行
  13552. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  13553. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  13554. cardView: false, //是否显示详细视图
  13555. detailView: false,
  13556. //rowStyle:rowStyle,//通过自定义函数设置行样式
  13557. ajaxOptions: {
  13558. headers: {
  13559. 'Accept': 'application/json',
  13560. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  13561. }
  13562. },
  13563. columns: [
  13564. {
  13565. field: 'groupName',
  13566. title: '项目名称',
  13567. align: "center",
  13568. valign: 'middle',
  13569. }, {
  13570. field: 'reqDate',
  13571. title: '申请时间',
  13572. align: "center",
  13573. valign: 'middle',
  13574. formatter: function (value, row, index) {
  13575. if (value == null || value == "") {
  13576. return "";
  13577. }
  13578. return format(value, "yyyy-MM-dd HH:mm:ss");
  13579. }
  13580. }
  13581. ],
  13582. onClickRow: function (row) {
  13583. clearJcDetail();
  13584. $("#patientId_t").text(row.patientId);
  13585. $("#name_t").text(row.patientName);
  13586. $("#date_t").text(format(row.reqDate, "yyyy-MM-dd HH:mm:ss"));
  13587. fitJcDetail(row.reqNo, row.patientId);
  13588. },
  13589. responseHandler: function (res) {
  13590. if (res == '401' || res == 401) {
  13591. window.location.href = '/thmz/login/view'
  13592. return;
  13593. }
  13594. var ress = eval(res);
  13595. if (ress.code == -1) {
  13596. if (ress.message != null && ress.message != '') {
  13597. errorMesage(ress);
  13598. }
  13599. if (retryCount == 0) {
  13600. retryCount++;
  13601. $("#jyButton").click();
  13602. return;
  13603. }
  13604. return {
  13605. "total": 0,//总页数
  13606. "rows": {} //数据
  13607. };
  13608. }
  13609. if (ress.count <= 0 && retryCount == 0) {
  13610. retryCount++;
  13611. $("#jyButton").click();
  13612. return;
  13613. }
  13614. //有数据的时候,计数也需要加1,防止这时医生自己候点击检验没数据又跳回检查
  13615. retryCount++;
  13616. return {
  13617. "total": ress.count,//总页数
  13618. "rows": ress.data //数据
  13619. };
  13620. },
  13621. onLoadSuccess: function (data) {
  13622. $(".pagination-detail").css("display", "none");
  13623. }
  13624. });
  13625. }
  13626. /**
  13627. * 构建列表查询参数
  13628. * @param params
  13629. * @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}}
  13630. */
  13631. function queryParams(params) {
  13632. var patientId = $("#previewYjReqModalPatientId").val();
  13633. var times = $("#previewYjReqModalTimes").val();
  13634. return {
  13635. reqType: "3",
  13636. patientId: patientId,
  13637. times: times,
  13638. pageSize: params.limit, //页面大小
  13639. pageIndex: params.offset / params.limit //页码
  13640. };
  13641. };
  13642. /**
  13643. * 加载检查明细
  13644. * @param reqNo
  13645. */
  13646. function fitJcDetail(reqNo, patientId) {
  13647. $.ajax({
  13648. type: "GET",
  13649. url: '/thmz/getYjJcRecordReport?hisReqNo=' + reqNo + "&patientId=" + patientId,
  13650. contentType: "application/json;charset=UTF-8",
  13651. dataType: "json",
  13652. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13653. success: function (res) {
  13654. if (res == '401' || res == 401) {
  13655. window.location.href = '/thmz/login/view'
  13656. return;
  13657. }
  13658. if (res.code == 0) {
  13659. canBePrintJc = true;
  13660. $("#jy_detail").removeClass("in").addClass("hide");
  13661. $("#jc_detail").removeClass("hide").addClass("in");
  13662. var mzPatientMi = res.data.mzPatientMi;
  13663. $("#gender_jc").text(mzPatientMi.gender);
  13664. $("#age_jc").text(mzPatientMi.ageString);
  13665. var yjJcRecordReport = res.data.yjJcRecordReport;
  13666. $("#groupName").text(res.data.groupName);
  13667. $("#textJc").text(yjJcRecordReport.textJc);
  13668. $("#textZd").text(yjJcRecordReport.textZd);
  13669. var jcRecord = res.data.jcRecord;
  13670. $("#report_no").text(jcRecord.reportNo);
  13671. $("#reportId").text(jcRecord.reportId);
  13672. if (jcRecord.reportDate == null || jcRecord.reportDate == "") {
  13673. $("#reportDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  13674. } else {
  13675. $("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
  13676. }
  13677. $("#confirmId").text(jcRecord.confirmId);
  13678. if (jcRecord.confirmDate == null || jcRecord.confirmDate == "") {
  13679. $("#confirmDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  13680. } else {
  13681. $("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
  13682. }
  13683. } else {
  13684. errorMesage(res);
  13685. }
  13686. }
  13687. });
  13688. }
  13689. /**
  13690. * 清空检查明细
  13691. * @param reqNo
  13692. */
  13693. function clearJcDetail() {
  13694. canBePrintJc = false;
  13695. $("#patientId_t").text("");
  13696. $("#name_t").text("");
  13697. $("#date_t").text("");
  13698. $("#gender_jc").text("");
  13699. $("#age_jc").text("");
  13700. $("#groupName").text("");
  13701. $("#textJc").text("");
  13702. $("#textZd").text("");
  13703. $("#report_no").text("");
  13704. $("#reportId").text("");
  13705. $("#reportDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  13706. $("#confirmId").text("");
  13707. $("#confirmDate").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  13708. }
  13709. /**
  13710. * 初始化检验报告列表
  13711. */
  13712. function initJyListTable() {
  13713. var patientId = $("#previewYjReqModalPatientId").val();
  13714. var times = $("#previewYjReqModalTimes").val();
  13715. $('#tb_table_list').bootstrapTable("destroy");
  13716. $('#tb_table_list').bootstrapTable({
  13717. url: '/thmz/getJyListByPatientIdAndTimes?patientId=' + patientId + "&times=" + times, //请求后台的URL(*)
  13718. method: 'get', //请求方式(*)
  13719. toolbar: '#toolbar', //工具按钮用哪个容器
  13720. striped: true, //是否显示行间隔色
  13721. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  13722. pagination: true, //是否显示分页(*)
  13723. sortable: true, //是否启用排序
  13724. sortOrder: "asc", //排序方式
  13725. //queryParams: queryJyPNameParams, //传递参数(*)
  13726. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  13727. pageNumber: 1, //初始化加载第一页,默认第一页
  13728. pageSize: 5, //每页的记录行数(*)
  13729. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  13730. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  13731. strictSearch: true,
  13732. showColumns: false, //是否显示所有的列
  13733. showRefresh: false, //是否显示刷新按钮
  13734. minimumCountColumns: 2, //最少允许的列数
  13735. clickToSelect: true, //是否启用点击选中行
  13736. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  13737. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  13738. cardView: false, //是否显示详细视图
  13739. detailView: false,
  13740. //rowStyle:rowStyle,//通过自定义函数设置行样式
  13741. ajaxOptions: {
  13742. headers: {
  13743. 'Accept': 'application/json',
  13744. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  13745. }
  13746. },
  13747. columns: [
  13748. {
  13749. field: 'aply_CTNT',
  13750. title: '检验名称',
  13751. align: "center",
  13752. valign: 'middle',
  13753. }, {
  13754. field: 'ordr_CREATE_DATE',
  13755. title: '检验时间',
  13756. align: "center",
  13757. valign: 'middle',
  13758. formatter: function (value, row, index) {
  13759. if (value == null || value == "") {
  13760. return "";
  13761. }
  13762. return format(value, "yyyy-MM-dd HH:mm:ss");
  13763. }
  13764. }
  13765. ],
  13766. onClickRow: function (row) {
  13767. queryInspectionDetail(row.ordr_ID);
  13768. },
  13769. responseHandler: function (res) {
  13770. if (res == '401' || res == 401) {
  13771. window.location.href = '/thmz/login/view'
  13772. return;
  13773. }
  13774. var ress = eval(res);
  13775. if (ress.code == -1) {
  13776. if (retryCount == 0) {
  13777. retryCount++;
  13778. $("#jcButton").click();
  13779. return;
  13780. }
  13781. if (ress.message != null && ress.message != '') {
  13782. errorMesage(ress);
  13783. }
  13784. return {
  13785. "total": ress.data.length,//总页数
  13786. "rows": ress.data //数据
  13787. };
  13788. }
  13789. if (ress.data.length <= 0 && retryCount == 0) {
  13790. retryCount++;
  13791. $("#jcButton").click();
  13792. return;
  13793. }
  13794. //有数据的时候,计数也需要加1,防止这时医生自己候点击检查没数据又跳回检验
  13795. retryCount++;
  13796. return {
  13797. "total": ress.data.length,//总页数
  13798. "rows": ress.data //数据
  13799. };
  13800. },
  13801. onLoadSuccess: function (data) {
  13802. $("#jy_table_table_div").find(".pagination-detail").css("display", "none");
  13803. }
  13804. });
  13805. }
  13806. /**
  13807. * 清空检验明细
  13808. * @param orderId
  13809. */
  13810. function clearInspectionDetail() {
  13811. canBePrintJy = false;
  13812. $("#patientId_t_jy").text("");
  13813. $("#name_t_jy").text("");
  13814. $("#gender_jy").text("");
  13815. $("#age_jy").text("");
  13816. $("#reqDept_t_jy").text("");
  13817. $("#bed_no_jy").text("");
  13818. $("#smpl_jy").text("");
  13819. $("#item_jy").text("");
  13820. $("#applyDate").text("");
  13821. $("#orderCreateDate").text("");
  13822. $("#auditTime").text("");
  13823. $("#orderUsrName").text("");
  13824. $("#testUsrName").text("");
  13825. $("#auditUsrName").text("");
  13826. $("#jyBody").html("");
  13827. }
  13828. /**
  13829. * 加载检验明细
  13830. * @param orderId
  13831. */
  13832. function queryInspectionDetail(orderId) {
  13833. clearInspectionDetail();
  13834. $.ajax({
  13835. type: "GET",
  13836. url: '/thmz/getInspectionDetail?orderId=' + orderId,
  13837. contentType: "application/json;charset=UTF-8",
  13838. dataType: "json",
  13839. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  13840. success: function (res) {
  13841. if (res == '401' || res == 401) {
  13842. window.location.href = '/thmz/login/view'
  13843. return;
  13844. }
  13845. if (res.code == 0) {
  13846. canBePrintJy = true;
  13847. $("#jc_detail").removeClass("in").addClass("hide");
  13848. $("#jy_detail").removeClass("hide").addClass("in");
  13849. var mzPatientMi = res.mzPatientMi;
  13850. $("#patientId_t_jy").text(mzPatientMi.patientId);
  13851. $("#name_t_jy").text(mzPatientMi.name);
  13852. $("#gender_jy").text(mzPatientMi.gender);
  13853. $("#age_jy").text(mzPatientMi.ageString);
  13854. var html = "";
  13855. if (res.data != null) {
  13856. var inspectionHeader = res.data.inspectionHeader;
  13857. $("#reqDept_t_jy").text(inspectionHeader.dept_NAME);
  13858. $("#bed_no_jy").text(inspectionHeader.ptnt_BED_NO);
  13859. $("#smpl_jy").text(inspectionHeader.smpl_NAME);
  13860. $("#item_jy").text(inspectionHeader.aply_CNTN);
  13861. $("#applyDate").text(format(inspectionHeader.aply_DATE, "yyyy-MM-dd HH:mm:ss"));
  13862. $("#orderCreateDate").text(format(inspectionHeader.ordr_CREATE_DATE, "yyyy-MM-dd HH:mm:ss"));
  13863. $("#auditTime").text(format(inspectionHeader.audt_TIME, "yyyy-MM-dd HH:mm:ss"));
  13864. $("#orderUsrName").text(inspectionHeader.doc_NAME);
  13865. $("#testUsrName").text(inspectionHeader.test_USR_NAME);
  13866. $("#auditUsrName").text(inspectionHeader.audt_USR_NAME);
  13867. var inspectionItems = res.data.inspectionItems;
  13868. if (inspectionItems != null && inspectionItems.length > 0) {
  13869. for (var i = 0; i < inspectionItems.length; i++) {
  13870. html += "<tr>";
  13871. var obj = inspectionItems[i];
  13872. var itm_VALUE = obj.itm_VALUE;
  13873. if (itm_VALUE == null || itm_VALUE == "null") {
  13874. itm_VALUE = "";
  13875. }
  13876. itm_VALUE += (obj.itm_STR_VALUE == null || obj.itm_STR_VALUE == "null") ? "" : obj.itm_STR_VALUE;
  13877. var range = obj.range;
  13878. if (range == null || range == "null") {
  13879. range = "";
  13880. }
  13881. range += (obj.range_STR == null || obj.range_STR == "null") ? "" : obj.range_STR;
  13882. html += "<td width='25%'>" + obj.itm_NAME + "</td>";
  13883. html += "<td width='16.66%'>" + itm_VALUE + "</td>";
  13884. html += "<td width='16.66%'>" + obj.itm_UNIT + "</td>";
  13885. if (obj.itm_ALERT == null || obj.itm_ALERT == "") {
  13886. html += "<td width='16.66%'><span style=\"color:#67C23A;font-weight:bold\"></span></td>";
  13887. } else if (obj.itm_ALERT == "H") {
  13888. html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↑</span></td>";
  13889. } else if (obj.itm_ALERT == "L") {
  13890. html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↓</span></td>";
  13891. }
  13892. html += "<td width='25%'>" + range + "</td>";
  13893. html += "</tr>";
  13894. var bacteriaResults = obj.bacteriaResults;
  13895. if (bacteriaResults == null || bacteriaResults.length == 0) {
  13896. continue;
  13897. }
  13898. var bacteriaResult = bacteriaResults[0];
  13899. if (bacteriaResult == null || bacteriaResult.length == 0) {
  13900. continue;
  13901. }
  13902. var antibioticResults = bacteriaResult.antibioticResults;
  13903. if (antibioticResults == null || antibioticResults.length == 0) {
  13904. continue;
  13905. }
  13906. 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>';
  13907. for (var j = 0; j < antibioticResults.length; j++) {
  13908. var antibioticResultsObj = antibioticResults[j];
  13909. html += "<tr>";
  13910. html += "<td width='35%' style='padding-left: 2%;";
  13911. if (j == 0) {
  13912. html += "border-top: 1px solid black;";
  13913. }
  13914. html += "'>" + antibioticResultsObj.anti_NAME_CN + "</td>";
  13915. html += "<td width='20%' ";
  13916. if (j == 0) {
  13917. html += "style='border-top: 1px solid black;'";
  13918. }
  13919. html += ">" + antibioticResultsObj.anti_ABB + "</td>";
  13920. html += "<td width='25%' ";
  13921. if (j == 0) {
  13922. html += "style='border-top: 1px solid black;'";
  13923. }
  13924. html += ">" + antibioticResultsObj.anti_MIC + "</td>";
  13925. html += "<td width='20%' style='padding-right: 2%;";
  13926. if (j == 0) {
  13927. html += "border-top: 1px solid black;";
  13928. }
  13929. html += "'>" + antibioticResultsObj.anti_VALUE + "</td>";
  13930. html += "</tr>";
  13931. }
  13932. }
  13933. }
  13934. }
  13935. $("#jyBody").html(html);
  13936. } else {
  13937. errorMesage(res);
  13938. }
  13939. }
  13940. });
  13941. }
  13942. /**
  13943. * 打印检查检验报告单
  13944. * @param printType 打印模式 1 预览打印 2 打印设置
  13945. */
  13946. function printJyJcReport(printType) {
  13947. var typeIndex = getIndex("jcjy_group");
  13948. var title = "检查报告单";
  13949. if (typeIndex == 1) {
  13950. title = "检验报告单"
  13951. if (!canBePrintJy) {
  13952. warningMesageSimaple("没有任何【" + title + "】可供打印!");
  13953. return;
  13954. }
  13955. } else {
  13956. if (!canBePrintJc) {
  13957. warningMesageSimaple("没有任何【" + title + "】可供打印!");
  13958. return;
  13959. }
  13960. }
  13961. setPrint();
  13962. LODOP = getLodop();
  13963. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
  13964. LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
  13965. //设置默认打印机
  13966. LODOP.SET_PRINTER_INDEX(printIndex);
  13967. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  13968. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  13969. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  13970. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
  13971. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  13972. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  13973. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  13974. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  13975. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  13976. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  13977. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  13978. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  13979. var strStyle = "<style>table{width: 96%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
  13980. if (typeIndex == 0) {
  13981. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_detail").innerHTML);
  13982. }
  13983. if (typeIndex == 1) {
  13984. LODOP.ADD_PRINT_TABLE("37mm", "5mm", "130mm", "138mm", strStyle + document.getElementById("jy_detail_content").innerHTML);
  13985. LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
  13986. LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_title").innerHTML);
  13987. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  13988. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  13989. LODOP.ADD_PRINT_HTM("177mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_foot").innerHTML);
  13990. LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
  13991. LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
  13992. }
  13993. if (printType == 1) {
  13994. LODOP.PREVIEW();
  13995. } else if (printType == 2) {
  13996. LODOP.PRINT_SETUP();
  13997. }
  13998. }
  13999. /**
  14000. * 初始化科室下拉选
  14001. */
  14002. function initExecUnit() {
  14003. //父科室列表
  14004. $.ajax({
  14005. type: "GET",
  14006. url: '/thmz/allUnitCode',
  14007. dataType: "json",
  14008. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14009. success: function (data) {
  14010. if (data == '401' || data == 401) {
  14011. window.location.href = '/thmz/login/view'
  14012. return;
  14013. }
  14014. var html = '';
  14015. $.each(data.data, function (commentIndex, comment) {
  14016. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
  14017. });
  14018. $('#execUnit').empty(); //清空resText里面的所有内容
  14019. $('#zlExecUnit').empty(); //清空resText里面的所有内容
  14020. $('#execUnit').html(html);
  14021. $('#execUnit').selectpicker('refresh');
  14022. $('#zlExecUnit').html(html);
  14023. $('#zlExecUnit').selectpicker('refresh');
  14024. $('#execUnit').selectpicker('val', null);
  14025. $('#zlExecUnit').selectpicker('val', null);
  14026. }
  14027. });
  14028. }
  14029. /**
  14030. * 初始化证件类型下拉选
  14031. */
  14032. function initCertificateTypeSelect() {
  14033. $.ajax({
  14034. type: "GET",
  14035. url: '/thmz/listCertificateType',
  14036. contentType: "application/json;charset=UTF-8",
  14037. dataType: "json",
  14038. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14039. success: function (res) {
  14040. if (res == '401' || res == 401) {
  14041. window.location.href = '/thmz/login/view'
  14042. return;
  14043. }
  14044. if (res.code == 0) {
  14045. res.data.forEach(function (item, index) {
  14046. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  14047. $('#rapidAcceptsUserCertificateType').append(html);
  14048. $('#editUserCertificateType').append(html);
  14049. $('#crbMainCardCertificateType').append(html);
  14050. });
  14051. $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
  14052. $('#editUserCertificateType').selectpicker('refresh');
  14053. $('#crbMainCardCertificateType').selectpicker('refresh');
  14054. } else {
  14055. errorMesage(res);
  14056. }
  14057. }
  14058. });
  14059. }
  14060. /**
  14061. * 加载病历信息编辑预览
  14062. * @param patientId
  14063. * @param times
  14064. * @param type 1 编辑 2 预览
  14065. */
  14066. function showMzBlRecordModal(patientId, times, type) {
  14067. $.ajax({
  14068. type: "GET",
  14069. url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times+'&type='+type,
  14070. contentType: "application/json;charset=UTF-8",
  14071. dataType: "json",
  14072. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14073. success: function (res) {
  14074. if (res == '401' || res == 401) {
  14075. window.location.href = '/thmz/login/view'
  14076. return;
  14077. }
  14078. if (res.code == 0) {
  14079. var mzPatientMi = res.mzPatientMi;
  14080. $("#editPatientId").text(mzPatientMi.patientId);
  14081. $("#editPatientName").text(mzPatientMi.name);
  14082. $("#editPatientGender").text(mzPatientMi.gender);
  14083. $("#editPatientAge").text(mzPatientMi.ageString);
  14084. var mzBlRecord = res.mzBlRecord;
  14085. $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint == null ? "" : mzBlRecord.emrChiefComplaint);
  14086. $("#editEmrHpi").val(mzBlRecord.emrHpi == null ? "" : mzBlRecord.emrHpi);
  14087. $("#editEmrPs").val(mzBlRecord.emrPs == null ? "" : mzBlRecord.emrPs);
  14088. $("#editPersonalHistory").val(mzBlRecord.personalHistory == null ? "" : mzBlRecord.personalHistory);
  14089. $("#editFamilyHistory").val(mzBlRecord.familyHistory == null ? "" : mzBlRecord.familyHistory);
  14090. $("#editFzZl").val(mzBlRecord.fzZl == null ? "" : mzBlRecord.fzZl);
  14091. $("#editCrbHistory").val(mzBlRecord.crbHistory == null ? "" : mzBlRecord.crbHistory);
  14092. $("#editObstericalHistory").val(mzBlRecord.obstericalHistory == null ? "" : mzBlRecord.obstericalHistory);
  14093. $("#editQtjc").val(mzBlRecord.emrPe == null ? "" : mzBlRecord.emrPe);
  14094. setSelectedAttr("editZd", mzBlRecord.icdCode, mzBlRecord.icdText);
  14095. setSelectedAttr("editTcmZd", mzBlRecord.tcmIcdCode, mzBlRecord.tcmIcdText);
  14096. var patientAllergenInfoList = res.patientAllergenInfoList;
  14097. if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
  14098. var zdAllergen = [];
  14099. var ypDitList = [];
  14100. var zdAllergenHtml = '';
  14101. var ypDitListHtml = '';
  14102. var zdAllergeCodes = null;
  14103. var zdAllergeTexts = null;
  14104. var ypDitListodes = null;
  14105. var ypDitListTexts = null;
  14106. for (var i = 0; i < patientAllergenInfoList.length; i++) {
  14107. var patientAllergenInfo = patientAllergenInfoList[i];
  14108. if (patientAllergenInfo.type == 0 || patientAllergenInfo.type == '0') {
  14109. zdAllergen[zdAllergen.length] = patientAllergenInfo.allergenCode;
  14110. zdAllergenHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
  14111. if (zdAllergeCodes == null) {
  14112. zdAllergeCodes = patientAllergenInfo.allergenCode;
  14113. zdAllergeTexts = patientAllergenInfo.allergenName;
  14114. } else {
  14115. zdAllergeCodes += "," + patientAllergenInfo.allergenCode;
  14116. zdAllergeTexts += "," + patientAllergenInfo.allergenName;
  14117. }
  14118. } else if (patientAllergenInfo.type == 1 || patientAllergenInfo.type == '1') {
  14119. ypDitList[ypDitList.length] = patientAllergenInfo.allergenCode;
  14120. ypDitListHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
  14121. if (zdAllergeCodes == null) {
  14122. ypDitListodes = patientAllergenInfo.allergenCode;
  14123. ypDitListTexts = patientAllergenInfo.allergenName;
  14124. } else {
  14125. ypDitListodes += "," + patientAllergenInfo.allergenCode;
  14126. ypDitListTexts += "," + patientAllergenInfo.allergenName;
  14127. }
  14128. }
  14129. }
  14130. $("#editZdAllergen").empty();
  14131. $('#editZdAllergen').append(zdAllergenHtml);
  14132. $('#editZdAllergen').selectpicker('refresh');
  14133. $("#editYpDitList").empty();
  14134. $('#editYpDitList').append(ypDitListHtml);
  14135. $('#editYpDitList').selectpicker('refresh');
  14136. $("#editZdAllergen").selectpicker('val', zdAllergen);
  14137. $("#editZdAllergen").selectpicker('refresh');
  14138. $("#editYpDitList").selectpicker('val', ypDitList);
  14139. $("#editYpDitList").selectpicker('refresh');
  14140. $("#editZdAllergen").attr("selectedCodes", zdAllergeCodes);
  14141. $("#editZdAllergen").attr("selectedTexts", zdAllergeTexts);
  14142. $("#editYpDitList").attr("selectedCodes", ypDitListodes);
  14143. $("#editYpDitList").attr("selectedTexts", ypDitListTexts);
  14144. }
  14145. var tentativeDiagnosis = mzBlRecord.tentativeDiagnosis == null ? "" : mzBlRecord.tentativeDiagnosis;
  14146. if ((mzBlRecord.icdCode == null || mzBlRecord.icdCode == "") && mzBlRecord.icdText != null && mzBlRecord.icdText != "") {
  14147. if (tentativeDiagnosis == null || tentativeDiagnosis == "") {
  14148. tentativeDiagnosis = mzBlRecord.icdText;
  14149. } else {
  14150. tentativeDiagnosis = mzBlRecord.icdText + " " + tentativeDiagnosis;
  14151. }
  14152. }
  14153. $("#edittentativeDiagnosis").val(tentativeDiagnosis);
  14154. $("#editEmrJkjy").val(mzBlRecord.emrJkjy == null ? "" : mzBlRecord.emrJkjy);
  14155. $("#bl_weight").val(mzBlRecord.weight == 0 ? null : mzBlRecord.weight);
  14156. $("#bl_temperature").val(mzBlRecord.temperature == 0 ? null : mzBlRecord.temperature);
  14157. $("#bl_sphygmus").val(mzBlRecord.sphygmus == 0 ? null : mzBlRecord.sphygmus);
  14158. $("#bl_breathe").val(mzBlRecord.breathe == 0 ? null : mzBlRecord.breathe);
  14159. $("#bl_pressure_high").val(mzBlRecord.pressureHigh == 0 ? null : mzBlRecord.pressureHigh);
  14160. $("#bl_pressure_floor").val(mzBlRecord.pressureFloor == 0 ? null : mzBlRecord.pressureFloor);
  14161. $("#bl_pressure_high_left").val(mzBlRecord.pressureHighLeft == 0 ? null : mzBlRecord.pressureHighLeft);
  14162. $("#bl_pressure_floor_left").val(mzBlRecord.pressureFloorLeft == 0 ? null : mzBlRecord.pressureFloorLeft);
  14163. if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
  14164. var reg = new RegExp("</br>", "g");//g,表示全部替换。
  14165. var editEmrProcess = mzBlRecord.emrProcess.replace(reg, "\n");
  14166. reg = new RegExp("&nbsp;", "g");//g,表示全部替换。
  14167. editEmrProcess = editEmrProcess.replace(reg, "");
  14168. $("#editEmrProcess").val(editEmrProcess);
  14169. } else {
  14170. $("#editEmrProcess").val("");
  14171. }
  14172. if (type == 1) {
  14173. $("#mzBlRecorTitle").html("门诊病历【编辑】");
  14174. $("#setOtherEmrProcess").removeClass("in").addClass("hide");
  14175. $("#openBlRecordModel").removeClass("hide").addClass("in");
  14176. $("#setEmrProcess").removeClass("hide").addClass("in");
  14177. $("#visitingDetailModal").modal("hide");
  14178. } else if (type == 2) {
  14179. $("#mzBlRecorTitle").html("门诊病历【预览】");
  14180. $("#setOtherEmrProcess").removeClass("hide").addClass("in");
  14181. $("#openBlRecordModel").removeClass("in").addClass("hide");
  14182. $("#setEmrProcess").removeClass("in").addClass("hide");
  14183. //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
  14184. if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
  14185. $("#baseMzBlTimes").val($("#mzBlTimes").val());
  14186. }
  14187. $("#otherBlRecordModal").modal("hide");
  14188. }
  14189. $("#mzBlTimes").val(mzBlRecord.times);
  14190. $("#editMzBlRecordModal").modal();
  14191. } else {
  14192. errorMesage(res);
  14193. }
  14194. }
  14195. });
  14196. }
  14197. /**
  14198. * 清空区域
  14199. */
  14200. function clearInput() {
  14201. //编辑病历的时候,没有基础病历的就诊次数,如果是预览病历的时候,有基础病历的次数
  14202. var baseMzBlTimes = $("#baseMzBlTimes").val();
  14203. $("#editPatientId").text(null);
  14204. $("#editPatientName").text(null);
  14205. $("#editPatientGender").text(null);
  14206. $("#editPatientAge").text(null);
  14207. $("#editEmrChiefComplaint").val(null);
  14208. $("#editEmrHpi").val(null);
  14209. $("#editEmrPs").val(null);
  14210. $("#editPersonalHistory").val(null);
  14211. $("#editFamilyHistory").val(null);
  14212. $("#editFzZl").val(null);
  14213. $("#editCrbHistory").val(null);
  14214. $("#editObstericalHistory").val(null);
  14215. $("#bl_weight").val(null);
  14216. $("#bl_sphygmus").val(null);
  14217. $("#bl_breathe").val(null);
  14218. $("#bl_pressure_high").val(null);
  14219. $("#bl_pressure_floor").val(null);
  14220. $("#bl_pressure_high_left").val(null);
  14221. $("#bl_pressure_floor_left").val(null);
  14222. $("#editQtjc").val(null);
  14223. $("#editZd").selectpicker('val', null);
  14224. $("#editZd").selectpicker('refresh');
  14225. $("#editTcmZd").selectpicker('val', null);
  14226. $("#editTcmZd").selectpicker('refresh');
  14227. $("#edittentativeDiagnosis").val(null);
  14228. $("#editEmrProcess").val(null);
  14229. $("#editEmrJkjy").val(null);
  14230. $("#mzBlTimes").val(null);
  14231. if (baseMzBlTimes != null && baseMzBlTimes != "") {
  14232. $("#otherBlRecordModal").modal();
  14233. }
  14234. }
  14235. /**
  14236. * 保存门诊病历
  14237. */
  14238. function setEmrProcess() {
  14239. $("#editMzBlRecordModal").modal("hide");
  14240. $("#messageModal").modal();
  14241. $("#messageContent").html("确认修改当前门诊病历吗?");
  14242. $("#messageButton").off("click").on("click", function (t) {
  14243. $("#messageModal").modal("hide");
  14244. sendEmrProcess();
  14245. });
  14246. $("#cancelButton").off("click").on("click", function (t) {
  14247. $("#editMzBlRecordModal").modal();
  14248. });
  14249. }
  14250. /**
  14251. * 提交保存门诊病历
  14252. */
  14253. function sendEmrProcess() {
  14254. //修改告警人员
  14255. var icdCodes = $("#editZd").val();
  14256. var icdCodeStr = null;
  14257. if (icdCodes != null && icdCodes.length > 0) {
  14258. for (var i = 0; i < icdCodes.length; i++) {
  14259. if (icdCodeStr == null) {
  14260. icdCodeStr = icdCodes[i];
  14261. } else {
  14262. icdCodeStr += "," + icdCodes[i];
  14263. }
  14264. }
  14265. }
  14266. //中医诊断
  14267. let tcmIcdCodes = $("#editTcmZd").val();
  14268. let tcmIcdCodeStr = null;
  14269. if (tcmIcdCodes != null && tcmIcdCodes.length > 0) {
  14270. for (let i = 0; i < tcmIcdCodes.length; i++) {
  14271. if (tcmIcdCodeStr == null) {
  14272. tcmIcdCodeStr = tcmIcdCodes[i];
  14273. } else {
  14274. tcmIcdCodeStr += "," + tcmIcdCodes[i];
  14275. }
  14276. }
  14277. }
  14278. //设置过敏源
  14279. var patientAllergenInfoList = [];
  14280. var zdAllergen = $("#editZdAllergen").val();
  14281. var ypDitList = $("#editYpDitList").val();
  14282. if (zdAllergen != null && zdAllergen.length > 0) {
  14283. for (var i = 0; i < zdAllergen.length; i++) {
  14284. var tempJson = JSON.parse('{}');
  14285. tempJson.allergenCode = zdAllergen[i];
  14286. tempJson.type = 0;
  14287. patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
  14288. }
  14289. }
  14290. if (ypDitList != null && ypDitList.length > 0) {
  14291. for (var i = 0; i < ypDitList.length; i++) {
  14292. var tempJson = JSON.parse('{}');
  14293. tempJson.allergenCode = ypDitList[i];
  14294. tempJson.type = 1;
  14295. patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
  14296. }
  14297. }
  14298. $.ajax({
  14299. type: "POST",
  14300. url: '/thmz/setEmrProcess',
  14301. contentType: "application/json;charset=UTF-8",
  14302. dataType: "json",
  14303. data: JSON.stringify({
  14304. "patientId": $("#editPatientId").text(),
  14305. "times": $("#mzBlTimes").val(),
  14306. "emrChiefComplaint": $("#editEmrChiefComplaint").val(),
  14307. "emrHpi": $("#editEmrHpi").val(),
  14308. "emrPs": $("#editEmrPs").val(),
  14309. "personalHistory": $("#editPersonalHistory").val(),
  14310. "familyHistory": $("#editFamilyHistory").val(),
  14311. "fzZl": $("#editFzZl").val(),
  14312. "crbHistory": $("#editCrbHistory").val(),
  14313. "obstericalHistory": $("#editObstericalHistory").val(),
  14314. "emrPe": $("#editQtjc").val(),
  14315. "weight": $("#bl_weight").val(),
  14316. "temperature": $("#bl_temperature").val(),
  14317. "sphygmus": $("#bl_sphygmus").val(),
  14318. "breathe": $("#bl_breathe").val(),
  14319. "pressureHigh": $("#bl_pressure_high").val(),
  14320. "pressureFloor": $("#bl_pressure_floor").val(),
  14321. "pressureHighLeft": $("#bl_pressure_high_left").val(),
  14322. "pressureFloorLeft": $("#bl_pressure_floor_left").val(),
  14323. "icdCode": icdCodeStr,
  14324. "tcmIcdCode": tcmIcdCodeStr,
  14325. "icdText": $('#editZd').next().attr("title"),
  14326. "tcmIcdText": $('#editTcmZd').next().attr("title"),
  14327. "tentativeDiagnosis": $("#edittentativeDiagnosis").val(),
  14328. "emrJkjy": $("#editEmrJkjy").val(),
  14329. "emrProcess": $("#editEmrProcess").val(),
  14330. "patientAllergenInfoList": patientAllergenInfoList
  14331. }),
  14332. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14333. success: function (res) {
  14334. if (res == '401' || res == 401) {
  14335. window.location.href = '/thmz/login/view'
  14336. return;
  14337. }
  14338. if (res.code == 0) {
  14339. clearInput();
  14340. successMesage(res);
  14341. $("#editMzBlRecordModal").modal("hide");
  14342. } else {
  14343. errorMesage(res);
  14344. }
  14345. }
  14346. });
  14347. }
  14348. /**
  14349. * 打开待合并病历列表弹框
  14350. */
  14351. function openBlRecordModel() {
  14352. $("#editMzBlRecordModal").modal("hide");
  14353. $("#otherBlRecordModal").modal();
  14354. initOtherMzBlRecordList();
  14355. }
  14356. /**
  14357. * 关闭待合并病历列表
  14358. */
  14359. function closeBlRecordModel() {
  14360. $('#baseMzBlTimes').val(null);
  14361. $("#visitingDetailModal").modal();
  14362. }
  14363. /**
  14364. * 病历列表
  14365. */
  14366. function initOtherMzBlRecordList() {
  14367. $('#other_bl_record_table').bootstrapTable("destroy");
  14368. $('#other_bl_record_table').bootstrapTable({
  14369. url: '/thmz/getMzBlRecordList', //请求后台的URL(*)
  14370. method: 'post', //请求方式(*)
  14371. toolbar: '#toolbar', //工具按钮用哪个容器
  14372. striped: true, //是否显示行间隔色
  14373. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  14374. pagination: true, //是否显示分页(*)
  14375. sortable: true, //是否启用排序
  14376. sortOrder: "desc", //排序方式
  14377. queryParams: queryOtherParams, //传递参数(*)
  14378. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  14379. pageNumber: 1, //初始化加载第一页,默认第一页
  14380. pageSize: 5, //每页的记录行数(*)
  14381. pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
  14382. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  14383. strictSearch: true,
  14384. showColumns: false, //是否显示所有的列
  14385. showRefresh: false, //是否显示刷新按钮
  14386. minimumCountColumns: 2, //最少允许的列数
  14387. clickToSelect: true, //是否启用点击选中行
  14388. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  14389. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  14390. cardView: false, //是否显示详细视图
  14391. detailView: false,
  14392. //rowStyle:rowStyle,//通过自定义函数设置行样式
  14393. ajaxOptions: {
  14394. headers: {
  14395. 'Accept': 'application/json',
  14396. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  14397. }
  14398. },
  14399. columns: [
  14400. {
  14401. title: '操作',
  14402. field: 'op',
  14403. align: "center",
  14404. valign: 'middle',
  14405. formatter: function (value, row, index) {
  14406. 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>';
  14407. return [str].join('');
  14408. }
  14409. },
  14410. {
  14411. field: 'patientId',
  14412. title: '门诊ID',
  14413. align: "center",
  14414. valign: 'middle'
  14415. }, {
  14416. field: 'patientName',
  14417. title: '患者姓名',
  14418. align: "center",
  14419. valign: 'middle'
  14420. }, {
  14421. field: 'deptCode',
  14422. title: '就诊科室',
  14423. align: "center",
  14424. valign: 'middle'
  14425. }, {
  14426. field: 'doctorCode',
  14427. title: '接诊医师',
  14428. align: "center",
  14429. valign: 'middle'
  14430. }, {
  14431. field: 'firstOrNot',
  14432. title: '初/复诊',
  14433. align: "center",
  14434. valign: 'middle',
  14435. formatter: function (value, row, index) {
  14436. if (value == '1') {
  14437. return "复诊";
  14438. }
  14439. return "初诊";
  14440. }
  14441. }
  14442. , {
  14443. field: 'visitDate',
  14444. title: '就诊时间',
  14445. align: "center",
  14446. valign: 'middle',
  14447. formatter: function (value, row, index) {
  14448. if (value == null || value == "") {
  14449. return "";
  14450. }
  14451. return format(value, "yyyy-MM-dd HH:mm:ss");
  14452. }
  14453. }
  14454. ],
  14455. responseHandler: function (res) {
  14456. if (res == '401' || res == 401) {
  14457. window.location.href = '/thmz/login/view'
  14458. return;
  14459. }
  14460. var ress = eval(res);
  14461. if (ress.code == -1) {
  14462. if (ress.message != null && ress.message != '') {
  14463. errorMesage(ress);
  14464. }
  14465. return {
  14466. "total": 0,//总页数
  14467. "rows": {} //数据
  14468. };
  14469. }
  14470. return {
  14471. "total": ress.total,//总页数
  14472. "rows": ress.data //数据
  14473. };
  14474. },
  14475. });
  14476. }
  14477. /**
  14478. * 构建列表查询参数
  14479. * @param params
  14480. * @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}}
  14481. */
  14482. function queryOtherParams(params) {
  14483. var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
  14484. patientId: $("#editPatientId").text(),
  14485. exceptTimes: $("#mzBlTimes").val(),
  14486. pageSize: params.limit, //页面大小
  14487. pageIndex: params.offset / params.limit, //页码
  14488. };
  14489. return temp;
  14490. }
  14491. /**
  14492. * 提取处理意见保存
  14493. */
  14494. function setOtherEmrProcess() {
  14495. $("#editMzBlRecordModal").modal("hide");
  14496. $("#messageModal").modal();
  14497. $("#messageContent").html("确定要执行此次提取处理意见操作吗?");
  14498. $("#messageButton").off("click").on("click", function (t) {
  14499. $("#messageModal").modal("hide");
  14500. $.ajax({
  14501. type: "GET",
  14502. url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val() + '&times=' + $("#mzBlTimes").val(),
  14503. contentType: "application/json;charset=UTF-8",
  14504. dataType: "json",
  14505. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14506. success: function (res) {
  14507. if (res == '401' || res == 401) {
  14508. window.location.href = '/thmz/login/view'
  14509. return;
  14510. }
  14511. if (res.code == 0) {
  14512. successMesage(res);
  14513. $("#editMzBlRecordModal").modal("hide");
  14514. } else {
  14515. errorMesage(res);
  14516. }
  14517. }
  14518. });
  14519. });
  14520. $("#cancelButton").off("click").on("click", function (t) {
  14521. $("#editMzBlRecordModal").modal();
  14522. });
  14523. }
  14524. /**
  14525. * 医保电子凭证读卡
  14526. * @param params
  14527. */
  14528. function siReadCard(params) {
  14529. $.ajax({
  14530. type: "GET",
  14531. url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
  14532. contentType: "application/json;charset=UTF-8",
  14533. dataType: "json",
  14534. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14535. success: function (res) {
  14536. if (res == '401' || res == 401) {
  14537. window.location.href = '/thmz/login/view'
  14538. return;
  14539. }
  14540. //console.log(res);
  14541. if (res.code == 200) {
  14542. var data = JSON.parse(res.data);
  14543. queryUserInfoBySocialNoNotFillPatient('rapidAcceptsUserCardNo', "" + data.data.idNo + "", queryUserInfoByCardNo, 'rapidAcceptsModal');
  14544. } else {
  14545. errorMesage(res);
  14546. }
  14547. }
  14548. });
  14549. // window.open('ReadCard://'+prm, '_self')
  14550. }
  14551. /**
  14552. * 西药品类按钮点击事件 因为原插件有点未解决bug,点击title的时候,加载的列表非对应的,
  14553. * @param paneId
  14554. */
  14555. function xyTableOnClick(paneId) {
  14556. setTimeout(function () {
  14557. $("#xyTabContent div.tab-pane").each(function (index, obj) {
  14558. var targetId = $(obj).attr("id");
  14559. //如果处方内容是空的,就删除没有处方
  14560. if ($(obj).find("div.cf_content").children().length == 0) {
  14561. $(obj).remove();
  14562. $("[href='#" + targetId + "']").parent().remove();
  14563. } else if (targetId == paneId) {
  14564. $(obj).addClass("active").addClass("in");
  14565. } else {
  14566. $(obj).removeClass("active").removeClass("in");
  14567. }
  14568. });
  14569. }, 400);
  14570. }
  14571. /**
  14572. * 打开转诊弹层
  14573. */
  14574. function transferTreatment() {
  14575. $("#turnDept").selectpicker({
  14576. size: 5
  14577. });
  14578. $("#turnToConsultationTitle").html("转诊");
  14579. $("#opType").val(1);
  14580. $("#turnToConsultationDoctorDiv").removeClass("hide").addClass("in");
  14581. $("#turnDeptDiv").removeClass("hide").addClass("in");
  14582. $("#consultationDeptDiv").removeClass("in").addClass("hide");
  14583. //科室列表
  14584. $.ajax({
  14585. type: "GET",
  14586. url: '/thmz/getUnitCodeByRequestDay',
  14587. dataType: "json",
  14588. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14589. success: function (data) {
  14590. if (data == '401' || data == 401) {
  14591. window.location.href = '/thmz/login/view'
  14592. return;
  14593. }
  14594. var html = '';
  14595. $.each(data.data, function (commentIndex, comment) {
  14596. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  14597. });
  14598. $('#turnDept').empty();
  14599. $('#turnDept').html(html);
  14600. $('#turnDept').selectpicker('refresh');
  14601. }
  14602. });
  14603. $("#turnToConsultationModal").modal();
  14604. }
  14605. /**
  14606. * 打开会诊弹层
  14607. */
  14608. function consultation() {
  14609. $("#consultationDept").selectpicker({
  14610. size: 5
  14611. });
  14612. $("#turnToConsultationTitle").html("发起会诊");
  14613. $("#opType").val(2);
  14614. $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
  14615. $("#consultationDeptDiv").removeClass("hide").addClass("in");
  14616. $("#turnDeptDiv").removeClass("in").addClass("hide");
  14617. //科室列表
  14618. $.ajax({
  14619. type: "GET",
  14620. url: '/thmz/allMzUnitCode',
  14621. dataType: "json",
  14622. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14623. success: function (res) {
  14624. if (res == '401' || res == 401) {
  14625. window.location.href = '/thmz/login/view'
  14626. return;
  14627. }
  14628. var html = '';
  14629. $.each(res.data, function (commentIndex, comment) {
  14630. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  14631. });
  14632. $('#consultationDept').empty();
  14633. $('#consultationDept').html(html);
  14634. $('#consultationDept').selectpicker('refresh');
  14635. $.ajax({
  14636. type: "GET",
  14637. url: '/thmz/getUnConsultation?serialNo=' + $("#mzfzSerialNoInClick").val(),
  14638. dataType: "json",
  14639. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14640. success: function (res) {
  14641. if (res == '401' || res == 401) {
  14642. window.location.href = '/thmz/login/view'
  14643. return;
  14644. }
  14645. var data = res.data;
  14646. if (data != null && data.length > 0) {
  14647. $('#consultationDept').selectpicker('val', data);
  14648. $('#consultationDept').selectpicker('refresh');
  14649. }
  14650. }
  14651. });
  14652. }
  14653. });
  14654. $("#turnToConsultationModal").modal();
  14655. }
  14656. /**
  14657. * 清空转诊和发起会诊区域
  14658. */
  14659. function clearTurnToConsultationInput() {
  14660. $("#turnDept").selectpicker('val', null);
  14661. $("#turnDept").selectpicker('refresh');
  14662. $("#consultationDept").selectpicker('val', null);
  14663. $("#consultationDept").selectpicker('refresh');
  14664. $("#turnToConsultationDoctor").selectpicker('val', null);
  14665. $("#turnToConsultationDoctor").selectpicker('refresh');
  14666. $("#turnToConsultationId").val(null);
  14667. $("#opType").val(null);
  14668. $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
  14669. $("#turnDeptDiv").removeClass("in").addClass("hide");
  14670. $("#consultationDeptDiv").removeClass("in").addClass("hide");
  14671. }
  14672. /**
  14673. * 清空门诊统筹额外内容区域
  14674. */
  14675. function clearExpContentRequired() {
  14676. $("#mdtrtGrpType").selectpicker('val', null);
  14677. $("#mdtrtGrpType").selectpicker('refresh');
  14678. $("#trumFlag").selectpicker('val', null);
  14679. $("#trumFlag").selectpicker('refresh');
  14680. $("#relTtpFlag").selectpicker('val', null);
  14681. $("#relTtpFlag").selectpicker('refresh');
  14682. $("#otpErReflFlag").selectpicker('val', null);
  14683. $("#otpErReflFlag").selectpicker('refresh');
  14684. }
  14685. /**
  14686. * 清空门诊统筹支付参数区域
  14687. */
  14688. function clearZgtczfInput() {
  14689. $("#zgmztczf").selectpicker('val', null);
  14690. $("#zgmztczf").selectpicker('refresh');
  14691. $("#grzhzf").selectpicker('val', null);
  14692. $("#grzhzf").selectpicker('refresh');
  14693. $("#readCardResult").val(null);
  14694. }
  14695. /**
  14696. * 保存转诊/会诊
  14697. */
  14698. function setTurnToConsultation() {
  14699. $("#turnToConsultationModal").modal("hide");
  14700. $("#messageModal").modal();
  14701. var opType = $("#opType").val();
  14702. var targetDeptNo = $("#turnDept").val();
  14703. var title = "确认提交转诊操作吗,提交后您将无法继续接诊该患者?";
  14704. if (opType == 2 || opType == "2") {
  14705. title = "确认提交本次会诊操作吗?";
  14706. var consultationDept = $("#consultationDept").val();
  14707. if (consultationDept != null && consultationDept.length > 0) {
  14708. targetDeptNo = null;
  14709. for (var i = 0; i < consultationDept.length; i++) {
  14710. if (targetDeptNo == null) {
  14711. targetDeptNo = consultationDept[i];
  14712. } else {
  14713. targetDeptNo += "," + consultationDept[i];
  14714. }
  14715. }
  14716. }
  14717. }
  14718. $("#messageContent").html(title);
  14719. $("#messageButton").off("click").on("click", function (t) {
  14720. $("#messageModal").modal("hide");
  14721. $.ajax({
  14722. type: "POST",
  14723. url: '/thmz/saveTurnToConsultation',
  14724. contentType: "application/json;charset=UTF-8",
  14725. dataType: "json",
  14726. data: JSON.stringify({
  14727. "id": $("#turnToConsultationId").val(),
  14728. "opType": opType,
  14729. "targetDeptNo": targetDeptNo,
  14730. "targetDoctorNo": $("#turnToConsultationDoctor").val(),
  14731. "serialNo": $("#mzfzSerialNoInClick").val(),
  14732. "remark": $("#turnToConsultationRemark").val(),
  14733. }),
  14734. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14735. success: function (res) {
  14736. if (res == '401' || res == 401) {
  14737. window.location.href = '/thmz/login/view'
  14738. return;
  14739. }
  14740. if (res.code == 0) {
  14741. successMesage(res);
  14742. clearTurnToConsultationInput();
  14743. if (opType == 1 || opType == "1") {
  14744. //加载候诊患者列表
  14745. loadUnClinicTableList();
  14746. //加载接诊中患者列表
  14747. loadInClinicTableList();
  14748. clearWorkSpace();
  14749. }
  14750. } else {
  14751. $("#turnToConsultationModal").modal();
  14752. errorMesage(res);
  14753. }
  14754. }
  14755. });
  14756. });
  14757. $("#cancelButton").off("click");
  14758. }
  14759. /**
  14760. * 初始医生下拉选
  14761. * @param ampm 时间段区间
  14762. */
  14763. function initEmployee() {
  14764. var opType = $("#opType").val();
  14765. if (opType == 2) {
  14766. return;
  14767. }
  14768. $("#turnToConsultationDoctor").selectpicker({
  14769. size: 5
  14770. });
  14771. //医生列表
  14772. $.ajax({
  14773. type: "GET",
  14774. url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#turnDept').val(),
  14775. dataType: "json",
  14776. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14777. success: function (res) {
  14778. if (res == '401' || res == 401) {
  14779. window.location.href = '/thmz/login/view'
  14780. return;
  14781. }
  14782. var html = '';
  14783. var defaultCode = null;
  14784. $.each(res.data, function (commentIndex, comment) {
  14785. var employeeName = comment.employee.employeeName;
  14786. if (comment.leftNum != null) {
  14787. employeeName = employeeName + " 余号(" + comment.leftNum + ")"
  14788. }
  14789. html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + employeeName + '</option>';
  14790. if (res.data.length == 1) {
  14791. //如果只有一个号别,默认选中
  14792. defaultCode = comment.employee.employeeCode;
  14793. }
  14794. });
  14795. $('#turnToConsultationDoctor').empty();
  14796. $('#turnToConsultationDoctor').html(html);
  14797. $('#turnToConsultationDoctor').selectpicker('refresh');
  14798. if (defaultCode != null) {
  14799. //如果有无需选择医生的选项,默认选择
  14800. $('#turnToConsultationDoctor').selectpicker('val', defaultCode);
  14801. $('#turnToConsultationDoctor').selectpicker('refresh');
  14802. }
  14803. }
  14804. });
  14805. }
  14806. /**
  14807. * 设置挂号号别
  14808. * @param patientId
  14809. * @param times
  14810. * @param reqType
  14811. */
  14812. function setMzReqType(patientId,times,reqType) {
  14813. if(stringIsBlank(reqType)){
  14814. postAjaxJsonHttpRequst("/thmz/queryMzOrderDetails",{patientId:patientId,times:times},true,function (res) {
  14815. if(res.code == 0 && res.data != null){
  14816. $("#mzReqTypeName").text(res.data.reqTypeName)
  14817. $("#mzReqType").val(res.data.reqType)
  14818. if(res.data.reqType == '45') {
  14819. $("#mzOrderTypeSelect").val('4');
  14820. $('#mzOrderTypeSelect').selectpicker('refresh');
  14821. }
  14822. }
  14823. })
  14824. }else {
  14825. getAjaxRequst("/thmz/getMzChargeTypeByCode",{code:reqType},true,function (res) {
  14826. if(res.code == 0 && res.data != null){
  14827. $("#mzReqType").val(reqType)
  14828. $("#mzReqTypeName").text(res.data.name)
  14829. if(reqType == '45'){
  14830. $("#mzOrderTypeSelect").val('4');
  14831. $('#mzOrderTypeSelect').selectpicker('refresh');
  14832. }
  14833. }
  14834. })
  14835. }
  14836. }
  14837. /**
  14838. * 选择处方类型进行效验
  14839. */
  14840. function verifyMzOrderType() {
  14841. let mzOrderTypeSelectVal = $("#mzOrderTypeSelect").val();
  14842. if(mzOrderTypeSelectVal == '3'){
  14843. if(stringIsBlank(curOpspDiseCode)){
  14844. errorMesageSimaple('不是特门病人,请先点击[查询特门]并选中特门编码!')
  14845. $("#mzOrderTypeSelect").val('1');
  14846. $('#mzOrderTypeSelect').selectpicker('refresh');
  14847. return
  14848. }
  14849. }
  14850. let mzReqTypeVal = $("#mzReqType").val()
  14851. if(mzOrderTypeSelectVal == '4' && mzReqTypeVal != '45'){
  14852. errorMesageSimaple('当前病人不是GCP实验类型,不能选择该选项!')
  14853. $("#mzOrderTypeSelect").val('1');
  14854. $('#mzOrderTypeSelect').selectpicker('refresh');
  14855. return
  14856. }
  14857. }
  14858. /**
  14859. * 初始化门诊处方类型下拉框
  14860. */
  14861. function initMzOrderTypeSelect() {
  14862. getAjaxRequst("/thmz/queryMzOrderType",{},true,function (res) {
  14863. let html = ''
  14864. $.each(res.data, function (commentIndex, comment) {
  14865. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  14866. });
  14867. $('#mzOrderTypeSelect').empty();
  14868. $('#mzOrderTypeSelect').html(html);
  14869. $('#mzOrderTypeSelect').selectpicker('refresh');
  14870. $('#mzOrderTypeSelect').val('1');
  14871. $('#mzOrderTypeSelect').selectpicker('refresh');
  14872. })
  14873. }
  14874. /**
  14875. * 选择门诊统筹支付时校验门诊诊断是否是标准诊断,校验医生是否具有医保编码
  14876. */
  14877. function verifyInsuranceInfo() {
  14878. var zgmztczf = $("#zgmztczf").val();
  14879. if (zgmztczf != null && (zgmztczf == 1 || zgmztczf == "1")) {
  14880. $('#mzOrderTypeSelect').val('2');
  14881. $('#mzOrderTypeSelect').selectpicker('refresh');
  14882. postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:$("#patientId").text()},true,function (res) {
  14883. if(res.code ==0){
  14884. if(!stringIsBlank(res.data)){
  14885. warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
  14886. }
  14887. }
  14888. })
  14889. var diagnoseValue = $("#diagnoseValue").val();
  14890. if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
  14891. errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
  14892. // $("#zgmztczf").selectpicker('val', null);
  14893. // $("#zgmztczf").selectpicker('refresh');
  14894. return false;
  14895. }
  14896. diagnoseValue = diagnoseValue.replace(/,/g, "");
  14897. if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
  14898. errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
  14899. // $("#zgmztczf").selectpicker('val', null);
  14900. // $("#zgmztczf").selectpicker('refresh');
  14901. return false;
  14902. }
  14903. var ybCode = localStorage.getItem("ybCode");
  14904. if (ybCode == null || ybCode == "" || ybCode.length == 0) {
  14905. errorMesageSimaple("您还没有医保赋码,无法进行门诊统筹接诊,请取消门诊统筹选项");
  14906. // $("#zgmztczf").selectpicker('val', null);
  14907. // $("#zgmztczf").selectpicker('refresh');
  14908. return false;
  14909. }
  14910. }else {
  14911. if($('#mzOrderTypeSelect').val() =='2'){
  14912. $('#mzOrderTypeSelect').val('1');
  14913. $('#mzOrderTypeSelect').selectpicker('refresh');
  14914. }
  14915. }
  14916. return true;
  14917. }
  14918. /**
  14919. * 已诊列表发起会诊
  14920. * @param patientId
  14921. */
  14922. function consultationCliniced(patientId) {
  14923. $.ajax({
  14924. type: "GET",
  14925. url: '/thmz/getLastClinicedFzOrder?patientId=' + patientId,
  14926. dataType: "json",
  14927. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  14928. success: function (res) {
  14929. if (res == '401' || res == 401) {
  14930. window.location.href = '/thmz/login/view'
  14931. return;
  14932. }
  14933. if (res.code == 0) {
  14934. $("#visitingDetailModal").modal("hide");
  14935. $("#mzfzSerialNoInClick").val(res.data.serialNo);
  14936. consultation();
  14937. } else {
  14938. errorMesage(res);
  14939. }
  14940. }
  14941. });
  14942. }
  14943. /**
  14944. * 计算诊疗金额
  14945. * @param flag true ,直接计算总价, false 还要计算总量
  14946. */
  14947. function calculateZl(flag) {
  14948. if (!flag) {
  14949. var itemQuantity = $("#itemQuantity").val();
  14950. if (itemQuantity == null) {
  14951. return;
  14952. }
  14953. var dayZlNum = $("#dayZlNum").val();
  14954. if (dayZlNum == null) {
  14955. return;
  14956. }
  14957. //频率
  14958. var times = $('#orderFrequencyZl').find("option:selected").attr('desc');
  14959. if (times == null) {
  14960. return;
  14961. }
  14962. var totalNumZl = Multiply(Multiply(itemQuantity, dayZlNum), times);
  14963. $("#totalNumZl").val(totalNumZl);
  14964. }
  14965. //总量
  14966. var totalNumZl = $("#totalNumZl").val();
  14967. if (totalNumZl == null) {
  14968. return;
  14969. }
  14970. //单价
  14971. var zlItemPrice = $("#zlItemPrice").val();
  14972. if (zlItemPrice == null) {
  14973. return;
  14974. }
  14975. $("#totalAmountZl").val(Multiply(totalNumZl, zlItemPrice));
  14976. }
  14977. /**
  14978. *打印外伤无第三方责任承诺书
  14979. */
  14980. function printNoThirdParty() {
  14981. printNoThirdPartyCommon(1);
  14982. }
  14983. /**
  14984. * 打印外伤无第三方责任承诺书
  14985. * @param printType 打印模式 1 预览打印 2 打印设置
  14986. */
  14987. function printNoThirdPartyCommon(printType) {
  14988. warningMesageSimaple("请提醒患者至医保窗口审核,审核通过方能报销!");
  14989. var title = "外伤无第三方责任承诺书";
  14990. setPrint();
  14991. LODOP = getLodop();
  14992. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
  14993. LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
  14994. //设置默认打印机
  14995. LODOP.SET_PRINTER_INDEX(printIndex);
  14996. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  14997. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  14998. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  14999. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
  15000. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  15001. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  15002. // var strStyle = "<style>table{width: 96%;}</style>";
  15003. var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>";
  15004. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("print_no_third_party_table").innerHTML);
  15005. if (printType == 1) {
  15006. LODOP.PREVIEW();
  15007. } else if (printType == 2) {
  15008. LODOP.PRINT_SETUP();
  15009. }
  15010. }
  15011. /**
  15012. * 打印自费承诺书
  15013. */
  15014. function printSelfPay() {
  15015. printSelfPayCommon(1);
  15016. }
  15017. /**
  15018. * 打印自费承诺书
  15019. * @param printType 打印模式 1 预览打印 2 打印设置
  15020. */
  15021. function printSelfPayCommon(printType) {
  15022. var title = "参保人员门诊统筹医保支付告知审核表";
  15023. setPrint();
  15024. LODOP = getLodop();
  15025. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
  15026. LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
  15027. //设置默认打印机
  15028. LODOP.SET_PRINTER_INDEX(printIndex);
  15029. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  15030. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  15031. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  15032. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
  15033. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  15034. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  15035. // var strStyle = "<style>table{width: 96%;}</style>";
  15036. //table,th {border-width: 1px;border-style: solid;border-collapse: collapse}
  15037. var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} </style>";
  15038. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
  15039. if (printType == 1) {
  15040. LODOP.PREVIEW();
  15041. } else if (printType == 2) {
  15042. LODOP.PRINT_SETUP();
  15043. }
  15044. }
  15045. /**
  15046. * 将科室缓存到内存中
  15047. */
  15048. function saveDeptConfig() {
  15049. var clinicDeptNo = $("#clinicDeptNo").val();
  15050. if (clinicDeptNo != null && clinicDeptNo != "") {
  15051. var userIdCode = localStorage.getItem("userIdCode");
  15052. localStorage.setItem(userIdCode, clinicDeptNo);
  15053. }
  15054. $("#selectDeptModal").modal("hide");
  15055. }
  15056. /**
  15057. * 合理用药药品说明书
  15058. */
  15059. function hlyyypsms() {
  15060. $("#western_medicine_name").webuiPopover('hide');
  15061. var code = $("#western_medicine_current_code").val();
  15062. var serial = $("#western_medicine_current_serial").val();
  15063. $("#hlyyTitle").html("药品说明书");
  15064. showHlyyModel('hlyysmsDiv', 'hlyysmsLoading', 'hlyysmsModal', "http://172.16.32.121:9097/web/sms/hpms_medi_show.aspx?his_code=" + code + "_" + serial);
  15065. }
  15066. /**
  15067. * 预约挂号
  15068. * @param patientId
  15069. */
  15070. function registration(patientId) {
  15071. clearRegistrationModal();
  15072. $("#patientIdRegistration").val(patientId);
  15073. $("#visitingDetailModal").modal('hide');
  15074. $("#registrationModal").modal();
  15075. }
  15076. /**
  15077. * 初始门诊时间区间下拉选
  15078. */
  15079. function initMzWorkTime() {
  15080. $("#ampm").selectpicker({
  15081. size: 10
  15082. });
  15083. $.ajax({
  15084. type: "GET",
  15085. url: '/thmz/getMzWorkTime',
  15086. dataType: "json",
  15087. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15088. success: function (res) {
  15089. if (res == '401' || res == 401) {
  15090. window.location.href = '/thmz/login/view'
  15091. return;
  15092. }
  15093. var html = '';
  15094. var ampm = null;
  15095. $.each(res.data, function (commentIndex, comment) {
  15096. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  15097. // if (ampm == null || (ampm != "a" && ampm != "p")) {
  15098. // var startTime = paseToFullTime(comment.startTime);
  15099. // var endTime = paseToFullTime(comment.endTime);
  15100. // if (range(startTime, endTime)) {
  15101. // ampm = comment.code;
  15102. // }
  15103. // }
  15104. });
  15105. $('#ampm').empty(); //清空resText里面的所有内容
  15106. $('#ampm').html(html);
  15107. $('#ampm').selectpicker('refresh');
  15108. // $("#ampm").selectpicker('val', ampm);
  15109. // $('#ampm').selectpicker('refresh');
  15110. initDeptPlus(1);
  15111. }
  15112. });
  15113. }
  15114. /**
  15115. * 初始科室下拉选
  15116. * @param ampm 时间段区间
  15117. */
  15118. function initDeptPlus(type) {
  15119. var ampm = $("#ampm").val();
  15120. if (type == 1) {
  15121. setAmTimes(ampm);
  15122. }
  15123. $("#deptNo").selectpicker({
  15124. size: 10
  15125. });
  15126. var apTimes = $("#apTimes").val();
  15127. //科室列表
  15128. $.ajax({
  15129. type: "GET",
  15130. url: '/thmz/getUnitCodeByRequestDayAndAmpm?ampm=' + $("#ampm").val() + '&date=' + $("#registrationTime").val() + "&apTimes=" + apTimes,
  15131. dataType: "json",
  15132. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15133. success: function (data) {
  15134. if (data == '401' || data == 401) {
  15135. window.location.href = '/thmz/login/view'
  15136. return;
  15137. }
  15138. var html = '';
  15139. $.each(data.data, function (commentIndex, comment) {
  15140. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  15141. });
  15142. $('#deptNo').empty();
  15143. $('#deptNo').html(html);
  15144. $('#deptNo').selectpicker('refresh');
  15145. $('#chargeType').empty();
  15146. $('#chargeType').selectpicker('refresh');
  15147. emptyInput();
  15148. }
  15149. });
  15150. }
  15151. /**
  15152. * 设置时间下拉选
  15153. * @param ampm
  15154. */
  15155. function setAmTimes(ampm) {
  15156. if (ampm == "a" || ampm == "p") {
  15157. $("#apTimesDiv").removeClass("hide").addClass("in");
  15158. $("#doctorDiv").css("margin-top", "10px");
  15159. var timeHtml = null;
  15160. var defaultTime = null;
  15161. var date = new Date($("#registrationTime").val());
  15162. var currentDate = getCurrentDate();
  15163. var afterToday = date.getTime() > currentDate.getTime();
  15164. if (ampm == "a") {
  15165. if (afterToday || range(paseToFullTime("00:00"), paseToFullTime("08:30"))) {
  15166. defaultTime = "a1";
  15167. timeHtml = '<option value="a1">08:00-08:30</option><option value="a2">08:30-09:00</option><option value="a3">09:00-09:30</option><option value="a4">09:30-10:00</option><option value="a5">10:00-10:30</option><option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15168. } else if (range(paseToFullTime("08:30"), paseToFullTime("09:00"))) {
  15169. defaultTime = "a2";
  15170. timeHtml = '<option value="a2">08:30-09:00</option><option value="a3">09:00-09:30</option><option value="a4">09:30-10:00</option><option value="a5">10:00-10:30</option><option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15171. } else if (range(paseToFullTime("09:00"), paseToFullTime("09:30"))) {
  15172. defaultTime = "a3";
  15173. timeHtml = '<option value="a3">09:00-09:30</option><option value="a4">09:30-10:00</option><option value="a5">10:00-10:30</option><option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15174. } else if (range(paseToFullTime("09:30"), paseToFullTime("10:00"))) {
  15175. defaultTime = "a4";
  15176. timeHtml = '<option value="a4">09:30-10:00</option><option value="a5">10:00-10:30</option><option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15177. } else if (range(paseToFullTime("10:00"), paseToFullTime("10:30"))) {
  15178. defaultTime = "a5";
  15179. timeHtml = '<option value="a5">10:00-10:30</option><option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15180. } else if (range(paseToFullTime("10:30"), paseToFullTime("11:00"))) {
  15181. defaultTime = "a6";
  15182. timeHtml = '<option value="a6">10:30-11:00</option><option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15183. } else if (range(paseToFullTime("11:00"), paseToFullTime("11:30"))) {
  15184. defaultTime = "a7";
  15185. timeHtml = '<option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
  15186. } else if (range(paseToFullTime("11:30"), paseToFullTime("12:00"))) {
  15187. defaultTime = "a8";
  15188. timeHtml = '<option value="a8">11:30-12:00</option>';
  15189. }
  15190. } else {
  15191. if (afterToday || range(paseToFullTime("00:00"), paseToFullTime("14:30"))) {
  15192. defaultTime = "p1";
  15193. timeHtml = '<option value="p1">14:00-14:30</option><option value="p2">14:30-15:00</option><option value="p3">15:00-15:30</option><option value="p4">15:30-16:00</option><option value="p5">16:00-16:30</option><option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15194. } else if (range(paseToFullTime("14:30"), paseToFullTime("15:00"))) {
  15195. defaultTime = "p2";
  15196. timeHtml = '<option value="p2">14:30-15:00</option><option value="p3">15:00-15:30</option><option value="p4">15:30-16:00</option><option value="p5">16:00-16:30</option><option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15197. } else if (range(paseToFullTime("15:00"), paseToFullTime("15:30"))) {
  15198. defaultTime = "p3";
  15199. timeHtml = '<option value="p3">15:00-15:30</option><option value="p4">15:30-16:00</option><option value="p5">16:00-16:30</option><option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15200. } else if (range(paseToFullTime("15:30"), paseToFullTime("16:00"))) {
  15201. defaultTime = "p4";
  15202. timeHtml = '<option value="p4">15:30-16:00</option><option value="p5">16:00-16:30</option><option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15203. } else if (range(paseToFullTime("16:00"), paseToFullTime("16:30"))) {
  15204. defaultTime = "p5";
  15205. timeHtml = '<option value="p5">16:00-16:30</option><option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15206. } else if (range(paseToFullTime("16:30"), paseToFullTime("17:00"))) {
  15207. defaultTime = "p6";
  15208. timeHtml = '<option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
  15209. } else if (range(paseToFullTime("17:00"), paseToFullTime("17:30"))) {
  15210. defaultTime = "p7";
  15211. timeHtml = '<option value="p7">17:00-17:30</option>';
  15212. }
  15213. }
  15214. $('#apTimes').html(timeHtml);
  15215. $('#apTimes').selectpicker('refresh');
  15216. $("#apTimes").selectpicker('val', defaultTime);
  15217. $('#apTimes').selectpicker('refresh');
  15218. $("#chargeTypeDiv").css("margin-top", "10px");
  15219. $("#apTimesDiv").removeClass("hide").addClass("in");
  15220. } else {
  15221. $("#apTimes").selectpicker('val', null);
  15222. $('#apTimes').selectpicker('refresh');
  15223. $("#apTimesDiv").removeClass("in").addClass("hide");
  15224. $("#chargeTypeDiv").css("margin-top", "0px");
  15225. }
  15226. }
  15227. /**
  15228. * 初始门诊号别下拉选
  15229. */
  15230. function initChargeType() {
  15231. $.ajax({
  15232. type: "GET",
  15233. url: '/thmz/getChargeTypeByRequestDayAndDoctor?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val() + '&date=' + $("#registrationTime").val() + "&apTime=" + $("#apTimes").val(),
  15234. dataType: "json",
  15235. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15236. success: function (res) {
  15237. if (res == '401' || res == 401) {
  15238. window.location.href = '/thmz/login/view'
  15239. return;
  15240. }
  15241. var html = '';
  15242. var defaultCode = null;
  15243. $.each(res.data, function (commentIndex, comment) {
  15244. if (res.data.length == 1) {
  15245. //如果只有一个号别,默认选中
  15246. defaultCode = comment.code;
  15247. }
  15248. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  15249. });
  15250. $('#chargeType').empty(); //清空resText里面的所有内容
  15251. $('#chargeType').html(html);
  15252. $('#chargeType').selectpicker('refresh');
  15253. if (defaultCode != null) {
  15254. //如果有默认选项,默认选择
  15255. $('#chargeType').selectpicker('val', defaultCode);
  15256. $('#chargeType').selectpicker('refresh');
  15257. initDoctorInfo();
  15258. }
  15259. emptyInput();
  15260. }
  15261. });
  15262. }
  15263. /**
  15264. * 初始医生下拉选
  15265. * @param ampm 时间段区间
  15266. */
  15267. function initDoctorInfo() {
  15268. $("#doctorInfo").selectpicker({
  15269. size: 10
  15270. });
  15271. //医生列表
  15272. $.ajax({
  15273. type: "GET",
  15274. url: '/thmz/getDoctorCodeByRequestDayAndDoctor?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val() + "&chargeType=" + $("#chargeType").val() + '&date=' + $("#registrationTime").val() + "&apTime=" + $("#apTimes").val(),
  15275. dataType: "json",
  15276. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15277. success: function (res) {
  15278. if (res == '401' || res == 401) {
  15279. window.location.href = '/thmz/login/view'
  15280. return;
  15281. }
  15282. var html = '';
  15283. var defaultCode = null;
  15284. $.each(res.data, function (commentIndex, comment) {
  15285. var employeeName = comment.employee.employeeName;
  15286. if (comment.leftNum != null) {
  15287. employeeName = employeeName + " 余号(" + comment.leftNum + ")"
  15288. }
  15289. html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + employeeName + '</option>';
  15290. if (res.data.length == 1) {
  15291. //如果只有一个号别,默认选中
  15292. defaultCode = comment.employee.employeeCode;
  15293. }
  15294. });
  15295. $('#doctorInfo').empty();
  15296. $('#doctorInfo').html(html);
  15297. $('#doctorInfo').selectpicker('refresh');
  15298. //validator.checkAll($("#regi_form"));
  15299. if (defaultCode != null) {
  15300. //如果有无需选择医生的选项,默认选择
  15301. $('#doctorInfo').selectpicker('val', defaultCode);
  15302. $('#doctorInfo').selectpicker('refresh');
  15303. fitFee();
  15304. }
  15305. }
  15306. });
  15307. }
  15308. /**
  15309. * 设置挂号费等费用
  15310. */
  15311. function fitFee() {
  15312. var mzyRequestId = $('#doctorInfo').find("option:selected").attr('data-mzyRequestId');
  15313. var checkFee = $('#doctorInfo').find("option:selected").attr('data-checkFee');
  15314. $("#checkFee").val(checkFee);
  15315. $("#totalFee").val(checkFee);
  15316. $.ajax({
  15317. type: "GET",
  15318. url: '/thmz/getMzChargeTypeByMzyRequestId?mzyRequestId=' + mzyRequestId + "&birthDay=&patientId=" + $("#patientIdRegistration").val(),
  15319. dataType: "json",
  15320. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15321. success: function (res) {
  15322. if (res == '401' || res == 401) {
  15323. window.location.href = '/thmz/login/view'
  15324. return;
  15325. }
  15326. $("#registrationFee").val(res.data.reqFee);
  15327. $("#hospitalFee").val(res.data.clinicFee);
  15328. $("#othFee").val(parseFloat(res.data.othFee) - parseFloat(checkFee));
  15329. checkFee = parseFloat(res.data.reqFee) + parseFloat(res.data.clinicFee) + parseFloat(res.data.othFee);
  15330. $("#totalFee").val(checkFee);
  15331. }
  15332. });
  15333. }
  15334. /**
  15335. * 科室与时间区间下拉选改变时清空输入框内容
  15336. */
  15337. function emptyInput() {
  15338. $('#doctorInfo').empty();
  15339. $('#doctorInfo').selectpicker('refresh');
  15340. $("#registrationFee").val(0.00);
  15341. $("#hospitalFee").val(0.00);
  15342. $("#checkFee").val(0.00);
  15343. $("#othFee").val(0.00);
  15344. $("#totalFee").val(0.00);
  15345. }
  15346. /**
  15347. * 科室与时间区间下拉选改变时清空输入框内容
  15348. */
  15349. function clearRegistrationModal() {
  15350. $("#patientIdRegistration").val(null);
  15351. $("#registrationTime").val(null);
  15352. $('#ampm').selectpicker('val', null);
  15353. $('#ampm').selectpicker('refresh');
  15354. $('#deptNo').empty();
  15355. $('#deptNo').selectpicker('refresh');
  15356. $('#chargeType').empty();
  15357. $('#chargeType').selectpicker('refresh');
  15358. $('#doctorInfo').empty();
  15359. $('#doctorInfo').selectpicker('refresh');
  15360. $('#apTimes').empty();
  15361. $('#apTimes').selectpicker('refresh');
  15362. $("#registrationFee").val(0.00);
  15363. $("#hospitalFee").val(0.00);
  15364. $("#checkFee").val(0.00);
  15365. $("#othFee").val(0.00);
  15366. $("#totalFee").val(0.00);
  15367. }
  15368. /**
  15369. * 保存挂号信息
  15370. */
  15371. function saveMzyReqrecUnPay() {
  15372. $("#registrationModal").modal('hide');
  15373. $("#messageModal").modal();
  15374. $("#messageContent").html("确定提交本次预约挂号申请吗?");
  15375. $("#messageButton").off("click").bind("click", function (t) {
  15376. $("#messageModal").modal('hide');
  15377. realSaveMzyReqrecUnPay();
  15378. });
  15379. $("#cancelButton").off("click").bind("click", function (t) {
  15380. $("#messageModal").modal('hide');
  15381. $("#registrationModal").modal();
  15382. });
  15383. }
  15384. /**
  15385. * 保存挂号信息
  15386. */
  15387. function realSaveMzyReqrecUnPay() {
  15388. $("#saveRegistration").attr("disabled", true);
  15389. var mzyRequestId = $('#doctorInfo').find("option:selected").attr('data-mzyRequestId');
  15390. var patientId = $("#patientIdRegistration").val();
  15391. var totalFee = $("#totalFee").val();
  15392. $.ajax({
  15393. type: "POST",
  15394. url: '/thmz/saveMzyReqrec',
  15395. contentType: "application/json;charset=UTF-8",
  15396. dataType: "json",
  15397. data: JSON.stringify({
  15398. "mzyReqrec": {
  15399. "patientId": patientId,
  15400. "ampm": $("#ampm").val(),
  15401. "apTime": $("#apTimes").val(),
  15402. "unitCode": $("#deptNo").val(),
  15403. "chargeType": $("#chargeType").val(),
  15404. "requestDayStr": $("#registrationTime").val()
  15405. }, "mzyRequestId": mzyRequestId, "totalFee": totalFee, "payMark": "5"
  15406. }),
  15407. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15408. success: function (res) {
  15409. if (res == '401' || res == 401) {
  15410. window.location.href = '/thmz/login/view'
  15411. return;
  15412. }
  15413. if (res.code == 0) {
  15414. successMesage(res);
  15415. clearRegistrationModal();
  15416. $("#registrationModal").modal('hide');
  15417. } else {
  15418. errorMesage(res);
  15419. }
  15420. $("#saveRegistration").attr("disabled", false);
  15421. }
  15422. });
  15423. }
  15424. //打开门诊电子病历
  15425. function openEmr() {
  15426. $.ajax({
  15427. type: "GET",
  15428. url: '/thmz/getMzjsdHost',
  15429. dataType: "json",
  15430. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15431. success: function (res) {
  15432. if (res == '401' || res == 401) {
  15433. window.location.href = '/thmz/login/view'
  15434. return;
  15435. }
  15436. if (res.code == 0) {
  15437. let times = $("#visitTimes").val();
  15438. let patientId = $("#patientId").text();
  15439. if(stringIsBlank(patientId)){
  15440. return errorMesageSimaple('门诊号不能为空,请先接诊')
  15441. }
  15442. let age = $("#patientAge").text();
  15443. let sex= $("#patientGender").text();
  15444. let userIdCode = localStorage.getItem("userIdCode");
  15445. let patNo = window.btoa(JSON.stringify({
  15446. patientId:patientId,
  15447. times: Number(times),
  15448. userIdCode:userIdCode
  15449. })
  15450. )
  15451. window.open(`${res.data}/mzEmr/${patNo}`, '_blank');
  15452. }
  15453. }
  15454. });
  15455. }
  15456. //省影像平台(影像报告调阅)
  15457. function YX01() {
  15458. let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
  15459. let params = {
  15460. url: 'http://20.30.1.81/openapi/api/v2/study/create/url',
  15461. reqBody: {
  15462. "organ_code":"52321300510430043N",
  15463. "organ_name":"沭阳铭和医院",
  15464. "app_dpt_code":$("#deptCode").val(),
  15465. "app_dpt_name":$("#deptName").val(),
  15466. "app_doc_loginid": localStorage.getItem("userID"),
  15467. "app_doc_idcard": localStorage.getItem("socialNo"),
  15468. "app_doc_name": localStorage.getItem("userName"),
  15469. "organ_empi": $("#patientId").text(), //院内患者主索引
  15470. "op_em_hp_ex_mark": "门诊", //非必传 门诊/急诊/住院/体检标志
  15471. "ghxh_no": null, //非必传 院内就诊挂号序号
  15472. "cardtype": cardType,
  15473. "cardno": $("#identityNo").val(),
  15474. "name": $("#patientName").text(),
  15475. "mobile": $("#mobile").val(),
  15476. "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
  15477. "birthday": null,// 非必传 yyyy-mm-dd
  15478. "idcard_hos": null, //非必传 医保卡号
  15479. "permissions_code":"IIS", //鉴权平台标识
  15480. "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
  15481. "region": null //非必传
  15482. }
  15483. }
  15484. $.ajax({
  15485. type: "POST",
  15486. url: '/thmz/YxYunAPI',
  15487. contentType: "application/json;charset=UTF-8",
  15488. dataType: "json",
  15489. data: JSON.stringify(params),
  15490. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15491. success: function (res) {
  15492. if (res.code == 200) {
  15493. viewRecordId = res.data.view_record_id
  15494. let url = decodeURIComponent(res.data.url.transport_protocol + "://" + res.data.url.domain + "/" + res.data.url.path)
  15495. window.open(url, '_blank');
  15496. } else {
  15497. // errorMesage(res);
  15498. }
  15499. },
  15500. error: function(xhr, textStatus, errorThrown) {
  15501. console.error("失败状态:", xhr.status);
  15502. console.error("错误:", errorThrown);
  15503. }
  15504. });
  15505. }
  15506. //省影像平台(患者近期检查项目数量查询接口)
  15507. function YX02() {
  15508. console.log('YX02-----------------------------------',$("#patientId").text(),viewRecordId)
  15509. if (!$("#patientId").text() || notFirstYX02 || hasJcInYx) {
  15510. return false
  15511. }
  15512. notFirstYX02 = true
  15513. let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
  15514. let params = {
  15515. url: 'http://20.30.1.81/openapi/api/v2/study/shorttime/list/total',
  15516. reqBody: {
  15517. "organ_code":"52321300510430043N",
  15518. "organ_name":"沭阳铭和医院",
  15519. "app_dpt_code":$("#deptCode").val(),
  15520. "app_dpt_name":$("#deptName").val(),
  15521. "app_doc_loginid": localStorage.getItem("userID"),
  15522. "app_doc_idcard": localStorage.getItem("socialNo"),
  15523. "app_doc_name": localStorage.getItem("userName"),
  15524. "organ_empi": $("#patientId").text(), //院内患者主索引
  15525. "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
  15526. "ghxh_no": '', //非必传 院内就诊挂号序号
  15527. "cardtype": cardType,
  15528. "cardno": $("#identityNo").val(),
  15529. "name": $("#patientName").text(),
  15530. "mobile": $("#mobile").val(),
  15531. "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
  15532. "birthday": '',// 非必传 yyyy-mm-dd
  15533. "idcard_hos": '', //非必传 医保卡号
  15534. "permissions_code":"IIS", //鉴权平台标识
  15535. "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
  15536. "region": '' //非必传
  15537. }
  15538. }
  15539. $.ajax({
  15540. type: "POST",
  15541. url: '/thmz/YxYunAPI',
  15542. contentType: "application/json;charset=UTF-8",
  15543. dataType: "json",
  15544. data: JSON.stringify(params),
  15545. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15546. success: function (res) {
  15547. if (res.code == 200) {
  15548. if (res.data && res.data.total_num > 0) {
  15549. hasJcInYx = true
  15550. viewRecordId = res.data.view_record_id
  15551. }
  15552. } else {
  15553. // errorMesage(res);
  15554. }
  15555. },
  15556. error: function(xhr, textStatus, errorThrown) {
  15557. console.error("失败状态:", xhr.status);
  15558. console.error("错误:", errorThrown);
  15559. }
  15560. });
  15561. }
  15562. //省影像平台(患者近期类似检查项目接口)
  15563. function YX03(yxItemArr) {
  15564. console.log('YX03-----------------------------------')
  15565. let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
  15566. let params = {
  15567. url: 'http://20.30.1.81/openapi/api/v2/mutual/project/notice',
  15568. reqBody: {
  15569. "organ_code":"52321300510430043N",
  15570. // "organ_name":"沭阳铭和医院",
  15571. // "app_dpt_code":$("#deptCode").val(),
  15572. "app_doc_loginid": localStorage.getItem("userID"),
  15573. "app_doc_idcard": localStorage.getItem("socialNo"),
  15574. "app_doc_name": localStorage.getItem("userName"),
  15575. "source": "沭阳铭和医院",
  15576. "permissions_code":"IIS", //鉴权平台标识
  15577. "app_dpt_name":$("#deptName").val(),
  15578. "organ_empi": $("#patientId").text(), //院内患者主索引
  15579. "name": $("#patientName").text(),
  15580. "cardtype": cardType,
  15581. "cardno": $("#identityNo").val(),
  15582. "mobile": $("#mobile").val(),
  15583. "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
  15584. // "birthday": null,// 非必传 yyyy-mm-dd
  15585. // "idcard_hos": null, //非必传 医保卡号
  15586. "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
  15587. // "ghxh_no": null, //非必传 院内就诊挂号序号
  15588. "project_list": yxItemArr,
  15589. // [{
  15590. // "chk_modality": "ct", //非必传 检查设备类型:ct、dr或mri
  15591. // "proj_name": "",
  15592. // "hos_medi_no": "", //非必传 检查项目医保编码
  15593. // "hos_proj_no": "", //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
  15594. // "ckpt_name": "", //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
  15595. // "chk_methodname": "", //非必传 检查方法名称
  15596. // "chk_advice": "", //检查申请名称
  15597. // }]
  15598. "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
  15599. "region": null //非必传
  15600. }
  15601. }
  15602. $.ajax({
  15603. type: "POST",
  15604. url: '/thmz/YxYunAPI',
  15605. contentType: "application/json;charset=UTF-8",
  15606. dataType: "json",
  15607. data: JSON.stringify(params),
  15608. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15609. success: function (res) {
  15610. if (res.code == 200) {
  15611. if (res.data.totalNum && parseInt(res.data.totalNum) > 0) {
  15612. jcItemList = yxItemArr.map(i=> i.proj_name)
  15613. $("#jcJyModal").modal();
  15614. $("#jcJyModalTitle").html("省影像平台提示您");
  15615. $("#jcJyModalContent").html("当前患者在省影像平台中有类似检查记录,可前往查看详情!");
  15616. $("#jcJyModalButton").off("click").on("click", function (t) {
  15617. $("#jcJyModal").modal("hide");
  15618. let url = decodeURIComponent(res.data.url.transport_protocol + "://" + res.data.url.domain + "/" + res.data.url.path)
  15619. window.open(url, '_blank');
  15620. });
  15621. $("#jcJySubmitModalButton").off("click").on("click", function (t) {
  15622. $("#jcJyModal").modal("hide");
  15623. savePrescription()
  15624. });
  15625. $("#jcJyModalCancelButton").off("click").on("click", function (t) {
  15626. jcItemList = yxItemArr.map(i=> i.proj_name)
  15627. });
  15628. } else {
  15629. savePrescription()
  15630. }
  15631. } else {
  15632. savePrescription()
  15633. }
  15634. },
  15635. error: function(xhr, textStatus, errorThrown) {
  15636. // console.error("失败状态:", xhr.status);
  15637. // console.error("错误:", errorThrown);
  15638. savePrescription()
  15639. }
  15640. });
  15641. }
  15642. //省影像平台(开单回执接口,用于院端HIS系统返回医生实际开单的详情,并存证到省“影像平台”内)
  15643. function YX04() {
  15644. //辅助检查
  15645. var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
  15646. let hasYxData = false;
  15647. let yxItemArr = [];
  15648. if (jcjyTabContents != null && jcjyTabContents.length > 0) {
  15649. for (var i = 0; i < jcjyTabContents.length; i++) {
  15650. //项目类型
  15651. var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
  15652. //检查
  15653. if (itemsType == "2" || itemsType == 2) {
  15654. //影像云平台处理数据
  15655. hasYxData = true
  15656. let ckpt = $("#yshPart").val() && $("#yshPart").val() !== '' ? $("#yshPart").val() : $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val();
  15657. let tempYxObj= {
  15658. // "chk_modality": null, //非必传 检查设备类型:ct、dr或mri
  15659. "proj_name": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
  15660. // "hos_medi_no": "", //非必传 检查项目医保编码
  15661. "hos_proj_no": $(jcjyTabContents[i]).find("input.temporary_items_code").val(), //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
  15662. "hos_proj_price": $(jcjyTabContents[i]).find("input.temporary_items_amount").val(), //检查项目院内价格
  15663. "ckpt_name": ckpt, //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
  15664. // "chk_methodname": "", //非必传 检查方法名称
  15665. "chk_advice": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(), //检查申请名称
  15666. }
  15667. yxItemArr.push(tempYxObj)
  15668. }
  15669. }
  15670. }
  15671. let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
  15672. let params = {
  15673. url: 'http://20.30.1.81/openapi/api/v2/mutual/project/callback',
  15674. reqBody: {
  15675. "view_record_id": viewRecordId, //记录医生一次调阅的唯一标识
  15676. "organ_code":"52321300510430043N",
  15677. "app_doc_loginid": localStorage.getItem("userID"),
  15678. "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
  15679. "app_doc_idcard": localStorage.getItem("socialNo"),
  15680. "app_doc_name": localStorage.getItem("userName"),
  15681. "source": "沭阳铭和医院",
  15682. "permissions_code":"IIS", //鉴权平台标识
  15683. "app_dpt_name":$("#deptName").val(),
  15684. "organ_empi": $("#patientId").text(), //院内患者主索引
  15685. "name": $("#patientName").text(),
  15686. "cardtype": cardType,
  15687. "cardno": $("#identityNo").val(),
  15688. "mobile": $("#mobile").val(),
  15689. "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
  15690. "birthday": null,// 非必传 yyyy-mm-dd
  15691. "idcard_hos": null, //非必传 医保卡号
  15692. "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
  15693. "project_list": yxItemArr,
  15694. // "project_list": [
  15695. // {
  15696. // "chk_modality": null, //非必传 检查设备类型:ct、dr或mri
  15697. // "proj_name": "",
  15698. // "hos_medi_no": "", //非必传 检查项目医保编码
  15699. // "hos_proj_no": "", //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
  15700. // "hos_proj_price": "", //检查项目院内价格
  15701. // "ckpt_name": "", //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
  15702. // "chk_methodname": "", //非必传 检查方法名称
  15703. // "chk_advice": "", //检查申请名称
  15704. // }
  15705. // ],
  15706. "region": null //非必传
  15707. }
  15708. }
  15709. console.log('YX04----params----',params)
  15710. return
  15711. $.ajax({
  15712. type: "POST",
  15713. url: '/thmz/YxYunAPI',
  15714. contentType: "application/json;charset=UTF-8",
  15715. dataType: "json",
  15716. data: JSON.stringify(params),
  15717. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15718. success: function (res) {
  15719. if (res.code == 200) {
  15720. console.log(res.message)
  15721. } else {
  15722. console.error(res);
  15723. }
  15724. },
  15725. error: function(xhr, textStatus, errorThrown) {
  15726. console.error("失败状态:", xhr.status);
  15727. console.error("错误:", errorThrown);
  15728. }
  15729. });
  15730. }
  15731. //省临床检验平台(检验云报告调阅)
  15732. function HR01() {
  15733. return
  15734. // console.log('HR01-----------------------------------')
  15735. let identityTypeCode = handleIdentityTypeCode($("#rapidAcceptsUserCertificateType").val())
  15736. let diagCode = []
  15737. let diagName = []
  15738. $("#diagnoseTags").children("span").each(function() {
  15739. var title = $(this).attr("title");
  15740. var id = $(this).attr("id");
  15741. diagCode.push(id)
  15742. diagName.push(title)
  15743. // console.log("Span - ID: " + id + ", Title: " + title);
  15744. });
  15745. let params = {
  15746. url: 'http://20.46.201.94:9999/pmemr/productMutualRecognition/getCrossUrl',
  15747. reqBody: {
  15748. " messages": {
  15749. "EVN": {
  15750. "eventTypeCode": "01",
  15751. "eventTypeName": "可互认报告查询服务"
  15752. },
  15753. "PID": {
  15754. "patientId": $("#patientId").text(),
  15755. "identityTypeCode": identityTypeCode,
  15756. "identityNo": $("#identityNo").val(),
  15757. "visitCardTypeCode": "94", // 院内就诊卡
  15758. "visitCardNo": $("#visitCardNo").val(),
  15759. "personalName": $("#patientName").text(),
  15760. "birthDate": formatDateToDate8(new Date(($("#birthDay").val()))),
  15761. "sexCode": $("#sex").val(),
  15762. "mobile": $("#mobile").val()
  15763. },
  15764. "PV1": {
  15765. "visitTypeCode": "1", //门诊
  15766. "visitNo": $("#mzfzSerialNoInClick").val(),
  15767. "visitDate": formatDateToDate8(new Date()),
  15768. "orgCode": "321322049",
  15769. "orgName": "沭阳铭和医院",
  15770. "deptCode": $("#deptCode").val(),
  15771. "deptName": $("#deptName").val(),
  15772. "wardCode": "",
  15773. "wardName": "",
  15774. "bedNo": "",
  15775. "doctorId": localStorage.getItem("userID"),
  15776. "doctorName": localStorage.getItem("userName"),
  15777. "doctorIdentityNo": localStorage.getItem("socialNo"),
  15778. "computerMac": "",
  15779. "computerIp": ""
  15780. },
  15781. "DG1":
  15782. {
  15783. "chiefCompliant": $("#symptom").val(),
  15784. "diagCode": diagCode.join(","),
  15785. "diagName": diagName.join(",")
  15786. }
  15787. }
  15788. }
  15789. }
  15790. console.log('reqBody:',params.reqBody)
  15791. $.ajax({
  15792. type: "POST",
  15793. url: '/thmz/JyYunAPI',
  15794. contentType: "application/json;charset=UTF-8",
  15795. dataType: "json",
  15796. data: JSON.stringify(params),
  15797. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  15798. success: function (res) {
  15799. if (res == '401' || res == 401) {
  15800. window.location.href = '/thmz/login/view'
  15801. return;
  15802. }
  15803. console.log('res----',res)
  15804. if (res.code == 0) {
  15805. } else {
  15806. errorMesage(res);
  15807. }
  15808. }
  15809. });
  15810. }
  15811. function getCurrentDateTimeISO() {
  15812. const now = new Date();
  15813. const isoString = now.toISOString();
  15814. return isoString
  15815. .replace('T', ' ')
  15816. .replace(/\.\d{3}Z/, '')
  15817. .slice(0, 19);
  15818. }
  15819. function formatDateToDate8(date) {
  15820. const year = date.getFullYear();
  15821. const month = String(date.getMonth() + 1).padStart(2, '0');
  15822. const day = String(date.getDate()).padStart(2, '0');
  15823. return `${year}${month}${day}`;
  15824. }
  15825. function handleYxCardType(val) {
  15826. let identityTypeCodeMap = {
  15827. '01': '1',
  15828. '02': '2',
  15829. '03': '3',
  15830. '04': '4',
  15831. '05': '4',
  15832. '06': '5',
  15833. '07': '9',
  15834. '08': '6',
  15835. '09': '9',
  15836. '10': '9',
  15837. '11': '9',
  15838. '12': '9',
  15839. '13': '9',
  15840. '14': '9',
  15841. '15': '9',
  15842. '16': '9',
  15843. '17': '9',
  15844. '90': '1',
  15845. '99': '9',
  15846. '990102': '9',
  15847. '990201': '9'
  15848. // yx:
  15849. // 1 居民身份证
  15850. // 2 中国人民解放军军人身份证件
  15851. // 3 中国人民武装警察身份证件
  15852. // 4 港澳居民来往内地通行证 仅限港澳居民使用
  15853. // 5 台湾居民来往大陆通行证 仅限台湾居民使用
  15854. // 6 护照 仅限外籍人员使用
  15855. // 9 其他
  15856. //his:
  15857. // JMSFZ("01","居民身份证(户口簿)"),
  15858. // ZGRMJFJJGZ("02","中国人民解放军军官证"),
  15859. // ZGRMWZJCJGZ("03","中国人民武装警察警官证"),
  15860. // XGTQHZ("04","香港特区护照/港澳居民来往内地通行证"),
  15861. // AMTQHZ("05","澳门特区护照/港澳居民来往内地通行证"),
  15862. // TWJMLWNDTXZ("06","台湾居民来往内地通行证"),
  15863. // WGRYJJLZ("07","外国人永久居留证"),
  15864. // WGRHZ("08","外国人护照"),
  15865. // CJRZ("09","残疾人证"),
  15866. // JLSZM("10","军烈属证明"),
  15867. // WGRJYZ("11","外国人就业证"),
  15868. // WGZJZ("12","外国专家证"),
  15869. // WGCZJZZ("13","外国常驻记者证"),
  15870. // TGARYKYZ("14","台港澳人员就业证"),
  15871. // HGLHDJZJZ("15","回国(来华)定居专家证"),
  15872. // ZGHZ("16","中国护照"),
  15873. // GATJMJZZ("17","港澳台居民居住证"),
  15874. // SHBZK("90","社会保障卡"),
  15875. // QTSFZJ("99","其他身份证件"),
  15876. // POVERTY_CODE("990102", "扶贫人口编码"),
  15877. // MEDICAL_BIRTH_CERT("990201", "医学出生证明");
  15878. }
  15879. return identityTypeCodeMap[val];
  15880. }
  15881. function handleIdentityTypeCode(val) {
  15882. let identityTypeCodeMap = {
  15883. '01': '01',
  15884. '02': '04',
  15885. '03': '99',
  15886. '04': '06',
  15887. '05': '06',
  15888. '06': '07',
  15889. '07': '99',
  15890. '08': '03',
  15891. '09': '99',
  15892. '10': '99',
  15893. '11': '99',
  15894. '12': '99',
  15895. '13': '99',
  15896. '14': '99',
  15897. '15': '99',
  15898. '16': '03',
  15899. '17': '99',
  15900. '90': '91',
  15901. '99': '99',
  15902. '990102': '99',
  15903. '990201': '99'
  15904. }
  15905. return identityTypeCodeMap[val];
  15906. }
  15907. //打开pacs检查
  15908. function openPacsJc() {
  15909. getAjaxRequst("/thmz/getPacsUrl",{},true,function (res) {
  15910. if (res == '401' || res == 401) {
  15911. window.location.href = '/thmz/login/view'
  15912. return;
  15913. }
  15914. if(res.code == 0 ){
  15915. let patientId = $("#patientId").text();
  15916. let pacsurl = res.data +"?patient_no="+patientId
  15917. window.open(pacsurl, '_blank');
  15918. }else {
  15919. errorMesage(res)
  15920. }
  15921. })
  15922. }
  15923. //打开检查检验
  15924. function openJcJyPacsModal() {
  15925. $("#previewJcJyPacsModal").modal()
  15926. getAjaxRequst("/thmz/getMzjsdHost",{},true,function (res) {
  15927. if (res == '401' || res == 401) {
  15928. window.location.href = '/thmz/login/view'
  15929. return;
  15930. }
  15931. if(res.code == 0){
  15932. let userIdCode = localStorage.getItem("userIdCode");
  15933. let patNo = $("#patientId").text();
  15934. let end = format(new Date(),'yyyy-MM-dd')
  15935. let start = format(getPreviousDays(new Date(),30),'yyyy-MM-dd')
  15936. let showUrl = `${res.data}/jumpRedirect?url=%2FinspectionResult%3FpatNo%3D${patNo}%26start%3D${start}%26end%3D${end}&code=${userIdCode}`
  15937. $("#jyjcpacsDiv").attr("src", showUrl);
  15938. }
  15939. })
  15940. }
  15941. function openDiscountLv() {
  15942. $("#discountLvModal").modal();
  15943. postAjaxJsonHttpRequst("/thmz/queryDiscountLv",{patientId: $("#patientId").text()},true,function (res) {
  15944. if(res.code == 0){
  15945. if(res.data != null){
  15946. $("#discountLv").val(res.data)
  15947. $('#discountLv').selectpicker('refresh');
  15948. }
  15949. }else {
  15950. errorMesage(res)
  15951. }
  15952. })
  15953. }
  15954. //保存股东卡优先级
  15955. function saveDiscountLv() {
  15956. postAjaxJsonHttpRequst("/thmz/updateDiscountLv",{patientId: $("#patientId").text(),discountLv : $("#discountLv").val()},true,function (res) {
  15957. if(res.code == 0){
  15958. successMesageSimaple("修改成功")
  15959. $("#discountLvModal").modal("hide");
  15960. }else {
  15961. errorMesage(res)
  15962. }
  15963. })
  15964. }
  15965. //打开医技预约
  15966. function openYjYyModal() {
  15967. getAjaxRequst("/thmz/getYjYyUrl",{},true,function (res) {
  15968. if (res == '401' || res == 401) {
  15969. window.location.href = '/thmz/login/view'
  15970. return;
  15971. }
  15972. if(res.code == 0 ){
  15973. let patientId = $("#patientId").text();
  15974. let yjyyUrl = res.data +"?MZH="+patientId
  15975. window.open(yjyyUrl, '_blank');
  15976. }else {
  15977. errorMesage(res)
  15978. }
  15979. })
  15980. }
  15981. function getPreviousDays(date, days) {
  15982. var prevDate = new Date(date); // 创建一个与指定日期相同的新日期对象
  15983. prevDate.setDate(date.getDate() - days); // 将日期设置为前几天(days)的日期
  15984. return prevDate;
  15985. }
  15986. function stringIsBlank(val) {
  15987. try {
  15988. val = val.trim()
  15989. } catch {
  15990. }
  15991. return typeof val === 'undefined' || val === null || val === ''
  15992. }
  15993. //是否开启复制粘贴
  15994. function initCopy() {
  15995. getAjaxRequst("/thmz/initCopy",{},true,function (res) {
  15996. if(res.code == -1){
  15997. document.oncontextmenu = function(event){
  15998. event.returnValue = false;
  15999. }
  16000. document.onkeydown = function(event){
  16001. if(event.ctrlKey && window.event.keyCode == 67){
  16002. return false;
  16003. }
  16004. if(event.ctrlKey && window.event.keyCode == 86){
  16005. return false;
  16006. }
  16007. }
  16008. }else {
  16009. document.oncontextmenu = function(event){
  16010. event.returnValue = true;
  16011. }
  16012. document.onkeydown = function(event){
  16013. if(event.ctrlKey && window.event.keyCode == 67){
  16014. return true;
  16015. }
  16016. if(event.ctrlKey && window.event.keyCode == 86){
  16017. return true;
  16018. }
  16019. }
  16020. }
  16021. })
  16022. }