SMPIJ00300.js 312 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726
  1. // =================================================================================================
  2. // - 2009.04.27 Creation JHP
  3. //==================================================================================================
  4. /* --------------------------------------------------------------------------------------------------
  5. Fucntion Name || Description
  6. -----------------------------------------------------------------------------------------------------
  7. 2009.07.23 JHP
  8. 심사화면 환자 메세지 여부확인: fGetPatMsgYn
  9. 환자기준 전송메세지작성 : fPatJudgPatMsgTrsm
  10. 처방기준 전송메세지작성 : fOrderJudgPatMsgTrsm
  11. 해당건 환자 전체 메세지 보기 : fJudgPatMsgTrsmRef
  12. 2009.08.13 JHP
  13. 처방사유조회 : fPrcpResnRef
  14. 환자번호 첫자리 문자인경우 환자번호로 인식 fChkPidWordNumber
  15. */
  16. // 수정이력 :
  17. // 20090811 수정추가 JHP, 변경요청 858 재원심사에서 계산처방 조회시 진료과는 전체로 넘겨야함. 하여 기존 것. 주석, 빈값 넘김으로 수정
  18. // 20090811 수정추가 JHP, 변경요청 858 재원심사에서 계산처방 조회시 진료과는 전체로 넘겨야함. 진료과별 의사를 보기때문에 의사도 일단 전체로 해놓음.
  19. // 20090817 수정추가 JHP, 수정요청 계산처방시행조회 화면 edicd 조회조건에 존재하기에 추가함. 없으면 singlenode 에러남.
  20. var VAL_today = getCurrentDate();
  21. var VAL_fromdd = VAL_today.toDate().getAddDate(-6,"M").getDateFormat("YYYYMM");
  22. var VAL_userid = getUserId();
  23. var VAL_usernm = getUserName();
  24. function fOpenSMPIS00500Detail() {
  25. model.makeValue("/root/hidden/smpis00500/cond/patunitsrch", model.getValue("/root/main/item1/iteminfo/pid"));
  26. model.makeValue("/root/hidden/smpis00500/cond/code", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd")));
  27. model.makeValue("/root/hidden/smpis00500/cond/datecond", "");
  28. model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/item1/iteminfo/indd1"));
  29. model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/item1/iteminfo/dschdd"));
  30. model.makeValue("/root/hidden/smpis00500/cond/ioflag", "I");
  31. model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", "");
  32. model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
  33. model.makeValue("/root/hidden/smpis00500/cond/codecond", "");
  34. model.makeValue("/root/hidden/smpis00500/cond/judgrid", "");
  35. model.makeValue("/root/hidden/smpis00500/cond/cancer", "");
  36. model.makeValue("/root/hidden/smpis00500/cond/large", "");
  37. model.makeValue("/root/hidden/smpis00500/cond/middle", "");
  38. model.makeValue("/root/hidden/smpis00500/cond/small", "");
  39. model.makeValue("/root/hidden/smpis00500/cond/edicd", "");
  40. modal("SMPIS00500", "1", "10", "10", "SMPIS00500", "/root/hidden/smpis00500/cond", "/root/send", "", "");
  41. }
  42. function fOpenSMPIS00600Detail() {
  43. fOpenSMPIS00600Call("false");
  44. }
  45. function fOpenSMPIS00600Detail2() {
  46. fOpenSMPIS00600Call("true");
  47. }
  48. function fOpenSMPIS00600Call(cutonly) {
  49. model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", model.getValue("/root/main/item1/iteminfo/pid"));
  50. model.makeValue("/root/hidden/smpis00600/cond/code", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd")));
  51. model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
  52. model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", VAL_fromdd);
  53. model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
  54. model.makeValue("/root/hidden/smpis00600/cond/clamymto", VAL_today);
  55. model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
  56. model.makeValue("/root/hidden/smpis00600/cond/clamflag", "");
  57. model.makeValue("/root/hidden/smpis00600/cond/ioflag", "I");
  58. model.makeValue("/root/hidden/smpis00600/cond/insukind", model.getValue("/root/main/item1/iteminfo/insukindcd"));
  59. model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", model.getValue("/root/main/item1/iteminfo/orddeptcd"));
  60. model.makeValue("/root/hidden/smpis00600/cond/orddrid", model.getValue("/root/main/item1/iteminfo/medispclid"));
  61. model.makeValue("/root/hidden/smpis00600/cond/cutonly", cutonly);
  62. modal("SMPIS00600", "1", "10", "10", "SMPIS00600", "/root/hidden/smpis00600/cond", "/root/send", "", "");
  63. }
  64. //화면 open시(와 초기화 버튼 클릭시) 화면 초기화 기능을 수행한다.
  65. function fInitialize() {
  66. // 공통코드를 조회한다.
  67. zbcfGetCodeList(
  68. new Array("P0111","P0110","P0112","P0008","P0010","P0117","P0506","P0551"),
  69. new Array("/root/init/P0111list","/root/init/P0110list","/root/init/P0112list","/root/init/P0008list","/root/init/P0010list","/root/init/P0117list","/root/init/P0506list","/root/init/P0551list"), false );
  70. model.setValue("/root/send/listval/uuee/scrnid","SMPIJ00300");
  71. // 2013.02.19 - 부가코드 원무공통코드조회
  72. pamfGetCodeList(new Array(
  73. "PK029"
  74. ),
  75. new Array("/root/init/PAM/PK029list"
  76. ));
  77. if ( submit("TRPIJ00407",false) ) {
  78. var grd_name = model.getValue("/root/hidden/listval/uuee[compsnm='grd_ordlist']/compsnm");
  79. var refdata = model.getValue("/root/hidden/listval/uuee[compsnm='grd_ordlist']/compscnts");
  80. var sizedata = model.getValue("/root/hidden/listval/uuee[compsnm='grd_ordlist']/compssizecnts");
  81. var diag_grd_name = model.getValue("/root/hidden/listval/uuee[compsnm='grd_diaglist']/compsnm");
  82. var diag_refdata = model.getValue("/root/hidden/listval/uuee[compsnm='grd_diaglist']/compscnts");
  83. var diag_sizedata = model.getValue("/root/hidden/listval/uuee[compsnm='grd_diaglist']/compssizecnts");
  84. if (grd_name != "") {
  85. setOrderInfoOfCol("grd_ordlist",refdata,sizedata);
  86. }
  87. if (diag_grd_name != "") {
  88. setOrderInfoOfCol("grd_diaglist",diag_refdata,diag_sizedata);
  89. }
  90. }
  91. // model.refresh(); - 불필요해서 제거 - 20080731 박창원
  92. fSetRdoReset();
  93. btn_clspcd.selected = true;
  94. // 20091109 JHP 심사메모버튼으로 변경시 case도 심사메모에 해당하는 것으로 변경해야함.
  95. model.toggle("case_spclspec");
  96. model.setValue("/root/send/totalsumflag", "Y");
  97. model.setValue("/root/send/unitflag", "-");
  98. btn_attData.attribute("class") = "btn2_letter4";
  99. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  100. model.setValue("/root/send/indd",indd);
  101. model.setValue("/root/send/curdd",VAL_today);
  102. submit("TRPIJ00305",false);
  103. // 코딩을 위하여 임사로 모든 권한을 준다.
  104. //model.setValue("/root/hidden/properties/auth", "11100000");
  105. // (common.js) 현재 로그인한 사용자 번호(ID)
  106. model.makevalue("/root/hidden/userid",VAL_userid);
  107. model.makevalue("/root/hidden/usernm",VAL_usernm);
  108. }
  109. /* 대상자조회에서 대상자 선택하여 넘어올때 메세지 여부 확인, JHP. 2009.07.23 */
  110. function fGetPatMsgYn(){
  111. var cnt = getNodesetCount("/root/main/msglist/list");
  112. if(cnt > 0){
  113. img_msg.visible = true;
  114. }else{
  115. img_msg.visible = false;
  116. }
  117. }
  118. /* 환자기준 전송메세지작성, JHP. 2009.07.16 */
  119. function fPatJudgPatMsgTrsm() {
  120. if (!isNull(model.getvalue("/root/main/item1/iteminfo/pid"))) {
  121. fMsgTrsmMakeNode("P");
  122. } else {
  123. messageBox("기본정보가 ", "I004");
  124. }
  125. model.refresh();
  126. modal("SPPIZ01900_심사환자메세지작성", "", "400", "300", "", "/root/tmp/msgtrsm/info", "/root/main/patinfo");
  127. model.removenode("/root/tmp/msgtrsm");
  128. }
  129. /* 처방기준 전송메세지작성, JHP. 2009.07.16 */
  130. function fOrderJudgPatMsgTrsm() {
  131. if (!isNull(model.getvalue("/root/main/item1/iteminfo/pid"))) {
  132. if(grd_ordlist.row <= 0){
  133. return;
  134. }
  135. fMsgTrsmMakeNode("O");
  136. } else {
  137. messageBox("기본정보가 ", "I004");
  138. }
  139. model.refresh();
  140. modal("SPPIZ01900_심사환자메세지작성", "", "400", "300", "", "/root/tmp/msgtrsm/info", "/root/main/patinfo");
  141. model.removenode("/root/tmp/msgtrsm");
  142. }
  143. function fMsgTrsmMakeNode(kindflag) {
  144. // 인스턴스생성
  145. model.makeValue("/root/tmp/msgtrsm/info/instcd", "");
  146. model.makeValue("/root/tmp/msgtrsm/info/msgwrtedd", VAL_today);
  147. model.makeValue("/root/tmp/msgtrsm/info/msgwrteno", "");
  148. model.makeValue("/root/tmp/msgtrsm/info/msgwrtehistno", "");
  149. model.makeValue("/root/tmp/msgtrsm/info/histstat", "Y");
  150. model.makeValue("/root/tmp/msgtrsm/info/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  151. model.makeValue("/root/tmp/msgtrsm/info/orddd", model.getValue("/root/main/item1/iteminfo/indd1"));
  152. model.makeValue("/root/tmp/msgtrsm/info/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  153. model.makeValue("/root/tmp/msgtrsm/info/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  154. model.makeValue("/root/tmp/msgtrsm/info/orddeptcd", model.getValue("/root/main/item1/iteminfo/orddeptcd"));
  155. model.makeValue("/root/tmp/msgtrsm/info/orddrid", model.getValue("/root/main/item1/iteminfo/medispclid"));
  156. model.makeValue("/root/tmp/msgtrsm/info/orddrnm", model.getValue("/root/main/item1/iteminfo/medispclnm"));
  157. model.makeValue("/root/tmp/msgtrsm/info/ordtype", "I");
  158. model.makeValue("/root/tmp/msgtrsm/info/ordqty", 0);
  159. model.makeValue("/root/tmp/msgtrsm/info/ordtims", 0);
  160. model.makeValue("/root/tmp/msgtrsm/info/orddays", 0);
  161. model.makeValue("/root/tmp/msgtrsm/info/rgstrid", "-");
  162. model.makeValue("/root/tmp/msgtrsm/info/rgstdd", "-");
  163. model.makeValue("/root/tmp/msgtrsm/info/rgsttm", "-");
  164. model.makeValue("/root/tmp/msgtrsm/info/sendphone", "");
  165. model.makeValue("/root/tmp/msgtrsm/info/anybodyyn", "N");
  166. model.makeValue("/root/tmp/msgtrsm/info/sendflag", "O");
  167. model.makeValue("/root/tmp/msgtrsm/info/senddate", "");
  168. model.makeValue("/root/tmp/msgtrsm/info/sendid", VAL_userid);
  169. model.makeValue("/root/tmp/msgtrsm/info/deliveid", "-");
  170. model.makeValue("/root/tmp/msgtrsm/info/recvdate", "");
  171. model.makeValue("/root/tmp/msgtrsm/info/recvid", "");
  172. model.makeValue("/root/tmp/msgtrsm/info/recvcnfmyn", "N");
  173. model.makeValue("/root/tmp/msgtrsm/info/recvcnfmid", VAL_userid);
  174. model.makeValue("/root/tmp/msgtrsm/info/sendmsg", "");
  175. model.makeValue("/root/tmp/msgtrsm/info/recvmsg", "");
  176. model.makeValue("/root/tmp/msgtrsm/info/fstrgstrid", "");
  177. model.makeValue("/root/tmp/msgtrsm/info/fstrgstdt", "");
  178. model.makeValue("/root/tmp/msgtrsm/info/lastupdtrid", "");
  179. model.makeValue("/root/tmp/msgtrsm/info/lastupdtdt", "");
  180. if (kindflag == "P") {
  181. model.makeValue("/root/tmp/msgtrsm/info/kindflag", kindflag);
  182. model.makeValue("/root/tmp/msgtrsm/info/grupcalcscorcd", "-");
  183. model.makeValue("/root/tmp/msgtrsm/info/snglcalcscorcd", "-");
  184. model.makeValue("/root/tmp/msgtrsm/info/prcpdd", "-");
  185. model.makeValue("/root/tmp/msgtrsm/info/prcpno", 0);
  186. model.makeValue("/root/tmp/msgtrsm/info/prcppayflag", "-");
  187. } else if (kindflag == "O") {
  188. model.makeValue("/root/tmp/msgtrsm/info/kindflag", kindflag); // 처방기준 'O', chk
  189. model.makeValue("/root/tmp/msgtrsm/info/grupcalcscorcd", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("grupcalcscorcd"))); //chk
  190. model.makeValue("/root/tmp/msgtrsm/info/snglcalcscorcd", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd")));; //chk
  191. model.makeValue("/root/tmp/msgtrsm/info/prcpdd", ""); // 서버단에서 조회하여 가져와야함. chk(입원만)
  192. model.makeValue("/root/tmp/msgtrsm/info/prcpno", ""); // 서버단에서 조회하여 가져와야함. chk(입원만)
  193. model.makeValue("/root/tmp/msgtrsm/info/prcppayflag", ""); // 서버단에서 조회하여 가져와야함. chk (입원만)
  194. }
  195. }
  196. // 환자 전체 메세지 내용 조회하여 하나씩 보기.
  197. function fJudgPatMsgTrsmRef(){
  198. model.makeValue("/root/tmp/msgtrsm/info/refyn", "Y");
  199. model.makeValue("/root/tmp/msgtrsm/info/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  200. model.makeValue("/root/tmp/msgtrsm/info/orddd", model.getValue("/root/main/item1/iteminfo/indd1"));
  201. model.makeValue("/root/tmp/msgtrsm/info/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  202. model.makeValue("/root/tmp/msgtrsm/info/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  203. model.makeValue("/root/tmp/msgtrsm/info/orddeptcd", model.getValue("/root/main/item1/iteminfo/orddeptcd"));
  204. model.makeValue("/root/tmp/msgtrsm/info/orddrid", model.getValue("/root/main/item1/iteminfo/medispclid"));
  205. model.makeValue("/root/tmp/msgtrsm/info/ordtype", "I");
  206. modal("SMPIJ02600_메세지현황", "", "100", "100", "", "/root/tmp/msgtrsm/info", "/root/init/openchk");
  207. model.removeNode("/root/tmp/msgtrsm");
  208. }
  209. // 처방사유조회
  210. // history.. 진료에 있는화면 기본조건으로 팝업사용..YS(윤샘)요청
  211. function fPrcpResnRef(){
  212. // 세션값 받기
  213. model.makeValue("/root/tmp/prcpresnref/info/pid", model.getValue("/root/main/item1/iteminfo/pid")); // 등록번호
  214. model.makeValue("/root/tmp/prcpresnref/info/fromdd", model.getValue("/root/main/item1/iteminfo/indd1")); // 처방시작일 default indd
  215. model.makeValue("/root/tmp/prcpresnref/info/todd", model.getValue("/root/main/item1/iteminfo/dschdd")); // 처방종료일 default dschdd
  216. model.makeValue("/root/tmp/prcpresnref/info/orddeptcd", "-"); // 진료과 : 주진료과
  217. model.makeValue("/root/tmp/prcpresnref/info/orddrid", "-"); // 주치의 : default "-"
  218. model.makeValue("/root/tmp/prcpresnref/info/mainjudgid", "-"); // 심사자 : 현재심사자
  219. model.makeValue("/root/tmp/prcpresnref/info/prcpcd", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("grupcalcscorcd"))); // 수가코드 : 그룹코드
  220. model.makeValue("/root/tmp/prcpresnref/info/insukind", model.getValue("/root/main/item1/iteminfo/insukindcd")); // 보험유형 : 환자보험유형
  221. model.makeValue("/root/tmp/prcpresnref/info/ioflag", "I"); // 내원유형 : default "-"
  222. model.makeValue("/root/tmp/prcpresnref/info/resncd", "FF"); // 사유구분 : default "FF" 중복처방
  223. model.makeValue("/root/tmp/prcpresnref/info/popup", "judg"); // 팝업사용처구분 : judg(심사)
  224. modal("SPMMO19000_중복처방사유조회", "", "400", "300", "", "/root/tmp/prcpresnref/info", "/root/tmp/prcpresnref/info");
  225. model.removeNode("/root/tmp/prcpresnref");
  226. }
  227. // 환자번호 문자 숫자 여부 판단. (isNaN 숫자가아닐경우 true, isFinite 숫자일경우 true)
  228. // 성가환자번호중 첫글자가 문자인경우가 있어서 판단함.
  229. // 현재 재원메인은 적용안함. 대상자조회만 따로 화면에 적용함.
  230. function fChkPidWordNumber(pid)
  231. {
  232. if( typeof( this ) == "undefined" ) return false;
  233. if( this.length == 0 ) return false;
  234. var thisSting = pid.toString();
  235. var firstpid = "";
  236. for( var i=0; i < thisSting.length; i++ ){
  237. var thisNumber = thisSting.substring( i, i+1 );
  238. // 숫자가 아니면
  239. if( isNaN( thisNumber ) ) firstpid = firstpid + 'W';
  240. // 숫자면
  241. if( isNaN( thisNumber ) == false ) firstpid = firstpid + 'N';
  242. // 공백이면 FALSE 리턴
  243. if( " " == thisNumber ) firstpid = firstpid + 'L';
  244. }
  245. var firstpidYN = firstpid.substring( 0, 2 );
  246. // 첫번째 두번째 글자 여부
  247. // 문자숫자, 숫자숫자 : pid로 판단 : true
  248. // 문자문자, 숫자문자 : 글자로 판단 : false
  249. // 그외 : 글자로 판단 : false
  250. if ( firstpidYN == "WN"){ return true}
  251. else if ( firstpidYN == "NN"){ return true}
  252. else if ( firstpidYN == "WW"){ return false}
  253. else if ( firstpidYN == "NW"){ return false}
  254. else { return false }
  255. }
  256. //선택된환자 주,부유형에 따른 보험정보 리스트를 갖고 온다. (pmihiphs)
  257. function fGetInsulist(){
  258. //색상 초기화
  259. opt_patientinfo.attribute("background-color") = "transparent";
  260. cmb_itemraremsg.attribute("background-color") = "transparent";
  261. // 기존 Open 되어 있는 윈도우 중 대상자 조회화면을 제외한 모든 창을 닫는다.
  262. var judgOpenWindow = getChildWindow("SPPMC02500"); // SPPMC02500_대상자 조회.xrw
  263. var childCnt = window.children.length;
  264. childCnt = eval(childCnt) + 1;
  265. for( var i = childCnt; i > 1; i-- ) {
  266. var child = window.children.item(i-1);
  267. if (judgOpenWindow != child) {
  268. window.children.item(i-1).close();
  269. }
  270. }
  271. model.removeNodeset("/root/main/list1");
  272. model.resetInstanceNode("/root/hidden/sppiz00300/cond");
  273. model.resetInstanceNode("/root/hidden/sppiz00300/rslt");
  274. model.resetInstanceNode("/root/hidden/smpiz00100/cond");
  275. model.resetInstanceNode("/root/hidden/smpiz00100/rslt");
  276. model.setValue("/root/send/indd1", model.getValue("/root/main/item1/iteminfo/indd1"));
  277. model.setValue("/root/send/curdd",VAL_today);
  278. submit("TRPIJ00309",false);
  279. }
  280. //대상자 조회에서 선택된환자의 보험정보 리스트를 조회 한 후 최종것을 선택 하여 환자 정보를 자동 조회 환다.
  281. function fSelectInsulist(getinsukind, getmskind, getflag){
  282. var nodecnt = getNodesetCount("/root/main/list1/insulist");
  283. if (nodecnt == 0) { // 보험내역이 없는겨우
  284. return;
  285. }
  286. var mskind = "";
  287. var fromdd = "";
  288. var todd = "";
  289. var insukind = "";
  290. var suppkind = "";
  291. var cretno = "";
  292. var seqno = "";
  293. var row = 0;
  294. // 대상자 조회에서 선택된 내용이 조회되도록 수정 - 박창원
  295. // 유형이 같은 데이타 중 마지막 데이타 선택
  296. var personflag = model.getValue("/root/send/personflag");
  297. if (personflag != "9") {
  298. //주석 처리함. 2007.08.22 박도형
  299. //위의 로직 수정. 시작일자가 최종일자로 데이터 가져옴 plet2.
  300. var maxfromdd = model.getXPathValue("max(/root/main/list1/insulist[mskind='"+getmskind+"']/fromdd)");
  301. mskind = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/mskind");
  302. fromdd = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/fromdd");
  303. todd = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/todd");
  304. insukind = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/insukind");
  305. suppkind = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/suppkind");
  306. cretno = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/cretno");
  307. seqno = model.getValue("/root/main/list1/insulist[mskind='"+getmskind+"' and fromdd='"+maxfromdd+"']/seqno");
  308. model.setValue("/root/send/mskind",mskind);
  309. model.setValue("/root/send/fromdd",fromdd);
  310. model.setValue("/root/send/todd",todd);
  311. model.setValue("/root/send/ordfromdd",fromdd);
  312. model.setValue("/root/send/ordtodd",todd);
  313. model.setValue("/root/send/insukind",insukind);
  314. model.setValue("/root/send/suppkind",suppkind);
  315. model.setValue("/root/send/cretno",cretno);
  316. model.setValue("/root/send/seqno",seqno);
  317. }
  318. // 검색조건 초기화
  319. model.setValue("/root/hidden/list1/isclcond/matractflag","");
  320. model.setValue("/root/hidden/list1/isclcond/calcpayflag","");
  321. model.setValue("/root/hidden/list1/isclcond/snglcalcscorcls","");
  322. model.setValue("/root/hidden/list1/isclcond/cpflag","");
  323. model.setValue("/root/hidden/list1/isclcond/edicd","");
  324. model.setValue("/root/hidden/list1/isclcond/snglcalcscorcd","");
  325. model.setValue("/root/hidden/list1/isclcond/actingflag","");
  326. grd_ordlist.attribute("nodeset") = "/root/main/list2/iscllist";
  327. fGetItemInfo(getflag);
  328. }
  329. // 처방 Grid 마우스 오른쪽 "처방주석입력"
  330. function fOrderGridInsertCmt() {
  331. var rdounitflag = model.getValue("/root/send/unitflag");
  332. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  333. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  334. var rows = grd_clcjlist.rows;
  335. if (rdounitflag == "M") {
  336. // 줄단위로 셋팅하고 처리
  337. model.setValue(rdo_unitflag.attribute("ref"), "J");
  338. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'J']";
  339. grd_clcjlist.rebuild();
  340. // 단위에 에 따라 해당 행있는 특정코드 콤보 재설정
  341. for (var i=1; i< rows; i++) {
  342. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  343. var status = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("status"));
  344. if (status != "") {
  345. grd_clcjlist.rowStatus(i) = status;
  346. }
  347. if (unitflag == "M") {
  348. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M'' and cdid != 'MX999']";
  349. } else if (unitflag == "J") {
  350. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J']";
  351. }
  352. }
  353. }
  354. model.removenode("/root/hidden/sppij00500/rslt"); // SPPIJ00500_특정내역상세관리 에서 선택된 결과가 copyNode되는 경로임
  355. model.removenode("/root/hidden/sppij00500/cond");
  356. for (var k=0; k < grd_ordlist.selectedRows; k++ ) {
  357. var row = grd_ordlist.selectedRow(k);
  358. var edicd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("edicd"));
  359. var calcscorcd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("snglcalcscorcd"));
  360. if (edicd) {
  361. } else {
  362. messageBox("EDI코드가 없는 경우 해당 줄단위 특정내역이", "I004"); ///EDI코드가 없는 경우 해당 줄단위 특정내역이 없습니다.
  363. return;
  364. }
  365. }
  366. var rowcnt = 1;
  367. var setrow = 0;
  368. for (var k=0; k < grd_ordlist.selectedRows; k++ ) {
  369. var row = grd_ordlist.selectedRow(k);
  370. var edicd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("edicd"));
  371. var calcscorcd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("snglcalcscorcd"));
  372. if (rows == 1) {
  373. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  374. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  375. model.makevalue("/root/hidden/sppij00500/cond/edicd", edicd);
  376. model.makevalue("/root/hidden/sppij00500/cond/unitflag","J");
  377. model.makevalue("/root/hidden/sppij00500/cond/flag", "I");
  378. model.makevalue("/root/hidden/sppij00500/cond/spclcd", "JX999");
  379. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  380. model.makevalue("/root/hidden/sppij00500/cond/detldesc", "특정내역의 구분코드가 없는 경우에는 기타 줄번호(확장 번호)단위의 기타내역에 기재");
  381. model.makevalue("/root/hidden/sppij00500/cond/spclspec", "");
  382. model.makevalue("/root/hidden/sppij00500/cond/remfact","X(700)");
  383. model.makevalue("/root/hidden/sppij00500/cond/rownum", "");
  384. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  385. } else if (getNodesetCount(grd_clcjlist.nodeset+"[calcscorcd='"+calcscorcd+"']") == 0) {
  386. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  387. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  388. model.makevalue("/root/hidden/sppij00500/cond/edicd", edicd);
  389. model.makevalue("/root/hidden/sppij00500/cond/unitflag","J");
  390. model.makevalue("/root/hidden/sppij00500/cond/flag", "I");
  391. model.makevalue("/root/hidden/sppij00500/cond/spclcd", "JX999");
  392. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  393. model.makevalue("/root/hidden/sppij00500/cond/detldesc", "특정내역의 구분코드가 없는 경우에는 기타 줄번호(확장 번호)단위의 기타내역에 기재");
  394. model.makevalue("/root/hidden/sppij00500/cond/spclspec", "");
  395. model.makevalue("/root/hidden/sppij00500/cond/remfact","X(700)");
  396. model.makevalue("/root/hidden/sppij00500/cond/rownum", "");
  397. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  398. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/pid", pid);
  399. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/indd", indd);
  400. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/edicd", edicd);
  401. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/unitflag","J");
  402. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/flag", "I");
  403. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcd", "JX999");
  404. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcdnm", "");
  405. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/detldesc", "특정내역의 구분코드가 없는 경우에는 기타 줄번호(확장 번호)단위의 기타내역에 기재");
  406. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclspec", "");
  407. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/remfact","X(700)");
  408. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/rownum", "");
  409. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", calcscorcd);
  410. rowcnt = rowcnt+1;
  411. } else {
  412. for (var i=1; i<rows; i++) {
  413. var clcjedicd = grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("edicd"));
  414. var spclcd = grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd"));
  415. if ( edicd == clcjedicd) {
  416. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  417. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  418. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/flag", "U");
  419. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/edicd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("edicd")));
  420. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/detldesc", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("detldesc")));
  421. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd")));
  422. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcdnm", "");
  423. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclspec", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclspec")));
  424. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/remfact", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("remfact")));
  425. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/rownum", i);
  426. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/unitflag","J")
  427. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd")));
  428. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclspec", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclspec")));
  429. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("calcscorcd")));
  430. rowcnt = rowcnt+1;
  431. // 특정내역 상세 화면에 보여줄 특정내역 선택
  432. setrow = i;
  433. }
  434. model.makevalue("/root/hidden/sppij00500/cond/edicd", edicd);
  435. model.makevalue("/root/hidden/sppij00500/cond/unitflag","J");
  436. if ( model.getValue("/root/main/list4/clcjlist["+ setrow +"]/spclcd") == "JX999" ) {
  437. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  438. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  439. model.makevalue("/root/hidden/sppij00500/cond/flag", "U");
  440. model.makevalue("/root/hidden/sppij00500/cond/spclcd", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("spclcd")));
  441. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  442. model.makevalue("/root/hidden/sppij00500/cond/detldesc", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("detldesc")));
  443. model.makevalue("/root/hidden/sppij00500/cond/spclspec", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("spclspec")));
  444. model.makevalue("/root/hidden/sppij00500/cond/remfact", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("remfact")));
  445. model.makevalue("/root/hidden/sppij00500/cond/rownum", setrow);
  446. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("calcscorcd")));
  447. } else {
  448. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  449. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  450. model.makevalue("/root/hidden/sppij00500/cond/flag", "I");
  451. model.makevalue("/root/hidden/sppij00500/cond/spclcd", "JX999");
  452. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  453. model.makevalue("/root/hidden/sppij00500/cond/detldesc", "특정내역의 구분코드가 없는 경우에는 기타 줄번호(확장 번호)단위의 기타내역에 기재");
  454. model.makevalue("/root/hidden/sppij00500/cond/spclspec", "");
  455. model.makevalue("/root/hidden/sppij00500/cond/remfact","X(700)");
  456. model.makevalue("/root/hidden/sppij00500/cond/rownum", "");
  457. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  458. }
  459. }
  460. }
  461. }
  462. model.removenode("/root/hidden/sppij00500/rslt");
  463. modal("SPPIJ00500" ,"", "10", "10", "SPPIJ00500", "/root/hidden/sppij00500", "/root/hidden/clcj", "", ""); // SPPIJ00500_특정내역상세관리.xrw
  464. var rsltcnt = getNodesetCount("/root/hidden/sppij00500/rslt/list");
  465. // 처리 건수
  466. if (rsltcnt > 0) {
  467. for(var i=rsltcnt; i>0; i--) {
  468. var flag = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/flag");
  469. var rownum = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/rownum");
  470. var edicd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/edicd");
  471. var newspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcd");
  472. var newspclcdnm = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcdnm");
  473. var newspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclspec");
  474. var newremfact = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/remfact ");
  475. var newdetldesc = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/detldesc");
  476. var newdcalcscorcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/calcscorcd");
  477. var oldspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclcd");
  478. var oldspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclspec");
  479. // 특정코드 추가인 경우
  480. if (flag == "I") {
  481. var clcjrow = grd_clcjlist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
  482. grd_clcjlist.insertRow(clcjrow++, true,false,false);
  483. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("pid")) = model.getValue("/root/send/pid");
  484. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("indd")) = model.getValue("/root/send/indd");
  485. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("cretno")) = model.getValue("/root/send/cretno");
  486. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("fromdd")) = model.getValue("/root/send/fromdd");
  487. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("mskind")) = model.getValue("/root/send/mskind");
  488. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("unitflag")) = "J";
  489. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("edicd")) = edicd;
  490. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclcd")) = newspclcd;
  491. //grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  492. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclspec")) = newspclspec;
  493. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("remfact")) = newremfact;
  494. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  495. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("calcscorcd")) = newdcalcscorcd
  496. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclmemoflag")) = "E";
  497. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("status")) = "3";
  498. // 처방Grid에서도 해당 줄단위 특정내역의 'T' 컬럼의 "*" 를 표시한다.
  499. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  500. rowcnt = eval(rowcnt) + 1;
  501. for (var j = 1; j < rowcnt; j++) {
  502. //for (var j = 1; j < grd_ordlist.rows; j++) {
  503. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  504. if (edicd == clcjedicd) {
  505. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  506. //model.refresh(); 최적화 문제로 변경 - 20080731 박창원
  507. //model.refreshpart("/root/main/list2/iscllist/text");
  508. }
  509. }
  510. // 특정코드 변경인 경우
  511. } else if (flag == "U") {
  512. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcd")) = newspclcd;
  513. //grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  514. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclspec")) = newspclspec;
  515. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("remfact")) = newremfact;
  516. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  517. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("calcscorcd")) = newdcalcscorcd;
  518. if ( grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) != "3") {
  519. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "0";
  520. }
  521. //model.refresh(); 최적화 문제로 변경 - 20080731 박창원
  522. model.refreshpart("/root/main/list4/clcjlist");
  523. // 특정코드, 특정내역이 변경되었거나 삭제된 특정코드를 조회하여 "확인"을 선택한 경우
  524. if (oldspclcd != newspclcd || oldspclspec != newspclspec || grd_clcjlist.rowstatus(row) == 4) {
  525. var rowstatus = grd_clcjlist.rowstatus(rownum);
  526. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  527. } else {
  528. grd_clcjlist.rowstatus(rownum) = 2; // 2 : update 상태로 stat를 변경한다.
  529. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "2";
  530. }
  531. }
  532. // 처방Grid에서도 해당 줄단위 특정내역의 'T' 컬럼의 "*" 를 표시한다.
  533. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  534. rowcnt = eval(rowcnt) + 1;
  535. for (var j = 1; j < rowcnt; j++) {
  536. //for (var j = 1; j < grd_ordlist.rows; j++) {
  537. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  538. if (edicd == clcjedicd) {
  539. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  540. //model.refresh(); 최적화 문제로 변경 - 20080731 박창원
  541. model.refreshpart("/root/main/list2/iscllist/text");
  542. }
  543. }
  544. model.setValue("/root/hidden/item1/message", "특정코드 - "+ newspclcd +" / 특정내역 : "+ newspclspec +" / 기재형식 : "+ newremfact);
  545. model.refreshpart("/root/hidden/item1/message");
  546. // 특정코드 삭제인 경우
  547. } else if (flag == "D" && rownum != "" ) {
  548. var cnt = 0;
  549. for (var j = 1; j < grd_clcjlist.rows; j++) {
  550. var clcjedicd = model.getValue("/root/main/list4/clcjlist["+ j +"]/edicd");
  551. if (edicd == clcjedicd) {
  552. if (grd_clcjlist.rowstatus(j) != 4) {
  553. cnt++;
  554. }
  555. }
  556. }
  557. if (cnt > 0) {
  558. } else {
  559. grd_ordlist.valueMatrix(row, grd_ordlist.colref("text")) = "";
  560. //model.resetInstanceNode("/root/main/list2/iscllist["+ row +"]/text");
  561. }
  562. // 특정내역 Grid에서 삭제
  563. var rowstatus = grd_clcjlist.rowstatus(rownum);
  564. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  565. grd_clcjlist.deleteRow(rownum, false); // 해당 라인을 Grid에서 삭제한다.
  566. } else { // 0 : new, 2 : update
  567. grd_clcjlist.rowstatus(rownum) = 4; // 4 : delete 상태로 stat를 변경한다.
  568. }
  569. grd_clcjlist.row = rownum;
  570. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  571. rowcnt = eval(rowcnt) + 1;
  572. for (var j = 1; j < rowcnt; j++) {
  573. //for (var j = 1; j < grd_ordlist.rows; j++) {
  574. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  575. if (edicd == clcjedicd) {
  576. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "");
  577. //model.refresh(); 최적화 문제로 변경 - 20080731 박창원
  578. model.refreshpart("/root/main/list2/iscllist/text");
  579. }
  580. }
  581. } // 특정 코드 상태 따른 if end
  582. } // for end
  583. var rdounitflag = model.getValue("/root/send/unitflag");
  584. if (rdounitflag == "-") {
  585. for (var i=1; i<grd_clcjlist.rows; i++) {
  586. var delstatus = grd_clcjlist.rowStatus(i);
  587. var delspclspec = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec"));
  588. if (delstatus == 1 || delstatus == 3) { // 0 : new, 3 : insert & new
  589. if (delspclspec == "") {
  590. grd_clcjlist.deleteItem(i);
  591. }
  592. }
  593. }
  594. // 입력행 추가
  595. fSpclGridInsertRow();
  596. } else if (rdounitflag == "M") {
  597. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'M']";
  598. grd_clcjlist.rebuild();
  599. } else if (rdounitflag == "J") {
  600. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'J']";
  601. grd_clcjlist.rebuild();
  602. }
  603. for (var i=1; i<grd_clcjlist.rows; i++) {
  604. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  605. var status = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("status"));
  606. if (status != "") {
  607. grd_clcjlist.rowStatus(i) = status;
  608. }
  609. if (unitflag == "M") {
  610. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M' and cdid != 'MX999']";
  611. } else if (unitflag == "J") {
  612. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J']";
  613. }
  614. }
  615. //fSaveClcjList();
  616. } // 처리 건수 if end
  617. //model.refresh(); 최적화 문제로 변경 - 20080731 박창원
  618. }
  619. //재원심사 인적사항, 보험내역, 상병, 금액내역을 갖고 온다.
  620. function fGetItemInfo(paramFlag){
  621. group9.visible = false;
  622. btn_attData.attribute("class") = "btn2_letter4";
  623. btn_drginfo.attribute("visibility") = "hidden";
  624. // NST 관련버튼 초기화(2015.11.16 LEJ)
  625. btn_nst.disabled = true;
  626. btn_nst.attribute("class") = "btn2_letter8";
  627. btn_nst.attribute("text") = "NST";
  628. // 읽기전용을 위한 변수
  629. var readonly = model.getValue("/root/send/readonly");
  630. // 오픈일자를 가져옴 - 하드코딩 제거 20090302 박창원, 의정부,여의도,성가,빈센트를 위해서 예외작업함 나중에 제거필요
  631. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  632. if(ipt_pid.currentText.length >0)
  633. {
  634. model.resetInstanceNode("/root/main/item1/iteminfo");
  635. model.resetInstanceNode("/root/main/item18/cnstinfo");
  636. model.removeNodeset("/root/main/list1/insulist");
  637. model.removeNodeset("/root/main/list3/diaglist");
  638. model.removeNodeset("/root/main/list2/iscllist");
  639. model.setValue("/root/hidden/item1/vcode","");
  640. grd_ordlist.refresh();
  641. model.setValue("/root/send/curdd",VAL_today);
  642. model.makeValue("/root/send/paramflag",paramFlag);
  643. asyncSend("TRPIJ00322", "/root/send", "/root/chklist/goso", "responseHandlerTRPIJ00322");
  644. if(!submit("TRPIJ00301")){
  645. messageBox("선택된 환자가","I004");
  646. return;
  647. }
  648. //model.refresh();
  649. // 20091109 JHP 빈센트 병원 오류확인, fGetItemInfo에서 상단정보는 환자 정보 조회후에 바로 상단정보셋팅되게 바꾸게 요청함.
  650. // 하여 delPatientInfos(), fSetOutPatPamInfo()를 상단쪽 환자정보조회 이후로 이동시킴. 와 윤영옥, 정승우, 박창원.
  651. // 상단에 환자정보 초기화하고 기입하기 (이미 퇴원환자는 제외)
  652. delPatientInfos();
  653. fSetOutPatPamInfo();
  654. //처방조회조건부분 클리어
  655. fSetRdoReset();
  656. fGetSelectedOrderData();
  657. // 처방내역을 갖고 온다.
  658. fGetIsclList(paramFlag);
  659. // 2009.07.27 기존 상단에 제목줄 무조건 히든.
  660. // grd_insuhistory.rowhidden(0)=true;
  661. // 2009.07.27 4건이상이면 안없애고 4건이하면 없앤다.
  662. var nodecnt = getNodesetCount("/root/main/list1/insulist");
  663. if(nodecnt < 4) {
  664. grd_insuhistory.rowhidden(0)=true;
  665. }
  666. // 수정추가, 2009.07.27 유형정보가 많을경우 스크롤바 생겨서 일수가 안보이기때문에 버튼을 두어서 많이 보게끔했다.
  667. // 다른거 손대면 일이커지니깡. ㅋㅋ
  668. // 일단 먼저 버튼에 초기화형식으로 모두 숨김해놓는다.
  669. btn_insuhistoryup.visible = false;
  670. btn_insuhistorydown.visible = false;
  671. grd_insuhistory.attribute("height") = "77";
  672. // 유형갯수에 따라서 버튼보여주고 길이체크한다.
  673. var nodecnt = getNodesetCount("/root/main/list1/insulist");
  674. if(nodecnt >= 4) {
  675. btn_insuhistorydown.visible = true;
  676. }
  677. //상병이 한건도 없는경우 자동으로 처방상병을 갱신한다.
  678. if(grd_diaglist.rows < 2)
  679. {
  680. if(grd_diaglist.rows == 1){
  681. var chkdiag = model.getValue("/root/main/list3/diaglist["+ 1 +"]/diagcd");
  682. if(!chkdiag){
  683. fRefreshDiag();
  684. }
  685. }
  686. }
  687. fSpclGridInsertRow();
  688. // 20080811 자동으로 상병줄추가 제외하기로함
  689. fDiagGridInsertRow();
  690. var lastjudgendid = model.getValue("/root/main/item1/iteminfo/lastjudgendid");
  691. var lastjudgendnm = model.getValue("/root/main/item1/iteminfo/lastjudgendnm");
  692. var opyn = model.getValue("/root/main/item1/iteminfo/opflag");
  693. var age = model.getValue("/root/main/item1/iteminfo/age");
  694. model.setValue("/root/send/age",age);
  695. var userid = model.getValue("/root/hidden/userid");
  696. btn_save.disabled = false;
  697. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  698. model.setValue("root/hidden/item1/chksave","N");
  699. btn_recalc.disabled = false;
  700. btn_sugicalc.disabled = false;
  701. btn_dclrtclose.disabled = false;
  702. btn_dschclose.disabled = false;
  703. btn_totjudgclose.disabled = false;
  704. btn_dschclosecancel.disabled = false;
  705. btn_midregist.disabled = false;
  706. btn_midregistyn.disabled = false;
  707. }else
  708. {
  709. messageBox("환자번호를","C001");
  710. return;
  711. }
  712. // 수술심사상태를 가져온다. -- 수술심사상태는 수술이 있는 사람만 가져온다. - 20080922 박창원
  713. //if (opyn == "Y") {
  714. // fGetOperStat();
  715. //}
  716. // 외래 필수 심사 품목 조회를 위해 요율 칼럼을 불러온다! (2012.06.01 LEJ)
  717. var brateflag = model.getValue("/root/main/item1/iteminfo/brateflag");
  718. model.setValue("/root/send/brateflag",brateflag);
  719. fGetPatMsgYn();
  720. // 진료비 계산내역을 갖고 온다.
  721. //fGetCalc();
  722. //항목별소계
  723. //fSetItemSubTotal();
  724. // 특정내역 중 MT015, MT016 정보가 입력된 환자인지를 확인한다.
  725. fCheckSpclSpecData();
  726. // 2008. 01. 27 박지욱 추가 (처방 색깔 항 구분에 따라 흰색-회색 구분되도록 처리)
  727. //fSetOrderColorByEdiitem();
  728. //범례 색깔을 표시한다.
  729. //fSetColorSpclJudgOrder();
  730. //특정내역이 있는 처방에 'T'필드에 *표를 해준다.
  731. //fSetOrdSpclTxt();
  732. //중간청구 등록여부, 심사 마감상태, 문제환자여부를 체크하여 버튼의 색상을 셋팅해준다.
  733. fSetItemInfoSetting();
  734. // 마이그레이션된 중간청구등록이 되지 않은 데이터에 대하여 일괄적으로 중간청구 등록일을 20081003 으로 한다. - 20081003 박창원
  735. var midcflag = model.getValue("/root/main/item1/iteminfo/midcflag");
  736. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  737. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  738. if (midcflag == "N" && indd < opendd && fromdd == opendd) {
  739. model.setValue("/root/main/item1/iteminfo/lastmdlclamdd",opendd);
  740. }
  741. // 하단의 희귀난치성 산정특례환자의 등록번호 함수로 대체함. 20091020 JHP (추가작업발생)############################################# 시작
  742. // // 희귀난치성 산정특례환자의 등록번호를 보여준다. - 20090622 박창원
  743. // var raremsg = model.getValue("/root/main/item1/iteminfo/raremsg");
  744. //
  745. // if (raremsg != '-') {
  746. // model.setValue("/root/main/item1/iteminfo/itemmsg",raremsg);
  747. // model.refresh();
  748. // }
  749. // 중증번호, 희귀난치번호 보여주는 방법 변경에 따른 수정.
  750. fItemRareMsg();
  751. // 하단의 희귀난치성 산정특례환자의 등록번호 함수로 대체함. 20091020 JHP (추가작업발생)############################################# 끝
  752. // 희귀난치여부 표시 - 20080811 박창원 추가
  753. var rareyn = model.getValue("/root/main/item1/iteminfo/rareyn");
  754. cap_rare.visible= false;
  755. cap_tb.visible= false;
  756. cap_g1.visible = false;
  757. cap_c1c.visible= false;
  758. cap_c2e.visible= false;
  759. cap_c2f.visible= false;
  760. cap_cp.visible= false;
  761. if (rareyn == "Y") {
  762. cap_rare.visible= true;
  763. }else if(rareyn == "T") {
  764. cap_tb.visible= true;
  765. }
  766. // 차상위 표시
  767. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  768. var dcuc = model.getValue("/root/main/item1/iteminfo/dcuc");
  769. if (cfe == "C") {
  770. cap_c1c.visible= true;
  771. } else if (cfe == "E") {
  772. cap_c2e.visible= true;
  773. } else if (cfe == "F") {
  774. cap_c2f.visible= true;
  775. } else if (dcuc =="G") {
  776. cap_g1.visible = true;
  777. }
  778. // 완화의료 시범사업...20091228 정승우 환자구분추가
  779. pm_flag.visible=false;
  780. var calcscorrecalflag = model.getValue("/root/main/item1/iteminfo/calcscorrecalflag");
  781. if (calcscorrecalflag == "7" || calcscorrecalflag == "8") {
  782. pm_flag.visible=true;
  783. }
  784. var cpflag = model.getValue("/root/main/item1/iteminfo/cpyn");
  785. if (cpflag == "Y") {
  786. cap_cp.visible=true;
  787. }
  788. //메세지 클리어
  789. model.setValue("/root/hidden/item1/message","");
  790. // 20091109 JHP 심사메모버튼으로 변경시 case도 심사메모에 해당하는 것으로 변경해야함.
  791. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  792. if (sixtimyn == "Y"){
  793. btn_clspcd.selected = true;
  794. model.toggle("case_spclspec");
  795. } else {
  796. btn_judgrmk.selected = true;
  797. model.toggle("case_judgrmemo");
  798. }
  799. model.setValue("/root/hidden/item1/snglcalcscorcd", "");
  800. model.setValue("/root/hidden/item1/edicd", "");
  801. //분만정보 체크
  802. fCheckBorn();
  803. //수술여부 체크
  804. fCheckOper();
  805. //퇴원메모여부 체크
  806. fCheckDschMemo();
  807. //공여자 수혜자 체크
  808. fCheckDnorPat();
  809. // 수정추가 20090813 외래요율환자 일경우 보험, 보조유형 정보가 맞는지 확인하여 체크
  810. fOutRateInsuSuppflag();
  811. // 특이환자 버튼 설정 - 20080923 박창원
  812. if (model.getValue("/root/main/item1/iteminfo/pamprobjudgflag") == "Y") {
  813. btn_patspcfyn.attribute("background-image") = "../../../com/commonweb/images/icon_btn_s.gif"; // 주황색
  814. } else {
  815. btn_patspcfyn.attribute("background-image") = "../../../com/commonweb/images/icon_btn.gif"; // 파란색
  816. }
  817. // 자보한도액 초과자 체크 : 자보환자일때만 자보발생금액 버튼 활성화 초과자는 자보발생금액 버튼 색깔변경 - 20080923 박창원
  818. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  819. var suppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  820. var suppkindflag = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  821. if ( insukind == "31" && suppkind == "18") {
  822. var paylimityn = model.getValue("/root/main/item1/iteminfo/paylimityn");
  823. // 자보발생금액 버튼 설정
  824. if (paylimityn == "Y") {
  825. btn_autolimit.attribute("background-image") = "../../../com/commonweb/images/icon_btn_s.gif"; // 주황색
  826. } else {
  827. btn_autolimit.attribute("background-image") = "../../../com/commonweb/images/icon_btn.gif"; // 파란색
  828. }
  829. } else { // 자보자손이 아닐경우 파란색으로 - 20081108 박창원
  830. btn_autolimit.attribute("background-image") = "../../../com/commonweb/images/icon_btn.gif"; // 파란색
  831. }
  832. // 20091016 JHP 요청번호8558 진료상병과심사상병체크 ############################################################################################ 시작
  833. fCheckEmrDiagPamDiag();
  834. // 20091016 JHP 요청번호8558 진료상병과심사상병체크 ############################################################################################ 끝
  835. // 사망환자 메세지 20090602 박창원
  836. var dethdt = model.getValue("/root/main/item1/iteminfo/dethdt");
  837. var maxexecdd = model.getValue("/root/main/item1/iteminfo/maxexecddt");
  838. var dethdd = dethdt.substr(0,8);
  839. if (dethdt != '-') {
  840. if (maxexecdd > dethdd) {
  841. messageBox("사망일자 이후 실시처방이 있습니다. 정리 후 ","C003");
  842. }
  843. else {
  844. messageBox("사망환자[사망시간 "+ dethdt.substr(0,4) + ":" + dethdt.substr(4,2) + ":" + dethdt.substr(6,2) + " " + dethdt.substr(8,2) + ":" + dethdt.substr(10,2) + "]", "I005");
  845. // 20090921 수정추가 : JHP inpt 사망정보 존재하면 진료결과의 값을 사망으로바꾸어서 저장할때 저장되게끔한다..
  846. var dschdd = model.getValue("/root/main/item1/iteminfo/dschdd");
  847. var ordrslt = model.getValue("/root/main/item1/iteminfo/ordrslt");
  848. // 퇴원일자와 사망일자가 동일할 때만 진료결과 체크한다.
  849. if(dethdd == dschdd && ordrslt != "4"){
  850. model.setValue("/root/main/item1/iteminfo/ordrslt","4");
  851. }
  852. }
  853. }
  854. // 당일외래진료후 입원환자 및 덤프된 원내,원외 약제 체크 알럿 - 20090616 박창원
  855. var todayoutyn = model.getValue("/root/main/item1/iteminfo/todayoutyn");
  856. var dumpinyn = model.getValue("/root/main/item1/iteminfo/dumpinyn");
  857. var dumpoutyn = model.getValue("/root/main/item1/iteminfo/dumpoutyn");
  858. var lastjudgdt = model.getValue("/root/main/item1/iteminfo/lastjudgdt");
  859. var dumpclamkeyexistyn = model.getValue("/root/main/item1/iteminfo/dumpclamkeyexistyn");
  860. var serdiagfromdd = model.getValue("/root/main/item1/iteminfo/serdiagfromdd"); //중증시작일자
  861. if (todayoutyn == "Y" && lastjudgdt == "-") {
  862. if (dumpinyn == "N" && dumpoutyn == "N") {
  863. messageBox("당일 외래진료 후 입원처리된", "I005");
  864. } else if (dumpinyn == "Y" && dumpoutyn == "N") {
  865. messageBox("당일 외래진료 후 입원처리되고 원내 약제 덤프처방이 있는", "I005");
  866. } else if (dumpinyn == "N" && dumpoutyn == "Y") {
  867. messageBox("당일 외래진료 후 입원처리되고 원외 약제 덤프처방이 있는", "I005");
  868. }else if (dumpinyn == "Y" && dumpoutyn == "Y") {
  869. messageBox("당일 외래진료 후 입원처리되고 원내/원외 약제 덤프처방이 있는", "I005");
  870. }
  871. }
  872. // 6시간미만여부체크 - 20080722 박창원
  873. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  874. if (sixtimyn == "Y" && indd < serdiagfromdd) {
  875. messageBox("중증등록일과 입원일자가 다르므로 재원 이력 분리 후 중증 적용 바랍니다", "I005");
  876. }
  877. // 본인부담상한제 대상자체크 - 200800808 박창원
  878. var ownbmaxyn = model.getValue("/root/main/item8/ownbmaxamt/ownbmaxyn");
  879. if (ownbmaxyn == "Y") {
  880. messageBox("본인부담상한제 대상", "I005");
  881. }
  882. var ownbmaxgradeflag = model.getValue("/root/main/item1/iteminfo/ownbmaxgradeflag");
  883. var ownlimmitamt = model.getValue("/root/main/item1/iteminfo/ownlimmitamt"); // 본인부담 상한 구분에 따른 상한기준액
  884. var suppkindflag = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  885. var ownbmaxgrade = model.getValue("/root/main/item1/iteminfo/ownbmaxgrade"); // 보험유형과 재원이력의 본인부담 상한 구분 비교
  886. // 수정추가 : 20090820 : JHP : 상한제 차등구분(iphs의 ownbmaxgradeflag)을 확인하여 보조유형 차상위 환자에 대해서는 상한제 차등구분이 200만원 코드인 3인지 확인한다.
  887. // 2011.01.17 경북대병원 차상위 상한금액구분 메시지 삭제요청
  888. /*
  889. if(suppkindflag == '32' ||suppkindflag == '33' ||suppkindflag == '34' ||suppkindflag == '35' ||suppkindflag == '36' ||suppkindflag == '37' ||suppkindflag == '38' ||suppkindflag == '39' ||
  890. suppkindflag == '40' ||suppkindflag == '41' ||suppkindflag == '42' ||suppkindflag == '43' ||suppkindflag == '44' ||suppkindflag == '45' ||suppkindflag == '46'){
  891. if(ownbmaxgradeflag != "3"){
  892. messageBox("차상위 환자입니다. 현재 상한제금액구분이 200만원이 아니므로 \n원무팀에 요청하시어 상한제금액구분을 변경","I008");
  893. }
  894. }
  895. */
  896. // 응급실을 통하여 소아과로 입원한 6세미만 환자는 유형을 변경할 것인지 알럿을 띄워준다.
  897. // 현재과(PD),입원경로(응급실),6세미만, 보험유형은 보험과 보호만, 재원중인 환자로 보조유형이 6세미만이 아닌 환자를 조건으로함 - 20081007 박창원
  898. // 입원경로 조건을 없앰 - 20081013 박창원
  899. // 신생아 추가 - 20081013 박창원
  900. var age = parseInt(model.getValue("/root/main/item1/iteminfo/age"));
  901. var inpath = model.getValue("/root/main/item1/iteminfo/inpath");
  902. var orddeptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  903. var rrgstno = model.getValue("/root/main/item1/iteminfo/rrgstno");
  904. var canceryn = "N"; // 6세미만과 등록암이 공존하지 못하도록 20090602 박창원
  905. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  906. var babyyn ="N";
  907. var end6yn = "N";
  908. var brthdd = "20" + rrgstno.substr(0,6);
  909. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  910. // 신생아를 구별지음
  911. if (indschacptstat != 'D' && dumpclamkeyexistyn == "Y") {
  912. messageBox("외래 자료 수집이 된 재원 내 실시처방이 있습니다. 외래 사후 자료를 생성 삭제한 후 Dump처리","I008");
  913. }
  914. //응급실 관리료 여부 체크
  915. var nog3reasnyn = model.getValue("/root/main/item1/iteminfo/nog3reasnyn");
  916. if (nog3reasnyn == "Y") {
  917. messageBox("응급 의료관리료 미발생 환자입니다.","I007");
  918. }
  919. if (rrgstno.substr(7,1) == "3" || rrgstno.substr(7,1) == "4" || rrgstno.substr(7,1) == "7" || rrgstno.substr(7,1) == "8" && (cfe != "E" && cfe != "F")) {
  920. var interval = getDateInterval(brthdd,indd);
  921. if (interval < "28") {
  922. babyyn = "Y";
  923. }
  924. }
  925. // 6세미만 생일 여부를 판단함
  926. if ((rrgstno.substr(7,1) == "3" || rrgstno.substr(7,1) == "4" || rrgstno.substr(7,1) == "7" || rrgstno.substr(7,1) == "8") && age <= 6) {
  927. var curdd = VAL_today.substr(2,6);
  928. brthdd = brthdd.substr(2,6);
  929. if (age == 6) {
  930. if (brthdd >= curdd) {
  931. end6yn = "N";
  932. } else if (brthdd < curdd) {
  933. end6yn = "Y";
  934. }
  935. } else if(age < 6) {
  936. end6yn = "N";
  937. } else if (age > 6) {
  938. end6yn ="Y";
  939. }
  940. }
  941. //35세 이상 고위험 임신부 관련 메세지 (2015.07.29 LEJ)
  942. if (orddeptcd == "2100000000" && age >= 35 ){
  943. if (model.getValue("/root/main/item17/obgydiag/obgydiagyn") == "Y"){ //임신 상병 체크 추가 (2015.10.05 LEJ)
  944. messageBox("35세 이상 고위험 임신부 입원진료 내역입니다!!","I007");
  945. }
  946. }
  947. if ( (insukind == "11" || insukind == "21" || insukind == "22") && suppkind != "31" && !(insukind == "22" && suppkind == "08") ){ //20100318 정승우 신생아유형은 메세지 뜨지 않도록 적용하고 버튼도 보이지 않도록
  948. //산정특례여부 체크
  949. fCheckEssc();
  950. //산정특례 + 정상요율 + 퇴원확정인 경우는 메시지t처리 한다.
  951. var chkBtn = "False";
  952. if(btn_esscdiag.visible){
  953. chkBtn = "True";
  954. }else{
  955. chkBtn = "False";
  956. }
  957. // 희귀난치성 산정특례 체크 - 20090622 박창원
  958. var rareesscyn = model.getValue("/root/main/item12/rareessc/rareesscyn");
  959. //20100318 정승우 메세지 정리 보조유형이 50이면 띄우지 않는다.
  960. //if (chkBtn == "True" && rareesscyn == "Y" && suppkindflag != "50") {
  961. // messageBox("희귀난치성 산정특례", "I005");
  962. // 희귀난치성 산정특례 환자의 경우 메세지후 return때문에 진행안되는 부분 comment 처리 - 20100221 박창원
  963. //return;
  964. //}
  965. var rare = model.getValue("/root/main/list1/insulist[rare='H']/rare");
  966. if (rare.length > 0 && (indschacptstat == 'A' || indschacptstat == 'T') ){
  967. messageBox("희귀대불 환자입니다. 자격", "I007");
  968. }
  969. if (insukind == "11") {
  970. if (ownbmaxgrade == 'Y') {
  971. messageBox("환자의 본인부담 상한구분이 보험유형 기준자료의 상한구분과 일치하지 않습니다. ", "I007");
  972. }
  973. else {
  974. // 연도별 분리 안 된 이력 중 본인부담 상한액 초과 환자 메세지 발생
  975. var todd = model.getValue("/root/main/item1/iteminfo/todd");
  976. var dschnotidt = model.getValue("/root/main/item1/iteminfo/dschnotidt");
  977. var curyear = VAL_today.substr(0,4);
  978. var fromyear = fromdd.substr(0,4);
  979. var toyear = todd.substr(0,4);
  980. if ( todd == "99991231" ) {
  981. if ( dschnotidt.substr(0,8) == "99991231" || dschnotidt.substr(0,8) == "" ) {
  982. toyear = curyear ;
  983. }
  984. else {
  985. toyear = dschnotidt.substr(0,4) ;
  986. }
  987. }
  988. if ( fromyear != toyear && cfe != 'F' ) {
  989. if(parseInt(model.getValue("/root/main/item2/itemcalc/ownbpayamt")) > ownlimmitamt) {
  990. messageBox("연도별 분리 되지 않은 본인부담상한제 환자입니다. \n재원 분리 ", "I007");
  991. }
  992. }
  993. else {
  994. //본임부담상한제 체크 : 기준 금액 이상이면 메시지 발생.
  995. if ((indschacptstat == 'A' || indschacptstat == 'T')) {
  996. if(parseInt(model.getValue("/root/main/item2/itemcalc/ownbpayamt")) > ownlimmitamt) {
  997. messageBox("본인부담상한제 환자", "I009");
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. // 중증수술 처방이 있을경우 상병이 맞지 않으면 Alert - 20080908 박창원
  1004. var chkSuppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  1005. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  1006. var v191prcpyn = model.getValue("/root/main/item1/iteminfo/v191prcpyn");
  1007. var v192prcpyn = model.getValue("/root/main/item1/iteminfo/v192prcpyn");
  1008. var v191diagyn = model.getValue("/root/main/item1/iteminfo/v191diagyn");
  1009. var v192diagyn = model.getValue("/root/main/item1/iteminfo/v192diagyn");
  1010. var vcode = model.getvalue("/root/hidden/item1/vcode");
  1011. // 20090602 개심개두는 입원요율만 적용되게
  1012. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  1013. // 개심개두 상병 메세지 통합 - 20081010 박창원
  1014. var opmessageyn = "N";
  1015. if (v191prcpyn == "Y" && chkSuppkind != "05" && chkSuppkind != "32" && chkSuppkind != "34" && sixtimyn == "N") { // 20090325 차상위 2종추가
  1016. //if (v191diagyn == "N") { // 개심/개두 수술인 경우 상병과 상관없이 보조유형 적용 안 되면 메세지 띄움 (2015.02.10 LEJ)
  1017. messageBox("중증해당 수술이 있습니다. 상병을", "I007");
  1018. opmessageyn = "Y";
  1019. //}
  1020. }
  1021. if (v192prcpyn == "Y" && chkSuppkind != "05" && chkSuppkind != "32" && chkSuppkind != "34") { // 20090325 차상위 2종추가
  1022. //if (v192diagyn == "N" && opmessageyn == "N") { // 개심/개두 수술인 경우 상병과 상관없이 보조유형 적용 안 되면 메세지 띄움 (2015.02.10 LEJ)
  1023. messageBox("중증해당 수술이 있습니다. 상병을", "I007");
  1024. //}
  1025. }
  1026. // 개두술 관련 적용 약제 추가에 따른 재원심사 알림 메세지 [입퇴 + 외퇴] : (해당 약제 + 해당 상병)이면서 보조유형이 개두술이 아닌 경우 메세지 (2015.02.10 LEJ)
  1027. if (v191prcpyn == "D" && v191diagyn == "Y" && chkSuppkind != "05" && chkSuppkind != "39") {
  1028. messageBox("개심/개두 관련 약제가 있습니다. 보조 유형을", "I007");
  1029. opmessageyn = "Y";
  1030. }
  1031. // 개심술 관련 적용 약제 추가에 따른 재원심사 알림 메세지 [입퇴 + 외퇴] : (해당 약제 + 해당 상병)이면서 보조유형이 개심술이 아닌 경우 메세지 (2015.02.10 LEJ)
  1032. if (v192prcpyn == "D" && v192diagyn == "Y" && chkSuppkind != "05" && chkSuppkind != "39") {
  1033. messageBox("개심/개두 관련 약제가 있습니다. 보조 유형을", "I007");
  1034. opmessageyn = "Y";
  1035. }
  1036. if(insukind == "11" && chkBtn == "True" && chkSuppkind != "05" && chkSuppkind != "06" && chkSuppkind != "32" && chkSuppkind != "39" && cfe != "C" && chkSuppkind != "40" && chkSuppkind != "50" ){ //20090325 차상위 2종추가
  1037. messageBox("중증정보가 존재하는", "I005");
  1038. canceryn = "Y";
  1039. }
  1040. if( (insukind == "21" || insukind == "22") && chkBtn == "True" && chkSuppkind != "05" && chkSuppkind != "06" && chkSuppkind != "32" && cfe != "C" && chkSuppkind != "39" && chkSuppkind != "40" && chkSuppkind != "50" ){ //20090325 차상위 2종추가
  1041. if (!(sixtimyn == "N" && end6yn == "N" && babyyn == "N" && age <= 6)) {
  1042. messageBox("중증정보가 존재하는", "I005");
  1043. }
  1044. }
  1045. } else {
  1046. btn_esscdiag.visible= false;
  1047. }
  1048. // 6시간 미만여부 추가 - 20081105 박창원
  1049. // 진료과 제한 조건 삭제 - 20090219 박창원
  1050. // 조건 삭제 20091008 JHP 박창원 요청.( insukind == "21" || insukind == "22" )
  1051. if (sixtimyn == "N" && babyyn == "Y" &&age == 0 && indd >= "20080101" && (insukind == "11") && suppkind != "31" && cfe != "C" && readonly != "Y") {
  1052. var msg = messageBox("입원한 신생아 입니다. 신생아 유형을 적용","S001");
  1053. if (msg == 6) { // 신생아 요율을 적용한다.
  1054. Insuchange("31");
  1055. }
  1056. }
  1057. // 6시간 미만여부 추가 - 20081105 박창원
  1058. // 진료과 제한조건 삭제 - 20080219 박창원
  1059. // 희귀난치일때 6세미만 메세지 적용안함 - 20100630 박창원
  1060. if (insukind == "11") {
  1061. var opchkyn = model.getValue("/root/main/item11/drginfo/opchkyn");
  1062. var drgmchkyn = model.getValue("/root/main/item11/drginfo/drgmchkyn");
  1063. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  1064. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  1065. var indaycnt = parseInt(model.getValue("/root/main/list1/insulist[fromdd='"+fromdd+"']/indaycnt"));
  1066. if (opchkyn == "Y" && indaycnt <= 30 ) {
  1067. btn_drginfo.attribute("visibility") = "visible";
  1068. } else {
  1069. btn_drginfo.attribute("visibility") = "hidden";
  1070. }
  1071. if (opchkyn == "Y" && (indschacptstat == 'A' || indschacptstat == 'T') && indaycnt <= 30 ) {
  1072. messageBox("DRG 대상입니다.","I");
  1073. } else if ( opchkyn == "Y" && (indschacptstat == 'A' || indschacptstat == 'T') && indaycnt > 30 ) {
  1074. messageBox("DRG 대상입니다만 재원일수 초과 입니다.","I");
  1075. }
  1076. var zdiagcd = model.getValue("/root/main/list3/diaglist[diagcd='Z201']/seqno");
  1077. if (suppkind == "00" && zdiagcd != "") {
  1078. messageBox("잠복결핵 대상입니다.","I");
  1079. }
  1080. if (sixtimyn == "N" && end6yn == "N" && canceryn == "N" && babyyn == "N" && age <= 6 && suppkind != "08" && suppkind != "41" && suppkind != "06"
  1081. && cfe != "C" && suppkind != "40" && readonly != "Y"
  1082. && suppkind != "46" && suppkind != "50" && suppkind != "51" && dschjudgprcsstat != "C") {
  1083. var msg = messageBox("6세미만 환자입니다. 6세미만 유형을 적용","S001");
  1084. if (msg == 6) { // 6세미만 요율을 적용한다.
  1085. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  1086. if (cfe == "E" || cfe == "F") {
  1087. var suppkind = "41";
  1088. } else {
  1089. var suppkind = "08";
  1090. }
  1091. Insuchange(suppkind);
  1092. }
  1093. }
  1094. }
  1095. if (insukind == "21" || insukind == "22"){
  1096. if (sixtimyn == "N" && end6yn == "N" && babyyn == "N" && age <= 6 && suppkind != "08" && suppkind != "41" && readonly != "Y" ) {
  1097. var msg = messageBox("6세미만 환자입니다. 6세미만 유형을 적용","S001");
  1098. if (msg == 6) { // 6세미만 요율을 적용한다.
  1099. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  1100. var suppkind = "08";
  1101. if (cfe == "E" || cfe == "F") {
  1102. suppkind = "41";
  1103. }
  1104. Insuchange(suppkind);
  1105. }
  1106. }
  1107. }
  1108. if (insukind == "31"){
  1109. var paygrntyn = model.getValue("/root/main/item1/iteminfo/paygrntyn");
  1110. if (paygrntyn != "Y") {
  1111. messageBox("자동차보험 지급보증번호 누락입니다.","I007");
  1112. }
  1113. }
  1114. //진료결과 체크 - 중간청구인경우 : 계속, 퇴원인경우 : 퇴원
  1115. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  1116. var ordrslt = model.getValue("/root/main/item1/iteminfo/ordrslt");
  1117. if(dschnotiyn == "Y"){
  1118. if(ordrslt == "" || ordrslt == "-" || ordrslt == "1"){
  1119. if(ordrslt != "4"){
  1120. model.setValue("/root/main/item1/iteminfo/ordrslt","9");
  1121. }
  1122. }
  1123. }else{
  1124. if(ordrslt == "" || ordrslt == "-"){
  1125. model.setValue("/root/main/item1/iteminfo/ordrslt","1");
  1126. }
  1127. }
  1128. //응급 6시간 미만 체크를 위하여 넣어 둔다.
  1129. var ordtype = model.getValue("/root/main/item1/iteminfo/ordtype");
  1130. var brateflag = model.getValue("/root/main/item1/iteminfo/brateflag");
  1131. model.setValue("/root/send/ordtype",ordtype);
  1132. model.setValue("/root/send/brateflag",brateflag);
  1133. //본인부담율이 20%가 아닌 경우 상단정보에 보조유형정보를 붉은 색으로 표시해준다.
  1134. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  1135. var payownbrate = model.getValue("/root/main/item1/iteminfo/ownrate");
  1136. //보험인경우 본인부담율 20%가 아니면 붉은색으로 표시해준다.
  1137. if(insukind == "11"){
  1138. if(payownbrate == "20"){
  1139. opt_suppkind.attribute("class") = "output_fix";
  1140. cmb_suppkind.attribute("class") = "combo_default";
  1141. opt_ownrate.attribute("class") = "output_fix";
  1142. }else{
  1143. opt_suppkind.attribute("color") = "#ff0066";
  1144. cmb_suppkind.attribute("color") = "#ff0066";
  1145. opt_ownrate.attribute("color") = "#ff0066";
  1146. }
  1147. //보호 2종인경우 본인부담율 15%가 아니면 붉은색으로 표시해준다.
  1148. }else if(insukind == "22"){
  1149. if(payownbrate == "15"){
  1150. opt_suppkind.attribute("class") = "output_fix";
  1151. cmb_suppkind.attribute("class") = "combo_default";
  1152. opt_ownrate.attribute("class") = "output_fix";
  1153. }else{
  1154. opt_suppkind.attribute("color") = "#ff0066";
  1155. cmb_suppkind.attribute("color") = "#ff0066";
  1156. opt_ownrate.attribute("color") = "#ff0066";
  1157. }
  1158. //나머지는 정상 색깔로 표시해 준다.
  1159. }else{
  1160. opt_suppkind.attribute("class") = "output_fix";
  1161. cmb_suppkind.attribute("class") = "combo_default";
  1162. opt_ownrate.attribute("class") = "output_fix";
  1163. }
  1164. // 마이그레이션 환자는 조회만 되게 한다. - 20080819 박창원
  1165. var mig = model.getValue("/root/main/item1/iteminfo/mig");
  1166. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  1167. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  1168. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  1169. var dschdclrtyn = model.getValue("/root/main/item1/iteminfo/dschdclrtyn");
  1170. // NST 상태 표시 추가 ( 2015.11.16 LEJ)
  1171. btn_nst.disabled = true;
  1172. btn_nst.attribute("class") = "btn2_letter8";
  1173. btn_nst.attribute("text") = "NST";
  1174. var cnststat = model.getValue("/root/main/item18/cnstinfo/cnststat");
  1175. var nstcnt = model.getValue("/root/main/item18/cnstinfo/nstcnt");
  1176. if (cnststat != "-" && cnststat != ""){
  1177. btn_nst.disabled = false;
  1178. if (nstcnt >= "2" && nstcnt != ""){
  1179. btn_nst.attribute("text") = "NST : " + cnststat + "(" + nstcnt + ")" ;
  1180. } else {
  1181. btn_nst.attribute("text") = "NST : " + cnststat;
  1182. }
  1183. if (cnststat == "회신" || cnststat == "회신확정"){
  1184. btn_nst.attribute("color") = "#ff0066";
  1185. }
  1186. }
  1187. // 심사중
  1188. if (readonly == "Y") {
  1189. btn_save.disabled = true;
  1190. btn_recalc.disabled = true;
  1191. btn_sugicalc.disabled = true;
  1192. btn_dclrtclose.disabled = true;
  1193. btn_dschclose.disabled = true;
  1194. btn_totjudgclose.disabled = true;
  1195. btn_dschclosecancel.disabled = true;
  1196. btn_midregist.disabled = true;
  1197. btn_midregistyn.disabled = true;
  1198. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1199. model.setValue("root/hidden/item1/chksave","Y");
  1200. }else if (indschacptstat == "D") { // 퇴원이 완료되면 세부계산내역 저장이 안되게 20080911
  1201. messageBox("퇴원 처리된 환자입니다. 요율변경 및 계산내역 수정은", "E001");
  1202. btn_save.disabled = true;
  1203. btn_recalc.disabled = true;
  1204. btn_sugicalc.disabled = true;
  1205. btn_dclrtclose.disabled = true;
  1206. btn_dschclose.disabled = true;
  1207. btn_totjudgclose.disabled = true;
  1208. btn_dschclosecancel.disabled = true;
  1209. btn_midregist.disabled = true;
  1210. btn_midregistyn.disabled = true;
  1211. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1212. model.setValue("root/hidden/item1/chksave","Y");
  1213. } else if (indschacptstat == "T" && (dschjudgprcsstat == "C" || dschjudgprcsstat == "E" || dschjudgprcsstat == "G" ) ) { // 가퇴원 일단추가 가퇴원은 재 판단해서 블로킹 로직을 만든다. - 20081005 박창원
  1214. messageBox("가퇴원 처리가된 마감 환자입니다. 요율변경 및 계산내역 수정은", "E001");
  1215. btn_save.disabled = true;
  1216. btn_recalc.disabled = true;
  1217. btn_sugicalc.disabled = true;
  1218. btn_dclrtclose.disabled = true;
  1219. btn_dschclose.disabled = true;
  1220. btn_totjudgclose.disabled = true;
  1221. btn_dschclosecancel.disabled = false;
  1222. btn_midregist.disabled = true;
  1223. btn_midregistyn.disabled = true;
  1224. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1225. model.setValue("root/hidden/item1/chksave","Y");
  1226. } else if (dschjudgprcsstat == "B" ) {
  1227. if ( lastjudgendid != userid ) {
  1228. messageBox(lastjudgendnm + "님이 퇴원심사 진행중입니다. 저장은", "E001");
  1229. btn_save.disabled = true;
  1230. btn_recalc.disabled = true;
  1231. btn_sugicalc.disabled = true;
  1232. btn_dclrtclose.disabled = true;
  1233. btn_dschclose.disabled = true;
  1234. btn_totjudgclose.disabled = true;
  1235. btn_dschclosecancel.disabled = true;
  1236. btn_midregist.disabled = true;
  1237. btn_midregistyn.disabled = true;
  1238. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1239. model.setValue("root/hidden/item1/chksave","Y");
  1240. } else {
  1241. btn_dschclosecancel.disabled = true;
  1242. if (dschnotiyn == "Y") { // 퇴원확정인 경우 예고 심사 비활성
  1243. btn_dclrtclose.disabled = true;
  1244. } else if (dschdclrtyn == "Y" && dschnotiyn == "N") { // 퇴원예고인 경우 퇴원마감, 통합마감 비활성
  1245. btn_dschclose.disabled = true;
  1246. btn_totjudgclose.disabled = true;
  1247. }
  1248. }
  1249. // 심사완료, 통합심사완료
  1250. } else if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E" || dschjudgprcsstat == "G" ) {
  1251. messageBox("퇴원마감이나 통합심사마감 처리가된 환자입니다. 요율변경 및 계산내역 수정은", "E001");
  1252. btn_save.disabled = true;
  1253. btn_recalc.disabled = true;
  1254. btn_sugicalc.disabled = true;
  1255. btn_dclrtclose.disabled = true;
  1256. btn_dschclose.disabled = true;
  1257. btn_totjudgclose.disabled = true;
  1258. btn_midregist.disabled = true;
  1259. btn_midregistyn.disabled = true;
  1260. btn_dschclosecancel.disabled = false;
  1261. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1262. model.setValue("root/hidden/item1/chksave","Y");
  1263. } else if (dschjudgprcsstat == "A" && dschnotiyn == "N") {
  1264. btn_dschclose.disabled = true;
  1265. btn_totjudgclose.disabled = true;
  1266. btn_dschclosecancel.disabled = true;
  1267. if (dschdclrtyn == "N") { // 퇴원예고 안 된 경우 예고심사 비활성
  1268. btn_dclrtclose.disabled = true;
  1269. }
  1270. } else if (dschjudgprcsstat == "A" && dschnotiyn == "Y") {
  1271. btn_dschclosecancel.disabled = true;
  1272. btn_dclrtclose.disabled = true;
  1273. //} else if (orddeptcd == "2280000000" && dschnotiyn == "Y" && sixtimyn == "Y" ) { // 응급실환자의 경고 alert 추가 - 20081003 박창원
  1274. // 20091019 JHP 번호가 하드코딩되어있어서 삭제함 기존("... 응급수납 T.1813으로 연락후...") 번호삭제 - 이미숙 요청
  1275. // var msg = messageBox("수납이 가능한 상태입니다.(응급실은 무심사 퇴원 가능함),처방수정을 하시려면 반드시 응급수납으로 연락후 처리하시기 바랍니다. 처방 검색만 하시려면(수정불가)","S001");
  1276. // if (msg == 6) {
  1277. // btn_save.disabled = true;
  1278. // btn_recalc.disabled = true;
  1279. // btn_sugicalc.disabled = true;
  1280. // btn_dschclose.disabled = true;
  1281. // btn_totjudgclose.disabled = true;
  1282. // btn_midregist.disabled = true;
  1283. // btn_midregistyn.disabled = true;
  1284. // btn_dschclosecancel.disabled = false;
  1285. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  1286. // model.setValue("root/hidden/item1/chksave","Y");
  1287. // }
  1288. }
  1289. //if (indschacptstat == "T" && (dschjudgprcsstat == "A" || dschjudgprcsstat == "B" || dschjudgprcsstat == "F") ) { // 가퇴원 메세지 추가 - 20081005 박창원
  1290. // messageBox("가퇴원 환자","I009");
  1291. //}
  1292. // AS-IS 데이터가 비정상적인 액팅이 되었을때 alert - 20081013 박창원 - 한시적 루틴
  1293. var abnormalactingyn = model.getValue("/root/main/item1/iteminfo/abnormalactingyn");
  1294. var abnormalexip = model.getValue("/root/main/item1/iteminfo/abnormalexip");
  1295. var abnormaliscl = model.getValue("/root/main/item1/iteminfo/abnormaliscl");
  1296. var indate = model.getValue("/root/main/item1/iteminfo/indd1");
  1297. var spcdrugyn = model.getValue("/root/main/item1/iteminfo/spcdrugyn") ;
  1298. var dcuc = model.getValue("/root/main/item1/iteminfo/dcuc");
  1299. var jinyn = model.getValue("/root/main/item1/iteminfo/jinyn");
  1300. var erjinyn = model.getValue("/root/main/item1/iteminfo/erjinyn");
  1301. if (abnormalactingyn == "Y" && indate < opendd) {
  1302. messageBox("AS-IS 처방이 비정상적으로 TO-BE 기간에 시행된 처방이 있습니다.","I007");
  1303. }
  1304. // 특수조제료 발생 처방이 있는데 주사제무균조제료가 발생하지 않았을 경우 메세지 - 20081108 박창원
  1305. // 계산내역에 IJ0041 <> ast.adbmdrug - pcldrug ='D'
  1306. // IJ0042 <> ast.adbmdrug - pcldrug in ('B','T')
  1307. // IJ0043 <> ast.adbmdrug - pcldrug ='C' 계산내역에 주사무균조제료 갯수와 처방갯수가 틀리면 메시지 처리
  1308. if (spcdrugyn == "Y" && dschnotiyn == "Y") {
  1309. messageBox("주사제 무균조제료 발생 오류입니다.","I007");
  1310. }
  1311. // 실시처방과 계산내역이 맞지 않을경우 Alert - 20081110 박창원
  1312. if ( (abnormaliscl == "Y" || abnormalexip == "Y") && dschnotiyn == "Y")
  1313. {
  1314. messageBox("실시내역과 계산내역이 일치하지 않습니다. 재계산 후.","I007");
  1315. }
  1316. // 미시행 처방이 있을 경우 alert - 20081013 박창원
  1317. if (dschnotiyn == "Y" && fChkClose() == false) {
  1318. messageBox("미 시행된 처방이 있습니다.","I007");
  1319. }
  1320. if (dcuc == "G") {
  1321. messageBox("긴급지원 대상자 입니다.","I007");
  1322. }
  1323. // 동일과 내 1회 이상 진찰료(응급 전문의진찰료 포함) 발생 시 메세지 (2016.01.14 LEJ)
  1324. if (jinyn == "Y") {
  1325. messageBox("동일과 내 1회 이상 진찰료(응급 전문의진찰료 포함)가 발생했습니다.","I007");
  1326. }
  1327. // KTAS 4,5등급 환자에 응급 전문의진찰료 발생 시 메세지 (2016.01.14 LEJ)
  1328. if (erjinyn == "Y") {
  1329. messageBox("KTAS 4,5등급 환자에 응급 전문의진찰료가 발생했습니다.","I007");
  1330. }
  1331. // 명단위, 줄단위에 따라 특정코드 콤보 리스트 변경 및 특정코드에 해당하는 상세설명 적용
  1332. var p0117list = instance1.selectSingleNode("/root/init/P0117list");
  1333. for (var i=0; i<grd_clcjlist.rows; i++) {
  1334. var unitflag = model.getValue("/root/main/list4/clcjlist["+ i + "]/unitflag");
  1335. var spclcd = model.getValue("/root/main/list4/clcjlist["+ i + "]/spclcd");
  1336. if (unitflag == "M") {
  1337. if (p0117list != null) {
  1338. var p0117 = p0117list.childNodes;
  1339. for (var j = 1; j <= p0117.length; j++) {
  1340. var cdid = model.getValue("/root/init/P0117list/P0117["+ j +"]/cdid");
  1341. if (cdid == spclcd) {
  1342. model.setValue("/root/main/list4/clcjlist["+ i +"]/detldesc", model.getValue("/root/init/P0117list/P0117["+ j +"]/detldesc"));
  1343. j = p0117.length + 1;
  1344. }
  1345. }
  1346. }
  1347. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M' and cdid != 'MX999']";
  1348. } else if (unitflag == "J") {
  1349. if (p0117list != null) {
  1350. var p0117 = p0117list.childNodes;
  1351. for (var j = 1; j <= p0117.length; j++) {
  1352. var cdid = model.getValue("/root/init/P0117list/P0117["+ j +"]/cdid");
  1353. if (cdid == spclcd) {
  1354. model.setValue("/root/main/list4/clcjlist["+ i +"]/detldesc", model.getValue("/root/init/P0117list/P0117["+ j +"]/detldesc"));
  1355. j = p0117.length + 1;
  1356. }
  1357. }
  1358. }
  1359. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J']";
  1360. }
  1361. }
  1362. // 최적화 문제로 추가 - 20081015 박창원
  1363. grd_clcjlist.refresh();
  1364. var orddeptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  1365. var erorddeptcd = model.getValue("/root/main/item1/iteminfo/erorddeptcd");
  1366. // 의료급여 정신과정액인경우 보조유형 메시지 처리
  1367. if ((insukind == "21" || insukind == "22")
  1368. && (suppkind != "14")
  1369. && (orddeptcd == "2030000000" || erorddeptcd == "2030000000")) {
  1370. messageBox("의료급여 정신과정액환자입니다. 보조유형을 14. 보호정신과정액으로 변경하세요.","I007");
  1371. }
  1372. model.refresh();
  1373. }
  1374. // 처방 색깔 항 구분에 따라 흰색-회색 구분되도록 처리한다.
  1375. function fSetOrderColorByEdiitem() {
  1376. var rowcnt = grd_ordlist.rows;
  1377. var ediitem2 = "";
  1378. var color = "#f4f4f4";
  1379. for (var i = 0; i < rowcnt; i++) { // Grid 필터링 이후 Grid 상에 표시된 처방 개수만큼 돌면서
  1380. //for (var i = 1; i < grd_ordlist.rows; i++) { // Grid 필터링 이후 Grid 상에 표시된 처방 개수만큼 돌면서
  1381. //Color 표시 범례
  1382. //1. 문제처방 : #fcd2c1
  1383. //2. 선별심사 : #ffe79d
  1384. //3. 선별심사 + 문제처방 : #7BE6B7
  1385. //4. 야간, 공휴가산 : #ffff00(밝은노랑)
  1386. var status = grd_ordlist.rowHidden(i);
  1387. if (status == false) {
  1388. var ediitem1 = grd_ordlist.valueMatrix(i, grd_ordlist.colRef("item1"));
  1389. if (ediitem1.length > 0) {
  1390. if (ediitem1 == ediitem2) {
  1391. grd_ordlist.rowStyle(i,"data","background-color") = color;
  1392. } else {
  1393. ediitem2 = ediitem1;
  1394. if (color == "#ffffff") {
  1395. grd_ordlist.rowStyle(i,"data","background-color") = "#f4f4f4";
  1396. color = "#f4f4f4";
  1397. } else {
  1398. grd_ordlist.rowStyle(i,"data","background-color") = "#ffffff";
  1399. color = "#ffffff";
  1400. }
  1401. }
  1402. }
  1403. }
  1404. }
  1405. }
  1406. // 상단에 환자정보 기입하기
  1407. // 수정추가 : 20091006 JHP 상단정보로 파라미터 값 넘길때 기존엔 param 에 첫번재 값이 기준없이 무조건 I였는데 .응급기준을 확인하여 응급일때는 E로 나머지는 I로 셋팅한다.
  1408. function fSetOutPatPamInfo() {
  1409. var pid = model.getValue("root/main/item1/iteminfo/pid");
  1410. var indd = model.getValue("root/main/item1/iteminfo/indd1");
  1411. var cretno = model.getValue("root/main/item1/iteminfo/cretno");
  1412. var instcd = model.getValue("root/main/item1/iteminfo/instcd");
  1413. var ordtype = model.getValue("root/main/item1/iteminfo/ordtype");
  1414. // 수정추가 퇴원환자일경우 상단정보 파라미터에 srchdd를 퇴원일자로 넣어주고 아니면 현재일자를 넣어준다. 20090916, JHP,(현대김영학 참조)
  1415. var indschacptstat = model.getValue("root/main/item1/iteminfo/indschacptstat");
  1416. var dschdd = model.getValue("root/main/item1/iteminfo/dschdd");
  1417. if(indschacptstat == "D" || indschacptstat == "T"){
  1418. var srchdd = dschdd;
  1419. }else{
  1420. var srchdd = VAL_today;
  1421. }
  1422. // param 첫번째 붙는 값은 외래 : O, 입원 : I, 지원부서 : S, 수술 : T, 응급 : E, 의뢰 : C
  1423. //var param = "I" + "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd + "▦" + srchdd;
  1424. if(ordtype == "E"){
  1425. var param = "E" + "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd + "▦" + srchdd;
  1426. }else{
  1427. var param = "I" + "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd + "▦" + srchdd;
  1428. }
  1429. setParameter("condparam", param);
  1430. setParameter("errflag", "Y");
  1431. modal("SPMMO08900", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  1432. var useyn = getParameter("SPMMO08900_rtn_useyn");
  1433. if(useyn == "Y") {
  1434. setParameter("SPMMO08900_rtn_useyn", "");
  1435. }else{
  1436. }
  1437. }
  1438. function fGetOperStat() {
  1439. submit("TRPIJ00314",false);
  1440. }
  1441. // 처방내역을 갖고 온다.
  1442. function fGetIsclList(paramFlag){
  1443. // 수정추가 paramFlag에따라서 조회조건 놔둔다. 20090728 JHP
  1444. if(paramFlag == "IPHS"){
  1445. // 재원심사메인화면 우측상단 유형에서 더블클릭햇을때...JHP 20090728
  1446. // 더블클릭시 값 지정하기에 따로 값셋팅안한다. ...JHP 20090728
  1447. }else if(paramFlag == "Srch"){
  1448. // 대상자조회에서 퇴원모드시 조회조건의 값이 있으면 이걸로 셋팅한다. ...JHP 20090728
  1449. // 수정추가 JHP 20090427 퇴원모드조회조건 추가.. 신규 시작
  1450. var dschmodesrch = model.getValue("/root/send/dschmodesrch"); // 퇴원모드 조회 조건
  1451. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacpstat"); // 입퇴원진행상태
  1452. var lastjudgdt = model.getValue("/root/main/item1/iteminfo/lastjudgdt"); // 최종심사일시
  1453. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd"); // 최종중간청구일시
  1454. var indd = model.getValue("/root/main/item1/iteminfo/indd1"); // 입원일
  1455. var lastjudgdt2 = "";
  1456. var lastmdlclamdd2 = "";
  1457. if (lastjudgdt != "" && lastjudgdt != "-") {
  1458. // 수정, 최종심사일 다음날이 아니라 해당일부터여서 하루 더하는거 뺌. 20090729 JHP(yyy)요청
  1459. lastjudgdt2 = lastjudgdt.toDate("YYYYMMDD");
  1460. //lastjudgdt2 = lastjudgdt2.getAddDate(1);
  1461. lastjudgdt2 = lastjudgdt2.getDateFormat();
  1462. }
  1463. // lastmdlclamdd 에 하루를 더한다.(중간청구 일자가 있으면)
  1464. if (lastmdlclamdd != "" && lastmdlclamdd != "-" && lastmdlclamdd == null) {
  1465. lastmdlclamdd2 = lastmdlclamdd.toDate("YYYYMMDD");
  1466. lastmdlclamdd2 = lastmdlclamdd2.getAddDate(1);
  1467. lastmdlclamdd2 = lastmdlclamdd2.getDateFormat();
  1468. }
  1469. if(dschmodesrch == "1"){
  1470. if (lastmdlclamdd != "" && lastmdlclamdd != "-" && lastmdlclamdd == null) {
  1471. if(lastmdlclamdd2 >= VAL_today){
  1472. model.setValue("/root/send/ordfromdd",VAL_today);
  1473. } else {
  1474. model.setValue("/root/send/ordfromdd",lastmdlclamdd2);
  1475. }
  1476. model.setValue("/root/send/ordtodd",VAL_today);
  1477. } else {
  1478. model.setValue("/root/send/ordfromdd", indd);
  1479. model.setValue("/root/send/ordtodd", VAL_today);
  1480. }
  1481. }else if(dschmodesrch == "2"){
  1482. if(lastjudgdt != "" && lastjudgdt != "-"){
  1483. if(lastjudgdt2 >= VAL_today){
  1484. model.setValue("/root/send/ordfromdd",VAL_today);
  1485. } else {
  1486. model.setValue("/root/send/ordfromdd",lastjudgdt2);
  1487. }
  1488. model.setValue("/root/send/ordtodd",VAL_today);
  1489. }else{
  1490. model.setValue("/root/send/ordfromdd", indd);
  1491. model.setValue("/root/send/ordtodd", VAL_today);
  1492. }
  1493. }else{
  1494. // 아무것도 아닐때는 (퇴원모드조건아니면...) 처방구분 아무것도 아닌거하고 같다.
  1495. //model.setValue("/root/send/ordfromdd", fromdd);
  1496. //model.setValue("/root/send/ordtodd", todd);
  1497. var ordfromdd = model.getValue("/root/send/fromdd");
  1498. var ordtodd = model.getValue("/root/send/todd");
  1499. var maxhopedd = model.getValue("/root/main/item1/iteminfo/maxhopedd");
  1500. var tmp = model.getValue("/root/main/item1/iteminfo/lastjudgdt");
  1501. var lastjudgdt = tmp.substr(0,4) + tmp.substr(4,2) + tmp.substr(6,2);
  1502. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  1503. var dschdd = model.getValue("/root/main/item1/iteminfo/dschdd");
  1504. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  1505. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  1506. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd");
  1507. // ordfromdd는 기본적으로 입원일로
  1508. ordfromdd = indd;
  1509. // ordtodd가 99991231이면 현재일로 set
  1510. if (ordtodd == "99991231") {
  1511. ordtodd = VAL_today;
  1512. }
  1513. // maxhopedd가 있는 경우에는 ordtodd를 maxhopedd로 set
  1514. if (maxhopedd != "") {
  1515. ordtodd = maxhopedd
  1516. }
  1517. // 최종심사일자가 있는 경우 최종심사일로 부터 시작일을 설정
  1518. if (lastjudgdt != "" && lastjudgdt != "-") {
  1519. ordfromdd = lastjudgdt;
  1520. }
  1521. // 퇴원환자 처리
  1522. if (indschacptstat == "D") {
  1523. ordfromdd = indd;
  1524. ordtodd = dschdd;
  1525. /* if (lastmdlclamdd != "") {
  1526. ordfromdd = lastmdlclamdd;
  1527. } */
  1528. } else if (dschnotiyn == "Y") { // 퇴원확정환자는 디폴트로 입원일부터 중간청구 발생자는 중간청구 이후로
  1529. ordfromdd = indd;
  1530. if (lastmdlclamdd != "" && lastmdlclamdd != "-") {
  1531. ordfromdd = lastmdlclamdd;
  1532. }
  1533. }
  1534. // 시작일이 종료일보다 큰경우 종료일을 시작일과 동일하게 맞추어 준다.
  1535. if (ordfromdd > ordtodd) {
  1536. ordtodd = ordfromdd;
  1537. }
  1538. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  1539. if (ordfromdd < opendd) {
  1540. ordfromdd = opendd;
  1541. }
  1542. model.setValue("/root/send/ordfromdd", ordfromdd);
  1543. model.setValue("/root/send/ordtodd", ordtodd);
  1544. }
  1545. // 수정추가 JHP 20090427 퇴원모드조회조건 추가.. 신규 끝
  1546. }else{
  1547. // 기타는 값을 넣지 않아서 기본적으로 원래것을 타게 한다. ...JHP 20090728
  1548. // 날짜 조회 전면 수정함 - 20081111 박창원
  1549. /* [재원조회기간]
  1550. 1-1. 재원심사 (재원퇴원심사 불문하고)
  1551. default 심사일자~max hopdd(없으면 현재일)까지 조회
  1552. 심사중에 조회기간을 조정시 상세내역 닫힌 후에도 그 환자를 저장하고 나가기 전까지는 그 조회기간으로 조회
  1553. 상세에서 기간을 조회하면 메인화면도 조정됨
  1554. 1-2. 체크박스 체크시(메인화면에서)
  1555. default 입원시작일~max hopdd
  1556. 중간청구시작일~오늘일자(중간청구한 환자-청구생성완료)
  1557. 심사중에 조회기간을 조정시 상세내역 닫힌 후에도 그 환자를 저장하고 나가기 전까지는 그 조회기간으로 조회
  1558. 상세에서 기간을 조회하면 메인화면도 조정됨
  1559. 2. 퇴원 완료된 환자 조회시
  1560. 입원일~퇴원일
  1561. 중간청구시작일~오늘일자(중간청구한 환자-청구생성완료) */
  1562. var ordfromdd = model.getValue("/root/send/fromdd");
  1563. var ordtodd = model.getValue("/root/send/todd");
  1564. var maxhopedd = model.getValue("/root/main/item1/iteminfo/maxhopedd");
  1565. var tmp = model.getValue("/root/main/item1/iteminfo/lastjudgdt");
  1566. var lastjudgdt = tmp.substr(0,4) + tmp.substr(4,2) + tmp.substr(6,2);
  1567. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  1568. var dschdd = model.getValue("/root/main/item1/iteminfo/dschdd");
  1569. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  1570. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  1571. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd");
  1572. // ordfromdd는 기본적으로 입원일로
  1573. ordfromdd = indd;
  1574. // ordtodd가 99991231이면 현재일로 set
  1575. if (ordtodd == "99991231") {
  1576. ordtodd = VAL_today;
  1577. }
  1578. // maxhopedd가 있는 경우에는 ordtodd를 maxhopedd로 set
  1579. if (maxhopedd != "") {
  1580. ordtodd = maxhopedd
  1581. }
  1582. // 최종심사일자가 있는 경우 최종심사일로 부터 시작일을 설정
  1583. if (lastjudgdt != "" && lastjudgdt != "-") {
  1584. ordfromdd = lastjudgdt;
  1585. }
  1586. // 퇴원환자 처리
  1587. if (indschacptstat == "D") {
  1588. ordfromdd = indd;
  1589. ordtodd = dschdd;
  1590. /* if (lastmdlclamdd != "") {
  1591. ordfromdd = lastmdlclamdd;
  1592. } */
  1593. } else if (dschnotiyn == "Y") { // 퇴원확정환자는 디폴트로 입원일부터 중간청구 발생자는 중간청구 이후로
  1594. ordfromdd = indd;
  1595. if (lastmdlclamdd != "" && lastmdlclamdd != "-") {
  1596. ordfromdd = lastmdlclamdd;
  1597. }
  1598. }
  1599. // 시작일이 종료일보다 큰경우 종료일을 시작일과 동일하게 맞추어 준다.
  1600. if (ordfromdd > ordtodd) {
  1601. ordtodd = ordfromdd;
  1602. }
  1603. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  1604. if (ordfromdd < opendd) {
  1605. ordfromdd = opendd;
  1606. }
  1607. model.setValue("/root/send/ordfromdd", ordfromdd);
  1608. model.setValue("/root/send/ordtodd", ordtodd);
  1609. }
  1610. model.setValue("/root/send/mig", model.getValue("/root/main/item1/iteminfo/mig"));
  1611. model.refresh();
  1612. //처방조회 옵션에 항목구분에 처방이 있는 것만 Bold로 보여준다.
  1613. fSetItemBold();
  1614. // 20091126 수정추가 JHP 요청번호 8496, 주사제 4항1목, 마취제 5항 1목에 대해 1회량이 20이 넘으면 메세지 처리요청 ####################시작
  1615. fChkinjanstmsg();
  1616. }
  1617. // 처방내역을 갖고 온다.
  1618. function fGetIsclList_FromTo(){
  1619. //model.resetInstanceNode("/root/send");
  1620. var ordfromdd = model.getValue("/root/send/ordfromdd");
  1621. var ordtodd = model.getValue("/root/send/ordtodd");
  1622. //처방조회 시작일자와 종료일자가 없는 경우 보험내역 시작 종료일로 셋팅해 준다.
  1623. if(ordfromdd == ""){
  1624. model.setValue("/root/send/ordfromdd", model.getValue("/root/send/fromdd"));
  1625. }
  1626. if(ordtodd == ""){
  1627. model.setValue("/root/send/ordtodd", model.getValue("/root/send/todd"));
  1628. }
  1629. if(ipt_pid.currentText.length >0) {
  1630. var row = grd_ordlist.row;
  1631. model.removeNodeset("/root/main/list2/iscllist");
  1632. grd_ordlist.refresh();
  1633. submit("TRPIJ00302");
  1634. //model.refresh(); 최적화 문제로 대체
  1635. //model.refreshpart("/root/main/list2/iscllist");
  1636. grd_ordlist.row = row;
  1637. grd_ordlist.topRow = row - 3;
  1638. //처방조회 옵션에 항목구분에 처방이 있는 것만 Bold로 보여준다.
  1639. fSetItemBold();
  1640. } else {
  1641. messageBox("환자번호를","C001");
  1642. return;
  1643. }
  1644. }
  1645. // 진료비 계산내역을 갖고 온다.
  1646. function fGetCalc(){
  1647. if(ipt_pid.currentText.length >0)
  1648. {
  1649. model.resetInstanceNode("/root/main/item2/itemcalc");
  1650. var totalsumflag = model.getValue("/root/send/totalsumflag");
  1651. if(!totalsumflag){
  1652. model.setValue("/root/send/totalsumflag","N");
  1653. }
  1654. submit("TRPIJ00303");
  1655. if(!totalsumflag){
  1656. model.setValue("/root/send/totalsumflag","");
  1657. }
  1658. }else
  1659. {
  1660. //messageBox("환자번호를","C001");
  1661. return;
  1662. }
  1663. }
  1664. //중간청구 등록여부, 심사 마감상태, 문제환자여부, dump 유무 를 체크하여 버튼의 색상을 셋팅해준다.
  1665. function fSetItemInfoSetting(){
  1666. //중간청구 등록 여부
  1667. var midcflag = model.getValue("/root/main/item1/iteminfo/midcflag");
  1668. //분할 제외 대상자 여부
  1669. var midregistyn = model.getValue("/root/main/item1/iteminfo/midregistyn");
  1670. if(midcflag == "Y"){
  1671. btn_midregist.attribute("class") = "btn2_letter6";
  1672. btn_midregist.attribute("color") = "#ff0066";
  1673. btn_midregist.disabled = false;
  1674. btn_midregistyn.disabled = true;
  1675. btn_midcomplete.disabled= false;
  1676. btn_midcancel.disabled = false;
  1677. } else {
  1678. btn_midregist.attribute("class") = "btn2_letter6";
  1679. btn_midregistyn.disabled = false;
  1680. btn_midcomplete.disabled= true;
  1681. btn_midcancel.disabled = true;
  1682. // 분할 제외 대상자 인 경우
  1683. if (midregistyn == "Y") {
  1684. btn_midregistyn.attribute("class") = "btn2_letter6";
  1685. btn_midregistyn.attribute("color") = "#ff0066";
  1686. btn_midregist.disabled = true;
  1687. } else {
  1688. btn_midregistyn.attribute("class") = "btn2_letter6";
  1689. //btn_midregistyn.attribute("class") = "btn2_letter6";
  1690. btn_midregist.disabled = false;
  1691. }
  1692. }
  1693. //퇴원심사 상태
  1694. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  1695. if(dschjudgprcsstat == "C" ){ //퇴원마감
  1696. btn_dschclose.attribute("class") = "btn5_letter6";
  1697. btn_dschclose.attribute("color") = "#ff0066";
  1698. btn_totjudgclose.attribute("class") = "btn2_letter6";
  1699. btn_midcancel.visible = true;
  1700. }else if(dschjudgprcsstat == "E" ){ //통합심사마감
  1701. btn_totjudgclose.attribute("class") = "btn5_letter6";
  1702. btn_totjudgclose.attribute("color") = "#ff0066";
  1703. btn_dschclose.attribute("class") = "btn2_letter6";
  1704. }else{
  1705. btn_dschclose.attribute("class") = "btn2_letter6";
  1706. btn_totjudgclose.attribute("class") = "btn2_letter6";
  1707. btn_midcancel.visible = false;
  1708. }
  1709. //문제환자 여부
  1710. var probjudgflag = model.getValue("/root/main/item1/iteminfo/probjudgflag");
  1711. if(probjudgflag == "G"){
  1712. model.setValue("/root/hidden/item1/probpatgreen","Y");
  1713. model.setValue("/root/hidden/item1/probpatred","");
  1714. }else if(probjudgflag == "R"){
  1715. model.setValue("/root/hidden/item1/probpatred","Y");
  1716. model.setValue("/root/hidden/item1/probpatgreen","");
  1717. }else{
  1718. model.setValue("/root/hidden/item1/probpatgreen","");
  1719. model.setValue("/root/hidden/item1/probpatred","");
  1720. }
  1721. //dump 유무 : 버튼 빨간색 표기
  1722. var dumpexistyn = model.getValue("/root/main/item1/iteminfo/dumpexistyn");
  1723. if(dumpexistyn == "Y"){
  1724. btn_dump.attribute("class") = "btn2_letter6";
  1725. btn_dump.attribute("color") = "#ff0066";
  1726. btn_dump.disabled = false;
  1727. }else{
  1728. btn_dump.attribute("class") = "btn2_letter6";
  1729. }
  1730. var recalcyn = model.getValue("/root/main/item1/iteminfo/recalcyn");
  1731. if(recalcyn == "Y"){
  1732. btn_recalc.attribute("class") = "btn2_letter6";
  1733. btn_recalc.attribute("color") = "#ff0066";
  1734. btn_recalc.disabled = false;
  1735. }else{
  1736. btn_recalc.attribute("class") = "btn2_letter6";
  1737. }
  1738. }
  1739. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1740. //상병처리 관련 코딩 시작 //
  1741. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1742. // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "상병순서 위로"
  1743. function fDiagSeqUp() {
  1744. var rowstatus = grd_diaglist.rowstatus(grd_diaglist.row);
  1745. if (rowstatus == 4) { // 4 : delete
  1746. return;
  1747. }
  1748. var diagseq = parseInt(model.getValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno")); // 선택된 줄의 NO
  1749. if (diagseq > 1) { // 첫번째 줄이 아닌 경우
  1750. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno", --diagseq);
  1751. if (rowstatus == 0 || rowstatus == 2) {
  1752. grd_diaglist.rowstatus(grd_diaglist.row) = 2; // 2 : update
  1753. }
  1754. // 바로 위 상병순서와 중복되는 경우
  1755. var nextrow = grd_diaglist.row - 1;
  1756. var nextdiagseq = model.getValue("/root/main/list3/diaglist["+ nextrow +"]/seqno");
  1757. if (diagseq == nextdiagseq) {
  1758. model.setValue("/root/main/list3/diaglist["+ nextrow +"]/seqno", ++diagseq);
  1759. // rowstatus = grd_diaglist.rowstatus(nextrow);
  1760. // if (rowstatus == 0 || rowstatus == 2) {
  1761. // grd_diaglist.rowstatus(nextrow) = 2; // 2 : update
  1762. // }
  1763. }
  1764. fSortDiagNo();
  1765. }
  1766. }
  1767. // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "상병순서 아래로"
  1768. function fDiagSeqDown() {
  1769. var rowstatus = grd_diaglist.rowstatus(grd_diaglist.row);
  1770. if (rowstatus == 4) { // 4 : delete
  1771. return;
  1772. }
  1773. // 삭제 상태가 아닌 마지막 줄을 찾는다.
  1774. var lastRow = grd_diaglist.rows - 1;
  1775. for (var i = 1; i < grd_diaglist.rows; i++) {
  1776. if (grd_diaglist.rowstatus(i) == 4) { // delete
  1777. lastRow = i - 1;
  1778. i = grd_diaglist.rows;
  1779. }
  1780. }
  1781. var diagseq = parseInt(model.getValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno")); // 선택된 줄의 NO
  1782. if (diagseq < lastRow) { // 마지막 줄이 아닌 경우
  1783. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno", ++diagseq);
  1784. if (rowstatus == 0 || rowstatus == 2) {
  1785. grd_diaglist.rowstatus(grd_diaglist.row) = 2; // 2 : update
  1786. }
  1787. // 바로 아래 상병순서와 중복되는 경우
  1788. var nextrow = grd_diaglist.row + 1;
  1789. var nextdiagseq = model.getValue("/root/main/list3/diaglist["+ nextrow +"]/seqno");
  1790. if (diagseq == nextdiagseq) {
  1791. model.setValue("/root/main/list3/diaglist["+ nextrow +"]/seqno", --diagseq);
  1792. }
  1793. fSortDiagNo();
  1794. }
  1795. }
  1796. // "상병순서 위로/아래로" 순서 변경 후에 상병 순서 NO에 따라 sorting 작업
  1797. function fSortDiag() {
  1798. var maxRow = parseInt(grd_diaglist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다
  1799. grd_diaglist.sort(1, 1, maxRow, 1) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1
  1800. // model.refresh(); 최적화문제로 대체 20080731 박창원
  1801. model.refreshpart("/root/main/list3/diaglist");
  1802. // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
  1803. grd_diaglist.gridToInstance();
  1804. }
  1805. // "상병순서 위로/아래로" 순서 변경 후에 상병 순서 NO에 따라 sorting 작업
  1806. function fSortDiagNo2() {
  1807. var delcnt = 0;
  1808. for (var i = 1; i < grd_diaglist.rows; i++) {
  1809. grd_diaglist.rowHidden(i) = false;
  1810. }
  1811. var cldino = 1;
  1812. for (var i = 1; i < grd_diaglist.rows; i++) {
  1813. model.setValue("/root/main/list3/diaglist[" + i + "]/seqno", i);
  1814. rowstatus = grd_diaglist.rowstatus(i);
  1815. }
  1816. var maxRow = parseInt(grd_diaglist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다
  1817. grd_diaglist.sort(1, grd_diaglist.colRef("seqno"), maxRow , grd_diaglist.colRef("seqno")) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1 / col = 3 : no
  1818. if (delcnt > 0) {
  1819. grd_diaglist.sort(1, grd_diaglist.colRef("seqno"), maxRow - delcnt, grd_diaglist.colRef("seqno")) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1 / col = 3 : no
  1820. }
  1821. // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
  1822. grd_diaglist.gridToInstance();
  1823. var rowstatus;
  1824. for (var i = 1; i < grd_diaglist.rows; i++) {
  1825. rowstatus = grd_diaglist.rowstatus(i);
  1826. if (rowstatus > 3) { // 삭제상태
  1827. grd_diaglist.rowHidden(i) = true;
  1828. } else {
  1829. grd_diaglist.rowHidden(i) = false;
  1830. }
  1831. }
  1832. }
  1833. function fSortDiagNo() {
  1834. var maxRow = parseInt(grd_diaglist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다
  1835. grd_diaglist.sort(1, 1, maxRow, 1) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1
  1836. // model.refresh(); 최적화문제로 대체 20080731 박창원
  1837. model.refreshpart("/root/main/list3");
  1838. // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
  1839. grd_diaglist.gridToInstance();
  1840. //루핑을 돌면서 순번을 맞춰주고, 모두 insert모드로 바꿔준다.
  1841. //상병은 History를 남기지 않고 그냥 모두 삭제 후 다시 insert로 처리한다.
  1842. //상병 순번이 key라서 update로 하면 바뀐 seq입력시 기존것이 아직 안바뀌었으면 Dup에러 발생함으로.
  1843. for(i =1; i<grd_diaglist.rows;i++){
  1844. model.setValue("/root/main/list3/diaglist[" + i + "]/seqno", i);
  1845. grd_diaglist.rowstatus(i) = 1;
  1846. }
  1847. }
  1848. function fDiagGridAddRow(addyn, selectyn) {
  1849. var iInsertRow = 0;
  1850. if (grd_diaglist.rows == 1 || addyn == "Y") {
  1851. iInsertRow = grd_diaglist.row;
  1852. grd_diaglist.addRow(false, false);
  1853. } else {
  1854. iInsertRow = grd_diaglist.row;
  1855. grd_diaglist.insertRow(iInsertRow, "below", false,false);
  1856. }
  1857. var nowRow = 0;
  1858. nowRow = grd_diaglist.row;
  1859. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno", grd_diaglist.row);
  1860. // 청구과, 진료개시일은 주상병을 기준으로 부여한다.
  1861. var clamdeptcd = model.getValue("/root/main/list3/diaglist/orddeptcd");
  1862. if (clamdeptcd == "") { // 주상병의 진료과가 입력되지 않은 경우 인적사항의 청구과를 입력한다.
  1863. clamdeptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  1864. }
  1865. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/orddeptcd", clamdeptcd);
  1866. var ordfromdd = model.getValue("/root/main/list3//diaglist/ordfromdd");
  1867. if (ordfromdd) {
  1868. model.setValue("/root/main/list3//diaglist["+ grd_diaglist.row +"]/ordfromdd", ordfromdd);
  1869. } else {
  1870. model.setValue("/root/main/list3//diaglist["+ grd_diaglist.row +"]/ordfromdd", model.getValue("/root/main/item1/iteminfo/indd"));
  1871. }
  1872. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/toot", "-");
  1873. // 상병이력조회에서 호출된 경우가 아니면
  1874. if (selectyn != "Y") {
  1875. fSortDiagNo2(true);
  1876. }
  1877. // edit mode 설정위한것임 절대 지우지 말것.
  1878. grd_diaglist.refresh();
  1879. if (addyn != "Y") {
  1880. grd_diaglist.row = nowRow;
  1881. grd_diaglist.col = grd_diaglist.colRef("diagcd");
  1882. grd_diaglist.dispatch("onentercell");
  1883. }
  1884. }
  1885. // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 추가"
  1886. function fDiagGridInsertRow() {
  1887. // 2008.03.06 박지욱 추가 (상병의 진료개시일은 중간청구최종시작일자, 중간청구등록이 없으면 입원일자 세팅)
  1888. model.removenode("/root/hidden/mdlclamrgst");
  1889. model.makeNode("/root/hidden/mdlclamrgst");
  1890. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  1891. var deptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  1892. //속도개선 plet2 상병리스트에서 마지막 날짜를 가져오도록.
  1893. //submit("TRPIJ00313");
  1894. var fromdd = model.getXPathValue("/root/main/list3/diaglist[last()]/ordfromdd");
  1895. if (fromdd == "") {
  1896. var indd = model.getValue("/root/send/ordfromdd");
  1897. fromdd = indd;
  1898. }
  1899. // 삭제 상태가 아닌 마지막 줄을 찾는다.
  1900. var diagrow = grd_diaglist.rows - grd_diaglist.fixedRows; // 상병 Grid 가장 마지막 줄에 추가한다.
  1901. grd_diaglist.insertRow(diagrow++, true,false,false);
  1902. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/seqno", diagrow);
  1903. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/ordfromdd", fromdd); // 진료개시일
  1904. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/orddeptcd", deptcd); // 진료과
  1905. fSortDiagNo();
  1906. // 행추가 시 맨 밑에 행이 보일 수 있드록 추가 ( 2007.10.09 김건기 )
  1907. grd_diaglist.bottomRow = grd_diaglist.rows;
  1908. // 행추가 후 상병코드 컬럼으로 포커스 이동 ( 2007.10.09 김건기 )
  1909. model.setFocus("grd_diaglist");
  1910. // edit mode 설정위한것임 절대 지우지 말것.
  1911. grd_diaglist.refresh();
  1912. grd_diaglist.row = diagrow;
  1913. grd_diaglist.col = grd_diaglist.colref("diagcd");
  1914. //grd_diaglist.dispatch("onentercell");
  1915. //grd_diaglist.editCell();
  1916. }
  1917. // 상병 다섯줄 추가
  1918. function fDiagGridInsertRow5() { // 20080826 박창원 추가
  1919. // 2008.03.06 박지욱 추가 (상병의 진료개시일은 중간청구최종시작일자, 중간청구등록이 없으면 입원일자 세팅)
  1920. model.removenode("/root/hidden/mdlclamrgst");
  1921. model.makeNode("/root/hidden/mdlclamrgst");
  1922. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  1923. var deptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  1924. var fromdd = model.getXPathValue("/root/main/list3/diaglist[last()]/ordfromdd");
  1925. if (fromdd == "") {
  1926. var indd = model.getValue("/root/send/ordfromdd");
  1927. fromdd = indd;
  1928. }
  1929. for (var i = 1; i <= 5; i++) {
  1930. var lastRow = grd_diaglist.rows - 1;
  1931. var diagrow = lastRow; // 상병 Grid 가장 마지막 줄에 추가한다.
  1932. grd_diaglist.insertRow(diagrow++, true,false,false);
  1933. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/seqno", diagrow);
  1934. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/ordfromdd", fromdd); // 진료개시일
  1935. model.setValue("/root/main/list3/diaglist[" + diagrow + "]/orddeptcd", deptcd); // 진료과
  1936. }
  1937. fSortDiagNo();
  1938. // 행추가 시 맨 밑에 행이 보일 수 있드록 추가 ( 2007.10.09 김건기 )
  1939. grd_diaglist.topRow = grd_diaglist.rows - 6;
  1940. // 행추가 후 상병코드 컬럼으로 포커스 이동 ( 2007.10.09 김건기 )
  1941. model.setFocus("grd_diaglist");
  1942. grd_diaglist.row = diagrow - 5;
  1943. grd_diaglist.col = grd_diaglist.colref("diagcd");
  1944. grd_diaglist.dispatch("onentercell");
  1945. grd_diaglist.editCell();
  1946. }
  1947. // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 삭제"
  1948. function fDiagGridDeleteRow() {
  1949. //상병은 삭제시 무조건 삭제를 날려 버린다.
  1950. for( var i = 0; i < grd_diaglist.selectedRows; i++ ){
  1951. var cRrow = grd_diaglist.selectedRow(i);
  1952. grd_diaglist.rowstatus(cRrow) = 4; // 4 : delete 상태로 stat를 변경한다.
  1953. }
  1954. var tmp = grd_diaglist.rows;
  1955. for(var k = tmp; k >= 0;k--){
  1956. if(grd_diaglist.rowstatus(k) == "4"){
  1957. grd_diaglist.deleteRow(k, false);
  1958. }
  1959. }
  1960. //model.refresh(); 최적회 때문에 20080731 박창원
  1961. model.refreshpart("/root/main/list3/diaglist");
  1962. fSortDiagNo();
  1963. }
  1964. // 상병코드 조회 팝업
  1965. function fSearchDiageCode() {
  1966. var row = grd_diaglist.row;
  1967. var diagcd = model.getValue("/root/main/list3/diaglist["+ row + "]/diagcd");
  1968. model.removeNodeset("/root/hidden/sppiz00400/rslt");
  1969. // 상병 Data가 2007년 이후로 설정되어 있으므로 임시로 현재 날짜를 넘긴다.
  1970. //model.makeValue("/root/hidden/sppiz00400/cond/basedd", model.getValue("/root/main/item1/clbs/clamdd"));
  1971. model.resetInstanceNode("/root/hidden/sppiz00400/cond");
  1972. model.makeValue("/root/hidden/sppiz00400/cond/basedd", VAL_today); // (dateHelper.js) 현재날짜 반환
  1973. model.makeValue("/root/hidden/sppiz00400/cond/diagcd", diagcd);
  1974. model.makeNode("/root/hidden/sppiz00400/cond/diagnm");
  1975. model.makeValue("/root/hidden/sppiz00400/cond/selectedrdodiagkind","1");
  1976. if(diagcd){
  1977. submit("TRPIJ00308",false); // 입력된 상병코드로 emr.mrtmicd10 테이블을 조회한다.
  1978. var rsltList = instance1.selectSingleNode("/root/hidden/sppiz00400");
  1979. if (rsltList != null && rsltList.childNodes.length == 1) {
  1980. // 조회된 결과가 1건이면
  1981. fSetDiagCdNm();
  1982. } else {
  1983. // 조회된 결과가 없거나 여러 건이면
  1984. // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
  1985. fSearchSPPIZ00400();
  1986. }
  1987. } else {
  1988. // 상병코드 입력 없이 상병명 선택 시
  1989. fSearchSPPIZ00400();
  1990. }
  1991. }
  1992. // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
  1993. function fSearchSPPIZ00400() {
  1994. model.removeNodeset("/root/hidden/sppiz00400/rslt");
  1995. model.makeNode("/root/hidden/sppiz00400/rslt/diagcd");
  1996. model.makeNode("/root/hidden/sppiz00400/rslt/diaghngnm");
  1997. model.makeNode("/root/hidden/sppiz00400/rslt/diagengnm");
  1998. model.resetInstanceNode("/root/hidden/sppiz00400/cond");
  1999. model.makeValue("/root/hidden/sppiz00400/cond/basedd", VAL_today); // (dateHelper.js) 현재날짜 반환
  2000. model.makeValue("/root/hidden/sppiz00400/cond/diagcd", model.getValue("/root/main/list3/diaglist["+ grd_diaglist.row + "]/diagcd"));
  2001. model.makeNode("/root/hidden/sppiz00400/cond/diagnm");
  2002. model.makeValue("/root/hidden/sppiz00400/cond/selectedrdodiagkind","3"); // 사용자가 직접검색하여 입력 할수 있도록 임의의 값(3)을 넣어줌
  2003. modal("SPPIZ00400" ,"", "10", "10", "SPPIZ00400", "/root/hidden/sppiz00400/cond", "/root/init", "", ""); // SPPIZ00400_상병코드조회.xrw
  2004. }
  2005. // [SPPIZ00400_상병코드조회.xrw 에서 호출] 상병조회 팝업에서 상병을 더블클릭 했을경우 상병 그리드에 반영
  2006. function fSetDiagCdNm() {
  2007. var diagcd = model.getValue("/root/hidden/sppiz00400/rslt/diagcd");
  2008. var diaghngnm = model.getValue("/root/hidden/sppiz00400/rslt/diaghngnm");
  2009. var diagengnm = model.getValue("/root/hidden/sppiz00400/rslt/diagengnm");
  2010. var spclcd = model.getValue("/root/hidden/sppiz00400/rslt/spclcd");
  2011. var currRow = grd_diaglist.row;
  2012. //20090810 JHP 수정추가. 상병 조회팝업에서 상병조회 후 적용하려고 할때 인스턴스 증가(행추가)하여 적용시킨다.
  2013. if(grd_diaglist.row <= 0){
  2014. fDiagGridInsertRow();
  2015. grd_diaglist.endEditCell();
  2016. }else{
  2017. var chkdiagcd = model.getValue("/root/main/list3/diaglist["+ currRow + "]/diagcd");
  2018. var chkdiagnm = model.getValue("/root/main/list3/diaglist["+ currRow + "]/diagnm");
  2019. if((chkdiagcd != "" || chkdiagcd != " " || chkdiagcd != null) &&
  2020. (chkdiagnm == "" || chkdiagnm == " " || chkdiagnm == null)){
  2021. ;
  2022. }else if((chkdiagcd != "" || chkdiagcd != " " || chkdiagcd != null) &&
  2023. (chkdiagnm != "" || chkdiagnm != " " || chkdiagnm != null)){
  2024. ;
  2025. }else{
  2026. fDiagGridInsertRow();
  2027. grd_diaglist.endEditCell();
  2028. }
  2029. }
  2030. if (diagcd) {
  2031. grd_diaglist.endEditCell();
  2032. model.setValue("/root/main/list3/diaglist["+ currRow + "]/diagcd", diagcd);
  2033. }
  2034. if (diaghngnm) {
  2035. model.setValue("/root/main/list3/diaglist["+ currRow + "]/diagnm", diaghngnm);
  2036. }
  2037. if(diagengnm){
  2038. model.setValue("/root/main/list3/diaglist["+ currRow + "]/diagengnm", diagengnm);
  2039. }
  2040. if(spclcd){
  2041. model.setValue("/root/main/list3/diaglist["+ currRow + "]/vcode", spclcd);
  2042. }
  2043. var chk_key = model.getValue("/root/main/list3/diaglist["+ currRow + "]/pid");
  2044. //신규로 불러온 입력되는 경우는 Insert시 key값이 없으므로 기본 정보에서 읽어다 넣어 준다.
  2045. if(chk_key){
  2046. return;
  2047. }else{
  2048. //Pid
  2049. model.setValue("/root/main/list3/diaglist["+ currRow + "]/pid",model.getValue("/root/send/pid"));
  2050. //Indd
  2051. model.setValue("/root/main/list3/diaglist["+ currRow + "]/indd",model.getValue("/root/send/indd"));
  2052. //Cretno
  2053. model.setValue("/root/main/list3/diaglist["+ currRow + "]/cretno",model.getValue("/root/send/cretno"));
  2054. //fromdd
  2055. model.setValue("/root/main/list3/diaglist["+ currRow + "]/fromdd",model.getValue("/root/send/fromdd"));
  2056. //mskind
  2057. model.setValue("/root/main/list3/diaglist["+ currRow + "]/mskind",model.getValue("/root/send/mskind"));
  2058. //drinptyn
  2059. model.setValue("/root/main/list3/diaglist["+ currRow + "]/drinptyn","N");
  2060. //addflag
  2061. model.setValue("/root/main/list3/diaglist["+ currRow + "]/addflag","Y");
  2062. if(grd_diaglist.row >1){
  2063. //orddeptcd
  2064. model.setValue("/root/main/list3/diaglist["+ currRow + "]/orddeptcd",model.getValue("/root/main/list3/diaglist[1]/orddeptcd"));
  2065. //ordfromdd
  2066. model.setValue("/root/main/list3/diaglist["+ currRow + "]/ordfromdd",model.getValue("/root/main/list3/diaglist[1]/ordfromdd"));
  2067. }
  2068. //저장후 빈행을 추가해 준다.
  2069. //20080811 자동으로 줄추가 되는 기능 제외
  2070. fDiagGridInsertRow();
  2071. }
  2072. // model.refresh(); 최적화 문제로 대체 20080731 박창원
  2073. model.refreshpart("/root/main/list3/diaglist");
  2074. }
  2075. function fChangeRate() {
  2076. grp_changeownbrate.visible = true;
  2077. }
  2078. function fUpdDiag() {
  2079. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  2080. if(chk){
  2081. //fGetIsclList
  2082. fRefreshDiag(); // 특정 환자에 대한 전상병 내역을 조회한다.
  2083. // 20080811 제외하기로함(상병줄추가(자동)
  2084. //fDiagGridInsertRow();
  2085. }
  2086. }
  2087. function fChangeRate1() {
  2088. // 6시간 미만 환자는 입원에만 해당하는 요율을 적용할 수 없다. - 20081105 박창원
  2089. var suppkind = cmb_suppkindlist.value;
  2090. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  2091. var suppkindcd = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  2092. //20090325 차상위 2종추가 - 박창원
  2093. if (sixtimyn == "Y" && (suppkind == "05" || suppkind == "08" || suppkind == "09" || suppkind == "31" || suppkind == "39" || suppkind == "41" || suppkind == "42" || suppkind == "43")) {
  2094. messageBox("6시간 미만환자는 입원에만 적용되는 보조유형으로 변경을","E001");
  2095. grp_changeownbrate.visible = false;
  2096. return;
  2097. }
  2098. // 6세미만, 신생아는 조건에 맞지 않으면 Block - 20090103 박창원
  2099. if (suppkind == "08" || suppkind == "31" || suppkind == "41")
  2100. var age = parseInt(model.getValue("/root/main/item1/iteminfo/age"));
  2101. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  2102. var insukindcd = model.getValue("/root/main/item1/iteminfo/insukindcd");
  2103. var inpath = model.getValue("/root/main/item1/iteminfo/inpath");
  2104. var orddeptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  2105. var rrgstno = model.getValue("/root/main/item1/iteminfo/rrgstno");
  2106. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  2107. var babyyn ="N";
  2108. var end6yn = "N";
  2109. var brthdd = "20" + rrgstno.substr(0,6);
  2110. var readonly = model.getValue("/root/send/readonly");
  2111. // 신생아를 구별지음
  2112. if (rrgstno.substr(7,1) == "3" || rrgstno.substr(7,1) == "4" || rrgstno.substr(7,1) == "7" || rrgstno.substr(7,1) == "8") {
  2113. var interval = getDateInterval(brthdd,indd);
  2114. if (interval < "28") {
  2115. babyyn = "Y";
  2116. }
  2117. }
  2118. // 6세미만 생일 여부를 판단함
  2119. if ((rrgstno.substr(7,1) == "3" || rrgstno.substr(7,1) == "4") && age <= 6) {
  2120. if (age == 6) {
  2121. if (brthdd >= VAL_today) {
  2122. end6yn = "Y";
  2123. }
  2124. } else if (age == 6){
  2125. if (brthdd < VAL_today) {
  2126. end6yn = "N";
  2127. }
  2128. } else if(age < 6) {
  2129. end6yn = "Y";
  2130. } else if (age > 6) {
  2131. end6yn ="N";
  2132. }
  2133. }
  2134. var reqdeptno = model.getValue("/root/hidden/list2/dept[deptcd='"+orddeptcd+"']reqdeptno");
  2135. if (sixtimyn == "N" && babyyn == "Y" &&age == 0 && indd >= "20080101" && reqdeptno == "11" && (insukindcd == "11" || insukindcd == "21" || insukindcd == "22")) {
  2136. if (suppkind != "31") {
  2137. messageBox("신생아 조건에 맞지 않아 변경을","E001");
  2138. grp_changeownbrate.visible = false;
  2139. return;
  2140. }
  2141. }
  2142. if (sixtimyn == "N" && end6yn == "Y" && babyyn == "N" && age <= 6 && reqdeptno == "11" && (insukindcd == "11" || insukindcd == "21" || insukindcd == "22")) {
  2143. if (suppkind != "08" && suppkind != "41") { // 20090325 차상위 2종 조건 추가 - 박창원
  2144. if (suppkind != "31") {
  2145. messageBox("6세미만 조건에 맞지 않아 변경을","E001");
  2146. grp_changeownbrate.visible = false;
  2147. return;
  2148. }
  2149. }
  2150. }
  2151. var msg = messageBox("선택하신 요율을 적용","S001");
  2152. if(msg !=6){
  2153. return;
  2154. }else{
  2155. Insuchange(suppkind);
  2156. }
  2157. }
  2158. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2159. //상병조회버튼에 대한 처리 //
  2160. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2161. // 수가 조회
  2162. function fSetSrchCalcScorCdPop(){
  2163. model.setValue("/root/hidden/smpic00100/cond/calcscorcd", grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd")));
  2164. model.setValue("/root/hidden/smpic00100/cond/judgflag", "Y");
  2165. modal("SMPIC00100", 1,150, 150, "SMPIC00100", "/root/hidden/smpic00100/cond", "/root/temp/item6", "", "");
  2166. }
  2167. // 보험인정기준관리 화면 호출 20091105 수정추가 JHP 요청번호 : 5874
  2168. function fSetSrchInsuRcogBaseMngt(){
  2169. var calcscorcd = grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd"));
  2170. model.setValue("root/hidden/sppiz01600/cond/calcscorcd", calcscorcd);
  2171. // SPPIZ01600_보험인정기준조회 팝업 연결 (선택된 row의 처방코드를 넘겨준다.)
  2172. modal("SPPIZ01600", 1,150, 150, "SPPIZ01600", "/root/hidden/sppiz01600/cond/calcscorcd", "/root/send/item3/calcscorcd", "", "");
  2173. }
  2174. // 보험인정기준관리 화면 호출 20091105 수정추가 JHP 요청번호 : 5874 호출함수. - 미사용
  2175. function getOpenInsuRcogBaseMngtChk(){
  2176. var temp = getChildWindow("ddd");
  2177. var nodecnt = 0;
  2178. var xPathFunction = "count(/root/main/h_limi/limi)";
  2179. while (nodecnt == 0)
  2180. {
  2181. nodecnt = temp.model.getXPathValue(xPathFunction);
  2182. if (nodecnt >= 500){
  2183. temp.messageBox("해당코드 인정기준을 확인합니다.","I002");
  2184. temp.model.setValue("/root/main/right/h_limt/limt/limt_calcscorcd" ,grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colRef("snglcalcscorcd")));
  2185. temp.ipt_calcscorcd.dispatch("onkeypress");
  2186. temp.model.refresh();
  2187. break;
  2188. }
  2189. }
  2190. }
  2191. // 약품편람 호출 - 20080930 박창원
  2192. function fOpenDrugDic() {
  2193. open("SMADB01900","","","","bbb","","","","");
  2194. var temp = getChildWindow("bbb");
  2195. // 필터링 할 경우 row값을 제대로 못 가져와서 valueMatrix로 변경함. 2012.02.16 LEJ
  2196. temp.model.setValue("/root/hidden/receivedata/srchdrugcd", grd_ordlist.valueMatrix(grd_ordlist.row,grd_ordlist.colRef("snglcalcscorcd")));
  2197. }
  2198. // 의약품정보 호출 - 20080930 박창원
  2199. function fOpenDruginfo() {
  2200. open("SMADB00100","","","","ccc","","","","");
  2201. var temp = getChildWindow("ccc");
  2202. temp.model.setValue("/root/send/srchinfo/srchcd", grd_ordlist.valueMatrix(grd_ordlist.row,grd_ordlist.colRef("snglcalcscorcd")));
  2203. }
  2204. // 환자단위 메시지 전송
  2205. function fSendMsgPat() {
  2206. model.makeValue("/root/temp/opentab", "pmsg");
  2207. zmifOpenMessagePopup("/root/temp"); // root/temp/opentab 에 receivemsg (받은메세지함) 값을 주고 오픈한다.
  2208. }
  2209. // 처방단위 메시지 전송
  2210. function fSendMsgOrder() {
  2211. model.makeValue("/root/temp/opentab", "pmsg");
  2212. zmifOpenMessagePopup("/root/temp"); // root/temp/opentab 에 pmsg (환자메세지작성창) 값을 주고 오픈한다.
  2213. }
  2214. // 처방상병을 끌고 온다.
  2215. function fRefreshDiag() {
  2216. if(model.getValue("/root/main/item1/iteminfo/patnm")){
  2217. // 심사대상자의 등록번호를 조건으로 하여 전체 상병이력을 조회한다.
  2218. var cnt = grd_diaglist.rows;
  2219. submit("TRPIJ00306");
  2220. // model.refresh(); 최적화문제로 주석처리 - 20081015 박창원
  2221. for(var i = 1; i < grd_diaglist.rows; i++) {
  2222. var chkflag = model.getValue("/root/main/list3/diaglist["+ i + "]/chkflag");
  2223. if(chkflag == "2"){
  2224. grd_diaglist.rowstatus(i) = 1;
  2225. }
  2226. }
  2227. }
  2228. }
  2229. // 특정 환자에 대한 청구상병을 조회한다.
  2230. function fGetClamDiagHistList() {
  2231. if(model.getValue("/root/main/item1/iteminfo/patnm")){
  2232. // 심사대상자의 등록번호를 조건으로 하여 전체 청구 상병이력을 조회한다.
  2233. model.setValue("/root/hidden/smpiz00100/cond/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  2234. model.setValue("/root/hidden/smpiz00100/cond/ordfromdd", model.getValue("/root/main/item1/iteminfo/indd"));
  2235. model.setValue("/root/hidden/smpiz00100/cond/ordtodd", model.getValue("/root/main/item1/iteminfo/dschdd"));
  2236. model.setValue("/root/hidden/smpiz00100/cond/srchflag", "pam"); // 검색구분 Radio : 청구
  2237. modal("SMPIZ00100" ,"", "10", "10", "SMPIZ00100", "/root/hidden/smpiz00100/cond", "/root/init", "", ""); // SMPIZ00100_외래입원상병이력조회.xrw
  2238. // model.refresh(); 최적화 문제로 20080731 박창원
  2239. var rsltNode = instance1.selectSingleNode("/root/hidden/smpiz00100/rslt");
  2240. var originpid = model.getValue("/root/main/item1/iteminfo/pid");
  2241. if (rsltNode != null) {
  2242. for (var i = 1; i <= rsltNode.childNodes.length; i++) {
  2243. var diagcd = model.getValue("/root/hidden/smpiz00100/rslt/diag["+ i +"]/diagcd");
  2244. var isSame = false;
  2245. for (var j = grd_diaglist.fixedRows; j < grd_diaglist.rows; j++) {
  2246. if (diagcd == model.getValue("/root/main/list3/diaglist["+ j +"]/diagcd")) {
  2247. // 동일한 상병이 존재하는 경우
  2248. isSame = true;
  2249. j = grd_diaglist.rows;
  2250. }
  2251. }
  2252. // 동일한 상병이 없는 경우
  2253. if (isSame == false) {
  2254. grd_diaglist.addRow(false,true);
  2255. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  2256. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  2257. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  2258. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  2259. var mskind = model.getValue("/root/main/item1/iteminfo/mskind");
  2260. var ruleoutyn = model.getValue("/root/hidden/smpiz00100/rslt/diag["+ i +"]/diagkindcd");
  2261. if(ruleoutyn == "C"){
  2262. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/ruleoutyn", "false");
  2263. }else{
  2264. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/ruleoutyn", "true");
  2265. }
  2266. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/pid", pid);
  2267. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/indd", indd);
  2268. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/cretno", cretno);
  2269. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/fromdd", fromdd);
  2270. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/mskind", mskind);
  2271. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/addflag", "Y");
  2272. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/drinptyn", "N");
  2273. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/seqno", grd_diaglist.row);
  2274. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/diagcd", model.getValue("/root/hidden/smpiz00100/rslt/diag["+ i +"]/diagcd"));
  2275. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/diagnm", model.getValue("/root/hidden/smpiz00100/rslt/diag["+ i +"]/diaghngnm"));
  2276. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/diagengnm", model.getValue("/root/hidden/smpiz00100/rslt/diag["+ i +"]/diagengnm"));
  2277. // 청구과, 진료개시일은 주상병을 기준으로 부여한다.
  2278. var clamdeptcd = model.getValue("/root/main/list3/diaglist/orddeptcd");
  2279. if (clamdeptcd == "") { // 주상병의 진료과가 입력되지 않은 경우 인적사항의 진료과를 입력한다.
  2280. clamdeptcd = model.getValue("/root/main/item1/iteminfo/orddeptcd");
  2281. }
  2282. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/orddeptcd", clamdeptcd);
  2283. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/ordfromdd", model.getValue("/root/main/list3/diaglist/ordfromdd"));
  2284. model.setValue("/root/main/list3/diaglist["+ grd_diaglist.row +"]/toot", "-");
  2285. }
  2286. }
  2287. fSortDiagNo(true);
  2288. }
  2289. }
  2290. }
  2291. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2292. //상병처리 관련 코딩 끝 //
  2293. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2294. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2295. //처장 Filter 관련 코딩 //
  2296. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2297. // 처방 조회부 - 재행/급여/항목구분 Radio 선택에 따라 처방 내역을 보여준다.
  2298. function fGetSelectedOrderData() {
  2299. var matractflag = model.getValue("/root/hidden/list1/isclcond/matractflag");
  2300. var calcpayflag = model.getValue("/root/hidden/list1/isclcond/calcpayflag");
  2301. var snglcalcscorcls = model.getValue("/root/hidden/list1/isclcond/snglcalcscorcls");
  2302. var cpflag = model.getValue("/root/hidden/list1/isclcond/cpflag");
  2303. var edicd = model.getValue("/root/hidden/list1/isclcond/edicd");
  2304. var snglcalcscorcd = model.getValue("/root/hidden/list1/isclcond/snglcalcscorcd");
  2305. var actingflag = model.getValue("/root/hidden/list1/isclcond/actingflag");
  2306. var calcamtflag = model.getValue("/root/hidden/list1/isclcond/calcamtflag");
  2307. var tmp = "/root/main/list2/iscllist["
  2308. var chk = "0";
  2309. //재료행위 구분
  2310. if(matractflag){
  2311. tmp = tmp + matractflag;
  2312. chk = "1";
  2313. }
  2314. //급여구분
  2315. if(calcpayflag){
  2316. if(chk == "1"){
  2317. tmp = tmp + " and " + calcpayflag;
  2318. }else{
  2319. tmp = tmp + calcpayflag;
  2320. chk = "1";
  2321. }
  2322. }
  2323. //항목구분
  2324. if(snglcalcscorcls) {
  2325. if(chk == "1"){
  2326. tmp = tmp + " and (" + snglcalcscorcls + ")";
  2327. }else{
  2328. tmp = tmp + "(" + snglcalcscorcls + ")";
  2329. chk = "1";
  2330. }
  2331. }
  2332. // 시행구분 여부
  2333. if(actingflag) {
  2334. if(chk == "1"){
  2335. tmp = tmp + " and " + actingflag;
  2336. }else{
  2337. tmp = tmp + actingflag;
  2338. chk = "1";
  2339. }
  2340. }
  2341. //CP여부
  2342. if(cpflag) {
  2343. if(chk == "1"){
  2344. tmp = tmp + " and " + cpflag;
  2345. }else{
  2346. tmp = tmp + cpflag;
  2347. chk = "1";
  2348. }
  2349. }
  2350. //수가코드
  2351. if(snglcalcscorcd) {
  2352. if(chk == "1"){
  2353. tmp = tmp + " and " + snglcalcscorcd;
  2354. }else{
  2355. tmp = tmp + snglcalcscorcd;
  2356. chk = "1";
  2357. }
  2358. }
  2359. //항목구분
  2360. if(edicd) {
  2361. if(chk == "1"){
  2362. tmp = tmp + " and " + edicd;
  2363. }else{
  2364. tmp = tmp + edicd;
  2365. chk = "1";
  2366. }
  2367. }
  2368. //zero 수가 제외구분
  2369. if(calcamtflag) {
  2370. if(chk == "1"){
  2371. tmp = tmp + " and " + calcamtflag;
  2372. }else{
  2373. tmp = tmp + calcamtflag;
  2374. chk = "1";
  2375. }
  2376. }
  2377. if(chk == "0")
  2378. {
  2379. tmp = "/root/main/list2/iscllist";
  2380. }else{
  2381. tmp = tmp + "]";
  2382. }
  2383. grd_ordlist.attribute("nodeset") = tmp ;
  2384. grd_ordlist.rebuild();
  2385. grd_ordlist.resizeCells();
  2386. //grd_ordlist.gridToInstance();
  2387. grd_ordlist.row = 0; // 그리드의 첫줄부터 표시되도록 포커스를 0으로 설정한다.
  2388. // 2008. 01. 27 박지욱 추가 (처방 색깔 항 구분에 따라 흰색-회색 구분되도록 처리)
  2389. //fSetOrderColorByEdiitem();
  2390. //항목별소계
  2391. fSetItemSubTotal();
  2392. // 처방 Grid의 내용이 변경된 경우, 선별심사 처방 색깔 구분을 다시 처리한다.
  2393. fSetColorSpclJudgOrder();
  2394. //fSetOrdSpclTxt();
  2395. // model.refresh(); 최적화 문제로 대체 20080731 박창원
  2396. model.refreshpart("/root/main/list2/iscllist");
  2397. }
  2398. // 처방조회부, 처방 Grid용 Group의 컨트롤 크기를 설정한다.
  2399. function fSetOrderControlSize() {
  2400. if(grp_calc.attribute("top") == "305"){
  2401. //기존위치에 +200한 위치, 처방그리드는 사이즈 +200
  2402. grp_calc.attribute("top") = "105";
  2403. grp_calc.attribute("height") = "640";
  2404. grd_ordlist.attribute("height") = "518";
  2405. cap_paylimamt.attribute("top") = "595";
  2406. opt_paylimamt.attribute("top") = "620";
  2407. swt_spclmemo.visible = "false";
  2408. grd_diaglist.visible = "false";
  2409. }else{
  2410. grp_calc.attribute("top") = "305";
  2411. grp_calc.attribute("height") = "440";
  2412. grd_ordlist.attribute("height") = "318";
  2413. cap_paylimamt.attribute("top") = "395";
  2414. opt_paylimamt.attribute("top") = "420";
  2415. swt_spclmemo.visible = "true";
  2416. grd_diaglist.visible = "true";
  2417. }
  2418. }
  2419. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2420. //처장 Filter 관련 코딩 끝 //
  2421. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2422. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2423. //특정내역 관련 코딩 //
  2424. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2425. // 특정 환자에 대해 그동안 작성된 심사자메모, 청구메모 내역을 조회한다.
  2426. function fGetMemoHistList() {
  2427. if(model.getValue("/root/main/item1/iteminfo/patnm")){
  2428. model.removeNodeset("/root/hidden/sppiz00300/rslt");
  2429. model.makevalue("/root/hidden/sppiz00300/cond/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  2430. model.makevalue("/root/hidden/sppiz00300/cond/orddeptcd", model.getValue("/root/main/item1/iteminfo/orddeptcd"));
  2431. model.makevalue("/root/hidden/sppiz00300/cond/ioflag", "I");
  2432. model.makevalue("/root/hidden/sppiz00300/cond/refterm", "2");
  2433. model.makevalue("/root/hidden/sppiz00300/cond/anofildinclyn", "Y");
  2434. model.makevalue("/root/hidden/sppiz00300/cond/fromdd", "");
  2435. model.makevalue("/root/hidden/sppiz00300/cond/todd", "");
  2436. modal("SPPIZ00300" ,"", "10", "10", "SPPIZ00300", "/root/hidden/sppiz00300/cond", "/root/init", "", ""); // SPPIZ00300_메모이력조회.xrw
  2437. var SelectMemo = instance1.selectSingleNode("/root/hidden/sppiz00300/rslt");
  2438. if (SelectMemo != null) {
  2439. var choimemo = model.getValue("/root/hidden/sppiz00300/rslt/choimemo").getTrim(); // (stringHelper.js) 문자열 앞뒤에 있는 공백 제거
  2440. var choiedicd = model.getValue("/root/hidden/sppiz00300/rslt/edicd");
  2441. if (choimemo) {
  2442. model.setValue("/root/hidden/sppiz00300/rslt/choimemo", choimemo);
  2443. var destRef = model.getValue("/root/hidden/sppiz00300/rslt/destRef");
  2444. if (destRef == "judgmemo") { // 심사메모로 전달
  2445. var judgmemo = model.getValue("root/main/item1/iteminfo/judgrmk");
  2446. if (judgmemo) { // 기존 심사메모가 공백이 아닌 경우 선택된 메모를 심사화면 메모 뒤에 덧붙인다.
  2447. model.setValue("root/main/item1/iteminfo/judgrmk", judgmemo +" \n"+ choimemo);
  2448. } else {
  2449. if (choiedicd) { // 처방별 메모를 전달하는 경우임
  2450. // 동일한 EDI 코드가 있을 경우만 추가
  2451. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2452. rowcnt = eval(rowcnt) + 1;
  2453. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2454. for (var j = 1; j < rowcnt; j++) {
  2455. var clodedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2456. if (choiedicd == clodedicd) {
  2457. model.setValue("/root/main/item1/iteminfo/judgrmk", choimemo);
  2458. j = grd_ordlist.rows;
  2459. }
  2460. }
  2461. } else {
  2462. model.setValue("root/main/item1/iteminfo/judgrmk", choimemo);
  2463. }
  2464. }
  2465. model.toggle("case_judgrmemo"); // 해당 tab 으로 토글시킨다.
  2466. }
  2467. else if (destRef == "edimemo") { // 청구메모로 전달
  2468. var edimemo = model.getValue("/root/main/item1/iteminfo/edirmk");
  2469. if (edimemo) { // 기존 청구메모가 공백이 아닌 경우 선택된 메모를 심사화면 메모 뒤에 덧붙인다.
  2470. model.setValue("/root/main/item1/iteminfo/edirmk", edimemo +" \n"+ choimemo);
  2471. } else {
  2472. if (choiedicd) { // 처방별 메모를 전달하는 경우임
  2473. // 동일한 EDI 코드가 있을 경우 * 표시
  2474. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2475. rowcnt = eval(rowcnt) + 1;
  2476. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2477. for (var j = 1; j < rowcnt; j++) {
  2478. var clodedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2479. if (choiedicd == clodedicd) {
  2480. model.setValue("/root/main/item1/iteminfo/edirmk", choimemo);
  2481. //j = grd_ordlist.rows;
  2482. j = rowcnt;
  2483. }
  2484. }
  2485. } else {
  2486. model.setValue("root/main/item1/iteminfo/edirmk", choimemo);
  2487. }
  2488. }
  2489. model.toggle("case_ediclammemo"); // 해당 tab 으로 토글시킨다.
  2490. }
  2491. else if (destRef == "prcpmemo") { // 처방별 주석로 전달
  2492. // 동일한 EDI 코드가 있을 경우 * 표시
  2493. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2494. rowcnt = eval(rowcnt) + 1;
  2495. for (var j = 1; j < rowcnt; j++) {
  2496. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2497. var iscledicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2498. if (choiedicd == iscledicd) {
  2499. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  2500. }
  2501. }
  2502. for (var i=1; i<grd_clcjlist.rows; i++) {
  2503. var edicd = model.getValue("/root/main/list4/clcjlist["+i+"]/edicd");
  2504. var spclspec = model.getValue("/root/main/list4/clcjlist["+i+"]/spclspec");
  2505. if (choiedicd == edicd) {
  2506. var ans = messageBox("등록된 메모가 있습니다. 기존 내역에 추가할 경우 예(Yes)\n 새로운 내역으로 변경하시려면 아니오(No) 선택하여 주십시요", "S003"); ///수정사항이 있습니다. 저장하시려면 예(Yes)\n변경하시려면 아니오(No)
  2507. if (ans == 6) { // 6: yes
  2508. // 'JX999' 코드를 추가한다.
  2509. fSpclGridInsertRow(); // 특정내역 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 추가"
  2510. var clsprow = grd_ordlist.row;
  2511. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/unitflag", "J");
  2512. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/edicd", choiedicd);
  2513. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclcd", "JX999");
  2514. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclcdnm", "JX999 기타내역");
  2515. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclspec", spclspec + "\n"+ choimemo);
  2516. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/remfact", "X(700)");
  2517. return;
  2518. }
  2519. else if (ans == 7) { // 7:no
  2520. model.setValue("/root/main/list4/clcjlist["+ i +"]/spclspec", choimemo);
  2521. return ;
  2522. }
  2523. else if (ans == 2) { // 2:cancel
  2524. return ;
  2525. }
  2526. }
  2527. }
  2528. // 신규로 특정 내역을 추가하는 경우
  2529. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2530. rowcnt = eval(rowcnt) + 1;
  2531. for (var j = 1; j < rowcnt; j++) {
  2532. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2533. var iscledicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2534. if (choiedicd == iscledicd) {
  2535. // 'JX999' 코드를 추가한다.
  2536. fSpclGridInsertRow(); // 특정내역 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 추가"
  2537. var clsprow = grd_clsphist.row;
  2538. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/unitflag", "J");
  2539. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/edicd", choiedicd);
  2540. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclcd", "JX999");
  2541. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclcdnm", "JX999 기타내역");
  2542. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/spclspec", spclspec + "\n"+ choimemo);
  2543. model.setValue("/root/main/list4/clcjlist["+ clsprow +"]/remfact", "X(700)");
  2544. return;
  2545. }
  2546. }
  2547. }
  2548. model.refresh();
  2549. }
  2550. }
  2551. }
  2552. }
  2553. // 특정내역 중 MT015, MT016 내역을 조회하여 "소명자료" Btn (첨부물 자료관리) Popup 화면에 표시한다.
  2554. function fGetAttachedDataList() {
  2555. if(model.getValue("/root/main/item1/iteminfo/patnm")){
  2556. //model.removeNodeset("/root/hidden/sppiz00200/cond/clsp");
  2557. model.setValue("/root/hidden/sppiz00200/cond/clsp/rowstat","");
  2558. model.setValue("/root/hidden/sppiz00200/cond/clsp/unitflag","");
  2559. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclcd","");
  2560. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclspec", "");
  2561. model.setValue("/root/hidden/sppiz00200/cond/clsp/initedilnno", "");
  2562. model.setValue("/root/hidden/sppiz00200/cond/clsp/calcscorcd", "");
  2563. model.setValue("/root/hidden/sppiz00200/cond/clsp/seqno", "");
  2564. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclformat","");
  2565. // 특정내역 Grid에서 "행 삭제"한 경우 MT015 / MT016 자료를 표시하지 않도록 하는 기능 필요함
  2566. // (작성할 것!!!!!!!!!!!!!!!!!!!!!!!)
  2567. for (var i = 1; i < grd_clcjlist.rows; i++) {
  2568. var tmp = model.getValue("/root/main/list4/clcjlist["+ i +"]/spclcd");
  2569. if(tmp == "MT015" || tmp == "MT016"){
  2570. model.setValue("/root/hidden/sppiz00200/cond/clsp/rowstat","-");
  2571. model.setValue("/root/hidden/sppiz00200/cond/clsp/unitflag","M");
  2572. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclcd", model.getValue("/root/main/list4/clcjlist["+ i +"]/spclcd"));
  2573. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclspec", model.getValue("/root/main/list4/clcjlist["+ i +"]/spclspec"));
  2574. model.setValue("/root/hidden/sppiz00200/cond/clsp/initedilnno", grd_clcjlist.row);
  2575. model.setValue("/root/hidden/sppiz00200/cond/clsp/calcscorcd", model.getValue("/root/main/list4/clcjlist["+ i +"]/edicd"));
  2576. model.setValue("/root/hidden/sppiz00200/cond/clsp/seqno", "1");
  2577. model.setValue("/root/hidden/sppiz00200/cond/clsp/spclformat", model.getValue("/root/main/list4/clcjlist["+ i +"]/remfact"));
  2578. }
  2579. }
  2580. modal("SPPIZ00200" ,"", "10", "10", "SPPIZ00200"); // SPPIZ00200_첨부물자료관리.xrw
  2581. fDisplayAttachedDataList()
  2582. fCheckSpclSpecData();
  2583. }
  2584. }
  2585. // "소명자료" Btn (첨부물 자료관리) Popup 화면에서 특정내역 중 MT015, MT016 정보가 입력된 환자인지를 확인한다.
  2586. // 특정내역 MT004가 입력된 환자인지 체크한다.
  2587. function fDisplayAttachedDataList() {
  2588. var isAttachedDataList = false;
  2589. var cSrcNode = instance1.selectSingleNode("/root/hidden/sppiz00200/rslt/clsp");
  2590. if (cSrcNode == null) { // 특정내역이 없는 경우임
  2591. return;
  2592. }
  2593. if (model.getValue("/root/hidden/sppiz00200/rslt/clsp/unitflag") == "") { // "취소" 선택시에 버튼 색이 변경되지 않도록
  2594. return;
  2595. }
  2596. var cSrcChildNodeList = cSrcNode.childNodes;
  2597. for (var i = 1; i <= cSrcChildNodeList.length; i++) {
  2598. var spclcd = model.getValue("/root/hidden/sppiz00200/rslt/clsp["+i+"]/spclcd");
  2599. if (spclcd == "MT015" || spclcd == "MT016") {
  2600. var rowstat = model.getValue("/root/hidden/sppiz00200/rslt/clsp["+i+"]/rowstat")
  2601. if (rowstat != 'D') {
  2602. var spclspec = model.getValue("/root/hidden/sppiz00200/rslt/clsp["+i+"]/spclspec");
  2603. if (spclspec) {
  2604. isAttachedDataList = true;
  2605. }
  2606. // 특정내역 Grid 에서 해당 내용을 삽입 또는 수정한다.
  2607. if (rowstat == "I") { // 삽입
  2608. fSpclGridInsertRow();
  2609. model.setValue("/root/main/list4/clcjlist[" + grd_clcjlist.row + "]/spclcd", spclcd);
  2610. model.setValue("/root/main/list4/clcjlist[" + grd_clcjlist.row + "]/spclspec", spclspec);
  2611. if (spclcd == "MT015") {
  2612. model.setValue("/root/main/list4/clcjlist[" + grd_clcjlist.row + "]/remfact", "X(2)");
  2613. } else {
  2614. model.setValue("/root/main/list4/clcjlist[" + grd_clcjlist.row + "]/remfact", "X(200)");
  2615. }
  2616. } else if (rowstat == "U") { // 수정
  2617. for (var j = 1; j < grd_clcjlist.rows; j++) {
  2618. var gridspclcd = model.getValue("/root/main/list4/clcjlist["+ j +"]/spclcd");
  2619. var gridspclspec = model.getValue("/root/main/list4/clcjlist["+ j +"]/spclspec");
  2620. var gridrowstatus = grd_clcjlist.rowstatus(j);
  2621. if (gridspclcd == spclcd) {
  2622. model.setValue("/root/main/list4/clcjlist[" + j + "]/spclspec", spclspec);
  2623. if (gridrowstatus == 1 || gridrowstatus == 3) { // 1 : insert, 3 : insert & new
  2624. } else {
  2625. grd_clcjlist.rowstatus(j) = 2; // 2 : update 상태로 stat를 변경한다.
  2626. }
  2627. }
  2628. }
  2629. }
  2630. } else { // 삭제
  2631. // 특정내역 Grid 에서 해당 내용을 삭제한다.
  2632. for (var j = 1; j < grd_clcjlist.rows; j++) {
  2633. var gridspclcd = model.getValue("/root/main/list4/clcjlist["+ j +"]/spclcd");
  2634. var gridspclspec = model.getValue("/root/main/list4/clcjlist["+ j +"]/spclspec");
  2635. var gridrowstatus = grd_clcjlist.rowstatus(j);
  2636. if (gridspclcd == spclcd) {
  2637. if (gridrowstatus == 1 || gridrowstatus == 3) { // 1 : insert, 3 : insert & new
  2638. grd_clcjlist.deleteRow(j, false); // 해당 라인을 Grid에서 삭제한다.
  2639. } else { // 0 : new, 2 : update
  2640. grd_clcjlist.rowstatus(j) = 4; // 4 : delete 상태로 stat를 변경한다.
  2641. }
  2642. }
  2643. }
  2644. }
  2645. }
  2646. }
  2647. if (isAttachedDataList) {
  2648. btn_attData.attribute("class") = "btn5_letter4";
  2649. btn_attData.attribute("color") = "#cc3333";
  2650. } else {
  2651. btn_attData.attribute("class") = "btn2_letter4";
  2652. }
  2653. }
  2654. // DB에서 조회한 특정내역 중 MT015, MT016 정보가 입력된 환자인지를 확인한다.
  2655. // 특정내역 MT004가 입력된 환자인지 체크한다.
  2656. function fCheckSpclSpecData() {
  2657. var cSrcNode = instance1.selectSingleNode("/root/main/list4/clcjlist");
  2658. if (cSrcNode == null) { // 특정내역이 없는 경우임
  2659. return;
  2660. }
  2661. //var cSrcChildNodeList = cSrcNode.childNodes;
  2662. // for (var i = 1; i <= cSrcChildNodeList.length; i++) {
  2663. var spclcdMT015 = model.getValue("/root/main/list4/clcjlist[spclcd='MT015' or spclcd='MT016']/spclcd");
  2664. var spclcdMT004 = model.getValue("/root/main/list4/clcjlist[spclcd='MT004']/spclcd");
  2665. if (spclcdMT015.length > 0) {
  2666. btn_attData.attribute("class") = "btn5_letter4";
  2667. btn_attData.attribute("color") = "#ff0066";
  2668. } else {
  2669. btn_attData.attribute("class") = "btn2_letter4";
  2670. }
  2671. if(spclcdMT004 == "MT004") {
  2672. btn_mt004.attribute("class") = "btn5_letter4";
  2673. btn_mt004.attribute("color") = "#ff0066";
  2674. } else {
  2675. btn_mt004.attribute("class") = "btn2_letter4";
  2676. }
  2677. // }
  2678. }
  2679. //줄단위 추가
  2680. function fSpclGridInsertRow() {
  2681. // 특정내역 Grid 상에서 직접 행을 추가하는 경우 : 명세서단위 특정내역만을 추가할 수 있다.
  2682. // 줄단위 특정내역의 경우, 처방 Grid에서 'T' 컬럼을 더블클릭하여 특정내역 상세관리 Popup을 통해 입력한다.
  2683. var clcjrow = 0;
  2684. if(grd_clcjlist.rows > 1){
  2685. clcjrow = grd_clcjlist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
  2686. var chkdata = model.getValue("/root/main/list4/clcjlist[" + clcjrow + "]/spclcd");
  2687. if(chkdata == ""){
  2688. return;
  2689. }
  2690. }
  2691. grd_clcjlist.insertRow(clcjrow++, true,false,false);
  2692. grd_clcjlist.cellComboNodeset(clcjrow,3) = "/root/init/P0117list/P0117[minval = 'M' and cdid != 'MX999']";
  2693. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/pid", model.getValue("/root/send/pid"));
  2694. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/indd", model.getValue("/root/send/indd"));
  2695. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/cretno", model.getValue("/root/send/cretno") );
  2696. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/fromdd", model.getValue("/root/send/fromdd"));
  2697. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/mskind", model.getValue("/root/send/mskind"));
  2698. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/unitflag", "M");
  2699. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/spclmemoflag","E" );
  2700. model.setValue("/root/main/list4/clcjlist[" + (grd_clcjlist.rows - 1) + "]/status", "3");
  2701. grd_clcjlist.row = grd_clcjlist.rows;
  2702. grd_clcjlist.rowstatus(grd_clcjlist.row) = 1;
  2703. // grd_clcjlist.gridToInstance(); 최적화문제로 주석처리 - 20081015 박창원
  2704. }
  2705. // 특정내역 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 삭제"
  2706. function fSpclGridDeleteRow() {
  2707. var rowstatus = grd_clcjlist.rowstatus(grd_clcjlist.row);
  2708. for( var i = grd_clcjlist.selectedRows; i >= 0 ; i-- ){
  2709. var cRrow = grd_clcjlist.selectedRow(i);
  2710. if (rowstatus == 4) { // 4 : delete
  2711. return;
  2712. }
  2713. else if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  2714. grd_clcjlist.deleteRow(cRrow, false); // 해당 라인을 Grid에서 삭제한다.
  2715. } else { // 0 : new, 2 : update
  2716. model.setValue("/root/main/list4/clcjlist[" + grd_clcjlist.row + "]/status", 4);
  2717. grd_clcjlist.rowstatus(cRrow) = 4; // 4 : delete 상태로 stat를 변경한다.
  2718. }
  2719. }
  2720. fCheckSpclSpecData();
  2721. //특정내역이 있는 처방에 'T'필드에 *표를 해준다.
  2722. //fSetOrdSpclTxt();
  2723. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  2724. model.refreshpart("/root/main/list2/iscllist");
  2725. model.refreshpart("/root/main/list4/clcjlist");
  2726. }
  2727. // 특정내역 Grid 에서 선택한 줄단위 특정내역을 조회하고, 명세서단위 특정내역을 수정/입력한다.
  2728. function fSetDocRefLnSpclSpec(){
  2729. model.removenode("/root/hidden/sppij00500/rslt"); // SPPIJ00500_특정내역상세관리 에서 선택된 결과가 copyNode되는 경로임
  2730. model.removenode("/root/hidden/sppij00500/cond/list");
  2731. model.resetInstanceNode("/root/hidden/sppij00500/cond");
  2732. var row = grd_clcjlist.row;
  2733. var rows = grd_clcjlist.rows;
  2734. var edicd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("edicd"));
  2735. var oldspclcd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("spclcd"));
  2736. var oldspclcdnm = "";
  2737. var oldspclspec = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("spclspec"));
  2738. var oldremfact = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("remfact"));
  2739. var olddetldesc = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("detldesc"));
  2740. //줄단위 명단위 특정내역 구분.
  2741. var unitflag = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("unitflag"));
  2742. var calcscorcd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("calcscorcd"));
  2743. // pid,indd추가 결과조회 팝업호출을 위하여 - 20080922 박창원
  2744. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  2745. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  2746. var rowcnt = 1;
  2747. var setrow =0 ;
  2748. if(unitflag == "J"){
  2749. if (edicd ) {
  2750. for (var i=1; i<rows; i++) {
  2751. var grdedicd = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("edicd"));
  2752. if ( edicd == grdedicd) {
  2753. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/pid", pid);
  2754. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/indd", indd);
  2755. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/flag", "U");
  2756. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/edicd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("edicd")));
  2757. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd")));
  2758. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcdnm", "");
  2759. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclspec", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec")));
  2760. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/detldesc", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("detldesc")));
  2761. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/remfact", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("remfact")));
  2762. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/unitflag", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag")));
  2763. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/rownum", i);
  2764. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclcd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd")));
  2765. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclspec", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec")));
  2766. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("calcscorcd")));
  2767. if (row == i) {
  2768. setrow = i;
  2769. }
  2770. rowcnt = rowcnt+1;
  2771. }
  2772. }
  2773. model.setValue("/root/hidden/sppij00500/cond/pid", pid);
  2774. model.setValue("/root/hidden/sppij00500/cond/indd", indd);
  2775. model.setValue("/root/hidden/sppij00500/cond/flag", "U");
  2776. model.setValue("/root/hidden/sppij00500/cond/edicd", edicd);
  2777. model.setValue("/root/hidden/sppij00500/cond/spclcd", oldspclcd);
  2778. model.setValue("/root/hidden/sppij00500/cond/spclcdnm", oldspclcdnm);
  2779. model.setValue("/root/hidden/sppij00500/cond/detldesc", olddetldesc);
  2780. model.setValue("/root/hidden/sppij00500/cond/spclspec", oldspclspec);
  2781. model.setValue("/root/hidden/sppij00500/cond/remfact", oldremfact);
  2782. model.setValue("/root/hidden/sppij00500/cond/rownum", setrow);
  2783. model.setValue("/root/hidden/sppij00500/cond/unitflag", "J");
  2784. model.setValue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  2785. //var unitflag = model.getValue("/root/main/list4/clcjlist["+ row +"]/unitflag");
  2786. var unitflag = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("unitflag"))
  2787. // 삭제상태인 경우 처방Grid에서 입력,수정은 가능하지만 특정내역Grid에서는 편집할 수 없다.
  2788. var rowstatus = grd_clcjlist.rowstatus(row);
  2789. if (rowstatus == 4) { // 4 : delete
  2790. messageBox("삭제된 특정내역은 수정할 수", "I004"); ///삭제된 특정내역은 수정할 수 없습니다.
  2791. return;
  2792. }
  2793. modal("SPPIJ00500" ,"", "10", "10", "SPPIJ00500", "/root/hidden/sppij00500", "/root/hidden/clcj", "", ""); // SPPIJ00500_특정내역상세관리.xrw
  2794. var rsltcnt = getNodesetCount("/root/hidden/sppij00500/rslt/list");
  2795. // 처리 건수
  2796. if (rsltcnt > 0) {
  2797. for(var i=rsltcnt; i>0; i--) {
  2798. var flag = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/flag");
  2799. var rownum = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/rownum");
  2800. var edicd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/edicd");
  2801. var newspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcd");
  2802. var newspclcdnm = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcdnm");
  2803. var newspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclspec");
  2804. var newremfact = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/remfact");
  2805. var newdetldesc = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/detldesc");
  2806. oldspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclcd");
  2807. oldspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclspec");
  2808. // 특정코드 추가인 경우
  2809. if (flag == "I") {
  2810. var clsprow = grd_clcjlist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
  2811. grd_clcjlist.insertRow(clsprow++, true,false,false);
  2812. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("unitflag")) = unitflag;
  2813. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclcd")) = newspclcd;
  2814. //grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  2815. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclspec")) = newspclspec;
  2816. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("remfact")) = newremfact;
  2817. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  2818. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("edicd")) = edicd;
  2819. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("status")) = "3";
  2820. // 특정코드 변경인 경우
  2821. } else if (flag == "U") {
  2822. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("unitflag")) = unitflag;
  2823. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcd")) = newspclcd;
  2824. //grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  2825. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclspec")) = newspclspec;
  2826. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("remfact")) = newremfact;
  2827. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  2828. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("edicd")) = edicd;
  2829. if ( grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) != "3") {
  2830. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "0";
  2831. }
  2832. model.refresh();
  2833. // 특정코드, 특정내역이 변경되었거나 삭제된 특정코드를 조회하여 "확인"을 선택한 경우
  2834. if (oldspclcd != newspclcd || oldspclspec != newspclspec || grd_clcjlist.rowstatus(row) == 4) {
  2835. var rowstatus = grd_clcjlist.rowstatus(rownum);
  2836. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  2837. } else {
  2838. grd_clcjlist.rowstatus(rownum) = 2; // 2 : update 상태로 stat를 변경한다.
  2839. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "2";
  2840. }
  2841. }
  2842. // 처방Grid에서도 해당 줄단위 특정내역의 'T' 컬럼의 "*" 를 표시한다.
  2843. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2844. rowcnt = eval(rowcnt) + 1;
  2845. for (var j = 1; j < rowcnt; j++) {
  2846. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2847. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2848. if (edicd == clcjedicd) {
  2849. if(newspclcd == "JX999"){
  2850. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "#");
  2851. }else{
  2852. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  2853. }
  2854. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  2855. model.refreshpart("/root/main/list2/iscllist");
  2856. }
  2857. }
  2858. model.setValue("/root/hidden/item1/message", "특정코드 - "+ newspclcd +" / 특정내역 : "+ newspclspec +" / 기재형식 : "+ newremfact);
  2859. // 특정코드 삭제인 경우
  2860. } else if (flag == "D" && rownum != "" ) {
  2861. // 특정내역 Grid에서 삭제
  2862. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  2863. grd_clcjlist.deleteRow(rownum, false); // 해당 라인을 Grid에서 삭제한다.
  2864. } else { // 0 : new, 2 : update
  2865. grd_clcjlist.rowstatus(rownum) = 4; // 4 : delete 상태로 stat를 변경한다.
  2866. }
  2867. // 처방Grid에서도 해당 줄단위 특정내역의 삭제 처리를 한다.
  2868. // 줄번호가 부여된 줄단위 특정내역이 삭제된 경우, 처방Grid의 'T' 컬럼의 "*" 를 삭제한다.
  2869. //var clcjedicd = model.getValue("/root/main/list4/clcjlist["+ rownum +"]/edicd"); //root/main/list4/clcjlist/edicd
  2870. var clcjedicd = grd_clcjlist.valueMatrix( rownum,grd_clcjlist.colRef("edicd"));
  2871. if (clcjedicd) {
  2872. var isSameLn = false;
  2873. for (var j = 1; j < grd_clcjlist.rows; j++) {
  2874. if (grd_clcjlist.rowstatus(j) != 4) {
  2875. isSameLn = true; // 같은 줄번호에 여러개의 특정내역이 있는 경우임
  2876. }
  2877. }
  2878. }
  2879. if (isSameLn == false) { // 동일한 줄번호의 특정내역이 없는 경우
  2880. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  2881. rowcnt = eval(rowcnt) + 1;
  2882. for (var j = 1; j < rowcnt; j++) {
  2883. //for (var j = 1; j < grd_ordlist.rows; j++) {
  2884. var iscldicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  2885. if (clcjedicd == iscldicd) {
  2886. model.resetInstanceNode("/root/main/list2/iscllist["+ j +"]/text");
  2887. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  2888. model.refreshpart("/root/main/list2/iscllist");
  2889. }
  2890. }
  2891. }
  2892. } // 특정코드 비교 if
  2893. } // end for
  2894. var rdounitflag = model.getValue("/root/send/unitflag");
  2895. if (rdounitflag == "-") {
  2896. for (var i=1; i<grd_clcjlist.rows; i++) {
  2897. var delstatus = grd_clcjlist.rowStatus(i);
  2898. var delspclspec = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec"));
  2899. if (delstatus == 1 || delstatus == 3) { // 0 : new, 3 : insert & new
  2900. if (delspclspec == "") {
  2901. grd_clcjlist.deleteItem(i);
  2902. }
  2903. }
  2904. }
  2905. // 입력행 추가
  2906. fSpclGridInsertRow();
  2907. } else if (rdounitflag == "M") {
  2908. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'M']";
  2909. grd_clcjlist.rebuild();
  2910. } else if (rdounitflag == "J") {
  2911. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'J']";
  2912. grd_clcjlist.rebuild();
  2913. }
  2914. for (var i=1; i<grd_clcjlist.rows; i++) {
  2915. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  2916. var status = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("status"));
  2917. if (status != "") {
  2918. grd_clcjlist.rowStatus(i) = status;
  2919. }
  2920. if (unitflag == "M") {
  2921. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M'and cdid != 'MX999']";
  2922. } else if (unitflag == "J") {
  2923. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J' ]";
  2924. }
  2925. }
  2926. } // 처리 건수
  2927. } else {
  2928. messageBox("EDI코드가 없는 경우 해당 줄단위 특정내역이", "I004"); ///EDI코드가 없는 경우 해당 줄단위 특정내역이 없습니다.
  2929. }
  2930. //명단위 특정내역으르 클릭한경우(unitflag =="M") 또는 빈칸을 클릭한경우는 명단위 특정내역으로 구분한다. 2007.09.23 박도형
  2931. }else{
  2932. model.removenode("/root/hidden/sppij00500/rslt"); // SPPIZ00500_특정내역상세관리 에서 선택된 결과가 copyNode되는 경로임
  2933. model.resetInstanceNode("/root/hidden/sppij00500/cond");
  2934. var edicd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("edicd"));
  2935. var spclcd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("spclcd"));
  2936. var spclcdnm = "";
  2937. var spclspec = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("spclspec"));
  2938. var remfact = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("remfact"));
  2939. var detldesc = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("detldesc"));
  2940. //줄단위 명단위 특정내역 구분.
  2941. var unitflag = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("unitflag"));
  2942. var calcscorcd = grd_clcjlist.valueMatrix(row, grd_clcjlist.colRef("calcscorcd"));
  2943. model.setValue("/root/hidden/sppij00500/cond/pid", pid);
  2944. model.setValue("/root/hidden/sppij00500/cond/indd", indd);
  2945. model.setValue("/root/hidden/sppij00500/cond/edicd", edicd);
  2946. model.setValue("/root/hidden/sppij00500/cond/spclcd", spclcd);
  2947. model.setValue("/root/hidden/sppij00500/cond/spclcdnm", spclcdnm);
  2948. model.setValue("/root/hidden/sppij00500/cond/remfact", remfact);
  2949. model.setValue("/root/hidden/sppij00500/cond/spclspec", spclspec);
  2950. model.makevalue("/root/hidden/sppij00500/cond/unitflag", "M");
  2951. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  2952. // 명단위도 기존 입력된 내역까지 다 보낸다. 2008.01.04 박지욱
  2953. var rowcnt = 1;
  2954. for (var i=1; i<grd_clcjlist.rows; i++) {
  2955. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  2956. var spclcd = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd"));
  2957. if (unitflag == "M" && grd_clcjlist.rowstatus(i) != 4 && spclcd != "") {
  2958. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/pid", pid);
  2959. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/indd", indd);
  2960. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/flag", "U");
  2961. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/edicd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("edicd")));
  2962. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd")));
  2963. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcdnm", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcdnm")));
  2964. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclspec", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec")));
  2965. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/detldesc", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("detldesc")));
  2966. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/remfact", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("remfact")));
  2967. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/unitflag", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag")));
  2968. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/rownum", i);
  2969. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclcd", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd")));
  2970. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclspec", grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec")));
  2971. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", calcscorcd);
  2972. if (row == i) {
  2973. setrow = i;
  2974. }
  2975. rowcnt = rowcnt+1;
  2976. }
  2977. }
  2978. modal("SPPIJ00500" ,"", "10", "10", "SPPIJ00500", "/root/hidden/sppij00500", "/root/hidden/clcj", "", "");
  2979. var rsltcnt = getNodesetCount("/root/hidden/sppij00500/rslt/list");
  2980. // 처리 건수
  2981. if (rsltcnt > 0) {
  2982. for(var i=rsltcnt; i>0; i--) {
  2983. var flag = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/flag");
  2984. var rownum = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/rownum");
  2985. var edicd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/edicd");
  2986. var newspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcd");
  2987. var newspclcdnm = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcdnm");
  2988. var newspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclspec");
  2989. var newremfact = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/remfact");
  2990. var newdetldesc = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/detldesc");
  2991. // 특정코드 추가인 경우
  2992. if (flag == "I") {
  2993. var clsprow = grd_clcjlist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
  2994. grd_clcjlist.insertRow(clsprow++, true,false,false);
  2995. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("unitflag")) = unitflag;
  2996. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclcd")) = newspclcd;
  2997. //grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  2998. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclspec")) = newspclspec;
  2999. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("remfact")) = newremfact;
  3000. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  3001. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("edicd")) = edicd;
  3002. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("status")) = "3";
  3003. // pid, indd, cretno, fromdd, mskind, spclmemoflag, seqno 세팅
  3004. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("pid")) = model.getValue("/root/send/pid");
  3005. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("indd")) = model.getValue("/root/send/indd");
  3006. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("cretno")) = model.getValue("/root/send/cretno");
  3007. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("fromdd")) = model.getValue("/root/send/fromdd");
  3008. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("mskind")) = model.getValue("/root/send/mskind");
  3009. grd_clcjlist.valueMatrix(clsprow, grd_clcjlist.colRef("spclmemoflag")) = "E";
  3010. // 특정코드 변경인 경우
  3011. } else if (flag == "U") {
  3012. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("unitflag")) = unitflag;
  3013. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcd")) = newspclcd;
  3014. //grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  3015. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclspec")) = newspclspec;
  3016. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("remfact")) = newremfact;
  3017. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  3018. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("edicd")) = edicd;
  3019. if ( grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) != "3") {
  3020. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "0";
  3021. }
  3022. model.setValue("/root/hidden/item1/message", "특정코드 - "+ newspclcd +" / 특정내역 : "+ newspclspec +" / 기재형식 : "+ newremfact);
  3023. // 특정코드 삭제인 경우
  3024. } else if (flag == "D" && rownum != "" ) {
  3025. // 특정내역 Grid에서 삭제
  3026. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  3027. grd_clcjlist.deleteRow(rownum, false); // 해당 라인을 Grid에서 삭제한다.
  3028. } else { // 0 : new, 2 : update
  3029. grd_clcjlist.rowstatus(rownum) = 4; // 4 : delete 상태로 stat를 변경한다.
  3030. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "4";
  3031. }
  3032. }
  3033. }
  3034. // 그리드 정렬 & 한줄추가
  3035. //fSortSpclNo();
  3036. //fSaveClcjList();
  3037. } // 처리건수
  3038. }
  3039. }
  3040. // 처방 행 삭제 or 삭제취소 후에 특정내역 sorting 작업
  3041. function fSortSpclNo() {
  3042. // 빈 줄을 삭제한다.
  3043. for (var i = 1; i < grd_clcjlist.rows; i++) {
  3044. var rowstatus = grd_clcjlist.rowstatus(i);
  3045. var spclcd = model.getValue("/root/main/list4/clcjlist["+ i +"]/spclcd");
  3046. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  3047. if (spclcd == "") {
  3048. // 줄을 삭제한다.
  3049. grd_clcjlist.deleteRow(i, false);
  3050. i--;
  3051. }
  3052. }
  3053. }
  3054. // JS010(특정코드:야간가산)의 hhmm이 야간(18~09시)가 아니면 특정내역 Grid에 빨간색으로 표시
  3055. for(var i = 1; i < grd_clcjlist.rows; i++) {
  3056. grd_clcjlist.rowStyle(i, "data", "color") = "#000000";
  3057. var spclcd = model.getValue("/root/main/list4/clcjlist["+ i + "]/spclcd");
  3058. var spclspec = model.getValue("/root/main/list4/clcjlist["+ i + "]/spclspec");
  3059. if (spclcd == "JS010") {
  3060. var js010chk = false;
  3061. if (spclspec.length >= 12) {
  3062. var ccyymmddhhmm = spclspec.substr(0, 12);
  3063. if (isValidDateTime(ccyymmddhhmm, "YYYYMMDDhhmm")) { // (dateHelper.js) 유효한 날짜, 시간 인지 점검
  3064. var hhmm = parseInt(spclspec.substr(8, 4), 10); // '09' 와 같은 형식으로 입력한 경우 -> 9로 처리
  3065. if (hhmm >= 1800 || hhmm < 900) {
  3066. js010chk = true;
  3067. }
  3068. }
  3069. }
  3070. if (js010chk == false) {
  3071. grd_clcjlist.rowStyle(i, "data", "color") = "#ff3333"; // ff3333=붉은색
  3072. }
  3073. }
  3074. }
  3075. grd_clcjlist.colsort(grd_clcjlist.colRef("unitflag")) = "desc";
  3076. grd_clcjlist.colsort(grd_clcjlist.colRef("edicd")) = "asc";
  3077. grd_clcjlist.colsort(grd_clcjlist.colRef("spclcd")) = "asc";
  3078. grd_clcjlist.colsort(grd_clcjlist.colRef("status")) = "desc";
  3079. var maxRow = parseInt(grd_clcjlist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다.
  3080. var maxCol = parseInt(grd_clcjlist.cols) - 1;
  3081. grd_clcjlist.sort(grd_clcjlist.fixedRows, grd_clcjlist.fixedCols, maxRow, maxCol) = "usersort";
  3082. // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
  3083. grd_clcjlist.gridToInstance();
  3084. // 빈줄 추가
  3085. fSpclGridInsertRow();
  3086. }
  3087. function fSetLnUnitSpclcjec() { // 'T' 필드 더블클릭시 호출한다.
  3088. var rdounitflag = model.getValue("/root/send/unitflag");
  3089. // pid,indd추가 결과조회 팝업호출을 위하여 - 20080922 박창원
  3090. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  3091. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  3092. if (rdounitflag == "M") {
  3093. // 줄단위로 셋팅하고 처리
  3094. rdo_unitflag.value = "J";
  3095. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'J']";
  3096. grd_clcjlist.rebuild();
  3097. // 단위에 필터에 따라 해당 행있는 특정코드 콤보 재설정
  3098. for (var i=1; i<grd_clcjlist.rows; i++) {
  3099. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  3100. var status = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("status"));
  3101. if (status != "") {
  3102. grd_clcjlist.rowStatus(i) = status;
  3103. }
  3104. if (unitflag == "M") {
  3105. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M'' and cdid != 'MX999']";
  3106. } else if (unitflag == "J") {
  3107. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J']";
  3108. }
  3109. }
  3110. }
  3111. var row = grd_ordlist.row;
  3112. var rows = grd_clcjlist.rows;
  3113. model.removenode("/root/hidden/sppij00500/rslt"); // SPPIJ00500_특정내역상세관리 에서 선택된 결과가 copyNode되는 경로임
  3114. model.removenode("/root/hidden/sppij00500/cond");
  3115. // 처방 Grid에서 줄번호가 부여된 경우
  3116. //var edicd = model.getValue("/root/main/list2/iscllist["+ row +"]/edicd");
  3117. var edicd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("edicd"));
  3118. var calcscorcd = grd_ordlist.valueMatrix(row, grd_ordlist.colref("snglcalcscorcd")); // 수정추가 JHP 특정내역에 수가코드 추가하기. 20090423
  3119. var rowcnt = 1;
  3120. var setrow = 0;
  3121. if (edicd) {
  3122. if (rows == 1) {
  3123. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd); // 수정추가 JHP 특정내역에 수가코드 추가하기. 20090423
  3124. model.makevalue("/root/hidden/sppij00500/cond/edicd", edicd);
  3125. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  3126. model.makevalue("/root/hidden/sppij00500/cond/pid", indd);
  3127. model.makevalue("/root/hidden/sppij00500/cond/unitflag","J");
  3128. model.makevalue("/root/hidden/sppij00500/cond/flag", "I");
  3129. model.makevalue("/root/hidden/sppij00500/cond/spclcd", "JX999");
  3130. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  3131. model.makevalue("/root/hidden/sppij00500/cond/detldesc", "");
  3132. model.makevalue("/root/hidden/sppij00500/cond/spclspec", "");
  3133. model.makevalue("/root/hidden/sppij00500/cond/remfact","");
  3134. model.makevalue("/root/hidden/sppij00500/cond/rownum", "");
  3135. } else {
  3136. for (var i=1; i<rows; i++) {
  3137. var clcjcalcscorcd = grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("calcscorcd"));
  3138. var clcjedicd = grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("edicd"));
  3139. var spclcd = grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd"));
  3140. if ( edicd == clcjedicd) {
  3141. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/flag", "U");
  3142. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("calcscorcd"))); // 수정추가 JHP 특정내역에 수가코드 추가하기. 20090423
  3143. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/edicd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("edicd")));
  3144. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/detldesc", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("detldesc")));
  3145. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd")));
  3146. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclcdnm", "");
  3147. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/spclspec", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclspec")));
  3148. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/remfact", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("remfact")));
  3149. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/rownum", i);
  3150. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/unitflag","J")
  3151. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclcd", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclcd")));
  3152. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/oldspclspec", grd_clcjlist.valueMatrix( i,grd_clcjlist.colRef("spclspec")));
  3153. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/pid", pid);
  3154. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/indd", indd);
  3155. model.makevalue("/root/hidden/sppij00500/cond/list["+ rowcnt +"]/calcscorcd", "");
  3156. rowcnt = rowcnt+1;
  3157. // 특정내역 상세 화면에 보여줄 특정내역 선택
  3158. setrow = i;
  3159. }
  3160. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", calcscorcd);
  3161. model.makevalue("/root/hidden/sppij00500/cond/edicd", edicd);
  3162. model.makevalue("/root/hidden/sppij00500/cond/unitflag","J");
  3163. if ( setrow != 0 ) {
  3164. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  3165. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  3166. model.makevalue("/root/hidden/sppij00500/cond/flag", "U");
  3167. model.makevalue("/root/hidden/sppij00500/cond/spclcd", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("spclcd")));
  3168. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  3169. model.makevalue("/root/hidden/sppij00500/cond/detldesc", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("detldesc")));
  3170. model.makevalue("/root/hidden/sppij00500/cond/spclspec", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("spclspec")));
  3171. model.makevalue("/root/hidden/sppij00500/cond/remfact", grd_clcjlist.valueMatrix(setrow,grd_clcjlist.colRef("remfact")));
  3172. model.makevalue("/root/hidden/sppij00500/cond/rownum", setrow);
  3173. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", "");
  3174. } else {
  3175. model.makevalue("/root/hidden/sppij00500/cond/pid", pid);
  3176. model.makevalue("/root/hidden/sppij00500/cond/indd", indd);
  3177. model.makevalue("/root/hidden/sppij00500/cond/flag", "I");
  3178. model.makevalue("/root/hidden/sppij00500/cond/spclcd", "JX999");
  3179. model.makevalue("/root/hidden/sppij00500/cond/spclcdnm", "");
  3180. model.makevalue("/root/hidden/sppij00500/cond/detldesc", "");
  3181. model.makevalue("/root/hidden/sppij00500/cond/spclspec", "");
  3182. model.makevalue("/root/hidden/sppij00500/cond/remfact","");
  3183. model.makevalue("/root/hidden/sppij00500/cond/rownum", "");
  3184. model.makevalue("/root/hidden/sppij00500/cond/calcscorcd", "");
  3185. }
  3186. }
  3187. }
  3188. model.removenode("/root/hidden/sppij00500/rslt");
  3189. modal("SPPIJ00500" ,"", "10", "10", "SPPIJ00500", "/root/hidden/sppij00500", "/root/hidden/clcj", "", ""); // SPPIJ00500_특정내역상세관리.xrw
  3190. var rsltcnt = getNodesetCount("/root/hidden/sppij00500/rslt/list");
  3191. // 처리 건수
  3192. if (rsltcnt > 0) {
  3193. for(var i=rsltcnt; i>0; i--) {
  3194. var flag = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/flag");
  3195. var rownum = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/rownum");
  3196. var calcscorcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/calcscorcd");
  3197. var edicd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/edicd");
  3198. var newspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcd");
  3199. var newspclcdnm = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclcdnm");
  3200. var newspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/spclspec");
  3201. var newremfact = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/remfact ");
  3202. var newdetldesc = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/detldesc");
  3203. var oldspclcd = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclcd");
  3204. var oldspclspec = model.getValue("/root/hidden/sppij00500/rslt/list["+ i +"]/oldspclspec");
  3205. // 특정코드 추가인 경우
  3206. if (flag == "I") {
  3207. var clcjrow = grd_clcjlist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
  3208. grd_clcjlist.insertRow(clcjrow++, true,false,false);
  3209. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("pid")) = model.getValue("/root/send/pid");
  3210. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("indd")) = model.getValue("/root/send/indd");
  3211. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("cretno")) = model.getValue("/root/send/cretno");
  3212. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("fromdd")) = model.getValue("/root/send/fromdd");
  3213. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("mskind")) = model.getValue("/root/send/mskind");
  3214. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("unitflag")) = "J";
  3215. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("calcscorcd")) = calcscorcd;
  3216. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("edicd")) = edicd;
  3217. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclcd")) = newspclcd;
  3218. //grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  3219. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclspec")) = newspclspec;
  3220. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("remfact")) = newremfact;
  3221. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  3222. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("spclmemoflag")) = "E";
  3223. grd_clcjlist.valueMatrix(clcjrow, grd_clcjlist.colRef("status")) = "3";
  3224. // 처방Grid에서도 해당 줄단위 특정내역의 'T' 컬럼의 "*" 를 표시한다.
  3225. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  3226. rowcnt = eval(rowcnt) + 1;
  3227. for (var j = 1; j < rowcnt; j++) {
  3228. //for (var j = 1; j < grd_ordlist.rows; j++) {
  3229. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  3230. if (edicd == clcjedicd) {
  3231. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  3232. //model.refresh(); 최적화 문제로 20080731 박창원
  3233. }
  3234. }
  3235. // 특정코드 변경인 경우
  3236. } else if (flag == "U") {
  3237. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcd")) = newspclcd;
  3238. //grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclcdnm")) = newspclcdnm;
  3239. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("spclspec")) = newspclspec;
  3240. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("remfact")) = newremfact;
  3241. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("detldesc")) = newdetldesc;
  3242. if ( grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) != "3") {
  3243. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "0";
  3244. }
  3245. model.refresh();
  3246. // 특정코드, 특정내역이 변경되었거나 삭제된 특정코드를 조회하여 "확인"을 선택한 경우
  3247. if (oldspclcd != newspclcd || oldspclspec != newspclspec || grd_clcjlist.rowstatus(row) == 4) {
  3248. var rowstatus = grd_clcjlist.rowstatus(rownum);
  3249. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  3250. } else {
  3251. grd_clcjlist.rowstatus(rownum) = 2; // 2 : update 상태로 stat를 변경한다.
  3252. grd_clcjlist.valueMatrix(rownum, grd_clcjlist.colRef("status")) = "2";
  3253. }
  3254. }
  3255. // 처방Grid에서도 해당 줄단위 특정내역의 'T' 컬럼의 "*" 를 표시한다.
  3256. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  3257. rowcnt = eval(rowcnt) + 1;
  3258. for (var j = 1; j < rowcnt; j++) {
  3259. //for (var j = 1; j < grd_ordlist.rows; j++) {
  3260. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  3261. if (edicd == clcjedicd) {
  3262. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "*");
  3263. //model.refresh(); 최적화 문제로 20080731 박창원
  3264. }
  3265. }
  3266. model.setValue("/root/hidden/item1/message", "특정코드 - "+ newspclcd +" / 특정내역 : "+ newspclspec +" / 기재형식 : "+ newremfact);
  3267. // 특정코드 삭제인 경우
  3268. } else if (flag == "D" && rownum != "" ) {
  3269. var cnt = 0;
  3270. for (var j = 1; j < grd_clcjlist.rows; j++) {
  3271. var clcjedicd = model.getValue("/root/main/list4/clcjlist["+ j +"]/edicd");
  3272. if (edicd == clcjedicd) {
  3273. if (grd_clcjlist.rowstatus(j) != 4) {
  3274. cnt++;
  3275. }
  3276. }
  3277. }
  3278. if (cnt > 0) {
  3279. } else {
  3280. grd_ordlist.valueMatrix(row, grd_ordlist.colref("text")) = "";
  3281. //model.resetInstanceNode("/root/main/list2/iscllist["+ row +"]/text");
  3282. }
  3283. // 특정내역 Grid에서 삭제
  3284. var rowstatus = grd_clcjlist.rowstatus(rownum);
  3285. if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  3286. grd_clcjlist.deleteRow(rownum, false); // 해당 라인을 Grid에서 삭제한다.
  3287. } else { // 0 : new, 2 : update
  3288. grd_clcjlist.rowstatus(rownum) = 4; // 4 : delete 상태로 stat를 변경한다.
  3289. }
  3290. grd_clcjlist.row = rownum;
  3291. var rowcnt = getNodesetCount("/root/main/list2/iscllist"); // 필터
  3292. rowcnt = eval(rowcnt) + 1;
  3293. for (var j = 1; j < rowcnt; j++) {
  3294. //for (var j = 1; j < grd_ordlist.rows; j++) {
  3295. var clcjedicd = model.getValue("/root/main/list2/iscllist["+ j +"]/edicd");
  3296. if (edicd == clcjedicd) {
  3297. model.setValue("/root/main/list2/iscllist["+ j +"]/text", "");
  3298. //model.refresh(); 최적화 문제로 20080731 박창원
  3299. }
  3300. }
  3301. } // 특정 코드 상태 따른 if end
  3302. } // for end
  3303. var rdounitflag = model.getValue("/root/send/unitflag");
  3304. if (rdounitflag == "-") {
  3305. for (var i=1; i<grd_clcjlist.rows; i++) {
  3306. var delstatus = grd_clcjlist.rowStatus(i);
  3307. var delspclspec = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec"));
  3308. if (delstatus == 1 || delstatus == 3) { // 0 : new, 3 : insert & new
  3309. if (delspclspec == "") {
  3310. grd_clcjlist.deleteItem(i);
  3311. }
  3312. }
  3313. }
  3314. // 입력행 추가
  3315. fSpclGridInsertRow();
  3316. } else if (rdounitflag == "M") {
  3317. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'M']";
  3318. grd_clcjlist.rebuild();
  3319. } else if (rdounitflag == "J") {
  3320. grd_clcjlist.attribute("nodeset") = "/root/main/list4/clcjlist[unitflag = 'J']";
  3321. grd_clcjlist.rebuild();
  3322. }
  3323. for (var i=1; i<grd_clcjlist.rows; i++) {
  3324. var unitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  3325. var status = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("status"));
  3326. if (status != "") {
  3327. grd_clcjlist.rowStatus(i) = status;
  3328. }
  3329. if (unitflag == "M") {
  3330. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'M' and cdid != 'MX999']";
  3331. } else if (unitflag == "J") {
  3332. grd_clcjlist.cellComboNodeset(i,3) = "/root/init/P0117list/P0117[minval = 'J']";
  3333. }
  3334. }
  3335. } // 처리 건수 if end
  3336. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  3337. model.refreshpart("/root/main/list2/iscllist");
  3338. model.refreshpart("/root/main/list4/clcjlist");
  3339. } else {
  3340. messageBox("EDI코드가 없는 경우 해당 줄단위 특정내역이", "I004"); ///EDI코드가 없는 경우 해당 줄단위 특정내역이 없습니다.
  3341. }
  3342. }
  3343. function fGetStageTNM(){
  3344. model.removenode("/root/hidden/smpij02000/rslt"); // SMPIZ02000_환자별암병기분류조회 에서 선택된 결과가 copyNode되는 경로임
  3345. model.resetInstanceNode("/root/hidden/smpij02000/cond");
  3346. model.setValue("/root/hidden/smpij02000/cond/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  3347. model.setValue("/root/hidden/smpij02000/cond/insuflag", "");
  3348. modal("SMPIJ02000" ,"", "10", "10", "SMPIJ02000", "/root/hidden/smpij02000/cond", "/root/send/list01", "", "");
  3349. }
  3350. //심사자 메모 팝업 갱신
  3351. function fSetJudgMemoRefresh(){
  3352. model.refresh();
  3353. var memo = model.getValue("/root/hidden/sppiz00700/rslt/memo");
  3354. var tmp = model.getValue("/root/main/item1/iteminfo/judgrmk");
  3355. if(tmp){
  3356. tmp = tmp + " ";
  3357. }
  3358. model.setValue("/root/main/item1/iteminfo/judgrmk",tmp + memo);
  3359. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  3360. model.refresh();
  3361. }
  3362. //EDI 메모 팝업 갱신
  3363. function fSetEdiMemoRefresh(){
  3364. var memo = model.getValue("/root/hidden/sppiz00700/rslt/memo");
  3365. var tmp = model.getValue("/root/main/item1/iteminfo/edirmk");
  3366. if(tmp){
  3367. tmp = tmp + " ";
  3368. }
  3369. model.setValue("/root/main/item1/iteminfo/edirmk",tmp + memo);
  3370. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  3371. model.refresh();
  3372. }
  3373. //확인코드(JT001) 줄단위 특정내역 입력
  3374. function fCnfmCdInsert(){
  3375. var trgtManWindow = getChildWindow("SPPIJ00500");
  3376. //var edicd = model.getValue("/root/main/list2/iscllist[" + grd_ordlist.row + "]/edicd");
  3377. var edicd = grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colref("edicd"));
  3378. var selectededicd = "";
  3379. var row = 0;
  3380. model.removenode("/root/hidden/sppij00500/rslt"); // SPPIZ00500_특정내역상세관리 에서 선택된 결과가 copyNode되는 경로임
  3381. model.resetInstanceNode("/root/hidden/sppij00500/cond");
  3382. if(edicd){
  3383. for (var i = 1; i < grd_clcjlist.rows; i++) {
  3384. if(edicd == model.getValue("/root/main/list4/clcjlist["+ i +"]/edicd")){
  3385. model.setValue("/root/hidden/sppij00500/cond/edicd", model.getValue("/root/main/list4/clcjlist["+ i +"]/edicd"));
  3386. model.setValue("/root/hidden/sppij00500/cond/spclcd", model.getValue("/root/main/list4/clcjlist["+ i +"]/spclcd"));
  3387. model.setValue("/root/hidden/sppij00500/cond/remfact", model.getValue("/root/main/list4/clcjlist["+ i +"]/remfact"));
  3388. model.setValue("/root/hidden/sppij00500/cond/spclspec", model.getValue("/root/main/list4/clcjlist["+ i +"]/spclspec"));
  3389. model.setValue("/root/hidden/sppij00500/cond/row", i);
  3390. selectededicd = edicd;
  3391. row = i;
  3392. }
  3393. }
  3394. //이미 등록된 확인코드가 있는경우
  3395. if(selectededicd){
  3396. model.setValue("/root/hidden/sppij00500/cond/unitflag", "J");
  3397. var chk = model.getValue("/root/hidden/sppij00500/cond/spclcd");
  3398. if(chk == "JT001"){
  3399. model.removeNodeset("root/hidden/sppiz01100/rslt");
  3400. model.makeValue("/root/hidden/sppiz01100/cond/code", model.getValue("/root/hidden/sppij00500/cond/spclspec"));
  3401. model.makeValue("/root/hidden/sppiz01100/edicd", edicd);
  3402. modal("SPPIZ01100" ,"", "10", "10", "SPPIZ01100", "/root/hidden/sppiz01100", "/root/init/sppiz01100", "", ""); // SPPIZ01100_확인코드조회
  3403. if (instance1.selectSingleNode("root/hidden/sppiz01100/rslt")) {
  3404. model.setValue("/root/main/list4/clcjlist["+ row +"]/spclspec", model.getValue("root/hidden/sppiz01100/rslt/code"));
  3405. //Combo 줄단위 코드로 셋팅
  3406. grd_clcjlist.cellComboNodeset(row,3) = "/root/init/P0117list/P0117[minval = 'J']";
  3407. grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colref("cnfmcd")) = model.getValue("root/hidden/sppiz01100/rslt/code");
  3408. model.refresh();
  3409. fSpclGridInsertRow() ;
  3410. }
  3411. }
  3412. //등록된 확인코드가 없으면 신규로 발생시켜준다.
  3413. }else{
  3414. model.removeNodeset("root/hidden/sppiz01100/rslt");
  3415. model.makeValue("/root/hidden/sppiz01100/cond/code", "");
  3416. modal("SPPIZ01100" ,"", "10", "10", "SPPIZ01100", "/root/hidden/sppiz01100", "/root/init/sppiz01100", "", ""); // SPPIZ01100_확인코드조회
  3417. if (instance1.selectSingleNode("root/hidden/sppiz01100/rslt")) {
  3418. fSpclGridInsertRow() ;
  3419. var row = grd_clcjlist.rows - 1;
  3420. //Combo 줄단위 코드로 셋팅
  3421. grd_clcjlist.cellComboNodeset(row,3) = "/root/init/P0117list/P0117[minval = 'J']";
  3422. model.setValue("/root/main/list4/clcjlist["+ row +"]/edicd", edicd);
  3423. model.setValue("/root/main/list4/clcjlist["+ row +"]/spclcd", "JT001");
  3424. model.setValue("/root/main/list4/clcjlist[" + row + "]/unitflag","J");
  3425. model.setValue("/root/main/list4/clcjlist[" + row + "]/spclmemoflag","E" );
  3426. model.setValue("/root/main/list4/clcjlist[" + row + "]/remfact", "X(5)");
  3427. model.setValue("/root/main/list4/clcjlist[" + row + "]/spclspec", model.getValue("root/hidden/sppiz01100/rslt/code"));
  3428. grd_ordlist.valueMatrix(grd_ordlist.row, grd_ordlist.colref("cnfmcd")) = model.getValue("root/hidden/sppiz01100/rslt/code");
  3429. //model.setValue("/root/main/list2/iscllist[" + grd_ordlist.row + "]/cnfmcd",model.getValue("root/hidden/sppiz01100/rslt/code"));
  3430. fSpclGridInsertRow() ;
  3431. }
  3432. }
  3433. //특정내역이 있는 처방에 'T'필드에 *표를 해준다.
  3434. //fSetOrdSpclTxt();
  3435. }
  3436. }
  3437. ///////////////////////////////////////////////////////////////////////////
  3438. //특정내역 관련 코딩 종료 //
  3439. ///////////////////////////////////////////////////////////////////////////
  3440. ///////////////////////////////////////////////////////////////////////////
  3441. // 조합기호(ipt_cmpyno)를 입력하면 해당 조합명칭을 조회한다.
  3442. function fGetCmpyNm() {
  3443. /*var rrgstno = model.getValue("/root/main/item1/iteminfo/rrgstno");
  3444. rrgstno = rrgstno.replace("-","");
  3445. //보험증번호 조회(보험자격조회)
  3446. var parm = rrgstno + "▦" + //주민번호
  3447. model.getValue("/root/main/item1/iteminfo/patnm") + "▦" + //이름
  3448. model.getValue("/root/main/item1/iteminfo/indd") + "▦";//진료일자
  3449. setParameter("SPPMC03700_PARM",parm);
  3450. setParameter("SPPMC03700_RTN","");
  3451. modal("SPPMC03700", "1","400", "400", "SPPMC03700", "", "", "", ""); */
  3452. }
  3453. //보조유형이 바뀌는경우
  3454. function fSetPatSuppRate() {
  3455. // 보조유형ID과 요율%로 combo 의 value
  3456. // 보조유형NM과 요율%로 combo 의 label
  3457. //cmb_suppkind.choices.itemset.attribute("nodeset") = "/root/main/item4/insu[suppkind = '"+ cmb_suppkind.value +"']";
  3458. var suppkindcd = model.getValue("/root/main/item4/insu/suppkind");
  3459. var payownbrate = model.getValue("/root/main/item4/insu/ownbrate");
  3460. model.setValue("/root/main/item1/iteminfo/suppkindcd", suppkindcd);
  3461. model.setValue("/root/main/item1/iteminfo/ownrate", payownbrate);
  3462. if(payownbrate == "20"){
  3463. opt_suppkind.attribute("class") = "output_fix";
  3464. }else{
  3465. opt_suppkind.attribute("color") = "#ff0066";
  3466. }
  3467. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  3468. model.refreshpart("/root/main/item1/iteminfo");
  3469. }
  3470. ///////////////////////////////////////////////////////////////////////////
  3471. //처방 관련 코딩 시작 //
  3472. ///////////////////////////////////////////////////////////////////////////
  3473. //처방조회 옵션에 항목구분에 처방이 있는 것만 Bold로 보여준다.
  3474. //이건 처음에 로드했을때 한번만 도는것이라서 따로 분리하여 만듬. 2007.09.09 박도형
  3475. // 최적화 문제로 else if를 사용하여 수정 - 20081017 박창원
  3476. function fSetItemBold(){
  3477. rdo_ordfilflag.item(0).attribute("font-weight") = "bold"; // "전체" 항목은 default 로 굵게 표시한다.
  3478. //우선 초기화를 한다.
  3479. rdo_ordfilflag.item(1).attribute("font-weight") = "normal";
  3480. rdo_ordfilflag.item(2).attribute("font-weight") = "normal";
  3481. rdo_ordfilflag.item(3).attribute("font-weight") = "normal";
  3482. rdo_ordfilflag.item(4).attribute("font-weight") = "normal";
  3483. rdo_ordfilflag.item(5).attribute("font-weight") = "normal";
  3484. rdo_ordfilflag.item(6).attribute("font-weight") = "normal";
  3485. rdo_ordfilflag.item(7).attribute("font-weight") = "normal";
  3486. rdo_ordfilflag.item(8).attribute("font-weight") = "normal";
  3487. rdo_ordfilflag.item(9).attribute("font-weight") = "normal";
  3488. rdo_ordfilflag.item(10).attribute("font-weight") = "normal";
  3489. rdo_ordfilflag.item(11).attribute("font-weight") = "normal";
  3490. rdo_ordfilflag.item(12).attribute("font-weight") = "normal";
  3491. // 처방 조회부 항목구분 Radio에서 해당 처방이 있는 item을 굵게 표시한다.
  3492. var item1 = model.getValue("/root/main/list2/iscllist[item1='01']/item1"); //항목구분 에 Bold처리하기 위한 체크
  3493. var item2 = model.getValue("/root/main/list2/iscllist[item1='02']/item1");
  3494. var item3 = model.getValue("/root/main/list2/iscllist[item1='03']/item1");
  3495. var item4 = model.getValue("/root/main/list2/iscllist[item1='04']/item1");
  3496. var item5 = model.getValue("/root/main/list2/iscllist[item1='05']/item1");
  3497. var item6 = model.getValue("/root/main/list2/iscllist[item1='06']/item1");
  3498. var item7 = model.getValue("/root/main/list2/iscllist[item1='07']/item1");
  3499. var item8 = model.getValue("/root/main/list2/iscllist[item1='08']/item1");
  3500. var item9 = model.getValue("/root/main/list2/iscllist[item1='09']/item1");
  3501. var item10 = model.getValue("/root/main/list2/iscllist[item1='10']/item1");
  3502. var itemSS = model.getValue("/root/main/list2/iscllist[item1='SS']/item1");
  3503. var itemAA = model.getValue("/root/main/list2/iscllist[item1='AA']/item1");
  3504. var itemBB = model.getValue("/root/main/list2/iscllist[item1='BB']/item1");
  3505. if (item1 == "01") {
  3506. rdo_ordfilflag.item(1).attribute("font-weight") = "bold";
  3507. }
  3508. if (item2 == "02") {
  3509. rdo_ordfilflag.item(2).attribute("font-weight") = "bold";
  3510. }
  3511. if (item3 == "03") {
  3512. rdo_ordfilflag.item(3).attribute("font-weight") = "bold";
  3513. }
  3514. if (item4 == "04") {
  3515. rdo_ordfilflag.item(4).attribute("font-weight") = "bold";
  3516. }
  3517. if (item5 == "05") {
  3518. rdo_ordfilflag.item(5).attribute("font-weight") = "bold";
  3519. }
  3520. if (item6 == "06") {
  3521. rdo_ordfilflag.item(6).attribute("font-weight") = "bold";
  3522. }
  3523. if (item7 == "07") {
  3524. rdo_ordfilflag.item(7).attribute("font-weight") = "bold";
  3525. }
  3526. if (item8 == "08") {
  3527. rdo_ordfilflag.item(8).attribute("font-weight") = "bold";
  3528. }
  3529. if (item9 == "09") {
  3530. rdo_ordfilflag.item(9).attribute("font-weight") = "bold";
  3531. }
  3532. if (item10 == "10") {
  3533. rdo_ordfilflag.item(10).attribute("font-weight") = "bold";
  3534. }
  3535. if (itemSS == "SS") {
  3536. rdo_ordfilflag.item(11).attribute("font-weight") = "bold";
  3537. }
  3538. if (itemAA == "AA" || itemBB == "BB" ) {
  3539. rdo_ordfilflag.item(12).attribute("font-weight") = "bold";
  3540. }
  3541. }
  3542. // 20091126 수정추가 JHP 요청번호 8496, 주사제 4항1목, 마취제 5항 1목에 대해 1회량이 20이 넘으면 메세지 처리요청 ####################시작
  3543. function fChkinjanstmsg(){
  3544. var visualcalcscorcd = "-";
  3545. // SNGLEARNCLS - > 05, 04, 09 (처방분류에서 주사제/내분비대사/ Insulin&Antidiabetics 제외) 구현해야함.
  3546. // 20091130 JHP snglearncls값 확인하여 050409값일때는 메세지 처리 제외한다.
  3547. // 처방for 로직 수정 속도개선 plet2
  3548. var nodelist = model.instances(0).selectNodes("/root/main/list2/iscllist[item1='04' and item2='01' and calcqty>= 20 and snglearncls!='050409']/snglcalcscorcd");
  3549. if (nodelist.length > 0) {
  3550. var i=0;
  3551. while(nodelist.nextNode()){
  3552. visualcalcscorcd = visualcalcscorcd + ', ' + nodelist.item(i).value;
  3553. ++i;
  3554. }
  3555. }
  3556. if(visualcalcscorcd != "-"){
  3557. messageBox("1회량 20이상인 주사제가 존재합니다.(인슐린제외) \n\n(" + visualcalcscorcd + ")\n\n","I007");
  3558. }
  3559. }
  3560. // 항목별소계
  3561. function fSetItemSubTotal() {
  3562. grd_ordlist.rebuildStyle();
  3563. grd_ordlist.rebuild();
  3564. // ****************************************************************************************************************
  3565. // 항목별 소계 subtotal 김상진 20101122
  3566. // ****************************************************************************************************************
  3567. // #ffff0| 밝은노랑
  3568. // #d9e3fe 옅은파랑
  3569. // #eeddff 옅은보라
  3570. // #b9fcf8 밝은하늘
  3571. // #cefcfa 옅은하늘
  3572. var grdobj = document.controls.item("grd_ordlist");
  3573. if (model.getValue(chk_showsubtotal.attribute("ref")) == "Y") {
  3574. var col_hngnm = grdobj.colRef("hngnm");
  3575. var col_item1 = grdobj.colRef("item1");
  3576. var subtot_style = "background-color:#cefcfa; color:#0000ff;font-weight:bold;"
  3577. var subtot_fromat = "format:(-)#,###; roundmode:round; roundposition:0"
  3578. grdobj.subtotalposition= "below";
  3579. grdobj.subtotal("sum", col_item1, grdobj.colRef("hospaddamt"),subtot_fromat, subtot_style, col_hngnm, col_hngnm, true);
  3580. grdobj.subtotal("sum", col_item1, grdobj.colRef("specamt"),subtot_fromat, subtot_style, col_hngnm, col_hngnm, true);
  3581. grdobj.subtotal("sum", col_item1, grdobj.colRef("totordamt"),subtot_fromat, subtot_style, col_hngnm, col_hngnm, true);
  3582. grdobj.subtotal("sum", col_item1, grdobj.colRef("calcamt"),subtot_fromat, subtot_style, col_hngnm, col_hngnm, true);
  3583. var srchnm = "";
  3584. var fild1 = "0";
  3585. var rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_item1, true, true);
  3586. while( rowno > 0){
  3587. var fild1 = "0";
  3588. fild1 = grd_ordlist.valueMatrix(rowno, col_hngnm);
  3589. if(fild1 == "01"){
  3590. grd_ordlist.valueMatrix(rowno, col_hngnm) = "진찰료 소계";
  3591. }else if(fild1== "02"){
  3592. grd_ordlist.valueMatrix(rowno, col_hngnm) = "입원료 소계";
  3593. }else if(fild1 == "03"){
  3594. grd_ordlist.valueMatrix(rowno, col_hngnm) = "투약료 소계";
  3595. }else if(fild1 == "04"){
  3596. grd_ordlist.valueMatrix(rowno, col_hngnm) = "주사료 소계";
  3597. }else if(fild1 == "05"){
  3598. grd_ordlist.valueMatrix(rowno, col_hngnm) = "마취료 소계";
  3599. }else if(fild1 == "06"){
  3600. grd_ordlist.valueMatrix(rowno, col_hngnm) = "이학료 소계";
  3601. }else if(fild1 == "07"){
  3602. grd_ordlist.valueMatrix(rowno, col_hngnm) = "정신료 소계";
  3603. }else if(fild1 == "08"){
  3604. grd_ordlist.valueMatrix(rowno, col_hngnm) = "수술료 소계";
  3605. }else if(fild1 == "09"){
  3606. grd_ordlist.valueMatrix(rowno, col_hngnm) = "검사료 소계";
  3607. }else if(fild1 == "10"){
  3608. grd_ordlist.valueMatrix(rowno, col_hngnm) = "방사선 소계";
  3609. }else if(fild1 == "SS"){
  3610. grd_ordlist.valueMatrix(rowno, col_hngnm) = "특수 소계";
  3611. }
  3612. rowno = grdobj.findRow(srchnm, rowno + 1,col_item1,true,true);
  3613. }
  3614. }
  3615. }
  3616. //범례 색깔을 표시한다.
  3617. function fSetColorSpclJudgOrder() {
  3618. //일단 수정변경 : 20090915 : JHP 필터기능으로 숨김기능이 제어가 되어서 for문을 돌릴때 i의 제어가 어렵다 하여 datagrid의 rows로 for문을 돌리는걸로 변경한다.
  3619. if (model.getValue(chk_showitemcoloryn.attribute("ref")) == "Y") {
  3620. fSetOrderColorByEdiitem();
  3621. }
  3622. //Color 표시 범례
  3623. //1. 문제처방 : #fcd2c1
  3624. //2. 선별심사 : #ffe79d
  3625. //3. 선별심사 + 문제처방 : #7BE6B7
  3626. //4. 야간, 공휴가산 : #ffff00(밝은노랑)
  3627. //선별심사, 문제처방 체크 (기왕증, CP보다 우선시 한다. -심사자가 기왕증 ,CP여부를 확인하고 문제처방을 한경우 임으로)
  3628. var grdobj = document.controls.item("grd_ordlist");
  3629. var col_hngnm = grdobj.colRef("hngnm");
  3630. var col_probordyn = grdobj.colRef("probordyn");
  3631. var srchnm = "Y";
  3632. var spcljudgyn = "";
  3633. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_probordyn, true, true);
  3634. while( rowno > 0){
  3635. grd_ordlist.rowStyle(rowno,"data","background-color") = "#fcd2c1";
  3636. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_probordyn, true, true);
  3637. }
  3638. var col_spcljudgyn = grdobj.colRef("spcljudgyn");
  3639. var probordyn = "";
  3640. var rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_spcljudgyn, true, true);
  3641. while( rowno > 0){
  3642. grd_ordlist.rowStyle(rowno,"data","background-color") = "#ffe79d";
  3643. probordyn = grdobj.valueMatrix(rowno, col_probordyn);
  3644. if (probordyn == "Y"){ //둘다 체크된경우
  3645. grd_ordlist.rowStyle(rowno,"data","background-color") = "#7BE6B7";
  3646. }
  3647. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_spcljudgyn, true, true);
  3648. }
  3649. // 야간가산(산정의미 두번째 "1'), 공휴가산(산정의미 두번째자리 "5")
  3650. var col_estmmeancd = grdobj.colRef("estmmeancd");
  3651. var col_pay100 = grdobj.colRef("pay100");
  3652. srchnm = "1";
  3653. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3654. while( rowno > 0){
  3655. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3656. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3657. }
  3658. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3659. }
  3660. // 야간가산(산정의미 두번째 "1'), 공휴가산(산정의미 두번째자리 "5")
  3661. srchnm = "5";
  3662. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3663. while( rowno > 0){
  3664. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3665. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3666. }
  3667. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3668. }
  3669. //응급가산 ( '2','3','P','Q' )
  3670. var erindt = model.getValue("/root/main/item1/iteminfo/erindt");
  3671. var eroutdt = model.getValue("/root/main/item1/iteminfo/eroutdt");
  3672. var outdate = eroutdt.toDate("YYYYMMDDhhmm").getDateFormat("YYYYMMDDhhmm");
  3673. var in24date = erindt.toDate("YYYYMMDDhhmm").getAddDate(24,"h").getDateFormat("YYYYMMDDhhmm");
  3674. var basedate = "";
  3675. var execddtm = "";
  3676. if (outdate < in24date ) {
  3677. basedate = outdate;
  3678. } else {
  3679. basedate = in24date;
  3680. }
  3681. srchnm = "2";
  3682. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3683. while( rowno > 0){
  3684. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3685. execddtm =grdobj.valueMatrix(rowno,grdobj.colRef("execddtm")).toDate("YYYYMMDDhhmm").getDateFormat("YYYYMMDDhhmm") ;
  3686. if (execddtm > basedate) {
  3687. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3688. }
  3689. }
  3690. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3691. }
  3692. srchnm = "3";
  3693. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3694. while( rowno > 0){
  3695. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3696. execddtm =grdobj.valueMatrix(rowno,grdobj.colRef("execddtm")).toDate("YYYYMMDDhhmm").getDateFormat("YYYYMMDDhhmm") ;
  3697. if (execddtm > basedate) {
  3698. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3699. }
  3700. }
  3701. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3702. }
  3703. srchnm = "P";
  3704. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3705. while( rowno > 0){
  3706. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3707. execddtm =grdobj.valueMatrix(rowno,grdobj.colRef("execddtm")).toDate("YYYYMMDDhhmm").getDateFormat("YYYYMMDDhhmm") ;
  3708. if (execddtm > basedate) {
  3709. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3710. }
  3711. }
  3712. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3713. }
  3714. srchnm = "Q";
  3715. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_estmmeancd, false, false);
  3716. while( rowno > 0){
  3717. if ( grdobj.valueMatrix(rowno,col_estmmeancd).substr(1, 1) == srchnm ){
  3718. execddtm =grdobj.valueMatrix(rowno,grdobj.colRef("execddtm")).toDate("YYYYMMDDhhmm").getDateFormat("YYYYMMDDhhmm") ;
  3719. if (execddtm > basedate) {
  3720. grdobj.cellStyle("background-color", rowno, col_estmmeancd, rowno, col_pay100) = "#ffff00";
  3721. }
  3722. }
  3723. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_estmmeancd, false, false);
  3724. }
  3725. //DRG 수술구분
  3726. var col_drgopyn = grdobj.colRef("drgopyn");
  3727. srchnm = "Y";
  3728. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_drgopyn, true, true);
  3729. while( rowno > 0){
  3730. grdobj.cellStyle("background-color", rowno, col_pay100, rowno, col_pay100) = "#fec34d";
  3731. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_drgopyn, true, true);
  3732. }
  3733. // 급여구분 본인부담, 일반 색깔구분
  3734. var col_calcpayflag = grdobj.colRef("calcpayflag");
  3735. srchnm = "1";
  3736. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_calcpayflag, true, true);
  3737. while( rowno > 0){
  3738. grdobj.cellStyle("background-color", rowno, col_calcpayflag, rowno, col_calcpayflag) = "#00ff00";
  3739. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_calcpayflag, true, true);
  3740. }
  3741. srchnm = "2";
  3742. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_calcpayflag, true, true);
  3743. while( rowno > 0){
  3744. var pynpy = grdobj.valueMatrix(rowno,grdobj.colRef("pynpy"));
  3745. if (pynpy != 0) {
  3746. grdobj.cellStyle("background-color", rowno, col_calcpayflag, rowno, col_calcpayflag) = "#ccccff";
  3747. } else {
  3748. grdobj.cellStyle("background-color", rowno, col_calcpayflag, rowno, col_calcpayflag) = "#ff99cc";
  3749. }
  3750. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_calcpayflag, true, true);
  3751. }
  3752. // 외래 필수심사 품목 표기
  3753. var col_bfjudgyn = grdobj.colRef("bfjudgyn");
  3754. srchnm = "Y";
  3755. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_bfjudgyn, true, true);
  3756. while( rowno > 0){
  3757. grdobj.cellStyle("background-color", rowno, col_hngnm, rowno, col_hngnm) = "#f7a08b";
  3758. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_bfjudgyn, true, true);
  3759. }
  3760. // 응급수가 표기 : 별표1 (2015.12.30.LEJ)
  3761. var col_pordarcptyn = grdobj.colRef("pordarcptyn");
  3762. srchnm = "1";
  3763. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_pordarcptyn, true, true);
  3764. while( rowno > 0){
  3765. grdobj.cellStyle("background-color", rowno, col_pordarcptyn, rowno, col_pordarcptyn) = "#66CCFF";
  3766. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_pordarcptyn, true, true);
  3767. }
  3768. // 응급수가 표기 : 별표2 (2015.12.30.LEJ)
  3769. var col_pordarcptyn = grdobj.colRef("pordarcptyn");
  3770. srchnm = "2";
  3771. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_pordarcptyn, true, true);
  3772. while( rowno > 0){
  3773. grdobj.cellStyle("background-color", rowno, col_pordarcptyn, rowno, col_pordarcptyn) = "#FF66FF";
  3774. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_pordarcptyn, true, true);
  3775. }
  3776. // 응급수가 표기 : 별표3 (2015.12.30.LEJ)
  3777. var col_pordarcptyn = grdobj.colRef("pordarcptyn");
  3778. srchnm = "3";
  3779. rowno = grdobj.findRow(srchnm,grdobj.fixedrows ,col_pordarcptyn, true, true);
  3780. while( rowno > 0){
  3781. grdobj.cellStyle("background-color", rowno, col_pordarcptyn, rowno, col_pordarcptyn) = "#339933";
  3782. rowno = grdobj.findRow(srchnm,rowno + 1 ,col_pordarcptyn, true, true);
  3783. }
  3784. var spclcnt = grd_clcjlist.rows;
  3785. var col_edicd = grdobj.colRef("edicd");
  3786. var spclcd = "";
  3787. var spclspec = "";
  3788. var spcledicd = "";
  3789. var spclunitflag = "";
  3790. for (var i = 0; i < spclcnt; i++) {
  3791. spclcd = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd"));
  3792. spclspec = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclspec"));
  3793. spcledicd = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("edicd"));
  3794. spclunitflag = grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("unitflag"));
  3795. if (spclunitflag == 'J') { // 줄단위 특정내역인 경우만 적용한다. (2015.03.30 LEJ)
  3796. rowno = grdobj.findRow(spcledicd,grdobj.fixedrows ,col_edicd, true, true);
  3797. while( rowno > 0){
  3798. if(spclcd == "JT001"){
  3799. grdobj.valueMatrix(rowno,grdobj.colRef("cnfmcd")) = spclspec;
  3800. }else{
  3801. grdobj.valueMatrix(rowno,grdobj.colRef("text")) = "*";
  3802. }
  3803. rowno = grdobj.findRow(spcledicd,rowno + 1 ,col_edicd, true, true);
  3804. }
  3805. }
  3806. }
  3807. }
  3808. //특정내역이 있는 처방에 'T'필드에 *표를 해준다.
  3809. function fSetOrdSpclTxt(){
  3810. var cSrcNode = instance1.selectSingleNode("/root/main/list2/iscllist");
  3811. if (cSrcNode == null) { // 특정내역이 없는 경우임
  3812. return;
  3813. }
  3814. var rowcnt = getNodesetCount("/root/main/list2/iscllist");
  3815. rowcnt = eval(rowcnt) + 1;
  3816. // grd_clcjlist.findRow 로 변경(최적화문제) - 20081017 박창원
  3817. for (var i = 1; i < rowcnt ; i++) { // Grid 필터링 이후 Grid 상에 표시된 처방 개수만큼 돌면서
  3818. var edicd = model.getValue("/root/main/list2/iscllist[" + i + "]/edicd");
  3819. var spcl = grd_clcjlist.rows;
  3820. model.setValue("/root/main/list2/iscllist[" + i + "]/text", "");
  3821. if(spcl > 0){
  3822. if (edicd != "") {
  3823. var row = grd_clcjlist.findRow(edicd, 0, grd_clcjlist.colRef("edicd"), false, true);
  3824. if ( row > 0 ) {
  3825. var spclcd = model.getValue("/root/main/list4/clcjlist[" + row + "]/spclcd");
  3826. var spclspec = model.getValue("/root/main/list4/clcjlist[" + row + "]/spclspec");
  3827. var spcledicd = model.getValue("/root/main/list4/clcjlist[" + row + "]/spcledicd");
  3828. if(edicd == spcledicd){
  3829. if(spclcd == "JT001"){
  3830. model.setValue("/root/main/list2/iscllist[" + i + "]/cnfmcd", spclspec);
  3831. }else{
  3832. model.setValue("/root/main/list2/iscllist[" + i + "]/text", "*");
  3833. }
  3834. }
  3835. }
  3836. }
  3837. }
  3838. }
  3839. grd_ordlist.refresh();
  3840. }
  3841. // 처방 치식 입력
  3842. function fOrderToothInput() {
  3843. var row = grd_ordlist.mouseRow;
  3844. model.setValue("/root/hidden/sppiz00600/cond/pid", model.getValue("/root/main/item1/clbs/pid"));
  3845. model.setValue("/root/hidden/sppiz00600/cond/toot", model.getValue("/root/main/list2/clod[" + row + "]/toot"));
  3846. model.removenode("/root/hidden/sppiz00600/rslt"); // SPPIZ00600_상병및처방별치식 에서 선택된 결과가 copyNode되는 경로임
  3847. modal("SPPIZ00600" ,"", "10", "10", "SPPIZ00600", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
  3848. var tootSelect = instance1.selectSingleNode("/root/hidden/sppiz00600/rslt");
  3849. if (tootSelect != null) { // 취소를 누른 경우를 제외시킴
  3850. var toot = model.getValue("/root/hidden/sppiz00600/rslt/toot");
  3851. model.setValue("/root/main/list3/diaglist[" + row + "]/toothYN", model.getValue("/root/hidden/sppiz00600/rslt/toothYN"));
  3852. model.setValue("/root/main/list3/diaglist[" + row + "]/toot", toot);
  3853. model.refresh();
  3854. if (model.getValue("/root/hidden/sppiz00600/cond/toot") != toot) { // 치식번호가 변경된 경우
  3855. var diagstatus = grd_diaglist.rowstatus(row);
  3856. if (diagstatus == 0 || diagstatus == 2) { // 0 : new, 2 : update
  3857. grd_diaglist.rowstatus(row) = 2; // 2 : update
  3858. }
  3859. }
  3860. }
  3861. }
  3862. ///////////////////////////////////////////////////////////////////////////
  3863. //처방 관련 코딩 끝 //
  3864. ///////////////////////////////////////////////////////////////////////////
  3865. ///////////////////////////////////////////////////////////////////////////
  3866. //저장로직 관련 코딩 시작 //
  3867. ///////////////////////////////////////////////////////////////////////////
  3868. //저장로직
  3869. function fSaveMain(flag){
  3870. // 1. 기본적인 누락정보를 확인한다.
  3871. if (fCheckSave()){
  3872. } else {
  3873. return false;
  3874. }
  3875. fSaveAll();
  3876. //fGetItemInfo();
  3877. //보험, 급여환자인경우는 중증여부를 체크한다.
  3878. var chkInsukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  3879. if(chkInsukind == "11" || chkInsukind == "21" || chkInsukind == "22"){
  3880. if (flag != "P") {
  3881. //1. 중증, 산정특례 변경 여부 체크
  3882. fUpdtCheckEssc(flag);
  3883. }
  3884. }
  3885. return true;
  3886. }
  3887. function fSaveAll(){
  3888. model.setValue("/root/send/item1/iteminfo",getNodeListCSV(instance1.selectNodes("/root/main/item1/iteminfo")));
  3889. //상병은 전체 삭제 날리고 다시 insert시킨다.
  3890. //빈데이터를 삭제한다.
  3891. var rowcnt = grd_diaglist.rows;
  3892. for (var i = rowcnt; i > 0; i--) { // Grid 필터링 이후 Grid 상에 표시된 처방 개수만큼 돌면서
  3893. var diagcd = model.getValue("/root/main/list3/diaglist[" + i + "]/diagcd");
  3894. if(diagcd == ""){
  3895. grd_diaglist.deleteRow(i, false);
  3896. }else{
  3897. grd_diaglist.rowstatus(i) = 3;
  3898. }
  3899. }
  3900. var updtdiag = getGridUpdateData(grd_diaglist);
  3901. if(updtdiag) {
  3902. model.setValue("/root/send/diaglist",grd_diaglist.getUpdateData());
  3903. }
  3904. if (btn_save.disabled == false) {
  3905. //빈데이터를 삭제한다.
  3906. for (var i = 1; i < grd_clcjlist.rows; i++) { // Grid 필터링 이후 Grid 상에 표시된 특정내역 개수만큼 돌면서
  3907. var spclcd = model.getValue("/root/main/list4/clcjlist[" + i + "]/spclcd");
  3908. if(spclcd == ""){
  3909. var rowstatus = grd_clcjlist.rowstatus(i);
  3910. if (rowstatus == 4) { // 4 : delete
  3911. return;
  3912. }
  3913. else if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  3914. grd_clcjlist.deleteRow(i, false); // 해당 라인을 Grid에서 삭제한다.
  3915. } else { // 0 : new, 2 : update
  3916. grd_clcjlist.rowstatus(i) = 4; // 4 : delete 상태로 stat를 변경한다.
  3917. }
  3918. }
  3919. }
  3920. var updtclcj = getGridUpdateData(grd_clcjlist);
  3921. if(updtclcj) {
  3922. model.setValue("/root/send/clcjlist",grd_clcjlist.getUpdateData());
  3923. //if ( submit("TXPIJ00303") ) {
  3924. //삭제였던 특정내역은 그리드에서 지워 버린다.
  3925. for (var d = grd_clcjlist.rows; d > 0 ; d--) {
  3926. var delstatus = grd_clcjlist.rowstatus(d);
  3927. if(delstatus == 4){
  3928. grd_clcjlist.deleteRow(d, false); // 해당 라인을 Grid에서 삭제한다.
  3929. }
  3930. }
  3931. grd_clcjlist.clearStatus();
  3932. // }
  3933. }
  3934. //저장후 빈행을 추가해 준다.
  3935. fSpclGridInsertRow() ;
  3936. }
  3937. //특정내역 처리
  3938. var judgrmk = model.getValue("/root/main/item1/iteminfo/judgrmk");
  3939. var edirmk = model.getValue("/root/main/item1/iteminfo/edirmk");
  3940. var tstrmk = model.getValue("/root/main/item1/iteminfo/tstrmk");
  3941. var dumprmk = model.getValue("/root/main/item1/iteminfo/dumprmk");
  3942. // var tmpedirmk = strTrim(edirmk);
  3943. model.removenode("/root/main/list5");
  3944. if(judgrmk){
  3945. fSetJudgEDIMemo(judgrmk, "Y");
  3946. }
  3947. if(edirmk){
  3948. fSetJudgEDIMemo(edirmk, "N");
  3949. }
  3950. if(tstrmk){
  3951. fSetJudgEDIMemo(tstrmk, "T");
  3952. }
  3953. if(dumprmk){
  3954. fSetJudgEDIMemo(dumprmk, "D");
  3955. }
  3956. model.setValue("/root/send/spclspec",getNodeListCSV(instance1.selectNodes("/root/main/list5/judgrmk")));
  3957. submit("TXPIJ00309",false);
  3958. }
  3959. //저장전 데이터 유효성을 점검한다.
  3960. function fCheckSave(){
  3961. var bfmonth6 = VAL_today.toDate().getAddDate(-180,'D');
  3962. var brthdd = model.getValue("/root/main/item1/iteminfo/brthdd").toDate();
  3963. var snglcalcscorcls0210 = model.getValue("/root/main/list2/iscllist[snglcalcscorcls='0210' and calcpayflag='0' and snglcalcscorcd != 'Z9000' and snglcalcscorcd != 'Z9000-1' and snglcalcscorcd != 'Q9140001' and snglcalcscorcd != 'Q9140002']/snglcalcscorcls");
  3964. var snglcalcscorcls0211 = model.getValue("/root/main/list2/iscllist[snglcalcscorcls='0211' and calcpayflag='0' and snglcalcscorcd != 'Z9000' and snglcalcscorcd != 'Z9000-1' and snglcalcscorcd != 'Q9140001' and snglcalcscorcd != 'Q9140002']/snglcalcscorcls");
  3965. if ((bfmonth6 <= brthdd ) && (snglcalcscorcls0210 != "" || snglcalcscorcls0211 != "") ) {
  3966. if (messageBox("6개월 미만 소아환자에게 식이 청구되었습니다. 확인바랍니다. 저장","S001") == 6) {
  3967. return true;
  3968. } else {
  3969. return false;
  3970. }
  3971. } else {
  3972. return true;
  3973. }
  3974. }
  3975. //상병리스트를 저장한다.
  3976. function fSaveDiagList(){
  3977. //상병은 전체 삭제 날리고 다시 insert시킨다.
  3978. //빈데이터를 삭제한다.
  3979. var rowcnt = grd_diaglist.rows;
  3980. for (var i = rowcnt; i > 0; i--) { // Grid 필터링 이후 Grid 상에 표시된 처방 개수만큼 돌면서
  3981. var diagcd = model.getValue("/root/main/list3/diaglist[" + i + "]/diagcd");
  3982. if(diagcd == ""){
  3983. grd_diaglist.deleteRow(i, false);
  3984. }else{
  3985. grd_diaglist.rowstatus(i) = 3;
  3986. }
  3987. }
  3988. var updtdiag = getGridUpdateData(grd_diaglist);
  3989. if(updtdiag) {
  3990. model.setValue("/root/send/diaglist",grd_diaglist.getUpdateData());
  3991. if ( submit("TXPIJ00302",false) ) {
  3992. }
  3993. }
  3994. model.refreshpart("/root/main/list3/diaglist");
  3995. }
  3996. //특정내역을 저장 한다.
  3997. function fSaveClcjList(){
  3998. if (btn_save.disabled == false) {
  3999. //빈데이터를 삭제한다.
  4000. for (var i = 1; i < grd_clcjlist.rows; i++) { // Grid 필터링 이후 Grid 상에 표시된 특정내역 개수만큼 돌면서
  4001. var spclcd = model.getValue("/root/main/list4/clcjlist[" + i + "]/spclcd");
  4002. if(spclcd == ""){
  4003. var rowstatus = grd_clcjlist.rowstatus(i);
  4004. if (rowstatus == 4) { // 4 : delete
  4005. return;
  4006. }
  4007. else if (rowstatus == 1 || rowstatus == 3) { // 1 : insert, 3 : insert & new
  4008. grd_clcjlist.deleteRow(i, false); // 해당 라인을 Grid에서 삭제한다.
  4009. } else { // 0 : new, 2 : update
  4010. grd_clcjlist.rowstatus(i) = 4; // 4 : delete 상태로 stat를 변경한다.
  4011. }
  4012. }
  4013. }
  4014. var updtclcj = getGridUpdateData(grd_clcjlist);
  4015. if(updtclcj) {
  4016. model.setValue("/root/send/clcjlist",grd_clcjlist.getUpdateData());
  4017. if ( submit("TXPIJ00303",false) ) {
  4018. //삭제였던 특정내역은 그리드에서 지워 버린다.
  4019. for (var d = grd_clcjlist.rows; d > 0 ; d--) {
  4020. var delstatus = grd_clcjlist.rowstatus(d);
  4021. if(delstatus == 4){
  4022. grd_clcjlist.deleteRow(d, false); // 해당 라인을 Grid에서 삭제한다.
  4023. }
  4024. }
  4025. grd_clcjlist.clearStatus();
  4026. }
  4027. }
  4028. //저장후 빈행을 추가해 준다.
  4029. fSpclGridInsertRow() ;
  4030. }
  4031. }
  4032. //인적사항 저장
  4033. function fSaveItemInfo(){
  4034. submit("TXPIJ00301",false);
  4035. }
  4036. function strTrim(str){
  4037. return str.replace(/(^\s*)|(\s*$)/g, "");
  4038. }
  4039. //심사제 메모를 저장한다.
  4040. function fSaveJudgrmk(){
  4041. //특정내역 처리
  4042. var judgrmk = model.getValue("/root/main/item1/iteminfo/judgrmk");
  4043. var edirmk = model.getValue("/root/main/item1/iteminfo/edirmk");
  4044. var tstrmk = model.getValue("/root/main/item1/iteminfo/tstrmk");
  4045. // var tmpedirmk = strTrim(edirmk);
  4046. model.removenode("/root/main/list5");
  4047. if(judgrmk){
  4048. fSetJudgEDIMemo(judgrmk, "Y");
  4049. }
  4050. //if(edirmk){
  4051. fSetJudgEDIMemo(edirmk, "N");
  4052. //}
  4053. if(tstrmk){
  4054. fSetJudgEDIMemo(tstrmk, "T");
  4055. }
  4056. model.setValue("/root/main/item1/iteminfo/judgrmk_orign",judgrmk);
  4057. model.setValue("/root/main/item1/iteminfo/edirmk_orign",edirmk);
  4058. model.setValue("/root/main/item1/iteminfo/tstrmk_orign",tstrmk);
  4059. submit("TXPIJ00304",false);
  4060. }
  4061. //원무 계산서를 작성한다.
  4062. function fSaveCalcAmt(flag){
  4063. var cnt = 1;
  4064. var pid = model.getValue("/root/send/pid");
  4065. var indd = model.getValue("/root/send/indd");
  4066. var futureinsuyn = model.getValue("/root/main/item1/iteminfo/futureinsuyn");
  4067. model.resetInstanceNode("/root/send/insulist");
  4068. var instcd = model.getValue("/root/main/item1/iteminfo/instcd");
  4069. model.makeNode("/root/send/insu");
  4070. copyNodeType("/root/send/insu","/root/main/list1","replace");
  4071. var nodecnt = getNodesetCount("/root/send/insu/insulist");
  4072. // 배열 생성
  4073. var insuArray = new Array(nodecnt);
  4074. for (var i = 0; i<nodecnt; i++) {
  4075. insuArray[i] = new Array(grd_insuhistory.colref("indd"));
  4076. }
  4077. var row = 1;
  4078. for (var i = 0; i<nodecnt; i++) {
  4079. insuArray[i][0] = model.getValue("/root/send/insu/insulist["+ row + "]/insukind");
  4080. insuArray[i][1] = model.getValue("/root/send/insu/insulist["+ row + "]/suppkind");
  4081. insuArray[i][2] = model.getValue("/root/send/insu/insulist["+ row + "]/mskind");
  4082. insuArray[i][3] = model.getValue("/root/send/insu/insulist["+ row + "]/fromdd");
  4083. insuArray[i][4] = model.getValue("/root/send/insu/insulist["+ row + "]/todd");
  4084. insuArray[i][5] = model.getValue("/root/send/insu/insulist["+ row + "]/cretno");
  4085. insuArray[i][6] = model.getValue("/root/send/insu/insulist["+ row + "]/seqno");
  4086. insuArray[i][7] = model.getValue("/root/send/insu/insulist["+ row + "]/pid");
  4087. insuArray[i][8] = model.getValue("/root/send/insu/insulist["+ row + "]/indd");
  4088. insuArray[i][9] = model.getValue("/root/send/insu/insulist["+ row + "]/dschnotidt");
  4089. insuArray[i][10] = flag;
  4090. //할인계정 추가
  4091. insuArray[i][11] = model.getValue("/root/send/insu/insulist["+ row + "]/disccd");
  4092. insuArray[i][12] = model.getValue("/root/send/insu/insulist["+ row + "]/todd");
  4093. insuArray[i][13] = model.getValue("/root/send/insu/insulist["+ row + "]/ownbmaxgradeflag"); // 본인부담상한 구분 추가 20140320 LEJ
  4094. // insuArray[i][13] = model.getValue("/root/send/insu/insulist["+ row + "]/maxynm"); // 최종유형 날짜 처리를 위해서 20080924 박창원
  4095. // insuArray[i][14] = model.getValue("/root/send/insu/insulist["+ row + "]/maxyns"); // 최종유형 날짜 처리를 위해서 20080924 박창원
  4096. row++;
  4097. }
  4098. // 종료일 기준으로 sort
  4099. for (var i = 0; i<nodecnt; i++) {
  4100. for (var j = i+1; j<nodecnt; j++) {
  4101. var oldtodd = eval(insuArray[i][4]);
  4102. var newtodd = eval(insuArray[j][4]);
  4103. if (oldtodd > newtodd) {
  4104. var tempinsukind = insuArray[j][0];
  4105. var tempsuppkind = insuArray[j][1];
  4106. var tempmskind = insuArray[j][2];
  4107. var tempfromdd = insuArray[j][3];
  4108. var temptodd = insuArray[j][4];
  4109. var tempcretno = insuArray[j][5];
  4110. var tempseqno = insuArray[j][6];
  4111. var temppid = insuArray[j][7];
  4112. var tempindd = insuArray[j][8];
  4113. var tempdschnotidt = insuArray[j][9];
  4114. var tempflag = insuArray[j][10];
  4115. var tempdisccd = insuArray[j][11];
  4116. var temporgtodd = insuArray[i][12];
  4117. var tempownbmaxgradeflag = insuArray[i][13];
  4118. insuArray[j][0] = insuArray[i][0];
  4119. insuArray[j][1] = insuArray[i][1];
  4120. insuArray[j][2] = insuArray[i][2];
  4121. insuArray[j][3] = insuArray[i][3];
  4122. insuArray[j][4] = insuArray[i][4];
  4123. insuArray[j][5] = insuArray[i][5];
  4124. insuArray[j][6] = insuArray[i][6];
  4125. insuArray[j][7] = insuArray[i][7];
  4126. insuArray[j][8] = insuArray[i][8];
  4127. insuArray[j][9] = insuArray[i][9];
  4128. insuArray[j][10]= insuArray[i][10];
  4129. insuArray[j][11]= insuArray[i][11];
  4130. insuArray[j][12]= insuArray[i][12];
  4131. insuArray[j][13]= insuArray[i][13];
  4132. insuArray[i][0] = tempinsukind;
  4133. insuArray[i][1] = tempsuppkind;
  4134. insuArray[i][2] = tempmskind;
  4135. insuArray[i][3] = tempfromdd;
  4136. insuArray[i][4] = temptodd;
  4137. insuArray[i][5] = tempcretno;
  4138. insuArray[i][6] = tempseqno;
  4139. insuArray[i][7] = temppid;
  4140. insuArray[i][8] = tempindd;
  4141. insuArray[i][9] = tempdschnotidt;
  4142. insuArray[i][10]= tempflag;
  4143. insuArray[i][11]= tempdisccd;
  4144. insuArray[i][12]= temporgtodd;
  4145. insuArray[i][13]= tempownbmaxgradeflag;
  4146. }
  4147. }
  4148. }
  4149. // 배열에 있는 데이타를 node로 다시 copy
  4150. model.removenode("/root/send/insu");
  4151. row = 1;
  4152. var mskind = model.getValue("/root/send/mskind");
  4153. for (var i = 0; i<nodecnt; i++) {
  4154. var mskind_calc = insuArray[i][2];
  4155. if(mskind == mskind_calc){
  4156. model.makevalue("/root/send/insu/insulist["+ row + "]/insukind", insuArray[i][0]);
  4157. model.makevalue("/root/send/insu/insulist["+ row + "]/suppkind", insuArray[i][1]);
  4158. model.makevalue("/root/send/insu/insulist["+ row + "]/mskind", insuArray[i][2]);
  4159. model.makevalue("/root/send/insu/insulist["+ row + "]/fromdd", insuArray[i][3]);
  4160. // 마지막 데이타의 종료일자가 '99991231'일 경우 퇴원 통보일시로 변경
  4161. // 종료일자만 체크 - 20080924
  4162. if (insuArray[i][4] == "99991231" || insuArray[i][4] == "") {
  4163. model.makevalue("/root/send/insu/insulist["+ row + "]/todd", insuArray[i][9]);
  4164. model.makevalue("/root/send/insu/insulist["+ row + "]/orgtodd", "99991231");
  4165. } else {
  4166. // 미래유형이 있는경우 처리한다. 미래유형이 있는경우 마지막 데이터는 종료일이 99991231이 아님
  4167. // 미래유형이 있는 경우 종료일을 퇴원통보일로 맞춰주고 orgtodd는 99991231로 set 한다.
  4168. if (futureinsuyn == "Y" && row == nodecnt) {
  4169. model.makevalue("/root/send/insu/insulist["+ row + "]/todd", insuArray[i][9]);
  4170. model.makevalue("/root/send/insu/insulist["+ row + "]/orgtodd", "99991231");
  4171. }
  4172. model.makevalue("/root/send/insu/insulist["+ row + "]/todd", insuArray[i][4]);
  4173. model.makevalue("/root/send/insu/insulist["+ row + "]/orgtodd", insuArray[i][12]);
  4174. }
  4175. model.makevalue("/root/send/insu/insulist["+ row + "]/cretno", insuArray[i][5]);
  4176. model.makevalue("/root/send/insu/insulist["+ row + "]/seqno", insuArray[i][6]);
  4177. model.makevalue("/root/send/insu/insulist["+ row + "]/pid", insuArray[i][7]);
  4178. model.makevalue("/root/send/insu/insulist["+ row + "]/indd", insuArray[i][8]);
  4179. model.makevalue("/root/send/insu/insulist["+ row + "]/dschnotidt", insuArray[i][9]);
  4180. model.makevalue("/root/send/insu/insulist["+ row + "]/instcd", instcd);
  4181. model.makevalue("/root/send/insu/insulist["+ row + "]/flag", insuArray[i][10]);
  4182. model.makevalue("/root/send/insu/insulist["+ row + "]/disccd", insuArray[i][11]);
  4183. model.makevalue("/root/send/insu/insulist["+ row + "]/ownbmaxgradeflag", insuArray[i][13]);
  4184. row++;
  4185. }
  4186. }
  4187. if (submit("TXPIJ00306", false)) {
  4188. return 1;
  4189. } else {
  4190. return 0;
  4191. }
  4192. }
  4193. // 심사자메모, EDI청구메모를 특정내역 형식에 맞춰 설정한다.
  4194. function fSetJudgEDIMemo(spclmemo, usermemoyn) {
  4195. var item5Path = "";
  4196. var item5Node = "";
  4197. if (usermemoyn == "Y") {
  4198. item5Path = "/root/main/list5/judgrmk[";
  4199. item5Node = "U";
  4200. } else if(usermemoyn == "N"){
  4201. item5Path = "/root/main/list5/judgrmk[";
  4202. item5Node = "E";
  4203. } else if(usermemoyn == "D"){
  4204. item5Path = "/root/main/list5/judgrmk[";
  4205. item5Node = "D";
  4206. } else{
  4207. item5Path = "/root/main/list5/judgrmk[";
  4208. item5Node = "T";
  4209. }
  4210. var iSpclCdCnt = 0;
  4211. var spclcnt = instance1.selectSingleNode("/root/main/list5");
  4212. if(spclcnt != null){
  4213. var spcllist = spclcnt.childNodes;
  4214. iSpclCdCnt = spcllist.length ; // DB에 저장될 MX999 코드 개수
  4215. }
  4216. var iSpclCdTotLength = getStringLength(spclmemo); // (stringHelper.js) 문자열의 길이를 구한다.
  4217. // 수정추가 JHP 20090811 심사메모 4000byte초과시 alert메세지 띄우면서 안되게끔... 일단... clob으로 안되기때문에....
  4218. if (iSpclCdTotLength > 4000){
  4219. messageBox("심사/EDI메모내용이 너무길어 저장을 ","E001");
  4220. return false;
  4221. }
  4222. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  4223. if (iSpclCdTotLength > 1333) { // 새로 입력된 특정코드가 700byte를 넘는다.
  4224. // 영문(700자), 한글(350자) 길이로 잘라서 n개의 특정코드를 만든다.
  4225. var iLen = 0; // 특정내역 길이가 700 byte가 되었는지 계산
  4226. var iStartInx = 0; // 특정내역 시작 index
  4227. var iCharCnt = 0; // 몇글자로 구성되는지 계산
  4228. for (var i=0; i < spclmemo.length; i++) {
  4229. var sBit = spclmemo.charAt(i);
  4230. iCharCnt++;
  4231. if (escape(sBit).length > 4) {
  4232. iLen = iLen + 2;
  4233. } else {
  4234. iLen = iLen + 1;
  4235. }
  4236. if (iLen == 1333 || iLen > 1333) { // 영문(700자), 한글(350자)
  4237. iSpclCdCnt++;
  4238. //model.makeValue(item5Path + iSpclCdCnt + "]/" + item5Node + "usermemoyn", usermemoyn);
  4239. if (iLen == 350) { // 700byte로 길이가 끝난 경우
  4240. model.makeValue(item5Path + iSpclCdCnt + "]/spclspec", spclmemo.substr(iStartInx, iCharCnt));
  4241. model.makeValue(item5Path + iSpclCdCnt + "]/spclmemoflag", item5Node);
  4242. model.makeValue(item5Path + iSpclCdCnt + "]/m", "i");
  4243. model.makeValue(item5Path + iSpclCdCnt + "]/unitflag", "M");
  4244. model.makeValue(item5Path + iSpclCdCnt + "]/spclcd", "MX999");
  4245. model.makeValue(item5Path + iSpclCdCnt + "]/seqno", iSpclCdCnt);
  4246. model.makeValue(item5Path + iSpclCdCnt + "]/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  4247. model.makeValue(item5Path + iSpclCdCnt + "]/indd",indd);
  4248. model.makeValue(item5Path + iSpclCdCnt + "]/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  4249. model.makeValue(item5Path + iSpclCdCnt + "]/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  4250. model.makeValue(item5Path + iSpclCdCnt + "]/fromdd", model.getValue("/root/main/item1/iteminfo/fromdd"));
  4251. model.makeValue(item5Path + iSpclCdCnt + "]/instcd", "");
  4252. model.makeValue(item5Path + iSpclCdCnt + "]/lastupdtrid", "");
  4253. iStartInx += iCharCnt;
  4254. }
  4255. else if (iLen > 350) { // 영문(700자), 한글(350자)를 넘는 경우
  4256. model.makeValue(item5Path + iSpclCdCnt + "]/spclspec", spclmemo.substr(iStartInx, iCharCnt - 1));
  4257. model.makeValue(item5Path + iSpclCdCnt + "]/spclmemoflag", item5Node);
  4258. model.makeValue(item5Path + iSpclCdCnt + "]/m", "i");
  4259. model.makeValue(item5Path + iSpclCdCnt + "]/unitflag", "M");
  4260. model.makeValue(item5Path + iSpclCdCnt + "]/spclcd", "MX999");
  4261. model.makeValue(item5Path + iSpclCdCnt + "]/seqno", iSpclCdCnt);
  4262. model.makeValue(item5Path + iSpclCdCnt + "]/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  4263. model.makeValue(item5Path + iSpclCdCnt + "]/indd", indd);
  4264. model.makeValue(item5Path + iSpclCdCnt + "]/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  4265. model.makeValue(item5Path + iSpclCdCnt + "]/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  4266. model.makeValue(item5Path + iSpclCdCnt + "]/fromdd", model.getValue("/root/main/item1/iteminfo/fromdd"));
  4267. model.makeValue(item5Path + iSpclCdCnt + "]/instcd", "");
  4268. model.makeValue(item5Path + iSpclCdCnt + "]/lastupdtrid", "");
  4269. iStartInx += (iCharCnt - 1);
  4270. }
  4271. iCharCnt = 0;
  4272. iLen = 0;
  4273. if (parseInt(iSpclCdTotLength / 1333) == iSpclCdCnt) {
  4274. i = spclmemo.length;
  4275. if ((iSpclCdTotLength % 1333) != 0) { // 700Byte 씩 자르고 남은 길이가 있는 경우
  4276. iSpclCdCnt++;
  4277. //model.makeValue(item5Path + iSpclCdCnt + "]/" + item5Node + "usermemoyn", usermemoyn);
  4278. model.makeValue(item5Path + iSpclCdCnt + "]/spclspec", spclmemo.substring(iStartInx, spclmemo.length));
  4279. model.makeValue(item5Path + iSpclCdCnt + "]/spclmemoflag", item5Node);
  4280. model.makeValue(item5Path + iSpclCdCnt + "]/m", "i");
  4281. model.makeValue(item5Path + iSpclCdCnt + "]/unitflag", "M");
  4282. model.makeValue(item5Path + iSpclCdCnt + "]/spclcd", "MX999");
  4283. model.makeValue(item5Path + iSpclCdCnt + "]/seqno", iSpclCdCnt);
  4284. model.makeValue(item5Path + iSpclCdCnt + "]/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  4285. model.makeValue(item5Path + iSpclCdCnt + "]/indd", indd);
  4286. model.makeValue(item5Path + iSpclCdCnt + "]/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  4287. model.makeValue(item5Path + iSpclCdCnt + "]/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  4288. model.makeValue(item5Path + iSpclCdCnt + "]/fromdd", model.getValue("/root/main/item1/iteminfo/fromdd"));
  4289. model.makeValue(item5Path + iSpclCdCnt + "]/instcd", "");
  4290. model.makeValue(item5Path + iSpclCdCnt + "]/lastupdtrid", "");
  4291. }
  4292. }
  4293. }
  4294. }
  4295. } else { // 새로 입력된 특정코드는 700byte를 넘지 않는다.
  4296. //if (iSpclCdTotLength > 0) { // 새로 추가된 내용이 있다.
  4297. iSpclCdCnt++;
  4298. //model.makeValue(item5Path + iSpclCdCnt + "]/" + item5Node + "usermemoyn", usermemoyn);
  4299. model.makeValue(item5Path + iSpclCdCnt + "]/spclspec", spclmemo);
  4300. model.makeValue(item5Path + iSpclCdCnt + "]/spclmemoflag", item5Node);
  4301. model.makeValue(item5Path + iSpclCdCnt + "]/m", "i");
  4302. model.makeValue(item5Path + iSpclCdCnt + "]/unitflag", "M");
  4303. model.makeValue(item5Path + iSpclCdCnt + "]/spclcd", "MX999");
  4304. model.makeValue(item5Path + iSpclCdCnt + "]/seqno", "1");
  4305. model.makeValue(item5Path + iSpclCdCnt + "]/pid", model.getValue("/root/main/item1/iteminfo/pid"));
  4306. model.makeValue(item5Path + iSpclCdCnt + "]/indd", indd);
  4307. model.makeValue(item5Path + iSpclCdCnt + "]/mskind", model.getValue("/root/main/item1/iteminfo/mskind"));
  4308. model.makeValue(item5Path + iSpclCdCnt + "]/cretno", model.getValue("/root/main/item1/iteminfo/cretno"));
  4309. model.makeValue(item5Path + iSpclCdCnt + "]/fromdd", model.getValue("/root/main/item1/iteminfo/fromdd"));
  4310. model.makeValue(item5Path + iSpclCdCnt + "]/instcd", "");
  4311. model.makeValue(item5Path + iSpclCdCnt + "]/lastupdtrid", "");
  4312. //}
  4313. }
  4314. }
  4315. // 미래유형 정리 및 퇴원시 현황으로 HISTORY 유지하면서 inpt,iphs변경
  4316. //심사 완료 처리
  4317. function fJudgEnd(){
  4318. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","C");
  4319. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  4320. model.makevalue("/root/main/item1/iteminfo/indd1", indd);
  4321. if(submit("TXPIJ00301",false)) { //심사완료전 저장이 제대로 처리되지 않았을 경우네는 E70을 발생시키지 않게 한다. 20080908 박창원
  4322. fSaveCalcAmt("I");
  4323. fSetItemInfoSetting();
  4324. return 1;
  4325. }else {
  4326. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","B");
  4327. fSetItemInfoSetting();
  4328. return 0;
  4329. }
  4330. }
  4331. //통합심사 완료 처리
  4332. function fJudgAllEnd(){
  4333. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","E");
  4334. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  4335. model.makevalue("/root/main/item1/iteminfo/indd1", indd);
  4336. if(submit("TXPIJ00301",false)) { //심사완료전 저장이 제대로 처리되지 않았을 경우네는 E70을 발생시키지 않게 한다. 20080908 박창원
  4337. fSaveCalcAmt("I");
  4338. fSetItemInfoSetting();
  4339. return 1;
  4340. } else {
  4341. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","B");
  4342. fSetItemInfoSetting();
  4343. return 0;
  4344. }
  4345. }
  4346. //퇴원마감 취소 처리
  4347. function fJudgEndCancel(){
  4348. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","A");
  4349. if (submit("TXPIJ00301",false)) {
  4350. submit("TXPIJ03203",false);
  4351. fSetItemInfoSetting();
  4352. return 1;
  4353. } else {
  4354. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","B");
  4355. fSetItemInfoSetting();
  4356. return 0;
  4357. }
  4358. }
  4359. //예고심사 완료 처리
  4360. function fJudgDclrtEnd(){
  4361. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","G");
  4362. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  4363. model.makevalue("/root/main/item1/iteminfo/indd1", indd);
  4364. if(submit("TXPIJ00301",false)) { //심사완료전 저장이 제대로 처리되지 않았을 경우네는 E70을 발생시키지 않게 한다. 20080908 박창원
  4365. fSaveCalcAmt("I");
  4366. fSetItemInfoSetting();
  4367. return 1;
  4368. } else {
  4369. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","B");
  4370. fSetItemInfoSetting();
  4371. return 0;
  4372. }
  4373. }
  4374. ///////////////////////////////////////////////////////////////////////////
  4375. //저장로직 관련 코딩 종료 //
  4376. ///////////////////////////////////////////////////////////////////////////
  4377. ///////////////////////////////////////////////////////////////////////////
  4378. //체크로직 관련 코딩 종료
  4379. //1. 중증, 산정특례 여부 체크
  4380. //2. 분만여부 체크
  4381. //3. 수술여부 체크
  4382. ///////////////////////////////////////////////////////////////////////////
  4383. //1. 중증, 산정특례 여부 체크
  4384. // 기존로직이 보험 암환자의 경우 입원일 기준으로만 적용되게 되어있어 수정함 - 20081105 박창원
  4385. function fCheckEssc(){
  4386. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  4387. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  4388. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  4389. var mskind = model.getValue("/root/main/item1/iteminfo/mskind");
  4390. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  4391. var suppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  4392. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  4393. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  4394. var insuflag = "";
  4395. // 새로운기준적용을 위해 여기서부터 변수추가 - 20081105 박창원
  4396. var dschdd = model.getValue("/root/main/item1/iteminfo/dschdd");
  4397. btn_esscdiag.visible = false;
  4398. // 희귀난치 산정특례 처리 - 20090622 박창원, 7월1일부터 적용, H환자는 제외외어야함
  4399. var rareesscyn = model.getValue("/root/main/item12/rareessc/rareesscyn");
  4400. if (insukind == "11" && suppkind != "32" && rareesscyn == "Y" && suppkind != "01" && fromdd >= "20090701") {
  4401. // 20090930 JHP 희귀난치 등록여부 확인위해 추가함. -- 시작
  4402. var anohosprgstflag = model.getValue("/root/main/item13/rooa/anohosprgstflag");
  4403. var rareobstno = model.getValue("/root/main/item13/rooa/rareobstno");
  4404. var rareobstfromdd = model.getValue("/root/main/item13/rooa/rareobstfromdd");
  4405. var rareobsttodd = model.getValue("/root/main/item13/rooa/rareobsttodd");
  4406. var signyn = model.getValue("/root/main/item13/rooa/signyn");
  4407. //20091109 JHP 희귀난치 메세지는 상병에 R/O 상병일 경우는 메세지 제외함.
  4408. var ruleoutyn = model.getValue("/root/main/list3/diaglist[1]/ruleoutyn");
  4409. if(ruleoutyn == 'true'){
  4410. // 주상병 R/O일때에는 희귀난치 메세지 처리 안함.
  4411. }else{
  4412. if (fromdd >= "20091001") { // 10월1일 이후에는 등록번호가 반드시 있어야한다. - 추가코딩필요
  4413. // 타병원등록 여부 , Y:타병원,N:우리병원
  4414. if(anohosprgstflag == "Y"){
  4415. // 희귀난치 번호여부
  4416. if(rareobstno == null || rareobstno == '-'){
  4417. messageBox("## 희귀난치정보 ## : 타병원등록이나 희귀난치번호가 ","I004");
  4418. } else {
  4419. btn_esscdiag.visible = true;
  4420. btn_esscdiag.attribute("class") = "btn5_letter4";
  4421. btn_esscdiag.attribute("color") = "#ff0066";
  4422. return;
  4423. }
  4424. } else if(anohosprgstflag == "N"){
  4425. // 희귀난치 번호여부
  4426. if(rareobstno == null || rareobstno == '-'){
  4427. if(signyn == "Y"){
  4428. btn_esscdiag.visible = true;
  4429. btn_esscdiag.attribute("class") = "btn5_letter4";
  4430. btn_esscdiag.attribute("color") = "#ff0066";
  4431. return;
  4432. } else {
  4433. messageBox("## 희귀난치정보 ## : 재원병원등록이나 등록번호 및 서명정보가 ","I004");
  4434. }
  4435. } else{
  4436. btn_esscdiag.visible = true;
  4437. btn_esscdiag.attribute("class") = "btn5_letter4";
  4438. btn_esscdiag.attribute("color") = "#ff0066";
  4439. return;
  4440. }
  4441. } else {
  4442. // 희귀난치 data(mmohrooa)에 정보없음.
  4443. messageBox("## 희귀난치정보 ## : 등록번호 및 서명정보가 ","I004");
  4444. }
  4445. } else {
  4446. btn_esscdiag.visible = true;
  4447. btn_esscdiag.attribute("class") = "btn5_letter4";
  4448. btn_esscdiag.attribute("color") = "#ff0066";
  4449. return;
  4450. }
  4451. }
  4452. }
  4453. if (insukind > "22" || suppkind == "01" ) {
  4454. return;
  4455. }
  4456. if(chk){
  4457. var isEsscV193 = false;
  4458. var isEsscV191 = false;
  4459. var isEsscVisible = true;
  4460. var cEsscCnt = getNodesetCount("/root/main/chkessc");
  4461. if (cEsscCnt == 0 && rareesscyn != "Y" ) { // 특정내역이 없는 경우임
  4462. return;
  4463. } else {
  4464. var chkspclcd = model.getValue("/root/main/chkessc/chkessc[vcode='V191' or vcode='V192']/vcode");
  4465. var spclcd = model.getValue("/root/main/chkessc/chkessc[vcode='V193']/vcode");
  4466. if (chkspclcd.length > 0) {
  4467. isEsscV191 = true;
  4468. //이미 체크된건이 V193인경우 V193으로 처리 한다.
  4469. var chk = model.getValue("/root/hidden/item1/vcode");
  4470. if(chk == "V193"){
  4471. model.setValue("/root/hidden/item1/vcode","V193");
  4472. }else{
  4473. model.setValue("/root/hidden/item1/vcode",chkspclcd);
  4474. }
  4475. }
  4476. if(spclcd == "V193" && suppkind != "32") { // 차상위는 중증등록버튼이 활성화되지 않게한다. 20090227 박창원
  4477. model.setValue("/root/hidden/item1/vcode",spclcd);
  4478. var suppkindcd = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  4479. isEsscV193 = true;
  4480. // V193인경우 이미 적용하면 끝이기때문에 일부로 보여지지 않도록 했었지만
  4481. // 사용자 요구사항으로 그냥 버튼 살아 있게 한다. 2007.12.07 박도형
  4482. //if (suppkindcd == "06") {
  4483. // isEsscVisible = false;
  4484. //}
  4485. }
  4486. }
  4487. // 데이타 변경 후 중증 질환 체크 변경 유무 확인을 위한 flag 값 추가 : 2007.10.08 김건기 => fUpdtCheckEssc()에서 사용
  4488. model.setValue("/root/hidden/updtchkessc/esscV193",isEsscV193);
  4489. model.setValue("/root/hidden/updtchkessc/esscV191",isEsscV191);
  4490. if (isEsscV191) {
  4491. if (isEsscVisible) {
  4492. btn_esscdiag.visible = true;
  4493. } else {
  4494. btn_esscdiag.visible = false;
  4495. }
  4496. btn_esscdiag.attribute("class") = "btn5_letter4";
  4497. btn_esscdiag.attribute("color") = "#ff0066";
  4498. } else {
  4499. btn_esscdiag.attribute("class") = "btn2_letter4";
  4500. btn_esscdiag.visible = false;
  4501. if (isEsscV193) {
  4502. if (isEsscVisible) {
  4503. btn_esscdiag.visible = true;
  4504. } else {
  4505. btn_esscdiag.visible = false;
  4506. }
  4507. btn_esscdiag.attribute("class") = "btn5_letter4";
  4508. btn_esscdiag.attribute("color") = "#ff0066";
  4509. } else {
  4510. btn_esscdiag.attribute("class") = "btn2_letter4";
  4511. btn_esscdiag.visible = false;
  4512. }
  4513. }
  4514. }
  4515. }
  4516. //2. 분만여부 체크
  4517. function fCheckBorn(){
  4518. var cBorn = instance1.selectSingleNode("/root/main/item1/iteminfo");
  4519. if (cBorn == null) { // 출산정보가 없는경우임.
  4520. btn_babymother.attribute("class") = "btn5_letter4";
  4521. btn_babymother.visible = false;
  4522. return;
  4523. }else{
  4524. var cBornbaby = model.getValue("/root/main/item1/iteminfo/bornbaby");
  4525. if(cBornbaby == "Y"){
  4526. btn_babymother.visible = true;
  4527. btn_babymother.attribute("class") = "btn5_letter4";
  4528. btn_babymother.attribute("color") = "#ff0066";
  4529. }else{
  4530. btn_babymother.attribute("class") = "btn5_letter4";
  4531. btn_babymother.visible = false;
  4532. }
  4533. }
  4534. }
  4535. //3. 수술여부체크
  4536. function fCheckOper(){
  4537. var cOper = instance1.selectSingleNode("/root/main/item1/iteminfo");
  4538. if (cOper == null) { // 출산정보가 없는경우임.
  4539. btn_operdiag.attribute("class") = "btn5_letter4";
  4540. btn_operdiag.visible = false;
  4541. return;
  4542. }else{
  4543. var cOperDiag = model.getValue("/root/main/item1/iteminfo/opflag");
  4544. if(cOperDiag == "Y"){
  4545. btn_operdiag.visible = true;
  4546. btn_operdiag.attribute("class") = "btn5_letter4";
  4547. btn_operdiag.attribute("color") = "#ff0066";
  4548. // 수술심사상태에 따른 캡션변경
  4549. //미심
  4550. var cnt1 = model.getValue("/root/main/item10/operstat/cnt1");
  4551. //보류
  4552. var cnt2 = model.getValue("/root/main/item10/operstat/cnt2");
  4553. //완료
  4554. var cnt3 = model.getValue("/root/main/item10/operstat/cnt3");
  4555. // 수술이 추가되었을때 - 수술심사테이블에 데이터가 들어가지 않은 경우는 미심이 포함되어 있어 미심이다. - 20071014 박창원
  4556. var nonpijhoper = model.getValue("/root/main/item10/operstat/nonpijhoper");
  4557. if (cnt1 > "0" || nonpijhoper == "Y") {
  4558. btn_operdiag.attribute("text")= "수술(미)";
  4559. return;
  4560. }
  4561. if (cnt1 < "1" && cnt2 > "0") {
  4562. btn_operdiag.attribute("text")= "수술(보)";
  4563. }
  4564. if (cnt1 < "1" && cnt2 < "1" && cnt3 > "0") {
  4565. btn_operdiag.attribute("text")= "수술(완)";
  4566. }
  4567. if (cnt1 < "1" && cnt2 < "1" && cnt3 < "1") {
  4568. btn_operdiag.attribute("text")= "수술(미)";
  4569. }
  4570. }else{
  4571. btn_operdiag.attribute("class") = "btn5_letter4";
  4572. btn_operdiag.visible = false;
  4573. }
  4574. }
  4575. }
  4576. //4. 퇴원메모 체크
  4577. function fCheckDschMemo(){
  4578. var cDschMemo = instance1.selectSingleNode("/root/main/item1/iteminfo");
  4579. if (cDschMemo == null) {
  4580. btn_dschmemo.attribute("class") = "btn5_letter4";
  4581. btn_dschmemo.visible = false;
  4582. return;
  4583. }else{
  4584. var cDschMemo = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  4585. if(cDschMemo == "Y"){
  4586. btn_dschmemo.visible = true;
  4587. btn_dschmemo.attribute("class") = "btn5_letter4";
  4588. btn_dschmemo.attribute("color") = "#ff0066";
  4589. }else{
  4590. btn_dschmemo.attribute("class") = "btn5_letter4";
  4591. btn_dschmemo.visible = false;
  4592. }
  4593. }
  4594. }
  4595. // 5.공여수혜자 여부 체크
  4596. function fCheckDnorPat(){
  4597. var cDnorPat = instance1.selectSingleNode("/root/main/item8/patdnorinfo");
  4598. if (cDnorPat == null) {
  4599. btn_patdnor.attribute("class") = "btn5_letter3";
  4600. btn_patdnor.visible = false;
  4601. return;
  4602. }else{
  4603. var cDnorPID = model.getValue("/root/main/item8/patdnorflag");
  4604. var cPatDnorFlag = model.getValue("/root/main/item8/patdnorinfo/patdnorflag");
  4605. //if(cDschMemo == "D"){
  4606. if(cPatDnorFlag == "D"){
  4607. btn_patdnor.visible = true;
  4608. btn_patdnor.attribute("text")= "수혜자"
  4609. btn_patdnor.attribute("class") = "btn5_letter3";
  4610. btn_patdnor.attribute("color") = "#ff0066";
  4611. //}else if (cDschMemo == "P"){
  4612. }else if (cPatDnorFlag == "P"){
  4613. btn_patdnor.visible = true;
  4614. btn_patdnor.attribute("text")= "공여자"
  4615. btn_patdnor.attribute("class") = "btn5_letter3";
  4616. btn_patdnor.attribute("color") = "#ff0066";
  4617. }else{
  4618. btn_dschmemo.attribute("class") = "btn5_letter4";
  4619. btn_dschmemo.visible = false;
  4620. }
  4621. }
  4622. }
  4623. // 20091019 JHP 진료상병 심사상병 체크로직 추가 (** 10/9 보험팀장 정례회의 결정사항임)
  4624. // 재원심사시 혹은 퇴원심사시 진료 주상병과 심사 주상병이 상이 한 경우
  4625. // [진료 주상병과 심사 주상병이 다릅니다.확인하시고 진료에 수정요청 하십시요
  4626. // ( 퇴원시 외래 FU검사의 요율에 오류가 있을 수 있습니다)] 라는 알럿을 주도록 함.
  4627. // 1. 적용대상 : 보험유형 11, 21, 22
  4628. // 단 보조유형 00정상, 01전액본인부담, 입원에만 존재하는 보조유형 제외
  4629. // 2. 조회시 ICD10 색인 분류 상 상위 구분 (영문 1자리와 숫자 2자리)으로 비교 하도록 함
  4630. // -> 진료 D619 상병과 심사 D618은 알럿 팝업 안뜨도록 함.
  4631. //for문 속도개선 plet2
  4632. function fCheckEmrDiagPamDiag(){
  4633. var insukind = model.getValue("/root/main/item14/emrdiagpamdiag/insukind");
  4634. var suppkind = model.getValue("/root/main/item14/emrdiagpamdiag/suppkind");
  4635. var notsuppkind = model.getValue("/root/main/item14/emrdiagpamdiag/notsuppkind");
  4636. var emrmaindiag = model.getValue("/root/main/item14/emrdiagpamdiag/emrmaindiag");
  4637. var pammaindiag = model.getValue("/root/main/item14/emrdiagpamdiag/pammaindiag");
  4638. var notsuppkindchk = model.getXPathValue("contains(/root/main/item14/emrdiagpamdiag/notsuppkind,'"+suppkind+"')");
  4639. var fstemrdiag2 = emrmaindiag.substring(0, 3);
  4640. var fstpamdiag2 = pammaindiag.substring(0, 3);
  4641. var fstemrdiag3 = emrmaindiag.substring(0, 4);
  4642. var fstpamdiag3 = pammaindiag.substring(0, 4);
  4643. // 입원제외 보조유형 배열과 보조유형 체크
  4644. var suppchk = "N";
  4645. if(notsuppkindchk == true){
  4646. suppchk = "Y";
  4647. }
  4648. // 1. 보험유형 11, 21, 22 이면 알럿
  4649. if(insukind == "11" || insukind == "21" || insukind == "22"){
  4650. // 00, 01, suppchk(입원제외보조유형)이 아니면 알럿
  4651. if(suppkind == "00" || suppkind =="01" || suppchk == "Y"){
  4652. }else{
  4653. // 둘다 null 이 아니면 알럿(원래는 NULL인데 글자수로 잘라서 NUL임)
  4654. if(fstemrdiag2 == 'NUL' || fstpamdiag2 == 'NUL'){
  4655. }else{
  4656. // 진료상병 심사상병 다르면 알럿
  4657. if(fstemrdiag2 != fstpamdiag2){
  4658. messageBox("[진료 주상병(" + fstemrdiag2 +"-)과 심사 주상병(" + fstpamdiag2 + "-)이 다릅니다. 확인하시고 진료에 수정요청 하십시요.\n( 퇴원시 외래 FU검사의 요율에 오류가 있을 수 있습니다)]\n","I007");
  4659. }
  4660. }
  4661. }
  4662. }
  4663. }
  4664. function fItemRareMsg(){
  4665. var srchrslt = "";
  4666. var itemmsg = model.getValue("/root/main/item1/iteminfo/itemmsg");
  4667. var raremsg = model.getValue("/root/main/item1/iteminfo/raremsg");
  4668. var serdiagfromdd = model.getValue("/root/main/item1/iteminfo/serdiagfromdd"); //중증시작일자
  4669. var serdiagtodd = model.getValue("/root/main/item1/iteminfo/serdiagtodd"); //중증종료일자
  4670. var rareobstfromdd = model.getValue("/root/main/item1/iteminfo/rareobstfromdd"); //희귀시작일자
  4671. var rareobsttodd = model.getValue("/root/main/item1/iteminfo/rareobsttodd"); //희귀종료일자
  4672. var dschnotidt = model.getValue("/root/main/item1/iteminfo/dschnotidt"); //퇴원일자
  4673. dschnotidt = (dschnotidt.length > 0 ? dschnotidt.substring(0 , 8) : "");
  4674. var suppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  4675. var rooamsgcnt = getNodesetCount("/root/main/rarecancermsglist/rarecancermsg[cd!='00']/nm");
  4676. var sdoamsgcnt = getNodesetCount("/root/main/rarecancermsglist/rarecancermsg[cd='00']/nm");
  4677. var rooamsg = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd!='00']/nm");
  4678. var sdoamsg = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd='00']/nm");
  4679. var rooamsgtooth = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd!='00' and cd!='01']/nm");
  4680. var rooamsgcd = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd!='00']/cd");
  4681. var sdoamsgcd = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd='00']/cd");
  4682. var rooamsgtoothcd = model.getXPathValue("/root/main/rarecancermsglist/rarecancermsg[cd!='00' and cd!='01']/cd");
  4683. cmb_itemraremsg.visible = false;
  4684. //두번호 모두 존재시.
  4685. if ((rooamsgcnt > 0) && (sdoamsgcnt > 0)) {
  4686. opt_patientinfo.attribute("background-color") = "transparent";
  4687. //희귀종료일자가 퇴원일자,입원일자보다 빠를시 색상변경
  4688. //중증종료일자가 퇴원일자,입원일자보다 빠를시 색상변경
  4689. if (
  4690. ((dschnotidt != "" && (dschnotidt > serdiagtodd )) || (dschnotidt == "" && (VAL_today > serdiagtodd )) )||
  4691. ((dschnotidt != "" && (dschnotidt > rareobsttodd )) || (dschnotidt == "" && (VAL_today> rareobsttodd )))
  4692. ) {
  4693. cmb_itemraremsg.attribute("background-color") = "#ff9900";
  4694. } else {
  4695. cmb_itemraremsg.attribute("background-color") = "transparent";
  4696. }
  4697. cmb_itemraremsg.visible = true;
  4698. opt_patientinfo.visible = false;
  4699. roundrect1.visible = false;
  4700. // 등록암 보조유형일경우(06.등록암, 11.가정간호등록암, 32.차상위1종, 40.차상위2종등록암
  4701. // if (suppkind == "06" || suppkind == "11" || suppkind == "32" || suppkind == "40") {
  4702. // model.setValue(cmb_itemraremsg.attribute("ref"), sdoamsg);
  4703. // } else if (suppkind == "87" || suppkind == "88" || suppkind == "89") {
  4704. // model.setValue(cmb_itemraremsg.attribute("ref"), rooamsgtoothcd);
  4705. // } else {
  4706. // model.setValue(cmb_itemraremsg.attribute("ref"), rooamsgcd);
  4707. // }
  4708. cmb_itemraremsg.select(0);
  4709. } else if (rooamsgcnt > 0) {
  4710. //희귀종료일자가 퇴원일자,입원일자보다 빠를시 색상변경
  4711. if ((dschnotidt != "" && (dschnotidt > rareobsttodd )) || (dschnotidt == "" && (VAL_today > rareobsttodd ))) {
  4712. if (rooamsgcnt == 1) {
  4713. opt_patientinfo.attribute("background-color") = "#ff9900";
  4714. } else {
  4715. cmb_itemraremsg.attribute("background-color") = "#ff9900";
  4716. }
  4717. } else {
  4718. opt_patientinfo.attribute("background-color") = "transparent";
  4719. cmb_itemraremsg.attribute("background-color") = "transparent";
  4720. }
  4721. if (suppkind == "87" || suppkind == "88" || suppkind == "89") {
  4722. if (rooamsgcnt == 1) {
  4723. srchrslt += rooamsgtooth; // 희귀등록번호
  4724. model.setValue(opt_patientinfo.attribute("ref"), rooamsgtooth);
  4725. opt_patientinfo.visible = true;
  4726. roundrect1.visible = true;
  4727. } else {
  4728. cmb_itemraremsg.visible = true;
  4729. opt_patientinfo.visible = false;
  4730. roundrect1.visible = false;
  4731. model.setValue(cmb_itemraremsg.attribute("ref"), rooamsgtoothcd);
  4732. }
  4733. } else {
  4734. if (rooamsgcnt == 1) {
  4735. srchrslt += rooamsg; // 희귀등록번호
  4736. model.setValue(opt_patientinfo.attribute("ref"), rooamsg);
  4737. opt_patientinfo.visible = true;
  4738. roundrect1.visible = true;
  4739. } else {
  4740. cmb_itemraremsg.visible = true;
  4741. opt_patientinfo.visible = false;
  4742. roundrect1.visible = false;
  4743. //model.setValue(cmb_itemraremsg.attribute("ref"), rooamsgcd);
  4744. cmb_itemraremsg.select(0);
  4745. }
  4746. }
  4747. } else if (sdoamsgcnt > 0) {
  4748. //중증종료일자가 퇴원일자,입원일자보다 빠를시 색상변경
  4749. if ((dschnotidt != "" && (dschnotidt > serdiagtodd )) || (dschnotidt == "" && (VAL_today > serdiagtodd))) {
  4750. opt_patientinfo.attribute("background-color") = "#ff9900";
  4751. } else {
  4752. opt_patientinfo.attribute("background-color") = "transparent";
  4753. }
  4754. cmb_itemraremsg.attribute("background-color") = "transparent";
  4755. if (sdoamsgcnt == 1) {
  4756. srchrslt += sdoamsg; // 중증등록정보
  4757. model.setValue(opt_patientinfo.attribute("ref"), sdoamsg);
  4758. opt_patientinfo.visible = true;
  4759. roundrect1.visible = true;
  4760. } else {
  4761. cmb_itemraremsg.visible = true;
  4762. opt_patientinfo.visible = false;
  4763. roundrect1.visible = false;
  4764. //model.setValue(cmb_itemraremsg.attribute("ref"), sdoamsgcd);
  4765. cmb_itemraremsg.select(0);
  4766. }
  4767. } else {
  4768. opt_patientinfo.attribute("background-color") = "transparent";
  4769. cmb_itemraremsg.attribute("background-color") = "transparent";
  4770. opt_patientinfo.visible = true;
  4771. roundrect1.visible = true;
  4772. cmb_itemraremsg.visible = false;
  4773. }
  4774. opt_patientinfo.refresh();
  4775. cmb_itemraremsg.refresh();
  4776. }
  4777. //Link 연결 팝업
  4778. function fLinkPopMenu(trgtWindow, cond, send){
  4779. var trgtManWindow = getChildWindow(trgtWindow);
  4780. if (trgtManWindow == null) {
  4781. open(trgtWindow ,"", "10", "10",trgtWindow, cond, send);
  4782. } else {
  4783. activateChild(trgtWindow);
  4784. model.refresh();
  4785. }
  4786. }
  4787. // 통합심사마감
  4788. function fDschallEnd() {
  4789. fDschjudgEndType("A");
  4790. }
  4791. // 퇴원마감
  4792. function fDschjudgEnd() {
  4793. fDschjudgEndType("");
  4794. }
  4795. // 예고심사 : 2014.06.09 LEJ
  4796. function fDschdclrtEnd() {
  4797. fDschjudgEndType("G");
  4798. }
  4799. function fDschjudgEndType(dschjudgendtype) {
  4800. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  4801. if(chk){
  4802. // 퇴원마감시 간호확정이 취소되었는지 실시한 확인 후 진행한다.
  4803. // 타인이 간호 확정을 취소할때 마감되는 상황이 발생되지 않기 위함
  4804. // 간호 확정이 취소된 경우에는 대상자 조회 호면을 refresh 하고
  4805. // 메인화면의 심사상태를 'A' 미심상태로 하고 간호 퇴원통보 여부도 'N'으로 세팅한다.- 20080927 박창원
  4806. model.makeValue("/root/send/checkyn","Y");
  4807. if (!submit("TRPIJ00315", false)) {
  4808. messageBox("실시간 환자상태 체크에 실패 했습니다.기본데이터 이상이나 시스템 오류입니다.관리자 문의 후", "C003");
  4809. return;
  4810. }
  4811. model.makeValue("/root/send/checkyn","N");
  4812. // 퇴원마감시 퇴원확정일시 이후 처방이 있으면 alert - 20081112 박창원
  4813. var maxexectm = model.getValue("/root/main/item11/endcnclstat/maxexectm").substr(0,8);
  4814. var dschnotidt = model.getValue("/root/main/item1/iteminfo/dschnotidt").substr(0,8);
  4815. var dschnotiyn = model.getValue("/root/main/item11/endcnclstat/dschnotiyn");
  4816. var ipscendyn = model.getValue("/root/main/item11/endcnclstat/ipscendyn");
  4817. var dumpexistyn = model.getValue("/root/main/item11/endcnclstat/dumpexistyn");
  4818. var dupexecdd = model.getValue("/root/main/item11/endcnclstat/dupexecdd");
  4819. var dumpclamkeyexistyn = model.getValue("/root/main/item11/endcnclstat/dumpclamkeyexistyn");
  4820. var paygrntyn = model.getValue("/root/main/item11/endcnclstat/paygrntyn");
  4821. var dschdclrtyn = model.getValue("/root/main/item11/endcnclstat/dschdclrtyn");
  4822. var dschjudgprcsstatyn = model.getValue("/root/main/item11/endcnclstat/dschjudgprcsstatyn");
  4823. if (dschnotiyn != 'N' && maxexectm > dschnotidt) {
  4824. var msg = messageBox("퇴원확정이후" + maxexectm + "일자 실시처방이 있습니다. 계속 ", "S001");
  4825. if (msg != "6") {
  4826. return;
  4827. }
  4828. }
  4829. if (dschjudgendtype != 'G' && dschnotiyn == 'N') {
  4830. messageBox("간호 퇴원확정이 취소된 상태 입니다. 마감 ", "E001");
  4831. // 무조건 대상자 조회 화면을 refresh
  4832. var trgtManWindow = getChildWindow("SMPIJ00200");
  4833. trgtManWindow.javascript.fGetInBfJudgTrgtManList();
  4834. trgtManWindow.javascript.fCountPat();
  4835. trgtManWindow.model.refresh();
  4836. // 메인화면의 심사상태를 미심으로 퇴원통보여부를 'N'으로
  4837. model.setValue("/root/main/item1/iteminfo/dschnotiyn", "N");
  4838. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat", "A");
  4839. model.refresh();
  4840. return;
  4841. } else if (dschjudgendtype == 'G' && dschdclrtyn == 'N') {
  4842. messageBox("의사 퇴원예고가 취소된 상태 입니다. 마감 ", "E001");
  4843. // 무조건 대상자 조회 화면을 refresh
  4844. var trgtManWindow = getChildWindow("SMPIJ00200");
  4845. trgtManWindow.javascript.fGetInBfJudgTrgtManList();
  4846. trgtManWindow.javascript.fCountPat();
  4847. trgtManWindow.model.refresh();
  4848. // 메인화면의 심사상태를 미심으로 퇴원통보여부를 'N'으로
  4849. model.setValue("/root/main/item1/iteminfo/dschnotiyn", "N");
  4850. model.setValue("/root/main/item1/iteminfo/dschdclrtyn", "N");
  4851. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat", "A");
  4852. model.refresh();
  4853. return;
  4854. }
  4855. // 20091007 JHP 병실료계산(PAM.FN_PI_GETADMAMTCALCYN) 및 처방계산(PAM.FN_PI_GETCALCMISSYN) 맞는지 확인
  4856. // 20091113 JHP 부유형은 무조건 Y로 넘어오지만 부유형통에 계산내역이 없을경우에는 값자체가 없기때문에 메세지가뜬다..하여 부유형일 경우는 메세지 제외시킨다.
  4857. var admamtcalcyn = model.getValue("/root/main/item11/endcnclstat/admamtcalcyn");
  4858. //var calcmissyn = model.getValue("/root/main/item11/endcnclstat/calcmissyn"); -- 일단 처방은 추후 반영 - 20091013 박창원
  4859. var chkmskind = model.getValue("/root/main/item1/iteminfo/mskind");
  4860. var brateflag = model.getValue("/root/main/item1/iteminfo/brateflag");
  4861. // 입원요율일 경우만 병실료 체크한다.
  4862. if (brateflag == "I") {
  4863. if (admamtcalcyn != "Y") {
  4864. if(chkmskind != "S"){
  4865. messageBox("계산되지 않은 병실료가 존재합니다. \n확인후 재계산(전수계산)","I008");
  4866. return;
  4867. }
  4868. }
  4869. }
  4870. // 2011.04.28 syjung 소급계산완료 여부. N이면 소급계산할 데이터가 남아 있으므로 퇴원마감 할 수 없음.
  4871. if (ipscendyn == "N") {
  4872. messageBox("완료되지 않은 소급계산 내역이 존재합니다. 재계산","I008");
  4873. return;
  4874. }
  4875. // 2011.06.14 syjung 외래에서 덤프되지 않은 처방 존재 여부. Y면 덤프되지 않은 처방이 있으므로 퇴원마감 할 수 없음.
  4876. if (dumpexistyn == "Y") {
  4877. messageBox("입원 당일 외래에서 덤프되지 않은 처방이 존재합니다. 재원심사 화면에서 [▶Dump] 내역을 ","I007");
  4878. return;
  4879. }
  4880. if (dumpclamkeyexistyn == "Y") {
  4881. if(messageBox("외래 자료 수집이 된 재원 내 실시처방이 있습니다. 외래 사후 자료를 생성 삭제한 후 Dump처리 하십시오.", "Q003") == 6) {
  4882. modal("SPPIJ03500");
  4883. if (model.getValue("/root/main/item1/iteminfo/dumprmk") == "" ) {
  4884. messageBox("사유를", "C001");
  4885. return;
  4886. }
  4887. } else {
  4888. return;
  4889. }
  4890. }
  4891. if (dupexecdd != "") {
  4892. dupexecdd = dupexecdd.toDate().getDateFormat("YYYY/MM/DD")
  4893. messageBox(dupexecdd + "중복계산 내역이 존재합니다. " + dupexecdd + "일 재계산","I008");
  4894. return;
  4895. }
  4896. //기재점검 중증, 산정특례 여부 체크
  4897. if (fGetDiagSpclcdCheck() == false) {
  4898. return false;
  4899. }
  4900. // 주부유형이 함께 있는 환자에 대해서는 퇴원마감시 알럿을 띄워준다.
  4901. var msyn = model.getValue("/root/main/item1/iteminfo/msyn");
  4902. if (msyn == "Y") {
  4903. messageBox("다른 보험 유형정보가 존재하오니 해당건 퇴원마감여부도 확인하여 주세요. 해당건 미마감 시 퇴원수납 할 수","I004");
  4904. }
  4905. var cOperDiag = model.getValue("/root/main/item1/iteminfo/opflag");
  4906. // 수술심사 미완료시 응급,chemo,dsc는 알럿만 정규퇴원은 blcok - 20090114 박창원
  4907. var ordtype = model.getValue("/root/main/item1/iteminfo/ordtype");
  4908. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  4909. // 연도별 분리 안 된 이력 중 본인부담 상한액 초과 환자 메세지 발생 ( 2016.03.11 LEJ )
  4910. var insukind = model.getValue("/root/main/item1/iteminfo/insukind");
  4911. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  4912. var ownlimmitamt = model.getValue("/root/main/item1/iteminfo/ownlimmitamt"); // 본인부담 상한 구분에 따른 상한기준액
  4913. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  4914. var todd = model.getValue("/root/main/item1/iteminfo/todd");
  4915. var curyear = VAL_today.substr(0,4);
  4916. var fromyear = fromdd.substr(0,4);
  4917. var toyear = todd.substr(0,4);
  4918. if ( todd == "99991231" ) {
  4919. if ( dschnotidt == "99991231" || dschnotidt == "" ) {
  4920. toyear = curyear ;
  4921. }
  4922. else {
  4923. toyear = dschnotidt.substr(0,4) ;
  4924. }
  4925. }
  4926. if ( insukind == "11" && fromyear != toyear && cfe != 'F' ) {
  4927. if(parseInt(model.getValue("/root/main/item2/itemcalc/ownbpayamt")) > ownlimmitamt) {
  4928. var msg = messageBox("연도별 분리 되지 않은 본인부담상한제 환자입니다. \n계속","S001");
  4929. if(msg != 6) {
  4930. return;
  4931. }
  4932. }
  4933. }
  4934. if(dschnotiyn == "Y" || (dschjudgendtype == 'G' && dschdclrtyn == 'Y')){
  4935. // 수술심사가 완료되지 않았습니다. - 20080821 박창원
  4936. if ( ordtype != "I" && ((btn_operdiag.attribute("text")== "수술(미)") ||(btn_operdiag.attribute("text")== "수술(보)")) && (cOperDiag == "Y" || cOperDiag == "YY" || cOperDiag == "YN") ) {
  4937. var msg = messageBox("수술심사가 완료되지 않았습니다. 계속","S001");
  4938. if(msg != 6) {
  4939. return;
  4940. }
  4941. }
  4942. if ( ordtype == "I" && ((btn_operdiag.attribute("text")== "수술(미)") ||(btn_operdiag.attribute("text")== "수술(보)")) && (cOperDiag == "Y" || cOperDiag == "YY" || cOperDiag == "YN") ) {
  4943. messageBox("수술심사가 완료되지 않았습니다. 마감","E001");
  4944. return;
  4945. }
  4946. // 소급내역이 존재합니다. 처리후 마감해주세요.
  4947. // 10월3일 이전 소급건은 조건에서 제외한다. - 20081004 박창원
  4948. if (model.getValue("/root/main/item11/recal[1]/recalcdd") != "") {
  4949. messageBox("소급내역이 존재합니다. 마감","E001");
  4950. return;
  4951. }
  4952. //약 반환 확인유무 및 창 호출.
  4953. if (fCheckReturnPrcpExist() == false) {
  4954. return;
  4955. }
  4956. if (insukind == "31"){
  4957. if (paygrntyn != "Y") {
  4958. messageBox("자동차보험 지급보증번호 누락입니다.","I007");
  4959. return;
  4960. }
  4961. }
  4962. if ((dschjudgendtype != 'G' && fChkClose() == true) || dschjudgendtype == 'G') {
  4963. // 예고심사 환자가 미시행처방이 있는 경우 마감 제어는 하지 않는다!
  4964. if (dschjudgendtype == 'G' && fChkClose() == false) {
  4965. var msg = messageBox("예고심사 환자 미시행 처방 내역이 있습니다. 마감","S001");
  4966. if(msg != 6) {
  4967. return;
  4968. }
  4969. }
  4970. if (fSaveMain("C") == true) {
  4971. //maxexectm 없다는건 iscl이 존재 하지 않는 것임.
  4972. var dschantichk = model.getValue("/root/hidden/result/getdschcalccheck/dschantichk");
  4973. if (dschantichk == "Y") {
  4974. var msg = messageBox("수술 예방적 항생제 평가 대상자입니다.\n항생제 퇴원약 사용 여부를 재확인하시기 바랍니다. \n계속","S001");
  4975. if(msg != 6) {
  4976. return;
  4977. }
  4978. }
  4979. if (maxexectm == "") {
  4980. if ( messageBox("유형에 계산된 처방 내역이 하나도 없습니다. 마감","Q004") != 6 ) {
  4981. return false;
  4982. }
  4983. }
  4984. // 입원 계산 자료 검증(2012.11.30 LeeEunJung)
  4985. var check0 = model.getValue("/root/hidden/result/getdschcalccheck/check0");
  4986. var check1 = model.getValue("/root/hidden/result/getdschcalccheck/check1");
  4987. var check2 = model.getValue("/root/hidden/result/getdschcalccheck/check2");
  4988. var check3 = model.getValue("/root/hidden/result/getdschcalccheck/check3");
  4989. var check4 = model.getValue("/root/hidden/result/getdschcalccheck/check4");
  4990. var check5 = model.getValue("/root/hidden/result/getdschcalccheck/check5");
  4991. if (check0 =="Y"||check1 =="Y"||check2 =="Y"||check3 =="Y"||check4 =="Y"||check5 =="Y") {
  4992. messageBox("계산자료 검증 시 오류가 체크되었습니다. 전체 재계산 후 문제 해결이 안 되면 전산실로 문의","I008");
  4993. return false;
  4994. }
  4995. // 건강보험 정상 16일 이상 재원환자에 대해 장기재원 불가피 주상병 존재하는 경우 알림
  4996. var longtermchk = model.getValue("/root/hidden/result/getdschcalccheck/longtermchk");
  4997. if (longtermchk == "Y") {
  4998. var msg = messageBox("장기재원 불가피 주상병이 있는 16일 이상 입원료 발생 환자 입니다.\n보조 유형을 확인하시기 바랍니다. \n계속","S001");
  4999. if(msg != 6) {
  5000. return;
  5001. }
  5002. }
  5003. //응급실 관리료 여부 체크
  5004. var nog3reasnyn = model.getValue("/root/hidden/result/getdschcalccheck/nog3reasnyn");
  5005. if (nog3reasnyn == "Y") {
  5006. messageBox("응급 의료관리료 미발생 환자입니다.","I007");
  5007. return false;
  5008. }
  5009. if (fGetDrgOpenPopup("O") == false) {
  5010. return false;
  5011. }
  5012. if (dschjudgendtype == "G" && dschjudgprcsstatyn > 0){
  5013. messageBox("입원이력 내 미심상태가 있습니다.","I007");
  5014. return false;
  5015. }
  5016. if (dschjudgendtype == "A") {
  5017. if (fJudgAllEnd()){
  5018. // 2. 화면 클리어 (공통)
  5019. fJudgEndClear();
  5020. messageBox("통합심사마감 처리가","I002");
  5021. } else {
  5022. messageBox("마감 처리가 되지","E007");
  5023. }
  5024. } else if (dschjudgendtype == "G") { // 예고심사 추가 (2014.06.19 LEJ)
  5025. if (fJudgDclrtEnd()){
  5026. // 2. 화면 클리어 (공통)
  5027. fJudgEndClear();
  5028. messageBox("예고심사마감 처리가","I002");
  5029. } else {
  5030. messageBox("마감 처리가 되지","E007");
  5031. }
  5032. } else {
  5033. if (fJudgEnd()){
  5034. // 2. 화면 클리어 (공통)
  5035. fJudgEndClear();
  5036. messageBox("퇴원마감 처리가","I002");
  5037. } else {
  5038. messageBox("마감 처리가 되지","E007");
  5039. }
  5040. }
  5041. }
  5042. } else {
  5043. messageBox("미시행 처방 내역이 있습니다. 마감","E001");
  5044. }
  5045. }
  5046. else {
  5047. messageBox("유형에 계산된 처방 내역이 하나도 없습니다. 마감","E001");
  5048. return;
  5049. }
  5050. }
  5051. }
  5052. function fJudgEndClear() {
  5053. // 2. 화면 클리어 (공통)
  5054. delPatientInfos();
  5055. fSetRdoReset();
  5056. btn_judgrmk.selected = true;
  5057. model.setValue("/root/send/totalsumflag", "Y");
  5058. model.setValue("/root/send/unitflag", "-");
  5059. //상세화면 저장버튼 처리를 위해 넣어 놓는다. - 2007-11.29 박도형
  5060. model.setValue("root/hidden/item1/chksave","N");
  5061. btn_esscdiag.attribute("class") = "btn2_letter4";
  5062. btn_babymother.attribute("class") = "btn2_letter4";
  5063. btn_operdiag.attribute("class") = "btn2_letter4";
  5064. btn_mt004.attribute("class") = "btn2_letter4";
  5065. btn_attData.attribute("class") = "btn2_letter4";
  5066. btn_operdiag.attribute("class") = "btn2_letter4";
  5067. btn_patdnor.attribute("class") = "btn_letter3";
  5068. btn_esscdiag.visible = true;
  5069. btn_babymother.visible = true;
  5070. btn_operdiag.visible = true;
  5071. btn_mt004.visible = true;
  5072. btn_attData.visible = true;
  5073. btn_operdiag.visible = true;
  5074. btn_patdnor.visible= true;
  5075. btn_save.disabled = false;
  5076. btn_recalc.disabled = false;
  5077. btn_sugicalc.disabled = false;
  5078. btn_dschclose.disabled = false;
  5079. btn_totjudgclose.disabled = false;
  5080. btn_dschclosecancel.disabled = false;
  5081. btn_midcomplete.disabled = false;
  5082. btn_midcancel.disabled = false;
  5083. btn_midregist.disabled = false;
  5084. btn_midregistyn.disabled = false;
  5085. group9.visible = false;
  5086. btn_dschclose.attribute("class") = "btn2_letter6";
  5087. btn_totjudgclose.attribute("class") = "btn2_letter6";
  5088. btn_dschclosecancel.attribute("class") = "btn2_letter6";
  5089. btn_midregist.attribute("class") = "btn2_letter6";
  5090. btn_midregistyn.attribute("class") = "btn2_letter6";
  5091. model.resetInstanceNode("/root/main/item1/iteminfo");
  5092. model.resetInstanceNode("/root/main/item2/itemcalc");
  5093. model.resetInstanceNode("/root/main/item2/incd");
  5094. model.resetInstanceNode("/root/main/item4/insu");
  5095. model.resetInstanceNode("/root/send");
  5096. model.removenode("/root/main/list1");
  5097. model.makeNode("/root/main/list1");
  5098. model.removenode("/root/main/list2");
  5099. model.makeNode("/root/main/list2");
  5100. model.removenode("/root/main/list3");
  5101. model.makeNode("/root/main/list3");
  5102. model.removenode("/root/main/list4");
  5103. model.makeNode("/root/main/list4");
  5104. model.refresh();
  5105. // 무조건 대상자 조회 화면을 refresh - 20080926 박창원
  5106. var trgtManWindow = getChildWindow("SMPIJ00200");
  5107. trgtManWindow.javascript.fGetInBfJudgTrgtManList();
  5108. trgtManWindow.javascript.fCountPat();
  5109. trgtManWindow.model.refresh();
  5110. }
  5111. // 치식 팝업용 데이타 생성
  5112. function fSetToothPop(row, flag) {
  5113. model.removenode("/root/hidden/sppiz00600/cond/list");
  5114. model.makeNode("/root/hidden/sppiz00600/cond/list");
  5115. // 상병
  5116. var cntdiag = getNodesetCount("/root/main/list3/diaglist");
  5117. // 처방
  5118. var cntiscl = getNodesetCount("/root/main/list2/iscllist");
  5119. var cd = "";
  5120. var cdnm = "";
  5121. var orddd = "";
  5122. var toot = "";
  5123. var rowcnt = 1;
  5124. for (i=1; i<=cntdiag; i++) {
  5125. cd = model.getValue("/root/main/list3/diaglist["+ i + "]/diagcd");
  5126. cdnm = model.getValue("/root/main/list3/diaglist["+ i + "]/diagnm");
  5127. orddd = model.getValue("/root/main/list3/diaglist["+ i + "]/ordfromdd");
  5128. toot = model.getValue("/root/main/list3/diaglist["+ i + "]/toot");
  5129. estmcls = model.getValue("/root/main/list2/iscllist["+ i + "]/estmcls"); //20100318 정승우 의정부 오류로 추가
  5130. if (cd != "") {
  5131. if ((toot != "-" && toot != "") || estmcls == "U") {
  5132. var milktoothstr = "ABCDE000";
  5133. var subTootStr = "";
  5134. for (var inx = 0; inx < 32; inx++) {
  5135. var tootnum = toot.substr(inx,1);
  5136. if (tootnum == "*") { // 선택된 영구치의 경우 1~8 사이 숫자로 표시한다.
  5137. if (inx < 8) {
  5138. subTootStr += (8 - inx);
  5139. }
  5140. else if (inx > 7 && inx < 16) {
  5141. subTootStr += (inx - 7);
  5142. }
  5143. else if (inx > 15 && inx < 24) {
  5144. subTootStr += (24 - inx);
  5145. } else {
  5146. subTootStr += (inx - 23);
  5147. }
  5148. } else if (tootnum == "#") { // 선택된 유치의 경우 A~E 사이 알파벳으로 표시한다.
  5149. if (inx < 8) {
  5150. subTootStr += milktoothstr.charAt(7 - inx);
  5151. }
  5152. else if (inx > 7 && inx < 16) {
  5153. subTootStr += milktoothstr.charAt(inx - 8);
  5154. }
  5155. else if (inx > 15 && inx < 24) {
  5156. subTootStr += milktoothstr.charAt(23 - inx);
  5157. } else {
  5158. subTootStr += milktoothstr.charAt(inx - 24);
  5159. }
  5160. } else { // if (tootnum == "0") 선택되지 않은 경우 공백으로 처리한다.
  5161. subTootStr += " ";
  5162. }
  5163. }
  5164. //치식 표기를 설정한다.
  5165. if (row == i && flag == "1" ) {
  5166. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
  5167. } else {
  5168. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "false");
  5169. }
  5170. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "상병");
  5171. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
  5172. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
  5173. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", subTootStr.substr(0, 8));
  5174. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", subTootStr.substr(8, 8));
  5175. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", subTootStr.substr(16, 8));
  5176. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", subTootStr.substr(24, 8));
  5177. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
  5178. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", toot);
  5179. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
  5180. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/pid", "");
  5181. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/indd", "");
  5182. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cretno", "");
  5183. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/instcd", "");
  5184. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/execdd", "");
  5185. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/calcseqno", "");
  5186. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/calcscorseqno", "");
  5187. rowcnt = rowcnt+1;
  5188. } else {
  5189. if (row == i && flag == "1" ) {
  5190. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
  5191. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "상병");
  5192. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
  5193. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
  5194. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", "");
  5195. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", "");
  5196. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", "");
  5197. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", "");
  5198. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
  5199. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", "");
  5200. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
  5201. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/pid", "");
  5202. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/indd", "");
  5203. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cretno", "");
  5204. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/instcd", "");
  5205. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/execdd", "");
  5206. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/calcseqno", "");
  5207. model.makevalue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/calcscorseqno", "");
  5208. rowcnt = rowcnt+1;
  5209. }
  5210. }
  5211. } // if cd != ""
  5212. } // for end
  5213. for (i=1; i<=cntiscl; i++) {
  5214. cd = model.getValue("/root/main/list2/iscllist["+ i + "]/snglcalcscorcd");
  5215. cdnm = model.getValue("/root/main/list2/iscllist["+ i + "]/hngnm");
  5216. orddd = model.getValue("/root/main/list2/iscllist["+ i + "]/ordfromdd");
  5217. toot = model.getValue("/root/main/list2/iscllist["+ i + "]/tootfact");
  5218. estmcls = model.getValue("/root/main/list2/iscllist["+ i + "]/estmcls");
  5219. if ((toot != "-" && toot != "") || estmcls == "U") {
  5220. var milktoothstr = "ABCDE000";
  5221. var subTootStr = "";
  5222. var tmpStr = "";
  5223. for (var inx = 0; inx < 32; inx++) {
  5224. var tootnum = toot.substr(inx,1);
  5225. if (tootnum == "*") { // 선택된 영구치의 경우 1~8 사이 숫자로 표시한다.
  5226. if (inx < 8) {
  5227. subTootStr += (8 - inx);
  5228. }
  5229. else if (inx > 7 && inx < 16) {
  5230. subTootStr += (inx - 7);
  5231. }
  5232. else if (inx > 15 && inx < 24) {
  5233. subTootStr += (24 - inx);
  5234. } else {
  5235. subTootStr += (inx - 23);
  5236. }
  5237. } else if (tootnum == "#") { // 선택된 유치의 경우 A~E 사이 알파벳으로 표시한다.
  5238. if (inx < 8) {
  5239. subTootStr += milktoothstr.charAt(7 - inx);
  5240. }
  5241. else if (inx > 7 && inx < 16) {
  5242. subTootStr += milktoothstr.charAt(inx - 8);
  5243. }
  5244. else if (inx > 15 && inx < 24) {
  5245. subTootStr += milktoothstr.charAt(23 - inx);
  5246. } else {
  5247. subTootStr += milktoothstr.charAt(inx - 24);
  5248. }
  5249. } else { // if (tootnum == "0") 선택되지 않은 경우 공백으로 처리한다.
  5250. subTootStr += " ";
  5251. }
  5252. }
  5253. //치식 표기를 설정한다.
  5254. if (row == i && flag == "2" ) {
  5255. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
  5256. } else {
  5257. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "false");
  5258. }
  5259. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "처방");
  5260. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
  5261. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
  5262. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", subTootStr.substr(0, 8));
  5263. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", subTootStr.substr(8, 8));
  5264. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", subTootStr.substr(16, 8));
  5265. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", subTootStr.substr(24, 8));
  5266. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
  5267. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", toot);
  5268. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
  5269. rowcnt = rowcnt+1;
  5270. } else {
  5271. if (row == i && flag == "2" ) {
  5272. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
  5273. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "처방");
  5274. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
  5275. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
  5276. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", "");
  5277. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", "");
  5278. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", "");
  5279. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", "");
  5280. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
  5281. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", "");
  5282. model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
  5283. rowcnt = rowcnt+1;
  5284. }
  5285. }
  5286. }
  5287. }
  5288. // 치식 팝어에 받은 데이타
  5289. function fGetToothPop() {
  5290. var tootSelectcnt = getNodesetCount("/root/hidden/sppiz00600/rslt/list");
  5291. var flag = "";
  5292. var row = "";
  5293. var toot = "";
  5294. tootSelectcnt = eval(tootSelectcnt) + 1;
  5295. for (var i=1; i<tootSelectcnt; i++) {
  5296. flag = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/flag");
  5297. row = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/row");
  5298. var rlsttoot = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/toot");
  5299. var rlsttoot1 = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/toot1");
  5300. if (rlsttoot == "") {
  5301. rlsttoot = "-";
  5302. }
  5303. if (rlsttoot1 == "") {
  5304. rlsttoot1 = "-";
  5305. }
  5306. if (flag == "1") {
  5307. toot = model.getValue("/root/main/list3/diaglist["+ row +"]/toot");
  5308. model.setValue("/root/main/list3/diaglist["+ row +"]/toot", rlsttoot);
  5309. model.setValue("/root/main/list3/diaglist["+ row +"]/toot1", rlsttoot1);
  5310. if (rlsttoot != toot) { // 치식번호가 변경된 경우
  5311. var diagstatus = grd_diaglist.rowstatus(row);
  5312. if (diagstatus == 0 || diagstatus == 2) { // 0 : new, 2 : update
  5313. grd_diaglist.rowstatus(row) = 2; // 2 : update
  5314. }
  5315. }
  5316. }
  5317. }
  5318. }
  5319. //1. 중증, 산정특례 변경 여부 체크
  5320. function fUpdtCheckEssc(flag){
  5321. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  5322. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  5323. var mskind = model.getValue("/root/main/item1/iteminfo/mskind");
  5324. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  5325. var suppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  5326. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  5327. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5328. var dschdd = model.getValue("/root/main/item1/iteminfo/dschdd");
  5329. var insuflag = "";
  5330. var isEsscdiag = btn_esscdiag.visible;
  5331. var isEsscdiagUpdt = false;
  5332. var isUpdtEsscV193 = model.getValue("/root/hidden/updtchkessc/esscV193");
  5333. var isUpdtEsscV191 = model.getValue("/root/hidden/updtchkessc/esscV191");
  5334. var rareesscyn = model.getValue("/root/hidden/result/rareessc/rareesscyn");
  5335. model.setValue("/root/hidden/item1/vcode","");
  5336. // 희귀난치 산정특례 추가 - 20100224 박창원
  5337. if(suppkind == "05" || suppkind == "06" || suppkind == "39" || suppkind == "40" || suppkind == "50" || suppkind == "31" || (insukind == "22" && suppkind == "08")){ // 20090325 차상위2종 추가 - 박창원 20100318 정승우 신생아 / 보호2종 6세미만 추가
  5338. return;
  5339. }
  5340. if(pid){
  5341. var isEsscV193 = false;
  5342. var isEsscV191 = false;
  5343. var isEsscVisible = true;
  5344. var cEsscCnt = getNodesetCount("/root/hidden/result/chkessc");
  5345. if (cEsscCnt == 0 && rareesscyn != "Y" ) { // 특정내역이 없는 경우임
  5346. return;
  5347. } else {
  5348. var chkspclcd = model.getValue("/root/hidden/result/chkessc[vcode='V191' or vcode='V192']/vcode");
  5349. var spclcd = model.getValue("/root/hidden/result/chkessc[vcode='V193']/vcode");
  5350. if (chkspclcd.length > 0) {
  5351. isEsscV191 = true;
  5352. //이미 체크된건이 V193인경우 V193으로 처리 한다.
  5353. var chk = model.getValue("/root/hidden/item1/vcode");
  5354. if(chk == "V193"){
  5355. model.setValue("/root/hidden/item1/vcode","V193");
  5356. }else{
  5357. model.setValue("/root/hidden/item1/vcode",chkspclcd);
  5358. }
  5359. }
  5360. if(spclcd == "V193" && suppkind != "32") { // 차상위는 중증등록버튼이 활성화되지 않게한다. 20090227 박창원
  5361. model.setValue("/root/hidden/item1/vcode",spclcd);
  5362. var suppkindcd = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  5363. isEsscV193 = true;
  5364. // V193인경우 이미 적용하면 끝이기때문에 일부로 보여지지 않도록 했었지만
  5365. // 사용자 요구사항으로 그냥 버튼 살아 있게 한다. 2007.12.07 박도형
  5366. //if (suppkindcd == "06") {
  5367. // isEsscVisible = false;
  5368. //}
  5369. }
  5370. }
  5371. btn_esscdiag.visible = false;
  5372. if (isEsscV191) {
  5373. if (isEsscVisible) {
  5374. if (isEsscdiag) {
  5375. if (isUpdtEsscV191 == "True") {
  5376. isEsscdiagUpdt = false;
  5377. } else {
  5378. isEsscdiagUpdt = true;
  5379. }
  5380. } else {
  5381. isEsscdiagUpdt = true;
  5382. }
  5383. btn_esscdiag.visible = true;
  5384. } else {
  5385. btn_esscdiag.visible = false;
  5386. isEsscdiagUpdt = false;
  5387. }
  5388. btn_esscdiag.attribute("class") = "btn5_letter4";
  5389. btn_esscdiag.attribute("color") = "#ff0066";
  5390. } else {
  5391. if (isEsscV193) {
  5392. if (isEsscVisible) {
  5393. if (isEsscdiag) {
  5394. if (isUpdtEsscV193 == "True") {
  5395. isEsscdiagUpdt = false;
  5396. } else {
  5397. isEsscdiagUpdt = true;
  5398. }
  5399. } else {
  5400. isEsscdiagUpdt = true;
  5401. }
  5402. btn_esscdiag.visible = true;
  5403. } else {
  5404. btn_esscdiag.visible = false;
  5405. isEsscdiagUpdt = false;
  5406. }
  5407. btn_esscdiag.attribute("class") = "btn5_letter4";
  5408. btn_esscdiag.attribute("color") = "#ff0066";
  5409. } else {
  5410. isEsscdiagUpdt = false;
  5411. btn_esscdiag.attribute("class") = "btn2_letter4";
  5412. btn_esscdiag.visible = false;
  5413. }
  5414. }
  5415. //if (isEsscdiagUpdt) {
  5416. var trgtManWindow = getChildWindow("SPPIJ01900");
  5417. var vcode = model.getValue("/root/hidden/item1/vcode");
  5418. model.setValue("/root/hidden/sppij01900/cond/pid",model.getValue("root/main/item1/iteminfo/pid"));
  5419. model.setValue("/root/hidden/sppij01900/cond/indd",model.getValue("root/main/item1/iteminfo/indd1"));
  5420. model.setValue("/root/hidden/sppij01900/cond/mskind",model.getValue("root/main/item1/iteminfo/mskind"));
  5421. model.setValue("/root/hidden/sppij01900/cond/brateflag",model.getValue("root/main/item1/iteminfo/brateflag"));
  5422. model.setValue("/root/hidden/sppij01900/cond/brthdd",model.getValue("root/main/item1/iteminfo/brthdd"));
  5423. model.setValue("/root/hidden/sppij01900/cond/vcode",vcode);
  5424. // 희귀난치 산정특례 로직 추가 - 20100224 박창원
  5425. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5426. var insukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  5427. var suppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  5428. if (insukind == "11" && suppkind != "31" && suppkind != "32" && suppkind != "01" && fromdd >= "20090701" && rareesscyn == "Y") {
  5429. // 20090930 JHP 희귀난치 등록여부 확인위해 추가함. -- 시작
  5430. var anohosprgstflag = model.getValue("/root/main/item13/rooa/anohosprgstflag");
  5431. var rareobstno = model.getValue("/root/main/item13/rooa/rareobstno");
  5432. var rareobstfromdd = model.getValue("/root/main/item13/rooa/rareobstfromdd");
  5433. var rareobsttodd = model.getValue("/root/main/item13/rooa/rareobsttodd");
  5434. var signyn = model.getValue("/root/main/item13/rooa/signyn");
  5435. //20091109 JHP 희귀난치 메세지는 상병에 R/O 상병일 경우는 메세지 제외함.
  5436. var ruleoutyn = model.getValue("/root/main/list3/diaglist[1]/ruleoutyn");
  5437. if(ruleoutyn == 'true'){
  5438. // 주상병 R/O일때에는 희귀난치 메세지 처리 안함.
  5439. }else{
  5440. if (fromdd >= "20091001") { // 10월1일 이후에는 등록번호가 반드시 있어야한다. - 추가코딩필요
  5441. // 타병원등록 여부 , Y:타병원,N:우리병원
  5442. if(anohosprgstflag == "Y"){
  5443. // 희귀난치 번호여부
  5444. if(rareobstno == null || rareobstno == '-'){
  5445. messageBox("## 희귀난치정보 ## : 타병원등록이나 희귀난치번호가 ","I004");
  5446. } else {
  5447. btn_esscdiag.visible = true;
  5448. btn_esscdiag.attribute("class") = "btn5_letter4";
  5449. btn_esscdiag.attribute("color") = "#ff0066";
  5450. }
  5451. } else if(anohosprgstflag == "N"){
  5452. // 희귀난치 번호여부
  5453. if(rareobstno == null || rareobstno == '-'){
  5454. if(signyn == "Y"){
  5455. btn_esscdiag.visible = true;
  5456. btn_esscdiag.attribute("class") = "btn5_letter4";
  5457. btn_esscdiag.attribute("color") = "#ff0066";
  5458. } else {
  5459. messageBox("## 희귀난치정보 ## : 재원병원등록이나 등록번호 및 서명정보가 ","I004");
  5460. }
  5461. } else{
  5462. btn_esscdiag.visible = true;
  5463. btn_esscdiag.attribute("class") = "btn5_letter4";
  5464. btn_esscdiag.attribute("color") = "#ff0066";
  5465. }
  5466. } else {
  5467. // 희귀난치 data(mmohrooa)에 정보없음.
  5468. messageBox("## 희귀난치정보 ## : 등록번호 및 서명정보가 ","I004");
  5469. }
  5470. } else {
  5471. btn_esscdiag.visible = true;
  5472. btn_esscdiag.attribute("class") = "btn5_letter4";
  5473. btn_esscdiag.attribute("color") = "#ff0066";
  5474. }
  5475. }
  5476. }
  5477. // 20100224 박창원 희귀난치 산정특례추가
  5478. var anohosprgstflag = model.getValue("/root/main/item13/rooa/anohosprgstflag");
  5479. var rareobstno = model.getValue("/root/main/item13/rooa/rareobstno");
  5480. var rareobstfromdd = model.getValue("/root/main/item13/rooa/rareobstfromdd");
  5481. var rareobsttodd = model.getValue("/root/main/item13/rooa/rareobsttodd");
  5482. var signyn = model.getValue("/root/main/item13/rooa/signyn");
  5483. var fromdd = model.getValue("/root/main/item1/iteminfo/indd1");
  5484. if (insukind == "11" && suppkind != "32" && rareesscyn == "Y" && suppkind != "01" && suppkind != "50" && suppkind != "46" && fromdd >= "20090701"
  5485. && ((anohosprgstflag == "N" && signyn == "Y") || (anohosprgstflag == "Y" && rareobstfromdd <= fromdd && rareobsttodd >= fromdd))) {
  5486. fesscdiag();
  5487. }else if(vcode == "V193" && suppkind != "32" && suppkind != "06" && suppkind != "40" && suppkind != "31" && suppkind != "69" && !(insukind == "22" && suppkind == "08") ){ // 차상위 1종일때는 등록암 메세지가 안나오게 20090227 박창원 20100318 정승우 신생아유형/급여2종 6세미만 일때 등록암 메세지 나오지 않도록
  5488. var msg = messageBox("등록암환자입니다. 중증요율 적용","S001");
  5489. if(msg !=6){
  5490. return;
  5491. }else{
  5492. Insuchange("06");
  5493. }
  5494. }else if(vcode == "V191" || vcode == "V192"){
  5495. if (flag == "S") {
  5496. var msg = messageBox("중증수술 환자입니다. 중증요율 적용","S001");
  5497. if(msg !=6){
  5498. return;
  5499. }else{
  5500. if (trgtManWindow == null) {
  5501. open("SPPIJ01900" ,"", "10", "10", "SPPIJ01900","/root/hidden/sppij01900/cond", "/root/send/cond");
  5502. } else {
  5503. activateChild("SPPIJ01900");
  5504. model.refresh();
  5505. }
  5506. }
  5507. }
  5508. } else {
  5509. if (flag == "S") {
  5510. //messageBox("저장이","I002");
  5511. }
  5512. //중증처방여부 체크
  5513. fChkEsscEDI();
  5514. }
  5515. }
  5516. }
  5517. // 변경된 퇴원확정여부, 심사상태 flag를 대상자조회화면에 보여준다. (2008.01.28 박지욱 추가)
  5518. function fSetChildStat() {
  5519. model.refresh();
  5520. // 대상자조회화면에 심사상태를 업데이트 보여주도록 한다. (2008. 01. 28 박지욱 추가, 심사상태와 퇴원확정여부, 최종심사자, 심사일자 변경)
  5521. var trgtManWindow = getChildWindow("SMPIJ00200"); // SMPIJ00600_입원재원심사대상자조회.xrw
  5522. if (trgtManWindow != null) {
  5523. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat"); // 심사상태
  5524. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn"); // 퇴원확정여부
  5525. var selectedRow = trgtManWindow.model.getValue("/root/hidden/selectedRow");
  5526. var row = parseInt(selectedRow);
  5527. if (row > 0) {
  5528. trgtManWindow.model.setValue( "/root/main/list1/gridinpt[" + row + "]/dschjudgprcsstat", dschjudgprcsstat);
  5529. trgtManWindow.model.setValue( "/root/main/list1/gridinpt[" + row + "]/dschnotiyn", dschnotiyn);
  5530. trgtManWindow.model.setValue( "/root/main/list1/gridinpt[" + row + "]/lastjudgendid", VAL_usernm);
  5531. trgtManWindow.model.setValue( "/root/main/list1/gridinpt[" + row + "]/lastjudgdt", VAL_today);
  5532. }
  5533. }
  5534. // 끝
  5535. }
  5536. // 중증처방체크로직 추가 - 2007.11.27
  5537. // 중증처방만 있고 상병이 없는경우 Alert메세지를 띄운다.
  5538. // 조건 : 중증처방 존재 + 중증버튼 없음 + 중증요율 아님
  5539. function fChkEsscEDI(){
  5540. var chkBtn = btn_esscdiag.visible;
  5541. var chkSuppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  5542. var chkInsukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  5543. if(chkBtn == "True" || chkSuppkind == "05" || chkSuppkind == "39"){ // 20090325 차상위 2종 추가 - 박창원
  5544. return;
  5545. }
  5546. if(chkInsukind != "11" && chkInsukind != "21" && chkInsukind != "22" ){
  5547. return;
  5548. }
  5549. var cEssc = instance1.selectSingleNode("/root/hidden/result/chkesscedi");
  5550. if (cEssc == null) { // 특정내역이 없는 경우임
  5551. return;
  5552. }else{
  5553. modal("SPPIJ02100" ,"", "10", "10", "SPPIJ02100", "/root/hidden/result/chkesscedi", "/root/main/list1", "", "");
  5554. }
  5555. }
  5556. // 마감 가능 여부 체크(임시적 사용)
  5557. function fChkClose() {
  5558. var flag = true;
  5559. // 처방내역에 있는 미시행 건이 있는지 체크
  5560. //이경민 속도 개선 for -> xpath
  5561. var chkN = model.getValue("/root/main/list2/iscllist[execprcpstatcd='N']/execprcpstatcd");
  5562. var chkO = model.getValue("/root/main/list2/iscllist[execprcpstatcd='O']/execprcpstatcd");
  5563. if(chkN == "N" || chkO == "O"){
  5564. flag = false;
  5565. }
  5566. return flag;
  5567. }
  5568. // grid 타이틀 컬럼 정보
  5569. function getOrderInfoOfCol(grdid){
  5570. var refdata = ""; // ref
  5571. var sizedata = ""; // size
  5572. var grdobj = document.controls.item(grdid);
  5573. var totcol = grdobj.cols;
  5574. for(var i = 0; i < totcol; i++){
  5575. var refval = grdobj.colAttribute(i, "ref");
  5576. refdata += refval + "^";
  5577. var sizeval = grdobj.colWidth(i);
  5578. sizedata += sizeval + "^";
  5579. }
  5580. refdata = refdata.substring(0 , refdata.length-1);
  5581. sizedata = sizedata.substring(0, sizedata.length-1);
  5582. var scrnid = model.getValue("/root/hidden/listval/uuee[compsnm='"+grdid+"']/scrnid");
  5583. var compscnts = model.getValue("/root/hidden/listval/uuee[compsnm='"+grdid+"']/compscnts");
  5584. if (scrnid == "") {
  5585. model.setValue("/root/send/listval/uuee/flag","I");
  5586. } else {
  5587. model.setValue("/root/send/listval/uuee/flag","U");
  5588. }
  5589. model.setValue("/root/send/listval/uuee/scrnid","SMPIJ00300");
  5590. model.setValue("/root/send/listval/uuee/compsnm",grdid.toString());
  5591. model.setValue("/root/send/listval/uuee/compscnts",refdata);
  5592. model.setValue("/root/send/listval/uuee/compsrefcnts","-");
  5593. model.setValue("/root/send/listval/uuee/compssizecnts",sizedata);
  5594. if ( submit("TXPIJ00402") ) {
  5595. messageBox("사용자 환경 저장이","I002");
  5596. }
  5597. }
  5598. // grid 타이틀 컬럼 정보
  5599. function getOrderInfoOfRdo(rdoid){
  5600. var refdata = ""; // ref
  5601. var sizedata = ""; // size
  5602. var scrnid = model.getValue("/root/hidden/listval/uuee[compsnm='"+rdoid+"']/scrnid");
  5603. var compscnts = model.getValue("/root/hidden/listval/uuee[compsnm='"+rdoid+"']/compscnts");
  5604. var calcamtflag = model.getValue("/root/hidden/list1/isclcond/calcamtflag")
  5605. if (scrnid == "") {
  5606. model.setValue("/root/send/listval/uuee/flag","I");
  5607. } else {
  5608. model.setValue("/root/send/listval/uuee/flag","U");
  5609. }
  5610. model.setValue("/root/send/listval/uuee/scrnid","SMPIJ00300");
  5611. model.setValue("/root/send/listval/uuee/compsnm",rdoid);
  5612. model.setValue("/root/send/listval/uuee/compscnts",(calcamtflag.length == 0 ? "-" : calcamtflag));
  5613. model.setValue("/root/send/listval/uuee/compsrefcnts", "-");
  5614. model.setValue("/root/send/listval/uuee/compssizecnts","-");
  5615. if ( submit("TXPIJ00402") ) {
  5616. //messageBox("사용자 환경 저장이","I002");
  5617. }
  5618. }
  5619. function getOrderInfoOfChk(chkid){
  5620. var scrnid = model.getValue("/root/hidden/listval/uuee[compsnm='"+chkid+"']/scrnid");
  5621. var compscnts = model.getValue("/root/hidden/listval/uuee[compsnm='"+chkid+"']/compscnts");
  5622. var chkval = model.getValue("/root/hidden/list1/isclcond/" + chkid.replace("chk_",""));
  5623. if (scrnid == "") {
  5624. model.setValue("/root/send/listval/uuee/flag","I");
  5625. } else {
  5626. model.setValue("/root/send/listval/uuee/flag","U");
  5627. }
  5628. model.setValue("/root/send/listval/uuee/scrnid","SMPIJ00300");
  5629. model.setValue("/root/send/listval/uuee/compsnm",chkid);
  5630. model.setValue("/root/send/listval/uuee/compscnts",(chkval.length == 0 ? "N" : chkval));
  5631. model.setValue("/root/send/listval/uuee/compsrefcnts", "-");
  5632. model.setValue("/root/send/listval/uuee/compssizecnts","-");
  5633. if ( submit("TXPIJ00402") ) {
  5634. //messageBox("사용자 환경 저장이","I002");
  5635. }
  5636. }
  5637. // 사용자별 grid 타이틀 컬럼 설정
  5638. function setOrderInfoOfCol(grdid, refdata, sizedata){
  5639. var grdobj = document.controls.item(grdid);
  5640. var refarr = refdata.split("^");
  5641. var sizearr = sizedata.split("^");
  5642. for(var i = 0; i < refarr.length; i++){
  5643. var colcnt = grdobj.colref("" + refarr[i] + "");
  5644. grdobj.colMove(i, colcnt, "before",false);
  5645. var size = sizearr[i];
  5646. grdobj.colWidth(i) = eval(size);
  5647. }
  5648. grdobj.refresh();
  5649. var caption = "";
  5650. for( var i = 1; i < grdobj.cols ; i++ ){
  5651. if (caption == "") {
  5652. caption = grdobj.textMatrix(0,i);
  5653. } else {
  5654. caption += "^" + grdobj.textMatrix(0,i);
  5655. }
  5656. }
  5657. grdobj.caption = caption;
  5658. }
  5659. // 중간청구등록 화면에서 조회된 환자가 중간 청구 등록이 된 경우.
  5660. function fSetMidregist(midcflag) {
  5661. btn_midregist.disabled = false;
  5662. if(midcflag == "Y"){
  5663. btn_midregist.attribute("class") = "btn2_letter6";
  5664. btn_midregist.attribute("color") = "#ff0066";
  5665. btn_midregistyn.disabled = true;
  5666. btn_midcomplete.disabled = false;
  5667. btn_midcancel.disabled = false;
  5668. } else {
  5669. btn_midregist.attribute("class") = "btn2_letter6";
  5670. btn_midregistyn.attribute("class") = "btn2_letter6";
  5671. btn_midregistyn.disabled = false;
  5672. btn_midcomplete.disabled = true;
  5673. btn_midcancel.disabled = true;
  5674. }
  5675. }
  5676. //유형적용 완료후 소급처리 한다. - 20080730 수가계산을 날짜별로 loop. - 박창원
  5677. function fReCalc() {
  5678. // 입원일 부터 현재까지 계산한다(일일단위로 loop)
  5679. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5680. var todd = model.getValue("/root/main/item1/iteminfo/todd");
  5681. if (todd == "99991231") {
  5682. todd = VAL_today;
  5683. }
  5684. var period = getDateInterval(fromdd, todd);
  5685. // fromdd부터 currentdate까지 loop
  5686. for (i=1; i<= (period+1); i++) {
  5687. model.setValue("/root/send/calcbasedd" , fromdd);
  5688. var rslt = submit("TXPIJ00205",false);
  5689. if (rslt == false ) {
  5690. return false;
  5691. }
  5692. // fromdd를 증가시킨다(하루씩)
  5693. fromdd = fromdd.toDate("YYYYMMDD");
  5694. fromdd = fromdd.getAddDate(1);
  5695. fromdd = fromdd.getDateFormat();
  5696. }
  5697. }
  5698. // SPPIZ00700_심사Comment조회.xrw 호출(심사자메모,EDI메모)
  5699. function fGetJudgEdiComment(memoflag, memocls) {
  5700. model.resetInstanceNode("/root/hidden/sppiz00700/rslt");
  5701. model.resetInstanceNode("/root/hidden/sppiz00700/cond");
  5702. model.setValue("/root/hidden/sppiz00700/cond/memoflag", memoflag);
  5703. model.setValue("/root/hidden/sppiz00700/cond/memocls", memocls);
  5704. modal("SPPIZ00700" ,"", "10", "10", "SPPIZ00700", "/root/hidden/sppiz00700", "/root/send/sppiz00700", "", "");
  5705. }
  5706. // 수정추가 20090813 외래요율환자 일경우 보험, 보조유형 정보가 맞는지 확인하여 alert처리함.
  5707. function fOutRateInsuSuppflag(){
  5708. //속도개선 통합 plet2
  5709. //submit("TRPIJ00316");
  5710. if(model.getValue("/root/main/outrateinsusuppflag/info/yn") == "N"){
  5711. messageBox("6시간 미만으로 외래요율 퇴원건입니다. \n환자에게 해당하는 보조유형을 선택하여 변경하시고 재계산 한후 심사","I008");
  5712. }
  5713. }
  5714. //평가메모 관련 팝업창세팅
  5715. function fSetTstMemoRefresh(){
  5716. var memo = model.getValue("/root/hidden/sppiz00700/rslt/memo");
  5717. var tmp = model.getValue("/root/main/item1/iteminfo/edirmk");
  5718. if(tmp){
  5719. tmp = tmp + " ";
  5720. }
  5721. model.setValue("/root/main/item1/iteminfo/tstrmk",tmp + memo);
  5722. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  5723. model.refresh();
  5724. }
  5725. function fSetRdoReset(){
  5726. var rdo_name = model.getValue("/root/hidden/listval/uuee[compsnm='rdo_zerofilter']/compsnm");
  5727. var rdo_val = model.getValue("/root/hidden/listval/uuee[compsnm='rdo_zerofilter']/compscnts");
  5728. if (rdo_name.length > 0) {
  5729. if (rdo_val == "calcamt!='0' or matractflag='0'"){
  5730. model.setValue(rdo_zerofilter.attribute("ref"), "0");
  5731. model.setValue("/root/hidden/list1/isclcond/calcamtflag",rdo_val );
  5732. } else if (rdo_val == "calcamt='0'") {
  5733. model.setValue(rdo_zerofilter.attribute("ref"), "1");
  5734. model.setValue("/root/hidden/list1/isclcond/calcamtflag",rdo_val );
  5735. } else {
  5736. model.setValue(rdo_zerofilter.attribute("ref"), "-");
  5737. model.setValue("/root/hidden/list1/isclcond/calcamtflag","");
  5738. }
  5739. } else {
  5740. model.setValue(rdo_zerofilter.attribute("ref"), "0");
  5741. model.setValue("/root/hidden/list1/isclcond/calcamtflag","calcamt!='0' or matractflag='0'");
  5742. }
  5743. var chk_name = model.getValue("/root/hidden/listval/uuee[compsnm='chk_showsubtotal']/compsnm");
  5744. var chk_val = model.getValue("/root/hidden/listval/uuee[compsnm='chk_showsubtotal']/compscnts");
  5745. if (chk_name.length > 0) {
  5746. if (chk_val == "Y"){
  5747. model.setValue("/root/hidden/list1/isclcond/showsubtotal", chk_val);
  5748. } else {
  5749. model.setValue("/root/hidden/list1/isclcond/showsubtotal", "");
  5750. }
  5751. } else {
  5752. model.setValue("/root/hidden/list1/isclcond/showsubtotal", "");
  5753. }
  5754. chk_name = model.getValue("/root/hidden/listval/uuee[compsnm='chk_showitemcoloryn']/compsnm");
  5755. chk_val = model.getValue("/root/hidden/listval/uuee[compsnm='chk_showitemcoloryn']/compscnts");
  5756. if (chk_name.length > 0) {
  5757. if (chk_val == "Y"){
  5758. model.setValue("/root/hidden/list1/isclcond/showitemcoloryn", chk_val);
  5759. } else {
  5760. model.setValue("/root/hidden/list1/isclcond/showitemcoloryn", "");
  5761. }
  5762. } else {
  5763. model.setValue("/root/hidden/list1/isclcond/showitemcoloryn", "");
  5764. }
  5765. model.setValue(rdo_actmatflag.attribute("ref"), "-");
  5766. model.setValue(rdo_actingflag.attribute("ref"), "all");
  5767. model.setValue(rdo_insuflag.attribute("ref"), "-");
  5768. model.setValue(rdo_ordfilflag.attribute("ref"), "-");
  5769. model.setValue(rdo_cpflag.attribute("ref"), "-");
  5770. model.setValue("/root/hidden/list1/isclcond/matractflag","");
  5771. model.setValue("/root/hidden/list1/isclcond/calcpayflag","");
  5772. model.setValue("/root/hidden/list1/isclcond/snglcalcscorcls","");
  5773. model.setValue("/root/hidden/list1/isclcond/cpflag","");
  5774. model.setValue("/root/hidden/list1/isclcond/edicd","");
  5775. model.setValue("/root/hidden/list1/isclcond/snglcalcscorcd","");
  5776. model.setValue("/root/hidden/list1/isclcond/actingflag","");
  5777. }
  5778. function openSMMMR06900() {
  5779. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  5780. if(chk){
  5781. var trgtManWindow = getChildWindow("SMMMR06900");
  5782. if (trgtManWindow == null) {
  5783. modal("SMMMR06900");
  5784. //modal("SMMMR06901" ,"", "10", "10", "SPPIJ02501", "/root/hidden/sppij02501/cond", "/root/send", "", "");
  5785. }else{
  5786. activateChild("SMMMR06900");
  5787. }
  5788. }
  5789. }
  5790. function fGetDrgOpenPopup(flag){
  5791. //DRG 설정..시작
  5792. var opchkyn = model.getValue("/root/main/item11/drginfo/opchkyn");
  5793. var drgmchkyn = model.getValue("/root/main/item11/drginfo/drgmchkyn");
  5794. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5795. var indaycnt = parseInt(model.getValue("/root/main/list1/insulist[fromdd='"+fromdd+"']/indaycnt"));
  5796. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  5797. var cnt = getNodesetCount("/root/main/list2/iscllist[drgacptflag='C']/drgacptflag");
  5798. var snglcalcscorcd = model.getValue("/root/main/list2/iscllist[drgacptflag='C']/snglcalcscorcd");
  5799. /* DRG 추가인정 수술료의 산정의미를 체크할 필요가 없다!! 추가인정금액 생성 시 제외하고 발생하므로!! (2015.06.24 LEJ)
  5800. if (cnt > 0 && dschjudgprcsstat != "C") {
  5801. var estmcd000 = getNodesetCount("/root/main/list2/iscllist[drgacptflag='C' and estmcd='000']/drgacptflag");
  5802. var estmcd004 = getNodesetCount("/root/main/list2/iscllist[drgacptflag='C' and estmcd='004']/drgacptflag");
  5803. var estmcd = getNodesetCount("/root/main/list2/iscllist[drgacptflag='C' and estmcd='']/drgacptflag");
  5804. if (estmcd000 > 0 || estmcd004 > 0 || estmcd > 0) {
  5805. } else {
  5806. messageBox("["+snglcalcscorcd+"] DRG 추가 인정 수술료입니다. 산정의미를","I007");
  5807. return false;
  5808. }
  5809. }
  5810. */
  5811. if (opchkyn=="Y" && indaycnt <= 30) {
  5812. // DRG 대상자 중 혈우병 특정기호: V009, HIV 특정기호: V103 존재 시 DRG 제외 대상자 메세지
  5813. var drgexceptyn = model.getValue("/root/main/item11/endcnclstat/drgexceptyn");
  5814. if (drgexceptyn == "Y") {
  5815. if ( messageBox("DRG 제외 상병(혈우병 또는 HIV)이 존재하는 DRG 대상자 입니다. 마감","Q004") != 6 ) {
  5816. return false;
  5817. }
  5818. }
  5819. if (flag == "O") { openSMMMR06900(); }
  5820. var vpid = model.getValue("/root/main/item1/iteminfo/pid");
  5821. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  5822. var ordfromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5823. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  5824. setParameter("pid", vpid);
  5825. setParameter("indd", indd);
  5826. setParameter("ordfromdd", ordfromdd);
  5827. setParameter("cretno", cretno);
  5828. setParameter("drgmstat", flag);
  5829. modal("SPPIJ03200" ,"", "10", "10", "SPPIJ03200", "/root/hidden/sppij03200/cond", "/root/send/data/drginfo", "", "");
  5830. if (model.getValue("/root/main/item11/drginfo/rslt") != "true") {
  5831. return false;
  5832. }
  5833. }
  5834. //DRG완료
  5835. }
  5836. function fGetKDrgOpenPopup(flag){
  5837. var vpid = model.getValue("/root/main/item1/iteminfo/pid");
  5838. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  5839. var ordfromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5840. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  5841. setParameter("pid", vpid);
  5842. setParameter("indd", indd);
  5843. setParameter("ordfromdd", ordfromdd);
  5844. setParameter("cretno", cretno);
  5845. setParameter("drgmstat", flag);
  5846. open("SPPIJ04000" ,"", "10", "10", "SPPIJ04000", "/root/hidden/sppij03200/cond", "/root/send/data/drginfo", "", "");
  5847. }
  5848. /*
  5849. 심사완료전상병특정내역체크 2013.07.10 plet2
  5850. 16세미만, 35세 이상 초산 산모 필수 진단 체크
  5851. 특정 분만진단에 필수 부진단 유무 체크
  5852. 임신주수별 체중과 진단 체크
  5853. */
  5854. function fGetDiagSpclcdCheck(){
  5855. var diagnode = "/root/main/list3/diaglist";
  5856. var spclnode = "/root/main/list4/clcjlist";
  5857. var isclnode = "/root/main/list2/iscllist";
  5858. var chk_diagcd = model.getValue(diagnode+"[seqno='1']/diagcd"); //주상병코드
  5859. var chk_O3420 = model.getValue(diagnode+"[diagcd='O3420']/diagcd");
  5860. var chk_prgweekcnt = model.getValue("/root/main/clcjnbwt/clcjnbwtlist/prgweekcnt"); //임신주수
  5861. var chk_weig = model.getValue("/root/main/clcjnbwt/clcjnbwtlist/weig"); //신생아체중
  5862. var chk_O365 =model.getValue(diagnode+"[diagcd='O365' or diagcd='O366' ]/diagcd"); //임신주수상병코드
  5863. var chk_poaflag = getNodesetCount(diagnode+"[diagcd!='' and poaflag='']/diagcd"); //poaflag
  5864. //16세미만, 35세 이상 초산 산모 필수 진단 체크
  5865. var chk_R= model.getValue(isclnode+"[snglcalcscorcd='R4351' " +
  5866. "or snglcalcscorcd='R3131' " +
  5867. "or snglcalcscorcd='R3141' " +
  5868. "or snglcalcscorcd='R4361' " +
  5869. "or snglcalcscorcd='R4519' " +
  5870. "or snglcalcscorcd='R4517' " +
  5871. "]/snglcalcscorcd"); // 초산 상병체크
  5872. var patage = parseInt(model.getValue("/root/main/item1/iteminfo/age"));
  5873. var result = true;
  5874. if (chk_R.length > 0 && (patage >= 35 || patage < 16) ) {
  5875. if(messageBox("어린 초임부 또는 고령초임부 환자입니다.", "Q003") == 6) {
  5876. result = true;
  5877. } else {
  5878. result = false;
  5879. }
  5880. }
  5881. //특정 분만진단에 필수 부진단 유무 체크
  5882. //O820이 주상병인 환자가 O3420 상병이 없을 경우 체크
  5883. if (chk_diagcd == 'O820' && chk_O3420.length == 0 ) {
  5884. if(messageBox("반복제왕절개 환자입니다.", "Q003") == 6) {
  5885. result = true;
  5886. } else {
  5887. var ans = messageBox("O3420 상병을 입력" , "S001");
  5888. if (ans==6){
  5889. model.setFocus("grd_diaglist");
  5890. //fDiagGridInsertRow();
  5891. grd_diaglist.bottomRow = grd_diaglist.rows;
  5892. model.refresh();
  5893. var maxseq = model.getXPathValue("max("+diagnode+"[*]/seqno)");
  5894. model.setValue(diagnode+"[seqno='"+maxseq+"']/diagcd","O3420");
  5895. model.setValue(diagnode+"[seqno='"+maxseq+"']/diagnm","이전의 제왕절개로 인한 흉터의 산모 관리");
  5896. }
  5897. result = false;
  5898. }
  5899. }
  5900. //임신주수별 체중과 진단 체크
  5901. //신생아 체중관련 상병누락입니다 (O365 or O366)
  5902. if (chk_prgweekcnt.length > 0 && chk_weig.length > 0) {
  5903. var nwbabyweight = parseInt(chk_weig);
  5904. var minweight = parseInt(model.getValue("/root/main/nbwt/nbwtlist[prgntweek='"+chk_prgweekcnt+"']/minweight"));
  5905. var maxweight = parseInt(model.getValue("/root/main/nbwt/nbwtlist[prgntweek='"+chk_prgweekcnt+"']/maxweight"));
  5906. if (chk_O365.length == 0 && (nwbabyweight <= minweight || nwbabyweight >= maxweight ) ) {
  5907. if(messageBox("신생아 체중관련 상병누락 환자입니다.", "Q003") == 6) {
  5908. result = true;
  5909. } else {
  5910. result = false;
  5911. }
  5912. }
  5913. }
  5914. var opchkyn = model.getValue("/root/main/item11/drginfo/opchkyn");
  5915. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5916. var indaycnt = parseInt(model.getValue("/root/main/list1/insulist[fromdd='"+fromdd+"']/indaycnt"));
  5917. if (opchkyn=="Y" && indaycnt <= 30) {
  5918. if (chk_poaflag > 0) {
  5919. messageBox("상병의 POA정보는", "I003");
  5920. return false;
  5921. /* 사후에 에러발생으로 모든상병 POA정보 없으면 진행되지않도록 수정. 2014.01.17 plet2
  5922. * if(messageBox("상병에 POA정보가 없습니다.", "Q003") == 6) {
  5923. result = true;
  5924. } else {
  5925. result = false;
  5926. }*/
  5927. }
  5928. }
  5929. }
  5930. //2013.07.18 이경민 요율변경 공통호출함수 정리
  5931. function Insuchange(suppkind) {
  5932. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  5933. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  5934. var cretno = model.getValue("/root/main/item1/iteminfo/cretno");
  5935. var mskind = model.getValue("/root/main/item1/iteminfo/mskind");
  5936. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  5937. var seqno = model.getValue("/root/main/item1/iteminfo/seqno");
  5938. if (seqno == "") {
  5939. seqno = "1"
  5940. }
  5941. var todd = model.getValue("/root/main/item1/iteminfo/todd");
  5942. var insukind = model.getValue("/root/send/insukind");
  5943. var instcd = model.getValue("/root/main/item1/iteminfo/instcd");
  5944. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  5945. model.setValue("/root/hidden/item2/insuchange/iphs_status","B");
  5946. model.setValue("/root/hidden/item2/insuchange/iphs_pid",pid);
  5947. model.setValue("/root/hidden/item2/insuchange/iphs_indd",indd);
  5948. model.setValue("/root/hidden/item2/insuchange/iphs_cretno",cretno);
  5949. model.setValue("/root/hidden/item2/insuchange/iphs_mskind",mskind);
  5950. model.setValue("/root/hidden/item2/insuchange/iphs_fromdd",fromdd);
  5951. model.setValue("/root/hidden/item2/insuchange/iphs_seqno",seqno);
  5952. model.setValue("/root/hidden/item2/insuchange/iphs_todd",todd);
  5953. model.setValue("/root/hidden/item2/insuchange/iphs_insukind",insukind);
  5954. model.setValue("/root/hidden/item2/insuchange/iphs_suppkind",suppkind);
  5955. model.setValue("/root/hidden/item2/insuchange/iphs_instcd",instcd);
  5956. model.setValue("/root/hidden/item2/insuchange/iphs_indschacptstat",indschacptstat);
  5957. model.removenode("/root/hidden/insuchange/rslt");
  5958. var receiptyn = model.getValue("/root/main/item1/iteminfo/receiptyn");
  5959. if (receiptyn != "") {
  5960. messageBox("퇴원(가퇴원) 수납이 되었으므로 유형변경을","E001");
  5961. return false;
  5962. }
  5963. if(submit("TXPIJ00305", false)){
  5964. if(messageBox("유형변경이 완료 되었습니다. 변경된 내역의 소급처리를", "Q004") == 6){
  5965. // 로딩창 열기
  5966. var sWindowMsg = "수가계산중입니다...";
  5967. callLoadingWindow(sWindowMsg);
  5968. fReCalc() ;
  5969. // 로딩창 닫기
  5970. removeLoadingWindow();
  5971. messageBox("소급계산이","I001");
  5972. }
  5973. }
  5974. model.refresh();
  5975. grp_changeownbrate.visible = false;
  5976. fGetItemInfo();
  5977. }
  5978. /**
  5979. * @desc : 퇴원예고일자 이후의 처방 존재 유무 확인(submit)
  5980. * @param :
  5981. * @return : true, false
  5982. * @authur : 이경민 2013. 8. 5
  5983. */
  5984. function fCheckReturnPrcpExist(){
  5985. var bRtn = true;
  5986. var pid = model.getValue("/root/main/item1/iteminfo/pid")
  5987. var indd = model.getValue("/root/main/item1/iteminfo/indd1")
  5988. var cretno = model.getValue("/root/main/item1/iteminfo/cretno")
  5989. model.makeValue("/root/dschreturnprcp/reqdata/pid", pid);
  5990. model.makeValue("/root/dschreturnprcp/reqdata/indd", indd);
  5991. model.makeValue("/root/dschreturnprcp/reqdata/cretno", cretno);
  5992. model.resetInstanceNode("/root/checkreturnprcp/rtndata/cnt");
  5993. if(submit("TRMMO00404")){
  5994. var nCnt = model.getValue("/root/checkreturnprcp/rtndata/cnt");
  5995. if(nCnt > 0) {
  5996. setParameter("SPMMO50400_pid", pid);
  5997. setParameter("SPMMO50400_indd", indd);
  5998. setParameter("SPMMO50400_cretno", cretno);
  5999. modal("SPMMO50400");
  6000. bRtn = false;
  6001. }
  6002. }
  6003. return bRtn;
  6004. }
  6005. //중간청구등록
  6006. function fmidregist() {
  6007. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6008. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  6009. if(chk){
  6010. if(ipt_pid.currentText.length >1){
  6011. if(indd.length>1){
  6012. //var trgtManWindow = getChildWindow("SMPIJ01100");
  6013. var trgtManWindow = getChildWindow("SMPIJ02300");
  6014. var patunitsrch1 = model.getValue("/root/main/item1/iteminfo/pid").getTrim(); // (stringHelper.js) 문자열 앞뒤에 있는 공백 제거
  6015. // 2008.01.23 박지욱 수정 (중간청구등록화면에 넘겨주는 데이터 추가 - pid, indd)
  6016. model.removenode("/root/hidden/midclam");
  6017. model.makeValue("/root/hidden/midclam/pid", patunitsrch1);
  6018. model.makeValue("/root/hidden/midclam/indd", model.getValue("/root/main/item1/iteminfo/indd"));
  6019. if (trgtManWindow == null) {
  6020. open("SMPIJ02300" ,"", "10", "10", "SMPIJ02300", "/root/hidden/midclam", "/root/hidden/midclam");
  6021. } else {
  6022. activateChild("SMPIJ02300");
  6023. trgtManWindow.javascript.fGetMidClamList();
  6024. }
  6025. model.refresh();
  6026. }
  6027. }
  6028. }
  6029. }
  6030. //분할제외등록
  6031. function fmidregistyn() {
  6032. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6033. if(chk){
  6034. var midregistyn = model.getValue("/root/main/item1/iteminfo/midregistyn");
  6035. if (midregistyn == "Y") {
  6036. if (submit("TXPIJ00307", false)) {
  6037. btn_midregist.attribute("class") = "btn2_letter6";
  6038. btn_midregist.disabled = false;
  6039. btn_midregistyn.attribute("class") = "btn2_letter6";
  6040. //btn_midregistyn.attribute("color") = "#ff0066";
  6041. model.setValue("/root/main/item1/iteminfo/midregistyn", "N");
  6042. messageBox("분할제외 등록 취소가","I002");
  6043. }
  6044. } else {
  6045. if (submit("TXPIJ00307"), false) {
  6046. btn_midregist.attribute("class") = "btn2_letter6";
  6047. btn_midregist.disabled = true;
  6048. btn_midregistyn.attribute("class") = "btn2_letter6";
  6049. btn_midregistyn.attribute("color") = "#ff0066";
  6050. model.setValue("/root/main/item1/iteminfo/midregistyn", "Y");
  6051. messageBox("분할제외 등록이","I002");
  6052. }
  6053. }
  6054. }
  6055. }
  6056. //애기/엄마
  6057. function fbabymother() {
  6058. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6059. if(chk){
  6060. var readonly = model.getValue("/root/send/readonly");
  6061. // 6시간 미만 환자일 경우 Block - 20081005 박창원
  6062. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  6063. // open일관련 적용 - 20090302 - 하드코딩 제거,확산병원 데이터 미등록 때문에 예외처리함
  6064. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  6065. // 이력 그리드내에서 보조유형이 09(자연분만) 있는 경우 이미 면제기간이 적용된 경우
  6066. // 분만신생아관리 화면에서 면제기간적용 버튼 비활성화 (2008.01.29 박지욱 추가)
  6067. var fromdd = "";
  6068. var todd = "";
  6069. var seqno = model.getValue("/root/main/item1/iteminfo/seqno");
  6070. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  6071. var dschnotidt = model.getValue("/root/main/item1/iteminfo/dschnotidt");
  6072. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  6073. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  6074. for (var i = 1; i < grd_insuhistory.rows; i++) {
  6075. var suppkind = model.getValue("/root/main/list1/insulist["+i+"]/suppkind");
  6076. if (suppkind == "09" || suppkind == "42") {
  6077. fromdd = model.getValue("/root/main/list1/insulist["+i+"]/fromdd");
  6078. todd = model.getValue("/root/main/list1/insulist["+i+"]/dschnotidt");
  6079. seqno = model.getValue("/root/main/list1/insulist["+i+"]/seqno");
  6080. }
  6081. }
  6082. model.setValue("/root/hidden/sppiz01200/cond/pid",model.getValue("/root/main/item1/iteminfo/pid"));
  6083. model.setValue("/root/hidden/sppiz01200/cond/indd",indd);
  6084. model.setValue("/root/hidden/sppiz01200/cond/cretno",model.getValue("/root/main/item1/iteminfo/cretno"));
  6085. model.setValue("/root/hidden/sppiz01200/cond/mskind",model.getValue("/root/main/item1/iteminfo/mskind"));
  6086. model.setValue("/root/hidden/sppiz01200/cond/brateflag",model.getValue("/root/main/item1/iteminfo/brateflag"));
  6087. model.setValue("/root/hidden/sppiz01200/cond/brthdd",model.getValue("/root/main/item1/iteminfo/brthdd"));
  6088. model.setValue("/root/hidden/sppiz01200/cond/dschnotidt",dschnotidt);
  6089. model.setValue("/root/hidden/sppiz01200/cond/dschnotiyn",dschnotiyn);
  6090. model.setValue("/root/hidden/sppiz01200/cond/calcbasedd", '-');
  6091. model.setValue("/root/hidden/sppiz01200/cond/seqno", seqno);
  6092. model.setValue("/root/hidden/sppiz01200/cond/cfe", cfe);
  6093. // 심사마감이나 퇴원한 환자는 면제일자적용이나 해제를 시킬 수 없다. - 20080924 박창원
  6094. // 기존에는 심사마감이나 퇴원여부를 인스턴스에서 가져오던 것을 실시간 체크로 변경 - 20080927 박창원
  6095. if (!submit("TRPIJ00315", false)) {
  6096. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6097. return;
  6098. }
  6099. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  6100. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  6101. // 중간청구 여부를 판단해서 블로킹 - 20081017 박창원
  6102. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd");
  6103. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  6104. if (lastmdlclamdd > fromdd && lastmdlclamdd > opendd && lastmdlclamdd != "" ) {
  6105. model.setValue("/root/hidden/sppiz01200/cond/saveyn","Y");
  6106. }
  6107. if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E" || indschacptstat == "D" || readonly == "Y") {
  6108. model.setValue("/root/hidden/sppiz01200/cond/saveyn","Y");
  6109. } else {
  6110. model.setValue("/root/hidden/sppiz01200/cond/saveyn","N");
  6111. }
  6112. // fromdd 와 todd 에 값이 있으면 면제기간 적용된 환자임을 알려주는 flag 세팅
  6113. if (fromdd != "" && todd != "") {
  6114. model.setValue("/root/hidden/sppiz01200/cond/disyn","Y");
  6115. } else {
  6116. model.setValue("/root/hidden/sppiz01200/cond/disyn","N");
  6117. }
  6118. if (sixtimyn == "Y") {
  6119. messageBox("6시간 미만 상태 입니다. 자연분만 요율을 설정(저장) ","E001");
  6120. }
  6121. model.setValue("/root/hidden/sppiz01200/cond/fromdd",fromdd);
  6122. model.setValue("/root/hidden/sppiz01200/cond/todd",todd);
  6123. var trgtManWindow = getChildWindow("SPPIZ01200");
  6124. if (trgtManWindow == null) {
  6125. open("SPPIZ01200" ,"", "10", "10", "SPPIZ01200","/root/hidden/sppiz01200/cond", "/root/hidden/sppiz01200/cond");
  6126. } else {
  6127. activateChild("SPPIZ01200");
  6128. model.refresh();
  6129. }
  6130. }
  6131. }
  6132. //수술(유)
  6133. function foperdiag() {
  6134. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6135. if(chk){
  6136. var trgtManWindow = getChildWindow("SPPIZ01300");
  6137. var indd = model.getValue("/root/main/item1/iteminfo/indd1");
  6138. model.setValue("/root/hidden/sppiz01300/cond/pid",model.getValue("root/main/item1/iteminfo/pid"));
  6139. model.setValue("/root/hidden/sppiz01300/cond/indd",indd);
  6140. model.setValue("/root/hidden/sppiz01300/cond/cretno",model.getValue("root/main/item1/iteminfo/cretno"));
  6141. if (trgtManWindow == null) {
  6142. open("SPPIZ01300" ,"", "10", "10", "SPPIZ01300","/root/hidden/sppiz01300/cond", "/root/send/data1");
  6143. } else {
  6144. activateChild("SPPIZ01300");
  6145. model.refresh();
  6146. }
  6147. }
  6148. }
  6149. //중간마감취소
  6150. function fmidcancel() {
  6151. //20091126 JHP 수정추가
  6152. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6153. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  6154. var ans = 0;
  6155. if(chk){
  6156. if(ipt_pid.currentText.length >1){
  6157. if(indd.length>1){
  6158. var trgtManWindow = getChildWindow("SMPID10100");
  6159. var patunitsrch1 = model.getValue("/root/main/item1/iteminfo/pid").getTrim(); // (stringHelper.js) 문자열 앞뒤에 있는 공백 제거
  6160. // 2008.01.23 박지욱 수정 (중간청구등록화면에 넘겨주는 데이터 추가 - pid, indd)
  6161. model.removenode("/root/hidden/midclam");
  6162. model.makeValue("/root/hidden/midclam/pid", patunitsrch1);
  6163. model.makeValue("/root/hidden/midclam/indd", model.getValue("/root/main/item1/iteminfo/indd"));
  6164. if (trgtManWindow == null) {
  6165. ans = messageBox("심사 취소 할 경우", "S001");
  6166. if (ans == 6) {
  6167. model.makeValue("/root/send/checkyn","Y");
  6168. if (!submit("TRPIJ00315", false)) {
  6169. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6170. return;
  6171. }
  6172. if (fGetDrgOpenPopup("O") == false) {
  6173. return false;
  6174. }
  6175. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","A");
  6176. if (submit("TXPIJ00301", false)) {
  6177. }
  6178. }
  6179. } else {
  6180. ans = messageBox("심사 취소 할 경우", "S001");
  6181. if (ans == 6) {
  6182. model.makeValue("/root/send/checkyn","Y");
  6183. if (!submit("TRPIJ00315", false)) {
  6184. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6185. return;
  6186. }
  6187. if (fGetDrgOpenPopup("O") == false) {
  6188. return false;
  6189. }
  6190. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","A");
  6191. submit("TXPIJ00301",false);
  6192. }
  6193. }
  6194. model.refresh();
  6195. }
  6196. }
  6197. }
  6198. }
  6199. //특정내역
  6200. function fspclData() {
  6201. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6202. if(chk){
  6203. var rrgstno = model.getValue("/root/main/item1/iteminfo/rrgstno");
  6204. rrgstno = rrgstno.replace("-","");
  6205. model.setValue("/root/send/rrgstno",rrgstno);
  6206. model.setValue("/root/send/dschdd",model.getValue("/root/main/item1/iteminfo/dschdd"));
  6207. var fromdd = model.getValue("/root/send/fromdd");
  6208. // v191, v192, v193 값을 넣기 위한 vcode
  6209. model.setValue("root/send/vcode", model.getValue("/root/hidden/item1/vcode"));
  6210. if (submit("TRPIJ00310")) {
  6211. copyNodeType("/root/main/list4","/root/hidden/list4","after");
  6212. //grd_clcjlist.dispatch("xforms-value-changed");
  6213. //model.refresh(); 최적화 문제로 대체 20080731 박창원
  6214. model.refreshpart("/root/main/list4");
  6215. for(var i = 1; i < grd_clcjlist.rows; i++) {
  6216. var spclcd = model.getValue("/root/main/list4/clcjlist["+ i + "]/spclcd");
  6217. model.setValue("/root/main/list4/clcjlist["+ i + "]/fromdd", fromdd);
  6218. if (spclcd == "" ) {
  6219. grd_clcjlist.deleteRow(i, false);
  6220. }
  6221. }
  6222. for(var i = 1; i < grd_clcjlist.rows; i++) {
  6223. var status = model.getValue("/root/main/list4/clcjlist["+ i + "]/status");
  6224. if(status == "3"){
  6225. grd_clcjlist.rowstatus(i) = 1;
  6226. }
  6227. }
  6228. // 그리드 정렬 + 빈줄 추가
  6229. fSortSpclNo();
  6230. // 행추가
  6231. // fSpclGridInsertRow();
  6232. }
  6233. }
  6234. }
  6235. //중증질환
  6236. function fesscdiag() {
  6237. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6238. var readonly = model.getValue("/root/send/readonly");
  6239. // open 일 적용 - 20090302 박창원 - 확산될때마다 수정해야함 - 확산병원은 오픈일 기준자료가 없으므로...
  6240. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  6241. /* if (opendd != "20081003") {
  6242. opendd = "20081003";
  6243. } */
  6244. if(chk){
  6245. var trgtManWindow = getChildWindow("SPPIJ01900");
  6246. var vcode = model.getValue("/root/hidden/item1/vcode");
  6247. var indd = model.getValue("root/main/item1/iteminfo/indd1");
  6248. // 6시간미만 변경 블로킹을 위해 변수 추가 - 20081105 박창원
  6249. var sixtimyn = model.getValue("/root/main/item1/iteminfo/sixtimyn");
  6250. // 심사마감이나 퇴원한 환자는 요율을 변경 시킬 수 없다. - 20080924 박창원
  6251. // 등록암 불가 알럿후 종료, 중증수술은 조회만 되게 - 기간적용,적용, 유형복원 안되게
  6252. // 기존에는 심사마감이나 퇴원여부를 인스턴스에서 가져오던 것을 실시간 체크로 변경 - 20080927 박창원
  6253. if (!submit("TRPIJ00315", false)) {
  6254. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6255. return;
  6256. }
  6257. var indschacptstat = model.getValue("/root/main/item11/endcnclstat/indschacptstat");
  6258. var dschjudgprcsstat = model.getValue("/root/main/item11/endcnclstat/dschjudgprcsstat");
  6259. model.setValue("/root/hidden/sppij01900/cond/pid",model.getValue("root/main/item1/iteminfo/pid"));
  6260. model.setValue("/root/hidden/sppij01900/cond/indd",indd);
  6261. model.setValue("/root/hidden/sppij01900/cond/cretno",model.getValue("root/main/item1/iteminfo/cretno"));
  6262. model.setValue("/root/hidden/sppij01900/cond/mskind",model.getValue("root/main/item1/iteminfo/mskind"));
  6263. model.setValue("/root/hidden/sppij01900/cond/brateflag",model.getValue("root/main/item1/iteminfo/brateflag"));
  6264. model.setValue("/root/hidden/sppij01900/cond/brthdd",model.getValue("root/main/item1/iteminfo/brthdd"));
  6265. model.setValue("/root/hidden/sppij01900/cond/vcode",vcode);
  6266. model.setValue("/root/hidden/sppij01900/cond/ownbrate",model.getValue("/root/main/item1/iteminfo/normalownbrate"));
  6267. model.setValue("/root/hidden/sppij01900/cond/cfe",model.getValue("root/main/item1/iteminfo/cfe"));
  6268. // 심사마감이나 퇴원한 환자는 중증수술기간산정관리에서 조작을 할 수 없다 - 20080924 박창원
  6269. // 중간청구 여부를 판단해서 블로킹 - 20081017 박창원
  6270. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd");
  6271. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  6272. if (lastmdlclamdd > fromdd && lastmdlclamdd > opendd && lastmdlclamdd != "" ) {
  6273. model.setValue("/root/hidden/sppij01900/cond/saveyn","Y");
  6274. }
  6275. if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E" || indschacptstat == "D" || readonly == "Y" ) {
  6276. model.setValue("/root/hidden/sppij01900/cond/saveyn","Y");
  6277. } else {
  6278. model.setValue("/root/hidden/sppij01900/cond/saveyn","N");
  6279. }
  6280. // 희귀난치성산정특례 - 20090621 박창원
  6281. var rareessc = model.getValue("/root/main/item12/rareessc/rareesscyn");
  6282. if (rareessc == "Y") {
  6283. var chksuppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  6284. if (chksuppkind == "50") {
  6285. if (lastmdlclamdd > fromdd && lastmdlclamdd > opendd && lastmdlclamdd != "" ) {
  6286. messageBox("중간청구 등록이 되어있습니다. 요율을 변경","E001");
  6287. return;
  6288. }else if (readonly == "Y") {
  6289. messageBox("읽기전용 모드입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6290. return;
  6291. }else if (indschacptstat == "D") {
  6292. messageBox("이미 퇴원한 환자입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6293. return;
  6294. }else if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E") {
  6295. messageBox("이미 마감된 환자입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6296. return;
  6297. }
  6298. var msg = messageBox("이미 희귀난치성 산정특례 적용이 된 환자입니다. 기존에 적용된 유형을 취소","S001");
  6299. if(msg != 6) {
  6300. return;
  6301. }else{
  6302. if (fSaveMain("P") == true) {
  6303. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  6304. var suppkind = "00";
  6305. if (cfe == "E" || cfe == "F") {
  6306. suppkind = "33"; //차상위2종정상으로 셋팅
  6307. }
  6308. Insuchange(suppkind);
  6309. }
  6310. }
  6311. } else if (chksuppkind != "50") {
  6312. if (readonly == "Y") {
  6313. messageBox("읽기전용 모드입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6314. return;
  6315. }
  6316. if (indschacptstat == "D") {
  6317. messageBox("이미 퇴원한 환자입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6318. return;
  6319. }
  6320. if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E") {
  6321. messageBox("이미 마감된 환자입니다. 희귀난치성 산정특례 요율을 적용하거나 취소","E001");
  6322. return;
  6323. }
  6324. var msg = messageBox("희귀난치성 산정특례 환자입니다. 중증요율 적용","S001");
  6325. if(msg !=6){
  6326. return;
  6327. }else{
  6328. if (fSaveMain("P") == true) {
  6329. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  6330. var suppkind = "50";
  6331. if (cfe == "E" || cfe == "F") {
  6332. suppkind = "46"; // 차상위2종희귀난치성 산정특례로 셋팅
  6333. }
  6334. Insuchange(suppkind);
  6335. }
  6336. }
  6337. }
  6338. }
  6339. if(vcode == "V193"){
  6340. var chksuppkind = model.getValue("/root/main/item1/iteminfo/suppkindcd");
  6341. var chkinsukind = model.getValue("/root/main/item1/iteminfo/insukindcd");
  6342. // 중간청구 여부를 판단해서 블로킹 - 20081017 박창원
  6343. // 차상위 2종 로직 추가 - 20090325 박창원
  6344. if(chksuppkind == "06" || chksuppkind == "40"){
  6345. if (lastmdlclamdd > fromdd && lastmdlclamdd > opendd && lastmdlclamdd != "" ) {
  6346. messageBox("중간청구 등록이 되어있습니다. 요율을 변경","E001");
  6347. return;
  6348. }else if (readonly == "Y") {
  6349. messageBox("읽기전용 모드입니다. 등록암 요율을 적용하거나 취소","E001");
  6350. return;
  6351. }else if (indschacptstat == "D") {
  6352. messageBox("이미 퇴원한 환자입니다. 등록암 요율을 적용하거나 취소","E001");
  6353. return;
  6354. }else if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E") {
  6355. messageBox("이미 마감된 환자입니다. 등록암 요율을 적용하거나 취소","E001");
  6356. return;
  6357. }
  6358. var msg = messageBox("이미 등록암 적용이 된 환자입니다. 기존에 적용된 유형을 취소","S001");
  6359. if(msg != 6) {
  6360. return;
  6361. }else{
  6362. if (fSaveMain("P") == true) {
  6363. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  6364. var suppkind = "00";
  6365. if (cfe == "E" || cfe == "F") {
  6366. suppkind = "33"; //차상위2종정상으로 셋팅
  6367. }
  6368. Insuchange(suppkind);
  6369. }
  6370. }
  6371. }
  6372. else if(chksuppkind != "06" && chksuppkind != "40" && chksuppkind != "31" && !(chkinsukind == "22" && chksuppkind == "08") ) { // 20090325 차상위적용 - 박창원 20100318 정승우 신생아유형은 제외추가
  6373. if (readonly == "Y") {
  6374. messageBox("읽기전용 모드입니다. 등록암 요율을 적용하거나 취소","E001");
  6375. return;
  6376. }
  6377. if (indschacptstat == "D") {
  6378. messageBox("이미 퇴원한 환자입니다. 등록암 요율을 적용하거나 취소","E001");
  6379. return;
  6380. }
  6381. if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E") {
  6382. messageBox("이미 마감된 환자입니다. 등록암 요율을 적용하거나 취소","E001");
  6383. return;
  6384. }
  6385. var msg = messageBox("등록암환자입니다. 중증요율 적용","S001");
  6386. if(msg !=6){
  6387. return;
  6388. }else{
  6389. if (fSaveMain("P") == true) {
  6390. var cfe = model.getValue("/root/main/item1/iteminfo/cfe");
  6391. var suppkind = "06";
  6392. if (cfe == "E" || cfe == "F") {
  6393. suppkind = "40"; // 차상위2종등록암으로 셋팅
  6394. }
  6395. Insuchange(suppkind);
  6396. }
  6397. }
  6398. }
  6399. }else if(vcode == "V191" || vcode == "V192"){
  6400. // 6시간 미만 환자는 화면을 보여주지 않는다. - 20081105 박창원
  6401. if (sixtimyn == "Y") {
  6402. messageBox("6시간 미만 상태 입니다. 중증수술 요율을 설정(저장) ","E001");
  6403. model.setValue("/root/hidden/sppij01900/cond/saveyn","Y");
  6404. }
  6405. if (trgtManWindow == null) {
  6406. open("SPPIJ01900" ,"", "10", "10", "SPPIJ01900","/root/hidden/sppij01900/cond", "/root/send/cond");
  6407. } else {
  6408. activateChild("SPPIJ01900");
  6409. model.refresh();
  6410. }
  6411. }
  6412. }
  6413. }
  6414. //퇴원마감취소
  6415. function fdschclosecancel() {
  6416. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6417. var tmpnotiyn;
  6418. var notichngflag = "N";
  6419. // 퇴원 마감 취소시 퇴원수납이 되었는지 실시한 확인 후 진행한다.
  6420. // 마감에서부터 취소사이에 수납에서 퇴원수납이 되었는데 마감취소가 되는 상황이 발생되지 않기 위함
  6421. // 퇴원수납이 된경우에는 대상자 조회 호면을 refresh 하고
  6422. // 메인화면의 심사상태를 'A' 미심상태로 하고 메인화면을 다시 로드- 20080927 박창원
  6423. model.makeValue("/root/send/checkyn","Y");
  6424. if (!submit("TRPIJ00315", false)) {
  6425. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6426. return;
  6427. }
  6428. var indschacptstat = model.getValue("/root/main/item11/endcnclstat/indschacptstat");
  6429. if (indschacptstat == 'D') {
  6430. messageBox("이미 퇴원처리가 된 환자입니다. 마감취소 ", "E001");
  6431. // 무조건 대상자 조회 화면을 refresh
  6432. var trgtManWindow = getChildWindow("SMPIJ00200");
  6433. trgtManWindow.javascript.fGetInBfJudgTrgtManList();
  6434. trgtManWindow.javascript.fCountPat();
  6435. trgtManWindow.model.refresh();
  6436. fGetItemInfo();
  6437. return;
  6438. }
  6439. if(chk){
  6440. var receiptyn = model.getValue("/root/main/item1/iteminfo/receiptyn");
  6441. var dschnotiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  6442. var dschdclrtyn = model.getValue("/root/main/item11/endcnclstat/dschdclrtyn");
  6443. var dschjudgprcsstat = model.getValue("/root/main/item11/endcnclstat/dschjudgprcsstat");
  6444. if (receiptyn != "" && dschnotiyn == "Y") {
  6445. messageBox("퇴원(가퇴원) 수납이 되었으므로 마감취소를","E001");
  6446. } else if (receiptyn == "" && (dschnotiyn == "Y" || ( dschjudgprcsstat == 'G' && dschdclrtyn == 'Y' ))) {
  6447. //DRG 상세 마감 취소 팝업
  6448. if (fGetDrgOpenPopup("O") == false) {
  6449. return false;
  6450. }
  6451. if ( dschnotiyn == "Y" ) {
  6452. // var msg = messageBox("간호의 퇴원확정여부도 함께 취소","S001");
  6453. // if(msg == 6){
  6454. // if (indschacptstat == "T") { // 가퇴원 블로킹 추가 - 20081005 박창원
  6455. // var msg1 = messageBox("가퇴원 상태에서는 간호확정 취소가 불가합니다. 계속진행","S001");
  6456. // if (msg1 != 6) {
  6457. // return;
  6458. // }
  6459. // } else {
  6460. // model.setValue("/root/main/item1/iteminfo/dschnotiyn","Z");
  6461. // }
  6462. // }else if(msg == 2){
  6463. // return;
  6464. // }
  6465. }
  6466. if (fJudgEndCancel()) {
  6467. if(fSaveCalcAmt("D")) {
  6468. } else {
  6469. messageBox("마감취소 처리가 되지","E007");
  6470. return 0;
  6471. }
  6472. } else {
  6473. messageBox("마감취소 처리가 되지","E007");
  6474. return 0;
  6475. }
  6476. if(model.getValue("/root/main/item1/iteminfo/dschnotiyn") == "Z"){
  6477. model.setValue("/root/main/item1/iteminfo/dschnotiyn","N");
  6478. notichngflag = "Y";
  6479. }
  6480. fJudgEndClear();
  6481. }
  6482. }
  6483. }
  6484. //종료
  6485. function fClear() {
  6486. // 심사상태를 미심상태로 바꾸고 대상자 조회를 리프레쉬 - 20081004 박창원
  6487. // 심사상태를 실시간 체크하여 심사상태가 심사중일때만 업데이트 되게 함 - 20081008 박창원
  6488. if (!submit("TRPIJ00315", false)) {
  6489. messageBox("실시간 환자상태 체크에 실패 했습니다.기본데이터 이상이나 시스템 오류입니다.관리자 문의 후", "C003");
  6490. return;
  6491. }
  6492. // 혹시모르는 종료버튼 클릭시 간호퇴원확정 취소를 막기위해 적용 - 20081008 박창원
  6493. var realnotiyn = model.getValue("/root/main/item11/endcnclstat/dschnotiyn");
  6494. var notiyn = model.getValue("/root/main/item1/iteminfo/dschnotiyn");
  6495. var readonly = model.getValue("/root/send/readonly");
  6496. if (notiyn == "Z") {
  6497. model.setValue("/root/main/item1/iteminfo/dschnotiyn", realnotiyn);
  6498. }
  6499. var dschjudgprcsstat = model.getValue("/root/main/item11/endcnclstat/dschjudgprcsstat");
  6500. if (dschjudgprcsstat == "B" && readonly != "Y") {
  6501. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","Z");
  6502. submit("TXPIJ00301");
  6503. }
  6504. // 2. 화면 클리어 (공통)
  6505. fJudgEndClear();
  6506. }
  6507. //중간청구마감
  6508. function fMidcomplete() {
  6509. // 20091126 JHP 수정추가
  6510. var chk = model.getValue("/root/main/item1/iteminfo/patnm");
  6511. var indd = model.getValue("/root/main/item1/iteminfo/indd");
  6512. var ans = 0;
  6513. if(chk){
  6514. if(ipt_pid.currentText.length >1){
  6515. if(indd.length>1){
  6516. if (!submit("TRPIJ00319", false )) {
  6517. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6518. return;
  6519. }
  6520. var noactyn = model.getValue("/root/main/item16/noactyn/noactyn");
  6521. if (noactyn == 'Y') {
  6522. modal("SPPIJ00900" ,"", "10", "10", "SPPIJ00900", "/root/main/item1/iteminfo/pid", "/root/send/send_pid/pid", "", "");
  6523. }
  6524. var trgtManWindow = getChildWindow("SMPID10100");
  6525. var patunitsrch1 = model.getValue("/root/main/item1/iteminfo/pid").getTrim(); // (stringHelper.js) 문자열 앞뒤에 있는 공백 제거
  6526. // 2008.01.23 박지욱 수정 (중간청구등록화면에 넘겨주는 데이터 추가 - pid, indd)
  6527. model.removenode("/root/hidden/midclam");
  6528. model.makeValue("/root/hidden/midclam/pid", patunitsrch1);
  6529. model.makeValue("/root/hidden/midclam/indd", model.getValue("/root/main/item1/iteminfo/indd"));
  6530. if (trgtManWindow == null) {
  6531. ans = messageBox("심사 마감 할 경우", "S001");
  6532. if (ans == 6) {
  6533. model.makeValue("/root/send/checkyn","Y");
  6534. if (!submit("TRPIJ00315", false )) {
  6535. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6536. return;
  6537. }
  6538. if (fGetDrgOpenPopup("O") == false) {
  6539. return false;
  6540. }
  6541. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","C");
  6542. if (submit("TXPIJ00301")) {
  6543. open("SMPID10100" ,"", "10", "10", "SMPID10100", "/root/hidden/midclam", "/root/hidden/midclam");
  6544. }
  6545. } else {
  6546. }
  6547. } else {
  6548. ans = messageBox("심사 마감 할 경우", "S001");
  6549. if (ans == 6) {
  6550. model.makeValue("/root/send/checkyn","Y");
  6551. if (!submit("TRPIJ00315", false)) {
  6552. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6553. return;
  6554. }
  6555. if (fGetDrgOpenPopup("O") == false) {
  6556. return false;
  6557. }
  6558. model.setValue("/root/main/item1/iteminfo/dschjudgprcsstat","C");
  6559. if (submit("TXPIJ00301")) {
  6560. activateChild("SMPID10100");
  6561. trgtManWindow.javascript.fGetMidClamList();
  6562. }
  6563. } else {
  6564. activateChild("SMPID10100");
  6565. trgtManWindow.javascript.fGetMidClamList();
  6566. }
  6567. }
  6568. model.refresh();
  6569. }
  6570. }
  6571. }
  6572. }
  6573. //중간청구마감
  6574. function fAccept() {
  6575. // 심사마감이나 퇴원한 환자는 요율변경을 할 수 없다. - 20080924 박창원
  6576. // 기존에는 심사마감이나 퇴원여부를 인스턴스에서 가져오던 것을 실시간 체크로 변경 - 20080927 박창원
  6577. if (!submit("TRPIJ00315", false)) {
  6578. messageBox("실시간 환자상태 체크에 실패 했습니다. 시스템 오류입니다.관리자 문의 후", "C003");
  6579. return;
  6580. }
  6581. // 오픈일 적용 - 20090302 박창원 - 하드코딩 제거 - 확산병원은 자료가 구축되어 있지 않기 때문에 오픈전까지 예외처리
  6582. var opendd = model.getValue("/root/main/item1/iteminfo/opendd");
  6583. var indschacptstat = model.getValue("/root/main/item1/iteminfo/indschacptstat");
  6584. var dschjudgprcsstat = model.getValue("/root/main/item1/iteminfo/dschjudgprcsstat");
  6585. // 중간청구, 읽기전옹 여부를 판단해서 블로킹 - 20081017 박창원
  6586. var lastmdlclamdd = model.getValue("/root/main/item1/iteminfo/lastmdlclamdd");
  6587. var fromdd = model.getValue("/root/main/item1/iteminfo/fromdd");
  6588. var readonly = model.getValue("/root/send/readonly");
  6589. if (lastmdlclamdd > fromdd && lastmdlclamdd > "20081003" && lastmdlclamdd != "" ) {
  6590. messageBox("중간청구 등록이 되어있습니다. 요율을 변경","E001");
  6591. grp_changeownbrate.visible = false;
  6592. return;
  6593. } else if (readonly == "Y") {
  6594. messageBox("읽기전용 모드에서는 요율을 변경","E001");
  6595. grp_changeownbrate.visible = false;
  6596. return;
  6597. } else if (indschacptstat == "D") {
  6598. messageBox("이미 퇴원한 환자입니다. 요율을 변경","E001");
  6599. grp_changeownbrate.visible = false;
  6600. return;
  6601. } else if (dschjudgprcsstat == "C" || dschjudgprcsstat == "E") {
  6602. messageBox("이미 마감된 환자입니다. 요율을 변경","E001");
  6603. grp_changeownbrate.visible = false;
  6604. return;
  6605. }
  6606. fChangeRate1();
  6607. }
  6608. //병용금기확인
  6609. function fUseincombinationtaboo() {
  6610. // 20091126 수정추가 JHP 병용금기내역 확인
  6611. var prcsyn = messageBox("병용금기확인시 계산내역에 따라 일부 시간이 지연될수 있습니다.\n\n","Q003");
  6612. if(prcsyn == "6"){
  6613. var pid = model.getValue("/root/main/item1/iteminfo/pid");
  6614. if(pid == "" || pid == null || pid == " "){
  6615. }else{
  6616. submit("TRPIJ00318");
  6617. var nodecnt = getNodesetCount("/root/hidden/useincombinationtaboo/list");
  6618. if(nodecnt > 1){
  6619. var seeyn = messageBox("병용금기내역이 존재합니다. 확인","Q005");
  6620. if(seeyn == "6"){
  6621. grp_taboo.attribute("left") = "420px";
  6622. grp_taboo.attribute("top") = "525px";
  6623. grp_taboo.attribute("width") = "508px";
  6624. grp_taboo.attribute("height") = "199px";
  6625. grp_taboo.visible = true;
  6626. }else{
  6627. }
  6628. }else{
  6629. messageBox("병용금기내역이 존재하지 ","I011");
  6630. }
  6631. }
  6632. }
  6633. }
  6634. //심사변경유무 체크 확인
  6635. function fCheckChngStatus() {
  6636. var rslt = true;
  6637. var judgrmk = model.getValue("/root/main/item1/iteminfo/judgrmk");
  6638. var edirmk = model.getValue("/root/main/item1/iteminfo/edirmk");
  6639. var tstrmk = model.getValue("/root/main/item1/iteminfo/tstrmk");
  6640. var judgrmk_orign = model.getValue("/root/main/item1/iteminfo/judgrmk_orign");
  6641. var edirmk_orign = model.getValue("/root/main/item1/iteminfo/edirmk_orign");
  6642. var tstrmk_orign = model.getValue("/root/main/item1/iteminfo/tstrmk_orign");
  6643. /* for (var i = 1; i < grd_diaglist.rows; i++) {
  6644. if (grd_diaglist.rowstatus(i) != 0 && grd_diaglist.valueMatrix(i, grd_diaglist.colRef("diagcd")) != "" && grd_diaglist.valueMatrix(i, grd_diaglist.colRef("diagcd")) != "") {
  6645. rslt = false;
  6646. }
  6647. }*/
  6648. for (var i = 1; i < grd_clcjlist.rows; i++) {
  6649. if (grd_clcjlist.rowstatus(i) != 0 && grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("edicd")) != "" && grd_clcjlist.valueMatrix(i, grd_clcjlist.colRef("spclcd")) != "") {
  6650. rslt = false;
  6651. }
  6652. }
  6653. if (judgrmk != judgrmk_orign) {
  6654. rslt = false;
  6655. }
  6656. if (edirmk != edirmk_orign) {
  6657. rslt = false;
  6658. }
  6659. if (tstrmk != tstrmk_orign) {
  6660. rslt = false;
  6661. }
  6662. return rslt;
  6663. }
  6664. function fOpenSPPIJ03800(){
  6665. var cond = "/root/hidden/SPPIJ03800_cond";
  6666. var ref = "/root/main/item1/iteminfo";
  6667. var send = "/root/send";
  6668. model.makevalue(cond+"/pid", model.getValue(ref+"/pid"));
  6669. model.makevalue(cond+"/cretno", model.getValue(ref+"/cretno"));
  6670. model.makevalue(cond+"/orddd", model.getValue(ref+"/fromdd"));
  6671. model.makevalue(cond+"/ordtodd", model.getValue(ref+"/todd"));
  6672. fLinkPopMenu("SPPIJ03800", cond, send, "modal");
  6673. }
  6674. function responseHandlerTRPIJ00322() {
  6675. if (getNodesetCount("/root/chklist/goso") > 0) {
  6676. messageBox("외출외박 24시간 초과된 완화의료 대상 환자입니다. 해당 일자의 입원료를", "I007")
  6677. }
  6678. }