123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689 |
- //@ sourceURL=clinic.js
- //判断病人列表是否在加载中,防止重复加载
- var msg_list_loading = false;
- //挂号卡片列表页面下标
- var pageIndex = 0;
- //药品使用方法,天数和频次的集合
- var groupIdMap = null;
- var LODOP; //声明为全局变量
- //默认打印机下标
- var printIndex = -1;
- // //上一個光标点击的元素ID
- var prevEleId = null;
- //打开检查检验报告的时候不知道哪个有报告,如果检查没有就自动打开检验,但是为了防止死循环,次数加到1就不在进行重试
- var retryCount = 0;
- //是否在读卡中
- var mztczfSiReadCardStatus = false;
- //药品组号与处方号关系
- var gropuIdAndOrderNoMap = null;
- //上一个药品大类
- //var prevCategoriesFlag = null;
- //处方回调和修改的时候处方号与处方tab的关系
- var orderNoAndTableIdMap = null;
- //处方回调和修改的时候处方tab与处方号的关系
- var tableIdAndOrderNoMap = null;
- //合理用药查询审核结果url
- var getResultUrl = null;
- //定时器
- var timer;
- var ksjzType = null;
- var hospitalName='沭阳铭和医院'
- var wpyHide = 0;
- //药房信息
- var groupNoList = []
- var currentPatientId = '';
- //就诊病人信息
- var currentPatientInfo = {} ;
- //就诊病人列表
- var patientList = [];
- //就诊病人过敏源
- var allergens = [];
- //影像平台YX02是否第一次调用
- var notFirstYX02 = false;
- //影像平台中患者近期有检查项目,判断是否发起第二次查询的依据
- var hasJcInYx = false;
- //记录医生一次调阅的唯一标识
- var viewRecordId = null;
- //记录检查项目列表用于判断是否调用重复验证检查接口YX03
- var jcItemList = null;
- $(function () {
- getAjaxRequst("/thmz/queryWpyOrderHide",{},true,function (res) {
- wpyHide = res.data
- if(res.data === 1){
- $('#wp_order_button').removeClass('in').addClass('hide');
- $('#healthEducationDiv').removeClass('in').addClass('hide');
- $('#ypHealthEducationDiv').removeClass('in').addClass('hide');
- }
- })
- getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
- hospitalName = res.data
- $('.hospitalName').text(hospitalName)
- })
- initCopy();
- initMzOrderTypeSelect();
- initGenderSelect();
- iniAdmissStatus();
- initListDeptSelect();
- initRelationSelect();
- //initTryResultSelect();
- initResponceTypeSelect();
- initTemplateTypeSelect("templateType");
- initTemplateKindTypeSelect('templateKindType');
- initZyClassTypeSelect();
- initInstructionSelect();
- initSelectWithParams();
- initCertificateTypeSelect();
- initMztcSelect();
- initMzssSelect();
- //setSelectSize();
- $('#editUserBirthDayGroup').datetimepicker({
- format: 'yyyy-mm-dd',
- language: 'zh-CN',
- minView: "month",
- });
- initDaterangepickerWithId('reportrange', "right");
- formatCheck();
- //数据校验
- init_validator();
- //初始频次下拉选
- initOrderFrequencys("orderFrequency", true);
- //初始频次下拉选
- initOrderFrequencys("orderFrequencyZl", true);
- //初始用药方式下拉选
- initSupplyTypes();
- //初始化外配药品用法
- initZdRxAll('rx_used_way','medcWayCodg');
- //初始化外配药品频次
- initZdRxAll('rx_used_frqu','usedFrquCodg');
- //初始外配药化剂型
- initDrugDosform();
- initAdvmPro('visitAdvmPro');
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //加载已接诊患者列表
- loadClinicTableList();
- //每隔一分钟秒读加载候诊患者列表
- refreshList();
- // setInterval(function () {
- // //加载候诊患者列表
- // loadUnClinicTableList();
- // //加载已接诊患者列表 病人会缴费,需要刷新状态
- // loadClinicTableList();
- // }, 60000);
- //初始化快速接诊病人姓名栏事件
- initUserList();
- //初始化主诉弹出层
- initRecommendList();
- //卡号输入改变事件
- cardNoChange();
- //初始化省份
- initProvince(3);
- //初始化省份
- initProvince(5);
- /**
- * 患者信息修改
- */
- $("#saveEditUser").on("click", function (t) {
- modifyPatient();
- });
- // /**
- // * 保存入院证
- // */
- // $("#saveBeHospitalized").on("click", function (t) {
- // saveBeHospitalized();
- // });
- /**
- * 打印入院证
- */
- $("#printBeHospitalized").on("click", function (t) {
- modifyPatient();
- });
- //折叠按钮初始化
- $('.collapse-link').on('click', function () {
- var $BOX_PANEL = $(this).closest('.x_panel_mine'),
- $ICON = $(this).find('i'),
- $BOX_CONTENT = $BOX_PANEL.find('.x_content');
- // fix for some div with hardcoded fix class
- if ($BOX_PANEL.attr('style')) {
- $BOX_CONTENT.slideToggle(200, function () {
- $BOX_PANEL.removeAttr('style');
- });
- } else {
- $BOX_CONTENT.slideToggle(200);
- $BOX_PANEL.css('height', 'auto');
- }
- $ICON.toggleClass('fa-chevron-up fa-chevron-down');
- });
- /**
- * 接诊
- */
- $("#clinicalReception").on("click", function (t) {
- var patientIdDb = $("#patientIdDb").val();
- if (patientIdDb == null || patientIdDb == "") {
- errorMesageSimaple("当前未选择病人,无法接诊");
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzfzPatientOrderByPatientId?patientId=' + patientIdDb,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- if (res.data.length == 1) {
- $("#turnToConsultationIdInClick").val(res.data[0].turnToConsultationId);
- clinicalReception(patientIdDb, res.data[0].serialNo, res.data[0].reqType);
- } else {
- $("#mzfzPatientOrderModal").modal();
- $("#mzfzPatientOrderTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- var roomCode = res.data[i].roomCode;
- if (roomCode == null || roomCode == "null") {
- roomCode = "";
- }
- var doctorCode = (res.data[i].doctorCode == null || res.data[i].doctorCode == 'null') ? '' : res.data[i].doctorCode;
- $("<tr data-target='" + res.data[i].serialNo + "' data-target-reqType='" + res.data[i].reqType + "' data-target-turnToConsultationId='" + res.data[i].turnToConsultationId + "'><td>" + res.data[i].patientId + "</td><td>" + res.data[i].name + "</td><td>" + res.data[i].deptCode + "</td><td>" + doctorCode + "</td><td>" + roomCode + "</td></tr>").appendTo("#mzfzPatientOrderTable").bind('click', function () {
- $("#mzfzPatientOrderModal").modal("hide");
- $("#turnToConsultationIdInClick").val($(this).attr("data-target-turnToConsultationId"));
- clinicalReception(patientIdDb, $(this).attr("data-target"), $(this).attr("data-target-reqType"));
- });
- }
- }
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- } else {
- errorMesageSimaple("当前病人没有分诊信息");
- }
- } else if (res.code == 200) {
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- clinicalReception(patientIdDb, null, null);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- /**
- * 存为范本
- */
- $("#saveapidAccepts").on("click", function (t) {
- //关闭帮助框
- $("#treeButton").webuiPopover('hide');
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- $("#saveapidAcceptsModal").modal("show");
- });
- /**
- * 实例化智能问诊弹窗
- */
- // $("[data-toggle='popover']").popover();
- $("#box-arrow-left").popover({
- html: 'true',
- content: '<div id="smartAssistPopoverContent"></div>'
- });
- //初始化药品分组下拉选
- initGroupOrder();
- // 初始化用药天数下拉选
- initDayNum();
- //页面加载完成初始化西药处方
- //initNavTabs(0);
- //页面加载完成初始化住院处方
- //initNavTabs(3);
- //初始医生工作太配置
- initWorkspaceConfigForCurrent();
- initExecUnit();
- $("#rapidAcceptsUserName").blur(function (e) {
- queryUserInfoByName();
- });
- $("#rapidAcceptsUserName").on('keydown', function (event) {
- if (event.key === "Enter") {
- event.preventDefault(); // 阻止默认行为(如表单提交)
- queryUserInfoByName();
- }
- });
- /**
- * 西药点击事件
- */
- $("#western_medicine_name").on("click", function (t) {
- var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#western_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0, null);
- });
- /**
- * 中药点击事件
- */
- $("#chinese_medicine_name").on("click", function (t) {
- var obj = $("#chineseMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#chinese_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#chinese_medicine_name').webuiPopover('show');
- loadYpList(1, null);
- });
- /**
- * 辅助检查、检验点击事件
- */
- $("#jcJyItem").on("click", function (t) {
- var obj = $("#jcJyItemPopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#jcJyItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList(null);
- });
- /**
- * 诊疗点击事件
- */
- $("#zlItem").on("click", function (t) {
- var obj = $("#zlItemPopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#zlItem').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#zlItem').webuiPopover('show');
- loadZlItemList(null);
- });
- //外配药点击事件
- $("#wp_medicine_name").on("click", function (t) {
- var obj = $("#wpMedicinePopoverContent").parent().parent().parent();
- if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
- $('#wp_medicine_name').webuiPopover('hide');
- $("#treeButton").webuiPopover('hide');
- return;
- }
- $('#wp_medicine_name').webuiPopover('show');
- loadWpMedicineList(null);
- });
- initYshPart();
- initJyZdSample();
- initClinicDeptNo();
- setTimeout(function () {
- getLodop();
- }, 800);
- //键盘监听回车键
- $(document).unbind("keyup").keyup(function (event) {
- var index = getIndex("bill_item_group");
- if (event.keyCode == 13) { //是否是回车
- var el = event.srcElement || event.target;
- var id = el.getAttribute("id");
- var current_code = null;
- if (index == 0) {
- current_code = $("#western_medicine_current_code").val();
- } else if (index == 1) {
- current_code = $("#chinese_medicine_current_code").val();
- } else if (index == 2) {
- current_code = $("#jcjy_current_code").val();
- } else if (index == 3) {
- current_code = $("#zl_current_code").val();
- }else if (index == 6) {
- current_code = $("#wp_medicine_current_code").val();
- }
- if (id == null || id == "") {
- id = el.getAttribute("data-id");
- }
- if (id == null || id == "") {
- var search = el.getAttribute("aria-label");
- if (search == "Search") {
- id = $(el).parent().parent().prev().attr("data-id");
- }
- }
- if (id != null && id != "") {
- //将当前点击的id记录下
- //prevEleId = id;
- } else if (prevEleId != null) {
- id = prevEleId;
- }
- //回车时,光标不在任何区域判断是不是在药品和诊疗开立区域
- if (id == null || id == "") {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- if (current_code != null && current_code != "") {
- //当前页面是西药保存页面,且有药品选中
- $("#supplyType").next().click();
- }
- } else if (index == 1) {
- //当前页面是中草药保存页面,且有药品选中
- } else if (index == 2) {
- if (current_code != null && current_code != "") {
- //当前页面是医技保存页面,且有选中
- if ($("#jyZdSampleDiv").hasClass('in')) {
- //此时是检验
- $("#jyZdSample").next().click();
- } else if ($("#yshPartDiv").hasClass('in')) {
- //说明现在是检查
- $("#yshPart").next().click();
- }
- }
- } else if (index == 3) {
- //诊疗
- $("#yshPart").next().click();
- return;
- } else if (index == 4) {
- //当前页面是住院保存页面
- $("#inpatientWardBeHospitalized").next().click();
- return;
- }
- }
- var customization = $("div.customization").not(".hide");
- // //回车时,光标不在任何区域,默认点击主诉
- // if (id == null || id == "") {
- // var eleId = $(customization[0]).attr("target-id");
- // $("#" + eleId).focus();
- // if (eleId == 'symptom') {
- // $("#" + eleId).click();
- // }
- // console.log("eleId=" + eleId);
- // } else
- if (id == 'symptom' || id == 'emrHpi' || id == 'emrPs' || id == 'personalHistory' || id == 'familyHistory' || id == 'obstericalHistory' || id == 'otherCheck' || id == 'diagnose' || id == 'tentativeDiagnosis' || id == 'fzZl' || id == 'crbHistory' ) {
- console.log("1id=" + id);
- if (id != $(customization[customization.length - 1]).attr("target-id")) {
- var next = $("#" + id + "Flag").next();
- while ($(next).hasClass("foreclose") || $(next).hasClass("hide")) {
- next = $(next).next();
- }
- var eleId = $(next).attr("target-id");
- $("#" + eleId).focus();
- if (eleId == 'diagnose' || id == 'diagnose' || id == 'symptom') {
- $("#" + eleId).click();
- }
- console.log("1eleId=" + eleId);
- } else {
- var data_target = $("#symptom").attr("data-target");
- $("#" + data_target).find("a.close").click();
- data_target = $("#diagnose").attr("data-target");
- $("#" + data_target).find("a.close").click();
- if (index == 0) {
- $("#western_medicine_name").focus();
- } else if (index == 1) {
- $("#chinese_medicine_name").focus();
- } else if (index == 2) {
- $("#jcJyItem").focus();
- } else if (index == 3) {
- $("#zlItem").focus();
- } else if (index == 4) {
- $("#inpatientWardBeHospitalized").next().click();
- } else if (index == 5) {
- $("#opName").next().click();
- }else if (index == 6) {
- $("#wp_medicine_name").focus();
- }
- }
- } else if (id == 'zy_drugWin') {
- $("#zyInstruction").next().click();
- } else if (id == 'zyInstruction') {
- var ariaExpanded = $("#zyInstruction").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#zyInstruction").next().click();
- }
- $("#saveChineseMedicine").click();
- $("#chinese_medicine_name").focus();
- $("#chinese_medicine_name").click();
- } else if (id == 'cyJssm') {
- $("#cyJsl").focus();
- } else if (id == 'cyJsl') {
- $("#cyZql").focus();
- } else if (id == 'cyZql') {
- $("#cyFj").focus();
- } else if (id == 'cyFj') {
- $("#cyFfcs").focus();
- } else if (id == 'cyFj') {
- $("#cyFfcs").focus();
- } else if (id == 'cyFfcs') {
- $("#useType_1").next().click();
- } else if (id == 'useType_1') {
- $("#cyMtjs").focus();
- } else if (id == 'cyMtjs') {
- $("#zyfs").focus();
- } else if (id == 'zyfs') {
- $("#zy_supplyType_1").next().click();
- } else if (id == 'supplyType') {
- $("#drugWinUnit").next().click();
- } else if (id == 'drugWinUnit') {
- $("#drugWin").focus();
- } else if (id == 'drugWin') {
- $("#dayNum").next().click();
- } else if (id == 'dayNum') {
- $("#orderFrequency").next().click();
- } else if (id == 'orderFrequency') {
- $("#gross").focus();
- } else if (id == 'gross') {
- $("#packUnit").next().click();
- } else if (id == 'packUnit') {
- $("#medicalAdvice").next().click();
- } else if (id == 'medicalAdvice') {
- var ariaExpanded = $("#medicalAdvice").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#medicalAdvice").next().click();
- }
- saveMedicine(0);
- $("#western_medicine_name").focus();
- } else if (id == 'saveWesternMedicine') {
- $("#western_medicine_name").focus();
- $("#western_medicine_name").click();
- } else if (id == 'yshPart' || id == 'jyQuantity') {
- $("#execUnit").next().click();
- } else if (id == 'jyZdSample') {
- $("#jyQuantity").focus();
- } else if (id == 'execUnit') {
- var ariaExpanded = $("#execUnit").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#execUnit").next().click();
- }
- $("#remark").focus();
- } else if (id == 'remark') {
- saveJyJcItem(true);
- $("#jcJyItem").focus();
- } else if (id == 'chargeUnit') {
- $("#itemQuantity").focus();
- } else if (id == 'itemQuantity') {
- $("#dayZlNum").next().click();
- } else if (id == 'dayZlNum') {
- var ariaExpanded = $("#dayZlNum").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#dayZlNum").next().click();
- }
- $("#orderFrequencyZl").next().click();
- } else if (id == 'orderFrequencyZl') {
- var ariaExpanded = $("#orderFrequencyZl").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#orderFrequencyZl").next().click();
- }
- $("#totalNumZl").focus();
- } else if (id == 'totalNumZl') {
- $("#zlExecUnit").next().click();
- } else if (id == 'zlExecUnit') {
- var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
- if (ariaExpanded == true || ariaExpanded == "true") {
- $("#zlExecUnit").next().click();
- }
- $("#zlRemark").focus();
- } else if (id == 'zlRemark') {
- saveZlItem(true);
- $("#zlItem").focus();
- } else if (id == 'inpatientWardBeHospitalized') {
- $("#smallWardBeHospitalized").next().click();
- } else if (id == 'smallWardBeHospitalized') {
- $("#conditionCode").next().click();
- } else if (id == 'conditionCode') {
- $("#routeOfAdmission").next().click();
- } else if (id == 'routeOfAdmission') {
- $("#admissStatus").next().click();
- } else if (id == 'admissStatus') {
- saveZyReq(true);
- $("#zy_req_button").focus();
- } else if (id == 'western_medicine_name') {
- var webuiID = $("#western_medicine_name").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#tb_table_western_medicine").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_western_medicine").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- checkYpInfo(trData.code, trData.serial, trData.ypType, true, null, 3);
- $("#western_medicine_name").click();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //已经选中药品,跳到用法
- $("#supplyType").next().click();
- } else {
- //药品查询框是空白的,打开查询框
- $("#western_medicine_name").click();
- }
- }
- } else if (id == 'chinese_medicine_name') {
- var webuiID = $("#chinese_medicine_name").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#chinese_medicine_name").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#tb_table_chinese_medicine").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_chinese_medicine").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- checkZyInfo(trData.code, trData.serial, $("#zyClassType").val(), true);
- $("#chinese_medicine_name").click();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#chinese_medicine_name").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //已经选中药品,跳到剂量
- $("#zy_drugWin").next().click();
- } else {
- //药品查询框是空白的,打开查询框
- $("#chinese_medicine_name").click();
- }
- }
- } else if (id == 'jcJyItem') {
- var webuiID = $("#jcJyItem").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#jcJyItem").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#tb_table_jc_jy_item").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_jc_jy_item").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- $('#jcJyItem').webuiPopover('hide');
- $("#jcJyZltype").val(trData.type);
- $("#execUnit").selectpicker('val', trData.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (trData.type == 1) {
- //检验
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#jyQuantityDiv").removeClass("hide").addClass("in");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- if (trData.sampleCode != null && trData.sampleCode != "") {
- $("#jyZdSample").selectpicker('val', trData.sampleCode);
- $('#jyZdSample').selectpicker('refresh');
- }
- } else if (trData.type == 2) {
- //检查
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#jyQuantityDiv").removeClass("in").addClass("hide");
- $("#chargeUnitDiv").removeClass("in").addClass("hide");
- if (trData.bwCode != null && trData.bwCode != "") {
- $("#yshPart").selectpicker('val', trData.bwCode);
- $('#yshPart').selectpicker('refresh');
- }
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- checkJcJyItemInfo(trData.code, trData.name, trData.type, true);
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#jcJyItem").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //如果是保存失败的,重新打开输入框查询
- if (prevEleId == 'remark') {
- $("#jcJyItem").click();
- } else {
- //当前页面是医技保存页面,且有选中
- if ($("#jyZdSampleDiv").hasClass('in')) {
- //此时是检验
- $("#jyZdSample").next().click();
- } else if ($("#yshPartDiv").hasClass('in')) {
- //说明现在是检查
- $("#yshPart").next().click();
- }
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#jcJyItem").click();
- }
- }
- } else if (id == 'zlItem') {
- var webuiID = $("#zlItem").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#zlItem").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#tb_table_zl_item").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_zl_item").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- $('#zlItem').webuiPopover('hide');
- $("#zlExecUnit").selectpicker('val', trData.execUnit);//默认不选中
- $("#zlExecUnit").selectpicker('refresh');
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3, null, null);
- }
- $("#zlItem").val(trData.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(trData.chargeAmount);
- $("#chargeUnit").val(trData.specification);
- $("#zl_current_code").val(trData.code);
- $("#itemQuantity").val(1);
- $("#chargeUnit").focus();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#zlItem").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //如果是保存失败的,重新打开输入框查询
- if (prevEleId == 'zlRemark') {
- $("#zlItem").click();
- } else {
- $("#chargeUnit").focus();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#zlItem").click();
- }
- }
- }else if (id == 'wp_medicine_name') {
- var webuiID = $("#wp_medicine_name").attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- $("#wp_medicine_name").click();
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#tb_table_wp_medicine").find("tbody").find("tr.trhover");
- if (arr != undefined && arr != null && arr.length > 0) {
- var dataIndex = $(arr).attr("data-index");
- var tableData = $("#tb_table_wp_medicine").bootstrapTable('getData');
- if (tableData != null && tableData.length > 0 && dataIndex != null) {
- var trData = tableData[dataIndex];
- $('#wp_medicine_name').webuiPopover('hide');
- //外配药
- if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
- initNavTabs(6, null, null);
- }
- $("#wp_medicine_name").val(trData.genname);
- $("#wp_medicine_name").blur();
- $("#sinDosunt").val(trData.minPrepunt);
- $("#sinDoscnt").val('1');
- setSelectDefaultVal('usedFrquCodg','13')
- setSelectDefaultVal('drugDosform',trData.dosformName)
- $("#prdrName").val(trData.prdrName);
- $("#drugDosunt").val(trData.minPacunt);
- $("#drugSpec").val(trData.specName);
- $("#wp_medicine_current_code").val(trData.medListCodg);
- $("#sinDoscnt").focus();
- }
- } else {
- //药品查询框是空白的,打开查询框
- $("#wp_medicine_name").click();
- }
- } else {
- if (current_code != null && current_code != "") {
- //如果是保存失败的,重新打开输入框查询
- $("#medcWayCodg").next().click();
- } else {
- //药品查询框是空白的,打开查询框
- $("#wp_medicine_name").click();
- }
- }
- }
- else if (id == 'zy_req_button') {
- //当前页面是住院保存页面,此时光标在入院按钮上
- console.log("入院按钮")
- $("#inpatientWardBeHospitalized").next().click();
- } else if (id == 'op_record_button') {
- //当前页面是手术保存页面,此时光标在入院按钮上
- console.log("手术按钮")
- $("#opName").next().click();
- } else if (id == 'opName') {
- $("#opTime").click();
- var opTime = $("#opTime").val();
- if (opTime == null || opTime == "") {
- $("#opTime").datetimepicker('show');
- } else {
- $("#opTime").datetimepicker('hide');
- $("#urgentClinicFlag").next().click();
- }
- } else if (id == 'opTime') {
- $("#opTime").datetimepicker('hide');
- $("#urgentClinicFlag").next().click();
- } else if (id == 'urgentClinicFlag') {
- $("#ssbc").next().click();
- } else if (id == 'ssbc') {
- $("#partCode").next().click();
- } else if (id == 'partCode') {
- $("#opScale").next().click();
- } else if (id == 'opScale') {
- $("#hocusCode").next().click();
- } else if (id == 'hocusCode') {
- $("#doctorZd").next().click();
- } else if (id == 'doctorZd') {
- $("#opRecordRemark").click();
- } else if (id == 'opRecordRemark') {
- saveOpRecord(true);
- }
- if (id != null && id != "") {
- //将当前点击的id记录下
- prevEleId = id;
- }
- } else if (event.keyCode == 37) {
- // //左键事件
- // if(index==0){
- // return;
- // }
- // var prevObject=$("#bill_item_group").find("button")[index-1];
- // $(prevObject).click();
- } else if (event.keyCode == 38) {
- //上键事件
- var tableId = null;
- var inputId = null;
- var contentId = null;
- if (index == 0) {
- tableId = "tb_table_western_medicine";
- inputId = "western_medicine_name";
- contentId = "westernMedicinePopoverContent";
- } else if (index == 1) {
- tableId = "tb_table_chinese_medicine";
- inputId = "chinese_medicine_name";
- contentId = "chineseMedicinePopoverContent";
- } else if (index == 2) {
- tableId = "tb_table_jc_jy_item";
- inputId = "jcJyItem";
- contentId = "jcJyItemPopoverContent";
- } else if (index == 3) {
- tableId = "tb_table_zl_item";
- inputId = "zlItem";
- contentId = "zlItemPopoverContent";
- }else if (index == 6) {
- tableId = "tb_table_wp_medicine";
- inputId = "wp_medicine_name";
- contentId = "wpMedicinePopoverContent";
- }
- if (inputId == null) {
- return;
- }
- var webuiID = $("#" + inputId).attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#" + tableId).find("tbody").find("tr.trhover");
- var prev = $(arr).prev();
- if (arr != undefined && arr != null && arr.length > 0) {
- if (prev != undefined && prev != null && prev.length > 0) {
- $(arr).removeClass("trhover");
- $(prev).addClass("trhover");
- var height = $(arr).css("height");
- $("#" + contentId).parent().animate({scrollTop: "-=" + height}, 100);
- }
- } else {
- var arrs = $("#" + tableId).find("tbody").find("tr");
- $(arrs[0]).addClass("trhover");
- var height = $(arrs[0]).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- }
- } else if (event.keyCode == 39) {
- // //右键事件
- // if(index==4){
- // return;
- // }
- // var nextObject=$("#bill_item_group").find("button")[index+1];
- // $(nextObject).click();
- } else if (event.keyCode == 40) {
- //下键事件
- var tableId = null;
- var inputId = null;
- var contentId = null;
- if (index == 0) {
- tableId = "tb_table_western_medicine";
- inputId = "western_medicine_name";
- contentId = "westernMedicinePopoverContent";
- } else if (index == 1) {
- tableId = "tb_table_chinese_medicine";
- inputId = "chinese_medicine_name";
- contentId = "chineseMedicinePopoverContent";
- } else if (index == 2) {
- tableId = "tb_table_jc_jy_item";
- inputId = "jcJyItem";
- contentId = "jcJyItemPopoverContent";
- } else if (index == 3) {
- tableId = "tb_table_zl_item";
- inputId = "zlItem";
- contentId = "zlItemPopoverContent";
- }else if (index == 6) {
- tableId = "tb_table_wp_medicine";
- inputId = "wp_medicine_name";
- contentId = "wpMedicinePopoverContent";
- }
- if (inputId == null) {
- return;
- }
- var webuiID = $("#" + inputId).attr("data-target");
- if (webuiID == null || webuiID == "null" || webuiID == "") {
- return;
- }
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- var arr = $("#" + tableId).find("tbody").find("tr.trhover");
- var next = $(arr).next();
- if (arr != undefined && arr != null && arr.length > 0) {
- if (next != undefined && next != null && next.length > 0) {
- $(arr).removeClass("trhover");
- $(next).addClass("trhover");
- var height = $(arr).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- } else {
- var arrs = $("#" + tableId).find("tbody").find("tr");
- $(arrs[0]).addClass("trhover");
- var height = $(arrs[0]).css("height");
- $("#" + contentId).parent().animate({scrollTop: "+=" + height}, 100);
- }
- }
- }
- });
- //打印检查检验报告单
- $('#btn_print').click(function () {
- printJyJcReport(1);
- });
- //打印设置检查检验报告单
- $('#btn_print_setup').click(function () {
- printJyJcReport(2);
- });
- /**
- * 医保电子凭证读卡
- */
- $("#siReadCard").on("click", function (t) {
- // siReadCard("qrcode_01101");
- siReadCard("jiangsu_qrcode_01101");
- });
- /**
- * 医保刷脸
- */
- $("#siReadCardFace").on("click", function (t) {
- // siReadCard("face_01101");
- siReadCard("jiangsu_face_01101");
- });
- /**
- * 门诊统筹支付医额外内容弹窗
- */
- $("#expContentRequired").on("click", function (t) {
- expContentRequiredModal();
- });
- /**
- * 门诊统筹支付医保电子凭证读卡
- */
- // $("#mztczfSiReadCard").on("click", function (t) {
- // mztczfSiReadCard(true, "qrcode_01101");
- // mztczfSiReadCard(true, "jiangsu_qrcode_01101");
- // });
- /**
- * 门诊统筹支付医保刷脸
- */
- // $("#mztczfSiReadCardFace").on("click", function (t) {
- // mztczfSiReadCard(true, "face_01101");
- // mztczfSiReadCard(true, "jiangsu_face_01101");
- // });
- /**
- * 快速接诊页面 -未挂号患者信息查询处编辑患者信息
- */
- $("#rapidAcceptsEditUser").on("click", function (t) {
- editUserModal($("#rapidAcceptsUserCode").val(), 2);
- ksjzType = 2 ;
- });
- //监听滚动停止处理逻辑开始
- let t1 = 0;
- let t2 = 0;
- let timer = null; // 定时器
- $("#scroll-wrap").on("scroll", function () {
- // 滚动
- clearTimeout(timer)
- timer = setTimeout(isScrollEnd, 100)
- t1 = $("#scroll-wrap").scrollTop();
- })
- function isScrollEnd() {
- t2 = $("#scroll-wrap").scrollTop();
- if (t2 == t1) {
- clearTimeout(timer)
- closeObjectWebui(true);
- console.log("滚动停止", t2) // 这里处理
- }
- }
- //监听滚动停止处理逻辑结束
- //合理用药预警系统(医药学知识查询助手)
- $("#hlyyButton").on("click", function (t) {
- $("#hlyyTitle").html("合理用药预警系统(医药学知识查询助手)");
- showHlyyModel('hlyysmsDiv', 'hlyysmsLoading', 'hlyysmsModal', "http://172.16.32.121:9097/index.html#");
- });
- //预约挂号日期控件注册
- $('#registrationTime').datetimepicker({
- language: 'zh-CN',
- //format: 'yyyy-mm-dd hh:ii:ss'
- format: 'yyyy-mm-dd',
- // showHour:false,
- // showMinute:false,
- // showSecond:false,
- // timeText:"",
- // timeFormat:"",
- minView: "month",
- autoclose: true,//选中自动关闭
- });
- //初始化号段下拉选
- initMzWorkTime();
- //挂号日期控件注册
- $('#opTime').datetimepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd hh:ii:ss',
- showHour: true,
- showMinute: true,
- showSecond: true,
- minView: "1", // 1 小时 2 日视图 3 月视图 4 年视图
- autoclose: true,//选中自动关闭
- });
- //出生日期控件注册
- $('#crbMainCardBirthDay').datetimepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- minView: "month",
- autoclose: true,//选中自动关闭
- });
- //发病日期控件注册
- $('#illStartDate').datetimepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- minView: "month",
- autoclose: true,//选中自动关闭
- });
- //诊断日期控件注册
- $('#illFirstDate').datetimepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- minView: "month",
- autoclose: true,//选中自动关闭
- });
- //死亡日期控件注册
- $('#deathDate').datetimepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- minView: "month",
- autoclose: true,//选中自动关闭
- });
- });
- /**
- * 刷新列表,解决越来越快的问题
- */
- function refreshList() {
- //clearInterval要放在方法开始,不然的话,下面的代码还没运行到clearInterval,又开始了循环了。
- clearInterval(timer);
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载已接诊患者列表 病人会缴费,需要刷新状态
- // loadClinicTableList();
- timer = setInterval(() => {
- refreshList()
- }, 60000);
- }
- /**
- * 门诊统筹额外内容
- */
- function expContentRequiredModal() {
- $("#expContentRequiredModal").modal("show");
- }
- /**
- * 打开科室选择页面
- */
- function selectDeptModal() {
- $("#selectDeptModal").modal("show");
- }
- /**
- * 打开配置页面
- */
- function configWorkspaceModal() {
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("show");
- }
- /**
- * 打开配置页面
- */
- function jumpToFy() {
- //console.log("val()",$("#clinicDeptNo").val())
- if (currentPatientInfo.patientId) {
- let data = {
- "healthNo":"",
- "patientNo":currentPatientInfo.patientId,
- "hospitalNo":"",
- "outpatientNo":"",
- "name":currentPatientInfo.name,
- "cardType":"01",
- "cardNo":currentPatientInfo.socialNo?currentPatientInfo.socialNo:"",
- "birthday":"",
- "age":"",
- "tel":currentPatientInfo.phoneNo?currentPatientInfo.phoneNo:"",
- "workOrgan":"",
- "lmp":""
- }
- const utf8Bytes = encodeURIComponent(JSON.stringify(data)).replace(/%([0-9A-F]{2})/g, (_, hex) => {
- return String.fromCharCode(parseInt(hex, 16));
- });
- let url = "http://192.168.100.140:18080/mchis-web/?token=321322199206140414&module=M102&data=" + btoa(utf8Bytes);
- window.open(url, "_blank");
- }
- }
- /**
- * 初始化用药天数下拉选
- */
- function initDayNum() {
- var html = '';
- for (var i = 1; i <= 112; i++) {
- html += '<option value="' + i + '">' + i + '</option>';
- }
- $('#dayNum').html(html);
- $('#dayNum').selectpicker('refresh');
- $('#dayZlNum').html(html);
- $('#dayZlNum').selectpicker('refresh');
- $('#medcDays').html(html);
- $('#medcDays').selectpicker('refresh');
- setSelectDefaultVal('medcDays',1)
- }
- /**
- * 根据病人姓名查询病人信息
- */
- function queryUserInfoByName() {
- var userName = $('#rapidAcceptsUserName').val();
- // var cardNo=$("#cardNo").val();
- if (userName == null || userName == "") {
- return;
- }
- if (userName.length > 0) {
- clearRapidAcceptsModal();
- $.ajax({
- type: "GET",
- url: '/thmz/getPatientMiByName?name=' + userName,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- fitPatient(res,"icCardNo");
- }
- }
- });
- }
- }
- /**
- * 按照病人id查询病人信息
- * @param patientId
- */
- function fillPatinet(value) {
- $("#rapidAcceptsUserCardNo").val(value);
- queryUserInfoByCardNo()
- }
- /**
- * 下拉框设置默认值
- * @param id
- * @param val
- */
- function setSelectDefaultVal(id,val) {
- $('#'+id).val(val)
- $('#'+id).selectpicker('refresh');
- }
- /**
- * 处方回调
- */
- function resetGroupIdSelect() {
- var groupIds = $("#groupId option");
- var usedGroupIdInputs = $("#xyTabContent").find("input.temporary_items_groupId");
- if (usedGroupIdInputs != null && usedGroupIdInputs.length > 0) {
- let lastGroupId = 0;
- for (var i = 0; i < usedGroupIdInputs.length; i++) {
- var groupId = Number($(usedGroupIdInputs[i]).val());
- if (groupId > lastGroupId) {
- lastGroupId = groupId;
- }
- }
- if (groupIds != null && groupIds.length > 1) {
- for (var i = 0; i < groupIds.length; i++) {
- var groupId = $(groupIds[i]).val();
- if (groupId <= lastGroupId) {
- continue;
- }
- $(groupIds[i]).remove();
- //删除给药方式与其他属性的缓存
- groupIdMap.remove(groupId);
- }
- appendGroupOrder();
- }
- } else if (groupIds != null && groupIds.length > 1) {
- initGroupOrder();
- }
- }
- /**
- * 初始化药品分组下拉选
- */
- function initGroupOrder() {
- var html = '<option value="1">1</option>';
- $('#groupId').html(html);
- $('#groupId').selectpicker('refresh');
- $("#groupId").selectpicker('val', 1);
- $('#groupId').selectpicker('refresh');
- groupIdMap = new MyMap();
- }
- /**
- * 追加分组
- */
- function appendGroupOrder() {
- var last = parseInt($("#groupId > option:last").val());
- last++;
- var html = '<option value="' + last + '">' + last + '</option>';
- $('#groupId').append(html);
- $('#groupId').selectpicker('refresh');
- }
- /**
- * 组号改变事件
- */
- function groupIdChange() {
- //var last = parseInt($("#groupId > option:last").val());
- var groupId = $("#groupId").val();
- var keys = groupIdMap.keySet();
- if (keys.indexOf(groupId) < 0) {
- //是新增药品清空药品输入区域
- var updateFlag = $("#western_medicine_update_flag").val();
- var currentCode = $("#western_medicine_current_code").val();
- //当前时新增药品,而且没有选择药品的时候,组号变更,清空区域
- if ((updateFlag == undefined || updateFlag == null || updateFlag == "false" || updateFlag == false) && (currentCode == null || currentCode == "")) {
- clearWesternMedicine(true);
- }
- } else {
- var map = groupIdMap.get(groupId);
- if (map != null) {
- var supplyType = map.get("supplyType");
- var orderFrequency = map.get("orderFrequency");
- var dayNum = map.get("dayNum");
- //用法编码
- $("#supplyType").selectpicker('val', supplyType);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").attr("disabled", "disabled");
- //天数
- $("#dayNum").selectpicker('val', dayNum);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").attr("disabled", "disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', orderFrequency);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").attr("disabled", "disabled");
- }
- }
- }
- /**
- * 关闭智能问诊弹框
- */
- function closePopover() {
- //$(".popover").popover('hide');
- $("#box-arrow-left").click();
- }
- /**
- * 关闭项目选择框
- * ReOpen 是否重新打开 true 打开 false 不打开
- */
- function closeObjectWebui(ReOpen) {
- var index = getIndex("bill_item_group");
- var currentCode = "western_medicine_name";
- if (index == 1) {
- currentCode = "chinese_medicine_name";
- } else if (index == 2) {
- currentCode = "jcJyItem";
- } else if (index == 3) {
- currentCode = "zlItem";
- }
- var webuiID = $("#" + currentCode).attr("data-target");
- if (webuiID != null && webuiID != "null" && webuiID != "") {
- //选择框打开
- if ($("#" + webuiID).hasClass("in") || $("#" + webuiID).css("display") == "block") {
- $("#" + currentCode).click();
- if (ReOpen) {
- $("#" + currentCode).click();
- }
- }
- }
- var symptomID = $("#symptom").attr("data-target");
- if (symptomID != null && symptomID != "null" && symptomID != "") {
- //选择框打开
- if ($("#" + symptomID).hasClass("in") || $("#" + symptomID).css("display") == "block") {
- $("#symptom").click();
- if (ReOpen) {
- $("#symptom").click();
- }
- }
- }
- var weightID = $("#weight").attr("data-target");
- if (weightID != null && weightID != "null" && weightID != "") {
- //选择框打开
- if ($("#" + weightID).hasClass("in") || $("#" + weightID).css("display") == "block") {
- $("#weight").click();
- if (ReOpen) {
- $("#weight").click();
- }
- }
- }
- var diagnoseID = $("#diagnose").attr("data-target");
- if (diagnoseID != null && diagnoseID != "null" && diagnoseID != "") {
- //选择框打开
- if ($("#" + diagnoseID).hasClass("in") || $("#" + diagnoseID).css("display") == "block") {
- $("#diagnose").click();
- if (ReOpen) {
- $("#diagnose").click();
- }
- }
- }
- }
- /**
- * 加载智能问诊弹框内容
- */
- function contentMethod() {
- setTimeout(function () {
- closeObjectWebui(false);
- $(".popover div.arrow").css("display", "none");
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (popoverId == undefined) {
- return;
- }
- var left = $("#" + popoverId).css("left");
- left = left.replace("px", "");
- left = parseInt(left);
- left = left + 55;
- $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
- $("#" + popoverId + " .popover-content").css("height", "100%");
- $("#smartAssistPopoverContent").css("height", "100%");
- var html = ' <div style="height: 24%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' <span id="patientHisData"></span>就医轨迹' +
- ' </button>' +
- ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
- ' </button>' +
- ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 23%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
- ' class="btn btn-primary">' +
- ' <span id="recommendType"></span>推荐' +
- ' </button>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
- ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 53%;padding-left: 15px;width: 100%;">' +
- ' <button type="button"' +
- ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' 医疗范本' +
- ' </button>' +
- ' <div class="item" style="width: 230px;height: 35px;float: right;line-height: 35px;margin-right: 40px;">' +
- ' <div class="col-md-6 col-sm-6 col-xs-12">' +
- ' <select class="form-control selectpicker show-tick" title="范文范围" onchange="fitTemplateData()"' +
- ' id="templateTypeForm">' +
- ' </select>' +
- ' </div>' +
- ' <div class="col-md-6 col-sm-6 col-xs-12">' +
- ' <select class="form-control selectpicker show-tick" title="范文类型" onchange="fitTemplateData()"' +
- ' id="templateKindTypeForm">' +
- ' </select>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;position: relative;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;" id="TemplateData">' +
- ' </form>' +
- ' </div>' +
- ' </div>';
- $("#smartAssistPopoverContent").html(html);
- initTemplateTypeSelect("templateTypeForm");
- initTemplateKindTypeSelect('templateKindTypeForm');
- fitPatientHisData();
- fitSymptomData();
- fitEmrHpiData();
- fitEmrPsData();
- fitDiagnoseData();
- fitTemplateData();
- }, 100);
- // setTimeout(function () {
- // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
- // },1000);
- }
- /**
- * 设置患者的就诊轨迹
- */
- function fitPatientHisData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- return;
- }
- var patientId = $("#patientId").text();
- if (patientId == null || patientId == "") {
- patientId = $("#userName").val();
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "commonParams": patientId,
- //"clinicStatuses": [5, 6],
- "clinicStatuses": [6],
- "pageSize": 10000,
- "offset": 0,
- "beginDate": "2012-02-01 00:00:00",
- "endDate": "",
- "doctorCode": "-1"
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var icdText = data[i].icdText;
- if (icdText == null) {
- // continue;
- icdText = "空白诊断";
- }
- icdText = icdText.trim();
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div style="float: left;width: 172px;">';
- html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
- html += ' </div>';
- html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
- html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- var patientName = $("#patientName").text();
- if (patientName == null || patientName == "") {
- if (res.mzPatientMi != null) {
- patientName = res.mzPatientMi.name;
- } else {
- patientName = patientId;
- }
- }
- $("#patientHisData").text(patientName + "的");
- if (($("#patientId").text() == null || $("#patientId").text() == "") && ($("#userName").val() == null || $("#userName").val() == "")) {
- $("#patientHisDataForm").html(emptyHtml);
- } else {
- $("#patientHisDataForm").html(html);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置主诉推荐
- */
- function fitSymptomData() {
- fitRecommendData(12);
- }
- /**
- * 设置现病史推荐
- */
- function fitEmrHpiData() {
- fitRecommendData(5);
- }
- /**
- * 设置既往史推荐
- */
- function fitEmrPsData() {
- fitRecommendData(6);
- }
- /**
- * 设置诊断推荐
- */
- function fitDiagnoseData() {
- fitRecommendData(13);
- }
- /**
- * 设置推荐通用方法
- */
- function fitRecommendData(paramsType) {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var inputId = "symptom";
- var text = "主诉";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史";
- } else if (paramsType == 13) {
- inputId = "diagnose";
- text = "诊断";
- }
- //光标不在现病史上
- if (document.activeElement.id != inputId) {
- return;
- }
- $("#recommendType").html(text);
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var paramsContent = data[i].paramsContent;
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
- html += paramsContent;
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;"';
- html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ',' + data[i].id + ')">';
- html += ' <img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#recommendForm").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置医疗范文方法
- */
- function fitTemplateData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;margin-left: 145px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplate?templateKindType=' + $("#templateKindTypeForm").val() + '&templateType=' + $("#templateTypeForm").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var template = data[i];
- var icdText = (template.icdText == null || template.icdText == "") ? "无" : template.icdText;
- html += ' <div class="item form-group thmz_alert" style="width: 100%;">';
- html += ' <div title="' + template.name + '"';
- html += ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">';
- html += template.name;
- html += ' </div>';
- html += ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"';
- html += ' title="' + template.icdText + '">诊断:<a';
- html += ' style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="medicalModelModal(' + template.id + ')">' + icdText + '</a>';
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(' + template.id + ')"><img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#TemplateData").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空快速接诊弹窗
- */
- function clearRapidAcceptsModal() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- $('#rapidAcceptsProvinceCode').selectpicker('val', null);
- $('#rapidAcceptsProvinceCode').selectpicker('refresh');
- $('#rapidAcceptsCityCode').selectpicker('val', null);
- $('#rapidAcceptsCityCode').selectpicker('refresh');
- $('#rapidAcceptsDistrictCode').selectpicker('val', null);
- $('#rapidAcceptsDistrictCode').selectpicker('refresh');
- $("#rapidAcceptsDetail").val(null);
- $("#rapidAcceptsDetail").attr("title", null);
- $("#rapidAcceptsUserContact").val(null);
- $("#rapidAcceptsUserContactPhone").val(null);
- }
- /**
- * 清空接诊台用户信息
- * @param flag 是否清空分诊流水哈 true 清空
- */
- function clearUser(flag) {
- $("#patientName").html("");
- $("#patientAge").html("");
- $("#patientGender").html("");
- $("#patientId").text(null);
- $("#visitTimes").val(null);
- $("#crbMainCard").css("display", "none");
- $("#editUser").css("display", "none");
- $("#clearUser").css("display", "none");
- $("#discountLvCard").css("display", "none");
- $("#mallTcCard").css("display", "none");
- // $("#fetchSpcSlwinfo").css("display", "none");
- $("#patientPhone").html("");
- $("#patientPhoneLabel").hide();
- $("#patientResponseType").html("");
- $("#first").next().click();
- $("#patientHisData").text("");
- initGhFeeSelect()
- $('#mzOrderTypeSelect').val('1');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- $("#mzReqTypeName").text(null);
- $("#mzReqType").val(null);
- if (flag) {
- $("#transferTreatment").css("display", "none");
- $("#consultation").css("display", "none");
- $("#mzfzSerialNoInClick").val(null);
- $("#mzfzReqTypeNoInClick").val(null);
- $("#turnToConsultationIdInClick").val(null);
- }
- }
- /**
- * 卡号输入改变事件
- */
- function cardNoChange() {
- // if (window.ActiveXObject || "ActiveXObject" in window) {
- // $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
- // queryUserInfoByCardNo();
- // });
- // } else {
- // $("#rapidAcceptsUserCardNo").on('input οninput', function () {
- // queryUserInfoByCardNo();
- // });
- // }
- $("#rapidAcceptsUserCardNo").on('keydown', function (event) {
- if (event.key === "Enter") {
- event.preventDefault(); // 阻止默认行为(如表单提交)
- queryUserInfoByCardNo();
- }
- });
- // $("#rapidAcceptsUserCardNo").on('blur', function (event) {
- // queryUserInfoByCardNo();
- // });
- $("#rapidAcceptsUserCardNoBtn").on('click', function (event) {
- queryUserInfoByCardNo();
- });
- }
- /**
- * 刷新就诊列表
- */
- function refreshClinic() {
- loadInClinicTableList();
- loadClinicTableList();
- fitPatientHisData();
- }
- /**
- * 加载已接诊患者列表
- */
- function loadClinicTableList() {
- //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
- loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
- initZyClassTypeSelect()
- }
- /**
- * 加载患者列表通用方法
- * @param id
- * @param queryParams
- */
- function loadCommonClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'patientName',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- var age = row.age;
- if (age == null || age == "null") {
- age = "";
- }
- let tfName = ''
- if(row.clinicStatus == 7){
- tfName = '/退'
- }
- return value + "/" + row.gender + "/" + age+ tfName;
- }
- }, {
- field: 'opDay',
- title: '接诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.clinicStatus == 5) {
- return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- // return '<a title="修改" style="cursor: pointer" onclick="getMzPrescriptionVoUnPaid(\'' + row.patientId + '\',' + row.times + ',' + row.id + ')">修改</a> <a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',5)">详情</a>';
- } else if (row.clinicStatus == 6) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',0)">详情</a>';
- } else if (row.clinicStatus == 7) {
- return '<a title="接诊" style="cursor: pointer" onclick="repeatAccepts(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',\'' + row.deptCode + '\')">接诊</a> <a title="详情" style="cursor: pointer" onclick="prescriptionDetail(\'' + row.patientId + '\',' + row.times + ',' + row.id + ',1)">详情</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- patientList = data.rows
- $(".pagination-detail").css("display", "none");
- if (id == "tb_table_clinic") {
- $("#ClinicNum").html(data.total);
- } else {
- $("#inClinicNum").html(data.total);
- }
- }
- });
- }
- /**
- * 得到查询的参数 接诊中
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsInClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [8]
- };
- return temp;
- };
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsClinic(params) {
- var rePortRangeArr = getRePortRangeArr();
- var commonParams = $("#userName").val();
- var needDateParams = commonParams == null || commonParams == "null" || commonParams == "";
- var temp = {
- beginDate: needDateParams ? rePortRangeArr[0] : "2012-02-01 00:00:00" ,
- endDate: needDateParams ? rePortRangeArr[1]: format(new Date(),"yyyy-MM-dd HH:mm:ss"),
- commonParams: commonParams,
- clinicStatuses: [5, 6, 7],
- pageSize: params.limit,
- offset: params.offset
- };
- return temp;
- };
- /**
- * 加载待诊患者列表方法
- */
- function loadUnClinicTableList() {
- loadCanClinicTableList("tb_table_un_clinic", queryParamsUnClinic);
- }
- /**
- * 加载接诊中患者列表方法
- */
- function loadInClinicTableList() {
- loadCanClinicTableList("tb_table_in_clinic", queryParamsInClinic);
- }
- /**
- * 加载待诊和接诊中患者列表通用方法方法
- */
- function loadCanClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [2, 5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'name',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age;
- }
- }, {
- field: 'visitDate',
- title: '分诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.statusFlag == 0) {
- return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
- } else if (row.statusFlag == 8) {
- //TODO 继续接诊需要新方法
- return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">续诊</a> <a title="取消接诊" onclick="cancelClinic(\'' + row.patientId + '\',\'' + row.times + '\')" style="cursor: pointer">消诊</a>';
- } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
- var userIdCode = localStorage.getItem("userIdCode");
- if (userIdCode === row.doctorCode) {
- return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a> <a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
- }
- return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\',' + row.reqType + ')" style="cursor: pointer">接诊</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- $("#unClinicNum").html(data.total);
- }
- });
- }
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParamsUnClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- statusFlagList: [0, 1, 2, 3]
- };
- return temp;
- };
- /**
- * 通知叫号
- * @param serialNo
- */
- function clinicCallNumber(serialNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/clinicCallNumber?serialNo=' + serialNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 接诊方法
- * @param patientId 门诊id
- * @param serialNo 分诊流水号
- * @param reqType 号表类别
- */
- function clinicalReception(patientId, serialNo, reqType) {
- var existPatientId = $("#patientId").text();
- if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
- $("#messageModal").modal();
- $("#messageContent").html("当前有病人正在接诊,是否切换?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription(1);
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- realClinicalReception(patientId, serialNo, reqType);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- clearWorkSpace();
- realClinicalReception(patientId, serialNo, reqType);
- });
- });
- $("#cancelButton").off("click");
- } else {
- realClinicalReception(patientId, serialNo, reqType);
- }
- }
- /**
- * 取消接诊
- * @param patientId
- */
- function cancelClinic(patientId, times) {
- $("#messageModal").modal();
- $("#messageContent").html("确认取消当前病人的接诊记录吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/cancelClinic?patientId=' + patientId + "×=" + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.length == 0) {
- return;
- }
- successMesage(res);
- if (times > 0) {
- notFirstYX02 = false
- hasJcInYx = false
- viewRecordId = null
- jcItemList = null
- loadUnClinicTableList();
- loadInClinicTableList();
- clearWorkSpace();
- }
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- };
- /**
- * 设置当前接诊病人信息
- * @param mzPatientMi
- */
- function setMzPatientInfo(mzPatientMi) {
- postAjaxJsonHttpRequst("/thmz/getSqGhfFlag",{patientId:mzPatientMi.patientId},true,function (res) {
- $("#ghFeeSelect").val(res.data)
- $('#ghFeeSelect').selectpicker('refresh');
- })
- $.ajax({
- type: "GET",
- url: '/thmz/getDeptNoByCurrentPatientId?patientId=' + mzPatientMi.patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //当前患者就诊科室编码
- localStorage.setItem("currentDeptNo", res.data.code);
- $("#deptCode").val(res.data.code);
- $("#deptName").val(res.data.name);
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- //处理影像平台接口需要数据
- $("#identityNo").val(mzPatientMi.socialNo);
- $("#visitCardNo").val(mzPatientMi.icCardNo);
- $("#birthDay").val(mzPatientMi.birthDay);
- $("#sex").val(mzPatientMi.sex);
- $("#mobile").val(mzPatientMi.phoneNo);
- notFirstYX02 = false
- hasJcInYx = false
- viewRecordId = null;
- jcItemList = null;
- currentPatientInfo = mzPatientMi
- $("#patientName").html(mzPatientMi.name);
- //var age = getAge(mzPatientMi);
- $("#patientAge").html(mzPatientMi.ageString);
- setVisitTypeName(mzPatientMi.patientId);
- $("#visitTimes").val(mzPatientMi.times);
- $("#patientGender").html(mzPatientMi.gender);
- $("#patientId").text(mzPatientMi.patientId);
- $("#crbMainCard").css("display", "inline-block");
- $("#editUser").css("display", "inline-block");
- $("#clearUser").css("display", "inline-block");
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
- $("#patientPhone").html(mzPatientMi.phoneNo);
- $("#patientPhoneLabel").show();
- } else {
- $("#patientPhoneLabel").hide();
- }
- $("#patientResponseType").html(mzPatientMi.responseTypeName);
- if (mzPatientMi.times == 1) {
- $("#first").next().click();
- } else {
- $("#not").next().click();
- }
- $("#patientHisData").text(mzPatientMi.name);
- fitPatientHisData();
- // setTmResponseType(mzPatientMi.patientId);
- }
- //设置病人身份
- function setVisitTypeName(patientId) {
- if(stringIsBlank(patientId)){
- return
- }
- postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
- if(res.code ==0){
- $("#patientVisitType").text(res.data);
- if(!stringIsBlank(res.data)){
- $("#discountLvCard").css("display", "inline-block");
- }
- }
- $("#crmType").text(res.crmTypeName);
- })
- postAjaxJsonHttpRequst("/thmz/queryWxmallPackagePurchasedItem",{patNo:patientId},true,function (res) {
- if(res.code == 0 && res.data != null && res.data.length > 0){
- $("#mallTcCard").css("display", "inline-block");
- }
- })
- }
- function closeMallTcDetailModal() {
- $("#mallTcDetailModal").modal("hide");
- }
- //保存商城套餐处方
- function saveMallTcOrder() {
- let allSelecteds = $('#mall_tc_detail_table').bootstrapTable('getAllSelections');
- if(allSelecteds == null && allSelecteds.length == 0){
- errorMesageSimaple('请选择需要开具的商城项目!')
- return
- }
- realSavePrescription(false,true);
- }
- //商城套餐
- function openMallTc() {
- $("#mallTcDetailModal").modal();
- initMallTcDetailTable();
- }
- //初始化
- function initMallTcDetailTable() {
- let patNo = $("#patientId").text();
- if(stringIsBlank(patNo)){
- errorMesageSimaple("请先就诊!")
- return
- }
- $('#mall_tc_detail_table').bootstrapTable("destroy");
- $('#mall_tc_detail_table').bootstrapTable({
- url: '/thmz/queryWxmallPackagePurchasedItem', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- // sortName: 'orderNo', //排序字段
- queryParams: function () {
- return {
- patNo:patNo
- }
- }, //传递参数(*)
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 25, //每页的记录行数(*)
- pageList: [25, 50, 75, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- checkbox: true,
- },
- {
- field: 'hisCode',
- title: '项目编码',
- align: "center",
- valign: 'middle'
- }, {
- field: 'hisName',
- title: '项目名称',
- align: "center",
- valign: 'middle',
- }, {
- field: 'quantity',
- title: '购买的数量',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'usableQuantity',
- title: '可使用数量',
- align: "center",
- valign: 'middle',
- },{
- field: 'originPrice',
- title: '原价(元)',
- align: "center",
- valign: 'middle',
- }, {
- field: 'price',
- title: '优惠单价(元)',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'costAmt',
- title: '总价',
- align: "center",
- valign: 'middle'
- }, {
- field: 'type',
- title: '项目类型',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == 'JY') {
- return '检验';
- }else if(value == 'JC'){
- return '检查';
- }
- else if(value == 'ZL'){
- return '诊疗';
- }
- return "";
- }
- }
- , {
- field: 'lastUseTime',
- title: '最后使用时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null && value != "") {
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- return "";
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- //"total": ress.pageViewVo.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 判断是否是特门病人
- * @param patientId
- */
- function setTmResponseType(patientId) {
- postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":"","readCardResult":""},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#patientResponseType").html("特殊门诊");
- $("#fetchSpcSlwinfo").css("display", "inline-block");
- }
- }
- })
- }
- //删除股东卡身份
- // function deleteShareholderCard() {
- // let patientId = $("#patientId").text();
- // if(stringIsBlank(patientId)){
- // errorMesageSimaple("请先选择就诊病人")
- // return
- // }
- // postAjaxJsonHttpRequst("/thmz/deleteShareholderCard",{patientId:patientId},true,function (res) {
- // if(res.code ==0){
- // $("#patientVisitType").text("");
- // successMesageSimaple(res.message)
- // }else {
- // errorMesage(res)
- // }
- // })
- // }
- //慢病建档
- function cmrCreate() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzjsdHost',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- let patientId = $("#patientId").text();
- if(stringIsBlank(patientId)){
- return errorMesageSimaple('门诊号不能为空,请先接诊')
- }
- getAjaxRequst("/thmz/getByPatientId",{patientId:patientId},true,function (ress) {
- if(ress.code ==0){
- let cmrType ;
- let userIdCode = localStorage.getItem("userIdCode");
- if(stringIsBlank($("#crmType").text())){
- cmrType = '2'
- }else {
- cmrType = '1'
- }
- window.open(`${res.data}/outpatient/chronicDisease/chronicDiseaseRegister?socialNo=${ress.data.socialNo}&type=${cmrType}&userCode=${userIdCode}`, '_blank');
- }
- })
- }
- }
- });
- }
- var curOpspDiseCode =null;
- var curOpspDiseName =null;
- function openFetchSpcSlwinfoModal() {
- $("#fetchSpcSlwinfoModal").modal();
- $("#fetchSpcSlwinfoTable").html(null);
- clearOpspDiseData();
- }
- /**
- * 清除特门数据
- */
- function clearOpspDiseData() {
- curOpspDiseCode =null;
- curOpspDiseName =null;
- visitMtCardResult = null;
- }
- /**
- * 关闭门特窗口
- */
- function closeFetchSpcSlwinfoModal() {
- $("#fetchSpcSlwinfoModal").modal("hide");
- clearOpspDiseData();
- }
- /**
- * 特门详情
- * @param patientId
- */
- function fetchSpcSlwinfo() {
- let patientId = $("#patientId").text();
- let visitAdvmCity = $("#visitAdvmCity").val();
- postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":visitAdvmCity,"readCardResult":visitMtCardResult},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.length == 0 ){
- errorMesageSimaple("该患者没有特门信息");
- }
- if (res.data != null && res.data.length > 0) {
- for (var i = 0; i < res.data.length; i++) {
- var begndate = res.data[i].begndate;
- if (begndate == null || begndate == "null") {
- begndate = "";
- }
- var enddate = res.data[i].enddate;
- if (enddate == null || enddate == "null") {
- enddate = "";
- }
- var opspDiseName = res.data[i].opspDiseName;
- if (opspDiseName == null || opspDiseName == "null") {
- opspDiseName = "";
- }
- var opspDiseCode = res.data[i].opspDiseCode;
- if (opspDiseCode == null || opspDiseCode == "null") {
- opspDiseCode = "";
- }
- var ideFixmedinsName = res.data[i].ideFixmedinsName;
- if (ideFixmedinsName == null || ideFixmedinsName == "null") {
- ideFixmedinsName = "";
- }
- $("<tr 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 () {
- $("#fetchSpcSlwinfoModal").modal("hide");
- curOpspDiseCode = $(this).attr("data-target-opspDiseCode");
- curOpspDiseName = $(this).attr("data-target-opspDiseName");
- //设置特殊门诊值
- $("#mzOrderTypeSelect").val('3')
- $('#mzOrderTypeSelect').selectpicker('refresh');
- });
- }
- } else {
- errorMesage(res);
- }
- } else {
- errorMesage(res);
- }
- })
- }
- function initAdvmPro(proId) {
- getAjaxRequst("/thmz/queryProvinceCodes",{},true,function (res) {
- if(res.code == 0 && res.data !=null && res.data.length > 0){
- let selectHtml = '';
- for (let i=0 ; i <res.data.length; i++ ){
- selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
- }
- $('#'+proId).html(selectHtml);
- $('#'+proId).selectpicker('refresh');
- $('#'+proId).val(430000);
- $('#'+proId).selectpicker('refresh');
- cityChange('visitAdvmPro','visitAdvmCity',430100)
- }
- })
- }
- function cityChange(proId,cityId,defalultVal) {
- let code = $('#'+proId).val()
- postAjaxJsonHttpRequst("/thmz/queryCityCodes",{code:code},true,function (res) {
- if(res.code == 0 && res.data !=null && res.data.length > 0){
- let selectHtml = '';
- for (let i=0 ; i <res.data.length; i++ ){
- selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
- }
- $('#'+cityId).html(selectHtml);
- $('#'+cityId).selectpicker('refresh');
- if(!stringIsBlank(defalultVal)){
- $('#'+cityId).val(defalultVal);
- $('#'+cityId).selectpicker('refresh');
- }
- }
- })
- }
- var visitMtCardResult = null;
- function readVisitPatientCard() {
- $.ajax({
- type: "GET",
- // url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
- url: 'http://localhost:8321/api/entry?param=jiangsu_qrcode_01101',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 200) {
- visitMtCardResult = res.data
- fetchSpcSlwinfo()
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初诊的时候设置患者生命体征
- * @param res
- */
- function setMzSmtz(res) {
- var mzYshTzxx = res.mzYshTzxx;
- if (mzYshTzxx != null) {
- if (mzYshTzxx.valueTz != null) {
- $("#weight").val(mzYshTzxx.valueTz);
- }
- if (mzYshTzxx.valueTw != null) {
- $("#temperature").val(mzYshTzxx.valueTw);
- }
- if (mzYshTzxx.valueMb != null) {
- $("#sphygmus").val(mzYshTzxx.valueMb);
- }
- if (mzYshTzxx.valueHx != null) {
- $("#breathe").val(mzYshTzxx.valueHx);
- }
- if (mzYshTzxx.valueSsy != null) {
- $("#pressure_high").val(mzYshTzxx.valueSsy);
- }
- if (mzYshTzxx.valueSzy != null) {
- $("#pressure_floor").val(mzYshTzxx.valueSzy);
- }
- }
- }
- /**
- * 真实的接诊方法
- * @param patientId
- * @param serialNo 分诊流水号
- * @param reqType 号表类别
- */
- function realClinicalReception(patientId, serialNo, reqType) {
- var turnToConsultationIdInClick = $("#turnToConsultationIdInClick").val();
- if (turnToConsultationIdInClick == null || turnToConsultationIdInClick == "null") {
- turnToConsultationIdInClick = 0;
- }
- var userIdCode = localStorage.getItem("userIdCode");
- var deptNo = localStorage.getItem(userIdCode);
- if (deptNo == null) {
- deptNo = "";
- }
- $.ajax({
- type: "GET",
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick + "&deptNo=" + deptNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- setMzReqType(null,null,reqType);
- var mzPatientMi = res.data;
- setMzPatientInfo(mzPatientMi);
- setMzSmtz(res);
- $("#identityNo").val(mzPatientMi.socialNo);
- $("#visitCardNo").val(mzPatientMi.icCardNo);
- $("#birthDay").val(mzPatientMi.birthDay);
- $("#sex").val(mzPatientMi.sex);
- $("#mobile").val(mzPatientMi.phoneNo);
- // tb_table_un_clinic
- $("#mzfzSerialNoInClick").val(serialNo);
- $("#mzfzReqTypeNoInClick").val(reqType);
- //有分诊流水号 且 不是简易门诊 或 会诊目标科室接诊
- if (serialNo != null && serialNo != "null") {
- if (!(reqType == "16" || reqType == 16 || reqType == -200)) {
- $("#transferTreatment").css("display", "inline-block");
- }
- $("#consultation").css("display", "inline-block");
- }
- notFirstYX02 = false
- hasJcInYx = false
- viewRecordId = null;
- jcItemList = null;
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //查询患者的门诊统筹信息
- // queryInsuinfo(patientId);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询患者的门诊统筹信息
- * @param patientId
- */
- function queryInsuinfo(patientId) {
- getAjaxRequst("/thmz/queryInsuinfo",{patientId: patientId},true,function (insurRes) {
- if(insurRes.code == 0){
- var ybCode = localStorage.getItem("ybCode");
- if(ybCode !=null && ybCode !="" && ybCode.length > 0){
- $("#zgmztczf").selectpicker('val',1);
- $("#zgmztczf").selectpicker('refresh');
- if($("#mzOrderTypeSelect").val() !='4'){
- $("#mzOrderTypeSelect").selectpicker('val','2');
- $("#mzOrderTypeSelect").selectpicker('refresh');
- }else {
- $("#zgmztczf").selectpicker('val',0);
- $("#zgmztczf").selectpicker('refresh');
- }
- postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
- if(res.code ==0){
- if(!stringIsBlank(res.data)){
- warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
- }
- }
- })
- }else {
- $("#zgmztczf").selectpicker('val',0);
- $("#zgmztczf").selectpicker('refresh');
- }
- }else if(insurRes.code == -1){
- errorMesageSimaple(insurRes.message);
- }else if(insurRes.code == -2){
- warningMesageSimaple(insurRes.message);
- }
- })
- }
- /**
- * 读医保电子凭证
- * @param asyncFlag true 异步 false 同步
- * @param params
- */
- function mztczfSiReadCard(asyncFlag, params) {
- mztczfSiReadCardStatus = true;
- $.ajax({
- type: "GET",
- url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: asyncFlag,
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- mztczfSiReadCardStatus = false;
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- //console.log(res);
- if (res.code == 200) {
- var data = JSON.parse(res.data);
- $("#readCardResult").val(JSON.stringify(data.data));
- $("#messageContent").html("读卡成功,是否保存处方?");
- } else {
- $("#messageContent").html("读卡失败,是否保存处方(不享受门诊统筹)?");
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- mztczfSiReadCardStatus = false;
- $("#messageContent").html("读卡异常,是否保存处方(不享受门诊统筹)?");
- }
- });
- }
- /**
- * 实际读医保电子凭证
- * @param asyncFlag true 异步 false 同步
- */
- function realMztczfSiReadCard(asyncFlag) {
- }
- /**
- * 清空工作台
- */
- function clearWorkSpace() {
- clearUser(true);
- clearWorkSpaceExcludeUser(1);
- }
- /**
- * 清空工作台除了用户信息
- * @param source 1 清空工作台 2 调用模板 3 调用历史处方
- */
- function clearWorkSpaceExcludeUser(source) {
- var conciseRecordsFlag = false;
- if (source == 2) {
- conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
- } else if (source == 3) {
- conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
- }
- if (source == 1 || conciseRecordsFlag) {
- $("#symptom").val(null);
- $("#emrHpi").val(null);
- $("#emrPs").val(null);
- $("#personalHistory").val(null);
- $("#familyHistory").val(null);
- $("#fzZl").val(null);
- $("#crbHistory").val(null);
- $("#obstericalHistory").val(null);
- $("#weight").val(null);
- $("#temperature").val(null);
- $("#sphygmus").val(null);
- $("#breathe").val(null);
- $("#pressure_high").val(null);
- $("#pressure_floor").val(null);
- $("#pressure_high_left").val(null);
- $("#pressure_floor_left").val(null);
- $("#tentativeDiagnosis").val(null);
- $("#otherCheck").val(null);
- $("#diagnoseValue").val(null);
- $("#diagnoseTags").html(null);
- $("#tcmDiagnoseValue").val(null);
- $("#tcmDiagnoseTags").html(null);
- $("#healthEducation").val(null);
- $("#zdAllergen").selectpicker('val', null);
- $("#zdAllergen").selectpicker('refresh');
- $("#ypDitList").selectpicker('val', null);
- $("#ypDitList").selectpicker('refresh');
- }
- //清空工作台的时候需要调用
- if (source == 1) {
- clearWesternMedicine(true);
- clearChineseMedicine();
- clearJyJcItem();
- clearZlItem();
- clearZyReq();
- //initNavTabs(0);
- clearNavTabs(0);
- clearNavTabs(1);
- clearNavTabs(2);
- clearNavTabs(3);
- clearNavTabs(4);
- clearNavTabs(5);
- clearNavTabs(6);
- clearApidAcceptsModal();
- clearTurnToConsultationInput();
- clearZgtczfInput();
- clearOpspDiseData();
- clearExpContentRequired();
- gropuIdAndOrderNoMap = null;
- //prevCategoriesFlag = null;
- initGroupOrder();
- localStorage.removeItem("currentDeptNo");
- getResultUrl = null;
- }
- $("#totalAmount").text(0);
- }
- /**
- * 构造西药处方详情和模板预览方法
- * @param pyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitxyContent(pyPrescription, contentId, titleId, checkBox) {
- if (pyPrescription != null && pyPrescription.length > 0) {
- var xypyHtml = "";
- for (var i = 0; i < pyPrescription.length; i++) {
- var py = pyPrescription[i];
- if (py == null || py.length == 0) {
- continue;
- }
- var detail = py.detail;
- if (detail == null || detail.length == 0) {
- continue;
- }
- for (var j = 0; j < detail.length; j++) {
- var pyDetail = detail[j];
- if (checkBox) {
- xypyHtml += "<div style='cursor: pointer;' data-id='" + pyDetail.orderCode + "'>";
- xypyHtml += "<input type='checkbox'/>";
- xypyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- xypyHtml += "<div>";
- }
- xypyHtml += "<span style='color: red;'>" + pyDetail.groupOrder + "." + "</span>";
- xypyHtml += pyDetail.name;
- xypyHtml += " ";
- xypyHtml += pyDetail.specification;
- xypyHtml += " X ";
- xypyHtml += pyDetail.quantity;
- xypyHtml += pyDetail.packUnit;
- xypyHtml += " 用法: ";
- xypyHtml += pyDetail.supplyName;
- xypyHtml += " ";
- xypyHtml += pyDetail.drugQuan;
- xypyHtml += pyDetail.unitDesc;
- xypyHtml += " ";
- xypyHtml += pyDetail.frequency;
- xypyHtml += " ";
- xypyHtml += pyDetail.orderDays;
- xypyHtml += "天 ";
- if (pyDetail.tryFlag != undefined && pyDetail.tryFlag != null && pyDetail.tryFlag != "null" && pyDetail.tryFlag != "") {
- xypyHtml += pyDetail.tryFlag;
- } else if (pyDetail.tryResult != undefined && pyDetail.tryResult != null && pyDetail.tryResult != "null" && pyDetail.tryResult != "") {
- xypyHtml += pyDetail.tryResult;
- }
- if (checkBox) {
- xypyHtml += "</span>";
- }
- xypyHtml += "</div>";
- }
- }
- afterFitContent(contentId, xypyHtml, titleId);
- } else {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- }
- }
- /**
- * 构造中药处方详情和模板预览方法
- * @param zyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitzyContent(zyPrescription, contentId, titleId, checkBox) {
- if (zyPrescription == null || zyPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zyDetail = zyPrescription[0];
- if (zyDetail == null || zyDetail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var detail = zyDetail.detail;
- if (detail == null || detail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zypyHtml = "";
- for (var i = 0; i < detail.length; i++) {
- //zypyHtml += '<div class="item form-group" style="margin-bottom: -5px;">';
- var zy = detail[i];
- if (zy == null || zy.length == 0) {
- continue;
- }
- if (checkBox) {
- zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\" style='cursor: pointer;' data-id='" + zy.orderCode + "'>";
- zypyHtml += "<input type='checkbox'/>";
- zypyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\">";
- }
- zypyHtml += zy.name;
- if(zy.spec){
- zypyHtml += "("+zy.spec+")";
- }
- var instructionText = zy.instructionText;
- if (instructionText != null && instructionText != "") {
- zypyHtml += "[";
- zypyHtml += instructionText;
- zypyHtml += "]";
- }
- zypyHtml += zy.quantity;
- if(zyDetail.groupNo =='83'){
- zypyHtml += "袋";
- }else {
- zypyHtml += "g";
- }
- if (checkBox) {
- zypyHtml += "</span>";
- }
- zypyHtml += "</div>";
- // if (i % 4 == 0) {
- // zypyHtml += '</div>';
- // }
- }
- // if(detail.length%4!=0){
- // for(var i=0;i<4-(detail.length%4);i++){
- // zypyHtml += "<div class=\"col-md-3 col-sm-3 col-xs-12\"></div>";
- // }
- // }
- var zyfs = zyDetail.zyfs;
- if (zyfs != null && zyfs != "") {
- zypyHtml += " <div class=\"col-md-12 col-sm-12 col-xs-12\">";
- zypyHtml += ' <div style="text-indent: 2em;">';
- zypyHtml += ' <div>';
- zypyHtml += 'x<span>';
- zypyHtml += zyfs;
- zypyHtml += '</span> 付</div>';
- }
- afterFitContent(contentId, zypyHtml, titleId);
- }
- /**
- * 构造辅助检查、检验处方详情和模板预览方法
- * @param jcjyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitJcjyContent(jcjyPrescription, contentId, titleId, checkBox) {
- if (jcjyPrescription == null || jcjyPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var jcjyDetail = jcjyPrescription[0];
- if (jcjyDetail == null || jcjyDetail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var detail = jcjyDetail.detail;
- if (detail == null || detail.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var jcjyHtml = "";
- for (var i = 0; i < detail.length; i++) {
- var jcjy = detail[i];
- if (jcjy == null || jcjy.length == 0) {
- continue;
- }
- if (checkBox) {
- jcjyHtml += "<div style='cursor: pointer;' data-id='" + jcjy.orderCode + "'>";
- jcjyHtml += "<input type='checkbox'/>";
- jcjyHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- jcjyHtml += "<div>";
- }
- jcjyHtml += jcjy.index + ".";
- jcjyHtml += jcjy.name;
- var drugUnit = jcjy.drugUnit;
- if (drugUnit == undefined || drugUnit == null || drugUnit == "") {
- drugUnit = "";
- }
- var drugQuan = jcjy.drugQuan;
- if (drugQuan != undefined && drugQuan != null && drugQuan != "") {
- jcjyHtml += " 单量:" + drugQuan + drugUnit;
- }
- var orderDays = jcjy.orderDays;
- if (orderDays != undefined && orderDays != null && orderDays != "") {
- jcjyHtml += " 天数:" + orderDays + "天";
- }
- var frequency = jcjy.frequency;
- if (frequency != undefined && frequency != null && frequency != "") {
- jcjyHtml += " 频次:" + frequency;
- }
- var quantity = jcjy.quantity;
- if (quantity != undefined && quantity != null && quantity != "") {
- jcjyHtml += " 总量:" + quantity + drugUnit;
- }
- if (checkBox) {
- jcjyHtml += "</span>";
- }
- jcjyHtml += "</div>";
- }
- afterFitContent(contentId, jcjyHtml, titleId);
- }
- /**
- * 构造入院处方详情和模板预览方法
- * @param jcjyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitZyReqContent(zyReqPrescription, contentId, titleId, checkBox) {
- if (zyReqPrescription == null || zyReqPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var zyReqHtml = "";
- if (checkBox) {
- zyReqHtml += "<div style='cursor: pointer;'>";
- zyReqHtml += "<input type='checkbox'/>";
- zyReqHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- zyReqHtml += "<div>";
- }
- zyReqHtml += "收住院 [";
- zyReqHtml += zyReqPrescription.reqDept;
- if (zyReqPrescription.smallDept != null && zyReqPrescription.smallDept != "") {
- zyReqHtml += "(" + zyReqPrescription.smallDept + ")";
- }
- zyReqHtml += "]";
- if (zyReqPrescription.admissStatus != null && zyReqPrescription.admissStatus != "") {
- zyReqHtml += zyReqPrescription.admissStatus;
- }
- if (zyReqPrescription.conditionCode != null && zyReqPrescription.conditionCode != "") {
- zyReqHtml += " " + zyReqPrescription.conditionCode;
- }
- if (zyReqPrescription.routeOfAdmission != null && zyReqPrescription.routeOfAdmission != "") {
- zyReqHtml += " " + zyReqPrescription.routeOfAdmission;
- }
- zyReqHtml += " 侯床";
- if (checkBox) {
- zyReqHtml += "</span>";
- }
- zyReqHtml += "</div>";
- afterFitContent(contentId, zyReqHtml, titleId);
- }
- /**
- * 构造门诊外配药处方详情和模板预览方法
- * @param wpMedicinePrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitWpMedicineContent(wpMedicinePrescription, contentId, titleId, checkBox) {
- if (wpMedicinePrescription == null || wpMedicinePrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var wpMedicineHtml = "";
- for (var i = 0; i < wpMedicinePrescription.length; i++) {
- var wpMedicine = wpMedicinePrescription[i];
- if (wpMedicine == null || wpMedicine.length == 0) {
- continue;
- }
- if (checkBox) {
- wpMedicineHtml += "<div style='cursor: pointer;' data-id='" + wpMedicine.code + "'>";
- wpMedicineHtml += "<input type='checkbox'/>";
- wpMedicineHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- wpMedicineHtml += "<div>";
- }
- wpMedicineHtml += "<span style='color: red;'>" + (i+1) + "." + "</span>";
- wpMedicineHtml += wpMedicine.name;
- wpMedicineHtml += " ";
- wpMedicineHtml += wpMedicine.drugSpec;
- wpMedicineHtml += " X ";
- wpMedicineHtml += wpMedicine.drugCnt;
- wpMedicineHtml += wpMedicine.drugDosunt;
- wpMedicineHtml += " 用法 ";
- wpMedicineHtml += wpMedicine.medcWayDscr;
- wpMedicineHtml += " ";
- wpMedicineHtml += wpMedicine.sinDoscnt;
- wpMedicineHtml += wpMedicine.sinDosunt;
- wpMedicineHtml += " ";
- wpMedicineHtml += wpMedicine.usedFrquName;
- wpMedicineHtml += " ";
- wpMedicineHtml += wpMedicine.medcDays;
- wpMedicineHtml += "天";
- if (checkBox) {
- wpMedicineHtml += "</span>";
- }
- wpMedicineHtml += "</div>";
- }
- afterFitContent(contentId, wpMedicineHtml, titleId);
- }
- /**
- * 构造门诊手术处方详情和模板预览方法
- * @param jcjyPrescription
- * @param contentId 内容ID
- * @param titleId 标题ID
- * @param checkBox 是否需要增加ckeckBox
- */
- function fitOpRecordContent(opRecordPrescription, contentId, titleId, checkBox) {
- if (opRecordPrescription == null || opRecordPrescription.length == 0) {
- $("#" + titleId).removeClass("in").addClass("hide");
- $("#" + contentId).html("");
- return;
- }
- var opHtml = "";
- for (var i = 0; i < opRecordPrescription.length; i++) {
- var opRecord = opRecordPrescription[i];
- if (opRecord == null || opRecord.length == 0) {
- continue;
- }
- if (checkBox) {
- opHtml += "<div style='cursor: pointer;' data-id='" + opRecord.opCode + "'>";
- opHtml += "<input type='checkbox'/>";
- opHtml += "<span onclick='rowDataClick(this)'>";
- } else {
- opHtml += "<div>";
- }
- opHtml += opRecord.opName;
- var urgentClinicFlag = opRecord.urgentClinicFlag;
- if (urgentClinicFlag != undefined && urgentClinicFlag != null && urgentClinicFlag != "") {
- opHtml += " 急诊标志:" + urgentClinicFlag;
- }
- var ssbc = opRecord.ssbc;
- if (ssbc != undefined && ssbc != null && ssbc != "") {
- opHtml += " 班次:" + ssbc;
- }
- var partName = opRecord.partName;
- if (partName != undefined && partName != null && partName != "") {
- opHtml += " 手术部位:" + partName;
- }
- var opScale = opRecord.opScale;
- if (opScale != undefined && opScale != null && opScale != "") {
- opHtml += " 手术等级:" + opScale;
- }
- var hocusCode = opRecord.hocusCode;
- if (hocusCode != undefined && hocusCode != null && hocusCode != "") {
- opHtml += " 麻醉方式:" + hocusCode;
- }
- var doctorZd = opRecord.doctorZd;
- if (doctorZd != undefined && doctorZd != null && doctorZd != "") {
- opHtml += " 主刀医生:" + doctorZd;
- }
- if (checkBox) {
- opHtml += "</span>";
- }
- opHtml += "</div>";
- }
- afterFitContent(contentId, opHtml, titleId);
- }
- /**
- * 处方详情构造方法后续事件,如所有的复选框默认勾选
- * @param contentId
- * @param zyReqHtml
- * @param titleId
- */
- function afterFitContent(contentId, zyReqHtml, titleId) {
- $("#" + contentId).html(zyReqHtml);
- $("#" + titleId).removeClass("hide").addClass("in");
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#" + titleId).find("input[type='checkbox']").prop("checked", true);
- $("#" + contentId).find("input[type='checkbox']").each(function (index, obj) {
- $(obj).prop("checked", true);
- });
- } else {
- $("#" + titleId).find("input[type='checkbox']").prop("checked", false);
- }
- }
- /**
- * 模板、详情页行数据点击事件
- * @param obj
- */
- function rowDataClick(obj) {
- $(obj).prev().click();
- }
- /**
- * 模板、详情页治疗分类标题点击事件
- * @param obj
- * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
- */
- function titleClick(obj, source) {
- var contentObj = $(obj).parent().next();
- var check = $(obj).prop("checked");
- if (source == 0) {
- var prev = $(obj).prev();
- check = !$(prev).prop("checked");
- $(prev).prop("checked", check)
- }
- if (contentObj != null) {
- $(contentObj).children().each(function (index, object) {
- //以下两个方法,单独调用一个可能不行
- $(object).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- });
- }
- }
- /**
- * 开单互认提醒服务
- * @param
- * @param
- */
- function HR02(jyItemArr) {
- let identityTypeCode = handleIdentityTypeCode($("#rapidAcceptsUserCertificateType").val())
- let diagCode = []
- let diagName = []
- $("#diagnoseTags").children("span").each(function() {
- var title = $(this).attr("title");
- var id = $(this).attr("id");
- diagCode.push(id)
- diagName.push(title)
- // console.log("Span - ID: " + id + ", Title: " + title);
- });
- // return
- let params = {
- url: 'http://20.46.201.94:9999/pmemr/productMutualRecognition/checkApply',
- reqBody: {
- " messages": {
- "EVN": {
- "eventTypeCode": "02",
- "eventTypeName": "开单互认提醒服务"
- },
- "PID": {
- "patientId": $("#patientId").text(),
- "identityTypeCode": identityTypeCode,
- "identityNo": $("#identityNo").val(),
- "visitCardTypeCode": "94", // 院内就诊卡
- "visitCardNo": $("#visitCardNo").val(),
- "personalName": $("#patientName").text(),
- "birthDate": formatDateToDate8(new Date(($("#birthDay").val()))),
- "sexCode": $("#sex").val(),
- "mobile": $("#mobile").val()
- },
- "PV1": {
- "visitTypeCode": "1", //门诊
- "visitNo": $("#mzfzSerialNoInClick").val(),
- "visitDate": formatDateToDate8(new Date()),
- "orgCode": "321322049",
- "orgName": "沭阳铭和医院",
- "deptCode": $("#deptCode").val(),
- "deptName": $("#deptName").val(),
- "wardCode": "",
- "wardName": "",
- "bedNo": "",
- "doctorId": localStorage.getItem("userID"),
- "doctorName": localStorage.getItem("userName"),
- "doctorIdentityNo": localStorage.getItem("socialNo"),
- "computerMac": "",
- "computerIp": ""
- },
- "DG1":{
- "chiefCompliant": $("#symptom").val(),
- "diagCode": diagCode.join(","),
- "diagName": diagName.join(",")
- },
- "OBR": {
- "lab": jyItemArr
- },
- "closeMethod": "", //0 跳转固定页blank.html
- "closeReminder": "" //1:关闭互认有效期内本院报告提醒,不传参数则默认提醒
- }
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/JyYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方明细复选框点击事件
- * @param obj
- * @param source 0 是标题的行点击事件 1 标题的checkbox本身触发
- */
- function prescriptionCfmxChosice(obj, source) {
- var check = $(obj).prop("checked");
- if (source == 0) {
- var prev = $(obj).prev();
- check = !$(prev).prop("checked");
- //以下两个方法,单独调用一个可能不行
- $(prev).prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- }
- var conents = $(obj).parent().parent().nextAll();
- if (conents == null || conents.length == 0) {
- return;
- }
- $(conents).each(function (index, object) {
- //以下两个方法,单独调用一个可能不行
- $(object).find("div:eq(0)").find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- var contentObj = $(object).find("div:eq(1)");
- if (contentObj != null) {
- $(contentObj).children().each(function (contentIndex, contentObject) {
- $(contentObject).find("input[type='checkbox']").prop("checked", check) //如果鼠标点击选中了,执行后可以取消选中
- });
- }
- });
- }
- /**
- * 简明病历标题点击事件
- * @param obj
- */
- function prescriptionJmblChosice(obj) {
- var prev = $(obj).prev();
- var check = !$(prev).prop("checked");
- $(prev).prop("checked", check); //如果鼠标点击选中了,执行后可以取消选中
- }
- /**
- * 医疗范文详情预览
- * @param id
- */
- function medicalModelModal(id) {
- closeObjectWebui(false);
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#conciseRecordsYlfw").prop("checked", true);
- $("#prescriptionSubsidiaryYlfw").prop("checked", true);
- } else {
- $("#conciseRecordsYlfw").prop("checked", false);
- $("#prescriptionSubsidiaryYlfw").prop("checked", false);
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateById?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- $("#vmedicalModelName").text(res.data.name);
- $("#idTemplate").val(res.data.id);
- $("#zsTemplate").html(jsonData.mzBlRecord.emrChiefComplaint);
- $("#xbsTemplate").html(jsonData.mzBlRecord.emrHpi);
- $("#tgjcTemplate").html(jsonData.mzBlRecord.emrPe);
- $("#jkjyTemplate").html(jsonData.mzBlRecord.emrJkjy);
- var icdText = res.data.icdText;
- $("#zdTemplate").html("");
- $("#xypyContent").html("");
- $("#xymjContent").html("");
- $("#xyjeContent").html("");
- $("#yczlContent").html("");
- $("#zyzlContent").html("");
- $("#zlyjContent").html("");
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#zdTemplate").html(html);
- }
- var prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null && prescriptionDetail != "") {
- prescriptionDetail = JSON.parse(prescriptionDetail);
- var xyPrescription = prescriptionDetail.xyPrescription;
- if (xyPrescription != null) {
- fitxyContent(xyPrescription.pyPrescription, "xypyContent", "xypyTitle", true);
- fitxyContent(xyPrescription.mjPrescription, "xymjContent", "xymjTitle", true);
- fitxyContent(xyPrescription.jePrescription, "xyjeContent", "xyjeTitle", true);
- fitxyContent(xyPrescription.ycPrescription, "yczlContent", "yczlTitle", true);
- } else {
- $("#xypyTitle").removeClass("in").addClass("hide");
- $("#xypyContent").html("");
- $("#xymjTitle").removeClass("in").addClass("hide");
- $("#xymjContent").html("");
- $("#xyjeTitle").removeClass("in").addClass("hide");
- $("#xyjeContent").html("");
- $("#yczlTitle").removeClass("in").addClass("hide");
- $("#yczlContent").html("");
- }
- var zyPrescription = prescriptionDetail.zyPrescription;
- if (zyPrescription != null) {
- fitzyContent(zyPrescription, "zyzlContent", "zyzlTitle", true);
- } else {
- $("#zyzlTitle").removeClass("in").addClass("hide");
- $("#zyzlContent").html("");
- }
- var jcjyPrescription = prescriptionDetail.jcjyPrescription;
- if (jcjyPrescription != null) {
- fitJcjyContent(jcjyPrescription, "jcjyContent", "jcjyTitle", true);
- } else {
- $("#jcjyTitle").removeClass("in").addClass("hide");
- $("#jcjyContent").html("");
- }
- var zlPrescription = prescriptionDetail.zlPrescription;
- if (zlPrescription != null) {
- fitJcjyContent(zlPrescription, "zlContent", "zlTitle", true);
- } else {
- $("#zlTitle").removeClass("in").addClass("hide");
- $("#zlContent").html("");
- }
- var zyReqPrescription = prescriptionDetail.zyReqPrescription;
- if (zyReqPrescription != null) {
- fitZyReqContent(zyReqPrescription, "zyReqContent", "zyReqTitle", true);
- } else {
- $("#zyReqTitle").removeClass("in").addClass("hide");
- $("#zyReqContent").html("");
- }
- var opRecordPrescription = prescriptionDetail.opRecordPrescription;
- if (opRecordPrescription != null) {
- fitOpRecordContent(opRecordPrescription, "opRecordContent", "opRecordTitle", true);
- } else {
- $("#opRecordTitle").removeClass("in").addClass("hide");
- $("#opRecordContent").html("");
- }
- } else {
- $("#xypyTitle").removeClass("in").addClass("hide");
- $("#xypyContent").html("");
- $("#xymjTitle").removeClass("in").addClass("hide");
- $("#xymjContent").html("");
- $("#xyjeTitle").removeClass("in").addClass("hide");
- $("#xyjeContent").html("");
- $("#yczlTitle").removeClass("in").addClass("hide");
- $("#yczlContent").html("");
- $("#zyzlTitle").removeClass("in").addClass("hide");
- $("#zyzlContent").html("");
- $("#jcjyTitle").removeClass("in").addClass("hide");
- $("#jcjyContent").html("");
- $("#zlTitle").removeClass("in").addClass("hide");
- $("#zlContent").html("");
- $("#zyReqTitle").removeClass("in").addClass("hide");
- $("#zyReqContent").html("");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- $("#medicalModelModal").modal();
- }
- /**
- * 诊疗项目回写
- * @param code
- * @param mzChargeDetail
- */
- function callBackZlDetail(code, mzChargeDetail) {
- //诊疗项目
- $.ajax({
- type: "GET",
- url: '/thmz/getZdChargeItemByCode?code=' + code,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- //如果
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3, null, null);
- }
- $("#zlItem").val(res.data.name);
- $("#zlItem").blur();
- $("#descriptions").val(res.data.descriptions);
- $("#zlItemPrice").val(res.data.chargeAmount);
- $("#chargeUnit").val(res.data.chargeUnit);
- $("#zl_current_code").val(res.data.code);
- $("#zlRemark").val(mzChargeDetail.instructionText);
- $("#dayZlNum").selectpicker('val', mzChargeDetail.orderDays);
- $('#dayZlNum').selectpicker('refresh');
- if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
- $("#zlHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
- $('#zlHospApprFlag').selectpicker('refresh');
- }
- $("#orderFrequencyZl").selectpicker('val', mzChargeDetail.frequency);
- $('#orderFrequencyZl').selectpicker('refresh');
- if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
- $("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
- $('#zlExecUnit').selectpicker('refresh');
- }
- $("#itemQuantity").val(mzChargeDetail.drugQuan);
- $("#totalNumZl").val(mzChargeDetail.quantity);
- saveZlItem(false);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 处方模板回调和历史处方调用自动重置组号
- * @param type
- */
- function resetNewGroupId(type) {
- if (type == 1 || type == 2) {
- var xyTabContents = $("#xyTabContent").find("div.tab-pane");
- //西药设置
- if (xyTabContents != null && xyTabContents.length > 0) {
- groupIdMap = new MyMap();
- gropuIdAndOrderNoMap = new MyMap();
- var newGroupId = 1;
- gropuIdAndOrderNoMap.put(1, 0);
- var prevGroupId = null;
- for (var i = 0; i < xyTabContents.length; i++) {
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempGroupId = $(formGroups[j]).find("input.temporary_items_groupId").val();
- if (prevGroupId != null && tempGroupId != prevGroupId) {
- newGroupId++;
- gropuIdAndOrderNoMap.put(newGroupId, i);
- }
- $(formGroups[j]).find("span.groupId").text(newGroupId);
- $(formGroups[j]).find("input.temporary_items_groupId").val(newGroupId);
- var map = groupIdMap.get(newGroupId + '');
- if (map == null) {
- map = new MyMap();
- map.put("supplyType", $(formGroups[j]).find("input.temporary_items_supplyType").val());
- map.put("orderFrequency", $(formGroups[j]).find("input.temporary_items_orderFrequency").val());
- map.put("dayNum", $(formGroups[j]).find("input.temporary_items_dayNum").val());
- groupIdMap.put(newGroupId + '', map);
- }
- if (prevGroupId == null || tempGroupId != prevGroupId) {
- prevGroupId = tempGroupId;
- }
- }
- }
- }
- resetGroupIdSelect();
- }
- }
- }
- /**
- * 处方回写
- * @param jsonData 处方数据
- * @param type 回写类型 0 全部回写 1 医疗范文 2 就诊详情
- */
- function editPrescription(jsonData, type) {
- orderNoAndTableIdMap = new MyMap();
- tableIdAndOrderNoMap = new MyMap();
- var firstOrNot = jsonData.firstOrNot;
- var conciseRecordsFlag = false;
- if (type == 1) {
- conciseRecordsFlag = $("#conciseRecordsYlfw").prop("checked");
- } else if (type == 2) {
- conciseRecordsFlag = $("#conciseRecordsJzxq").prop("checked");
- }
- if (firstOrNot == 0) {
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#not").next().click();
- }
- if (type == 0 || conciseRecordsFlag) {
- $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
- $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
- $("#emrPs").val(jsonData.mzBlRecord.emrPs);
- $("#personalHistory").val(jsonData.mzBlRecord.personalHistory);
- $("#familyHistory").val(jsonData.mzBlRecord.familyHistory);
- $("#fzZl").val(jsonData.mzBlRecord.fzZl);
- $("#crbHistory").val(jsonData.mzBlRecord.crbHistory);
- $("#obstericalHistory").val(jsonData.mzBlRecord.obstericalHistory);
- if (jsonData.mzBlRecord.weight != null && jsonData.mzBlRecord.weight != 0) {
- $("#weight").val(jsonData.mzBlRecord.weight);
- } else {
- $("#weight").val("");
- }
- if (jsonData.mzBlRecord.temperature != null && jsonData.mzBlRecord.temperature != 0) {
- $("#temperature").val(jsonData.mzBlRecord.temperature);
- } else {
- $("#temperature").val("");
- }
- if (jsonData.mzBlRecord.sphygmus != null && jsonData.mzBlRecord.sphygmus != 0) {
- $("#sphygmus").val(jsonData.mzBlRecord.sphygmus);
- } else {
- $("#sphygmus").val("");
- }
- if (jsonData.mzBlRecord.breathe != null && jsonData.mzBlRecord.breathe != 0) {
- $("#breathe").val(jsonData.mzBlRecord.breathe);
- } else {
- $("#breathe").val("");
- }
- if (jsonData.mzBlRecord.pressureHigh != null && jsonData.mzBlRecord.pressureHigh != 0) {
- $("#pressure_high").val(jsonData.mzBlRecord.pressureHigh);
- } else {
- $("#pressure_high").val("");
- }
- if (jsonData.mzBlRecord.pressureFloor != null && jsonData.mzBlRecord.pressureFloor != 0) {
- $("#pressure_floor").val(jsonData.mzBlRecord.pressureFloor);
- } else {
- $("#pressure_floor").val("");
- }
- if (jsonData.mzBlRecord.pressureHighLeft != null && jsonData.mzBlRecord.pressureHighLeft != 0) {
- $("#pressure_high_left").val(jsonData.mzBlRecord.pressureHighLeft);
- } else {
- $("#pressure_high_left").val("");
- }
- if (jsonData.mzBlRecord.pressureFloorLeft != null && jsonData.mzBlRecord.pressureFloorLeft != 0) {
- $("#pressure_floor_left").val(jsonData.mzBlRecord.pressureFloorLeft);
- } else {
- $("#pressure_floor_left").val("");
- }
- $("#tentativeDiagnosis").val(jsonData.mzBlRecord.tentativeDiagnosis);
- $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
- var icdCode = jsonData.icdCode;
- if (icdCode != null && icdCode != "" && icdCode.length > 0) {
- $.ajax({
- type: "POST",
- url: '/thmz/getZdIcdByCodes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- data: JSON.stringify({
- "icdCode": icdCode
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- for (var i = 0; i < res.data.length; i++) {
- fitDiagnoseValue(res.data[i].name, res.data[i].code);
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- $("#healthEducation").val(jsonData.mzBlRecord.emrJkjy);
- if(!stringIsBlank(jsonData.tcmIcdCode)){
- let tcmIcdCodes = jsonData.tcmIcdCode.split(",");
- let tcmIcdTexts = jsonData.tcmIcdText.split(",");
- for (let i = 0; i < tcmIcdCodes.length; i++) {
- fitTcmDiagnoseValue(tcmIcdTexts[i],tcmIcdCodes[i])
- }
- }
- }
- if(jsonData.ghFeeFlag === '1'){
- $("#ghFeeSelect").val('1')
- $('#ghFeeSelect').selectpicker('refresh');
- }
- var patientAllergenInfoList = jsonData.patientAllergenInfoList;
- if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
- var zdAllergen = [];
- var ypDitList = [];
- var zdAllergenHtml = '';
- var ypDitListHtml = '';
- var zdAllergeCodes = null;
- var zdAllergeTexts = null;
- var ypDitListodes = null;
- var ypDitListTexts = null;
- for (var i = 0; i < patientAllergenInfoList.length; i++) {
- var patientAllergenInfo = patientAllergenInfoList[i];
- if (patientAllergenInfo.type == 0 || patientAllergenInfo.type == '0') {
- zdAllergen[zdAllergen.length] = patientAllergenInfo.allergenCode;
- zdAllergenHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
- if (zdAllergeCodes == null) {
- zdAllergeCodes = patientAllergenInfo.allergenCode;
- zdAllergeTexts = patientAllergenInfo.allergenName;
- } else {
- zdAllergeCodes += "," + patientAllergenInfo.allergenCode;
- zdAllergeTexts += "," + patientAllergenInfo.allergenName;
- }
- } else if (patientAllergenInfo.type == 1 || patientAllergenInfo.type == '1') {
- ypDitList[ypDitList.length] = patientAllergenInfo.allergenCode;
- ypDitListHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
- if (zdAllergeCodes == null) {
- ypDitListodes = patientAllergenInfo.allergenCode;
- ypDitListTexts = patientAllergenInfo.allergenName;
- } else {
- ypDitListodes += "," + patientAllergenInfo.allergenCode;
- ypDitListTexts += "," + patientAllergenInfo.allergenName;
- }
- }
- }
- $("#zdAllergen").empty();
- $('#zdAllergen').append(zdAllergenHtml);
- $('#zdAllergen').selectpicker('refresh');
- $("#ypDitList").empty();
- $('#ypDitList').append(ypDitListHtml);
- $('#ypDitList').selectpicker('refresh');
- $("#zdAllergen").selectpicker('val', zdAllergen);
- $("#zdAllergen").selectpicker('refresh');
- $("#ypDitList").selectpicker('val', ypDitList);
- $("#ypDitList").selectpicker('refresh');
- $("#zdAllergen").attr("selectedCodes", zdAllergeCodes);
- $("#zdAllergen").attr("selectedTexts", zdAllergeTexts);
- $("#ypDitList").attr("selectedCodes", ypDitListodes);
- $("#ypDitList").attr("selectedTexts", ypDitListTexts);
- }
- //西药选中的数据组
- var xyArrays = [];
- //中药选中的数据组
- var zyArrays = [];
- //辅助检查、检验选中的数据组
- var jcjyArrays = [];
- //诊疗选中的数据组
- var zlArrays = [];
- //住院选中的数据组
- var zyReqArrays = [];
- //门诊手术选中的数据组
- var opRecordArrays = [];
- //外配药选中的数据组
- var wpMedicinedArrays = [];
- //组号与同组药数量的map
- var groupOrderAndLengthMap = new MyMap();
- //处方号与同处方号药数量的map
- var orderNoAndLengthMap = new MyMap();
- //住院回写
- var zyReqCallBack = false;
- if (type == 1) {
- setCallBackArrays("xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("zyzlContent", zyArrays, null, null);
- setCallBackArrays("jcjyContent", jcjyArrays, null, null);
- setCallBackArrays("zlContent", zlArrays, null, null);
- zyReqCallBack = $("#zyReqContent").find("input").prop("checked");
- setCallBackArrays("opRecordContent", opRecordArrays, null, null);
- setCallBackArrays("wpMedicineContent", wpMedicinedArrays, null, null);
- } else if (type == 2) {
- setCallBackArrays("prescriptionDetail_xypyContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_xymjContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_xyjeContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_yczlContent", xyArrays, groupOrderAndLengthMap, orderNoAndLengthMap);
- setCallBackArrays("prescriptionDetail_zyzlContent", zyArrays, null, null);
- setCallBackArrays("prescriptionDetail_jcjyContent", jcjyArrays, null, null);
- setCallBackArrays("prescriptionDetail_zlContent", zlArrays, null, null);
- zyReqCallBack = $("#prescriptionDetail_zyReqContent").find("input").prop("checked");
- setCallBackArrays("prescriptionDetail_opRecordContent", opRecordArrays, null, null);
- setCallBackArrays("prescriptionDetail_wpMedicineContent", wpMedicinedArrays, null, null);
- } else if (type == 0) {
- zyReqCallBack = true;
- }
- var mzChargeDetailList = jsonData.mzChargeDetailList;
- var mzZyReq = jsonData.mzZyReq;
- //中药的公共参数是否已经设置了
- var hadSetZyFullParams = false;
- //西药,成药,医材,麻精,中药,诊疗
- if (mzChargeDetailList != null && mzChargeDetailList.length > 0) {
- //当前实际回写的组号
- var currentOrderNo = null;
- //处方号与药品类型关系
- var orderAndGroupNoMap = new MyMap();
- // mzChargeDetailList.sort(function (a, b) {
- // return a.groupNo - b.groupNo
- // });
- for (var i = 0; i < mzChargeDetailList.length; i++) {
- var mzChargeDetail = mzChargeDetailList[i];
- var groupNo = mzChargeDetail.groupNo;
- var code = mzChargeDetail.chargeItemCode;
- var serial = mzChargeDetail.serial;
- if (groupNo == "00") {
- if (type != 0 && !isInArray(code, zlArrays)) {
- continue;
- }
- callBackZlDetail(code, mzChargeDetail);
- } else if (groupNo == "71" || groupNo == "91" || groupNo == "111" || groupNo == "131") {
- // 71 西成药 91 医材 111 精一 131 精二
- var groupOrder = mzChargeDetail.groupOrder;
- if (groupOrder == null || groupOrder == 'null' || groupOrder == "") {
- groupOrder = 1;
- }
- var orderNo = mzChargeDetail.orderNo;
- orderAndGroupNoMap.put(orderNo, groupNo);
- if (type != 0 && !isInArray(code + "_" + serial + "_" + groupOrder + "_" + orderNo, xyArrays)) {
- continue;
- }
- var lastGroupOrder = parseInt($("#groupId > option:last").val());
- while (lastGroupOrder < groupOrder) {
- appendGroupOrder();
- lastGroupOrder = parseInt($("#groupId > option:last").val());
- }
- //appendGroupOrder()
- $("#groupId").selectpicker('val', groupOrder);
- $('#groupId').selectpicker('refresh');
- if (type == 1 || type == 2) {
- //模板和历史轨迹回调的时候,如果前一个处方不满5个,就将后面的处方的药品添加到上一个处方中,但如果同一组药不能全部添加到上一个处方,就不会追加到该处方中
- var orderNoLength = orderNoAndLengthMap.get(orderNo);
- if (currentOrderNo == null) {
- currentOrderNo = orderNo;
- } else if (orderAndGroupNoMap.get(currentOrderNo) != orderAndGroupNoMap.get(orderNo)) {
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //查询还没有满5个的处方页
- var tempOrderNo = null;
- for (var k = 0; k < currentGroupNos.length; k++) {
- if ($(currentGroupNos[k]).val() == groupNo) {
- var next = $(currentGroupNos[k]).next();
- if ($(next).children().length < 4) {
- var parentId = $(currentGroupNos[k]).parent().attr("id");
- tempOrderNo = tableIdAndOrderNoMap.get(parentId);
- }
- }
- }
- currentOrderNo = tempOrderNo;
- } else if (currentOrderNo != orderNo && orderNoLength < 5) {
- var currentOrderNoLength = orderNoAndLengthMap.get(currentOrderNo);
- var groupOrderLength = groupOrderAndLengthMap.get(groupOrder);
- if (groupOrderLength + currentOrderNoLength <= 5) {
- currentOrderNoLength = currentOrderNoLength + 1;
- orderNoLength = orderNoLength - 1;
- groupOrderLength = groupOrderLength - 1;
- orderNoAndLengthMap.put(currentOrderNo, currentOrderNoLength);
- orderNoAndLengthMap.put(orderNo, orderNoLength);
- groupOrderAndLengthMap.put(groupOrder, groupOrderLength);
- orderNo = currentOrderNo;
- if (currentOrderNoLength == 5) {
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //查询还没有满5个的处方页,
- var tempOrderNo = null;
- for (var k = 0; k < currentGroupNos.length; k++) {
- if ($(currentGroupNos[k]).val() == groupNo) {
- var next = $(currentGroupNos[k]).next();
- //这里判断是4,是因为已经把组号设置了,所以要减去1
- if ($(next).children().length < 4) {
- var parentId = $(currentGroupNos[k]).parent().attr("id");
- tempOrderNo = tableIdAndOrderNoMap.get(parentId);
- }
- }
- }
- currentOrderNo = tempOrderNo;
- }
- } else {
- currentOrderNo = orderNo;
- }
- }
- }
- checkYpInfo(code, serial, groupNo, false, orderNo, type);
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
- $('#supplyType').selectpicker('refresh');
- $("#drugWin").val(mzChargeDetail.drugQuan);
- $("#drugWinUnit").selectpicker('val', mzChargeDetail.drugUnit);
- $('#drugWinUnit').selectpicker('refresh');
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', mzChargeDetail.orderDays);
- $('#dayNum').selectpicker('refresh');
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', mzChargeDetail.frequency);
- $('#orderFrequency').selectpicker('refresh');
- if (mzChargeDetail.tryFlag == 1 || mzChargeDetail.tryFlag == "1") {
- $("#tryResult").selectpicker('val', 100);
- $('#tryResult').selectpicker('refresh');
- } else if (mzChargeDetail.tryResult != null && mzChargeDetail.tryResult != "null" && mzChargeDetail.tryResult != "") {
- $("#tryResult").selectpicker('val', mzChargeDetail.tryResult);
- $('#tryResult').selectpicker('refresh');
- }
- $("#gross").val(mzChargeDetail.quantity);
- $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()));
- $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
- $('#medicalAdvice').selectpicker('refresh');
- if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
- $("#xyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
- $('#xyHospApprFlag').selectpicker('refresh');
- }
- saveWesternMedicineWithCheck(false, orderNo);
- $("#western_medicine_button").click();
- $("#xyTab").find("li:eq(0) a").off("click").click();
- } else {
- if (type != 0 && !isInArray(code + "_" + serial, zyArrays)) {
- continue;
- }
- //中药与颗粒剂
- checkZyInfo(code, serial, groupNo, false);
- //类型
- $("#zyClassType").selectpicker('val', groupNo);
- $('#zyClassType').selectpicker('refresh');
- $("#zy_drugWin").val(mzChargeDetail.quantity);
- $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
- $('#zyInstruction').selectpicker('refresh');
- if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
- $("#zyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
- $('#zyHospApprFlag').selectpicker('refresh');
- }
- saveChineseMedicine(false);
- if (!hadSetZyFullParams) {
- hadSetZyFullParams = true;
- $("input.zyfs").val(mzChargeDetail.drugWin);
- // $("#zy_orderFrequency_1").selectpicker('val', mzChargeDetail.frequency);
- // $('#zy_orderFrequency_1').selectpicker('refresh');
- $("#useType_1").selectpicker('val', mzChargeDetail.cyFysm);
- $('#useType_1').selectpicker('refresh');
- $("#cyJssm").selectpicker('val', mzChargeDetail.cyJssm);
- $('#cyJssm').selectpicker('refresh');
- $("#cyJsl").val(mzChargeDetail.cyJsl);
- $("#cyZql").val(mzChargeDetail.cyZql);
- $("#cyFj").val(mzChargeDetail.cyFj);
- $("#cyFfcs").val(mzChargeDetail.cyFfcs);
- $("#cyMtjs").val(mzChargeDetail.cyMtjs);
- $("#zy_supplyType_1").selectpicker('val', mzChargeDetail.cyDj);
- $('#zy_supplyType_1').selectpicker('refresh');
- }
- $("#chinese_medicine_button").click();
- }
- }
- }
- //检验与检查
- var mzYjReqList = jsonData.mzYjReqList;
- if (mzYjReqList != null && mzYjReqList.length > 0) {
- for (var i = 0; i < mzYjReqList.length; i++) {
- var mzYjReq = mzYjReqList[i];
- var code = mzYjReq.orderCode;
- if (type != 0 && !isInArray(code, jcjyArrays)) {
- continue;
- }
- var jcJyZltype = null;
- if (mzYjReq.reqType == 2) {
- jcJyZltype = 1;
- $("#jyZdSample").selectpicker('val', mzYjReq.inspectStuff);
- $('#jyZdSample').selectpicker('refresh');
- } else if (mzYjReq.reqType == 3) {
- jcJyZltype = 2;
- $("#yshPart").selectpicker('val', mzYjReq.inspectPart);
- $('#yshPart').selectpicker('refresh');
- }
- $("#jcJyZltype").val(jcJyZltype);
- checkJcJyItemInfo(code, null, jcJyZltype, false);
- $("#remark").val(mzYjReq.jyRemark);
- if (mzYjReq.execDept != null && mzYjReq.execDept != "") {
- $("#execUnit").selectpicker('val', mzYjReq.execDept);
- $('#execUnit').selectpicker('refresh');
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- saveJyJcItem(false);
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- }
- $("#yj_req_button").click();
- }
- //入院证
- if (zyReqCallBack && mzZyReq != null && mzZyReq.reqDept != null && mzZyReq.reqDept != "") {
- $("#inpatientWardBeHospitalized").selectpicker('val', mzZyReq.reqDept);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- $("#admissStatus").selectpicker('val', mzZyReq.admissStatus);
- $('#admissStatus').selectpicker('refresh');
- $("#conditionCode").selectpicker('val', mzZyReq.conditionCode);
- $('#conditionCode').selectpicker('refresh');
- $("#routeOfAdmission").selectpicker('val', mzZyReq.routeOfAdmission);
- $('#routeOfAdmission').selectpicker('refresh');
- $("#contacterName").val(mzZyReq.contacterName);
- $("#contacterRelationship").selectpicker('val', mzZyReq.contacterRelationship);
- $('#contacterRelationship').selectpicker('refresh');
- $("#contacterPhone").val(mzZyReq.contacterPhone);
- $("#contacterAddress").val(mzZyReq.contacterAddress);
- $("#deposit").val(mzZyReq.deposit);
- setTimeout(function () {
- $("#smallWardBeHospitalized").selectpicker('val', mzZyReq.smallDept);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- saveZyReq(false);
- }, 500);
- $("#zy_req_button").click();
- }
- //门诊手术
- var opRecordList = jsonData.opRecordList;
- if (opRecordList != null && opRecordList.length > 0) {
- for (var i = 0; i < opRecordList.length; i++) {
- var opRecord = opRecordList[i];
- var opCode = opRecord.opCode;
- if (type != 0 && !isInArray(opCode, opRecordArrays)) {
- continue;
- }
- var opNameHtml = '<option value="' + opRecord.opCode + '">' + opRecord.opName + '</option>';
- $('#opName').html(opNameHtml);
- $('#opName').selectpicker('refresh');
- $('#opName').selectpicker('val', opRecord.opCode);
- $('#opName').selectpicker('refresh');
- $("#opTime").val(opRecord.opDatetimeStr);
- $('#urgentClinicFlag').selectpicker('val', opRecord.urgentClinicFlag);
- $('#urgentClinicFlag').selectpicker('refresh');
- $('#ssbc').selectpicker('val', opRecord.ssbc);
- $('#ssbc').selectpicker('refresh');
- $('#partCode').selectpicker('val', opRecord.partCode);
- $('#partCode').selectpicker('refresh');
- $('#opScale').selectpicker('val', opRecord.opScale);
- $('#opScale').selectpicker('refresh');
- $('#hocusCode').selectpicker('val', opRecord.hocusCode);
- $('#hocusCode').selectpicker('refresh');
- $('#doctorZd').selectpicker('val', opRecord.doctorZd);
- $('#doctorZd').selectpicker('refresh');
- $("#opRecordRemark").val(opRecord.remark);
- saveOpRecord(false);
- }
- $("#op_record_button").click();
- }
- //外配药
- let rxDruginfoList = jsonData.rxDruginfoList;
- if(rxDruginfoList != null && rxDruginfoList.length > 0){
- for (let i = 0; i < rxDruginfoList.length; i++) {
- let rxDruginfo = rxDruginfoList[i];
- let medListCodg = rxDruginfo.medListCodg;
- if (type != 0 && !isInArray(medListCodg, wpMedicinedArrays)) {
- continue;
- }
- $("#wp_medicine_name").val(rxDruginfo.drugGenname)
- $("#wp_medicine_current_code").val(rxDruginfo.medListCodg)
- setSelectDefaultVal('rxItemTypeCode',rxDruginfo.rxItemTypeCode)
- setSelectDefaultVal('medcWayCodg',rxDruginfo.medcWayCodg)
- $("#medcDays").val(rxDruginfo.medcDays)
- $("#sinDosunt").val(rxDruginfo.sinDosunt)
- $("#sinDoscnt").val(rxDruginfo.sinDoscnt)
- $("#drugDosform").val(rxDruginfo.drugDosform)
- setSelectDefaultVal('usedFrquCodg',rxDruginfo.usedFrquCodg)
- $("#drugDosunt").val(rxDruginfo.drugDosunt)
- $("#drugCnt").val(rxDruginfo.drugCnt)
- $("#drugSpec").val(rxDruginfo.drugSpec)
- $("#wpHospApprFlag").val(rxDruginfo.hospApprFlag)
- saveWpOrder(false)
- }
- $("#wp_order_button").click();
- }
- setTimeout(function () {
- //设置总金额 计算金额的时候,可能处方还没有回写完
- calculateTotalAmount(false);
- }, 1000);
- //清空映射map
- orderNoAndTableIdMap = null;
- tableIdAndOrderNoMap = null;
- resetNewGroupId(type);
- }
- /**
- * 根据勾选内容设置选中集合
- * @param id 区域id
- * @param arrays 集合
- * @param groupOrderAndLengthMap 组号与同组药数量的map
- * @param orderNoAndLengthMap 处方号与同处方号药数量的map
- */
- function setCallBackArrays(id, arrays, groupOrderAndLengthMap, orderNoAndLengthMap) {
- var contents = $("#" + id).children();
- if (contents == null || contents.length == 0) {
- return;
- }
- $(contents).each(function (index, obj) {
- var checked = $(obj).find("input").prop("checked");
- var data_id = $(obj).attr("data-id");
- if (checked && data_id != undefined && data_id != null && data_id != "null" && data_id != "") {
- arrays[arrays.length] = data_id;
- var dataArr = null;
- //设置组号与同组药品数量关系
- if (groupOrderAndLengthMap != null) {
- dataArr = data_id.split("_");
- if (dataArr != null && dataArr.length >= 3) {
- var groupOrder = Number(dataArr[2]);
- var length = groupOrderAndLengthMap.get(groupOrder);
- if (length == null || length == "") {
- length = 0;
- }
- length++;
- groupOrderAndLengthMap.put(groupOrder, length);
- }
- }
- //设置处方号与同处方号药品数量关系
- if (orderNoAndLengthMap != null) {
- if (dataArr == null) {
- dataArr = data_id.split("_");
- }
- if (dataArr != null && dataArr.length >= 4) {
- var orderNo = Number(dataArr[3]);
- var length = orderNoAndLengthMap.get(orderNo);
- if (length == null || length == "") {
- length = 0;
- }
- length++;
- orderNoAndLengthMap.put(orderNo, length);
- }
- }
- }
- });
- }
- /**
- * 调用医疗范文
- */
- function callTemplate() {
- clearWorkSpaceExcludeUser(2);
- $.ajax({
- type: "GET",
- url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var jsonData = JSON.parse(res.data.templateData);
- editPrescription(jsonData, 1);
- $("#templateId").val(res.data.id);
- $("#templateName").val(res.data.name);
- $("#templateKindType").selectpicker('val', res.data.templateKindType);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', res.data.templateType);
- $("#templateType").selectpicker('refresh');
- $('#operationType').selectpicker('val', 1);
- $('#operationType').selectpicker('refresh');
- $("#operationTypeDiv").removeClass("hide").addClass("in");
- $("#medicalModelModal").modal("hide");
- closePopover();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 底层填充推荐方法
- * @param paramsType
- * @param appeal
- * @param inputId
- */
- function extracted(paramsType, appeal, inputId) {
- if (paramsType == 13) {
- var contentArr = appeal.split(",");
- if (contentArr != null && contentArr.length > 0) {
- for (var i = 0; i < contentArr.length; i++) {
- var content = contentArr[i].replace(")", "").replace("(", "-");
- var diagnoseArr = content.split("-");
- if (diagnoseArr == null || diagnoseArr.length == 0) {
- continue;
- }
- fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
- }
- }
- } else {
- $("#" + inputId).val(appeal);
- }
- }
- /**
- * 填充推荐
- * @param appeal
- * @param paramsType
- * @param id
- */
- function fitAppeal(appeal, paramsType, id) {
- var inputId = "symptom";
- var text = "主诉项已经录入,是否覆盖?";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史项已经录入,是否覆盖?";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史项已经录入,是否覆盖?";
- } else if (paramsType == 13) {
- inputId = "diagnoseValue";
- text = "诊断项已经录入,是否覆盖?";
- }
- var symptom = $("#" + inputId).val();
- if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
- symptom = null;
- }
- if (symptom != null && symptom != "") {
- $("#messageModal").modal();
- $("#messageContent").html(text);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- if (paramsType == 13) {
- $("#" + inputId).val(null);
- $("#diagnoseTags").html(null);
- }
- extracted(paramsType, appeal, inputId);
- });
- $("#cancelButton").off("click");
- } else {
- extracted(paramsType, appeal, inputId);
- }
- $.ajax({
- type: "GET",
- url: '/thmz/increaseTcCommonParamsNumber?id=' + id,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- }
- });
- }
- /**
- * 初始嘱托下拉选
- */
- function initInstructionSelect() {
- //西药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=0',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText + '</option>';
- $('#medicalAdvice').append(html);
- });
- $('#medicalAdvice').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- //中药医嘱
- $.ajax({
- type: "GET",
- url: '/thmz/getMzZdInstructionByType?instructionType=1',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.instructionText.trim() + '</option>';
- $('#zyInstruction').append(html);
- });
- $('#zyInstruction').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 设置下拉选的尺寸
- // */
- // function setSelectSize() {
- // $(".selectpicker").selectpicker({
- // dropuAuto: false,
- // size: 10
- // });
- // }
- /**
- * 初始化下拉选
- */
- function initSelectWithParams() {
- $(".selectpicker").selectpicker({
- dropuAuto: false,
- size: 10
- });
- //select 从后台加载数据,并保留之前选择的内容
- dynamicSelectWithOri("editZd", '/thmz/getAllZdIcdCommonParams?commonParams=', false);
- //中医诊断
- dynamicSelectWithOri("editTcmZd", '/thmz/getAllTcmIcdCodeByParams?name=',false);
- //手术名称下拉选实现
- dynamicSelect("opName", '/thmz/getZdIcd9Cm3ListByCode?code=', false);
- //手术部位
- dynamicSelect("partCode", '/thmz/getAllOpZdPartNewByCode?code=', true);
- //手术等级
- dynamicSelect("opScale", '/thmz/getAllOpZdScaleByCode?code=', true);
- //麻醉方式
- dynamicSelect("hocusCode", '/thmz/getAllZdAnaesthesiaByCode?code=', true);
- //主刀医生
- dynamicSelect("doctorZd", '/thmz/getEmployeeByCommon?code=', true);
- //过敏源
- dynamicSelectWithOri("zdAllergen", '/thmz/getZdAllergenListByCode?code=', false);
- //过敏源
- dynamicSelectWithOri("editZdAllergen", '/thmz/getZdAllergenListByCode?code=', false);
- //药品列表
- dynamicSelectWithOri("ypDitList", '/thmz/getYpZdDictListByCode?code=', false);
- //药品列表
- dynamicSelectWithOri("editYpDitList", '/thmz/getYpZdDictListByCode?code=', false);
- }
- /**
- * 初始化性别下拉选
- */
- function initGenderSelect() {
- var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
- $('#rapidAcceptsUserGender').html(gender);
- $('#rapidAcceptsUserGender').selectpicker('refresh');
- $('#editUserGender').html(gender);
- $('#editUserGender').selectpicker('refresh');
- $('#crbMainCardGender').html(gender);
- $('#crbMainCardGender').selectpicker('refresh');
- //医疗范文状态
- var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
- $('#templateStatus').html(templateStatus);
- $('#templateStatus').selectpicker('refresh');
- //医疗范文操作类型
- var operationType = '<option value="0">新增</option><option value="1">修改</option>';
- $('#operationType').html(operationType);
- $('#operationType').selectpicker('refresh');
- //入院病情
- var conditionCode = '<option value="1">有</option><option value="2">临床未确定</option><option value="3">情况不明</option><option value="4">无</option>';
- $('#conditionCode').html(conditionCode);
- $('#conditionCode').selectpicker('refresh');
- //入院途径
- initRouteOfAdmission()
- // 初始化收取挂号费默认值
- initGhFeeSelect()
- //就诊人群类型
- var mdtrtGrpType = '<option value="-1">无</option><option value="1">新冠肺炎确诊患者</option><option value="2">其他国家突发公共事件</option><option value="3">新冠肺炎疑似患者</option><option value="4">无症状感染者</option>';
- $('#mdtrtGrpType').html(mdtrtGrpType);
- $('#mdtrtGrpType').selectpicker('refresh');
- //外伤标志
- var trumFlag = '<option value="0">否</option><option value="1">是</option>';
- $('#trumFlag').html(trumFlag);
- $('#trumFlag').selectpicker('refresh');
- //涉及第三方标志
- var relTtpFlag = '<option value="0">否</option><option value="1">是</option>';
- $('#relTtpFlag').html(relTtpFlag);
- $('#relTtpFlag').selectpicker('refresh');
- //门诊急诊转诊标志
- var otpErReflFlag = '<option value="-1">无</option><option value="1">急诊</option><option value="2">转诊</option><option value="3">转诊合并急诊</option>';
- $('#otpErReflFlag').html(otpErReflFlag);
- $('#otpErReflFlag').selectpicker('refresh');
- }
- /**
- * 初始化中药类型下拉选
- */
- function initZyClassTypeSelect() {
- // let html = '<option selected="selected" value="81">普通</option><option value="83">颗粒剂</option>';
- // $('#zyClassType').html(html);
- // $('#zyClassType').selectpicker('refresh');
- getAjaxRequst("/thmz/selectYfAllByTime",{},true,function (res) {
- let html = '';
- $.each(res.data, function (commentIndex, comment) {
- groupNoList = res.data
- if(comment.mzFlag ==='1' && (comment.zcyFlag==='1' || comment.klFlag==='1')){
- html += '<option value="' + comment.groupNo + '">' + comment.groupName + '</option>';
- }
- });
- $('#zyClassType').html(html);
- $('#zyClassType').selectpicker('refresh');
- })
- }
- /**
- * 初始化皮试结果下拉选
- * @param categoriesFlag 0 口服 2 注射针剂
- */
- function initTryResultSelect(categoriesFlag) {
- var tryResult = '';
- if (categoriesFlag == 2 || categoriesFlag == "2") {
- tryResult += '<option value="100">皮试</option>';
- }
- tryResult += '<option value="0">阴性</option><option value="3">免试</option>';
- //var tryResult = '<option value="100">皮试</option><option value="0">阴性</option><option value="3">免试</option>';
- $('#tryResult').html(tryResult);
- $('#tryResult').selectpicker('refresh');
- //口服药选择皮试结果
- $("#tryResult").parent().parent().parent().removeClass("hide").addClass("in");
- }
- /**
- * 初始化病人身份类别下拉选
- */
- function initResponceTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzResponceType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#patientsNature').append(html);
- $('#editUserPatientsNature').append(html);
- $('#crbMainCardPatientsNature').append(html);
- // $('#responeTypeBeHospitalized').append(html);
- });
- $('#patientsNature').selectpicker('refresh');
- $('#editUserPatientsNature').selectpicker('refresh');
- $('#crbMainCardPatientsNature').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 所有的入院状态
- */
- function iniAdmissStatus() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAdmissStatus',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#admissStatus').empty();
- $('#admissStatus').html(html);
- $('#admissStatus').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化收取挂号费
- */
- function initGhFeeSelect() {
- getAjaxRequst("/thmz/getGhFeeValue",{},true,function (res) {
- $("#ghFeeSelect").val(res.data)
- $('#ghFeeSelect').selectpicker('refresh');
- })
- }
- /**
- * 初始化入院途径
- */
- function initRouteOfAdmission() {
- getAjaxRequst("/thmz/queryRouteOfAdmission",{},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#routeOfAdmission').empty();
- $('#routeOfAdmission').html(html);
- $('#routeOfAdmission').selectpicker('destroy').selectpicker('refresh');
- })
- }
- /**
- * 入院登记的病区列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allInpatientWard',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#inpatientWardBeHospitalized').empty();
- $('#inpatientWardBeHospitalized').html(html);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- }
- });
- }
- /**
- * 关系列表初始化
- */
- function initRelationSelect() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getRelation',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#contacterRelationship').empty();
- $('#contacterRelationship').html(html);
- $('#contacterRelationship').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 小科室列表
- */
- function initSmallDeptByDept() {
- let code = escape($('#inpatientWardBeHospitalized').val()).replace(/\+/g, '%2B');
- //小科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getSmallDeptByDept?code=' + code,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#smallWardBeHospitalized').empty();
- $('#smallWardBeHospitalized').html(html);
- $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- }
- });
- //病床数
- $.ajax({
- type: "GET",
- url: '/thmz/getBedStatusNumByDept?code=' + code,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var data = res.data;
- if (data == null) {
- $("#totalBedNum").val(0);
- $("#freeBedNum").val(0);
- $("#occupationBedNum").val(0);
- } else {
- $("#totalBedNum").val(data.total);
- $("#freeBedNum").val(data.free);
- $("#occupationBedNum").val(data.occupation);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化门诊统筹下拉选
- */
- function initMztcSelect() {
- var selectHtml = '<option value="0">否</option><option value="1">是</option>';
- $('#zgmztczf').html(selectHtml);
- $('#zgmztczf').selectpicker('refresh');
- var gzZfSelectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
- $('#grzhzf').html(gzZfSelectHtml);
- $('#grzhzf').selectpicker('refresh');
- }
- /**
- * 初始化手术下拉选
- */
- function initMzssSelect() {
- var selectHtml = '<option value="0">否</option><option value="1">是</option>';
- $('#urgentClinicFlag').html(selectHtml);
- $('#urgentClinicFlag').selectpicker('refresh');
- $('#urgentClinicFlag').selectpicker('val', "0");
- $('#urgentClinicFlag').selectpicker('refresh');
- var bcHtml = '<option value="1">正常</option><option value="2">加班</option>';
- $('#ssbc').html(bcHtml);
- $('#ssbc').selectpicker('refresh');
- $('#ssbc').selectpicker('val', "1");
- $('#ssbc').selectpicker('refresh');
- }
- /**
- * 初始化医疗范文范围下拉选
- * @param templateTypeId
- */
- function initTemplateTypeSelect(templateTypeId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#' + templateTypeId).append(html);
- });
- $('#' + templateTypeId).selectpicker('refresh');
- if(templateTypeId =='templateTypeForm'){
- $('#'+templateTypeId).selectpicker('val', "0");
- $('#'+templateTypeId).selectpicker('refresh');
- fitTemplateData()
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化医疗范文类型下拉选
- * @param templateKindTypeId
- */
- function initTemplateKindTypeSelect(templateKindTypeId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getTemplateKindTypes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#' + templateKindTypeId).append(html);
- });
- $('#' + templateKindTypeId).selectpicker('refresh');
- $('#' + templateKindTypeId).selectpicker({
- dropuAuto: false,
- size: 5
- });
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getXyOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始中药频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initZyOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getZyOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- /**
- * 初始中药服用说明
- */
- function initAllMzYshZdFysm() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAllMzYshZdFysm',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.name.indexOf(",") < 0) {
- //过滤组合的用法
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- }
- });
- $('.useType').empty();
- $('.useType').html(html);
- $('.useType').selectpicker('refresh');
- $('.useType').selectpicker('val', "2");
- $('.useType').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始用药方式下拉选
- */
- function initSupplyTypes() {
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.supplyOcc === "71") {
- html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
- }
- });
- $('#supplyType').empty();
- $('#supplyType').html(html);
- $('#supplyType').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化外配药剂型
- */
- function initDrugDosform() {
- getAjaxRequst("/thmz/wpMzPrescription/queryYpZdDosage",{},true ,function (res) {
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.name + '">' + comment.name + '</option>';
- });
- $('#drugDosform').html(html);
- $('#drugDosform').selectpicker('refresh');
- })
- }
- /**
- * 初始化外配处方字典
- */
- function initZdRxAll(label,id) {
- getAjaxRequst("/thmz/wpMzPrescription/queryZdRxAllByLabel",{label:label},true ,function (res) {
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#'+id).html(html);
- $('#'+id).selectpicker('refresh');
- })
- }
- /**
- * 初始煎药方式下拉选
- * @param async 是否是异步 true 异步 false 同步
- */
- function initZySupplyTypes(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- if (comment.supplyOcc === "81") {
- // html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.supplyCode + '">' + comment.supplyName + '[' + comment.pyCode + ']' + '</option>';
- }
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- $('#' + id).selectpicker({
- dropuAuto: false,
- size: 10
- });
- }
- });
- }
- /**
- * 初始查检查部位
- */
- function initYshPart() {
- $.ajax({
- type: "GET",
- url: '/thmz/getYshPart',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#yshPart').empty();
- $('#yshPart').html(html);
- $('#yshPart').selectpicker('refresh');
- $('#yshPart').selectpicker({
- dropuAuto: false,
- size: 10
- });
- }
- });
- }
- /**
- * 初始化验物下拉选
- */
- function initJyZdSample() {
- $.ajax({
- type: "GET",
- url: '/thmz/getJyZdSample',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#jyZdSample').empty();
- $('#jyZdSample').html(html);
- $('#jyZdSample').selectpicker('refresh');
- $('#jyZdSample').selectpicker({
- dropuAuto: false,
- size: 10
- });
- }
- });
- }
- /**
- * 初始化当前医生说书科室
- */
- function initClinicDeptNo() {
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByCurrentUser',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#clinicDeptNo').empty();
- $('#clinicDeptNo').html(html);
- $('#clinicDeptNo').selectpicker('refresh');
- var userIdCode = localStorage.getItem("userIdCode");
- var deptNo = localStorage.getItem(userIdCode);
- if (deptNo != null && deptNo != "") {
- $('#clinicDeptNo').selectpicker('val', deptNo);
- $('#clinicDeptNo').selectpicker('refresh');
- }
- }
- });
- }
- /**
- * 保存当前药品到右边处方区域
- * @param index 0 西药 1中药 2 诊疗和社备
- */
- function saveMedicine(index) {
- if (index == 0) {
- saveWesternMedicineWithCheck(true, null);
- } else if (index == 1) {
- saveChineseMedicine(true);
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- * orderNoParmams
- */
- function saveWesternMedicineWithCheck(calculateTotalAmountFlag, orderNoParmams) {
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#western_medicine_update_flag").val();
- if (updateFlag == "true" || updateFlag == true) {
- saveWesternMedicine(calculateTotalAmountFlag);
- } else {
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (currentGroupNo == "") {
- errorMesageSimaple("您未选择任何药品");
- return;
- }
- if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
- initNavTabs(0, currentGroupNo, orderNoParmams);
- }
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children().length;
- var thisGroupNo = $(tableId).find("input.current_groupNo").val();
- var flag = childrens === 5;
- if (!calculateTotalAmountFlag) {
- flag = childrens === 5 && $(tableId).is(':last-child');
- }
- if (thisGroupNo != null && thisGroupNo != '' && currentGroupNo != thisGroupNo) {
- //当前编辑的处方与选中的品类非同一处方能保存的
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //是否需要新增处方页,以保存医材处方
- var needAddTable = true;
- for (var i = 0; i < currentGroupNos.length; i++) {
- if ($(currentGroupNos[i]).val() == currentGroupNo) {
- var next = $(currentGroupNos[i]).next();
- if (needAddTable && $(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- //因为存在没有满5个的处方页,直接保存到该页
- needAddTable = false;
- }
- }
- }
- if (needAddTable) {
- //91 医材
- var message = "医材需要单独处方,是否需要新增医材处方?";
- if (currentGroupNo == '71') {
- message = "普通西成药需要单独处方,是否需要新增处方?"
- } else if (currentGroupNo == '111') {
- message = "麻、精一药物需要单独处方,是否需要新增处方?"
- } else if (currentGroupNo == '131') {
- message = "精二药物需要单独处方,是否需要新增处方?"
- }
- if (calculateTotalAmountFlag) {
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, currentGroupNo, orderNoParmams);
- saveWesternMedicine(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click").on("click", function (t) {
- return;
- });
- }
- }
- } else if (flag) {
- if (calculateTotalAmountFlag) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, currentGroupNo, orderNoParmams);
- saveWesternMedicine(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click").on("click", function (t) {
- return;
- });
- }
- } else {
- saveWesternMedicine(calculateTotalAmountFlag);
- }
- }
- }
- /**
- * 保存当前药品到右边处方区域 西药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveWesternMedicine(calculateTotalAmountFlag) {
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- //药品名称
- var westernMedicineNamme = $("#western_medicine_name").val();
- var tableId = $("#xyTab li.active").find("a").attr("href");
- if (tableId == undefined) {
- refreshNavTabs(0, currentGroupNo, null);
- tableId = $("#xyTab li.active").find("a").attr("href");
- }
- var thisGroupNo = $(tableId).find("input.current_groupNo").val();
- if (currentGroupNo != thisGroupNo) {
- //91 医材
- var type = "医材";
- if (currentGroupNo == '71') {
- type = "普通西成药"
- } else if (currentGroupNo == '111') {
- type = "麻、精一药物"
- } else if (currentGroupNo == '131') {
- type = "精二药物"
- }
- errorMesageSimaple("【" + westernMedicineNamme + "】是" + type + ",无法保存到当前处方,请切换或者新增相应的处方进行保存。");
- return;
- }
- //当前处方选项卡下标
- var xyTabIndex = $("#xyTab li.active").index();
- //组号
- var groupId = $("#groupId").val();
- if (groupId == null || groupId == '') {
- errorMesageSimaple("组号为空,请选择组号!");
- return;
- }
- groupId = parseInt(groupId);
- if (groupId == null || isNaN(groupId)) {
- errorMesageSimaple("组号为空,请选择组号!");
- return;
- }
- if (gropuIdAndOrderNoMap == null) {
- gropuIdAndOrderNoMap = new MyMap();
- }
- var exitIndex = gropuIdAndOrderNoMap.get(groupId);
- if (exitIndex == null) {
- exitIndex = xyTabIndex;
- gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
- }
- if (xyTabIndex != exitIndex) {
- var westernMedicineUpdateFlag = $("#western_medicine_update_flag").val();
- var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
- //非修改组号的情况下就需要切换组号
- if (!((westernMedicineUpdateFlag == true || westernMedicineUpdateFlag == "true") && westernMedicineOriGroupId != groupId)) {
- groupId = parseInt($("#groupId > option:last").val());
- $("#groupId").selectpicker('val', groupId);
- $('#groupId').selectpicker('refresh');
- gropuIdAndOrderNoMap.put(groupId, xyTabIndex);
- appendGroupOrder();
- }
- warningMesageSimaple("同一组药必须出现在同一个处方中,当前组号已经被其他处方使用,系统已自动为您重新分配组号!");
- //return;
- }
- //当前药品编码
- var currentCode = $("#western_medicine_current_code").val();
- //当前药品规格
- var currentSerial = $("#western_medicine_current_serial").val();
- //用法编码
- var supplyType = $("#supplyType").val();
- //用法描述
- var supplyTypeText = $('#supplyType option:selected').text();
- supplyTypeText = supplyTypeText.substring(0, supplyTypeText.indexOf("["));
- //药品默认单次使用剂量
- var drugWinDb = $("#drugWinDb").val();
- //处方实际单次使用剂量
- var drugWin = $("#drugWin").val();
- //剂量单位
- var drugWinUnit = $('#drugWinUnit option:selected').text();
- //drugWinUnit = drugWinUnit.substring(0, drugWinUnit.indexOf("("));
- //天数
- var dayNum = $("#dayNum").val();
- //频次编码
- var orderFrequency = $("#orderFrequency").val();
- //频次描述
- var orderFrequencyText = $('#orderFrequency option:selected').text();
- orderFrequencyText = orderFrequencyText.substring(0, orderFrequencyText.indexOf("("));
- //总量
- var gross = $("#gross").val();
- //包装单位
- var packUnit = $("#packUnit").val();
- if (packUnit == null) {
- packUnit = "";
- }
- //医嘱码
- var medicalAdvice = $("#medicalAdvice").val();
- //医嘱内容
- var medicalAdviceText = $('#medicalAdvice option:selected').text();
- let tmpMedicalAdviceText = medicalAdviceText.substring(0, medicalAdviceText.indexOf("("));
- //金额
- var totalRetprice = parseFloat($("#totalRetprice").val());
- //单价
- var packRetprice = $("#packRetprice").val();
- //皮试结果
- var tryResult = $("#tryResult").val();
- //药品大类标志
- var categoriesFlag = $("#categoriesFlag").val();
- //报销自费标识
- var xyHospApprFlag = $("#xyHospApprFlag").val();
- if (currentCode == null || currentCode == '') {
- if (calculateTotalAmountFlag) {
- errorMesageSimaple("未选择任何药品!");
- }
- return;
- }
- if (currentGroupNo != '91') {
- if (supplyType == null || supplyType == "") {
- errorMesageSimaple("用法为空!");
- return;
- }
- if (drugWin == null || drugWin == "") {
- errorMesageSimaple("剂量为空!");
- return;
- }
- if (dayNum == null || dayNum == "") {
- errorMesageSimaple("天数为空!");
- return;
- }
- if (orderFrequency == null || orderFrequency == "") {
- errorMesageSimaple("频次为空!");
- return;
- }
- }
- if (gross == null || gross == "") {
- errorMesageSimaple("总量为空!");
- return;
- }
- var manufactoryName = $("#manufactoryName").val();
- var html = '<div class="form-group">';
- html += '<span class="groupId">' + groupId + '</span>' + '.<span style="margin-left: 5px"></span>';
- html += westernMedicineNamme;
- if (manufactoryName != null && manufactoryName != 'null' && manufactoryName != "") {
- html += "(" + manufactoryName + ")"
- }
- html += ' ';
- html += $("#specification").val();
- html += ' X ';
- //html += drugWinDb + drugWinUnit + ' 共';
- html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
- html += '用法:' + supplyTypeText + ' ';
- html += drugWin + drugWinUnit + ' ';
- html += '频次:' + orderFrequencyText + ' ';
- html += dayNum + '天 ';
- if (tryResult != null && tryResult != 'null' && tryResult != "") {
- if (tryResult == "100" || tryResult == 100) {
- html += '皮试 ';
- } else {
- html += '皮试结果: ' + $('#tryResult option:selected').text();
- }
- }
- if (medicalAdvice != null && medicalAdvice != '') {
- html += '医嘱:' + tmpMedicalAdviceText;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editWesternMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(0,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
- html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_supplyTypeText" value="' + supplyTypeText + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWinUnitText" value="' + drugWinUnit+ '"/>';
- html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
- html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
- html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
- html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
- html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
- html += '<input type="hidden" class="temporary_items_medicalAdviceText" value="' + medicalAdviceText + '"/>';
- html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_tryResult" value="' + tryResult + '"/>';
- html += '<input type="hidden" class="temporary_items_currentGroupNo" value="' + currentGroupNo + '"/>';
- html += '<input type="hidden" class="temporary_items_categoriesFlag" value="' + categoriesFlag + '"/>';
- html += '<input type="hidden" class="temporary_items_xyHospApprFlag" value="' + xyHospApprFlag + '"/>';
- html += '</div>';
- var tableId = $("#xyTab li.active").find("a").attr("href");
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#western_medicine_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- // //原药品金额 如果是修改则需要设置
- // var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- //药品有可能会修改,所以,判断的时候要用原药品编码
- var updateOriCode = $("#update_ori_code").val();
- //规格有可能会修改,所以,判断的时候要用原规格
- var updateOriSerial = $("#update_ori_serial").val();
- //组号有可能会修改,所以,判断的时候要用原组号
- var westernMedicineOriGroupId = $("#western_medicine_ori_group_id").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- var temporaryItemsGroupId = $(formGroups[i]).find("input.temporary_items_groupId").val();
- if (temporaryItemsCode === updateOriCode && temporaryItemsSerial === updateOriSerial && temporaryItemsGroupId == westernMedicineOriGroupId) {
- //temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- } else {
- //因为药品可以换组号,要保证相同组号的在一起
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
- //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
- if (temporaryItemsGroupId > groupId) {
- nextObj = $(formGroups[i]);
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount(true);
- resetGroupIdSelect();
- }
- //判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
- var groupIdLast = $("#groupId option:last-child").text();
- if (groupId === groupIdLast) {
- appendGroupOrder();
- }
- //设置药品的用法,频次,天数
- var map = groupIdMap.get(groupId);
- if (map == null) {
- map = new MyMap();
- map.put("supplyType", supplyType);
- map.put("orderFrequency", orderFrequency);
- map.put("dayNum", dayNum);
- groupIdMap.put(groupId, map);
- }
- //设置当前药品的品类
- $(tableId).find("input.current_groupNo").val($("#current_groupNo").val());
- $("#supplyType").selectpicker('val', null);
- $('#supplyType').selectpicker('refresh');
- clearWesternMedicine(false);
- resetGroupIdMap();
- }
- /**
- * 上移
- * @param obj
- */
- function arrowUp(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).prev() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //前一个兄弟节点的序号
- var prevJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- prevJcjyItemGroupId = $(parentObject).prev().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
- $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).prev().before($(parentObject));
- }
- /**
- * 下移
- * @param obj
- */
- function arrowDown(obj) {
- var parentObject = $(obj).parent();
- if ($(parentObject).next() == null) {
- return;
- }
- //当前元素的序号
- var thisJcjyItemGroupId = null;
- //后一个兄弟节点的序号
- var afterJcjyItemGroupId = null;
- //当是项目时有序号,进行序号调整
- if ($(parentObject).find("span.jcjyItemGroupId") != null) {
- thisJcjyItemGroupId = $(parentObject).find("span.jcjyItemGroupId").html();
- afterJcjyItemGroupId = $(parentObject).after().find("span.jcjyItemGroupId").html();
- $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
- $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
- }
- $(parentObject).next().after($(parentObject));
- }
- /**
- * 修改西药
- * @param obj
- */
- function editWesternMedicine(obj) {
- clearWesternMedicine(true);
- //是新增药品还是编辑 true 修改 默认false
- $("#western_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //组号
- $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
- //组号有可能会修改,所以,判断的时候要用原组号
- $("#western_medicine_ori_group_id").val($(parentObject).find("input.temporary_items_groupId").val());
- $('#groupId').selectpicker('refresh');
- //药品名称
- $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
- var code = $(parentObject).find("input.temporary_items_code").val();
- var serial = $(parentObject).find("input.temporary_items_serial").val();
- //当前药品编码
- $("#western_medicine_current_code").val(code);
- //当前药品规格
- $("#western_medicine_current_serial").val(serial);
- //当前修改药品原始编码
- $("#update_ori_code").val(code);
- //当前修改的药品原始规格
- $("#update_ori_serial").val(serial);
- //用法编码
- $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
- $('#supplyType').selectpicker('refresh');
- $("#xyHospApprFlag").val($(parentObject).find("input.temporary_items_xyHospApprFlag").val());
- $('#xyHospApprFlag').selectpicker('refresh');
- //药品默认单次使用剂量
- $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
- //处方实际单次使用剂量
- $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //天数
- $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
- $('#dayNum').selectpicker('refresh');
- //频次编码
- $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
- $('#orderFrequency').selectpicker('refresh');
- //总量
- $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
- //医嘱
- $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
- $('#medicalAdvice').selectpicker('refresh');
- //金额
- $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
- //单价
- $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
- //皮试结果
- var tryResult = $(parentObject).find("input.temporary_items_tryResult").val();
- //设置当前药品类型
- $("#current_groupNo").val($(parentObject).find("input.temporary_items_currentGroupNo").val());
- //设置当前药品大类
- $("#categoriesFlag").val($(parentObject).find("input.temporary_items_categoriesFlag").val());
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=71",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- var drugWinHtml = '';
- if (res.data.weight != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- }
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- //剂量单位
- $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- //包装单位
- $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
- $('#packUnit').selectpicker('refresh');
- }
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
- initTryResultSelect(res.data.categoriesFlag);
- $("#tryResult").val(tryResult);
- $('#tryResult').selectpicker('refresh');
- }
- }
- $("#packSize").val(res.data.packSize);
- //厂家名称
- $("#manufactoryName").val(res.data.manufactoryName);
- //规格
- $("#specification").val(res.data.specification);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 修改中药
- * @param obj
- */
- function editChineseMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#chinese_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前药品编码
- $("#chinese_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前药品规格
- $("#chinese_medicine_current_serial").val($(parentObject).find("input.temporary_items_serial").val());
- //当前修改药品原始编码
- $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前修改的药品原始规格
- $("#update_ori_serial").val($(parentObject).find("input.temporary_items_serial").val());
- //中药类型
- $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
- $('#zyClassType').selectpicker('refresh');
- //药品名称
- $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
- //单价
- $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
- //处方实际单次使用剂量
- $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
- //医嘱码
- $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
- $('#zyInstruction').selectpicker('refresh');
- $("#zyHospApprFlag").val($(parentObject).find("input.temporary_items_zyHospApprFlag").val());
- $('#zyHospApprFlag').selectpicker('refresh');
- }
- /**
- * 修改辅助检查、检验项目
- * @param obj
- */
- function editJyJcItem(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#jcjy_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#jcjy_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //当前项目国家医保编码
- $("#jy_national_code").val($(parentObject).find("input.temporary_jy_national_code").val());
- //当前项目国家医保名称
- $("#jy_national_name").val($(parentObject).find("input.temporary_jy_national_name").val());
- $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
- //项目名称
- $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
- //单价
- $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
- //备注
- $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
- var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
- var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
- //执行科室
- var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
- $("#execUnit").selectpicker('val', execUnit);
- $('#execUnit').selectpicker('refresh');
- if (jcJyZltype == 1 || jcJyZltype == "1") {
- $("#jyZdSample").selectpicker('val', chargeUnit);
- $('#jyZdSample').selectpicker('refresh');
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#jyQuantityDiv").removeClass("hide").addClass("in");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- //数量
- var jyQuantity = $(parentObject).find("input.temporary_items_jyQuantity").val();
- $("#jyQuantity").val(jyQuantity);
- } else if (jcJyZltype == 2 || jcJyZltype == "2") {
- $("#yshPart").selectpicker('val', chargeUnit);
- $('#yshPart').selectpicker('refresh');
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#jyQuantityDiv").removeClass("in").addClass("hide");
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- }
- $("#jcJyZltype").val(jcJyZltype);
- }
- /**
- * 修改外配药
- * @param obj
- */
- function editWpMedicine(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#wp_medicine_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前编码
- $("#wp_medicine_current_code").val($(parentObject).find("input.temporary_items_code").val());
- //类别
- $("#rxItemTypeCode").val($(parentObject).find("input.temporary_items_rxItemTypeCode").val());
- $('#rxItemTypeCode').selectpicker('refresh');
- //用法
- $("#medcWayCodg").val($(parentObject).find("input.temporary_items_medcWayCodg").val());
- $('#medcWayCodg').selectpicker('refresh');
- //天数
- $("#medcDays").val($(parentObject).find("input.temporary_items_medcDays").val())
- $('#medcDays').selectpicker('refresh');
- //药品名称
- $("#wp_medicine_name").val($(parentObject).find("input.temporary_items_wpMedicineName").val())
- //最小剂量单位
- $("#sinDosunt").val($(parentObject).find("input.temporary_items_sinDosunt").val())
- //剂型
- $("#drugDosform").val($(parentObject).find("input.temporary_items_drugDosform").val())
- //最小剂量
- $("#sinDoscnt").val($(parentObject).find("input.temporary_items_sinDoscnt").val())
- //频次
- $("#usedFrquCodg").val($(parentObject).find("input.temporary_items_usedFrquCodg").val());
- $('#usedFrquCodg').selectpicker('refresh');
- //单位
- $("#drugDosunt").val($(parentObject).find("input.temporary_items_drugDosunt").val())
- //总量
- $("#drugCnt").val($(parentObject).find("input.temporary_items_drugCnt").val())
- //规格
- $("#drugSpec").val($(parentObject).find("input.temporary_items_drugSpec").val())
- //报销自费标识
- $("#wpHospApprFlag").val($(parentObject).find("input.temporary_items_wpHospApprFlag").val())
- $('#wpHospApprFlag').selectpicker('refresh');
- //厂家
- $("#prdrName").val($(parentObject).find("input.temporary_items_prdrName").val())
- }
- /**
- * 修改诊疗项目
- * @param obj
- */
- function editZlItem(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#zl_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#zl_current_code").val($(parentObject).find("input.temporary_items_code").val());
- $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
- //项目名称
- $("#zlItem").val($(parentObject).find("input.temporary_items_zlItemName").val());
- //单价
- $("#zlItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
- //备注
- $("#zlRemark").val($(parentObject).find("input.temporary_items_remark").val());
- var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
- //数量
- var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
- //执行科室
- var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
- $("#zlHospApprFlag").val($(parentObject).find("input.temporary_items_zlHospApprFlag").val());
- $('#zlHospApprFlag').selectpicker('refresh');
- var descriptions = $(parentObject).find("input.temporary_items_code").val();
- if (descriptions != null && descriptions != "" && descriptions != 'null') {
- $("#descriptions").val(descriptions);
- }
- var dayZlNum = $(parentObject).find("input.temporary_items_dayZlNum").val();
- if (dayZlNum != null && dayZlNum != "" && dayZlNum != 'null') {
- $("#dayZlNum").selectpicker('val', dayZlNum);
- $('#dayZlNum').selectpicker('refresh');
- }
- var orderFrequencyZl = $(parentObject).find("input.temporary_items_orderFrequencyZl").val();
- if (orderFrequencyZl != null && orderFrequencyZl != "" && orderFrequencyZl != 'null') {
- $("#orderFrequencyZl").selectpicker('val', orderFrequencyZl);
- $('#orderFrequencyZl').selectpicker('refresh');
- }
- var totalNumZl = $(parentObject).find("input.temporary_items_totalNumZl").val();
- if (totalNumZl != null && totalNumZl != "" && totalNumZl != 'null') {
- $("#totalNumZl").val(totalNumZl);
- }
- $("#zlExecUnit").selectpicker('val', execUnit);
- $('#zlExecUnit').selectpicker('refresh');
- //描述
- $("#chargeUnit").val(chargeUnit);
- $("#itemQuantity").val(itemQuantity);
- calculateZl(true);
- }
- /**
- * 保存当前辅助检查、检验项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge <= 6) {
- $.ajax({
- type: "GET",
- url: '/thmz/checkAdditionally?code=' + $("#jcjy_current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
- var xlCode = res.data.xlCode;
- xlCode = Multiply(100, xlCode);
- $("#messageModal").modal();
- $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,不满7周岁的儿童诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJyJcItemReal(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click");
- } else {
- //虽然是不满6岁,但是也没有需要加收的项目,直接保存
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- saveJyJcItemReal(calculateTotalAmountFlag);
- }
- }
- /**
- * 保存当前项目到右边处方区域
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveJyJcItemReal(calculateTotalAmountFlag) {
- var tableId = $("#jcjyTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //项目名称
- var jcJyItem = $("#jcJyItem").val();
- //当前项目编码
- var currentCode = $("#jcjy_current_code").val();
- //当前项目价格
- var jcjyItemPrice = $("#jcjyItemPrice").val();
- //执行科室
- var execUnit = $("#execUnit").val();
- //执行科室
- var execUnitName = $('#execUnit option:selected').text();
- execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
- //描述编码
- var chargeUnitCode = null;
- var chargeUnitName = "";
- //检验物或者检查部位
- var chargeUnit = null;
- var chargeUnitString = null;
- //检验数量
- var jyQuantity = null;
- //备注
- var remark = $("#remark").val();
- //项目类型
- var jcJyZltype = $("#jcJyZltype").val();
- //检验项目国家医保
- var jyNationalCode = null;
- var jyNationalName = null;
- if (jcJyZltype == "1" || jcJyZltype == 1) {
- //检验
- chargeUnit = $('#jyZdSample option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#jyZdSample').val();
- chargeUnitName = " 检验物:";
- jyQuantity = $('#jyQuantity').val();
- jyNationalCode = $("#jy_national_code").val();
- jyNationalName = $("#jy_national_name").val();
- if (calculateTotalAmountFlag == true) {
- if (jyQuantity == null || jyQuantity == "") {
- errorMesageSimaple("检验项目数量为空!");
- return;
- }
- if (jyQuantity <= 0) {
- errorMesageSimaple("检验项目数量不能小于1!");
- return;
- }
- }
- } else if (jcJyZltype == "2" || jcJyZltype == 2) {
- //检查
- chargeUnit = $('#yshPart option:selected').text();
- chargeUnit = chargeUnit.substring(0, chargeUnit.indexOf("("));
- chargeUnitCode = $('#yshPart').val();
- chargeUnitString = $('button[data-id="yshPart"]').attr('title');
- chargeUnitName = " 检查部位:";
- }
- if (currentCode == null || currentCode == '') {
- if (calculateTotalAmountFlag == true) {
- errorMesageSimaple("未选择任何项目!");
- }
- return;
- }
- //判断是否有重复的项目 返回true 说明有重复的
- //彩超加收一个部位的不限制多开
- if ("003913" != currentCode && verifyRepeat(currentCode, null, chargeUnitCode, 2)) {
- return;
- }
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#jcjy_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- //原组号
- var oriGroupId = null;
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- oriGroupId = $(formGroups[i]).find("span.jcjyItemGroupId").text();
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- if (oriGroupId != null) {
- groupId = oriGroupId;
- }
- var html = '<div class="form-group">';
- html += '<span class="jcjyItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
- html += jcJyItem + ' ';
- if (jcJyZltype == "3" || jcJyZltype == 3) {
- html += " 数量:" + itemQuantity;
- }
- if (execUnit != null && execUnit != "") {
- html += " 执行科室:" + execUnitName;
- }
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnitName + chargeUnit;
- }
- if (remark != null && remark != '') {
- html += ' 备注:' + remark;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(2,this)"></i>';
- if ($("#jcJyItemChargeDetail").hasClass("in")) {
- html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\',' + jcJyZltype + ')"></i>';
- }
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
- html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
- html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_name" value="' + chargeUnitString + '"/>';
- html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
- html += '<input type="hidden" class="temporary_jy_national_code" value="' + jyNationalCode + '"/>';
- html += '<input type="hidden" class="temporary_jy_national_name" value="' + jyNationalName + '"/>';
- if (jyQuantity != null) {
- html += '<input type="hidden" class="temporary_items_jyQuantity" value="' + jyQuantity + '"/>';
- }
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount(true);
- }
- clearJyJcItem();
- }
- /**
- * 保存外配处方到右方区域
- */
- function saveWpOrder(needCalcu) {
- if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
- initNavTabs(6, null, null);
- }
- var tableId = $("#wpMedicineTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //药品名称
- var wpMedicineName = $("#wp_medicine_name").val();
- //当前药品编码
- var currentCode = $("#wp_medicine_current_code").val();
- //药品类别
- var rxItemTypeCode = $("#rxItemTypeCode").val();
- //用法
- var medcWayCodg = $("#medcWayCodg").val();
- //天数
- var medcDays = $("#medcDays").val();
- //最小剂量单位
- var sinDosunt = $("#sinDosunt").val();
- //剂量
- var sinDoscnt = $("#sinDoscnt").val();
- //剂型
- var drugDosform = $("#drugDosform").val();
- //用法名称
- var medcWayCodgName = $('#medcWayCodg option:selected').text();
- //频次
- var usedFrquCodg = $("#usedFrquCodg").val();
- var usedFrquCodgName = $('#usedFrquCodg option:selected').text();
- //单位
- var drugDosunt = $("#drugDosunt").val();
- //总量
- var drugCnt = $("#drugCnt").val();
- //规格
- var drugSpec = $("#drugSpec").val();
- //报销自费标识
- var wpHospApprFlag = $("#wpHospApprFlag").val();
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- if(stringIsBlank(rxItemTypeCode)){
- errorMesageSimaple("未选择药品类别!");
- return;
- }
- if(stringIsBlank(medcWayCodg)){
- errorMesageSimaple("未选择用法!");
- return;
- }
- if(stringIsBlank(usedFrquCodg)){
- errorMesageSimaple("未选择频次!");
- return;
- }
- if(stringIsBlank(medcDays)){
- errorMesageSimaple("未选择天数!");
- return;
- }
- if(stringIsBlank(sinDoscnt)){
- errorMesageSimaple("未填写剂量!");
- return;
- }
- if(stringIsBlank(drugCnt)){
- errorMesageSimaple("未填写总量!");
- return;
- }
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(currentCode, null, null, 6)) {
- return;
- }
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#wp_medicine_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- //厂家
- var prdrName = $("#prdrName").val();
- var html = '<div class="form-group">';
- html += wpMedicineName;
- if (prdrName != null && prdrName != 'null' && prdrName != "") {
- html += "(" + prdrName + ")"
- }
- html += ' ';
- html += drugSpec;
- html += ' X ';
- html += drugCnt + drugDosunt + " " + '<br/><span style="margin-left: 15px"></span>';
- html += '用法:' + medcWayCodgName + ' ';
- html += sinDoscnt + sinDosunt + ' ';
- html += '频次:' + usedFrquCodgName + ' ';
- html += medcDays + '天 ';
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editWpMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(6,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_wpMedicineGroupId" value="' + groupId + '"/>';
- html += '<input type="hidden" class="temporary_items_wpMedicineName" value="' + wpMedicineName + '"/>';
- html += '<input type="hidden" class="temporary_items_rxItemTypeCode" value="' + rxItemTypeCode + '"/>';
- html += '<input type="hidden" class="temporary_items_medcWayCodg" value="' + medcWayCodg + '"/>';
- html += '<input type="hidden" class="temporary_items_medcDays" value="' + medcDays + '"/>';
- html += '<input type="hidden" class="temporary_items_prdrName" value="' + prdrName + '"/>';
- html += '<input type="hidden" class="temporary_items_sinDosunt" value="' + sinDosunt + '"/>';
- html += '<input type="hidden" class="temporary_items_drugDosform" value="' + drugDosform + '"/>';
- html += '<input type="hidden" class="temporary_items_sinDoscnt" value="' + sinDoscnt + '"/>';
- html += '<input type="hidden" class="temporary_items_usedFrquCodg" value="' + usedFrquCodg + '"/>';
- html += '<input type="hidden" class="temporary_items_drugDosunt" value="' + drugDosunt + '"/>';
- html += '<input type="hidden" class="temporary_items_drugCnt" value="' + drugCnt + '"/>';
- html += '<input type="hidden" class="temporary_items_drugSpec" value="' + drugSpec + '"/>';
- html += '<input type="hidden" class="temporary_items_wpHospApprFlag" value="' + wpHospApprFlag + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- if(needCalcu){
- calculateTotalAmount(true)
- }
- clearWpOrder();
- }
- /**
- * 保存当前诊疗项目到右边处方区域 需要提示加价
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveZlItem(calculateTotalAmountFlag) {
- //6岁内提示加价
- var patientAge = $("#patientAge").text();
- if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge <= 6) {
- $.ajax({
- type: "GET",
- url: '/thmz/checkAdditionally?code=' + $("#zl_current_code").val() + "&jcJyZltype=3",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
- var xlCode = res.data.xlCode;
- xlCode = Multiply(100, xlCode);
- $("#messageModal").modal();
- $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,不满7周岁的儿童诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveZlItemReal(calculateTotalAmountFlag);
- });
- $("#cancelButton").off("click");
- } else {
- //虽然是不满6岁,但是也没有需要加收的项目,直接保存
- saveZlItemReal(calculateTotalAmountFlag);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- saveZlItemReal(calculateTotalAmountFlag);
- }
- }
- /**
- * 保存当前项目到右边处方区域
- * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveZlItemReal(calculateTotalAmountFlag) {
- var tableId = $("#zlTab li.active").find("a").attr("href");
- //组号
- var groupId = $(tableId).find("div:eq(0)").children().length + 1;
- //项目名称
- var zlItem = $("#zlItem").val();
- //当前项目编码
- var currentCode = $("#zl_current_code").val();
- //当前项目价格
- var zlItemPrice = $("#zlItemPrice").val();
- //单位
- var chargeUnit = $("#chargeUnit").val();
- //执行科室
- var zlExecUnit = $("#zlExecUnit").val();
- //执行科室
- var zlExecUnitName = $('#zlExecUnit option:selected').text();
- zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
- //单量
- var itemQuantity = $("#itemQuantity").val();
- //规格
- var descriptions = $("#descriptions").val();
- //天数
- var dayZlNum = $("#dayZlNum").val();
- //频次
- var orderFrequencyZl = $("#orderFrequencyZl").val();
- //总量
- var totalNumZl = $("#totalNumZl").val();
- //描述编码
- var chargeUnitCode = chargeUnit;
- //备注
- var remark = $("#zlRemark").val();
- //报销自费标识
- var zlHospApprFlag = $("#zlHospApprFlag").val();
- if (calculateTotalAmountFlag == true) {
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何项目!");
- return;
- }
- if (totalNumZl == null || totalNumZl == "" || totalNumZl == "null") {
- errorMesageSimaple("项目使用总量为空!");
- return;
- }
- }
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(currentCode, null, null, 3)) {
- return;
- }
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#zl_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- //原组号
- var oriGroupId = null;
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- oriGroupId = $(formGroups[i]).find("span.zlItemGroupId").text();
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- if (oriGroupId != null) {
- groupId = oriGroupId;
- }
- var html = '<div class="form-group">';
- html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
- html += zlItem + ' ';
- if (descriptions != null && descriptions != "") {
- html += " 规格:" + descriptions;
- }
- html += " 单量:" + itemQuantity;
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnit;
- }
- if (dayZlNum != null && dayZlNum != "") {
- html += " 天数:" + dayZlNum + "天";
- }
- if (orderFrequencyZl != null && orderFrequencyZl != "") {
- html += " 频次:" + orderFrequencyZl;
- }
- if (totalNumZl != null && totalNumZl != "") {
- html += " 总量:" + totalNumZl;
- if (chargeUnit != null && chargeUnit != '') {
- html += chargeUnit;
- }
- }
- if (zlExecUnit != null && zlExecUnit != "") {
- html += " 执行科室:" + zlExecUnitName;
- }
- if (remark != null && remark != '') {
- html += ' 备注:' + remark;
- }
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editZlItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_zlItemName" value="' + zlItem + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + zlItemPrice + '"/>';
- html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
- html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
- html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
- html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
- html += '<input type="hidden" class="temporary_items_descriptions" value="' + descriptions + '"/>';
- html += '<input type="hidden" class="temporary_items_dayZlNum" value="' + dayZlNum + '"/>';
- html += '<input type="hidden" class="temporary_items_orderFrequencyZl" value="' + orderFrequencyZl + '"/>';
- html += '<input type="hidden" class="temporary_items_zlHospApprFlag" value="' + zlHospApprFlag + '"/>';
- html += '<input type="hidden" class="temporary_items_totalNumZl" value="' + totalNumZl + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount(true);
- }
- clearZlItem();
- }
- /**
- * 临时保存住院证
- * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
- */
- function saveZyReq(messageFlag) {
- //如果
- if ($("#zyReqTab").find("li") == null || $("#zyReqTab").find("li").length == 0) {
- initNavTabs(4, null, null);
- }
- var tableId = $("#zyReqTab li.active").find("a").attr("href");
- //病区编码
- var inpatientWardBeHospitalized = $("#inpatientWardBeHospitalized").val();
- //小病室编码
- var smallWardBeHospitalized = $("#smallWardBeHospitalized").val();
- //入院状态编码
- var admissStatus = $("#admissStatus").val();
- //病区名称
- var inpatientWardText = $('#inpatientWardBeHospitalized option:selected').text();
- //小科室名称
- var smallWardText = $('#smallWardBeHospitalized option:selected').text();
- //入院状态名称
- var admissStatusText = $('#admissStatus option:selected').text();
- //入院病情代码
- var conditionCode = $("#conditionCode").val();
- //入院途径代码
- var routeOfAdmission = $("#routeOfAdmission").val();
- //联系人姓名
- var contacterName = $("#contacterName").val();
- //联系人关系
- var contacterRelationship = $("#contacterRelationship").val();
- //联系人电话
- var contacterPhone = $("#contacterPhone").val();
- //联系人地址
- var contacterAddress = $("#contacterAddress").val();
- //押金
- var deposit = $("#deposit").val();
- //入院病情代码
- var conditionCodeText = $('#conditionCode option:selected').text();
- //入院途径代码
- var routeOfAdmissionText = $('#routeOfAdmission option:selected').text();
- if (admissStatusText == null || admissStatusText == '') {
- errorMesageSimaple("未选择入院状态!");
- return;
- }
- if (conditionCode == null || conditionCode == '') {
- errorMesageSimaple("未选择入院病情!");
- return;
- }
- if (routeOfAdmission == null || routeOfAdmission == '') {
- errorMesageSimaple("未选择入院途径!");
- return;
- }
- if (inpatientWardBeHospitalized == null || inpatientWardBeHospitalized == '') {
- errorMesageSimaple("未选择入院病区!");
- return;
- }
- if (admissStatus == null || admissStatus == '') {
- errorMesageSimaple("未选择入院状态!");
- return;
- }
- if (messageFlag == "true" || messageFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- $("#messageModal").modal();
- $("#messageContent").html("当前病人已经有一个暂存的入院申请,是否需要替换该申请?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveZyReq(false);
- });
- $("#cancelButton").off("click");
- return;
- }
- }
- var html = '<div class="form-group"> 收住院';
- if (inpatientWardText != null) {
- html += " [" + inpatientWardText;
- }
- if (smallWardText != null) {
- html += " (" + smallWardText + ") ";
- }
- if (inpatientWardText != null) {
- html += "]";
- }
- if (admissStatusText != null) {
- html += " " + admissStatusText;
- }
- if (conditionCodeText != null) {
- html += " " + conditionCodeText;
- }
- if (routeOfAdmissionText != null) {
- html += " " + routeOfAdmissionText;
- }
- html += ' 侯床';
- //html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_inpatient_ward" value="' + inpatientWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_small_ward" value="' + smallWardBeHospitalized + '"/>';
- html += '<input type="hidden" class="temporary_items_admiss_status" value="' + admissStatus + '"/>';
- html += '<input type="hidden" class="temporary_items_condition_code" value="' + conditionCode + '"/>';
- html += '<input type="hidden" class="temporary_items_route_of_admission" value="' + routeOfAdmission + '"/>';
- html += '<input type="hidden" class="temporary_items_contacter_name" value="' + contacterName + '"/>';
- html += '<input type="hidden" class="temporary_items_contacter_relationship" value="' + contacterRelationship + '"/>';
- html += '<input type="hidden" class="temporary_items_contacter_phone" value="' + contacterPhone + '"/>';
- html += '<input type="hidden" class="temporary_items_contacter_address" value="' + contacterAddress + '"/>';
- html += '<input type="hidden" class="temporary_items_deposit" value="' + deposit + '"/>';
- html += '</div>';
- $(tableId).find("div:eq(0)").html(html);
- clearZyReq();
- }
- /**
- * 临时保存门诊手术
- * @param messageFlag 是否需要提醒已经存在的相同诊间手术申请 true 提示
- */
- function saveOpRecord(messageFlag) {
- //如果
- if ($("#opRecordTab").find("li") == null || $("#opRecordTab").find("li").length == 0) {
- initNavTabs(5, null, null);
- }
- var tableId = $("#opRecordTab li.active").find("a").attr("href");
- //手术名称编码
- var opCode = $("#opName").val();
- //手术名称
- var opNameText = $('#opName option:selected').text();
- //手术时间
- var opTime = $("#opTime").val();
- //急诊标志
- var urgentClinicFlag = $("#urgentClinicFlag").val();
- //急诊标志名称
- var urgentClinicFlagText = $('#urgentClinicFlag option:selected').text();
- //班次
- var ssbc = $("#ssbc").val();
- //班次名称
- var ssbcText = $('#ssbc option:selected').text();
- //手术部位
- var partCode = $("#partCode").val();
- //手术部位名称
- var partCodeText = $('#partCode option:selected').text();
- //手术等级
- var opScale = $("#opScale").val();
- //手术等级名称
- var opScaleText = $('#opScale option:selected').text();
- //麻醉方式
- var hocusCode = $("#hocusCode").val();
- //麻醉方式名称
- var hocusCodeText = $('#hocusCode option:selected').text();
- //主刀医生
- var doctorZd = $("#doctorZd").val();
- //主刀医生名称
- var doctorZdText = $('#doctorZd option:selected').text();
- var opRecordRemark = $("#opRecordRemark").val();
- if (opCode == null || opCode == '') {
- errorMesageSimaple("手术名称为空!");
- return;
- }
- if (opTime == null || opTime == '') {
- errorMesageSimaple("手术时间为空!");
- return;
- }
- if (urgentClinicFlag == null || urgentClinicFlag == '') {
- errorMesageSimaple("急诊标志为空!");
- return;
- }
- if (ssbc == null || ssbc == '') {
- errorMesageSimaple("班次为空!");
- return;
- }
- if (partCode == null || partCode == '') {
- errorMesageSimaple("手术部位为空!");
- return;
- }
- if (opScale == null || opScale == '') {
- errorMesageSimaple("手术等级为空!");
- return;
- }
- if (hocusCode == null || hocusCode == '') {
- errorMesageSimaple("麻醉方式为空!");
- return;
- }
- if (doctorZd == null || doctorZd == '') {
- errorMesageSimaple("主刀医生为空!");
- return;
- }
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(opName, null, null, 5)) {
- return;
- }
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的手术是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#op_record_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- var updateOriCode = $("#update_ori_code").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- if (temporaryItemsCode === updateOriCode) {
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- var html = '<div class="form-group"> 手术名称:' + opNameText + ' 时间:' + opTime + ' 急诊标志:' + urgentClinicFlagText + ' 班次:' + ssbcText + ' 手术部位:' + partCodeText + ' 手术等级:' + opScaleText + ' 麻醉方式:' + hocusCodeText + ' 主刀医生:' + doctorZdText + ' 附注说明:' + opRecordRemark;
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editOpRecord(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + opCode + '"/>';
- html += '<input type="hidden" class="temporary_items_op_name" value="' + opNameText + '"/>';
- html += '<input type="hidden" class="temporary_items_op_time" value="' + opTime + '"/>';
- html += '<input type="hidden" class="temporary_items_urgent_clinic_flag" value="' + urgentClinicFlag + '"/>';
- html += '<input type="hidden" class="temporary_items_ssbc" value="' + ssbc + '"/>';
- html += '<input type="hidden" class="temporary_items_part_code" value="' + partCode + '"/>';
- html += '<input type="hidden" class="temporary_items_op_scale" value="' + opScale + '"/>';
- html += '<input type="hidden" class="temporary_items_hocus_code" value="' + hocusCode + '"/>';
- html += '<input type="hidden" class="temporary_items_doctor_zd" value="' + doctorZd + '"/>';
- html += '<input type="hidden" class="temporary_items_op_record_remark" value="' + opRecordRemark + '"/>';
- html += '</div>';
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- clearOpRecord();
- }
- /**
- * 修改门诊手术
- * @param obj
- */
- function editOpRecord(obj) {
- //是新增药品还是编辑 true 修改 默认false
- $("#op_record_update_flag").val(true);
- var parentObject = $(obj).parent();
- //当前项目编码
- $("#opName").selectpicker('val', $(parentObject).find("input.temporary_items_code").val());
- $('#opName').selectpicker('refresh');
- $("#update_ori_code").val($(parentObject).find("input.temporary_items_code").val());
- //手术时间
- $("#opTime").val($(parentObject).find("input.temporary_items_op_time").val());
- //急诊标志
- $("#urgentClinicFlag").selectpicker('val', $(parentObject).find("input.temporary_items_urgent_clinic_flag").val());
- $('#urgentClinicFlag').selectpicker('refresh');
- //班次
- $("#ssbc").selectpicker('val', $(parentObject).find("input.temporary_items_ssbc").val());
- $('#ssbc').selectpicker('refresh');
- //部位
- $("#partCode").selectpicker('val', $(parentObject).find("input.temporary_items_part_code").val());
- $('#partCode').selectpicker('refresh');
- //等级
- $("#opScale").selectpicker('val', $(parentObject).find("input.temporary_items_op_scale").val());
- $('#opScale').selectpicker('refresh');
- //麻醉方式
- $("#hocusCode").selectpicker('val', $(parentObject).find("input.temporary_items_hocus_code").val());
- $('#hocusCode').selectpicker('refresh');
- //麻醉方式
- $("#doctorZd").selectpicker('val', $(parentObject).find("input.temporary_items_doctor_zd").val());
- $('#doctorZd').selectpicker('refresh');
- $("#opRecordRemark").val($(parentObject).find("input.temporary_items_op_record_remark").val());
- }
- /**
- * 删除药品或者项目
- * @param index 0 西药 1 中药 2 检查检验 3诊疗 6外配药
- * @param obj 当前点击的对象
- */
- function removeYpOrProject(index, obj) {
- var tabId = null;
- var className = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //辅助检查、检验
- className = ".jcjyItemGroupId";
- tabId = "jcjyTab";
- } else if (index == 3) {
- //诊疗
- className = ".zlItemGroupId";
- tabId = "zlTab";
- }
- else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- }
- else if (index == 6) {
- //外配药
- className = ".wpMedicineGroupId";
- tabId = "wpMedicineTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
- //calculateCfAmount(tableId, totalRetprice, null, index, 1);
- //医技和诊疗的序号调整一下
- if (index == 2 || index == 3) {
- var nextAll = $(obj).parent().nextAll();
- if (nextAll != null && nextAll.length > 0) {
- for (var i = 0; i < nextAll.length; i++) {
- var index = $(nextAll[i]).find(className).text();
- $(nextAll[i]).find(className).text(index - 1);
- }
- }
- }
- var temporaryItemsGroupId = $(obj).parent().find("input.temporary_items_groupId").val();
- var temporaryItemsGroupIds = $(obj).parent().parent().find("input.temporary_items_groupId");
- if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
- var count = 0;
- for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
- if (temporaryItemsGroupId == $(temporaryItemsGroupIds[i]).val()) {
- count++;
- }
- }
- //当前删除的药品组号是最后一个的时候,清空缓存
- if (count == 1) {
- groupIdMap.remove(temporaryItemsGroupId);
- gropuIdAndOrderNoMap.remove(temporaryItemsGroupId);
- }
- }
- $(obj).parent().remove();
- if (index != 4) {
- calculateTotalAmount(false);
- }
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups == null || formGroups.length == 0) {
- if (index == 0) {
- //西药被清空后,重置药房类型编码
- $(tableId).find("input.current_groupNo").val(null);
- //当本处方内容都被删除完后,也删除处方table
- $("#" + tabId).find("a[href=\"" + tableId + "\"]").parent().remove();
- $(tableId).remove();
- //切换处方 最后一个被选中
- $("#" + tabId).find("li:last > a").off("click").tab('show');
- } else if (index == 1) {
- //当中药处方被清空完后,重置当前中药类型为空
- $("#current_zyClassType").val(null);
- }
- }
- if (index == 0) {
- resetGroupIdMap();
- }
- }
- /**
- * 重置组号与用法、频率天数缓存关系
- */
- function resetGroupIdMap() {
- var temporaryItemsGroupIds = $("#xyTabContent").find("input.temporary_items_groupId");
- if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
- var list = [];
- for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
- var groupId = $(temporaryItemsGroupIds[i]).val();
- if (list.indexOf(groupId) < 0) {
- list.push(groupId);
- }
- }
- var keys = groupIdMap.keySet();
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (list.indexOf(key) < 0) {
- groupIdMap.remove(key);
- }
- }
- }
- }
- /**
- * 清空西药
- * @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
- */
- function clearWesternMedicine(flag) {
- $("#addPDiv").css("margin-left", "125px");
- $("#hlyyypsms").removeClass("in").addClass("hide");
- $("#western_medicine_update_flag").val(false);
- $("#western_medicine_ori_group_id").val(null);
- $("#update_ori_code").val(null);
- $("#update_ori_serial").val(null);
- //药品名称
- $("#western_medicine_name").val(null);
- //当前药品编码
- $("#western_medicine_current_code").val(null);
- //当前药品规格
- $("#western_medicine_current_serial").val(null);
- //当前药房编码
- $("#current_groupNo").val(null);
- if (flag) {
- //用法编码
- $("#supplyType").selectpicker('val', null);
- $('#supplyType').selectpicker('refresh');
- //$("#supplyType").removeAttr("disabled");
- //天数
- $("#dayNum").selectpicker('val', null);
- $('#dayNum').selectpicker('refresh');
- // $("#dayNum").removeAttr("disabled");
- //频次编码
- $("#orderFrequency").selectpicker('val', null);
- $('#orderFrequency').selectpicker('refresh');
- // $("#orderFrequency").removeAttr("disabled");
- }
- //药品默认单次使用剂量
- $("#drugWinDb").val(null);
- //处方实际单次使用剂量
- $("#drugWin").val(null);
- //剂量单位
- $("#drugWinUnit").selectpicker('val', null);
- $('#drugWinUnit').selectpicker('refresh');
- //总量
- $("#gross").val(null);
- //包装单位
- $("#packUnit").selectpicker('val', null);
- $('#packUnit').selectpicker('refresh');
- //单价
- $("#packRetprice").val(null);
- //金额
- $("#totalRetprice").val(null);
- //医嘱
- $("#medicalAdvice").selectpicker('val', null);
- $('#medicalAdvice').selectpicker('refresh');
- $("#xyHospApprFlag").selectpicker('val', '0');
- $('#xyHospApprFlag').selectpicker('refresh');
- $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
- //皮试结果
- $("#tryResult").selectpicker('val', null);
- $('#tryResult').selectpicker('refresh');
- //$("#gross").attr("readonly", "readonly");
- $("#manufactoryName").val(null);
- $("#specification").val(null);
- $("#categoriesFlag").val(null);
- }
- /**
- * 保存当前药品到右边处方区域 中药
- * calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
- */
- function saveChineseMedicine(calculateTotalAmountFlag) {
- //药品名称
- var chineseMedicineNamme = $("#chinese_medicine_name").val();
- //当前药品编码
- var currentCode = $("#chinese_medicine_current_code").val();
- //当前药品规格
- var currentSerial = $("#chinese_medicine_current_serial").val();
- //处方实际单次使用剂量
- var drugWin = $("#zy_drugWin").val();
- //医嘱码
- var zyInstruction = $("#zyInstruction").val();
- //医嘱
- var zyInstructionText = $('#zyInstruction option:selected').text();
- //单价
- var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
- //当前中药的总价
- var totalRetprice = Multiply(drugWin, zyPackRetprice);
- //中药类型
- var zyClassType = $("#zyClassType").val();
- //
- var zyHospApprFlag = $("#zyHospApprFlag").val();
- //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
- var currentYyClassType = $("#current_zyClassType").val();
- if (currentYyClassType == null || currentYyClassType == "") {
- //中药此时是第一次选择药品,不控制类型
- $("#current_zyClassType").val(zyClassType);
- } else if (currentYyClassType != zyClassType) {
- errorMesageSimaple("同一个中药处方不允许同时出现普通中药和颗粒剂中药!");
- return;
- }
- if (currentCode == null || currentCode == '') {
- errorMesageSimaple("未选择任何药品!");
- return;
- }
- //颗粒 剂量只能为整数
- if(zyClassType == '83' && !(/(^[1-9]\d*$)/.test(drugWin))){
- errorMesageSimaple("颗粒剂处方剂量只能为大于等于1的正整数!");
- return;
- }
- var html = '<div class="form-group" style="float: left;">';
- html += chineseMedicineNamme;
- if (zyInstruction != null && zyInstruction != '') {
- html += '[' + zyInstructionText + ']';
- }
- html += '<span style="margin-left: 5px"></span>';
- html += drugWin + $("#zyUnit").text();
- html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
- html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editChineseMedicine(this)"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left:10px;" onclick="removeYpOrProject(1,this)"></i>';
- html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
- html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
- html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
- html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
- html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
- html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
- html += '<input type="hidden" class="temporary_items_drugUnit" value="' + $("#zyUnit").text() + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
- html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
- html += '<input type="hidden" class="temporary_items_zyHospApprFlag" value="' + zyHospApprFlag + '"/>';
- html += '</div>';
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //原药品金额 如果是修改则需要设置
- var temporaryItemsAmount = 0;
- //当前需要被移除元素的下个兄弟节点
- var nextObj = null;
- //当前修改的药品是不是最后一个
- var isLast = false;
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = $("#chinese_medicine_update_flag").val();
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- //如果是修改,需要减去原来的费用
- if (updateFlag == "true" || updateFlag == true) {
- var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- //药品有可能会修改,所以,判断的时候要用原药品编码
- var updateOriCode = $("#update_ori_code").val();
- //规格有可能会修改,所以,判断的时候要用原规格
- var updateOriSerial = $("#update_ori_serial").val();
- for (var i = 0; i < formGroups.length; i++) {
- var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
- var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
- if (temporaryItemsCode === updateOriCode && temporaryItemsSerial === updateOriSerial) {
- temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
- if (formGroups.length > 1) {
- nextObj = $(formGroups[i]).next();
- }
- isLast = (i + 1) === formGroups.length;
- $(formGroups[i]).remove();
- break;
- }
- }
- }
- }
- //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
- if (nextObj == null || isLast) {
- $(tableId).find("div:eq(0)").append(html);
- } else {
- $(nextObj).before(html);
- }
- //设置当前处方金额
- // calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
- if (calculateTotalAmountFlag) {
- //设置总金额
- calculateTotalAmount(true);
- }
- clearChineseMedicine();
- }
- /**
- * 清空中药
- */
- function clearChineseMedicine() {
- $("#chinese_medicine_update_flag").val(false);
- $("#update_ori_code").val(null);
- $("#update_ori_serial").val(null);
- //药品名称
- $("#chinese_medicine_name").val(null);
- //当前药品编码
- $("#chinese_medicine_current_code").val(null);
- //当前药品规格
- $("#chinese_medicine_current_serial").val(null);
- //医嘱
- $("#zyInstruction").selectpicker('val', null);
- $('#zyInstruction').selectpicker('refresh');
- $("#zyHospApprFlag").selectpicker('val', '0');
- $('#zyHospApprFlag').selectpicker('refresh');
- //剂量
- $("#zy_drugWin").val(null);
- //单价
- $("#zy_packRetprice").val(null);
- zyUnitChange()
- }
- //中药单位改变
- function zyUnitChange() {
- var zyClassTypeTemp = $("#zyClassType").val()
- if(zyClassTypeTemp == '83'){
- $("#zyUnit").text('袋')
- //煮取 剪法 隐藏
- $("#cyZqlDiv").removeClass("in").addClass("hide");
- $("#ZySupplyTypeDiv").removeClass("in").addClass("hide");
- if($("#cyFjDiv")){
- $("#cyFjDiv").removeClass("in").addClass("hide");
- }
- }else {
- $("#zyUnit").text('g')
- $("#cyZqlDiv").removeClass("hide").addClass("in");
- $("#ZySupplyTypeDiv").removeClass("hide").addClass("in");
- if($("#cyFjDiv")){
- $("#cyFjDiv").removeClass("hide").addClass("in");
- }
- }
- }
- /**
- * 清空辅助检查、检验项目
- */
- function clearJyJcItem() {
- $("#update_ori_code").val(null);
- $("#jcjy_update_flag").val(false);
- //项目名称
- $("#jcJyItem").val(null);
- //当前项目编码
- $("#jcjy_current_code").val(null);
- //项目国家医保
- $("#jy_national_code").val(null);
- $("#jy_national_name").val(null);
- //单价
- $("#jcjyItemPrice").val(null);
- //备注
- $("#remark").val(null);
- $("#jcJyZltype").val(null);
- $("#jyZdSample").selectpicker('val', null);
- $('#jyZdSample').selectpicker('refresh');
- $("#yshPart").selectpicker('val', null);
- $('#yshPart').selectpicker('refresh');
- $("#execUnit").selectpicker('val', null);
- $('#execUnit').selectpicker('refresh');
- $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#jyQuantityDiv").removeClass("in").addClass("hide");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- $("#jyQuantity").val(null);
- }
- /**
- * 清空外配处方
- */
- function clearWpOrder() {
- $("#wp_medicine_name").val(null);
- $("#wp_medicine_update_flag").val(false);
- $("#rxItemTypeCode").selectpicker('val', '11');
- $('#rxItemTypeCode').selectpicker('refresh');
- $('#medcWayCodg').val(null)
- $('#medcWayCodg').selectpicker('refresh');
- setSelectDefaultVal('medcDays',1)
- $('#usedFrquCodg').val(null)
- $('#usedFrquCodg').selectpicker('refresh');
- $('#sinDosunt').val(null)
- $('#prdrName').val(null)
- $('#sinDoscnt').val('1')
- setSelectDefaultVal('usedFrquCodg','13')
- $('#drugDosunt').val(null)
- $('#drugSpec').val(null)
- $('#drugCnt').val(null)
- $('#drugDosform').val(null)
- $('#drugDosform').selectpicker('refresh');
- $('#wpHospApprFlag').val('1')
- $('#wpHospApprFlag').selectpicker('refresh');
- }
- /**
- * 清空诊疗项目
- */
- function clearZlItem() {
- $("#update_ori_code").val(null);
- $("#zl_update_flag").val(false);
- //项目名称
- $("#zlItem").val(null);
- //当前项目编码
- $("#zl_current_code").val(null);
- //单价
- $("#zlItemPrice").val(null);
- //备注
- $("#zlRemark").val(null);
- //描述
- $("#chargeUnit").val(null);
- $("#itemQuantity").val(1);
- $("#descriptions").val(null);
- $("#dayZlNum").selectpicker('val', 1);
- $('#dayZlNum').selectpicker('refresh');
- $("#zlHospApprFlag").selectpicker('val', '0');
- $('#zlHospApprFlag').selectpicker('refresh');
- $("#orderFrequencyZl").selectpicker('val', 'ONCE');
- $('#orderFrequencyZl').selectpicker('refresh');
- $("#totalNumZl").val(null);
- $("#totalAmountZl").val(null);
- $("#zlExecUnit").selectpicker('val', null);
- $('#zlExecUnit').selectpicker('refresh');
- }
- /**
- * 清空入院证输入框
- */
- function clearZyReq() {
- $("#inpatientWardBeHospitalized").selectpicker('val', null);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- $("#smallWardBeHospitalized").selectpicker('val', null);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- $("#admissStatus").selectpicker('val', null);
- $('#admissStatus').selectpicker('refresh');
- $("#conditionCode").selectpicker('val', null);
- $('#conditionCode').selectpicker('refresh');
- $("#routeOfAdmission").selectpicker('val', null);
- $('#routeOfAdmission').selectpicker('refresh');
- $("#totalBedNum").val(null);
- $("#freeBedNum").val(null);
- $("#occupationBedNum").val(null);
- $("#contacterName").val(null);
- $("#contacterRelationship").selectpicker('val', null);
- $('#contacterRelationship').selectpicker('refresh');
- $("#contacterPhone").val(null);
- $("#contacterAddress").val(null);
- $("#deposit").val(null);
- initSmallDeptByDept();
- }
- /**
- * 清空门诊手术输入框
- */
- function clearOpRecord() {
- $("#op_record_update_flag").val(false);
- $("#opName").selectpicker('val', null);
- $('#opName').selectpicker('refresh');
- $("#urgentClinicFlag").selectpicker('val', null);
- $('#urgentClinicFlag').selectpicker('refresh');
- $("#ssbc").selectpicker('val', null);
- $('#ssbc').selectpicker('refresh');
- $("#partCode").selectpicker('val', null);
- $('#partCode').selectpicker('refresh');
- $("#opScale").selectpicker('val', null);
- $('#opScale').selectpicker('refresh');
- $("#opTime").val(null);
- $("#hocusCode").selectpicker('val', null);
- $('#hocusCode').selectpicker('refresh');
- $("#doctorZd").selectpicker('val', null);
- $('#doctorZd').selectpicker('refresh');
- $("#opRecordRemark").val(null);
- }
- /**
- * 计算总金额
- * @param needRemoveLastObject 是否需要删除最后一次加进来的项目
- */
- function calculateTotalAmount(needRemoveLastObject) {
- //调用后去除所有的验证提示
- $("div.alert ").each(function (index, obj) {
- $(obj).remove();
- });
- var jsonData = getParamsForpPrescription(3);
- if(stringIsBlank(jsonData.visitDeptCode)){
- jsonData.visitDeptCode = localStorage.getItem("currentDeptNo")
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getAmountForTempPrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if(!stringIsBlank(res.discountWarningMessage)){
- warningMesageSimaple(res.discountWarningMessage)
- }
- if(!stringIsBlank(res.ypHealthEducation)){
- $("#ypHealthEducation").val(res.ypHealthEducation)
- }else {
- $("#ypHealthEducation").val(null)
- }
- $("#totalAmount").html(res.data.amount.toFixed(2));
- var arrs = $("span.cf_amount");
- for (var i = 0; i < arrs.length; i++) {
- if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
- $(arrs[i]).html(res.data.amountList[i].toFixed(2));
- }
- }
- } else {
- if (needRemoveLastObject) {
- var index = getIndex("bill_item_group");
- var tabId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- } else if (index == 5) {
- //手术
- tabId = "opRecordTab";
- }else if (index == 6) {
- //手术
- tabId = "wpMedicineTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- var last = $(tableId).find("div:eq(0)").find("div:last");
- if (last != null) {
- $(last).find("i:eq(2)").click();
- $(last).find("i:eq(3)").click();
- }
- }
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 打开住院处理窗口
- // * @param data
- // */
- // function beHospitalized() {
- // $("#beHospitalizedModal").modal();
- // //根据病人门诊id查询病人的入院申请
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // headers: {
- // 'Accept': 'application/json',
- // 'Authorization': 'Bearer ' + localStorage.getItem("token")
- // },
- // success: function (resZyz) {
- // if (resZyz == '401' || resZyz == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (resZyz.code == 0) {
- // $("#icdCodeInputBeHospitalized").val(resZyz.data.icdCode);
- // $("#icdTextBeHospitalized").val(resZyz.data.icdText);
- // $("#icdTextBeHospitalized").attr("title", resZyz.data.icdText);
- // $("#inpatientWardBeHospitalized").selectpicker('val', resZyz.data.reqDept);
- // $("#inpatientWardBeHospitalized").selectpicker('refresh');
- // initSmallDeptByDept();
- // $("#smallWardBeHospitalized").selectpicker('val', resZyz.data.smallDept);
- // $("#smallWardBeHospitalized").selectpicker('refresh');
- // $("#admissStatus").selectpicker('val', resZyz.data.admissStatus);
- // $("#admissStatus").selectpicker('refresh');
- // $("#zyReqVisitDate").val(format(resZyz.data.visitDate, "yyyy-MM-dd HH:mm:ss"));
- // }
- // }
- // });
- // }
- /**
- * 打开编辑用户信息窗口
- * @param data
- * @param type 1 患者详情处编辑 2 快速接诊处编辑 3 就诊详情预览
- */
- function editUserModal(patientId, type) {
- if (type == 3) {
- $("#editUserModalTitle").html("患者档案【预览】");
- $("#saveEditUser").removeClass("in").addClass("hide");
- } else {
- $("#editUserModalTitle").html("患者档案【修改】");
- $("#saveEditUser").removeClass("hide").addClass("in");
- }
- $("#openSource").val(type);
- if (patientId == null) {
- //医生工作台发起
- patientId = $("#patientId").text();
- }
- // else {
- // //快速接诊界面发起
- // clearRapidAccepts();
- // }
- if (patientId == null || patientId == "null" || patientId == "") {
- errorMesageSimaple("请输入需要编辑的患者信息");
- return;
- }
- $("#rapidAcceptsModal").modal("hide");
- $("#visitingDetailModal").modal("hide");
- $("#editUserModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res);
- $("#editUserModal").modal("hide");
- }
- }
- });
- }
- /**
- * 处方类型按钮切换事件
- * @param object
- * @param objectIndex
- */
- function billItemButtonChange(object, objectIndex) {
- $(".nav-tabs").removeClass("in").addClass("hide");
- $(".tab-content").removeClass("in").addClass("hide");
- $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
- $("#bill_item_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- $("#rp_form" + index).removeClass("show").addClass("hide");
- });
- $("#rp_form" + objectIndex).removeClass("hide").addClass("show");
- $(object).removeClass("btn-default").addClass("btn-primary");
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- if (objectIndex == 0) {
- $("#western_medicine_name").focus();
- //有时候调用药品多了以后,会导致一个药品处方名对应多个content显现
- var paneId = $("#xyTab li.active").find("a").attr("href");
- if (paneId != null) {
- //去除第一个字符 #
- paneId = paneId.slice(1);
- xyTableOnClick(paneId)
- }
- } else if (objectIndex == 1) {
- $("#chinese_medicine_name").focus();
- } else if (objectIndex == 2) {
- $("#jcJyItem").focus();
- YX02()
- } else if (objectIndex == 3) {
- $("#zlItem").focus();
- } else if (objectIndex == 4) {
- // $("#inpatientWardBeHospitalized").next().click();
- prevEleId = "zy_req_button";
- } else if (objectIndex == 5) {
- prevEleId = "op_record_button";
- }else if (objectIndex == 6) {
- $("#wp_medicine_name").focus();
- }
- }
- /**
- * 打开快速接诊窗口
- * @param data
- */
- function rapidAcceptsModal() {
- $("#rapidAcceptsModal").modal();
- //延迟触发 默认光标在卡号输入框
- setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
- }
- /**
- * checkBox样式
- */
- function formatCheck() {
- if ($("input.flat")[0]) {
- $(document).ready(function () {
- $('input.flat').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- /**
- * 卡号有变化后查询病人信息
- */
- function queryUserInfoByCardNo() {
- //当反写的id不存在,说明不是查询后的改变事件,触发查询
- var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
- clearRapidAcceptsModal();
- // console.log("queryUserInfoByCardNo",rapidAcceptsUserCardNo)
- if (rapidAcceptsUserCardNo == null || rapidAcceptsUserCardNo == "") {
- return;
- }
- // var index = rapidAcceptsUserCardNo.indexOf("-");
- // if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "")) {
- $("#cardNo").attr("title", rapidAcceptsUserCardNo);
- $.ajax({
- type: "GET",
- url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- console.log("rapidAcceptsUserCardNo",res)
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#rapidAcceptsUserName").val(res.data.name);
- $("#rapidAcceptsUserCode").val(res.data.patientId);
- $("#patientIdDb").val(res.data.patientId);
- $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
- $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
- $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
- $('#rapidAcceptsUserCertificateType').selectpicker('val', '01');
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
- $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
- $('#rapidAcceptsProvinceCode').selectpicker('val', res.data.provinceCode);
- $('#rapidAcceptsProvinceCode').selectpicker('refresh');
- initCity(3, res.data.cityCode);
- initDistrict(3, res.data.cityCode, res.data.districtCode);
- $("#rapidAcceptsDetail").val(res.data.detail);
- $("#rapidAcceptsUserAddress").attr("title", res.data.address);
- $("#rapidAcceptsUserAddress").val(res.data.address);
- $("#rapidAcceptsUserContact").val(res.data.relName);
- $("#rapidAcceptsUserContactPhone").val(res.data.contractName);
- //查询分诊号
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": res.data.patientId}),
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (resFz) {
- if (resFz == '401' || resFz == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (resFz.code == 0) {
- if (resFz.data == null || resFz.data.length == 0) {
- errorMesageSimaple("没有查询到符合条件的分诊记录!");
- clearRapidAcceptsModal();
- return;
- }
- $("#mzfzSerialNo").val(resFz.data[0].serialNo);
- }
- }
- });
- } else {
- errorMesageSimaple("病人信息不存在!");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- // }
- }
- /**
- * 清空快速接诊查询框
- */
- function clearRapidAccepts() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- $("#rapidAcceptsUserAddress").attr("title", null);
- $("#mzfzSerialNo").val(null);
- $("#rapidAcceptsUserCardNo").focus();
- $("#rapidAcceptsUserAddress").val(null);
- $("#rapidAcceptsUserContact").val(null);
- $("#rapidAcceptsUserContactPhone").val(null);
- }
- /**
- * 根据病人姓名输入框内容动态加载病人列表
- */
- function initUserList() {
- //var width=$("#userName").css("width");
- var settings = {
- trigger: 'click',
- content: '',
- width: 170,
- multi: true,
- closeable: false,
- style: '',
- delay: 300,
- padding: true,
- height: 300,
- };
- var webuiPopover = $('#symptomFlagCheck').webuiPopover('destroy').webuiPopover(settings);
- //用户姓名选中事件
- // $("#rapidAcceptsUserName").on("click", function (t) {
- // if ($(webuiPopover).css("display") == "block") {
- // refeshPatinetList(true);
- // }
- // });
- }
- /**
- * 刷新候诊病人列表
- */
- function refeshPatinetList(flag) {
- //如果是重新加载病人列表,需要重置下标
- if (flag) {
- //重置下标
- pageIndex = 0;
- msg_list_loading = true;
- }
- var userName = $('#rapidAcceptsUserName').val();
- if (!(userName == null || userName == "" || isChinese(userName))) {
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- // $("#webuiPopover0").css("display", "block");
- // $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
- var html = '<div class="list-group">';
- for (var i = 0; i < res.data.length; i++) {
- var mzPatientMi = res.data[i];
- html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
- if (mzPatientMi.gender == "男") {
- html += '<img src="/thmz/images/boy.png"/>'
- } else if (mzPatientMi.gender == "女") {
- html += '<img src="/thmz/images/girl.png"/>'
- } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
- html += '<img src="/thmz/images/girl_or_boy.png"/>'
- }
- html += '<div>' + mzPatientMi.name + ' ' + mzPatientMi.gender + ' ';
- html += mzPatientMi.ageString;
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
- html += '<span>' + mzPatientMi.phoneNo + '</span>';
- }
- html += '</div></a>';
- }
- html += '</div>';
- // if (flag) {
- // $("#webuiPopover0 div.webui-popover-content").html("");
- // }
- // $("#webuiPopover0 div.webui-popover-content").append(html);
- // $("#webuiPopover0 div.arrow").css("left", "23px");
- refeshPatinetListScrollEvent();
- } else {
- // $("#webuiPopover0").css("display", "none");
- }
- }
- //查询完成,设置加载完成
- msg_list_loading = false;
- }
- });
- }
- /**
- * 病人下拉列表滚动条滚动到底部时继续加载新纪录
- */
- function refeshPatinetListScrollEvent() {
- // $('.webui-popover-content').scroll(function (event) {
- // var top = $(this).scrollTop();
- // var height = $(this).height();
- // var scrollHeight = $(this).get(0).scrollHeight;
- // if (scrollHeight <= top + height) {
- // if (!msg_list_loading) {
- // msg_list_loading = true;
- // pageIndex = pageIndex + 1;
- // refeshPatinetList(false);
- // }
- // }
- // });
- }
- /**
- * 按照病人id查询病人信息
- * @param patientId
- */
- function fillUnClinicPatinet(patientId) {
- $("#rapidAcceptsUserCardNo").val(patientId);
- // $("#webuiPopover0").css("display", "none");
- queryUserInfoByCardNo();
- }
- /**
- * 加载主诉,体格检查,诊断窗口
- */
- function initRecommendList() {
- var width = $("#symptom").parent().css("width");
- var settings = {
- placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- trigger: 'click', //值:click,hover 触发方式 manual 手动
- content: '',//内容,内容可以是函数
- width: width,
- //arrow:false,//是否显示箭头
- multi: true,//在页面允许其他弹出层
- closeable: true,//显示关闭按钮
- style: '', //值:'',inverse
- delay: 300,//延迟时间, 悬浮属性才执行
- padding: true,//内容填充
- height: 320,
- //offsetTop:10,
- cache: true,//如果缓存设置为false,则popover将销毁并重新创建
- };
- //主诉弹窗
- var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
- //体格检查弹窗
- settings.height = 260;
- $('#weight').webuiPopover('destroy').webuiPopover(settings);
- //诊断弹窗
- settings.height = 320;
- var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
- //中医诊断弹窗
- var tcmDiagnoseWebuiPopover = $('#tcmDiagnose').webuiPopover('destroy').webuiPopover(settings);
- //西药弹窗
- settings.width = 680;
- settings.closeable = false;
- settings.arrow = false;//显示箭头或不显示箭头
- settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //中药弹窗
- settings.trigger = 'click';
- settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
- //手动触发
- settings.trigger = 'manual';
- var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //辅助检查、检验弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
- var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
- //诊疗弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="zlItemPopoverContent"><table id="tb_table_zl_item"></table></div>';
- var zlItemWebuiPopover = $('#zlItem').webuiPopover('destroy').webuiPopover(settings);
- //外配药弹窗
- settings.trigger = 'manual';
- settings.content = '<div id="wpMedicinePopoverContent"><table id="tb_table_wp_medicine"></table></div>';
- var zlItemWebuiPopover = $('#wp_medicine_name').webuiPopover('destroy').webuiPopover(settings);
- //主诉选中事件
- $("#symptom").on("click", function (t) {
- if ($(symptomWebuiPopover).css("display") == "block") {
- $("#webuiPopover1 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
- html += "</div>";
- html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
- '<div style="float: left">' +
- '<span style="margin-left: 20px;">内容:</span> ' +
- '</div>' +
- '<div style="float: left;">' +
- '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
- '<option label="常用症状" value="0">常用症状</option>' +
- '<option label="常用时间" value="1">常用时间</option>' +
- '<option label="常用标点" value="2">常用标点</option>' +
- '<option label="常用词" value="3">常用词</option>' +
- '</select> ' +
- '</div>' +
- '<div style="width: 200px;float: left;margin-left: 10px;">' +
- '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
- '</div>' +
- '<div style="float: left;margin-left: 10px;">' +
- ' <button type="button" class="btn" onclick="saveParams();"' +
- ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
- ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
- ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
- ' </svg>' +
- '新增' +
- ' </button>' +
- ' </div>' +
- '</div>';
- $("#webuiPopover1 div.webui-popover-content").html(html);
- $('#paramsType').selectpicker('refresh');
- $("#paramsType").parent().css("width", "140px").css("height", "34px");
- $("#webuiPopover1").css("z-index", "10");
- if ($("#webuiPopover1").hasClass("in")) {
- loadSymptom();
- }
- }
- //加载智能接诊模块的主诉推荐
- fitSymptomData();
- });
- //体格检查各输入框选中事件
- $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor,#pressure_high_left,#pressure_floor_left").on("click", function (t) {
- if ($("#webuiPopover2").css("display") == "block") {
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- //loadSymptom();
- } else {
- $('#weight').webuiPopover('show');
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- }
- return false;
- });
- //诊断选中事件
- $("#diagnose").on("click", function (t) {
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- if ($(diagnoseWebuiPopover).css("display") == "block") {
- $("#webuiPopover3 div.arrow").css("left", "23px");
- $("#webuiPopover3 a.close").css("margin-top", "15px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
- html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
- ' <input type="text" class="form-control has-feedback-left" ' +
- ' placeholder="搜索" style="padding-left: 10px;" onkeyup="debounce(loadDiagnose(this.value),100,true)" id="paramsDiagnose">' +
- ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
- ' </div>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
- html += "</div>";
- $("#webuiPopover3 div.webui-popover-content").html(html);
- $("#webuiPopover3").css("z-index", "10");
- //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
- //中文会导致查询混乱
- $("#paramsDiagnose").on('compositionstart', function () {
- $("#paramsDiagnose").attr("isNeedPrevent", true);
- });
- $("#paramsDiagnose").on('compositionend', function () {
- $("#paramsDiagnose").attr("isNeedPrevent", false);
- });
- loadDiagnose("");
- }
- //加载智能接诊模块的诊断推荐推荐
- fitDiagnoseData();
- });
- //中医诊断
- $("#tcmDiagnose").on("click", function (t) {
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- if ($(tcmDiagnoseWebuiPopover).css("display") == "block") {
- $("#webuiPopover4 div.arrow").css("left", "23px");
- $("#webuiPopover4 a.close").css("margin-top", "15px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
- html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
- ' <input type="text" class="form-control has-feedback-left" ' +
- ' placeholder="搜索" style="padding-left: 10px;" onkeyup="debounce(loadtcmDiagnose(this.value),100,true)" id="paramstcmDiagnose">' +
- ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
- ' </div>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='tcmDiagnoseContentHtml'>";
- html += "</div>";
- $("#webuiPopover4 div.webui-popover-content").html(html);
- $("#webuiPopover4").css("z-index", "10");
- //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
- //中文会导致查询混乱
- $("#paramstcmDiagnose").on('compositionstart', function () {
- $("#paramstcmDiagnose").attr("isNeedPrevent", true);
- });
- $("#paramstcmDiagnose").on('compositionend', function () {
- $("#paramstcmDiagnose").attr("isNeedPrevent", false);
- });
- loadtcmDiagnose("");
- }
- //加载智能接诊模块的诊断推荐推荐
- // fitDiagnoseData();
- });
- //现病史选中事件
- $("#emrHpi").on("click", function (t) {
- //加载智能接诊模块的现病史推荐推荐
- fitEmrHpiData();
- });
- //既往史选中事件
- $("#emrPs").on("click", function (t) {
- //加载智能接诊模块的既往史推荐推荐
- fitEmrPsData();
- });
- // //西药选中事件
- // $("#western_medicine_name").on("click", function (t) {
- // if ($(westernMedicineWebuiPopover).css("display") == "block") {
- // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(0);
- // }
- // });
- // //中药选中事件
- // $("#chinese_medicine_name").on("click", function (t) {
- // if ($(chineseMedicineWebuiPopover).css("display") == "block") {
- // $("#chineseMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- // loadYpList(1);
- // }
- // });
- // //诊疗与医技弹窗选中事件
- // $("#jcJyItem").on("click", function (t) {
- // if ($(jcJyItemWebuiPopover).css("display") == "block") {
- // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
- // loadjcJyItemList();
- // }
- // });
- //帮助字典弹窗
- settings.width = 450;
- settings.height = 500;
- settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
- settings.trigger = 'click';
- var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
- $("#treeButton").on("click", function (t) {
- // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
- //初始化药品,检查检验菜单树
- initzTree();
- });
- }
- /**
- * 新增通用参数
- */
- function saveParams() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveTCommonParams',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "paramsType": $("#paramsType").val(),
- "paramsName": $("#paramsNameInput").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- loadSymptom();
- $("#paramsNameInput").val(null);
- // $("#paramsType").selectpicker('val', 0);
- // $("#paramsType").selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载主诉参数列表
- */
- function loadSymptom() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadSymptom',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.featureList != null && res.featureList.length > 0) {
- html += '<div id="feature">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.featureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.featureList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.featureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.timeList != null && res.timeList.length > 0) {
- html += '<div id="time">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.timeList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.timeList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.timeList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.characterList != null && res.characterList.length > 0) {
- html += '<div id="character">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.characterList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.characterList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.characterList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.wordsList != null && res.wordsList.length > 0) {
- html += '<div id="words">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.wordsList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.wordsList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
- html += res.wordsList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#contentHtml").html(html);
- }
- });
- }
- /**
- * 加载体格检查参数列表
- */
- function loadHealthCheckup() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadHealthCheckup',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.weightList != null && res.weightList.length > 0) {
- html += '<div id="weightDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.weightList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.weightList[i].paramsName + '\',\'weight\')"><span style="padding: 0px 5px;">';
- html += res.weightList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.temperatureList != null && res.temperatureList.length > 0) {
- html += '<div id="temperatureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.temperatureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.temperatureList[i].paramsName + '\',\'temperature\')"><span style="padding: 0px 5px;">';
- html += res.temperatureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.sphygmusList != null && res.sphygmusList.length > 0) {
- html += '<div id="sphygmusDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.sphygmusList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.sphygmusList[i].paramsName + '\',\'sphygmus\')"><span style="padding: 0px 5px;">';
- html += res.sphygmusList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.breatheList != null && res.breatheList.length > 0) {
- html += '<div id="breatheDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.breatheList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.breatheList[i].paramsName + '\',\'breathe\')"><span style="padding: 0px 5px;">';
- html += res.breatheList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.pressureList != null && res.pressureList.length > 0) {
- html += '<div id="pressureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">血压:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.pressureList.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.pressureList[i].paramsName + '\',\'pressure_\')"><span style="padding: 0px 5px;">';
- html += res.pressureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#healthCheckupContentHtml").html(html);
- }
- });
- }
- /**
- * 加载中医诊断参数列表
- */
- function loadtcmDiagnose(value) {
- if (!$("#webuiPopover4").hasClass("in")) {
- return;
- }
- let isNeedPrevent = $("#paramstcmDiagnose").attr("isNeedPrevent");
- if (isNeedPrevent == "true") {
- return;
- }
- postAjaxJsonHttpRequst("/thmz/getTcmIcdCodeByParams",{name:value},true,function (res) {
- var html = '';
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- html += '<div>';
- for (var i = 0; i < res.data.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitTcmDiagnoseValue(\'' + res.data[i].name + '\',\'' + res.data[i].code + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
- html += res.data[i].name;
- html += '<small> (' + res.data[i].code + ')</small>';
- html += '</span></button>';
- }
- html += '</div>';
- }
- } else {
- errorMesage(res);
- }
- $("#tcmDiagnoseContentHtml").html(html);
- })
- }
- /**
- * 加载诊断参数列表
- * @param value
- */
- function loadDiagnose(value) {
- if (!$("#webuiPopover3").hasClass("in")) {
- return;
- }
- var isNeedPrevent = $("#paramsDiagnose").attr("isNeedPrevent");
- if (isNeedPrevent == "true") {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getIcdCodeByParams?commonParams=' + value,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- let crbFlag = '1'
- if (res.data != null && res.data.length > 0) {
- html += '<div>';
- for (var i = 0; i < res.data.length; i++) {
- html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitDiagnoseValue(\'' + res.data[i].name + '\',\'' + res.data[i].code + '\',\'' + crbFlag + '\',\'' + res.data[i].infectiousdiseasesFlag + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
- html += res.data[i].name;
- html += '<small> (' + res.data[i].code + ')</small>';
- html += '</span></button>';
- }
- html += '</div>';
- }
- } else {
- errorMesage(res);
- }
- $("#diagnoseContentHtml").html(html);
- }
- });
- }
- /**
- * 填充中医诊断
- */
- function fitTcmDiagnoseValue(name, code) {
- if (code === null || code === "") {
- return;
- }
- let html = '';
- let childrenNum = $("#tcmDiagnoseTags").children().length;
- if (childrenNum == 6) {
- errorMesageSimaple("最多填写六个诊断!");
- return;
- }
- let diagnoseValue = $("#tcmDiagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "") {
- diagnoseValue = code;
- } else {
- if (diagnoseValue.indexOf(code) != -1) {
- errorMesageSimaple("诊断已存在,请勿重复添加!");
- return;
- }
- diagnoseValue += "," + code;
- }
- $("#tcmDiagnoseValue").val(diagnoseValue);
- if (childrenNum == 0) {
- html += '<span class="el-tag--mainDiagnosis" ';
- } else {
- html += '<span class="el-tag--secondaryDiagnosis" ';
- }
- 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>';
- $("#tcmDiagnoseTags").append(html);
- $("#tcmDiagnoseTags").parent().parent().css("height", $("#tcmDiagnoseTags").height());
- }
- /**
- * 填充诊断
- * @param value
- * @param code
- */
- function fitDiagnoseValue(value, code,crbFlag,infectiousdiseasesFlag) {
- if (code === null || code === "") {
- return;
- }
- var html = '';
- var childrenNum = $("#diagnoseTags").children().length;
- if (childrenNum == 6) {
- errorMesageSimaple("最多填写六个诊断!");
- return;
- }
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "") {
- diagnoseValue = code;
- } else {
- if (diagnoseValue.indexOf(code) != -1) {
- errorMesageSimaple("诊断已存在,请勿重复添加!");
- return;
- }
- diagnoseValue += "," + code;
- }
- $("#diagnoseValue").val(diagnoseValue);
- if (childrenNum == 0) {
- html += '<span class="el-tag--mainDiagnosis" ';
- } else {
- html += '<span class="el-tag--secondaryDiagnosis" ';
- }
- html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
- $("#diagnoseTags").append(html);
- $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
- if(stringNotBlank($("#patientId").text()) && crbFlag =='1' && infectiousdiseasesFlag == 1){
- crbMainCard()
- }
- }
- /**
- * 删除中医诊断
- */
- function removetcmDiagnoseValue(code) {
- var childrenIndex = 0;
- var children = $("#tcmDiagnoseTags").children();
- for (var i = 0; i < children.length; i++) {
- if ($(children[i]).attr("id") == code) {
- childrenIndex = i;
- break;
- }
- }
- $($("#tcmDiagnoseTags").children("span")[childrenIndex]).remove();
- if (childrenIndex == 0) {
- $($("#tcmDiagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
- }
- let tcmDiagnoseValue = $("#tcmDiagnoseValue").val();
- $("#tcmDiagnoseValue").val(tcmDiagnoseValue.replace(code, ""));
- $("#tcmDiagnoseTags").parent().parent().css("height", $("#tcmDiagnoseTags").height());
- }
- /**
- * 移除诊断
- * @param code
- */
- function removeDiagnoseValue(code) {
- var childrenIndex = 0;
- var children = $("#diagnoseTags").children();
- for (var i = 0; i < children.length; i++) {
- if ($(children[i]).attr("id") == code) {
- childrenIndex = i;
- break;
- }
- }
- $($("#diagnoseTags").children("span")[childrenIndex]).remove();
- if (childrenIndex == 0) {
- $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
- }
- var diagnoseValue = $("#diagnoseValue").val();
- $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
- $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
- }
- /**
- * 点击通用参数属性值时设置值到对应的区域
- * @param value
- * @param id
- */
- function fitValue(value, id) {
- //当选择的是血压时
- if (id == "pressure_") {
- var arr = value.split("/");
- $("#pressure_high").val(arr[0]);
- $("#pressure_floor").val(arr[1]);
- if ($("#pressureLeftFlag").hasClass("in")) {
- $("#pressure_high_left").val(arr[0]);
- $("#pressure_floor_left").val(arr[1]);
- }
- //当选的是体重,体温,脉搏和呼吸时
- } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
- $("#" + id).val(value);
- } else {
- //主诉拼写时
- var valueExist = $("#" + id).val();
- if (valueExist != null && valueExist != "") {
- value = valueExist + value;
- }
- $("#" + id).val(value);
- }
- }
- /**
- * 加载药品列表数列表
- * @param index
- */
- function loadYpList(index, event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- var medicinePopoverContent = null;
- var tableMedicine = null;
- var MedicineName = null;
- //var groupNo=null;
- if (index == 0) {
- medicinePopoverContent = "westernMedicinePopoverContent";
- tableMedicine = "tb_table_western_medicine";
- MedicineName = "western_medicine_name";
- // groupNo=71;
- }
- if (index == 1) {
- medicinePopoverContent = "chineseMedicinePopoverContent";
- tableMedicine = "tb_table_chinese_medicine";
- MedicineName = "chinese_medicine_name";
- // groupNo=$("#zyClassType").val();
- }
- // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#' + MedicineName).webuiPopover('show');
- $('#' + tableMedicine).bootstrapTable('refresh');
- $('#' + tableMedicine).bootstrapTable({
- url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var groupNo = null;
- if (index == 0) {
- groupNoListMz = groupNoList.filter((ere)=>{
- return "1" == ere.mzFlag && "1" == ere.xyFlag
- })
- // console.log("groupNoListMz",groupNoListMz[0].groupNo)
- groupNo = groupNoListMz[0].groupNo;
- }
- if (index == 1) {
- groupNo = $("#zyClassType").val();
- }
- var temp = {
- groupNo: groupNo,
- commonParams: $("#" + MedicineName).val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- // {
- // title: '药品说明书',
- // field: 'op',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // var str = '<button type="button" class="btn btn-primary btn-sm" onclick="hlyyypsms(\'' + row.code + '\',\'' + row.serial + '\')">说明书</button>';
- // return [str].join('');
- // }
- // },
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '药品名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'specification',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'manufactory',
- title: '生产厂家',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'miniUnitName',
- title: '单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '零售价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return '0.0元';
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'drugWinDesc',
- title: '剂量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'stockAmountVirtual',
- title: '库存数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'ybBlNew',
- title: '医保报销比例',
- align: "center",
- valign: 'middle',
- // sortable: true
- // formatter: function (value, row, index) {
- // if (value != null) {
- // return value + '%';
- // }
- // }
- }, {
- field: 'ybComment',
- title: '医保说明',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'nationalCode',
- title: '医保编码',
- align: "left",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#" + medicinePopoverContent).parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- postAjaxJsonHttpRequst("/thmz/checkKssByUserCode",{code:row.code,ypName:row.name,serial:row.serial,patientId:$("#patientId").text(),ypType:row.ypType},true,function (cres) {
- if(cres.code == 0){
- $('#' + MedicineName).webuiPopover('hide');
- console.log("row",row)
- console.log("index",index)
- if (index == 0) {
- clearWesternMedicine(false);
- checkYpInfo(row.code, row.serial, row. groupNo, true, null, 3);
- }
- if (index == 1) {
- checkZyInfo(row.code, row.serial, $("#zyClassType").val(), true);
- }
- }else if(cres.code == -2) {
- errorMesageSimaple(`没有${row.code}/${row.name}的抗生素使用级别权限,不能开具此药品`)
- }else if(cres.code == -3) {
- errorMesageSimaple(cres.message)
- } else {
- errorMesage(cres)
- }
- })
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 西药
- * @param code
- * @param serial
- * @param groupNo
- * @param needNotice 是否需要提示 当用户操作的时候 true 需要提示, 范文和处方回写的时候false不需要提示
- * @param orderNo 处方号,回写的时候需要用,因为有的处方没有满5个
- * @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
- */
- function checkYpInfo(code, serial, groupNo, needNotice, orderNo, type) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, null, 0)) {
- return;
- }
- $("#current_groupNo").val(groupNo);
- //不需要每次都关闭这个帮助字典
- //$("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=" + groupNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: needNotice,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //如果
- if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
- initNavTabs(0, groupNo, orderNo);
- }
- var cfdesc = '普药';
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- //每个处方不能超过5个药品
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children().length;
- var currentGroupNo = $(tableId).find("input.current_groupNo").val();
- var flag = childrens === 5;
- if (!needNotice) {
- flag = childrens === 5 && $(tableId).is(':last-child');
- }
- if (currentGroupNo != null && currentGroupNo != '' && groupNo != currentGroupNo) {
- //当前编辑的处方与选中的品类非同一处方能保存的
- var currentGroupNos = $("#xyTabContent").find("input.current_groupNo");
- //是否需要新增处方页,以保存医材处方
- var needAddTable = true;
- for (var i = 0; i < currentGroupNos.length; i++) {
- if ($(currentGroupNos[i]).val() == groupNo) {
- var next = $(currentGroupNos[i]).next();
- if (needAddTable && $(next).children().length < 5) {
- var parentId = $(currentGroupNos[i]).parent().attr("id");
- //切换处方
- $("#xyTab").find("a[href='#" + parentId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- //因为存在没有满5个的处方页,直接保存到该页
- needAddTable = false;
- fitWesternMedicine(res, groupNo, type);
- }
- }
- }
- if (needAddTable) {
- //91 医材
- var message = "医材需要单独处方,是否需要新增医材处方?";
- if (groupNo == '71') {
- message = "普通西成药需要单独处方,是否需要新增处方?"
- } else if (groupNo == '111') {
- message = "麻、精一药物需要单独处方,是否需要新增处方?"
- } else if (groupNo == '131') {
- message = "精二药物需要单独处方,是否需要新增处方?"
- }
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo, type);
- // //选中药品后,光标默认到用法
- // $("#supplyType").next().click();
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo, type);
- }
- }
- //当前编辑的处方非普通西药处方
- } else if (flag) {
- if (needNotice) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo, type);
- });
- $("#cancelButton").off("click");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- fitWesternMedicine(res, groupNo, type);
- }
- } else {
- //修改药品
- if (orderNo != null) {
- //西药处方数量
- // var xyTabLiLength = $("#xyTab li").length;
- // if (xyTabLiLength < orderNo) {
- //
- // } else {
- // $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- // }
- var tableId = orderNoAndTableIdMap.get(orderNo);
- if (tableId != null && tableId != "") {
- //切换处方
- $("#xyTab").find("a[href='#" + tableId + "']").off("click").tab('show');
- //$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- } else {
- refreshNavTabs(0, groupNo, orderNo);
- }
- fitWesternMedicine(res, groupNo, type);
- } else {
- $("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
- fitWesternMedicine(res, groupNo, type);
- }
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 项目限制提示
- * @param res
- * @param projectDesc
- */
- function checkProjectSelfInfo(row) {
- // console.log("checkProjectSelfInfo",row,ele)
- var code = 0;
- var age = currentPatientInfo.age;
- var sex = currentPatientInfo.sex;
- console.log("currentPatientInfo",currentPatientInfo)
- if (row.genderRestriction && row.genderRestriction != 0 && sex != row.genderRestriction) {
- warningMesageSimaple('项目'+row.name+'要求性别为'+row.genderRestriction == '1'?'男':'女'+'请重新选择!');
- code = 1;
- }
- if (row.maxAgeRestriction && age > row.maxAgeRestriction) {
- warningMesageSimaple('项目'+row.name+'要求年龄小于或等于'+row.maxAgeRestriction+'岁,请重新选择!');
- code = 1;
- }
- if (row.minAgeRestriction && age < row.minAgeRestriction) {
- warningMesageSimaple('项目'+row.name+'要求年龄大于或等于'+row.minAgeRestriction+'岁,请重新选择!');
- code = 1;
- }
- return code;
- }
- /**
- * 药品与项目自费信息提示
- * @param res
- * @param projectDesc
- */
- function hintProjectSelfPayInfo(selfpayProp, projectDesc) {
- var zgmztczf = $("#zgmztczf").val();
- if ((zgmztczf == 1 || zgmztczf == "1") && selfpayProp != null) {
- selfpayProp = Number(selfpayProp);
- if (selfpayProp > 0) {
- var titile = "当前项目含自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
- if (selfpayProp < 1) {
- titile = "当前项目含部分自费" + projectDesc + ",请与患者提前确认是否继续使用,并签署自费承诺书!";
- }
- warningMesageSimaple(titile);
- }
- }
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息 中药
- * @param code
- * @param serial
- * @param groupNo 药房信息
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- function checkZyInfo(code, serial, groupNo, async) {
- //判断是否有重复的项目 返回true 说明有重复的
- if (verifyRepeat(code, serial, null, 1)) {
- return;
- }
- let tcmDiagnoseValue = $("#tcmDiagnoseValue").val()
- if(stringIsBlank(tcmDiagnoseValue)){
- errorMesageSimaple('开中药必须要写中医诊断')
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=" + groupNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
- //如果
- if ($("#zyTab").find("li") == null || $("#zyTab").find("li").length == 0) {
- initNavTabs(1, null, null);
- //$("input.zyfs").val(1);
- }
- $("#chinese_medicine_name").val(res.data.name);
- $("#chinese_medicine_name").blur();
- //$("#zy_drugWin").val(res.data.weight);
- $("#zy_packRetprice").val(res.data.packRetprice);
- $("#chinese_medicine_current_code").val(res.data.code);
- $("#chinese_medicine_current_serial").val(res.data.serial);
- if (async) {
- //选中药品后,光标默认到数量输入框
- $("#zy_drugWin").focus();
- // prevEleId = 'zy_drugWin';
- }
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载辅助检查、检验列表
- * @param index
- */
- function loadjcJyItemList(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
- // return;
- // }
- $('#jcJyItem').webuiPopover('show');
- $('#tb_table_jc_jy_item').bootstrapTable('refresh');
- $('#tb_table_jc_jy_item').bootstrapTable({
- url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- commonParams: $("#jcJyItem").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'type',
- title: '项目类型',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == 1 || value == "1") {
- return "检验";
- }
- if (value == 2 || value == "2") {
- return "辅助检查";
- }
- if (value == 3 || value == "3") {
- return "诊疗";
- }
- return "";
- }
- },
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#jcJyItemPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- postAjaxJsonHttpRequst("/thmz/checkJyJcGenderAndAge",{
- patientId: $("#patientId").text(),
- type:row.type,
- code:row.code
- },true,function (resJyJc) {
- if(resJyJc.code == 0){
- $('#jcJyItem').webuiPopover('hide');
- $("#jcJyZltype").val(row.type);
- $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- if (row.type == 1) {
- //检验
- $("#jyZdSampleDiv").removeClass("hide").addClass("in");
- $("#jyQuantityDiv").removeClass("hide").addClass("in");
- $("#yshPartDiv").removeClass("in").addClass("hide");
- if (row.sampleCode != null && row.sampleCode != "") {
- $("#jyZdSample").selectpicker('val', row.sampleCode);
- $('#jyZdSample').selectpicker('refresh');
- }
- } else if (row.type == 2) {
- //检查
- $("#yshPartDiv").removeClass("hide").addClass("in");
- $("#jyZdSampleDiv").removeClass("in").addClass("hide");
- $("#jyQuantityDiv").removeClass("in").addClass("hide");
- if (row.bwCode != null && row.bwCode != "") {
- $("#yshPart").selectpicker('val', row.bwCode);
- $('#yshPart').selectpicker('refresh');
- }
- }
- $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
- checkJcJyItemInfo(row.code, row.name, row.type, true);
- }else {
- errorMesage(resJyJc)
- }
- })
- }
- });
- }
- /**
- * 加载外配药品
- * @param event
- */
- function loadWpMedicineList(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- $('#wp_medicine_name').webuiPopover('show');
- $('#tb_table_wp_medicine').bootstrapTable('refresh');
- $('#tb_table_wp_medicine').bootstrapTable({
- url: '/thmz/wpMzPrescription/queryRxMedicine', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- keyWard: $("#wp_medicine_name").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'medListCodg',
- title: '医保码',
- align: "center",
- valign: 'middle',
- width: 250,
- // sortable: true
- },
- {
- field: 'genname',
- title: '药品名称',
- align: "center",
- valign: 'middle',
- width: 150,
- // sortable: true
- }
- , {
- field: 'specName',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'prdrName',
- title: '生产厂家',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'aprvno',
- title: '批准文号',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'dualchnlFlag',
- title: '是否双通道标志',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if(value == 1 || value == "1"){
- return "是";
- }
- return "否";
- }
- // sortable: true
- }, {
- field: 'minPrepunt',
- title: '最小制剂单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'minPacunt',
- title: '最小包装单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#wpMedicinePopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#wp_medicine_name').webuiPopover('hide');
- //诊疗
- if ($("#wpMedicineTab").find("li") == null || $("#wpMedicineTab").find("li").length == 0) {
- initNavTabs(6, null, null);
- }
- $("#wp_medicine_name").val(row.genname);
- $("#wp_medicine_name").blur();
- $("#sinDosunt").val(row.minPrepunt);
- $("#sinDoscnt").val('1');
- setSelectDefaultVal('usedFrquCodg','13')
- setSelectDefaultVal('drugDosform',row.dosformName)
- $("#prdrName").val(row.prdrName);
- $("#drugDosunt").val(row.minPacunt);
- $("#drugSpec").val(row.specName);
- $("#wp_medicine_current_code").val(row.medListCodg);
- $("#sinDoscnt").focus();
- return;
- }
- });
- }
- /**
- * 加载诊疗列表
- * @param index
- */
- function loadZlItemList(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- $('#zlItem').webuiPopover('show');
- $('#tb_table_zl_item').bootstrapTable('refresh');
- $('#tb_table_zl_item').bootstrapTable({
- url: '/thmz/getZlItemByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- commonParams: $("#zlItem").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'chargeAmount',
- title: '价格',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return "0.00元";
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'descriptions',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'selfpayProp',
- title: '自付比例',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value != null) {
- return value + '%';
- }
- }
- }, {
- field: 'connotation',
- title: '医保说明',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'nationalCode',
- title: '医保编码',
- align: "left",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- //判断是否验证失败,0通过1失败
- // console.log("checkProjectSelfInfo(row)",checkProjectSelfInfo(row))
- if(checkProjectSelfInfo(row) == 1){
- return;
- }
- hintProjectSelfPayInfo(row.selfpayProp, "诊疗");
- $('#zlItem').webuiPopover('hide');
- $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
- $("#zlExecUnit").selectpicker('refresh');
- //诊疗
- if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
- initNavTabs(3, null, null);
- }
- $("#zlItem").val(row.name);
- $("#zlItem").blur();
- $("#zlItemPrice").val(row.chargeAmount);
- zlItemPriceIsReadonly(row.chargeAmount);
- $("#chargeUnit").val(row.specification);
- $("#zl_current_code").val(row.code);
- $("#itemQuantity").val(1);
- $("#descriptions").val(row.descriptions);
- $("#descriptions").attr('title', row.descriptions);
- $("#dayZlNum").selectpicker('val', 1);//默认不选中
- $("#dayZlNum").selectpicker('refresh');
- $("#orderFrequencyZl").selectpicker('val', 'ONCE');//默认不选中
- $("#orderFrequencyZl").selectpicker('refresh');
- calculateZl(false);
- $("#chargeUnit").focus();
- return;
- }
- });
- }
- /**
- * 诊疗单价输入框是否只读
- */
- function zlItemPriceIsReadonly(val) {
- if(val !=null && Number(val) > 0 ){
- $("#zlItemPrice").attr("readonly","readonly")
- }else {
- $("#zlItemPrice").removeAttr("readonly")
- }
- }
- /**
- * 诊疗与医技选中
- * @param code
- * @param name 回写的时候可以设置null
- * @param type 1 检验 2 检查
- * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- */
- //function checkJcJyItemInfo(code, name, type) {
- function checkJcJyItemInfo(code, name, type, async) {
- // //判断是否有重复的项目 返回true 说明有重复的
- // if (verifyRepeat(code, null, 2)) {
- // return;
- // }
- //不需要每次都关闭帮助树
- //$("#treeButton").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJcJyItemChargeByCode?code=' + code + '&jcJyZltype=' + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,//当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- hintProjectSelfPayInfo(res.selfpayProp, type == 1 ? "检验" : "辅助检查");
- //如果
- if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
- initNavTabs(2, null, null);
- }
- if (name == null) {
- name = res.name;
- }
- $("#jcJyItem").val(name);
- $("#jcJyItem").blur();
- $("#jcjyItemPrice").val(res.totalAmount);
- $("#jcjy_current_code").val(code);
- $("#jy_national_code").val(res.data[0].nationalCode);
- $("#jy_national_name").val(res.data[0].nationalName);
- $("#jyQuantity").val(1);
- $("#execUnit").selectpicker('val', res.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- // if (async) {
- // if (type == 1) {
- // //选中项目后,光标默认到数量输入框
- // $("#jyZdSample").next().click();
- // // prevEleId = 'jyZdSample';
- // } else if (type == 2) {
- // $("#yshPart").next().click();
- // // prevEleId = 'yshPart';
- // }
- // }
- }
- $("#jyjcNote").val(res.note)
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询辅助检查、检验项目明细
- * @param code 编码
- * @param jcJyZltype 1 检验 2 检查
- */
- function getJcJyItemChargeByCode(code, jcJyZltype) {
- if (code != null) {
- $("#itemCodeSearch").val(code);
- $("#jcJyZltypeSearch").val(jcJyZltype);
- } else if ($("#jcjy_current_code").val() == null || $("#jcjy_current_code").val() == '') {
- errorMesageSimaple("未选中任何项目!");
- return;
- }
- $("#jcJyItemModal").modal("show");
- $('#jcJyItemTable').bootstrapTable('refresh');
- $('#jcJyItemTable').bootstrapTable({
- url: '/thmz/getJcJyItemChargeByCode', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var itemCodeSearch = $("#itemCodeSearch").val();
- var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
- if (itemCodeSearch == null || itemCodeSearch == "") {
- itemCodeSearch = $("#jcjy_current_code").val();
- jcJyZltypeSearch = $("#jcJyZltype").val();
- }
- var temp = {
- code: itemCodeSearch,
- jcJyZltype: jcJyZltypeSearch
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'tcCode',
- title: '项目编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'code',
- title: '收费编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'name',
- title: '收费名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'num',
- title: '数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '单价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }, {
- field: 'totalAmount',
- title: '总金额',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return 0;
- }
- return value.toFixed(2);
- }
- }, {
- field: 'selfpayProp',
- title: '自付比例',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value != null) {
- return value + '%';
- }
- }
- }, {
- field: 'connotation',
- title: '医保说明',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#itemCodeSearch").val(null);
- $("#jyjcNote").val(res.note)
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- }
- });
- }
- function getJyJcCodeParam() {
- var itemCodeSearch = $("#itemCodeSearch").val();
- var jcJyZltypeSearch = $("#jcJyZltypeSearch").val();
- if (itemCodeSearch == null || itemCodeSearch == "") {
- itemCodeSearch = $("#jcjy_current_code").val();
- jcJyZltypeSearch = $("#jcJyZltype").val();
- }
- var temp = {
- code: itemCodeSearch,
- jcJyZltype: jcJyZltypeSearch
- };
- return temp;
- }
- /**
- * 判断是否有重复的项目 返回true 说明有重复的
- * @param code 编码
- * @param serial 药品规格 null 时是非药品
- * @param chargeUnitCode 检查部位或者检验物 null 时是 诊疗
- * @param index
- */
- function verifyRepeat(code, serial, chargeUnitCode, index) {
- //是新增药品还是编辑 true 修改 默认false
- var updateFlag = null;
- if (index == 0) {
- updateFlag = $("#western_medicine_update_flag").val();
- } else if (index == 1) {
- updateFlag = $("#chinese_medicine_update_flag").val();
- } else if (index == 2) {
- updateFlag = $("#jcjy_update_flag").val();
- } else if (index == 3) {
- updateFlag = $("#zl_update_flag").val();
- } else if (index == 5) {
- updateFlag = $("#op_record_update_flag").val();
- }else if (index == 6) {
- updateFlag = $("#wp_medicine_update_flag").val();
- }
- if (updateFlag == undefined || updateFlag == null) {
- updateFlag = false;
- }
- if (updateFlag == "true" || updateFlag == true) {
- return false;
- }
- var tabId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- } else if (index == 1) {
- //中成药
- tabId = "zyTab";
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- } else if (index == 5) {
- //手术
- tabId = "opRecordTab";
- }else if (index == 6) {
- //外配药
- tabId = "wpMedicineTab";
- }
- var tableId = $("#" + tabId + " li.active").find("a").attr("href");
- var items = $(tableId).find("div:eq(0)").find("div.form-group");
- var groupId = null;
- if (index == 0) {
- groupId = $("#groupId").val();
- }
- if (items != null && items.length > 0) {
- for (var i = 0; i < items.length; i++) {
- if (serial == null) {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_desc_value = $(items[i]).find("input.temporary_items_desc_value").val();
- if (chargeUnitCode == null && code === temporary_items_code) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- if (code === temporary_items_code && chargeUnitCode === temporary_items_desc_value) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- if (index == 0) {
- //西药需要判断组号,因为可能会有不同组的皮试用药,需要相同的药品
- var temporary_items_groupId = $(items[i]).find("input.temporary_items_groupId").val();
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial && groupId === temporary_items_groupId) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- } else {
- var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
- var temporary_items_serial = $(items[i]).find("input.temporary_items_serial").val();
- if (code === temporary_items_code && serial === temporary_items_serial) {
- errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- /**
- * 初始化处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- * @param groupNo 初始化时候的药房分类
- * @param orderNo 初始化时候的处方组号
- */
- function initNavTabs(index, groupNo, orderNo) {
- var tabId = null;
- var tabContentId = null;
- var paneId = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneId = "xycf_" + getUID();
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneId = "zycf_" + getUID();
- cfdesc = '中草药';
- } else if (index == 2) {
- //医技
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- paneId = "jcjycf_" + getUID();
- cfdesc = '辅助检查、检验';
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneId = "zlcf_" + getUID();
- cfdesc = '诊疗';
- } else if (index == 4) {
- //住院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneId = "zyReqcf_" + getUID();
- cfdesc = '入院';
- } else if (index == 5) {
- //手术
- tabId = "opRecordTab";
- tabContentId = "opRecordTabContent";
- paneId = "opRecordcf_" + getUID();
- cfdesc = '手术';
- }else if (index == 6) {
- //外配药
- tabId = "wpMedicineTab";
- tabContentId = "wpMedicineTabContent";
- paneId = "wpMedicinecf_" + getUID();
- cfdesc = '外配药';
- }
- var tabHtml = '<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab" ';
- if (index == 0) {
- tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
- }
- tabHtml += '>处方 <small class="cfdesc">(' + cfdesc + ')</small></a></li>';
- $("#" + tabId).html(tabHtml);
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
- html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
- html += '<input class="current_groupNo" type="hidden"/>';
- html += ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
- html += '<div style="width: 460px;">'
- if (index == 1) {
- html += '<div id="cyFjDiv" style="width: 130px;float: left;line-height: 34px;">' +
- ' <label class="my_label_2">复煎:</label>' +
- ' <div style="width: 69px;float: left;">' +
- ' <input type="number" class="form-control " id="cyFj" placeholder="请输入" value="1"/>' +
- ' </div>次' +
- ' </div>';
- html += '<div style="width: 130px;float: left;line-height: 34px;">' +
- ' <label class="my_label_2">分服:</label>' +
- ' <div style="width: 69px;float: left;">' +
- ' <input type="number" class="form-control " id="cyFfcs" placeholder="请输入" value="2"/>' +
- ' </div>次' +
- ' </div>';
- html += '<div style="width: 180px;float: left;">' +
- ' <label class="my_label_2">用法:</label>' +
- ' <div style="width: 135px;float: left;">' +
- ' <select class="form-control selectpicker show-tick useType"' +
- ' title="请选择" id="useType_1">' +
- ' </select>' +
- ' </div>' +
- ' </div>';
- html += '</div><div style="width: 460px;">'
- html += '<input id="singleAmount" type="hidden"/>';
- }
- html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- // else if (index == 1) {
- // html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品代煎所产生的费用!</div>';
- // }
- html += '</div></div></div>';
- $("#" + tabContentId).html(html);
- if (index == 1) {
- var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
- $('#cyJssm').html(water);
- $('#cyJssm').selectpicker('refresh');
- $("#cyJssm").selectpicker('val', "加凉水");
- $('#cyJssm').selectpicker('refresh');
- if($("#zyClassType").val() =='83'){
- $("#cyFjDiv").removeClass("in").addClass("hide");
- }else {
- $("#cyFjDiv").removeClass("hide").addClass("in");
- }
- initAllMzYshZdFysm();
- //initZyOrderFrequencys("zy_orderFrequency_1", false);
- initZySupplyTypes("zy_supplyType_1", false);
- }
- if (groupNo != null && groupNo != "") {
- //设置当前药品的品类
- $("#" + paneId).find("input.current_groupNo").val(groupNo);
- }
- if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
- orderNoAndTableIdMap.put(orderNo, paneId);
- tableIdAndOrderNoMap.put(paneId, orderNo);
- }
- }
- /**
- * 清空处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院 5 手术 6外配药
- */
- function clearNavTabs(index) {
- var tabId = null;
- var tabContentId = null;
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- $("#cyJsl").val(400);
- $("#cyZql").val(200);
- $("#cyFj").val(1);
- $("#cyFfcs").val(2);
- $("#cyMtjs").val(1);
- $("#zyfs").val(null);
- $("#cyJssm").selectpicker('val', "加凉水");
- $('#cyJssm').selectpicker('refresh');
- $("#zy_supplyType_1").selectpicker('val', null);
- $('#zy_supplyType_1').selectpicker('refresh');
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- } else if (index == 3) {
- //医技
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- } else if (index == 4) {
- //住院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- } else if (index == 5) {
- //手术
- tabId = "opRecordTab";
- tabContentId = "opRecordTabContent";
- }else if (index == 6) {
- //手术
- tabId = "wpMedicineTab";
- tabContentId = "wpMedicineTabContent";
- }
- $("#" + tabId).html(null);
- $("#" + tabContentId).html(null);
- }
- /**
- * 添加处方分页
- * @param index 0 西药 1 中药 2 诊疗 3 入院
- * @param groupNo 71 普通西药 91 医材 111 麻、精一 131 精二 151 诊疗
- * @param orderNo 处方号
- */
- function refreshNavTabs(index, groupNo, orderNo) {
- var tabId = null;
- var tabContentId = null;
- var paneIdPrfix = null;
- var cfdesc = '普药';
- //西药
- if (index == 0) {
- tabId = "xyTab";
- tabContentId = "xyTabContent";
- paneIdPrfix = "xycf_";
- if (groupNo == '91') {
- cfdesc = '医材';
- } else if (groupNo == '111') {
- cfdesc = '麻、精一';
- } else if (groupNo == '131') {
- cfdesc = '精二';
- }
- // else if(groupNo=='151'){
- // cfdesc='诊疗';
- // }
- } else if (index == 1) {
- //中草药
- tabId = "zyTab";
- tabContentId = "zyTabContent";
- paneIdPrfix = "zycf_";
- cfdesc = '中草药';
- } else if (index == 2) {
- //辅助检查、检验
- tabId = "jcjyTab";
- tabContentId = "jcjyTabContent";
- paneIdPrfix = "jcjycf_";
- cfdesc = '辅助检查、检验';
- } else if (index == 3) {
- //诊疗
- tabId = "zlTab";
- tabContentId = "zlTabContent";
- paneIdPrfix = "zlcf_";
- cfdesc = '诊疗';
- } else if (index == 4) {
- //入院
- tabId = "zyReqTab";
- tabContentId = "zyReqTabContent";
- paneIdPrfix = "zyReqcf_";
- cfdesc = '入院';
- } else if (index == 5) {
- //手术
- tabId = "opRecordTab";
- tabContentId = "opRecordTabContent";
- paneIdPrfix = "opRecordcf_";
- cfdesc = '手术';
- }else if (index == 6) {
- //手术
- tabId = "wpMedicineTab";
- tabContentId = "wpMedicineTabContent";
- paneIdPrfix = "wpMedicinecf_";
- cfdesc = '外配药';
- }
- // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
- // var length = $(tableId).find("div:eq(0)").children().length;
- // if(length==0){
- // //当前处方是空白的,不需要新增处方
- // return;
- // }
- var cfTitle = "处方" + " <small class=\"cfdesc\">(" + cfdesc + ")</small>";
- var paneId = paneIdPrfix + getUID();
- //清除选中的样式
- $("#" + tabId).find("li.active").removeClass("active");
- var tabHtml = '<li><a href="#' + paneId + '" role="tab" data-toggle="tab"';
- if (index == 0) {
- tabHtml += ' onclick=xyTableOnClick("' + paneId + '")';
- }
- tabHtml += '>' + cfTitle + '</a';
- tabHtml += '</li>';
- $("#" + tabId).append(tabHtml);
- var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
- '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
- '<input class="current_groupNo" type="hidden"/>' +
- ' <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
- ' <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">' +
- '<div style="width: 460px;">' +
- '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
- if (index == 0) {
- html += '<div style="width: 310px;float: left;color: red;padding-top: 8px;">说明:此费用包含药品给药方式所产生的费用!</div>';
- }
- html += '</div></div>';
- $("#" + tabContentId).append(html);
- //切换处方
- $("#" + tabId).find("a[href='#" + paneId + "']").off("click").tab('show');
- if (groupNo != null && groupNo != "") {
- //设置当前药品的品类
- $("#" + paneId).find("input.current_groupNo").val(groupNo);
- }
- if (orderNo != null && orderNo != "" && orderNoAndTableIdMap != null) {
- orderNoAndTableIdMap.put(orderNo, paneId);
- tableIdAndOrderNoMap.put(paneId, orderNo);
- }
- }
- /**
- * 判断是否需要自动增加组号
- * @param res
- */
- function autoAddGroupId(res) {
- var tableId = $("#xyTab li.active").find("a").attr("href");
- var childrens = $(tableId).find("div:eq(0)").children();
- var prevCategoriesFlag = null;
- if (childrens != null && childrens.length > 0) {
- prevCategoriesFlag = $(childrens[childrens.length - 1]).find("input.temporary_items_categoriesFlag").val();
- if (prevCategoriesFlag == "" || prevCategoriesFlag == undefined) {
- prevCategoriesFlag = null;
- }
- }
- if (!(res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2" || res.data.categoriesFlag == 1 || res.data.categoriesFlag == "1") ||
- ((res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2" || res.data.categoriesFlag == 1 || res.data.categoriesFlag == "1") && prevCategoriesFlag != null && prevCategoriesFlag != "1" && prevCategoriesFlag != 1 && prevCategoriesFlag != "2" && prevCategoriesFlag != 2)) {
- //非针剂默认要切换组号 或者 是针剂,但是上一个药品不是针剂,这时候也要新换一个组号
- var last = parseInt($("#groupId > option:last").val());
- $("#groupId").selectpicker('val', last);
- $('#groupId').selectpicker('refresh');
- }
- }
- /**
- * 填充西药选中的内容
- * @param res
- * @param groupNo
- * @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
- */
- function fitWesternMedicine(res, groupNo, type) {
- hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
- if (type != 0) {
- //处方修改的时候不改变组号
- autoAddGroupId(res);
- }
- $("#categoriesFlag").val(res.data.categoriesFlag);
- //prevCategoriesFlag = res.data.categoriesFlag;
- $("#western_medicine_name").val(res.data.name);
- $("#western_medicine_name").blur();
- var drugWinHtml = '';
- var index = null;
- if (res.data.weight != null) {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- index = res.data.weighUnit;
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- if (index == null) {
- index = res.data.volUnit;
- }
- }
- if (res.data.miniUnit != null && res.data.miniUnit != "") {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(1);
- $("#drugWinDb").val(1);
- }
- drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
- if (index == null) {
- index = res.data.miniUnit;
- }
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- $("#drugWinUnit").selectpicker('val', index);
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- $("#packUnit").selectpicker('val', res.data.packUnitDesc);
- $('#packUnit').selectpicker('refresh');
- }
- $("#packRetprice").val(res.data.packRetprice);
- $("#packSize").val(res.data.packSize);
- $("#western_medicine_current_code").val(res.data.code);
- $("#western_medicine_current_serial").val(res.data.serial);
- if ($("#dayNum").val() == null) {
- //天数 同组药品天数相同
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- }
- if (($("#supplyType").val() == null || $("#supplyType").val() == "") && res.data.supplyType != null) {
- // 给药方式 同组药品给药方式相同
- $("#supplyType").selectpicker('val', res.data.supplyType);
- $('#supplyType').selectpicker('refresh');
- }
- if (($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") && res.data.frequency != null) {
- //频次编码 同组药品频次编码相同
- $("#orderFrequency").selectpicker('val', res.data.frequency);
- $('#orderFrequency').selectpicker('refresh');
- }
- if ($("#orderFrequency").val() == null || $("#orderFrequency").val() == "") {
- //频次编码 防止频次为空
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
- if (res.data.psFlag != null && (res.data.psFlag == 1 || res.data.psFlag == "1")) {
- if (res.data.categoriesFlag == 0 || res.data.categoriesFlag == "0" || res.data.categoriesFlag == 2 || res.data.categoriesFlag == "2") {
- initTryResultSelect(res.data.categoriesFlag);
- }
- }
- $("#manufactoryName").val(res.data.manufactoryName);
- $("#specification").val(res.data.specification);
- calculate();
- $("#addPDiv").css("margin-left", "50px");
- $("#hlyyypsms").removeClass("hide").addClass("in");
- $("#western_medicine_name").focus();
- }
- /**
- * 剂量单位改变事件
- */
- function drugWinUnitChange() {
- var desc = $('#drugWinUnit').find("option:selected").attr('desc');
- $("#drugWin").val(desc);
- $("#drugWinDb").val(desc);
- calculate();
- }
- /**
- * 根据选择的内容计算总的用药量
- */
- function calculate() {
- //最小规格剂量
- var drugWinDb = $("#drugWinDb").val();
- //天数
- var dayNum = $("#dayNum").val();
- //当前使用的最小剂量
- var drugWin = $("#drugWin").val();
- //频率
- var times = $('#orderFrequency').find("option:selected").attr('desc');
- //包装规格数量
- var packSize = $("#packSize").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (drugWinDb == null || drugWinDb === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWinDb = 1;
- }
- if (dayNum == null || dayNum === "") {
- if (currentGroupNo == '71') {
- return;
- }
- dayNum = 1;
- }
- if (drugWin == null || drugWin === "") {
- if (currentGroupNo == '71') {
- return;
- }
- drugWin = 1;
- }
- if (times == null || times === "") {
- if (currentGroupNo == '71') {
- return;
- }
- times = 1;
- }
- if (packSize == null || packSize === "") {
- return;
- }
- //拆零总量
- var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
- //整包装的数量
- var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
- $("#gross").val(totalNum);
- $("#totalRetprice").val(Multiply(totalNum, packRetprice));
- }
- /**
- * 根据选择的总量计算金额 只有医材的时候需要计算
- */
- function calculateSimple() {
- //总量
- var gross = $("#gross").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- $("#totalRetprice").val(Multiply(gross, packRetprice));
- //当前药房编码
- var currentGroupNo = $("#current_groupNo").val();
- if (currentGroupNo == '91') {
- var dayNum = $("#dayNum").val();
- if (dayNum == null || dayNum == "") {
- //医材默认天数为1
- $("#dayNum").selectpicker('val', 1);
- $('#dayNum').selectpicker('refresh');
- }
- var orderFrequency = $("#orderFrequency").val();
- if (orderFrequency == null || orderFrequency == "") {
- $("#orderFrequency").selectpicker('val', "ONCE");
- $('#orderFrequency').selectpicker('refresh');
- }
- }
- }
- /**
- * 根据中药付数计算金额
- */
- function calculateZyAmount() {
- var singleAmount = $("#singleAmount").val();
- var tableId = $("#zyTab li.active").find("a").attr("href");
- //获取中药付数
- //var zyfs = $(tableId).find("input.zyfs").val();
- var zyfs = $("#zyfs").val();
- var cfAmount = Multiply(zyfs, singleAmount);
- $(tableId).find("span.cf_amount").html(cfAmount);
- calculateTotalAmount(false);
- }
- /**
- * 将病人信息填入患者信息修改form
- * @param patinet
- */
- function fillPlusPatinet(patinet) {
- if (patinet != null) {
- $("#editUserCode").val(patinet.patientId);
- $("#editUserName").val(patinet.name);
- $("#editUserName").blur();
- $("#editUserAge").val(patinet.age);
- $("#editUserAge").blur();
- $("#editUserGender").selectpicker('val', patinet.sex);
- $("#editUserGender").selectpicker('refresh');
- $("#editUserGender").blur();
- $("#editUserBirthDay").val(patinet.birthDayStr);
- $("#editUserBirthDay").blur();
- $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(patinet.icCardNo);
- $("#editUserCardNo").attr("title", patinet.icCardNo);
- $("#editUserCardNo").blur();
- $("#editUserPhoneNum").val(patinet.phoneNo);
- $("#editUserPhoneNum").attr("title", patinet.phoneNo);
- $("#editUserPhoneNum").blur();
- $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserPatientsNature").blur();
- $("#editUserIdCard").val(patinet.socialNo);
- $("#editUserIdCard").attr("title", patinet.socialNo);
- $("#editUserIdCard").blur();
- $('#editUserProvinceCode').selectpicker('val', patinet.provinceCode);
- $('#editUserProvinceCode').selectpicker('refresh');
- initCity(2, patinet.cityCode);
- initDistrict(2, patinet.cityCode, patinet.districtCode);
- $("#editUserDetail").val(patinet.detail);
- $("#editUserDetail").blur();
- $("#editUserContact").val(patinet.relName);
- $("#editUserContactPhone").val(patinet.contractName);
- }
- }
- /**
- * 修改病人信息
- */
- function modifyPatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/modifyPatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#editUserName").val(),
- "age": $("#editUserAge").val(),
- "sex": $("#editUserGender").val(),
- "birthDay": $("#editUserBirthDay").val(),
- "certificateType": $("#editUserCertificateType").val(),
- "icCardNo": $("#editUserCardNo").val(),
- "phoneNo": $("#editUserPhoneNum").val(),
- "responseType": $("#editUserPatientsNature").val(),
- "socialNo": $("#editUserIdCard").val(),
- "provinceCode": $("#editUserProvinceCode").val(),
- "cityCode": $("#editCityCode").val(),
- "districtCode": $("#editUserDistrictCode").val(),
- "detail": $("#editUserDetail").val(),
- "patientId": $("#editUserCode").val(),
- "relName": $("#editUserContact").val(),
- "contractName": $("#editUserContactPhone").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#editUserModal').modal('hide');
- var patientId = $("#patientId").text();
- let tempMzfzSerialNo = $("#mzfzSerialNoInClick").val();
- if (patientId != null && patientId != 'null' && patientId != "" && tempMzfzSerialNo.indexOf("clnicId_") < 0 ) {
- realClinicalReception(patientId, $("#mzfzSerialNoInClick").val(), $("#mzfzReqTypeNoInClick").val());
- } else {
- if(ksjzType == 2){
- let tempPatientId = $("#editUserCode").val();
- clearRapidAccepts();
- $("#rapidAcceptsUserCardNo").val(tempPatientId);
- queryUserInfoByCardNo();
- ksjzType = null;
- }
- }
- clearPlusPatinet();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 将病人信息修改域置空
- * @param patinet
- */
- function clearPlusPatinet() {
- ksjzType = null;
- $("#editUserCode").val(null);
- $("#editUserName").val(null);
- $("#editUserAge").val(null);
- $("#editUserGender").selectpicker('val', '1');
- $("#editUserGender").selectpicker('refresh');
- $("#editUserBirthDay").val(null);
- $('#editUserCertificateType').selectpicker('val', '01');
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(null);
- $("#editUserCardNo").attr("title", null);
- $("#editUserPhoneNum").val(null);
- $("#editUserPhoneNum").attr("title", null);
- $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserIdCard").val(null);
- $("#editUserIdCard").attr("title", null);
- $('#editUserProvinceCode').selectpicker('val', null);
- $('#editUserProvinceCode').selectpicker('refresh');
- $('#editCityCode').selectpicker('val', null);
- $('#editCityCode').selectpicker('refresh');
- $('#editUserDistrictCode').selectpicker('val', null);
- $('#editUserDistrictCode').selectpicker('refresh');
- $("#editUserDetail").val(null);
- $("#editUserContact").val(null);
- $("#editUserContactPhone").val(null);
- var openSource = $("#openSource").val();
- if (openSource == 2 || openSource == '2') {
- $("#rapidAcceptsModal").modal();
- } else if (openSource == 3 || openSource == '3') {
- $("#visitingDetailModal").modal();
- }
- $("#openSource").val(null);
- }
- // /**
- // * 保存入院证
- // */
- // function saveBeHospitalized() {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/saveMzZyReq',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "patientId": $("#patientId").text(),
- // "icdCode": $("#icdCodeBeHospitalized").val(),
- // "icdText": $("#icdTextBeHospitalized").val(),
- // "reqDept": $("#inpatientWardBeHospitalized").val(),
- // "smallDept": $("#smallWardBeHospitalized").val(),
- // "admissStatus": $("#admissStatus").val()
- // }),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if (res.code == 0) {
- // successMesage(res);
- // $('#beHospitalizedModal').modal('hide');
- // loadInClinicTableList();
- // loadClinicTableList();
- // clearWorkSpace();
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
- function getRePortRangeArr() {
- var rePortRange = $('#reportrange span').html();
- var rePortRangeArr = rePortRange.split(" - ");
- rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
- rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
- return rePortRangeArr;
- }
- /**
- * 初始医生工作太配置
- */
- function initWorkspaceConfigForCurrent() {
- $.ajax({
- type: "GET",
- url: '/thmz/getWorkspaceConfigForCurrent',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data.symptomFlag == 1) {
- $("#symptomFlag").removeClass("in").addClass("hide");
- if ($("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.symptomFlag == 0) {
- $("#symptomFlag").removeClass("hide").addClass("in");
- if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
- $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrHpiFlag == 1) {
- $("#emrHpiFlag").removeClass("in").addClass("hide");
- if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrHpiFlag == 0) {
- $("#emrHpiFlag").removeClass("hide").addClass("in");
- if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
- $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.emrPsFlag == 1) {
- $("#emrPsFlag").removeClass("in").addClass("hide");
- if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.emrPsFlag == 0) {
- $("#emrPsFlag").removeClass("hide").addClass("in");
- if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
- $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.personalHistoryFlag == 1) {
- $("#personalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.personalHistoryFlag == 0) {
- $("#personalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.fzZlFlag == 1) {
- $("#fzZlFlag").removeClass("in").addClass("hide");
- if ($("#fzZlFlagCheck").parent().hasClass("checked")) {
- $("#fzZlFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.fzZlFlag == 0) {
- $("#fzZlFlag").removeClass("hide").addClass("in");
- if (!$("#fzZlFlagCheck").parent().hasClass("checked")) {
- $("#fzZlFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.crbHistoryFlag == 1) {
- $("#crbHistoryFlag").removeClass("in").addClass("hide");
- if ($("#crbHistoryFlagCheck").parent().hasClass("checked")) {
- $("#crbHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.crbHistoryFlag == 0) {
- $("#crbHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#crbHistoryFlagCheck").parent().hasClass("checked")) {
- $("#crbHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.familyHistoryFlag == 1) {
- $("#familyHistoryFlag").removeClass("in").addClass("hide");
- if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.familyHistoryFlag == 0) {
- $("#familyHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
- $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.obstericalHistoryFlag == 1) {
- $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
- if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.obstericalHistoryFlag == 0) {
- $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
- if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
- $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.pressureLeftFlag == 1) {
- $("#pressureLeftFlag").removeClass("in").addClass("hide");
- if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.pressureLeftFlag == 0) {
- $("#pressureLeftFlag").removeClass("hide").addClass("in");
- if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
- $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.tentativeDiagnosisFlag == 1) {
- $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
- if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.tentativeDiagnosisFlag == 0) {
- $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
- if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
- $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.checkboxFlag == 1) {
- if ($("#checkboxFlagCheck").parent().hasClass("checked")) {
- $("#checkboxFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.checkboxFlag == 0) {
- if (!$("#checkboxFlagCheck").parent().hasClass("checked")) {
- $("#checkboxFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- if (res.data.zlPrintFlag == 1) {
- if ($("#zlPrintFlagCheck").parent().hasClass("checked")) {
- $("#zlPrintFlagCheck").parent().parent().click();//当前选中改为不选中
- }
- } else if (res.data.zlPrintFlag == 0) {
- if (!$("#zlPrintFlagCheck").parent().hasClass("checked")) {
- $("#zlPrintFlagCheck").parent().parent().click();//当前不选中改为选中
- }
- }
- //设置是否默认勾选处方回调
- localStorage.setItem("checkboxFlag", res.data.checkboxFlag);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存医生工作台配置
- */
- function saveWorkspaceConfig() {
- var symptomFlag = $("#symptomFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrHpiFlag = $("#emrHpiFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var emrPsFlag = $("#emrPsFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var personalHistoryFlag = $("#personalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var familyHistoryFlag = $("#familyHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var fzZlFlag = $("#fzZlFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var crbHistoryFlag = $("#crbHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var obstericalHistoryFlag = $("#obstericalHistoryFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var pressureLeftFlag = $("#pressureLeftFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var tentativeDiagnosisFlag = $("#tentativeDiagnosisFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var checkboxFlag = $("#checkboxFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- var zlPrintFlag = $("#zlPrintFlagCheck").parent().hasClass("checked") == true ? 0 : 1;
- $.ajax({
- type: "POST",
- url: '/thmz/saveWorkspaceConfig',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "symptomFlag": symptomFlag,
- "emrHpiFlag": emrHpiFlag,
- "emrPsFlag": emrPsFlag,
- "personalHistoryFlag": personalHistoryFlag,
- "familyHistoryFlag": familyHistoryFlag,
- "fzZlFlag": fzZlFlag,
- "crbHistoryFlag": crbHistoryFlag,
- "obstericalHistoryFlag": obstericalHistoryFlag,
- "pressureLeftFlag": pressureLeftFlag,
- "tentativeDiagnosisFlag": tentativeDiagnosisFlag,
- "checkboxFlag": checkboxFlag,
- "zlPrintFlag": zlPrintFlag
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- initWorkspaceConfigForCurrent();
- $("#configWorkspaceModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化药品,检查检验菜单树
- */
- function initzTree() {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- var webuiId = $("#treeButton").attr("data-target");
- var top = $("#" + webuiId).css("top");
- if (top.indexOf("-") == 0) {
- $("#" + webuiId).css("top", '0px');
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 2) {
- $("#jcJyItem").webuiPopover('hide');
- $.ajax({
- type: "GET",
- url: '/thmz/getJyJcZdClasses',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
- var setting = {
- callback: {
- onClick: zTreeOnClick
- }
- };
- $.fn.zTree.init($("#treeDemo"), setting, res.data);
- var webuiId = $("#treeButton").attr("data-target");
- var top = $("#" + webuiId).css("top");
- if (top.indexOf("-") == 0) {
- $("#" + webuiId).css("top", '0px');
- }
- } else {
- errorMesage(res);
- }
- }
- });
- } else if (index == 1) {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("中药暂无帮助字典");
- } else if (index == 3) {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("诊疗暂无帮助字典");
- } else {
- $("#treeButton").webuiPopover('hide');
- warningMesageSimaple("入院暂无帮助字典");
- }
- }
- /**
- * 节点点击事件
- * @param event
- * @param treeId
- * @param treeNode
- */
- function zTreeOnClick(event, treeId, treeNode) {
- var index = getIndex("bill_item_group");
- if (index == 0) {
- $("#western_medicine_name").val(treeNode.id);
- $('#western_medicine_name').webuiPopover('show');
- loadYpList(0, null);
- } else if (index == 2) {
- $("#jcJyItem").val(treeNode.id);
- $('#jcJyItem').webuiPopover('show');
- loadjcJyItemList(null);
- }
- }
- /**
- * 构建处方参数
- * @param type 1 保存处方 2 保存模板 3 计算金额
- * @returns {any}
- */
- function getParamsForpPrescription(type) {
- var codes = $("#diagnoseValue").val();
- var icdCode = null;
- if (codes != null && codes.length > 0) {
- var arr = codes.split(",");
- if (arr != null) {
- for (i = 0; i < arr.length; i++) {
- if (arr[i] != "") {
- if (icdCode == null) {
- icdCode = arr[i];
- } else {
- icdCode += "," + arr[i];
- }
- }
- }
- }
- }
- let tcmCodes = $("#tcmDiagnoseValue").val();
- let tcmIcdCodes = null;
- if (tcmCodes != null && tcmCodes.length > 0) {
- let arr = tcmCodes.split(",");
- if (arr != null) {
- for (i = 0; i < arr.length; i++) {
- if (arr[i] != "") {
- if (tcmIcdCodes == null) {
- tcmIcdCodes = arr[i];
- } else {
- tcmIcdCodes += "," + arr[i];
- }
- }
- }
- }
- }
- var jsonData = JSON.parse('' +
- '{"patientId": "",' +
- '"visitDeptCode":"",' +
- '"firstOrNot":"",' +
- '"icdCode": "",' +
- '"icdText": null,' +
- '"tcmIcdCode": "",' +
- '"tcmIcdText": null,' +
- '"jzFlag": "0",' +
- '"serialNo":"",' +
- '"mzBlRecord": ' +
- '{"firstOrNot": "",' +
- '"emrChiefComplaint": "",' +
- '"emrHpi": "",' +
- '"emrPs": "",' +
- '"emrPe": "",' +
- '"emrFzjc": null,' +
- '"emrProcess": null,' +
- '"emrXyy": "无",' +
- '"emrYypg": "无",' +
- '"emrGnpg": "无",' +
- '"emrJkjy": "",' +
- '"personalHistory": "",' +
- '"familyHistory": "",' +
- '"fzZl": "",' +
- '"crbHistory": "",' +
- '"obstericalHistory": "",' +
- '"weight": "",' +
- '"temperature": "",' +
- '"sphygmus": "",' +
- '"breathe": "",' +
- '"pressureHigh": "",' +
- '"pressureFloor": "",' +
- '"pressureHighLeft": "",' +
- '"pressureFloorLeft": "",' +
- '"tentativeDiagnosis":"",' +
- '"prescriptionDetail":""},' +
- '"mzChargeDetailList": [],' +
- '"rxDruginfoList": [],' +
- '"wxmallPackagePurchasedItemList": [],' +
- '"mzYjReqList": [],' +
- '"mzZyReq": {"reqDept": "","smallDept": "","admissStatus": "","conditionCode": "","routeOfAdmission": "", "contacterName":null , "contacterRelationship": "", "contacterPhone":null , "contacterAddress":null , "deposit":null },' +
- '"opRecordList": [],' +
- '"patientAllergenInfoList": [],' +
- '"zgmztczf":"",' +
- '"opspDisecode":"",' +
- '"opspDiseName":"",' +
- '"reqType":"",' +
- '"orderType":"",' +
- '"ghFeeFlag":"",' +
- '"grzhzf":"",' +
- '"readCardResult":"",' +
- '"readCardType":"01"}');
- jsonData.patientId = $("#patientId").text();
- var userIdCode = localStorage.getItem("userIdCode");
- var visitDeptCode = localStorage.getItem(userIdCode);
- if (visitDeptCode == null) {
- visitDeptCode = "";
- }
- jsonData.visitDeptCode = visitDeptCode;
- jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
- jsonData.icdCode = icdCode;
- jsonData.tcmIcdCode = tcmIcdCodes;
- jsonData.serialNo = $("#mzfzSerialNoInClick").val();
- if (type == 1) {
- jsonData.turnToConsultationId = $("#turnToConsultationIdInClick").val();
- var mdtrtGrpType = $("#mdtrtGrpType").val();
- var trumFlag = $("#trumFlag").val();
- var relTtpFlag = $("#relTtpFlag").val();
- if (trumFlag == "1" && relTtpFlag == "") {
- errorMesageSimaple("请注意【外伤标志】为【是】,【涉及第三方标志】不能为空!");
- $("#messageButton").attr("disabled", false);
- $("#messageModal").modal("hide");
- throw new Error("请注意【外伤标志】为【是】,【涉及第三方标志】不能为空!");
- }
- var otpErReflFlag = $("#otpErReflFlag").val();
- var expContent = JSON.parse("{}");
- if (mdtrtGrpType != "" && mdtrtGrpType != "-1") {
- expContent.MDTRT_GRP_TYPE = mdtrtGrpType;
- }
- if (trumFlag != "") {
- expContent.TRUM_FLAG = trumFlag;
- }
- if (relTtpFlag != "") {
- expContent.REL_TTP_FLAG = relTtpFlag;
- }
- if (otpErReflFlag != "" && otpErReflFlag != "-1") {
- expContent.OTP_ER_REFL_FLAG = otpErReflFlag;
- }
- jsonData.expContent = JSON.stringify(expContent);
- }
- jsonData.mzBlRecord.firstOrNot = jsonData.firstOrNot;
- jsonData.mzBlRecord.emrChiefComplaint = $("#symptom").val();
- jsonData.mzBlRecord.emrHpi = $("#emrHpi").val();
- jsonData.mzBlRecord.emrPs = $("#emrPs").val();
- jsonData.mzBlRecord.emrPe = $("#otherCheck").val();
- jsonData.mzBlRecord.emrJkjy = $("#healthEducation").val();
- jsonData.mzBlRecord.personalHistory = $("#personalHistory").val();
- jsonData.mzBlRecord.familyHistory = $("#familyHistory").val();
- jsonData.mzBlRecord.fzZl = $("#fzZl").val();
- jsonData.mzBlRecord.crbHistory = $("#crbHistory").val();
- jsonData.mzBlRecord.obstericalHistory = $("#obstericalHistory").val();
- jsonData.mzBlRecord.weight = $("#weight").val();
- jsonData.mzBlRecord.temperature = $("#temperature").val();
- jsonData.mzBlRecord.sphygmus = $("#sphygmus").val();
- jsonData.mzBlRecord.breathe = $("#breathe").val();
- jsonData.mzBlRecord.pressureHigh = $("#pressure_high").val();
- jsonData.mzBlRecord.pressureFloor = $("#pressure_floor").val();
- jsonData.mzBlRecord.pressureHighLeft = $("#pressure_high_left").val();
- jsonData.mzBlRecord.pressureFloorLeft = $("#pressure_floor_left").val();
- jsonData.mzBlRecord.tentativeDiagnosis = $("#tentativeDiagnosis").val();
- //职工统筹部分参数
- jsonData.zgmztczf = $("#zgmztczf").val();
- jsonData.grzhzf = $("#grzhzf").val();
- jsonData.readCardResult = $("#readCardResult").val();
- jsonData.reqType = $("#mzReqType").val();
- jsonData.orderType = $("#mzOrderTypeSelect").val();
- jsonData.ghFeeFlag = $("#ghFeeSelect").val();
- jsonData.opspDisecode = curOpspDiseCode;
- jsonData.opspDiseName = curOpspDiseName;
- //设置过敏源
- var zdAllergen = $("#zdAllergen").val();
- var ypDitList = $("#ypDitList").val();
- if (zdAllergen != null && zdAllergen.length > 0) {
- for (var i = 0; i < zdAllergen.length; i++) {
- var tempJson = JSON.parse('{}');
- tempJson.allergenCode = zdAllergen[i];
- tempJson.type = 0;
- jsonData.patientAllergenInfoList[jsonData.patientAllergenInfoList.length] = tempJson;
- }
- }
- if (ypDitList != null && ypDitList.length > 0) {
- for (var i = 0; i < ypDitList.length; i++) {
- var tempJson = JSON.parse('{}');
- tempJson.allergenCode = ypDitList[i];
- tempJson.type = 1;
- jsonData.patientAllergenInfoList[jsonData.patientAllergenInfoList.length] = tempJson;
- }
- }
- //设置处方详情
- var emrFzjc = null;
- var xyTabContents = $("#xyTabContent").find("div.tab-pane");
- //处方号
- var orderNo = 0;
- var arrs = $("span.cf_amount");
- //西药设置
- if (xyTabContents != null && xyTabContents.length > 0) {
- for (var i = 0; i < xyTabContents.length; i++) {
- //当前药品类型
- var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "","frequency": "","orderDays": "","paySelf": "0","drugWin": "1","instructionCode":"",' +
- '"instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","tryFlag":"","tryResult":"","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
- tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(formGroups[j]).find("input.temporary_items_gross").val();
- tempJson.drugQuan = $(formGroups[j]).find("input.temporary_items_drugWin").val();
- tempJson.drugUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnit").val();
- tempJson.frequency = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
- tempJson.orderDays = $(formGroups[j]).find("input.temporary_items_dayNum").val();
- tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
- tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
- tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
- tempJson.hospApprFlag = $(formGroups[j]).find("input.temporary_items_xyHospApprFlag").val();
- orderNo = i + 1;
- tempJson.orderNo = orderNo;
- tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
- tempJson.groupNo = currentGroupNo;
- var tryResult = $(formGroups[j]).find("input.temporary_items_tryResult").val();
- if (tryResult != undefined || tryResult != null || tryResult != "") {
- if (tryResult == 100 || tryResult == "100") {
- tempJson.tryFlag = 1;
- } else {
- tempJson.tryResult = tryResult;
- }
- }
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- }
- }
- //中草药
- var zyTabContents = $("#zyTabContent").find("div.form-group");
- if (zyTabContents != null && zyTabContents.length > 0) {
- orderNo++;
- var zyfs = $("#zyfs").val();
- if (zyfs == null || zyfs == "") {
- if (type == 3) {
- zyfs = 1;
- } else {
- errorMesageSimaple("中药付数为空,请设置!");
- $("#messageButton").attr("disabled", false);
- throw new Error('中药付数为空,请设置!');
- }
- }
- //中药的类型
- var currentZyClassType = $("#current_zyClassType").val();
- for (var i = 0; i < zyTabContents.length; i++) {
- var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "g","frequency": "","orderDays": "1","paySelf": "0","drugWin": "","instructionCode":"",' +
- '"instructionText":"","orderNo":"1","groupOrder":"1","supplyCode":"","tryFlag":"0","tryResult":"0","groupNo":"","cyJssm":"","cyDj":"","cyFysm":"","cyJsl":"","cyZql":"","cyFj":"","cyFfcs":"","cyMtjs":""}');
- tempJson.chargeItemCode = $(zyTabContents[i]).find("input.temporary_items_code").val();
- tempJson.serial = $(zyTabContents[i]).find("input.temporary_items_serial").val();
- tempJson.quantity = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugQuan = $(zyTabContents[i]).find("input.temporary_items_drugWin").val();
- tempJson.drugWin = zyfs;
- tempJson.drugUnit=$(zyTabContents[i]).find("input.temporary_items_drugUnit").val();
- //tempJson.frequency = $("#zy_orderFrequency_1").val();
- tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
- tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
- tempJson.hospApprFlag = $(zyTabContents[i]).find("input.temporary_items_zyHospApprFlag").val();
- tempJson.cyFysm = $("#useType_1").val();
- tempJson.cyJssm = $("#cyJssm").val();
- tempJson.cyJsl = $("#cyJsl").val();
- if(currentZyClassType !='83'){
- tempJson.cyZql = $("#cyZql").val();
- tempJson.cyFj = $("#cyFj").val();
- tempJson.cyDj = $("#zy_supplyType_1").val();
- }
- tempJson.cyFfcs = $("#cyFfcs").val();
- tempJson.cyMtjs = $("#cyMtjs").val();
- tempJson.orderNo = orderNo;
- tempJson.groupNo = currentZyClassType;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- //辅助检查、检验
- var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
- if (jcjyTabContents != null && jcjyTabContents.length > 0) {
- orderNo++;
- for (var i = 0; i < jcjyTabContents.length; i++) {
- if (emrFzjc == null) {
- emrFzjc = $(jcjyTabContents[i]).text();
- } else {
- emrFzjc += "," + $(jcjyTabContents[i]).text();
- }
- var tempJson = null;
- //项目类型
- var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
- //执行科室
- var execUnit = $(jcjyTabContents[i]).find("input.temporary_items_execUnit").val();
- tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":"","quantity":""}');
- tempJson.orderCode = $(jcjyTabContents[i]).find("input.temporary_items_code").val();
- tempJson.jyRemark = $(jcjyTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- if (itemsType == "1" || itemsType == 1) {
- //检验
- tempJson.inspectStuff = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
- tempJson.quantity = $(jcjyTabContents[i]).find("input.temporary_items_jyQuantity").val();
- // console.log('tempJson------------',tempJson)
- // //检验云处理数据
- // hasJyData = true
- // let tempJyItem = {
- // "labItemCode": tempJson.orderCode,
- // "labItemName": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
- // "labRecognCode": "",
- // "labRecognName": "",
- // "insuranceItemCode": $(jcjyTabContents[i]).find("input.temporary_jy_national_code").val(),
- // "insuranceItemName": $(jcjyTabContents[i]).find("input.temporary_jy_national_name").val()
- // }
- // jyItemArr.push(tempJyItem)
- } else if (itemsType == "2" || itemsType == 2) {
- //检查
- tempJson.inspectPart = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
- }
- jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
- jsonData.hasJcItem = true
- }
- }
- //诊疗
- var zlTabContents = $("#zlTabContent").find("div.form-group");
- if (zlTabContents != null && zlTabContents.length > 0) {
- orderNo++;
- for (var i = 0; i < zlTabContents.length; i++) {
- var tempJson = null;
- //执行科室
- var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
- //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
- tempJson = JSON.parse('{"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":""}');
- tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
- tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
- tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_totalNumZl").val();
- tempJson.drugQuan = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
- tempJson.zlUnitPrice = $(zlTabContents[i]).find("input.temporary_items_amount").val();
- //因为收费表里的单位长度限制,无法存入库
- //tempJson.drugUnit = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
- tempJson.frequency = $(zlTabContents[i]).find("input.temporary_items_orderFrequencyZl").val();
- tempJson.hospApprFlag = $(zlTabContents[i]).find("input.temporary_items_zlHospApprFlag").val();
- tempJson.orderDays = $(zlTabContents[i]).find("input.temporary_items_dayZlNum").val();
- tempJson.orderNo = orderNo;
- tempJson.execDept = execUnit;
- jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
- }
- }
- //外配药
- var wpMedicineTabContents = $("#wpMedicineTabContent").find("div.form-group");
- if (wpMedicineTabContents != null && wpMedicineTabContents.length > 0) {
- for (var i = 0; i < wpMedicineTabContents.length; i++) {
- var tempJson = JSON.parse('{"medListCodg": "","drugGenname": "","rxItemTypeCode": "","medcWayCodg": "","medcDays": "1","prdrName": "","sinDosunt": "","sinDoscnt": "1","usedFrquCodg": "","drugDosunt": "","drugCnt":"","drugSpec":"","hospApprFlag":"","drugDosform":""}');
- tempJson.medListCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_code").val();
- tempJson.drugGenname = $(wpMedicineTabContents[i]).find("input.temporary_items_wpMedicineName").val();
- tempJson.rxItemTypeCode = $(wpMedicineTabContents[i]).find("input.temporary_items_rxItemTypeCode").val();
- tempJson.medcWayCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_medcWayCodg").val();
- tempJson.medcDays = $(wpMedicineTabContents[i]).find("input.temporary_items_medcDays").val();
- tempJson.prdrName = $(wpMedicineTabContents[i]).find("input.temporary_items_prdrName").val();
- tempJson.sinDosunt = $(wpMedicineTabContents[i]).find("input.temporary_items_sinDosunt").val();
- tempJson.drugDosform = $(wpMedicineTabContents[i]).find("input.temporary_items_drugDosform").val();
- tempJson.sinDoscnt = $(wpMedicineTabContents[i]).find("input.temporary_items_sinDoscnt").val();
- tempJson.usedFrquCodg = $(wpMedicineTabContents[i]).find("input.temporary_items_usedFrquCodg").val();
- tempJson.drugCnt = $(wpMedicineTabContents[i]).find("input.temporary_items_drugCnt").val();
- tempJson.drugDosunt = $(wpMedicineTabContents[i]).find("input.temporary_items_drugDosunt").val();
- tempJson.drugSpec = $(wpMedicineTabContents[i]).find("input.temporary_items_drugSpec").val();
- tempJson.hospApprFlag = $(wpMedicineTabContents[i]).find("input.temporary_items_wpHospApprFlag").val();
- jsonData.rxDruginfoList[jsonData.rxDruginfoList.length] = tempJson;
- }
- }
- //入院
- var zyReqTabContents = $("#zyReqTabContent").find("div.form-group");
- if (zyReqTabContents != null && zyReqTabContents.length > 0) {
- jsonData.mzZyReq.reqDept = $(zyReqTabContents[0]).find("input.temporary_inpatient_ward").val();
- jsonData.mzZyReq.smallDept = $(zyReqTabContents[0]).find("input.temporary_items_small_ward").val();
- jsonData.mzZyReq.admissStatus = $(zyReqTabContents[0]).find("input.temporary_items_admiss_status").val();
- jsonData.mzZyReq.conditionCode = $(zyReqTabContents[0]).find("input.temporary_items_condition_code").val();
- jsonData.mzZyReq.routeOfAdmission = $(zyReqTabContents[0]).find("input.temporary_items_route_of_admission").val();
- jsonData.mzZyReq.contacterName = $(zyReqTabContents[0]).find("input.temporary_items_contacter_name").val();
- jsonData.mzZyReq.contacterRelationship = $(zyReqTabContents[0]).find("input.temporary_items_contacter_relationship").val();
- jsonData.mzZyReq.contacterPhone = $(zyReqTabContents[0]).find("input.temporary_items_contacter_phone").val();
- jsonData.mzZyReq.contacterAddress = $(zyReqTabContents[0]).find("input.temporary_items_contacter_address").val();
- jsonData.mzZyReq.deposit = $(zyReqTabContents[0]).find("input.temporary_items_deposit").val();
- }
- //门诊手术
- var opRecordTabContents = $("#opRecordTabContent").find("div.form-group");
- if (opRecordTabContents != null && opRecordTabContents.length > 0) {
- for (var i = 0; i < opRecordTabContents.length; i++) {
- var tempJson = null;
- var execUnit = $(opRecordTabContents[i]).find("input.temporary_items_execUnit").val();
- tempJson = JSON.parse('{"opCode": "","opName": "","opDatetimeStr": "","urgentClinicFlag": "","ssbc": "","partCode": "","opScale": "","hocusCode": "","doctorZd": "","remark":""}');
- tempJson.opCode = $(opRecordTabContents[i]).find("input.temporary_items_code").val();
- tempJson.opName = $(opRecordTabContents[i]).find("input.temporary_items_op_name").val();
- tempJson.opDatetimeStr = $(opRecordTabContents[i]).find("input.temporary_items_op_time").val();
- tempJson.urgentClinicFlag = $(opRecordTabContents[i]).find("input.temporary_items_urgent_clinic_flag").val();
- tempJson.ssbc = $(opRecordTabContents[i]).find("input.temporary_items_ssbc").val();
- tempJson.partCode = $(opRecordTabContents[i]).find("input.temporary_items_part_code").val();
- tempJson.opScale = $(opRecordTabContents[i]).find("input.temporary_items_op_scale").val();
- tempJson.hocusCode = $(opRecordTabContents[i]).find("input.temporary_items_hocus_code").val();
- tempJson.doctorZd = $(opRecordTabContents[i]).find("input.temporary_items_doctor_zd").val();
- tempJson.remark = $(opRecordTabContents[i]).find("input.temporary_items_op_record_remark").val();
- jsonData.opRecordList[jsonData.opRecordList.length] = tempJson;
- }
- }
- //设置诊断名称
- var icdText = null;
- var tagsTexts = $("span.el-select__tags-text");
- if (tagsTexts != null && tagsTexts.length > 0) {
- for (var i = 0; i < tagsTexts.length; i++) {
- if (icdText == null) {
- icdText = $(tagsTexts[i]).text();
- } else {
- icdText += "," + $(tagsTexts[i]).text();
- }
- }
- }
- jsonData.icdText = icdText;
- //设置中医诊断名称
- let tcmIcdText = null;
- let tcmTagsTexts = $("span.el-select__tcmtags-text");
- if (tcmTagsTexts != null && tcmTagsTexts.length > 0) {
- for (var i = 0; i < tcmTagsTexts.length; i++) {
- if (tcmIcdText == null) {
- tcmIcdText = $(tcmTagsTexts[i]).text();
- } else {
- tcmIcdText += "," + $(tcmTagsTexts[i]).text();
- }
- }
- }
- jsonData.tcmIcdText = tcmIcdText;
- jsonData.mzBlRecord.emrFzjc = emrFzjc;
- return jsonData;
- }
- function getParamsHlyy() {
- let loginUserCode = localStorage.getItem("userID")
- let loginUserName = localStorage.getItem("userName")
- let loginUserDept = localStorage.getItem("currentDeptNo")
- // let currentPatient = patientList.find(item=> item.patientId == currentPatientId)
- console.log("currentPatientId",currentPatientId)
- console.log("currentPatientInfo",currentPatientInfo)
- // //设置过敏源
- let patientAllergenInfoList = []
- let zdAllergen = $("#zdAllergen").find(":selected");
- const zdAllergenValue = [];
- const zdAllergenName = [];
- zdAllergen.each(function() {
- zdAllergenValue.push($(this).val()); // 选中的值
- zdAllergenName.push($(this).text()); // 显示的文本
- });
- console.log("zdAllergenValue",zdAllergenValue)
- console.log("zdAllergenName",zdAllergenName)
- let ypDitList = $("#ypDitList").find(":selected");
- const ypDitListValue = [];
- const ypDitListName = [];
- ypDitList.each(function() {
- ypDitListValue.push($(this).val()); // 选中的值
- ypDitListName.push($(this).text()); // 显示的文本
- });
- console.log("ypDitListValue",ypDitListValue)
- console.log("ypDitListName",ypDitListName)
- if (zdAllergen != null && zdAllergen.length > 0) {
- for (let i = 0; i < zdAllergen.length; i++) {
- let tempJson = JSON.parse('{}');
- tempJson.code = zdAllergenValue[i];
- tempJson.name = zdAllergenName[i];
- patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
- }
- }
- if (ypDitList != null && ypDitList.length > 0) {
- for (let i = 0; i < ypDitList.length; i++) {
- let tempJson = JSON.parse('{}');
- tempJson.code = ypDitListValue[i];
- tempJson.name = ypDitListName[i];
- patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
- }
- }
- var diagnoseChildren = $("#diagnoseTags").children();
- var patientDiag = [];
- for (var i = 0; i < diagnoseChildren.length; i++) {
- var child = diagnoseChildren[i]; // 直接获取 DOM 元素
- patientDiag.push({
- code: child.id,
- name: child.getAttribute("title") // 或 child.title
- });
- }
- //设置处方详情
- var orderList = [];
- var emrFzjc = null;
- var xyTabContents = $("#xyTabContent").find("div.tab-pane");
- //西药设置
- if (xyTabContents != null && xyTabContents.length > 0) {
- for (var i = 0; i < xyTabContents.length; i++) {
- //当前药品类型
- var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempJson = JSON.parse('{"id": "","code": "","route": "","name": "","dose": "","doseUnit": "","freq": "","amount": "","unit": "","repeat":"0",' +
- '"startDateTime":"","dayCount":"","group":""}');
- tempJson.id = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.code = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.route = $(formGroups[j]).find("input.temporary_items_supplyTypeText").val();
- tempJson.name = $(formGroups[j]).find("input.temporary_items_westernMedicineNamme").val();
- tempJson.dose = $(formGroups[j]).find("input.temporary_items_drugWin").val();
- tempJson.doseUnit = $(formGroups[j]).find("input.temporary_items_drugWinUnitText").val();
- tempJson.freq = $(formGroups[j]).find("input.temporary_items_orderFrequency").val();
- tempJson.amount = $(formGroups[j]).find("input.temporary_items_gross").val();
- tempJson.unit = $(formGroups[j]).find("input.temporary_items_packUnit").val();
- const timer = new Date();
- tempJson.startDateTime = timer.toLocaleString();
- tempJson.dayCount = $(formGroups[j]).find("input.temporary_items_dayNum").val();
- tempJson.group = $(formGroups[j]).find("input.temporary_items_groupId").val();
- orderList.push(tempJson)
- }
- }
- }
- }
- //外配药设置
- var wpMedicineTabContents = $("#wpMedicineTabContent").find("div.form-group");
- if (wpMedicineTabContents != null && wpMedicineTabContents.length > 0) {
- console.log("wpMedicineTabContent",wpMedicineTabContent)
- for (var i = 0; i < xyTabContents.length; i++) {
- //当前药品类型
- var currentGroupNo = $(xyTabContents[i]).find("input.current_groupNo").val();
- var formGroups = $(xyTabContents[i]).find("div.form-group");
- if (formGroups != null && formGroups.length > 0) {
- for (var j = 0; j < formGroups.length; j++) {
- var tempJson = JSON.parse('{"id": "","code": "","route": "","name": "","dose": "","doseUnit": "","freq": "","amount": "","unit": "","repeat":"0",' +
- '"startDateTime":"","dayCount":"","group":""}');
- tempJson.id = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.code = $(formGroups[j]).find("input.temporary_items_code").val();
- tempJson.route = $(formGroups[j]).find("input.temporary_items_medcWayCodg").val();
- tempJson.name = $(formGroups[j]).find("input.temporary_items_wpMedicineName").val();
- tempJson.dose = $(formGroups[j]).find("input.temporary_items_sinDoscnt").val();
- tempJson.doseUnit = $(formGroups[j]).find("input.temporary_items_sinDosunt").val();
- tempJson.freq = $(formGroups[j]).find("input.temporary_items_usedFrquCodg").val();
- tempJson.amount = $(formGroups[j]).find("input.temporary_items_drugCnt").val();
- tempJson.unit = $(formGroups[j]).find("input.temporary_items_drugDosunt").val();
- const timer = new Date();
- tempJson.startDateTime = timer.toLocaleString();
- tempJson.dayCount = $(formGroups[j]).find("input.temporary_items_medcDays").val();
- tempJson.group = $(formGroups[j]).find("input.temporary_items_groupId").val();
- orderList.push(tempJson)
- }
- }
- }
- }
- let params = {
- station : {
- type : "2"
- },
- doctor : {
- code : loginUserCode ,
- name : loginUserName ,
- deptCode : loginUserDept
- },
- patient : {
- id: currentPatientInfo.patientId ,
- code: currentPatientInfo.patientId ,
- visitId:"" ,
- name : currentPatientInfo.name,
- chargeType : currentPatientInfo.responseTypeName,
- sex : currentPatientInfo.gender,
- deptCode : loginUserDept,
- birthday : currentPatientInfo.birthDayStr,
- height :"",
- weight :"",
- medconds :{
- diag : patientDiag,
- allergens : patientAllergenInfoList
- }
- },
- orders : orderList,
- }
- return params
- console.log("params",params)
- }
- /**
- * 影像云平台判断检查项目
- */
- function handleYx03Data() {
- //辅助检查
- var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
- let hasYxData = false;
- let yxItemArr = [];
- if (jcjyTabContents != null && jcjyTabContents.length > 0) {
- for (var i = 0; i < jcjyTabContents.length; i++) {
- //项目类型
- var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
- //检查
- if (itemsType == "2" || itemsType == 2) {
- //影像云平台处理数据
- hasYxData = true
- let ckptName = $(jcjyTabContents[i]).find("input.temporary_items_desc_name").val()
- let ckpt = ckptName && ckptName !== '' ? ckptName : $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val();
- let tempYxObj=
- {
- // "chk_modality": "", //非必传 检查设备类型:ct、dr或mri
- "proj_name": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
- // "hos_medi_no": $(jcjyTabContents[i]).find("input.temporary_jy_national_code").val(), //非必传 检查项目医保编码
- "hos_proj_no": $(jcjyTabContents[i]).find("input.temporary_items_code").val(), //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
- "ckpt_name": ckpt, //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
- // "chk_methodname": "", //非必传 检查方法名称
- "chk_advice": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(), //检查申请名称
- }
- yxItemArr.push(tempYxObj)
- }
- }
- }
- if(hasYxData) {
- let currentJcItemList = yxItemArr.map(i=> i.proj_name)
- const newJcItem = jcItemList && jcItemList.length > 0 ? currentJcItemList.filter(item => !jcItemList.includes(item)) : currentJcItemList;
- if (newJcItem && newJcItem.length > 0) {
- YX03(yxItemArr)
- } else {
- savePrescription()
- }
- } else {
- savePrescription()
- }
- }
- function handleHlyyResult() {
- if (hasJcInYx) { //患者近期检查项目数量>0
- handleYx03Data()
- } else { //直接开单
- savePrescription()
- }
- // function getHlyyResult(res) {
- // $("#messageButton").attr("disabled", false);
- // if(res.beSave) {
- // if (hasJcInYx) { //患者近期检查项目数量>0
- // handleYx03Data()
- // } else { //直接开单
- // savePrescription()
- // }
- // } else {
- // errorMesageSimaple("合理用药未通过!");
- // }
- // }
- //
- // var hlyyParams = getParamsHlyy()
- // MLRKON_CLIENT.doCall("srv_screen", JSON.stringify(hlyyParams), { "api": false, "timeout": 10000}, getHlyyResult)
- }
- /**
- * 保存处方
- */
- function savePrescription() {
- var jsonData = getParamsForpPrescription(1);
- let wpMedicineFlag = jsonData.rxDruginfoList ==null || jsonData.rxDruginfoList.length ==0 ? false : true;
- savePrescriptionForReadCard(wpMedicineFlag);
- // var jsonData = getParamsForpPrescription(1);
- // console.log("savePrescription",jsonData)
- // let wpMedicineFlag = jsonData.rxDruginfoList ==null || jsonData.rxDruginfoList.length ==0 ? false : true;
- // $.ajax({
- // type: "POST",
- // url: '/thmz/rationalUseOfMedicine',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify(jsonData),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // $("#messageButton").attr("disabled", false);
- // if (res.code == 0) {
- // var rationalUseMap = res.data;
- // var result_lv = rationalUseMap.result_lv;
- // if (result_lv == 0 || result_lv == "0") {
- // savePrescriptionForReadCard(wpMedicineFlag);
- // } else {
- // var showUrl = rationalUseMap.ShowUrl;
- // getResultUrl = rationalUseMap.getResultUrl;
- // showHlyyModel('hlyyDiv', 'loading', 'hlyyModal', showUrl);
- // }
- // } else {
- // savePrescriptionForReadCard(wpMedicineFlag);
- // }
- // }
- // });
- }
- /**
- * 合理用药结果查询
- */
- function getResult() {
- $.ajax({
- type: "POST",
- url: '/thmz/auditingInterface',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"getResultUrl": getResultUrl}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#messageButton").attr("disabled", false);
- $("#hlyyModal").modal("hide");
- if (res.code == 0) {
- var rationalUseMap = res.data;
- if (rationalUseMap.length == 0) {
- savePrescriptionForReadCard(false);
- } else {
- var resultcode = rationalUseMap.resultcode;
- var success = rationalUseMap.success;
- var sh_msg = rationalUseMap.sh_msg;
- if (resultcode == -1) {
- //为处方不存在分析结果 直接忽略
- savePrescriptionForReadCard(false);
- } else if (resultcode == 0) {
- //2.success:药师审核完成标志,false未审核,true已审核/无需审核
- if (success == true || success == "true") {
- savePrescriptionForReadCard(false);
- } else {
- //提示消息
- $("#messageModal").modal();
- $("#messageContent").html("药师未审核,请点击右上方【继续保存】提交审核!");
- $("#messageButton").off("click").bind("click", function (t) {
- $("#messageModal").modal("hide");
- $("#hlyyModal").modal();
- });
- $("#cancelButton").off("click").bind("click", function (t) {
- $("#hlyyModal").modal();
- });
- ;
- }
- } else if (resultcode == 1) {
- //提示消息
- $("#messageModal").modal();
- $("#messageContent").html(sh_msg);
- $("#messageButton").off("click").bind("click", function (t) {
- $("#messageModal").modal("hide");
- });
- $("#cancelButton").off("click");
- }
- }
- } else {
- savePrescriptionForReadCard(false);
- }
- }
- });
- }
- /**
- * 合理用药结果弹窗
- * @param hlyyDiv
- * @param loading
- * @param hlyyModal
- * @param showUrl
- */
- function showHlyyModel(hlyyDiv, loading, hlyyModal, showUrl) {
- const iframeEle = document.getElementById(hlyyDiv);
- const loadingEle = document.getElementById(loading);
- //设置ififrame透明
- iframeEle.style.opacity = 0;
- loadingEle.style.display = 'block';
- $("#" + hlyyDiv).attr("src", showUrl);
- iframeEle.addEventListener('load', function () {
- // Hide the loading indicator
- loadingEle.style.display = 'none';
- // Bring the iframe back
- iframeEle.style.opacity = 1;
- });
- setTimeout(function () {
- // iframe 重复加载不会触发上述事件
- loadingEle.style.display = 'none';
- iframeEle.style.opacity = 1;
- }, 1000);
- $("#" + hlyyModal).modal();
- }
- /**
- * 点击保存处方时提示是否读卡 wpMedicineFlag true 是外配处方 false 否
- */
- function savePrescriptionForReadCard(wpMedicineFlag) {
- console.log("savePrescriptionForReadCard")
- if (!verifyInsuranceInfo()) {
- return;
- }
- //关闭帮助框
- $("#treeButton").webuiPopover('hide');
- $("#western_medicine_name").webuiPopover('hide');
- $("#chinese_medicine_name").webuiPopover('hide');
- $("#jcJyItem").webuiPopover('hide');
- $("#zlItem").webuiPopover('hide');
- getAjaxRequst("/thmz/zaiYuanByPatientId",{ patientId:$("#patientId").text()},true,function (response) {
- if(response.code == 0){
- if(response.data == "0"){
- if(wpMedicineFlag){
- let readCardResult = $("#readCardResult").val();
- if(stringIsBlank(readCardResult)){
- $("#messageModalYb").modal();
- $("#messageContent").html("门诊统筹处方必须读卡,是否立即读卡?");
- $("#ybdzpz").off("click").bind("click", function (t) {
- // mztczfSiReadCard(true, "qrcode_01101");
- mztczfSiReadCard(true, "jiangsu_qrcode_01101");
- realSavePrescription(wpMedicineFlag,false);
- });
- $("#ybsl").off("click").bind("click", function (t) {
- // mztczfSiReadCard(true, "face_01101");
- mztczfSiReadCard(true, "jiangsu_face_01101");
- realSavePrescription(wpMedicineFlag,false);
- });
- $("#cancelButtonYb").off("click").bind("click", function (t) {
- t.stopPropagation();
- t.preventDefault();
- realSavePrescription(wpMedicineFlag,false);
- });
- }else {
- realSavePrescription(wpMedicineFlag,false);
- }
- }else{
- realSavePrescription(wpMedicineFlag,false);
- }
- }else {
- realSavePrescription(wpMedicineFlag,false);
- }
- }else {
- errorMesage(response)
- }
- })
- }
- /**
- * 最终保存处方方法
- */
- function realSavePrescription(wpMedicineFlag,mallFlag) {
- $("#messageModalYb").modal('hide');
- $("#messageModal").modal();
- $("#messageContent").html("确认保存处方吗?");
- $("#messageButton").off("click").bind("click", function (t) {
- if (mztczfSiReadCardStatus && wpMedicineFlag) {
- $("#messageContent").html("门诊统筹正在读卡中,此次操作需与医保中心交互,耗时较长,请耐心等待...");
- return;
- }
- $("#messageButton").attr("disabled", true);
- var jsonData = getParamsForpPrescription(1);
- //商城处方
- if(mallFlag){
- jsonData.orderType = 5;
- jsonData.wxmallPackagePurchasedItemList = $('#mall_tc_detail_table').bootstrapTable('getAllSelections');
- }
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#messageButton").attr("disabled", false);
- if (res.code == 0) {
- successMesage(res);
- if (jsonData.hasJcItem) {
- YX04()
- }
- if(mallFlag){
- $("#mallTcDetailModal").modal("hide");
- }
- clearWorkSpace();
- loadInClinicTableList();
- loadClinicTableList();
- //$("#messageModal").modal();
- if(wpyHide === 0){
- $("#messageContent").html("门诊处方保存成功,是否打印门诊指引单?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- if(mallFlag){
- // printPrescription(res.data.patientId, res.data.times, res.data.id, 0, 1);
- printGuideCard(res.data.patientId, res.data.times, res.data.id, 0, 1);
- }else {
- // printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
- printGuideCard(res.data.patientId, res.data.times, res.data.id, 5, 1);
- }
- });
- $("#cancelButton").off("click");
- }else {
- successMesageSimaple('门诊处方保存成功')
- $("#messageModal").modal("hide");
- }
- } else {
- $("#messageModal").modal("hide");
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 保存医疗范文
- */
- function saveapidAccepts() {
- var templateName = $("#templateName").val();
- if (templateName == null || templateName == "") {
- errorMesageSimaple("范文名称不能为空!");
- return;
- }
- var templateKindType = $("#templateKindType").val();
- if (templateKindType == null || templateKindType == "") {
- errorMesageSimaple("范文类型不能为空!");
- return;
- }
- var templateType = $("#templateType").val();
- if (templateType == null || templateType == "") {
- errorMesageSimaple("范文范围不能为空!");
- return;
- }
- var templateStatus = $("#templateStatus").val();
- if (templateStatus == null || templateStatus == "") {
- errorMesageSimaple("范文状态不能为空!");
- return;
- }
- $("#saveapidAcceptsModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认保存医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- var jsonData = getParamsForpPrescription(2);
- var operationType = $("#operationType").val();
- var templateId = $("#templateId").val();
- if (operationType == 0 || operationType == '0') {
- templateId = null;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/saveTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": templateId,
- "name": templateName,
- "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
- "templateKindType": templateKindType,
- "templateType": templateType,
- "templateStatus": templateStatus,
- "templateData": JSON.stringify(jsonData),
- "emrChiefComplaint": $("#symptom").val(),
- "emrHpi": $("#emrHpi").val(),
- "emrPs": $("#emrPs").val(),
- "icdCode": $("#diagnoseValue").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- //范本保存完不清空
- //clearWorkSpace();
- } else {
- $("#saveapidAcceptsModal").modal();
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 停用医疗范文
- */
- function removeTemplate() {
- $("#messageModal").modal();
- $("#messageContent").html("确认停用医疗范文吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/removeTemplate',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#idTemplate").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#medicalModelModal").modal("hide");
- fitTemplateData();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 清空医疗范文模块内容
- */
- function clearApidAcceptsModal() {
- $("#templateId").val(null);
- $("#templateName").val(null);
- $("#templateKindType").selectpicker('val', 0);
- $("#templateKindType").selectpicker('refresh');
- $("#templateType").selectpicker('val', 0);
- $("#templateType").selectpicker('refresh');
- $("#templateStatus").selectpicker('val', 0);
- $("#templateStatus").selectpicker('refresh');
- $('#operationType').selectpicker('val', 0);
- $('#operationType').selectpicker('refresh');
- $("#operationTypeDiv").removeClass("in").addClass("hide");
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
- currentPatientId = patientId;
- console.log("currentPatientId1",currentPatientId)
- if (!confirm("请确认要修改处方吗?如只修改病历,请取消,点击【详情】再【修改病历】")) {
- return;
- }
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
- return;
- }
- //效验是否有修改处方权限
- postAjaxJsonHttpRequst("/thmz/queryPrescriptionModifyPermission",{"patientId":patientId,"times":times},false,function (re) {
- if (re == '401' || re == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(re.code != 0){
- errorMesageSimaple(re.message);
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription(1);
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- loadInClinicTableList();
- loadClinicTableList();
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId);
- });
- }
- })
- }
- /**
- * 查询病人未缴费处方信息 加载到处方修改 通用方法
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=5&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzReqType(patientId,times,null)
- setMzPatientInfo(res.mzPatientMi);
- setTimeout(()=>{
- editPrescription(res.data, 0)
- },1000)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- //查询患者的门诊统筹信息
- // queryInsuinfo(patientId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询病人已缴费处方信息 调用处方
- * @param patientId
- * @param times
- * @param clnicId 就诊记录id
- */
- function getMzPrescriptionVoPaid(patientId, times, clnicId) {
- $("#visitingDetailModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
- var mzfzReqTypeNoInClick = $("#mzfzReqTypeNoInClick").val();
- clearUser(false);
- clearWorkSpaceExcludeUser(3);
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 2)
- $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
- $("#mzfzReqTypeNoInClick").val(mzfzReqTypeNoInClick);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 重复接诊
- * @param patientId
- * @param times
- * @param clnicId
- * @param deptCode 就诊科室编码
- */
- function repeatAccepts(patientId, times, clnicId, deptCode) {
- $.ajax({
- type: "GET",
- url: '/thmz/validMzyReqrec?patientId=' + patientId + "&deptCode=" + deptCode,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == 0) {
- // $("#messageModal").modal();
- // $("#messageContent").html("挂号失效,确定继续就诊?");
- // $("#messageButton").off("click").on("click", function (t) {
- // $("#messageModal").modal("hide");
- // repeatAcceptsConfirm(patientId, times, clnicId);
- // });
- // $("#cancelButton").off("click");
- // warningMesageSimaple(res.message);
- // return;
- }
- repeatAcceptsConfirm(patientId, times, clnicId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 重复接诊提示方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsConfirm(patientId, times, clnicId) {
- var currentPatientId = $("#patientId").text();
- //当前接诊的用户和操作接诊的是同一个人,不做任何操作
- if (currentPatientId == patientId) {
- return;
- }
- if (currentPatientId == null || currentPatientId == "") {
- //当前没有人接诊,直接接诊
- repeatAcceptsCommon(patientId, times, clnicId);
- } else {
- //当前有人在接诊,提示是否需要切换和保存
- $("#messagePrescriptionModal").modal();
- $("#confirmPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- //先保存目前接诊信息,再切换就诊人
- var jsonData = getParamsForpPrescription(1);
- $.ajax({
- type: "POST",
- url: '/thmz/savePrescription',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- repeatAcceptsCommon(patientId, times, clnicId);
- //加载已接诊患者列表
- loadClinicTableList();
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelPrescriptionButton").off("click").on("click", function (t) {
- $("#messagePrescriptionModal").modal("hide");
- repeatAcceptsCommon(patientId, times, clnicId);
- });
- }
- }
- /**
- * 重复接诊通用方法
- * @param patientId
- * @param times
- * @param clnicId
- */
- function repeatAcceptsCommon(patientId, times, clnicId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "×=" + times + "&MzBlRecordFlag=true&payMark=null&clnicId=null",
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearWorkSpace();
- setMzReqType(patientId,times,null);
- setMzPatientInfo(res.mzPatientMi);
- editPrescription(res.data, 0)
- //修改患者的时候,将原纪录的就诊记录id带上,并借用分诊流水号字段传参
- $("#mzfzSerialNoInClick").val("clnicId_" + clnicId);
- //查询患者的门诊统筹信息
- // queryInsuinfo(patientId);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 就诊详情 已诊患者列表发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- */
- function prescriptionDetail(patientId, times, clnicId, payMark) {
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 0);
- }
- /**
- * 就诊详情 历史轨迹发起
- * @param patientId
- * @param times
- * @param clnicId
- * @param clinicStatus
- */
- function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
- closeObjectWebui(false);
- var payMark = null;
- if (clinicStatus == 5) {
- payMark = 5;
- } else {
- payMark = 0;
- }
- prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
- }
- function setmzPrescriptionPrintFlag(patientId, times) {
- postAjaxJsonHttpRequst("/thmz/mzPrescriptionPrint/getPrintFlag",{patientId:patientId,times:times},true,function (res) {
- if(res.data !=null){
- if(res.data == '1'){
- $("#printImage").attr("src", "/thmz/images/yiprint.png");
- }else {
- $("#printImage").attr("src", "/thmz/images/no_print.png");
- }
- }else {
- $("#printImage").attr("src", "/thmz/images/yiprint.png");
- }
- })
- }
- /**
- * 就诊详情通用方法
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param type 0 已诊患者列表发起 1 历史轨迹发起
- */
- function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
- $('#baseMzBlTimes').val(null);
- var oriPayMark = payMark;
- if (payMark == 1) {
- //退费时,查看的明细还是处方开立的情况
- payMark = 0;
- }
- //是否默认勾选处方回调
- var checkboxFlag = localStorage.getItem("checkboxFlag");
- if (checkboxFlag != null && (checkboxFlag == "0" || checkboxFlag == 0)) {
- $("#conciseRecordsJzxq").prop("checked", true);
- $("#prescriptionSubsidiaryJzxq").prop("checked", true);
- } else {
- $("#conciseRecordsJzxq").prop("checked", false);
- $("#prescriptionSubsidiaryJzxq").prop("checked", false);
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#visitingDetailModal").modal();
- var jsonData = res.data;
- var mzPatientMi = res.mzPatientMi;
- $("#visitingDetailPatientName").html('<a onclick="editUserModal(\'' + mzPatientMi.patientId + '\',3)" style=\'cursor: pointer;\'>' + mzPatientMi.name + '</a>');
- $("#visitingDetailPatientAge").text(mzPatientMi.ageString);
- $("#visitingDetailPatientGender").val(mzPatientMi.gender);
- $("#prescriptionDetail_zd").html("");
- $("#prescriptionDetail_xyzlContent").html("");
- $("#prescriptionDetail_zyzlContent").html("");
- $("#prescriptionDetail_zlyjContent").html("");
- if (res.opDate != null) {
- $("#visitingDetailDate").text(res.opDate);
- }
- if (res.deptName != null) {
- $("#visitingDetailDept").text(res.deptName);
- }
- if (res.doctorName != null) {
- $("#visitingDetailDoctor").text(res.doctorName);
- }
- var firstOrNot = jsonData.mzBlRecord.firstOrNot;
- if (firstOrNot == 0) {
- $("#visitFlag").html("初诊");
- $("#first").next().click();
- } else if (firstOrNot == 1) {
- $("#visitFlag").html("复诊");
- $("#not").next().click();
- }
- if (oriPayMark == 0) {
- $("#chargeImage").attr("src", "/thmz/images/charge.png");
- } else if (oriPayMark == 1) {
- $("#chargeImage").attr("src", "/thmz/images/refund.png");
- } else if (oriPayMark == 5) {
- $("#chargeImage").attr("src", "/thmz/images/nocharge.png");
- }
- setmzPrescriptionPrintFlag(patientId, times);
- $("#prescriptionDetail_zs").html(jsonData.mzBlRecord.emrChiefComplaint);
- $("#prescriptionDetail_xbs").html(jsonData.mzBlRecord.emrHpi);
- $("#prescriptionDetail_tgjc").html(jsonData.mzBlRecord.emrPe);
- $("#prescriptionDetail_jkjy").html(jsonData.mzBlRecord.emrJkjy);
- var icdText = jsonData.icdText;
- if (icdText != null) {
- var arr = icdText.split(",");
- var html = "";
- for (var i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#prescriptionDetail_zd").html(html);
- } else {
- $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
- }
- let tcmIcdText = jsonData.tcmIcdText
- if(tcmIcdText != null){
- let arr = tcmIcdText.split(",");
- let html = "";
- for (let i = 0; i < arr.length; i++) {
- if (i == 0) {
- html += ' <div class="tagZdy tagZdy-back">';
- } else {
- html += ' <div class="tagZdy tagZdy-back-green">';
- }
- html += arr[i];
- html += '</div>';
- }
- $("#prescriptionDetail_tcmzd").html(html);
- }
- var prescriptionDetail = jsonData.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null) {
- var checkBox = type == 1;
- prescriptionDetail = JSON.parse(prescriptionDetail);
- var xyPrescription = prescriptionDetail.xyPrescription;
- if (xyPrescription != null) {
- fitxyContent(xyPrescription.pyPrescription, "prescriptionDetail_xypyContent", "prescriptionDetail_xypyTitle", checkBox);
- fitxyContent(xyPrescription.mjPrescription, "prescriptionDetail_xymjContent", "prescriptionDetail_xymjTitle", checkBox);
- fitxyContent(xyPrescription.jePrescription, "prescriptionDetail_xyjeContent", "prescriptionDetail_xyjeTitle", checkBox);
- fitxyContent(xyPrescription.ycPrescription, "prescriptionDetail_yczlContent", "prescriptionDetail_yczlTitle", checkBox);
- } else {
- $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xypyContent").html("");
- $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xymjContent").html("");
- $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xyjeContent").html("");
- $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_yczlContent").html("");
- }
- var zyPrescription = prescriptionDetail.zyPrescription;
- if (zyPrescription != null) {
- fitzyContent(zyPrescription, "prescriptionDetail_zyzlContent", "prescriptionDetail_zyzlTitle", checkBox);
- } else {
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyzlContent").html("");
- }
- var jcjyPrescription = prescriptionDetail.jcjyPrescription;
- if (jcjyPrescription != null) {
- fitJcjyContent(jcjyPrescription, "prescriptionDetail_jcjyContent", "prescriptionDetail_jcjyTitle", checkBox);
- } else {
- ("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_jcjyContent").html("");
- }
- var zlPrescription = prescriptionDetail.zlPrescription;
- if (zlPrescription != null) {
- fitJcjyContent(zlPrescription, "prescriptionDetail_zlContent", "prescriptionDetail_zlTitle", checkBox);
- } else {
- $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zlContent").html("");
- }
- var zyReqPrescription = prescriptionDetail.zyReqPrescription;
- if (zyReqPrescription != null) {
- fitZyReqContent(zyReqPrescription, "prescriptionDetail_zyReqContent", "prescriptionDetail_zyReqTitle", true);
- } else {
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyReqContent").html("");
- }
- var opRecordPrescription = prescriptionDetail.opRecordPrescription;
- if (opRecordPrescription != null) {
- fitOpRecordContent(opRecordPrescription, "prescriptionDetail_opRecordContent", "prescriptionDetail_opRecordTitle", true);
- } else {
- $("#prescriptionDetail_opRecordTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_opRecordContent").html("");
- }
- let wpMedicinePrescription = prescriptionDetail.wpMedicinePrescription;
- if (wpMedicinePrescription != null) {
- fitWpMedicineContent(wpMedicinePrescription, "prescriptionDetail_wpMedicineContent", "prescriptionDetail_wpMedicineTitle", true);
- } else {
- $("#prescriptionDetail_wpMedicineTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_wpMedicineContent").html("");
- }
- } else {
- $("#prescriptionDetail_xypyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xypyContent").html("");
- $("#prescriptionDetail_xymjTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xymjContent").html("");
- $("#prescriptionDetail_xyjeTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_xyjeContent").html("");
- $("#prescriptionDetail_yczlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_yczlContent").html("");
- $("#prescriptionDetail_zyzlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyzlContent").html("");
- $("#prescriptionDetail_jcjyTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_jcjyContent").html("");
- $("#prescriptionDetail_zlTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zlContent").html("");
- $("#prescriptionDetail_zyReqTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_zyReqContent").html("");
- $("#prescriptionDetail_wpMedicineTitle").removeClass("in").addClass("hide");
- $("#prescriptionDetail_wpMedicineContent").html("");
- }
- $("#printJcReq").removeClass("in").addClass("hide");
- $("#printJcReq").off("click");
- $("#printJyReq").removeClass("in").addClass("hide");
- $("#printJyReq").off("click");
- $("#printJcReqSetup").removeClass("in").addClass("hide");
- $("#printJcReqSetup").off("click");
- $("#printJyReqSetup").removeClass("in").addClass("hide");
- $("#printJyReqSetup").off("click");
- $("#previewYjReq").removeClass("in").addClass("hide");
- $("#previewYjReq").off("click");
- $("#previewYjReqAll").removeClass("in").addClass("hide");
- $("#previewYjReqAll").off("click");
- $("#deletePrescription").removeClass("in").addClass("hide");
- $("#deletePrescription").off("click");
- $("#consultationCliniced").removeClass("in").addClass("hide");
- $("#consultationCliniced").off("click");
- if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
- $("#previewYjReq").removeClass("hide").addClass("in");
- $("#previewYjReq").off("click").on("click", function (t) {
- previewYjReq(patientId, times);
- });
- }
- if (res.yjReqCount != null && res.yjReqCount > 0) {
- $("#previewYjReqAll").removeClass("hide").addClass("in");
- $("#previewYjReqAll").off("click").on("click", function (t) {
- previewYjReqAll(patientId);
- });
- }
- if (type == 0) {
- $("#callPrescription").removeClass("in").addClass("hide");
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
- // $("#printPrescription").removeClass("in").addClass("hide");
- // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- $("#printGuideCard").removeClass("in").addClass("hide");
- $("#printGuideCardSetup").removeClass("in").addClass("hide");
- } else {
- // $("#printPrescription").removeClass("hide").addClass("in");
- // $("#printPrescription").off("click").on("click", function (t) {
- // printPrescription(patientId, times, clnicId, payMark, 1);
- // });
- $("#printGuideCard").removeClass("hide").addClass("in");
- $("#printGuideCard").off("click").on("click", function (t) {
- printGuideCard(patientId, times, clnicId, payMark, 1);
- });
- // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- // $("#printPrescriptionSetup").off("click").on("click", function (t) {
- // printPrescription(patientId, times, clnicId, payMark, 2);
- // });
- $("#printGuideCardSetup").removeClass("hide").addClass("in");
- $("#printGuideCardSetup").off("click").on("click", function (t) {
- printGuideCard(patientId, times, clnicId, payMark, 2);
- });
- }
- if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
- var hadJc = false;
- var hadJy = false;
- for (var i = 0; i < jsonData.mzYjReqList.length; i++) {
- var mzYjReq = jsonData.mzYjReqList[i];
- if (mzYjReq.reqType == 2) {
- hadJy = true;
- } else if (mzYjReq.reqType == 3) {
- hadJc = true;
- }
- }
- if (hadJc) {
- $("#printJcReq").removeClass("hide").addClass("in");
- $("#printJcReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 1);
- });
- $("#printJcReqSetup").removeClass("hide").addClass("in");
- $("#printJcReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 3, 2);
- });
- }
- if (hadJy) {
- $("#printJyReq").removeClass("hide").addClass("in");
- $("#printJyReq").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 1);
- });
- $("#printJyReqSetup").removeClass("hide").addClass("in");
- $("#printJyReqSetup").off("click").on("click", function (t) {
- printYjReq(patientId, times, 2, 2);
- });
- }
- }
- if (jsonData.mzZyReq == null || jsonData.mzZyReq.reqDept == null || jsonData.mzZyReq.reqDept == "") {
- $("#printZyReq").removeClass("in").addClass("hide");
- $("#printZyReq").off("click");
- $("#printZyReqSetup").removeClass("in").addClass("hide");
- $("#printZyReqSetup").off("click");
- } else {
- $("#printZyReq").removeClass("hide").addClass("in");
- $("#printZyReq").off("click").on("click", function (t) {
- printZyReq(patientId, 1);
- });
- $("#printZyReqSetup").removeClass("hide").addClass("in");
- $("#printZyReqSetup").off("click").on("click", function (t) {
- printZyReq(patientId, 2);
- });
- }
- //门诊手术
- if (jsonData.opRecordList != null && jsonData.opRecordList.length > 0) {
- $("#printOpRecord").removeClass("hide").addClass("in");
- $("#printOpRecord").off("click").on("click", function (t) {
- printOpRecord(patientId, times, 1);
- });
- $("#printOpRecordSetup").removeClass("hide").addClass("in");
- $("#printOpRecordSetup").off("click").on("click", function (t) {
- printOpRecord(patientId, times, 2);
- });
- } else {
- $("#printOpRecord").removeClass("in").addClass("hide");
- $("#printOpRecord").off("click");
- $("#printOpRecordSetup").removeClass("in").addClass("hide");
- $("#printOpRecordSetup").off("click");
- }
- //未缴费状态的时候可以删除处方
- if (oriPayMark == 5 || oriPayMark == "5") {
- $("#deletePrescription").removeClass("hide").addClass("in");
- $("#deletePrescription").off("click").on("click", function (t) {
- deletePrescription(clnicId);
- });
- }
- //已诊列表发起会诊
- $("#consultationCliniced").removeClass("hide").addClass("in");
- $("#consultationCliniced").off("click").on("click", function (t) {
- consultationCliniced(patientId);
- });
- //已诊列表发起预约挂号
- $("#registration").off("click").on("click", function (t) {
- registration(patientId);
- });
- } else {
- // $("#printPrescription").removeClass("in").addClass("hide");
- $("#printGuideCard").removeClass("in").addClass("hide");
- $("#printZyReq").removeClass("in").addClass("hide");
- $("#printBlRecord").removeClass("in").addClass("hide");
- $("#printJcReq").removeClass("in").addClass("hide");
- $("#printJyReq").removeClass("in").addClass("hide");
- $("#registration").removeClass("in").addClass("hide");
- $("#callPrescription").removeClass("hide").addClass("in");
- $("#callPrescription").off("click").on("click", function (t) {
- getMzPrescriptionVoPaid(patientId, times, clnicId);
- });
- }
- if (oriPayMark == 1) {
- // $("#printPrescription").removeClass("in").addClass("hide");
- // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- $("#printGuideCard").removeClass("in").addClass("hide");
- $("#printGuideCardSetup").removeClass("in").addClass("hide");
- } else {
- if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
- // $("#printPrescription").removeClass("in").addClass("hide");
- // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
- $("#printGuideCard").removeClass("in").addClass("hide");
- $("#printGuideCardSetup").removeClass("in").addClass("hide");
- } else {
- // $("#printPrescription").removeClass("hide").addClass("in");
- // $("#printPrescription").off("click").on("click", function (t) {
- // printPrescription(patientId, times, clnicId, payMark, 1);
- // });
- // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
- // $("#printPrescriptionSetup").off("click").on("click", function (t) {
- // printPrescription(patientId, times, clnicId, payMark, 2);
- // });
- $("#printGuideCard").removeClass("hide").addClass("in");
- $("#printGuideCard").off("click").on("click", function (t) {
- printGuideCard(patientId, times, clnicId, payMark, 1);
- });
- $("#printGuideCardSetup").removeClass("hide").addClass("in");
- $("#printGuideCardSetup").off("click").on("click", function (t) {
- printGuideCard(patientId, times, clnicId, payMark, 2);
- });
- }
- }
- $("#previewBlbg").off("click").on("click", function (t) {
- window.open("http://172.16.32.192:801/PIMSWebView.asp?mid=" + patientId);
- });
- $("#printBlRecord").removeClass("hide").addClass("in");
- $("#printBlRecord").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 1);
- });
- $("#printBlRecordSetup").removeClass("hide").addClass("in");
- $("#printBlRecordSetup").off("click").on("click", function (t) {
- printBlRecord(patientId, times, 2);
- });
- $("#showMzBlRecordModal").removeClass("hide").addClass("in");
- $("#showMzBlRecordModal").off("click").on("click", function (t) {
- showMzBlRecordModal(patientId, times, 1);
- });
- if ($("#setupId").hasClass("fa-chevron-up")) {
- //默认不展开打印设置
- $("#setupId").parent().click();
- }
- // setTimeout(function () {
- // if ($("#setupId").hasClass("fa-chevron-up")) {
- // //默认不展开打印设置
- // $("#setupId").parent().click();
- // }
- // }, 400);
- //就诊详情的时候,隐藏复选框
- if (type == 0) {
- $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
- $(obj).css("display", "none");
- });
- } else {
- //历史处方显示复选框
- $("#visitingDetailModal").find("input[type=checkbox]").each(function (index, obj) {
- $(obj).css("display", "inline-block");
- });
- }
- } else {
- errorMesage(res);
- }
- }
- });
- $("#selfAmountView").html(0.00);
- $("#fundPayView").html(0.00);
- $("#acctPayView").html(0.00);
- $("#totalAmountView").html(0.00);
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailFee?patientId=×=&receiptNo=&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: true,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.fundPay != undefined && res.fundPay != null) {
- $("#fundPayView").text("¥" + res.fundPay);
- }
- if (res.acctPay != undefined && res.acctPay != null) {
- $("#acctPayView").text("¥" + res.acctPay);
- }
- $("#selfAmountView").text("¥" + res.selfAmount);
- $("#totalAmountView").text("¥" + res.totalAmount);
- } else {
- printIndex = -1;
- }
- }
- });
- }
- /**
- * 查询默认打印机
- */
- function setPrint() {
- if (printIndex >= 0) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getLastWindowsByCurrentUser',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- printIndex = res.data.cgPrintIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
- //获取处方编码
- function getOrderNum(patientId,times,prescriptionDetail) {
- let num = '1'
- if(prescriptionDetail.length > 0){
- if(!stringIsBlank(prescriptionDetail[0].orderCode)){
- num = prescriptionDetail[0].orderCode.split("_")[3]
- }
- }
- return patientId + times + num;
- }
- //设置外配药打印页面
- function setWpMedicineTableHtml(wpMedicinePrescription) {
- let html = "";
- for (let i = 0; i <wpMedicinePrescription.length ; i++) {
- let detail = wpMedicinePrescription[i];
- html += "<tr><td>" + (i+1) + "</td>";
- html += "<td colspan='2'>";
- html += detail.name + "(" + detail.drugSpec + ")";
- html += "</td>";
- html += "<td colspan='2'></td>";
- html += "<td>X</td>";
- html += "<td rowspan='2' style='height: 100%;line-height: 100%;font-size: 40px;'>";
- html += "</td><td>" + detail.drugCnt + detail.drugDosunt + "</td>";
- html += "</tr>";
- html += "<tr><td></td>";
- html += "<td></td>";
- html += "<td style='font-weight: bold;text-align: right;'>用法:</td>";
- html += "<td>" + detail.sinDoscnt + detail.sinDosunt + "/次</td>";
- html += "<td>" + detail.usedFrquName + "</td>";
- html += "<td>" + detail.medcDays + "天</td>";
- html += "<td>" + detail.medcWayDscr + "</td>";
- html += "</tr>";
- }
- return html;
- }
- function setTableHtml(prescriptionDetail) {
- //设置成组处方符号
- if (prescriptionDetail.length > 1) {
- var map = new MyMap();
- var groupOrderlist = [];
- for (var j = 0; j < prescriptionDetail.length; j++) {
- var detail = prescriptionDetail[j];
- var list = map.get(detail.groupOrder);
- if (list == null) {
- list = [];
- map.put(detail.groupOrder, list);
- groupOrderlist[groupOrderlist.length] = detail.groupOrder;
- }
- list[list.length] = detail;
- }
- for (var j = 0; j < groupOrderlist.length; j++) {
- var list = map.get(groupOrderlist[j]);
- if (list.length == 1) {
- continue;
- }
- list[0].groupFlag = "┒";
- list[list.length - 1].groupFlag = "┛";
- if (list.length > 2) {
- for (var t = 1; t < list.length - 1; t++) {
- list[t].groupFlag = "┃";
- }
- }
- }
- }
- var html = "";
- for (var j = 0; j < prescriptionDetail.length; j++) {
- var detail = prescriptionDetail[j];
- html += "<tr><td>" + (j+1) + "</td>";
- html += "<td colspan='2'>";
- html += detail.name + "(" + detail.specification + ")";
- html += "</td>";
- html += "<td colspan='2'></td>";
- html += "<td>X</td>";
- html += "<td rowspan='2' style='height: 100%;line-height: 100%;font-size: 40px;'>";
- if (detail.groupFlag != undefined && detail.groupFlag != null) {
- html += detail.groupFlag;
- }
- html += "</td><td>" + detail.quantity + detail.packUnit + "</td>";
- html += "</tr>";
- html += "<tr><td></td>";
- if (detail.tryResult != undefined && detail.tryResult != null && detail.tryResult != "null" && detail.tryResult != "") {
- html += "<td>" + detail.tryResult + "</td>";
- } else if (detail.tryFlag != undefined && detail.tryFlag != null && detail.tryFlag != "null" && detail.tryFlag != "") {
- html += "<td>" + detail.tryFlag + "</td>";
- } else {
- html += "<td></td>";
- }
- html += "<td style='font-weight: bold;text-align: right;'>用法:</td>";
- html += "<td>" + detail.drugQuan + detail.unitDesc + "/次</td>";
- html += "<td>" + detail.frequency + "</td>";
- html += "<td>" + detail.orderDays + "天</td>";
- html += "<td>" + detail.supplyName + "</td>";
- html += "</tr>";
- }
- html += "<tr><td colspan='7'> ------(以下空白)------</td></tr>";
- return {html: html, j: j};
- }
- /**
- * 保存门诊处方打印记录
- * @param patientId
- * @param times
- */
- function saveMzPrescriptionPrint(patientId, times) {
- postAjaxJsonHttpRequst("/thmz/mzPrescriptionPrint/saveData",{patientId:patientId,times:times},true,function (res) {
- })
- }
- /**
- * 打印门诊处方
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printPrescription(patientId, times, clnicId, payMark, printType) {
- if(printType == 1){
- saveMzPrescriptionPrint(patientId,times)
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
- if (prescriptionDetail != null && prescriptionDetail != "") {
- var prescriptionDetailJson = JSON.parse(prescriptionDetail);
- //当前处方只开了住院证则只打印住院证
- if (prescriptionDetailJson.xyPrescription.jePrescription.length == 0 && prescriptionDetailJson.xyPrescription.mjPrescription.length == 0 && prescriptionDetailJson.xyPrescription.pyPrescription.length == 0 && prescriptionDetailJson.xyPrescription.ycPrescription.length == 0 && prescriptionDetailJson.zlPrescription.length == 0 && prescriptionDetailJson.jcjyPrescription.length == 0 && prescriptionDetailJson.zyPrescription.length == 0 && prescriptionDetailJson.zyReqPrescription != null && prescriptionDetailJson.zyReqPrescription.length > 0) {
- printZyReq(patientId, 1);
- return;
- }
- var index = 0;
- setPrint();
- LODOP = getLodop();
- LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"处方笺");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- //LODOP.SET_SHOW_MODE("SETUP_ENABLESS",getCheckSS());
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var deptName = res.deptName;
- $("#patientNamePrescription").text(mzPatientMi.name);
- $("#patientGenderPrescription").text(mzPatientMi.gender);
- $("#patientAgePrescription").text(mzPatientMi.ageString);
- $("#patientIdPrescription").text(mzPatientMi.patientId);
- $("#deptPrescription").text(deptName);
- // $("#doctorPrescription").text(res.doctorName);
- getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:res.doctorCode},false,function (postRes) {
- if(postRes.code ==0){
- $("#doctorPrescription").html("<img src='" + postRes.data + "' style='width:100px;height:23px;'/>")
- }else {
- $("#doctorPrescription").text(res.doctorName);
- }
- })
- $("#cfTime").text(res.opDate);
- $("#socialNo").text(mzPatientMi.socialNo);
- $("#sfTypeId").text(mzPatientMi.responseTypeName);
- $("#zdPrescription").text(res.data.icdText);
- $("#patientIdGuideCard").text(mzPatientMi.patientId);
- $("#doctorGuideCard").text(res.data.mzBlRecord.doctorName);
- $("#patientNameGuideCard").text(mzPatientMi.name);
- $("#patientDateGuideCard").text(format(new Date(), "yyyy/MM/dd/HH:mm"));
- JsBarcode("#cfBarcode", patientId, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- //普药处方
- var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
- if (pyPrescription != null && pyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.py_print =="1") {
- for (var i = 0; i < pyPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = pyPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("普通处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(pyPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- let wpMedicinePrescription = prescriptionDetailJson.wpMedicinePrescription;
- if(wpMedicinePrescription !=null && wpMedicinePrescription.length > 0){
- if (index > 0) {
- LODOP.NewPageA();
- }
- let _html = setWpMedicineTableHtml(wpMedicinePrescription);
- $("#typePrescription").text("院外调配处方");
- $("#cfTitle").text("院外调配");
- $("#prescriptionDetail").html(_html);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- }
- //医材处方
- var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
- if (ycPrescription != null && ycPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.yc_print =="1") {
- for (var i = 0; i < ycPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = ycPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("医材处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //麻精处方
- var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
- if (mjPrescription != null && mjPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
- for (var i = 0; i < mjPrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = mjPrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("麻、精一处方");
- $("#cfTitle").text("麻、精一");
- $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- //精二处方
- var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
- if (jePrescription != null && jePrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
- for (var i = 0; i < jePrescription.length; i++) {
- if (index > 0) {
- LODOP.NewPageA();
- }
- var prescriptionDetail = jePrescription[i].detail;
- var __ret = setTableHtml(prescriptionDetail);
- var html = __ret.html;
- var j = __ret.j;
- $("#typePrescription").text("精二处方");
- $("#cfTitle").text("精二");
- $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- $("#cfOrderNumTitle").text(null)
- //中药处方
- if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.zy_print =="1") {
- var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;zyPrescription
- var zyGroupNo = prescriptionDetailJson.zyPrescription[0].groupNo;
- if (zyPrescription != null && zyPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zyPrescription.length; i++) {
- if (i % 2 == 0) {
- html += "<tr><td></td><td></td></tr><tr>";
- }
- html += "<td>";
- html += zyPrescription[i].name;
- if(zyPrescription[i].spec){
- html += "("+zyPrescription[i].spec+")";
- }
- if(zyGroupNo=='83'){
- html += zyPrescription[i].quantity + "袋";
- }else {
- html += zyPrescription[i].quantity + "g";
- }
- if (zyPrescription[i].instructionText != null) {
- html += "[" + zyPrescription[i].instructionText + "]";
- }
- if (i % 2 == 1) {
- html += "</td></tr>";
- } else {
- html += "</td>";
- }
- }
- if (zyPrescription.length % 2 != 0) {
- html += "</tr>";
- }
- html += "<tr><td></td><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td></tr>";
- var cyMtjs = prescriptionDetailJson.zyPrescription[0].cyMtjs;
- if (cyMtjs == null || cyMtjs == "null") {
- cyMtjs = "";
- }
- var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
- if (cyJssm == null || cyJssm == "null") {
- cyJssm = "";
- }
- var cyJsl = prescriptionDetailJson.zyPrescription[0].cyJsl;
- if (cyJsl == null || cyJsl == "null") {
- cyJsl = "";
- }
- var cyZql = prescriptionDetailJson.zyPrescription[0].cyZql;
- if (cyZql == null || cyZql == "null") {
- cyZql = "";
- }
- var cyFj = prescriptionDetailJson.zyPrescription[0].cyFj;
- if (cyFj == null || cyFj == "null") {
- cyFj = "";
- }
- var cyFfcs = prescriptionDetailJson.zyPrescription[0].cyFfcs;
- if (cyFfcs == null || cyFfcs == "null") {
- cyFfcs = "";
- }
- var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
- if (cyFysm == null || cyFysm == "null") {
- cyFysm = "";
- }
- var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
- if (cyDj == null || cyDj == "null") {
- cyDj = "";
- } else {
- cyDj = "(" + cyDj + ")";
- }
- if(zyGroupNo =='83'){
- html += "<tr><td colspan='2'>每天" + cyMtjs + "剂," + cyJssm + cyJsl + "ml。分" + cyFfcs + "次" + cyFysm + "。</td></tr>";
- }else {
- html += "<tr><td colspan='2'>每天" + cyMtjs + "剂," + cyJssm + cyJsl + "ml,煮取量" + cyZql + "ml,复煎" + cyFj + "次。分" + cyFfcs + "次" + cyFysm + " " + cyDj + "。</td></tr>";
- }
- html += "<tr><td colspan='2'> ------(以下空白)------</td></tr>";
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("中药处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 (不含代煎费)");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- var printZlPrescription = $("#zlPrintFlagCheck").parent().hasClass("checked") == true ? true : false;
- if (printZlPrescription) {
- if (prescriptionDetailJson.zlPrescription != null && prescriptionDetailJson.zlPrescription.length > 0) {
- //诊疗处方
- var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
- if (zlPrescription != null && zlPrescription.length > 0) {
- var html = "";
- for (var i = 0; i < zlPrescription.length; i++) {
- var zlPrescriptionTemp = zlPrescription[i];
- html += "<tr>";
- html += "<td colspan='2'>" + zlPrescriptionTemp.index + "." + zlPrescriptionTemp.name + "</td>";
- html += "<td style='text-align: right;padding-right: 15px;'>X</td>";
- html += "<td>总量:" + zlPrescriptionTemp.quantity + "</td>";
- html += "</tr>";
- html += "<tr>";
- html += "<td width='40%'></td>";
- html += "<td width='20%'>单量:" + zlPrescriptionTemp.drugQuan + "</td>";
- html += "<td width='20%'>频率:" + zlPrescriptionTemp.frequency + "</td>";
- html += "<td width='20%'>天数:" + zlPrescriptionTemp.orderDays + "天</td>";
- html += "</tr>";
- }
- if (index > 0) {
- LODOP.NewPageA();
- }
- if (res.deptName != undefined && res.deptName != null) {
- if (res.deptName.indexOf("儿") > 0) {
- $("#typePrescription").text("儿科");
- $("#cfTitle").text("儿科");
- } else if (res.deptName.indexOf("急诊科") > 0) {
- $("#typePrescription").text("急诊");
- $("#cfTitle").text("急诊");
- } else {
- $("#typePrescription").text("诊疗处方");
- $("#cfTitle").text("普通");
- }
- }
- $("#prescriptionDetail").html(html);
- $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
- index++;
- }
- }
- }
- //检查申请单打印
- var mzYjReqList = res.data.mzYjReqList;
- if (mzYjReqList != null && mzYjReqList.length > 0) {
- $("#patientIdJcReq").text(mzPatientMi.patientId);
- $("#patientNameJcReq").text(mzPatientMi.name);
- $("#patientGenderJcReq").text(mzPatientMi.gender);
- $("#patientAgeJcReq").text(mzPatientMi.ageString);
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.icdText);
- var mzBlRecord = res.data.mzBlRecord;
- $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jcReqHis").text(mzBlRecord.emrHpi);
- var tz = getTz(mzBlRecord);
- $("#jcReqTz").text(tz);
- $("#jcReqReqDept").text(res.deptName);
- $("#jcReqReqDoctor").text(res.doctorName);
- // $("#patientIdJyReq").text(mzPatientMi.patientId);
- // $("#patientNameJyReq").text(mzPatientMi.name);
- // $("#patientGenderJyReq").text(mzPatientMi.gender);
- // $("#patientAgeJyReq").text(mzPatientMi.ageString);
- // $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
- // $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
- // $("#icdTextJyReq").text(res.data.icdText);
- // $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- // $("#jyReqHis").text(mzBlRecord.emrHpi);
- // $("#jyReqTz").text(tz);
- // $("#jyReqReqDept").text(res.deptName);
- // $("#jyReqReqDoctor").text(res.doctorName);
- for (var i = 0; i < mzYjReqList.length; i++) {
- var mzYjReq = mzYjReqList[i];
- if (mzYjReq == null) {
- continue;
- }
- if (i == 0) {
- var dateStr = format(mzYjReq.reqDate, "yyyy-MM-dd");
- $("#jcReqReqDate").text(dateStr);
- // $("#jyReqReqDoctor").text(dateStr);
- }
- if (mzYjReq.reqType == 2) {
- continue;
- }
- if ((i == 0 && index > 0) || i > 0) {
- LODOP.NewPageA();
- }
- JsBarcode("#JcBarcode", mzYjReq.reqNo, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- $("#reqNoJcReq").text(mzYjReq.reqNo);
- $("#jcReqItem").text(mzYjReq.groupName);
- $("#jcReqRemark").text(mzYjReq.jyRemark);
- $("#jcComment8").text(mzYjReq.comment8);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
- index++;
- }
- }
- //住院证打印
- var mzZyReq = res.data.mzZyReq;
- if (mzZyReq != null) {
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.ageString);
- $("#sfzZyReq").text(mzPatientMi.socialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- $("#icsTextZyReq").text(mzZyReq.icdText);
- } else {
- $("#icsCodeZyReq").text(mzZyReq.icdCode);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- }
- $("#reqDeptZyReq").text(mzZyReq.reqWardName);
- $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
- $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
- $("#depositZyReq").text(mzZyReq.deposit);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
- $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
- $(this).removeAttr("checked");
- if ($(this).val() == Number(mzZyReq.admissStatus) || $(this).val() == mzZyReq.admissStatus) {
- $(this).attr("checked", true)
- }
- });
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptName);
- getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
- if(signRes.code == 0){
- $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
- }else {
- $("#doctorCodeZyReq").text(mzZyReq.doctorName);
- }
- })
- if (index > 0) {
- LODOP.NewPageA();
- }
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- index++;
- }
- //手术申请单打印
- var opRecordList = res.data.opRecordList;
- if (opRecordList != null && opRecordList.length > 0) {
- $("#patientIdOpRecord").text(mzPatientMi.patientId);
- $("#patientNameOpRecord").text(mzPatientMi.name);
- $("#patientGenderOpRecord").text(mzPatientMi.gender);
- $("#patientAgeOpRecord").text(mzPatientMi.ageString);
- $("#responseTypeOpRecord").text(mzPatientMi.responseTypeName);
- $("#patientCardNoOpRecord").text(mzPatientMi.icCardNo);
- for (var i = 0; i < opRecordList.length; i++) {
- var obj = opRecordList[i];
- //$("#reqNoOpRecord").text(obj.recordId);
- $("#icdTextOpRecord").text(obj.diagBeforeOp);
- $("#opNameOpRecord").text(obj.opName);
- $("#hocusCodeOpRecord").text(obj.hocusCodeName);
- $("#opScaleOpRecord").text(obj.opScaleName);
- var dateStr = format(obj.applyDate, "yyyy-MM-dd HH:mm:ss");
- $("#applyDateOpRecord").text(dateStr);
- $("#opDatetimeOpRecord").text(obj.opDatetimeStr);
- $("#doctorZdOpRecord").text(obj.doctorZdName);
- $("#remarkOpRecord").text(obj.remark);
- if (index > 0) {
- LODOP.NewPageA();
- }
- JsBarcode("#JcBarcode", obj.recordId, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("op_record_card_table").innerHTML);
- index++;
- }
- }
- // $("#selfAmountGuideCard").html(0.00);
- // $("#fundPayGuideCard").html(0.00);
- // $("#acctPayGuideCard").html(0.00);
- $("#payQrcodeGuideCard").empty();
- $("#selfPayDetail").empty();
- infoMessage("获取支付信息耗时较长,请耐心等待")
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var selfPayList = res.selfPayList;
- $("#zfcns_time").text("时间:" + res.zfcns_time);
- if (selfPayList != null && selfPayList.length > 0) {
- $("#patientNameSelfPay").text(mzPatientMi.name);
- $("#patientGenderSelfPay").text(mzPatientMi.gender);
- $("#patientAgeSelfPay").text(mzPatientMi.ageString);
- $("#patientIdSelfPay").text(mzPatientMi.patientId);
- $("#deptSelfPay").text(deptName);
- $("#zdSelfPay").text(res.icdText);
- var selfPayListHtml = "";
- for (var i = 1; i <= selfPayList.length; i++) {
- selfPayListHtml += "<tr><td>";
- selfPayListHtml += i + "." + selfPayList[i - 1];
- selfPayListHtml += "</td></tr>";
- }
- $("#selfPayDetail").html(selfPayListHtml);
- if (index > 0) {
- LODOP.NewPageA();
- }
- //view-source:http://www.c-lodop.com/demolist/PrintSample43.html 分页看这里
- LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
- index++;
- }
- let html = `<tr style="font-weight: 700"><td>项目</td><td>地点</td></tr>`;
- if (res.guideCardData != null && res.guideCardData.length > 0) {
- if(res.guideCardData.length > 0){
- for (var i = 0; i < res.guideCardData.length; i++) {
- html += "<tr><td>" + res.guideCardData[i].name + "</td><td>" + res.guideCardData[i].address + "</td></tr>"
- }
- }
- }
- $("#guideCardDetail").html(html);
- let totalAmount = res.totalAmount;
- let jsonData = {
- "subject": '门诊收费',
- "body": '门诊收费_' + patientId,
- "patientId": patientId,
- "times" : times,
- "amount" : totalAmount
- }
- $.ajax({
- type: "POST",
- url: '/thmz/NongPay/unifiedOrderByCodeImgUrl',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.data != null && res.data != "" && res.data.payData != null && res.data.payData != "") {
- // new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
- // $("canvas").attr("id", "erw");
- // let canvas = document.getElementById('erw');
- // let src = canvas.toDataURL("image/png");
- let payQrcodeGuideCardHtml = `<img src="${res.data.payData}" style="width: 100px;height: 100px;margin: 20px 0"/><div style="width: 140px;margin-top: 2px;">微信扫码支付</div>`;
- $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
- }
- $("#totalAmountGuideCard").text("¥" + totalAmount +"元");
- JsBarcode('#imgcode', patientId, {
- lineColor: '#000000', //线条颜色
- width: 2, //线宽
- height: 60, //条码高度
- displayValue: false, //是否显示文字信息
- });
- if (index > 0) {
- LODOP.NewPageA();
- }
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
- //LODOP.PREVIEW();
- if (printType == 1) {
- LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- })
- // if (res.payQrcode != null && res.payQrcode != "") {
- // new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode); // 设置要生成二维码的链接
- // $("canvas").attr("id", "erw");
- // let canvas = document.getElementById('erw');
- // let src = canvas.toDataURL("image/png");
- // let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(自费)</div>`;
- // $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
- // }
- // if(!stringIsBlank(res.healthEducationUrl)){
- // new QRCode(document.getElementById("healthEducationCard"), res.healthEducationUrl); // 设置要生成二维码的链接
- // $("canvas").attr("id", "erw");
- // let canvas = document.getElementById('erw');
- // let src = canvas.toDataURL("image/png");
- // let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 120px;margin-top: 2px;">健康宣教</div>`;
- // $("#healthEducationCard").html(wxPayQrCardHtml);
- // }
- // if(!stringIsBlank(res.wxPayQrUrl)){
- // new QRCode(document.getElementById("wxPayQrCard"), res.wxPayQrUrl); // 设置要生成二维码的链接
- // $("canvas").attr("id", "erw");
- // let canvas = document.getElementById('erw');
- // let src = canvas.toDataURL("image/png");
- // let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(医保统筹)</div>`;
- // $("#wxPayQrCard").html(wxPayQrCardHtml);
- // }
- } else if (res.code == -2) {
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- function printGuideCard(patientId, times, clnicId, payMark, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '×=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0){
- var mzPatientMi = res.mzPatientMi;
- $("#patientIdGuideCard").text(mzPatientMi.patientId);
- $("#doctorGuideCard").text(res.data.mzBlRecord.doctorName);
- $("#patientNameGuideCard").text(mzPatientMi.name);
- $("#patientSexGuideCard").text(mzPatientMi.gender);
- $("#patientAgeGuideCard").text(mzPatientMi.ageString);
- $("#patientDateGuideCard").text(format(new Date(), "yyyy/MM/dd/HH:mm"));
- console.log("mzPatientMi",mzPatientMi);
- console.log("res",res);
- $("#payQrcodeGuideCard").empty();
- $("#selfPayDetail").empty();
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- setPrint();
- LODOP = getLodop();
- LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"门诊导引单");
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var selfPayList = res.selfPayList;
- $("#zfcns_time").text("时间:" + res.zfcns_time);
- if (selfPayList != null && selfPayList.length > 0) {
- $("#patientNameSelfPay").text(mzPatientMi.name);
- $("#patientGenderSelfPay").text(mzPatientMi.gender);
- $("#patientAgeSelfPay").text(mzPatientMi.ageString);
- $("#patientIdSelfPay").text(mzPatientMi.patientId);
- $("#deptSelfPay").text(deptName);
- $("#zdSelfPay").text(res.icdText);
- var selfPayListHtml = "";
- for (var i = 1; i <= selfPayList.length; i++) {
- selfPayListHtml += "<tr><td>";
- selfPayListHtml += i + "." + selfPayList[i - 1];
- selfPayListHtml += "</td></tr>";
- }
- $("#selfPayDetail").html(selfPayListHtml);
- if (index > 0) {
- LODOP.NewPageA();
- }
- //view-source:http://www.c-lodop.com/demolist/PrintSample43.html 分页看这里
- LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
- // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
- index++;
- }
- let html = `<tr style="font-weight: 700"><td>项目</td><td>地点</td></tr>`;
- if (res.guideCardData != null && res.guideCardData.length > 0) {
- if(res.guideCardData.length > 0){
- for (var i = 0; i < res.guideCardData.length; i++) {
- html += "<tr><td>" + res.guideCardData[i].name + "</td><td>" + res.guideCardData[i].address + "</td></tr>"
- }
- }
- }
- $("#guideCardDetail").html(html);
- let totalAmount = res.totalAmount;
- let jsonData = {
- // "subject": "1234",
- // "body": '门诊收费_' + patientId,
- "patientId": patientId,
- "times" : times,
- "amount" : totalAmount
- }
- // infoMessage("获取支付信息耗时较长,请耐心等待")
- // $.ajax({
- // type: "POST",
- // url: '/thmz/NongPay/unifiedOrderByCodeImgUrl',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify(jsonData),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- //
- // }
- // })
- // + JSON.stringify(jsonData)
- // 1. 生成二维码(使用临时容器,避免直接操作目标元素)
- const tempContainer = document.createElement('div');
- let qrCodeUrl = `https://hadln.net:20443/#/cashier?queryJson=${JSON.stringify(jsonData)}`
- // console.log("jsonData",JSON.stringify(jsonData))
- // console.log("qrCodeUrl",qrCodeUrl)
- // document.getElementById("payQrcodeGuideCard")
- new QRCode(tempContainer,{
- text: qrCodeUrl,
- width: 120,
- height: 120,
- version: 40,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.L // 最低容错,最大化容量
- }); // 设置要生成二维码的链接
- // 2. 获取生成的 canvas(直接从临时容器中获取,避免全局选择器冲突)
- const canvas = tempContainer.querySelector('canvas');
- if (!canvas) {
- console.error('未生成二维码canvas');
- return;
- }
- // 3. 立即导出 dataURL(在DOM操作前完成,避免污染)
- let src;
- try {
- src = canvas.toDataURL("image/png");
- } catch (e) {
- console.error('导出二维码失败:', e);
- return;
- }
- // $("canvas").attr("id", "erw");
- // let canvas = document.getElementById('erw');
- // let src = canvas.toDataURL("image/png");
- let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px;margin: 20px 0"/><div style="width: 140px;margin-top: 2px;">微信扫码支付</div>`;
- $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
- $("#totalAmountGuideCard").text("¥" + totalAmount +"元");
- JsBarcode('#imgcode', patientId, {
- lineColor: '#000000', //线条颜色
- width: 2, //线宽
- height: 60, //条码高度
- displayValue: false, //是否显示文字信息
- });
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
- //LODOP.PRINT();
- if (printType == 1) {
- LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else if (res.code == -2) {
- warningMesageSimaple(res.message)
- } else {
- errorMesage(res);
- }
- }
- });
- } else {
- errorMesage(res);
- }
- }})
- }
- /**
- * 构建体征描述
- * @param mzBlRecord
- * @returns {*}
- */
- function getTz(mzBlRecord) {
- var tz = null;
- if (mzBlRecord.weight != null && mzBlRecord.weight != 0) {
- var temp = "体重:" + mzBlRecord.weight + "kg ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.temperature != null && mzBlRecord.temperature != 0) {
- var temp = "体温:" + mzBlRecord.temperature + "℃ ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.sphygmus != null && mzBlRecord.sphygmus != 0) {
- var temp = "脉搏:" + mzBlRecord.sphygmus + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.breathe != null && mzBlRecord.breathe != 0) {
- var temp = "呼吸:" + mzBlRecord.breathe + "次/分 ";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHigh != null && mzBlRecord.pressureFloor != null && mzBlRecord.pressureHigh != 0 && mzBlRecord.pressureFloor != 0) {
- var temp = "血压:" + mzBlRecord.pressureHigh + "/" + mzBlRecord.pressureFloor + " mmhg";
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.pressureHighLeft != null && mzBlRecord.pressureFloorLeft != null && mzBlRecord.pressureHighLeft != 0 && mzBlRecord.pressureFloorLeft != 0) {
- var temp = "左血压:" + mzBlRecord.pressureHighLeft + "/" + mzBlRecord.pressureFloorLeft;
- if (tz == null) {
- tz = temp;
- } else {
- tz += " " + temp;
- }
- }
- if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- if (tz == null) {
- tz = mzBlRecord.emrPe;
- } else {
- tz += "," + mzBlRecord.emrPe;
- }
- }
- return tz;
- }
- /**
- * 打印医技申请单
- * @param patientId
- * @param times
- * @param type 申请单类型:2:检验;3:检查
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printYjReq(patientId, times, type, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printYjReq?patientId=' + patientId + '×=' + times + "&reqType=" + type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.mzYjReqList == null || res.data.mzYjReqList.length == 0) {
- errorMesageSimaple("没有医技申请单可以打印");
- return;
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"检查申请单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "检查申请单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.data.mzPatientMi;
- $("#patientIdJcReq").text(mzPatientMi.patientId);
- $("#patientNameJcReq").text(mzPatientMi.name);
- $("#patientGenderJcReq").text(mzPatientMi.gender);
- $("#patientAgeJcReq").text(mzPatientMi.ageString);
- $("#responseTypeJcReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJcReq").text(mzPatientMi.icCardNo);
- $("#icdTextJcReq").text(res.data.icdText);
- $("#patientIdJyReq").text(mzPatientMi.patientId);
- $("#patientNameJyReq").text(mzPatientMi.name);
- $("#patientGenderJyReq").text(mzPatientMi.gender);
- $("#patientAgeJyReq").text(mzPatientMi.ageString);
- $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
- $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
- $("#icdTextJyReq").text(res.data.icdText);
- var mzBlRecord = res.data.mzBlRecord;
- $("#jcReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jcReqHis").text(mzBlRecord.emrHpi);
- $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
- $("#jyReqHis").text(mzBlRecord.emrHpi);
- var tz = getTz(mzBlRecord);
- $("#jcReqTz").text(tz);
- $("#jcReqReqDept").text(res.data.deptName);
- $("#jcReqReqDoctor").text(res.data.doctorName);
- $("#jyReqTz").text(tz);
- $("#jyReqReqDept").text(res.data.deptName);
- $("#jyReqReqDoctor").text(res.data.doctorName);
- //检验报告列表名
- var jyTitle = '<tr><th style="min-height: 30px;border-bottom: 1px solid black;">执行科室</th><th style="min-height: 30px;border-bottom: 1px solid black;">检验项目</th><th style="min-height: 30px;border-bottom: 1px solid black;">标本</th><th style="min-height: 30px;border-bottom: 1px solid black;">单号</th></tr>';
- var jyContent = "";
- var needNewPageA = false;
- for (var i = 0; i < res.data.mzYjReqList.length; i++) {
- var obj = res.data.mzYjReqList[i];
- if (i == 0) {
- var dateStr = format(obj.reqDate, "yyyy-MM-dd");
- $("#jcReqReqDate").text(dateStr);
- $("#jyReqReqDate").text(dateStr);
- }
- if (obj.reqType == "3") {
- if (i > 0) {
- LODOP.NewPageA();
- }
- JsBarcode("#JcBarcode", obj.reqNo, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- $("#reqNoJcReq").text(obj.reqNo);
- $("#jcReqItem").text(obj.groupName);
- $("#jcReqRemark").text(obj.jyRemark);
- $("#jcComment8").text(obj.comment8);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_card_table").innerHTML);
- needNewPageA = true;
- } else if (obj.reqType == "2") {
- let inspectName = (obj.inspectName == null || obj.inspectName == "null") ? "" : obj.inspectName;
- jyContent += '<tr><td>' + obj.execName + '</td><td style="min-height: 30px;">' + obj.groupName + '</td><td>' + inspectName + '</td><td>' + obj.reqNo + '</td></tr>';
- JsBarcode("#JyBarcode", obj.reqNo, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- }
- }
- if (jyContent != null && jyContent != "" && jyContent.length > 0) {
- if (needNewPageA) {
- LODOP.NewPageA();
- }
- jyContent = jyTitle + jyContent;
- $("#jyContent").html(jyContent);
- //检验
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jy_card_table").innerHTML);
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印门诊病历
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printBlRecord(patientId, times, printType) {
- if(printType == 1){
- saveMzPrescriptionPrint(patientId,times)
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"门诊病历");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊病历");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientIdBlrecord").text(mzPatientMi.patientId);
- $("#patientNameBlrecord").text(mzPatientMi.name);
- $("#patientGenderBlrecord").text(mzPatientMi.gender);
- $("#patientAgeBlrecord").text(mzPatientMi.ageString);
- var mzBlRecord = res.mzBlRecord;
- if (mzBlRecord.firstOrNot == "1") {
- $("#firstOrNotTitle").text("复诊");
- } else {
- $("#firstOrNotTitle").text("初诊");
- }
- if (mzBlRecord.emrChiefComplaint != null && mzBlRecord.emrChiefComplaint != "") {
- $("#emrChiefComplaintBlrecord").text(mzBlRecord.emrChiefComplaint);
- $("#emrChiefComplaintBlrecord").parent().css("display", "block");
- } else {
- $("#emrChiefComplaintBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrHpi != null && mzBlRecord.emrHpi != "") {
- $("#emrHpiBlrecord").text(mzBlRecord.emrHpi);
- $("#emrHpiBlrecord").parent().css("display", "block");
- } else {
- $("#emrHpiBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrPs != null && mzBlRecord.emrPs != "") {
- $("#emrPsBlrecord").text(mzBlRecord.emrPs);
- $("#emrPsBlrecord").parent().css("display", "block");
- } else {
- $("#emrPsBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.personalHistory != null && mzBlRecord.personalHistory != "") {
- $("#personalHistoryBlrecord").text(mzBlRecord.personalHistory);
- $("#personalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#personalHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.familyHistory != null && mzBlRecord.familyHistory != "") {
- $("#familyHistoryBlrecord").text(mzBlRecord.familyHistory);
- $("#familyHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#familyHistoryBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.fzZl != null && mzBlRecord.fzZl != "") {
- $("#fzZlBlrecord").text(mzBlRecord.fzZl);
- $("#fzZlBlrecord").parent().css("display", "block");
- } else {
- $("#fzZlBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.crbHistory != null && mzBlRecord.crbHistory != "") {
- $("#crbHistoryBlrecord").text(mzBlRecord.crbHistory);
- } else {
- $("#crbHistoryBlrecord").text('无');
- }
- if (mzBlRecord.obstericalHistory != null && mzBlRecord.obstericalHistory != "") {
- $("#obstericalHistoryBlrecord").text(mzBlRecord.obstericalHistory);
- $("#obstericalHistoryBlrecord").parent().css("display", "block");
- } else {
- $("#obstericalHistoryBlrecord").parent().css("display", "none");
- }
- var patientAllergenInfoList = res.patientAllergenInfoList;
- if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
- var zdAllergen = null;
- for (var i = 0; i < patientAllergenInfoList.length; i++) {
- var patientAllergenInfo = patientAllergenInfoList[i];
- if (zdAllergen == null) {
- zdAllergen = patientAllergenInfo.allergenName;
- } else {
- zdAllergen += "," + patientAllergenInfo.allergenName;
- }
- }
- $("#zdAllergenBlrecord").text(zdAllergen);
- } else {
- $("#zdAllergenBlrecord").text('无');
- }
- var tz = getTz(mzBlRecord);
- if (tz != null && tz != "") {
- $("#emrPeBlrecord").text(tz);
- $("#emrPeBlrecord").parent().css("display", "block");
- } else {
- $("#emrPeBlrecord").parent().css("display", "none");
- }
- // if (mzBlRecord.emrPe != null && mzBlRecord.emrPe != "") {
- // $("#emrPeBlrecord").text(mzBlRecord.emrPe);
- // $("#emrPeBlrecord").parent().css("display", "block");
- // } else {
- // $("#emrPeBlrecord").parent().css("display", "none");
- // }
- if (res.icdText != null && res.icdText != "") {
- $("#icdTextBlrecord").text(res.icdText);
- $("#icdTextBlrecord").parent().css("display", "block");
- } else {
- $("#icdTextBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.tcmIcdText != null && mzBlRecord.tcmIcdText != "") {
- $("#tcmIcdTextBlrecord").text(mzBlRecord.tcmIcdText);
- } else {
- $("#tcmIcdTextBlrecord").text("无");
- }
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- $("#emrProcessBlrecord").html(mzBlRecord.emrProcess);
- $("#emrProcessBlrecord").parent().css("display", "block");
- } else {
- $("#emrProcessBlrecord").parent().css("display", "none");
- }
- if (mzBlRecord.emrJkjy != null && mzBlRecord.emrJkjy != "") {
- $("#emrJkjyBlrecord").text(mzBlRecord.emrJkjy);
- $("#emrJkjyBlrecord").parent().css("display", "block");
- } else {
- $("#emrJkjyBlrecord").parent().css("display", "none");
- }
- $("#visitDeptBlrecord").text(res.deptName);
- $("#visitDateBlrecord").text(res.visitDate);
- getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzBlRecord.doctorCode},false,function (hostRes) {
- if(hostRes.code ==0){
- $("#doctorSignBlrecord").html("<img src='" + hostRes.data + "' style='width:150px;height:25px;'/>")
- }
- })
- //LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_blrecord_card_table").innerHTML);
- //上边距 左边距 宽 高
- LODOP.ADD_PRINT_HTM("20mm", "5mm", "130mm", "168mm", strStyle + document.getElementById("mz_bl_content").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "20mm", strStyle + document.getElementById("mz_bl_title").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- LODOP.ADD_PRINT_HTM("190mm", "5mm", "130mm", "20mm", strStyle + document.getElementById("mz_bl_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印入院通知单
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printZyReq(patientId, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printZyReq?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"入院通知单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var mzZyReq = res.mzZyReq;
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.ageString);
- $("#sfzZyReq").text(mzPatientMi.socialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- $("#icsTextZyReq").text(mzZyReq.icdText);
- } else {
- $("#icsCodeZyReq").text(mzZyReq.icdCode);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- }
- $("#reqDeptZyReq").text(mzZyReq.reqWardName);
- $("#depositZyReq").text(mzZyReq.deposit);
- $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
- $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
- $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
- $(this).removeAttr("checked");
- if ($(this).val() == Number(mzZyReq.admissStatus) || $(this).val() == mzZyReq.admissStatus) {
- $(this).attr("checked", true)
- }
- });
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptName);
- getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
- if(signRes.code == 0){
- $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
- }else {
- $("#doctorCodeZyReq").text(mzZyReq.doctorName);
- }
- })
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印门诊手术请单
- * @param patientId
- * @param times
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printOpRecord(patientId, times, printType) {
- $.ajax({
- type: "GET",
- url: '/thmz/printOpRecord?patientId=' + patientId + '×=' + times,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.length == 0) {
- errorMesageSimaple("没有手术申请单可以打印");
- return;
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm",hospitalName+"门诊手术申请单");
- LODOP.SET_PRINT_STYLE("FontSize", 13); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊手术申请单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- $("#patientIdOpRecord").text(mzPatientMi.patientId);
- $("#patientNameOpRecord").text(mzPatientMi.name);
- $("#patientGenderOpRecord").text(mzPatientMi.gender);
- $("#patientAgeOpRecord").text(mzPatientMi.ageString);
- $("#responseTypeOpRecord").text(mzPatientMi.responseTypeName);
- $("#patientCardNoOpRecord").text(mzPatientMi.icCardNo);
- var needNewPageA = false;
- for (var i = 0; i < res.data.length; i++) {
- var obj = res.data[i];
- //$("#reqNoOpRecord").text(obj.recordId);
- $("#icdTextOpRecord").text(obj.diagBeforeOp);
- $("#opNameOpRecord").text(obj.opName);
- $("#hocusCodeOpRecord").text(obj.hocusCodeName);
- $("#opScaleOpRecord").text(obj.opScaleName);
- var dateStr = format(obj.applyDate, "yyyy-MM-dd HH:mm:ss");
- $("#applyDateOpRecord").text(dateStr);
- $("#opDatetimeOpRecord").text(obj.opDatetimeStr);
- $("#doctorZdOpRecord").text(obj.doctorZdName);
- $("#remarkOpRecord").text(obj.remark);
- if (i > 0) {
- LODOP.NewPageA();
- }
- JsBarcode("#JcBarcode", obj.recordId, {
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 26, //条码高度
- displayValue: false, //是否显示文字信息
- });
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("op_record_card_table").innerHTML);
- needNewPageA = true;
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开查看检查检验报告窗口(含往期)
- * @param patientId
- */
- function previewYjReqAll(patientId) {
- $("#visitingDetailModal").modal("hide");
- $("#previewYjReqModal").modal();
- $("#previewYjReqModalPatientId").val(patientId);
- $("#previewYjReqModalTimes").val(null);
- //重置参数
- retryCount = 0;
- initJcJyTable();
- }
- /**
- * 打开查看检查检验报告窗口
- * @param patientId 门诊病人ID
- * @param times 就诊次数
- */
- function previewYjReq(patientId, times) {
- $("#visitingDetailModal").modal("hide");
- $("#previewYjReqModal").modal();
- $("#previewYjReqModalPatientId").val(patientId);
- $("#previewYjReqModalTimes").val(times);
- //重置参数
- retryCount = 0;
- initJcJyTable();
- }
- /**
- * 删除本次处方
- * @param clnicId 就诊记录id
- */
- function deletePrescription(clnicId) {
- $("#visitingDetailModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认要删除本次处方信息吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/deletePrescription?clnicId=' + clnicId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#tb_table_clinic").bootstrapTable('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#visitingDetailModal").modal();
- });
- ;
- }
- /**
- * 检查检验列表类型按钮切换事件
- * @param object
- */
- function jcjyButtonChange(object) {
- $("#jcjy_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- initJcJyTable();
- }
- /**
- * 初始化检查检验报告列表
- */
- function initJcJyTable() {
- clearInspectionDetail();
- clearJcDetail();
- var typeIndex = getIndex("jcjy_group");
- if (typeIndex == 0) {
- //检查
- $('#tb_jy_pName_table_list').bootstrapTable("destroy");
- $('#tb_jy_table_list').bootstrapTable("destroy");
- initJcListTable();
- $("#jy_detail").removeClass("in").addClass("hide");
- $("#jc_detail").removeClass("hide").addClass("in");
- } else {
- $('#tb_table_list').bootstrapTable("destroy");
- initJyListTable();
- $("#jc_detail").removeClass("in").addClass("hide");
- $("#jy_detail").removeClass("hide").addClass("in");
- }
- }
- /**
- * 初始化检查报告列表
- */
- function initJcListTable() {
- $('#tb_table_list').bootstrapTable("destroy");
- $('#tb_table_list').bootstrapTable({
- url: '/thmz/getJcJyList', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'groupName',
- title: '项目名称',
- align: "center",
- valign: 'middle',
- }, {
- field: 'reqDate',
- title: '申请时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- onClickRow: function (row) {
- clearJcDetail();
- $("#patientId_t").text(row.patientId);
- $("#name_t").text(row.patientName);
- $("#date_t").text(format(row.reqDate, "yyyy-MM-dd HH:mm:ss"));
- fitJcDetail(row.reqNo, row.patientId);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- if (retryCount == 0) {
- retryCount++;
- $("#jyButton").click();
- return;
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- if (ress.count <= 0 && retryCount == 0) {
- retryCount++;
- $("#jyButton").click();
- return;
- }
- //有数据的时候,计数也需要加1,防止这时医生自己候点击检验没数据又跳回检查
- retryCount++;
- return {
- "total": ress.count,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- }
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParams(params) {
- var patientId = $("#previewYjReqModalPatientId").val();
- var times = $("#previewYjReqModalTimes").val();
- return {
- reqType: "3",
- patientId: patientId,
- times: times,
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit //页码
- };
- };
- /**
- * 加载检查明细
- * @param reqNo
- */
- function fitJcDetail(reqNo, patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getYjJcRecordReport?hisReqNo=' + reqNo + "&patientId=" + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- canBePrintJc = true;
- $("#jy_detail").removeClass("in").addClass("hide");
- $("#jc_detail").removeClass("hide").addClass("in");
- var mzPatientMi = res.data.mzPatientMi;
- $("#gender_jc").text(mzPatientMi.gender);
- $("#age_jc").text(mzPatientMi.ageString);
- var yjJcRecordReport = res.data.yjJcRecordReport;
- $("#groupName").text(res.data.groupName);
- $("#textJc").text(yjJcRecordReport.textJc);
- $("#textZd").text(yjJcRecordReport.textZd);
- var jcRecord = res.data.jcRecord;
- $("#report_no").text(jcRecord.reportNo);
- $("#reportId").text(jcRecord.reportId);
- if (jcRecord.reportDate == null || jcRecord.reportDate == "") {
- $("#reportDate").html(" ");
- } else {
- $("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
- }
- $("#confirmId").text(jcRecord.confirmId);
- if (jcRecord.confirmDate == null || jcRecord.confirmDate == "") {
- $("#confirmDate").html(" ");
- } else {
- $("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空检查明细
- * @param reqNo
- */
- function clearJcDetail() {
- canBePrintJc = false;
- $("#patientId_t").text("");
- $("#name_t").text("");
- $("#date_t").text("");
- $("#gender_jc").text("");
- $("#age_jc").text("");
- $("#groupName").text("");
- $("#textJc").text("");
- $("#textZd").text("");
- $("#report_no").text("");
- $("#reportId").text("");
- $("#reportDate").html(" ");
- $("#confirmId").text("");
- $("#confirmDate").html(" ");
- }
- /**
- * 初始化检验报告列表
- */
- function initJyListTable() {
- var patientId = $("#previewYjReqModalPatientId").val();
- var times = $("#previewYjReqModalTimes").val();
- $('#tb_table_list').bootstrapTable("destroy");
- $('#tb_table_list').bootstrapTable({
- url: '/thmz/getJyListByPatientIdAndTimes?patientId=' + patientId + "×=" + times, //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- //queryParams: queryJyPNameParams, //传递参数(*)
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'aply_CTNT',
- title: '检验名称',
- align: "center",
- valign: 'middle',
- }, {
- field: 'ordr_CREATE_DATE',
- title: '检验时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- onClickRow: function (row) {
- queryInspectionDetail(row.ordr_ID);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (retryCount == 0) {
- retryCount++;
- $("#jcButton").click();
- return;
- }
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- }
- if (ress.data.length <= 0 && retryCount == 0) {
- retryCount++;
- $("#jcButton").click();
- return;
- }
- //有数据的时候,计数也需要加1,防止这时医生自己候点击检查没数据又跳回检验
- retryCount++;
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $("#jy_table_table_div").find(".pagination-detail").css("display", "none");
- }
- });
- }
- /**
- * 清空检验明细
- * @param orderId
- */
- function clearInspectionDetail() {
- canBePrintJy = false;
- $("#patientId_t_jy").text("");
- $("#name_t_jy").text("");
- $("#gender_jy").text("");
- $("#age_jy").text("");
- $("#reqDept_t_jy").text("");
- $("#bed_no_jy").text("");
- $("#smpl_jy").text("");
- $("#item_jy").text("");
- $("#applyDate").text("");
- $("#orderCreateDate").text("");
- $("#auditTime").text("");
- $("#orderUsrName").text("");
- $("#testUsrName").text("");
- $("#auditUsrName").text("");
- $("#jyBody").html("");
- }
- /**
- * 加载检验明细
- * @param orderId
- */
- function queryInspectionDetail(orderId) {
- clearInspectionDetail();
- $.ajax({
- type: "GET",
- url: '/thmz/getInspectionDetail?orderId=' + orderId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- canBePrintJy = true;
- $("#jc_detail").removeClass("in").addClass("hide");
- $("#jy_detail").removeClass("hide").addClass("in");
- var mzPatientMi = res.mzPatientMi;
- $("#patientId_t_jy").text(mzPatientMi.patientId);
- $("#name_t_jy").text(mzPatientMi.name);
- $("#gender_jy").text(mzPatientMi.gender);
- $("#age_jy").text(mzPatientMi.ageString);
- var html = "";
- if (res.data != null) {
- var inspectionHeader = res.data.inspectionHeader;
- $("#reqDept_t_jy").text(inspectionHeader.dept_NAME);
- $("#bed_no_jy").text(inspectionHeader.ptnt_BED_NO);
- $("#smpl_jy").text(inspectionHeader.smpl_NAME);
- $("#item_jy").text(inspectionHeader.aply_CNTN);
- $("#applyDate").text(format(inspectionHeader.aply_DATE, "yyyy-MM-dd HH:mm:ss"));
- $("#orderCreateDate").text(format(inspectionHeader.ordr_CREATE_DATE, "yyyy-MM-dd HH:mm:ss"));
- $("#auditTime").text(format(inspectionHeader.audt_TIME, "yyyy-MM-dd HH:mm:ss"));
- $("#orderUsrName").text(inspectionHeader.doc_NAME);
- $("#testUsrName").text(inspectionHeader.test_USR_NAME);
- $("#auditUsrName").text(inspectionHeader.audt_USR_NAME);
- var inspectionItems = res.data.inspectionItems;
- if (inspectionItems != null && inspectionItems.length > 0) {
- for (var i = 0; i < inspectionItems.length; i++) {
- html += "<tr>";
- var obj = inspectionItems[i];
- var itm_VALUE = obj.itm_VALUE;
- if (itm_VALUE == null || itm_VALUE == "null") {
- itm_VALUE = "";
- }
- itm_VALUE += (obj.itm_STR_VALUE == null || obj.itm_STR_VALUE == "null") ? "" : obj.itm_STR_VALUE;
- var range = obj.range;
- if (range == null || range == "null") {
- range = "";
- }
- range += (obj.range_STR == null || obj.range_STR == "null") ? "" : obj.range_STR;
- html += "<td width='25%'>" + obj.itm_NAME + "</td>";
- html += "<td width='16.66%'>" + itm_VALUE + "</td>";
- html += "<td width='16.66%'>" + obj.itm_UNIT + "</td>";
- if (obj.itm_ALERT == null || obj.itm_ALERT == "") {
- html += "<td width='16.66%'><span style=\"color:#67C23A;font-weight:bold\"></span></td>";
- } else if (obj.itm_ALERT == "H") {
- html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↑</span></td>";
- } else if (obj.itm_ALERT == "L") {
- html += "<td width='16.66%'><span style=\"color:#F56C6C;font-weight:bold\">↓</span></td>";
- }
- html += "<td width='25%'>" + range + "</td>";
- html += "</tr>";
- var bacteriaResults = obj.bacteriaResults;
- if (bacteriaResults == null || bacteriaResults.length == 0) {
- continue;
- }
- var bacteriaResult = bacteriaResults[0];
- if (bacteriaResult == null || bacteriaResult.length == 0) {
- continue;
- }
- var antibioticResults = bacteriaResult.antibioticResults;
- if (antibioticResults == null || antibioticResults.length == 0) {
- continue;
- }
- html += '<tr><th width="35%;" style="text-align: left;padding-left: 2%;" >抗菌药物</th><th width="20%;" style="text-align: left;">药物编码</th><th width="30%;" style="text-align: left;">MIC值</th><th width="15%;" style="text-align: left;padding-right: 2%;">敏感性</th></tr>';
- for (var j = 0; j < antibioticResults.length; j++) {
- var antibioticResultsObj = antibioticResults[j];
- html += "<tr>";
- html += "<td width='35%' style='padding-left: 2%;";
- if (j == 0) {
- html += "border-top: 1px solid black;";
- }
- html += "'>" + antibioticResultsObj.anti_NAME_CN + "</td>";
- html += "<td width='20%' ";
- if (j == 0) {
- html += "style='border-top: 1px solid black;'";
- }
- html += ">" + antibioticResultsObj.anti_ABB + "</td>";
- html += "<td width='25%' ";
- if (j == 0) {
- html += "style='border-top: 1px solid black;'";
- }
- html += ">" + antibioticResultsObj.anti_MIC + "</td>";
- html += "<td width='20%' style='padding-right: 2%;";
- if (j == 0) {
- html += "border-top: 1px solid black;";
- }
- html += "'>" + antibioticResultsObj.anti_VALUE + "</td>";
- html += "</tr>";
- }
- }
- }
- }
- $("#jyBody").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打印检查检验报告单
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printJyJcReport(printType) {
- var typeIndex = getIndex("jcjy_group");
- var title = "检查报告单";
- if (typeIndex == 1) {
- title = "检验报告单"
- if (!canBePrintJy) {
- warningMesageSimaple("没有任何【" + title + "】可供打印!");
- return;
- }
- } else {
- if (!canBePrintJc) {
- warningMesageSimaple("没有任何【" + title + "】可供打印!");
- return;
- }
- }
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
- LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
- if (typeIndex == 0) {
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_detail").innerHTML);
- }
- if (typeIndex == 1) {
- LODOP.ADD_PRINT_TABLE("37mm", "5mm", "130mm", "138mm", strStyle + document.getElementById("jy_detail_content").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_title").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- LODOP.ADD_PRINT_HTM("177mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- }
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- /**
- * 初始化科室下拉选
- */
- function initExecUnit() {
- //父科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
- });
- $('#execUnit').empty(); //清空resText里面的所有内容
- $('#zlExecUnit').empty(); //清空resText里面的所有内容
- $('#execUnit').html(html);
- $('#execUnit').selectpicker('refresh');
- $('#zlExecUnit').html(html);
- $('#zlExecUnit').selectpicker('refresh');
- $('#execUnit').selectpicker('val', null);
- $('#zlExecUnit').selectpicker('val', null);
- }
- });
- }
- /**
- * 初始化证件类型下拉选
- */
- function initCertificateTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/listCertificateType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#rapidAcceptsUserCertificateType').append(html);
- $('#editUserCertificateType').append(html);
- $('#crbMainCardCertificateType').append(html);
- });
- $('#rapidAcceptsUserCertificateType').selectpicker('refresh');
- $('#editUserCertificateType').selectpicker('refresh');
- $('#crbMainCardCertificateType').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载病历信息编辑预览
- * @param patientId
- * @param times
- * @param type 1 编辑 2 预览
- */
- function showMzBlRecordModal(patientId, times, type) {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times+'&type='+type,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var mzPatientMi = res.mzPatientMi;
- $("#editPatientId").text(mzPatientMi.patientId);
- $("#editPatientName").text(mzPatientMi.name);
- $("#editPatientGender").text(mzPatientMi.gender);
- $("#editPatientAge").text(mzPatientMi.ageString);
- var mzBlRecord = res.mzBlRecord;
- $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint == null ? "" : mzBlRecord.emrChiefComplaint);
- $("#editEmrHpi").val(mzBlRecord.emrHpi == null ? "" : mzBlRecord.emrHpi);
- $("#editEmrPs").val(mzBlRecord.emrPs == null ? "" : mzBlRecord.emrPs);
- $("#editPersonalHistory").val(mzBlRecord.personalHistory == null ? "" : mzBlRecord.personalHistory);
- $("#editFamilyHistory").val(mzBlRecord.familyHistory == null ? "" : mzBlRecord.familyHistory);
- $("#editFzZl").val(mzBlRecord.fzZl == null ? "" : mzBlRecord.fzZl);
- $("#editCrbHistory").val(mzBlRecord.crbHistory == null ? "" : mzBlRecord.crbHistory);
- $("#editObstericalHistory").val(mzBlRecord.obstericalHistory == null ? "" : mzBlRecord.obstericalHistory);
- $("#editQtjc").val(mzBlRecord.emrPe == null ? "" : mzBlRecord.emrPe);
- setSelectedAttr("editZd", mzBlRecord.icdCode, mzBlRecord.icdText);
- setSelectedAttr("editTcmZd", mzBlRecord.tcmIcdCode, mzBlRecord.tcmIcdText);
- var patientAllergenInfoList = res.patientAllergenInfoList;
- if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
- var zdAllergen = [];
- var ypDitList = [];
- var zdAllergenHtml = '';
- var ypDitListHtml = '';
- var zdAllergeCodes = null;
- var zdAllergeTexts = null;
- var ypDitListodes = null;
- var ypDitListTexts = null;
- for (var i = 0; i < patientAllergenInfoList.length; i++) {
- var patientAllergenInfo = patientAllergenInfoList[i];
- if (patientAllergenInfo.type == 0 || patientAllergenInfo.type == '0') {
- zdAllergen[zdAllergen.length] = patientAllergenInfo.allergenCode;
- zdAllergenHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
- if (zdAllergeCodes == null) {
- zdAllergeCodes = patientAllergenInfo.allergenCode;
- zdAllergeTexts = patientAllergenInfo.allergenName;
- } else {
- zdAllergeCodes += "," + patientAllergenInfo.allergenCode;
- zdAllergeTexts += "," + patientAllergenInfo.allergenName;
- }
- } else if (patientAllergenInfo.type == 1 || patientAllergenInfo.type == '1') {
- ypDitList[ypDitList.length] = patientAllergenInfo.allergenCode;
- ypDitListHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
- if (zdAllergeCodes == null) {
- ypDitListodes = patientAllergenInfo.allergenCode;
- ypDitListTexts = patientAllergenInfo.allergenName;
- } else {
- ypDitListodes += "," + patientAllergenInfo.allergenCode;
- ypDitListTexts += "," + patientAllergenInfo.allergenName;
- }
- }
- }
- $("#editZdAllergen").empty();
- $('#editZdAllergen').append(zdAllergenHtml);
- $('#editZdAllergen').selectpicker('refresh');
- $("#editYpDitList").empty();
- $('#editYpDitList').append(ypDitListHtml);
- $('#editYpDitList').selectpicker('refresh');
- $("#editZdAllergen").selectpicker('val', zdAllergen);
- $("#editZdAllergen").selectpicker('refresh');
- $("#editYpDitList").selectpicker('val', ypDitList);
- $("#editYpDitList").selectpicker('refresh');
- $("#editZdAllergen").attr("selectedCodes", zdAllergeCodes);
- $("#editZdAllergen").attr("selectedTexts", zdAllergeTexts);
- $("#editYpDitList").attr("selectedCodes", ypDitListodes);
- $("#editYpDitList").attr("selectedTexts", ypDitListTexts);
- }
- var tentativeDiagnosis = mzBlRecord.tentativeDiagnosis == null ? "" : mzBlRecord.tentativeDiagnosis;
- if ((mzBlRecord.icdCode == null || mzBlRecord.icdCode == "") && mzBlRecord.icdText != null && mzBlRecord.icdText != "") {
- if (tentativeDiagnosis == null || tentativeDiagnosis == "") {
- tentativeDiagnosis = mzBlRecord.icdText;
- } else {
- tentativeDiagnosis = mzBlRecord.icdText + " " + tentativeDiagnosis;
- }
- }
- $("#edittentativeDiagnosis").val(tentativeDiagnosis);
- $("#editEmrJkjy").val(mzBlRecord.emrJkjy == null ? "" : mzBlRecord.emrJkjy);
- $("#bl_weight").val(mzBlRecord.weight == 0 ? null : mzBlRecord.weight);
- $("#bl_temperature").val(mzBlRecord.temperature == 0 ? null : mzBlRecord.temperature);
- $("#bl_sphygmus").val(mzBlRecord.sphygmus == 0 ? null : mzBlRecord.sphygmus);
- $("#bl_breathe").val(mzBlRecord.breathe == 0 ? null : mzBlRecord.breathe);
- $("#bl_pressure_high").val(mzBlRecord.pressureHigh == 0 ? null : mzBlRecord.pressureHigh);
- $("#bl_pressure_floor").val(mzBlRecord.pressureFloor == 0 ? null : mzBlRecord.pressureFloor);
- $("#bl_pressure_high_left").val(mzBlRecord.pressureHighLeft == 0 ? null : mzBlRecord.pressureHighLeft);
- $("#bl_pressure_floor_left").val(mzBlRecord.pressureFloorLeft == 0 ? null : mzBlRecord.pressureFloorLeft);
- if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
- var reg = new RegExp("</br>", "g");//g,表示全部替换。
- var editEmrProcess = mzBlRecord.emrProcess.replace(reg, "\n");
- reg = new RegExp(" ", "g");//g,表示全部替换。
- editEmrProcess = editEmrProcess.replace(reg, "");
- $("#editEmrProcess").val(editEmrProcess);
- } else {
- $("#editEmrProcess").val("");
- }
- if (type == 1) {
- $("#mzBlRecorTitle").html("门诊病历【编辑】");
- $("#setOtherEmrProcess").removeClass("in").addClass("hide");
- $("#openBlRecordModel").removeClass("hide").addClass("in");
- $("#setEmrProcess").removeClass("hide").addClass("in");
- $("#visitingDetailModal").modal("hide");
- } else if (type == 2) {
- $("#mzBlRecorTitle").html("门诊病历【预览】");
- $("#setOtherEmrProcess").removeClass("hide").addClass("in");
- $("#openBlRecordModel").removeClass("in").addClass("hide");
- $("#setEmrProcess").removeClass("in").addClass("hide");
- //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
- if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
- $("#baseMzBlTimes").val($("#mzBlTimes").val());
- }
- $("#otherBlRecordModal").modal("hide");
- }
- $("#mzBlTimes").val(mzBlRecord.times);
- $("#editMzBlRecordModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空区域
- */
- function clearInput() {
- //编辑病历的时候,没有基础病历的就诊次数,如果是预览病历的时候,有基础病历的次数
- var baseMzBlTimes = $("#baseMzBlTimes").val();
- $("#editPatientId").text(null);
- $("#editPatientName").text(null);
- $("#editPatientGender").text(null);
- $("#editPatientAge").text(null);
- $("#editEmrChiefComplaint").val(null);
- $("#editEmrHpi").val(null);
- $("#editEmrPs").val(null);
- $("#editPersonalHistory").val(null);
- $("#editFamilyHistory").val(null);
- $("#editFzZl").val(null);
- $("#editCrbHistory").val(null);
- $("#editObstericalHistory").val(null);
- $("#bl_weight").val(null);
- $("#bl_sphygmus").val(null);
- $("#bl_breathe").val(null);
- $("#bl_pressure_high").val(null);
- $("#bl_pressure_floor").val(null);
- $("#bl_pressure_high_left").val(null);
- $("#bl_pressure_floor_left").val(null);
- $("#editQtjc").val(null);
- $("#editZd").selectpicker('val', null);
- $("#editZd").selectpicker('refresh');
- $("#editTcmZd").selectpicker('val', null);
- $("#editTcmZd").selectpicker('refresh');
- $("#edittentativeDiagnosis").val(null);
- $("#editEmrProcess").val(null);
- $("#editEmrJkjy").val(null);
- $("#mzBlTimes").val(null);
- if (baseMzBlTimes != null && baseMzBlTimes != "") {
- $("#otherBlRecordModal").modal();
- }
- }
- /**
- * 保存门诊病历
- */
- function setEmrProcess() {
- $("#editMzBlRecordModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确认修改当前门诊病历吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- sendEmrProcess();
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editMzBlRecordModal").modal();
- });
- }
- /**
- * 提交保存门诊病历
- */
- function sendEmrProcess() {
- //修改告警人员
- var icdCodes = $("#editZd").val();
- var icdCodeStr = null;
- if (icdCodes != null && icdCodes.length > 0) {
- for (var i = 0; i < icdCodes.length; i++) {
- if (icdCodeStr == null) {
- icdCodeStr = icdCodes[i];
- } else {
- icdCodeStr += "," + icdCodes[i];
- }
- }
- }
- //中医诊断
- let tcmIcdCodes = $("#editTcmZd").val();
- let tcmIcdCodeStr = null;
- if (tcmIcdCodes != null && tcmIcdCodes.length > 0) {
- for (let i = 0; i < tcmIcdCodes.length; i++) {
- if (tcmIcdCodeStr == null) {
- tcmIcdCodeStr = tcmIcdCodes[i];
- } else {
- tcmIcdCodeStr += "," + tcmIcdCodes[i];
- }
- }
- }
- //设置过敏源
- var patientAllergenInfoList = [];
- var zdAllergen = $("#editZdAllergen").val();
- var ypDitList = $("#editYpDitList").val();
- if (zdAllergen != null && zdAllergen.length > 0) {
- for (var i = 0; i < zdAllergen.length; i++) {
- var tempJson = JSON.parse('{}');
- tempJson.allergenCode = zdAllergen[i];
- tempJson.type = 0;
- patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
- }
- }
- if (ypDitList != null && ypDitList.length > 0) {
- for (var i = 0; i < ypDitList.length; i++) {
- var tempJson = JSON.parse('{}');
- tempJson.allergenCode = ypDitList[i];
- tempJson.type = 1;
- patientAllergenInfoList[patientAllergenInfoList.length] = tempJson;
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/setEmrProcess',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": $("#editPatientId").text(),
- "times": $("#mzBlTimes").val(),
- "emrChiefComplaint": $("#editEmrChiefComplaint").val(),
- "emrHpi": $("#editEmrHpi").val(),
- "emrPs": $("#editEmrPs").val(),
- "personalHistory": $("#editPersonalHistory").val(),
- "familyHistory": $("#editFamilyHistory").val(),
- "fzZl": $("#editFzZl").val(),
- "crbHistory": $("#editCrbHistory").val(),
- "obstericalHistory": $("#editObstericalHistory").val(),
- "emrPe": $("#editQtjc").val(),
- "weight": $("#bl_weight").val(),
- "temperature": $("#bl_temperature").val(),
- "sphygmus": $("#bl_sphygmus").val(),
- "breathe": $("#bl_breathe").val(),
- "pressureHigh": $("#bl_pressure_high").val(),
- "pressureFloor": $("#bl_pressure_floor").val(),
- "pressureHighLeft": $("#bl_pressure_high_left").val(),
- "pressureFloorLeft": $("#bl_pressure_floor_left").val(),
- "icdCode": icdCodeStr,
- "tcmIcdCode": tcmIcdCodeStr,
- "icdText": $('#editZd').next().attr("title"),
- "tcmIcdText": $('#editTcmZd').next().attr("title"),
- "tentativeDiagnosis": $("#edittentativeDiagnosis").val(),
- "emrJkjy": $("#editEmrJkjy").val(),
- "emrProcess": $("#editEmrProcess").val(),
- "patientAllergenInfoList": patientAllergenInfoList
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- clearInput();
- successMesage(res);
- $("#editMzBlRecordModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开待合并病历列表弹框
- */
- function openBlRecordModel() {
- $("#editMzBlRecordModal").modal("hide");
- $("#otherBlRecordModal").modal();
- initOtherMzBlRecordList();
- }
- /**
- * 关闭待合并病历列表
- */
- function closeBlRecordModel() {
- $('#baseMzBlTimes').val(null);
- $("#visitingDetailModal").modal();
- }
- /**
- * 病历列表
- */
- function initOtherMzBlRecordList() {
- $('#other_bl_record_table').bootstrapTable("destroy");
- $('#other_bl_record_table').bootstrapTable({
- url: '/thmz/getMzBlRecordList', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "desc", //排序方式
- queryParams: queryOtherParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- title: '操作',
- field: 'op',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="showMzBlRecordModal(\'' + row.patientId + '\',' + row.times + ',2)">预览<i class="fa fa-edit" style="margin-left: 10px;"></i></button>';
- return [str].join('');
- }
- },
- {
- field: 'patientId',
- title: '门诊ID',
- align: "center",
- valign: 'middle'
- }, {
- field: 'patientName',
- title: '患者姓名',
- align: "center",
- valign: 'middle'
- }, {
- field: 'deptCode',
- title: '就诊科室',
- align: "center",
- valign: 'middle'
- }, {
- field: 'doctorCode',
- title: '接诊医师',
- align: "center",
- valign: 'middle'
- }, {
- field: 'firstOrNot',
- title: '初/复诊',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == '1') {
- return "复诊";
- }
- return "初诊";
- }
- }
- , {
- field: 'visitDate',
- title: '就诊时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (ress.message != null && ress.message != '') {
- errorMesage(ress);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryOtherParams(params) {
- var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
- patientId: $("#editPatientId").text(),
- exceptTimes: $("#mzBlTimes").val(),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- return temp;
- }
- /**
- * 提取处理意见保存
- */
- function setOtherEmrProcess() {
- $("#editMzBlRecordModal").modal("hide");
- $("#messageModal").modal();
- $("#messageContent").html("确定要执行此次提取处理意见操作吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val() + '×=' + $("#mzBlTimes").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- $("#editMzBlRecordModal").modal("hide");
- } else {
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editMzBlRecordModal").modal();
- });
- }
- /**
- * 医保电子凭证读卡
- * @param params
- */
- function siReadCard(params) {
- $.ajax({
- type: "GET",
- url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- //console.log(res);
- if (res.code == 200) {
- var data = JSON.parse(res.data);
- queryUserInfoBySocialNoNotFillPatient('rapidAcceptsUserCardNo', "" + data.data.idNo + "", queryUserInfoByCardNo, 'rapidAcceptsModal');
- } else {
- errorMesage(res);
- }
- }
- });
- // window.open('ReadCard://'+prm, '_self')
- }
- /**
- * 西药品类按钮点击事件 因为原插件有点未解决bug,点击title的时候,加载的列表非对应的,
- * @param paneId
- */
- function xyTableOnClick(paneId) {
- setTimeout(function () {
- $("#xyTabContent div.tab-pane").each(function (index, obj) {
- var targetId = $(obj).attr("id");
- //如果处方内容是空的,就删除没有处方
- if ($(obj).find("div.cf_content").children().length == 0) {
- $(obj).remove();
- $("[href='#" + targetId + "']").parent().remove();
- } else if (targetId == paneId) {
- $(obj).addClass("active").addClass("in");
- } else {
- $(obj).removeClass("active").removeClass("in");
- }
- });
- }, 400);
- }
- /**
- * 打开转诊弹层
- */
- function transferTreatment() {
- $("#turnDept").selectpicker({
- size: 5
- });
- $("#turnToConsultationTitle").html("转诊");
- $("#opType").val(1);
- $("#turnToConsultationDoctorDiv").removeClass("hide").addClass("in");
- $("#turnDeptDiv").removeClass("hide").addClass("in");
- $("#consultationDeptDiv").removeClass("in").addClass("hide");
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByRequestDay',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#turnDept').empty();
- $('#turnDept').html(html);
- $('#turnDept').selectpicker('refresh');
- }
- });
- $("#turnToConsultationModal").modal();
- }
- /**
- * 打开会诊弹层
- */
- function consultation() {
- $("#consultationDept").selectpicker({
- size: 5
- });
- $("#turnToConsultationTitle").html("发起会诊");
- $("#opType").val(2);
- $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
- $("#consultationDeptDiv").removeClass("hide").addClass("in");
- $("#turnDeptDiv").removeClass("in").addClass("hide");
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allMzUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#consultationDept').empty();
- $('#consultationDept').html(html);
- $('#consultationDept').selectpicker('refresh');
- $.ajax({
- type: "GET",
- url: '/thmz/getUnConsultation?serialNo=' + $("#mzfzSerialNoInClick").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var data = res.data;
- if (data != null && data.length > 0) {
- $('#consultationDept').selectpicker('val', data);
- $('#consultationDept').selectpicker('refresh');
- }
- }
- });
- }
- });
- $("#turnToConsultationModal").modal();
- }
- /**
- * 清空转诊和发起会诊区域
- */
- function clearTurnToConsultationInput() {
- $("#turnDept").selectpicker('val', null);
- $("#turnDept").selectpicker('refresh');
- $("#consultationDept").selectpicker('val', null);
- $("#consultationDept").selectpicker('refresh');
- $("#turnToConsultationDoctor").selectpicker('val', null);
- $("#turnToConsultationDoctor").selectpicker('refresh');
- $("#turnToConsultationId").val(null);
- $("#opType").val(null);
- $("#turnToConsultationDoctorDiv").removeClass("in").addClass("hide");
- $("#turnDeptDiv").removeClass("in").addClass("hide");
- $("#consultationDeptDiv").removeClass("in").addClass("hide");
- }
- /**
- * 清空门诊统筹额外内容区域
- */
- function clearExpContentRequired() {
- $("#mdtrtGrpType").selectpicker('val', null);
- $("#mdtrtGrpType").selectpicker('refresh');
- $("#trumFlag").selectpicker('val', null);
- $("#trumFlag").selectpicker('refresh');
- $("#relTtpFlag").selectpicker('val', null);
- $("#relTtpFlag").selectpicker('refresh');
- $("#otpErReflFlag").selectpicker('val', null);
- $("#otpErReflFlag").selectpicker('refresh');
- }
- /**
- * 清空门诊统筹支付参数区域
- */
- function clearZgtczfInput() {
- $("#zgmztczf").selectpicker('val', null);
- $("#zgmztczf").selectpicker('refresh');
- $("#grzhzf").selectpicker('val', null);
- $("#grzhzf").selectpicker('refresh');
- $("#readCardResult").val(null);
- }
- /**
- * 保存转诊/会诊
- */
- function setTurnToConsultation() {
- $("#turnToConsultationModal").modal("hide");
- $("#messageModal").modal();
- var opType = $("#opType").val();
- var targetDeptNo = $("#turnDept").val();
- var title = "确认提交转诊操作吗,提交后您将无法继续接诊该患者?";
- if (opType == 2 || opType == "2") {
- title = "确认提交本次会诊操作吗?";
- var consultationDept = $("#consultationDept").val();
- if (consultationDept != null && consultationDept.length > 0) {
- targetDeptNo = null;
- for (var i = 0; i < consultationDept.length; i++) {
- if (targetDeptNo == null) {
- targetDeptNo = consultationDept[i];
- } else {
- targetDeptNo += "," + consultationDept[i];
- }
- }
- }
- }
- $("#messageContent").html(title);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/saveTurnToConsultation',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "id": $("#turnToConsultationId").val(),
- "opType": opType,
- "targetDeptNo": targetDeptNo,
- "targetDoctorNo": $("#turnToConsultationDoctor").val(),
- "serialNo": $("#mzfzSerialNoInClick").val(),
- "remark": $("#turnToConsultationRemark").val(),
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- clearTurnToConsultationInput();
- if (opType == 1 || opType == "1") {
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- clearWorkSpace();
- }
- } else {
- $("#turnToConsultationModal").modal();
- errorMesage(res);
- }
- }
- });
- });
- $("#cancelButton").off("click");
- }
- /**
- * 初始医生下拉选
- * @param ampm 时间段区间
- */
- function initEmployee() {
- var opType = $("#opType").val();
- if (opType == 2) {
- return;
- }
- $("#turnToConsultationDoctor").selectpicker({
- size: 5
- });
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#turnDept').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var defaultCode = null;
- $.each(res.data, function (commentIndex, comment) {
- var employeeName = comment.employee.employeeName;
- if (comment.leftNum != null) {
- employeeName = employeeName + " 余号(" + comment.leftNum + ")"
- }
- html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + employeeName + '</option>';
- if (res.data.length == 1) {
- //如果只有一个号别,默认选中
- defaultCode = comment.employee.employeeCode;
- }
- });
- $('#turnToConsultationDoctor').empty();
- $('#turnToConsultationDoctor').html(html);
- $('#turnToConsultationDoctor').selectpicker('refresh');
- if (defaultCode != null) {
- //如果有无需选择医生的选项,默认选择
- $('#turnToConsultationDoctor').selectpicker('val', defaultCode);
- $('#turnToConsultationDoctor').selectpicker('refresh');
- }
- }
- });
- }
- /**
- * 设置挂号号别
- * @param patientId
- * @param times
- * @param reqType
- */
- function setMzReqType(patientId,times,reqType) {
- if(stringIsBlank(reqType)){
- postAjaxJsonHttpRequst("/thmz/queryMzOrderDetails",{patientId:patientId,times:times},true,function (res) {
- if(res.code == 0 && res.data != null){
- $("#mzReqTypeName").text(res.data.reqTypeName)
- $("#mzReqType").val(res.data.reqType)
- if(res.data.reqType == '45') {
- $("#mzOrderTypeSelect").val('4');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- }
- }
- })
- }else {
- getAjaxRequst("/thmz/getMzChargeTypeByCode",{code:reqType},true,function (res) {
- if(res.code == 0 && res.data != null){
- $("#mzReqType").val(reqType)
- $("#mzReqTypeName").text(res.data.name)
- if(reqType == '45'){
- $("#mzOrderTypeSelect").val('4');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- }
- }
- })
- }
- }
- /**
- * 选择处方类型进行效验
- */
- function verifyMzOrderType() {
- let mzOrderTypeSelectVal = $("#mzOrderTypeSelect").val();
- if(mzOrderTypeSelectVal == '3'){
- if(stringIsBlank(curOpspDiseCode)){
- errorMesageSimaple('不是特门病人,请先点击[查询特门]并选中特门编码!')
- $("#mzOrderTypeSelect").val('1');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- return
- }
- }
- let mzReqTypeVal = $("#mzReqType").val()
- if(mzOrderTypeSelectVal == '4' && mzReqTypeVal != '45'){
- errorMesageSimaple('当前病人不是GCP实验类型,不能选择该选项!')
- $("#mzOrderTypeSelect").val('1');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- return
- }
- }
- /**
- * 初始化门诊处方类型下拉框
- */
- function initMzOrderTypeSelect() {
- getAjaxRequst("/thmz/queryMzOrderType",{},true,function (res) {
- let html = ''
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#mzOrderTypeSelect').empty();
- $('#mzOrderTypeSelect').html(html);
- $('#mzOrderTypeSelect').selectpicker('refresh');
- $('#mzOrderTypeSelect').val('1');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- })
- }
- /**
- * 选择门诊统筹支付时校验门诊诊断是否是标准诊断,校验医生是否具有医保编码
- */
- function verifyInsuranceInfo() {
- var zgmztczf = $("#zgmztczf").val();
- if (zgmztczf != null && (zgmztczf == 1 || zgmztczf == "1")) {
- $('#mzOrderTypeSelect').val('2');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:$("#patientId").text()},true,function (res) {
- if(res.code ==0){
- if(!stringIsBlank(res.data)){
- warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
- }
- }
- })
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
- errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- diagnoseValue = diagnoseValue.replace(/,/g, "");
- if (diagnoseValue == null || diagnoseValue == "" || diagnoseValue.length == 0) {
- errorMesageSimaple("门诊统筹就诊必须使用标准的医保诊断,请修改诊断或者消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- var ybCode = localStorage.getItem("ybCode");
- if (ybCode == null || ybCode == "" || ybCode.length == 0) {
- errorMesageSimaple("您还没有医保赋码,无法进行门诊统筹接诊,请取消门诊统筹选项");
- // $("#zgmztczf").selectpicker('val', null);
- // $("#zgmztczf").selectpicker('refresh');
- return false;
- }
- }else {
- if($('#mzOrderTypeSelect').val() =='2'){
- $('#mzOrderTypeSelect').val('1');
- $('#mzOrderTypeSelect').selectpicker('refresh');
- }
- }
- return true;
- }
- /**
- * 已诊列表发起会诊
- * @param patientId
- */
- function consultationCliniced(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getLastClinicedFzOrder?patientId=' + patientId,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#visitingDetailModal").modal("hide");
- $("#mzfzSerialNoInClick").val(res.data.serialNo);
- consultation();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 计算诊疗金额
- * @param flag true ,直接计算总价, false 还要计算总量
- */
- function calculateZl(flag) {
- if (!flag) {
- var itemQuantity = $("#itemQuantity").val();
- if (itemQuantity == null) {
- return;
- }
- var dayZlNum = $("#dayZlNum").val();
- if (dayZlNum == null) {
- return;
- }
- //频率
- var times = $('#orderFrequencyZl').find("option:selected").attr('desc');
- if (times == null) {
- return;
- }
- var totalNumZl = Multiply(Multiply(itemQuantity, dayZlNum), times);
- $("#totalNumZl").val(totalNumZl);
- }
- //总量
- var totalNumZl = $("#totalNumZl").val();
- if (totalNumZl == null) {
- return;
- }
- //单价
- var zlItemPrice = $("#zlItemPrice").val();
- if (zlItemPrice == null) {
- return;
- }
- $("#totalAmountZl").val(Multiply(totalNumZl, zlItemPrice));
- }
- /**
- *打印外伤无第三方责任承诺书
- */
- function printNoThirdParty() {
- printNoThirdPartyCommon(1);
- }
- /**
- * 打印外伤无第三方责任承诺书
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printNoThirdPartyCommon(printType) {
- warningMesageSimaple("请提醒患者至医保窗口审核,审核通过方能报销!");
- var title = "外伤无第三方责任承诺书";
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
- LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- // var strStyle = "<style>table{width: 96%;}</style>";
- var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>";
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("print_no_third_party_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- /**
- * 打印自费承诺书
- */
- function printSelfPay() {
- printSelfPayCommon(1);
- }
- /**
- * 打印自费承诺书
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printSelfPayCommon(printType) {
- var title = "参保人员门诊统筹医保支付告知审核表";
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName + title);
- LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- // var strStyle = "<style>table{width: 96%;}</style>";
- //table,th {border-width: 1px;border-style: solid;border-collapse: collapse}
- var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} </style>";
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- }
- /**
- * 将科室缓存到内存中
- */
- function saveDeptConfig() {
- var clinicDeptNo = $("#clinicDeptNo").val();
- if (clinicDeptNo != null && clinicDeptNo != "") {
- var userIdCode = localStorage.getItem("userIdCode");
- localStorage.setItem(userIdCode, clinicDeptNo);
- }
- $("#selectDeptModal").modal("hide");
- }
- /**
- * 合理用药药品说明书
- */
- function hlyyypsms() {
- $("#western_medicine_name").webuiPopover('hide');
- var code = $("#western_medicine_current_code").val();
- var serial = $("#western_medicine_current_serial").val();
- $("#hlyyTitle").html("药品说明书");
- showHlyyModel('hlyysmsDiv', 'hlyysmsLoading', 'hlyysmsModal', "http://172.16.32.121:9097/web/sms/hpms_medi_show.aspx?his_code=" + code + "_" + serial);
- }
- /**
- * 预约挂号
- * @param patientId
- */
- function registration(patientId) {
- clearRegistrationModal();
- $("#patientIdRegistration").val(patientId);
- $("#visitingDetailModal").modal('hide');
- $("#registrationModal").modal();
- }
- /**
- * 初始门诊时间区间下拉选
- */
- function initMzWorkTime() {
- $("#ampm").selectpicker({
- size: 10
- });
- $.ajax({
- type: "GET",
- url: '/thmz/getMzWorkTime',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var ampm = null;
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- // if (ampm == null || (ampm != "a" && ampm != "p")) {
- // var startTime = paseToFullTime(comment.startTime);
- // var endTime = paseToFullTime(comment.endTime);
- // if (range(startTime, endTime)) {
- // ampm = comment.code;
- // }
- // }
- });
- $('#ampm').empty(); //清空resText里面的所有内容
- $('#ampm').html(html);
- $('#ampm').selectpicker('refresh');
- // $("#ampm").selectpicker('val', ampm);
- // $('#ampm').selectpicker('refresh');
- initDeptPlus(1);
- }
- });
- }
- /**
- * 初始科室下拉选
- * @param ampm 时间段区间
- */
- function initDeptPlus(type) {
- var ampm = $("#ampm").val();
- if (type == 1) {
- setAmTimes(ampm);
- }
- $("#deptNo").selectpicker({
- size: 10
- });
- var apTimes = $("#apTimes").val();
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByRequestDayAndAmpm?ampm=' + $("#ampm").val() + '&date=' + $("#registrationTime").val() + "&apTimes=" + apTimes,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#deptNo').empty();
- $('#deptNo').html(html);
- $('#deptNo').selectpicker('refresh');
- $('#chargeType').empty();
- $('#chargeType').selectpicker('refresh');
- emptyInput();
- }
- });
- }
- /**
- * 设置时间下拉选
- * @param ampm
- */
- function setAmTimes(ampm) {
- if (ampm == "a" || ampm == "p") {
- $("#apTimesDiv").removeClass("hide").addClass("in");
- $("#doctorDiv").css("margin-top", "10px");
- var timeHtml = null;
- var defaultTime = null;
- var date = new Date($("#registrationTime").val());
- var currentDate = getCurrentDate();
- var afterToday = date.getTime() > currentDate.getTime();
- if (ampm == "a") {
- if (afterToday || range(paseToFullTime("00:00"), paseToFullTime("08:30"))) {
- defaultTime = "a1";
- 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>';
- } else if (range(paseToFullTime("08:30"), paseToFullTime("09:00"))) {
- defaultTime = "a2";
- 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>';
- } else if (range(paseToFullTime("09:00"), paseToFullTime("09:30"))) {
- defaultTime = "a3";
- 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>';
- } else if (range(paseToFullTime("09:30"), paseToFullTime("10:00"))) {
- defaultTime = "a4";
- 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>';
- } else if (range(paseToFullTime("10:00"), paseToFullTime("10:30"))) {
- defaultTime = "a5";
- 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>';
- } else if (range(paseToFullTime("10:30"), paseToFullTime("11:00"))) {
- defaultTime = "a6";
- 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>';
- } else if (range(paseToFullTime("11:00"), paseToFullTime("11:30"))) {
- defaultTime = "a7";
- timeHtml = '<option value="a7">11:00-11:30</option><option value="a8">11:30-12:00</option>';
- } else if (range(paseToFullTime("11:30"), paseToFullTime("12:00"))) {
- defaultTime = "a8";
- timeHtml = '<option value="a8">11:30-12:00</option>';
- }
- } else {
- if (afterToday || range(paseToFullTime("00:00"), paseToFullTime("14:30"))) {
- defaultTime = "p1";
- 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>';
- } else if (range(paseToFullTime("14:30"), paseToFullTime("15:00"))) {
- defaultTime = "p2";
- 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>';
- } else if (range(paseToFullTime("15:00"), paseToFullTime("15:30"))) {
- defaultTime = "p3";
- 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>';
- } else if (range(paseToFullTime("15:30"), paseToFullTime("16:00"))) {
- defaultTime = "p4";
- 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>';
- } else if (range(paseToFullTime("16:00"), paseToFullTime("16:30"))) {
- defaultTime = "p5";
- 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>';
- } else if (range(paseToFullTime("16:30"), paseToFullTime("17:00"))) {
- defaultTime = "p6";
- timeHtml = '<option value="p6">16:30-17:00</option><option value="p7">17:00-17:30</option>';
- } else if (range(paseToFullTime("17:00"), paseToFullTime("17:30"))) {
- defaultTime = "p7";
- timeHtml = '<option value="p7">17:00-17:30</option>';
- }
- }
- $('#apTimes').html(timeHtml);
- $('#apTimes').selectpicker('refresh');
- $("#apTimes").selectpicker('val', defaultTime);
- $('#apTimes').selectpicker('refresh');
- $("#chargeTypeDiv").css("margin-top", "10px");
- $("#apTimesDiv").removeClass("hide").addClass("in");
- } else {
- $("#apTimes").selectpicker('val', null);
- $('#apTimes').selectpicker('refresh');
- $("#apTimesDiv").removeClass("in").addClass("hide");
- $("#chargeTypeDiv").css("margin-top", "0px");
- }
- }
- /**
- * 初始门诊号别下拉选
- */
- function initChargeType() {
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeTypeByRequestDayAndDoctor?unitCode=' + $('#deptNo').val() + "&m=" + $("#ampm").val() + '&date=' + $("#registrationTime").val() + "&apTime=" + $("#apTimes").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var defaultCode = null;
- $.each(res.data, function (commentIndex, comment) {
- if (res.data.length == 1) {
- //如果只有一个号别,默认选中
- defaultCode = comment.code;
- }
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#chargeType').empty(); //清空resText里面的所有内容
- $('#chargeType').html(html);
- $('#chargeType').selectpicker('refresh');
- if (defaultCode != null) {
- //如果有默认选项,默认选择
- $('#chargeType').selectpicker('val', defaultCode);
- $('#chargeType').selectpicker('refresh');
- initDoctorInfo();
- }
- emptyInput();
- }
- });
- }
- /**
- * 初始医生下拉选
- * @param ampm 时间段区间
- */
- function initDoctorInfo() {
- $("#doctorInfo").selectpicker({
- size: 10
- });
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getDoctorCodeByRequestDayAndDoctor?unitCode=' + $('#deptNo').val() + "&m=" + $("#ampm").val() + "&chargeType=" + $("#chargeType").val() + '&date=' + $("#registrationTime").val() + "&apTime=" + $("#apTimes").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var defaultCode = null;
- $.each(res.data, function (commentIndex, comment) {
- var employeeName = comment.employee.employeeName;
- if (comment.leftNum != null) {
- employeeName = employeeName + " 余号(" + comment.leftNum + ")"
- }
- html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + employeeName + '</option>';
- if (res.data.length == 1) {
- //如果只有一个号别,默认选中
- defaultCode = comment.employee.employeeCode;
- }
- });
- $('#doctorInfo').empty();
- $('#doctorInfo').html(html);
- $('#doctorInfo').selectpicker('refresh');
- //validator.checkAll($("#regi_form"));
- if (defaultCode != null) {
- //如果有无需选择医生的选项,默认选择
- $('#doctorInfo').selectpicker('val', defaultCode);
- $('#doctorInfo').selectpicker('refresh');
- fitFee();
- }
- }
- });
- }
- /**
- * 设置挂号费等费用
- */
- function fitFee() {
- var mzyRequestId = $('#doctorInfo').find("option:selected").attr('data-mzyRequestId');
- var checkFee = $('#doctorInfo').find("option:selected").attr('data-checkFee');
- $("#checkFee").val(checkFee);
- $("#totalFee").val(checkFee);
- $.ajax({
- type: "GET",
- url: '/thmz/getMzChargeTypeByMzyRequestId?mzyRequestId=' + mzyRequestId + "&birthDay=&patientId=" + $("#patientIdRegistration").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#registrationFee").val(res.data.reqFee);
- $("#hospitalFee").val(res.data.clinicFee);
- $("#othFee").val(parseFloat(res.data.othFee) - parseFloat(checkFee));
- checkFee = parseFloat(res.data.reqFee) + parseFloat(res.data.clinicFee) + parseFloat(res.data.othFee);
- $("#totalFee").val(checkFee);
- }
- });
- }
- /**
- * 科室与时间区间下拉选改变时清空输入框内容
- */
- function emptyInput() {
- $('#doctorInfo').empty();
- $('#doctorInfo').selectpicker('refresh');
- $("#registrationFee").val(0.00);
- $("#hospitalFee").val(0.00);
- $("#checkFee").val(0.00);
- $("#othFee").val(0.00);
- $("#totalFee").val(0.00);
- }
- /**
- * 科室与时间区间下拉选改变时清空输入框内容
- */
- function clearRegistrationModal() {
- $("#patientIdRegistration").val(null);
- $("#registrationTime").val(null);
- $('#ampm').selectpicker('val', null);
- $('#ampm').selectpicker('refresh');
- $('#deptNo').empty();
- $('#deptNo').selectpicker('refresh');
- $('#chargeType').empty();
- $('#chargeType').selectpicker('refresh');
- $('#doctorInfo').empty();
- $('#doctorInfo').selectpicker('refresh');
- $('#apTimes').empty();
- $('#apTimes').selectpicker('refresh');
- $("#registrationFee").val(0.00);
- $("#hospitalFee").val(0.00);
- $("#checkFee").val(0.00);
- $("#othFee").val(0.00);
- $("#totalFee").val(0.00);
- }
- /**
- * 保存挂号信息
- */
- function saveMzyReqrecUnPay() {
- $("#registrationModal").modal('hide');
- $("#messageModal").modal();
- $("#messageContent").html("确定提交本次预约挂号申请吗?");
- $("#messageButton").off("click").bind("click", function (t) {
- $("#messageModal").modal('hide');
- realSaveMzyReqrecUnPay();
- });
- $("#cancelButton").off("click").bind("click", function (t) {
- $("#messageModal").modal('hide');
- $("#registrationModal").modal();
- });
- }
- /**
- * 保存挂号信息
- */
- function realSaveMzyReqrecUnPay() {
- $("#saveRegistration").attr("disabled", true);
- var mzyRequestId = $('#doctorInfo').find("option:selected").attr('data-mzyRequestId');
- var patientId = $("#patientIdRegistration").val();
- var totalFee = $("#totalFee").val();
- $.ajax({
- type: "POST",
- url: '/thmz/saveMzyReqrec',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "mzyReqrec": {
- "patientId": patientId,
- "ampm": $("#ampm").val(),
- "apTime": $("#apTimes").val(),
- "unitCode": $("#deptNo").val(),
- "chargeType": $("#chargeType").val(),
- "requestDayStr": $("#registrationTime").val()
- }, "mzyRequestId": mzyRequestId, "totalFee": totalFee, "payMark": "5"
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- clearRegistrationModal();
- $("#registrationModal").modal('hide');
- } else {
- errorMesage(res);
- }
- $("#saveRegistration").attr("disabled", false);
- }
- });
- }
- //打开门诊电子病历
- function openEmr() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzjsdHost',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- let times = $("#visitTimes").val();
- let patientId = $("#patientId").text();
- if(stringIsBlank(patientId)){
- return errorMesageSimaple('门诊号不能为空,请先接诊')
- }
- let age = $("#patientAge").text();
- let sex= $("#patientGender").text();
- let userIdCode = localStorage.getItem("userIdCode");
- let patNo = window.btoa(JSON.stringify({
- patientId:patientId,
- times: Number(times),
- userIdCode:userIdCode
- })
- )
- window.open(`${res.data}/mzEmr/${patNo}`, '_blank');
- }
- }
- });
- }
- //省影像平台(影像报告调阅)
- function YX01() {
- let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
- let params = {
- url: 'http://20.30.1.81/openapi/api/v2/study/create/url',
- reqBody: {
- "organ_code":"52321300510430043N",
- "organ_name":"沭阳铭和医院",
- "app_dpt_code":$("#deptCode").val(),
- "app_dpt_name":$("#deptName").val(),
- "app_doc_loginid": localStorage.getItem("userID"),
- "app_doc_idcard": localStorage.getItem("socialNo"),
- "app_doc_name": localStorage.getItem("userName"),
- "organ_empi": $("#patientId").text(), //院内患者主索引
- "op_em_hp_ex_mark": "门诊", //非必传 门诊/急诊/住院/体检标志
- "ghxh_no": null, //非必传 院内就诊挂号序号
- "cardtype": cardType,
- "cardno": $("#identityNo").val(),
- "name": $("#patientName").text(),
- "mobile": $("#mobile").val(),
- "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
- "birthday": null,// 非必传 yyyy-mm-dd
- "idcard_hos": null, //非必传 医保卡号
- "permissions_code":"IIS", //鉴权平台标识
- "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
- "region": null //非必传
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/YxYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code == 200) {
- viewRecordId = res.data.view_record_id
- let url = decodeURIComponent(res.data.url.transport_protocol + "://" + res.data.url.domain + "/" + res.data.url.path)
- window.open(url, '_blank');
- } else {
- // errorMesage(res);
- }
- },
- error: function(xhr, textStatus, errorThrown) {
- console.error("失败状态:", xhr.status);
- console.error("错误:", errorThrown);
- }
- });
- }
- //省影像平台(患者近期检查项目数量查询接口)
- function YX02() {
- console.log('YX02-----------------------------------',$("#patientId").text(),viewRecordId)
- if (!$("#patientId").text() || notFirstYX02 || hasJcInYx) {
- return false
- }
- notFirstYX02 = true
- let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
- let params = {
- url: 'http://20.30.1.81/openapi/api/v2/study/shorttime/list/total',
- reqBody: {
- "organ_code":"52321300510430043N",
- "organ_name":"沭阳铭和医院",
- "app_dpt_code":$("#deptCode").val(),
- "app_dpt_name":$("#deptName").val(),
- "app_doc_loginid": localStorage.getItem("userID"),
- "app_doc_idcard": localStorage.getItem("socialNo"),
- "app_doc_name": localStorage.getItem("userName"),
- "organ_empi": $("#patientId").text(), //院内患者主索引
- "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
- "ghxh_no": '', //非必传 院内就诊挂号序号
- "cardtype": cardType,
- "cardno": $("#identityNo").val(),
- "name": $("#patientName").text(),
- "mobile": $("#mobile").val(),
- "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
- "birthday": '',// 非必传 yyyy-mm-dd
- "idcard_hos": '', //非必传 医保卡号
- "permissions_code":"IIS", //鉴权平台标识
- "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
- "region": '' //非必传
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/YxYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code == 200) {
- if (res.data && res.data.total_num > 0) {
- hasJcInYx = true
- viewRecordId = res.data.view_record_id
- }
- } else {
- // errorMesage(res);
- }
- },
- error: function(xhr, textStatus, errorThrown) {
- console.error("失败状态:", xhr.status);
- console.error("错误:", errorThrown);
- }
- });
- }
- //省影像平台(患者近期类似检查项目接口)
- function YX03(yxItemArr) {
- console.log('YX03-----------------------------------')
- let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
- let params = {
- url: 'http://20.30.1.81/openapi/api/v2/mutual/project/notice',
- reqBody: {
- "organ_code":"52321300510430043N",
- // "organ_name":"沭阳铭和医院",
- // "app_dpt_code":$("#deptCode").val(),
- "app_doc_loginid": localStorage.getItem("userID"),
- "app_doc_idcard": localStorage.getItem("socialNo"),
- "app_doc_name": localStorage.getItem("userName"),
- "source": "沭阳铭和医院",
- "permissions_code":"IIS", //鉴权平台标识
- "app_dpt_name":$("#deptName").val(),
- "organ_empi": $("#patientId").text(), //院内患者主索引
- "name": $("#patientName").text(),
- "cardtype": cardType,
- "cardno": $("#identityNo").val(),
- "mobile": $("#mobile").val(),
- "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
- // "birthday": null,// 非必传 yyyy-mm-dd
- // "idcard_hos": null, //非必传 医保卡号
- "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
- // "ghxh_no": null, //非必传 院内就诊挂号序号
- "project_list": yxItemArr,
- // [{
- // "chk_modality": "ct", //非必传 检查设备类型:ct、dr或mri
- // "proj_name": "",
- // "hos_medi_no": "", //非必传 检查项目医保编码
- // "hos_proj_no": "", //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
- // "ckpt_name": "", //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
- // "chk_methodname": "", //非必传 检查方法名称
- // "chk_advice": "", //检查申请名称
- // }]
- "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
- "region": null //非必传
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/YxYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code == 200) {
- if (res.data.totalNum && parseInt(res.data.totalNum) > 0) {
- jcItemList = yxItemArr.map(i=> i.proj_name)
- $("#jcJyModal").modal();
- $("#jcJyModalTitle").html("省影像平台提示您");
- $("#jcJyModalContent").html("当前患者在省影像平台中有类似检查记录,可前往查看详情!");
- $("#jcJyModalButton").off("click").on("click", function (t) {
- $("#jcJyModal").modal("hide");
- let url = decodeURIComponent(res.data.url.transport_protocol + "://" + res.data.url.domain + "/" + res.data.url.path)
- window.open(url, '_blank');
- });
- $("#jcJySubmitModalButton").off("click").on("click", function (t) {
- $("#jcJyModal").modal("hide");
- savePrescription()
- });
- $("#jcJyModalCancelButton").off("click").on("click", function (t) {
- jcItemList = yxItemArr.map(i=> i.proj_name)
- });
- } else {
- savePrescription()
- }
- } else {
- savePrescription()
- }
- },
- error: function(xhr, textStatus, errorThrown) {
- // console.error("失败状态:", xhr.status);
- // console.error("错误:", errorThrown);
- savePrescription()
- }
- });
- }
- //省影像平台(开单回执接口,用于院端HIS系统返回医生实际开单的详情,并存证到省“影像平台”内)
- function YX04() {
- //辅助检查
- var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
- let hasYxData = false;
- let yxItemArr = [];
- if (jcjyTabContents != null && jcjyTabContents.length > 0) {
- for (var i = 0; i < jcjyTabContents.length; i++) {
- //项目类型
- var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
- //检查
- if (itemsType == "2" || itemsType == 2) {
- //影像云平台处理数据
- hasYxData = true
- let ckpt = $("#yshPart").val() && $("#yshPart").val() !== '' ? $("#yshPart").val() : $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val();
- let tempYxObj= {
- // "chk_modality": null, //非必传 检查设备类型:ct、dr或mri
- "proj_name": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(),
- // "hos_medi_no": "", //非必传 检查项目医保编码
- "hos_proj_no": $(jcjyTabContents[i]).find("input.temporary_items_code").val(), //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
- "hos_proj_price": $(jcjyTabContents[i]).find("input.temporary_items_amount").val(), //检查项目院内价格
- "ckpt_name": ckpt, //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
- // "chk_methodname": "", //非必传 检查方法名称
- "chk_advice": $(jcjyTabContents[i]).find("input.temporary_items_jcJyItemName").val(), //检查申请名称
- }
- yxItemArr.push(tempYxObj)
- }
- }
- }
- let cardType = handleYxCardType($("#rapidAcceptsUserCertificateType").val())
- let params = {
- url: 'http://20.30.1.81/openapi/api/v2/mutual/project/callback',
- reqBody: {
- "view_record_id": viewRecordId, //记录医生一次调阅的唯一标识
- "organ_code":"52321300510430043N",
- "app_doc_loginid": localStorage.getItem("userID"),
- "study_request_time": getCurrentDateTimeISO(), //请求时间 yyyy-mm-dd hh:mm:ss
- "app_doc_idcard": localStorage.getItem("socialNo"),
- "app_doc_name": localStorage.getItem("userName"),
- "source": "沭阳铭和医院",
- "permissions_code":"IIS", //鉴权平台标识
- "app_dpt_name":$("#deptName").val(),
- "organ_empi": $("#patientId").text(), //院内患者主索引
- "name": $("#patientName").text(),
- "cardtype": cardType,
- "cardno": $("#identityNo").val(),
- "mobile": $("#mobile").val(),
- "sex": parseInt($("#sex").val()), //非必传 0:未知 1:男 2:女 9:未说明
- "birthday": null,// 非必传 yyyy-mm-dd
- "idcard_hos": null, //非必传 医保卡号
- "op_em_hp_ex_mark": "门诊", // 门诊/急诊/住院/体检标志
- "project_list": yxItemArr,
- // "project_list": [
- // {
- // "chk_modality": null, //非必传 检查设备类型:ct、dr或mri
- // "proj_name": "",
- // "hos_medi_no": "", //非必传 检查项目医保编码
- // "hos_proj_no": "", //检查项目院内编码(重复检查提醒收集的院内检查项目清单细项编码)
- // "hos_proj_price": "", //检查项目院内价格
- // "ckpt_name": "", //检查部位(如果院内工作站目录中没有单独的检查部位字段,则上传检查项目字段)
- // "chk_methodname": "", //非必传 检查方法名称
- // "chk_advice": "", //检查申请名称
- // }
- // ],
- "region": null //非必传
- }
- }
- console.log('YX04----params----',params)
- return
- $.ajax({
- type: "POST",
- url: '/thmz/YxYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code == 200) {
- console.log(res.message)
- } else {
- console.error(res);
- }
- },
- error: function(xhr, textStatus, errorThrown) {
- console.error("失败状态:", xhr.status);
- console.error("错误:", errorThrown);
- }
- });
- }
- //省临床检验平台(检验云报告调阅)
- function HR01() {
- return
- // console.log('HR01-----------------------------------')
- let identityTypeCode = handleIdentityTypeCode($("#rapidAcceptsUserCertificateType").val())
- let diagCode = []
- let diagName = []
- $("#diagnoseTags").children("span").each(function() {
- var title = $(this).attr("title");
- var id = $(this).attr("id");
- diagCode.push(id)
- diagName.push(title)
- // console.log("Span - ID: " + id + ", Title: " + title);
- });
- let params = {
- url: 'http://20.46.201.94:9999/pmemr/productMutualRecognition/getCrossUrl',
- reqBody: {
- " messages": {
- "EVN": {
- "eventTypeCode": "01",
- "eventTypeName": "可互认报告查询服务"
- },
- "PID": {
- "patientId": $("#patientId").text(),
- "identityTypeCode": identityTypeCode,
- "identityNo": $("#identityNo").val(),
- "visitCardTypeCode": "94", // 院内就诊卡
- "visitCardNo": $("#visitCardNo").val(),
- "personalName": $("#patientName").text(),
- "birthDate": formatDateToDate8(new Date(($("#birthDay").val()))),
- "sexCode": $("#sex").val(),
- "mobile": $("#mobile").val()
- },
- "PV1": {
- "visitTypeCode": "1", //门诊
- "visitNo": $("#mzfzSerialNoInClick").val(),
- "visitDate": formatDateToDate8(new Date()),
- "orgCode": "321322049",
- "orgName": "沭阳铭和医院",
- "deptCode": $("#deptCode").val(),
- "deptName": $("#deptName").val(),
- "wardCode": "",
- "wardName": "",
- "bedNo": "",
- "doctorId": localStorage.getItem("userID"),
- "doctorName": localStorage.getItem("userName"),
- "doctorIdentityNo": localStorage.getItem("socialNo"),
- "computerMac": "",
- "computerIp": ""
- },
- "DG1":
- {
- "chiefCompliant": $("#symptom").val(),
- "diagCode": diagCode.join(","),
- "diagName": diagName.join(",")
- }
- }
- }
- }
- console.log('reqBody:',params.reqBody)
- $.ajax({
- type: "POST",
- url: '/thmz/JyYunAPI',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- console.log('res----',res)
- if (res.code == 0) {
- } else {
- errorMesage(res);
- }
- }
- });
- }
- function getCurrentDateTimeISO() {
- const now = new Date();
- const isoString = now.toISOString();
- return isoString
- .replace('T', ' ')
- .replace(/\.\d{3}Z/, '')
- .slice(0, 19);
- }
- function formatDateToDate8(date) {
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- return `${year}${month}${day}`;
- }
- function handleYxCardType(val) {
- let identityTypeCodeMap = {
- '01': '1',
- '02': '2',
- '03': '3',
- '04': '4',
- '05': '4',
- '06': '5',
- '07': '9',
- '08': '6',
- '09': '9',
- '10': '9',
- '11': '9',
- '12': '9',
- '13': '9',
- '14': '9',
- '15': '9',
- '16': '9',
- '17': '9',
- '90': '1',
- '99': '9',
- '990102': '9',
- '990201': '9'
- // yx:
- // 1 居民身份证
- // 2 中国人民解放军军人身份证件
- // 3 中国人民武装警察身份证件
- // 4 港澳居民来往内地通行证 仅限港澳居民使用
- // 5 台湾居民来往大陆通行证 仅限台湾居民使用
- // 6 护照 仅限外籍人员使用
- // 9 其他
- //his:
- // JMSFZ("01","居民身份证(户口簿)"),
- // ZGRMJFJJGZ("02","中国人民解放军军官证"),
- // ZGRMWZJCJGZ("03","中国人民武装警察警官证"),
- // XGTQHZ("04","香港特区护照/港澳居民来往内地通行证"),
- // AMTQHZ("05","澳门特区护照/港澳居民来往内地通行证"),
- // TWJMLWNDTXZ("06","台湾居民来往内地通行证"),
- // WGRYJJLZ("07","外国人永久居留证"),
- // WGRHZ("08","外国人护照"),
- // CJRZ("09","残疾人证"),
- // JLSZM("10","军烈属证明"),
- // WGRJYZ("11","外国人就业证"),
- // WGZJZ("12","外国专家证"),
- // WGCZJZZ("13","外国常驻记者证"),
- // TGARYKYZ("14","台港澳人员就业证"),
- // HGLHDJZJZ("15","回国(来华)定居专家证"),
- // ZGHZ("16","中国护照"),
- // GATJMJZZ("17","港澳台居民居住证"),
- // SHBZK("90","社会保障卡"),
- // QTSFZJ("99","其他身份证件"),
- // POVERTY_CODE("990102", "扶贫人口编码"),
- // MEDICAL_BIRTH_CERT("990201", "医学出生证明");
- }
- return identityTypeCodeMap[val];
- }
- function handleIdentityTypeCode(val) {
- let identityTypeCodeMap = {
- '01': '01',
- '02': '04',
- '03': '99',
- '04': '06',
- '05': '06',
- '06': '07',
- '07': '99',
- '08': '03',
- '09': '99',
- '10': '99',
- '11': '99',
- '12': '99',
- '13': '99',
- '14': '99',
- '15': '99',
- '16': '03',
- '17': '99',
- '90': '91',
- '99': '99',
- '990102': '99',
- '990201': '99'
- }
- return identityTypeCodeMap[val];
- }
- //打开pacs检查
- function openPacsJc() {
- getAjaxRequst("/thmz/getPacsUrl",{},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0 ){
- let patientId = $("#patientId").text();
- let pacsurl = res.data +"?patient_no="+patientId
- window.open(pacsurl, '_blank');
- }else {
- errorMesage(res)
- }
- })
- }
- //打开检查检验
- function openJcJyPacsModal() {
- $("#previewJcJyPacsModal").modal()
- getAjaxRequst("/thmz/getMzjsdHost",{},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0){
- let userIdCode = localStorage.getItem("userIdCode");
- let patNo = $("#patientId").text();
- let end = format(new Date(),'yyyy-MM-dd')
- let start = format(getPreviousDays(new Date(),30),'yyyy-MM-dd')
- let showUrl = `${res.data}/jumpRedirect?url=%2FinspectionResult%3FpatNo%3D${patNo}%26start%3D${start}%26end%3D${end}&code=${userIdCode}`
- $("#jyjcpacsDiv").attr("src", showUrl);
- }
- })
- }
- function openDiscountLv() {
- $("#discountLvModal").modal();
- postAjaxJsonHttpRequst("/thmz/queryDiscountLv",{patientId: $("#patientId").text()},true,function (res) {
- if(res.code == 0){
- if(res.data != null){
- $("#discountLv").val(res.data)
- $('#discountLv').selectpicker('refresh');
- }
- }else {
- errorMesage(res)
- }
- })
- }
- //保存股东卡优先级
- function saveDiscountLv() {
- postAjaxJsonHttpRequst("/thmz/updateDiscountLv",{patientId: $("#patientId").text(),discountLv : $("#discountLv").val()},true,function (res) {
- if(res.code == 0){
- successMesageSimaple("修改成功")
- $("#discountLvModal").modal("hide");
- }else {
- errorMesage(res)
- }
- })
- }
- //打开医技预约
- function openYjYyModal() {
- getAjaxRequst("/thmz/getYjYyUrl",{},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0 ){
- let patientId = $("#patientId").text();
- let yjyyUrl = res.data +"?MZH="+patientId
- window.open(yjyyUrl, '_blank');
- }else {
- errorMesage(res)
- }
- })
- }
- function getPreviousDays(date, days) {
- var prevDate = new Date(date); // 创建一个与指定日期相同的新日期对象
- prevDate.setDate(date.getDate() - days); // 将日期设置为前几天(days)的日期
- return prevDate;
- }
- function stringIsBlank(val) {
- try {
- val = val.trim()
- } catch {
- }
- return typeof val === 'undefined' || val === null || val === ''
- }
- //是否开启复制粘贴
- function initCopy() {
- getAjaxRequst("/thmz/initCopy",{},true,function (res) {
- if(res.code == -1){
- document.oncontextmenu = function(event){
- event.returnValue = false;
- }
- document.onkeydown = function(event){
- if(event.ctrlKey && window.event.keyCode == 67){
- return false;
- }
- if(event.ctrlKey && window.event.keyCode == 86){
- return false;
- }
- }
- }else {
- document.oncontextmenu = function(event){
- event.returnValue = true;
- }
- document.onkeydown = function(event){
- if(event.ctrlKey && window.event.keyCode == 67){
- return true;
- }
- if(event.ctrlKey && window.event.keyCode == 86){
- return true;
- }
- }
- }
- })
- }
|