1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292 |
- /*
-
- 응급실 퇴실정리(SMMNE00200.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
-
- var xPathInddPationList = "/root/main/inddpatlist/inddpatinfo";
- var xPathMainCondNode = "/root/main/condition";
- function fInit(){
- zbcfGetCodeList( new Array("M0011", "M0535"), new Array("/root/init/M0011list", "/root/init/M0535list") );
- //16.01.04_간호하드코드 추가
- fGetNursHardCdInfo("'E27'", getCurrentDate());
- fInitialize();
- }
- /**
- * @group :
- * @ver : 2007.06.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기 화면 설정(기초 정보 설정)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
-
- if(getUserInfo("userid") == "ENR") {
- button6.visible = true;
- } else {
- button6.visible = false;
- }
-
- //16.10.19_칠곡 지역센터 승격으로 본원/칠곡 동시 적용
- /*
- //15.12.28_AYS 최종진료구역 본원만 활성화
- if(getUserInfo("dutplceinstcd") == "031") {
- caption23.visible = true;
- cmb_outarea.visible = true;
- } else {
- caption23.visible = false;
- cmb_outarea.visible = false;
- }
- */
- //15.12.28_AYS 최종진료구역 본원만 활성화
- //16.10.19_칠곡 지역센터 승격으로 본원/칠곡 동시 적용
-
- fInotSetNode();
- model.removenode("/root/send");
- model.makeValue("/root/send/searchitem", "outrm");
- model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
- model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
- model.setValue("/root/main/condition/researchflag", "N");
- grd_patlist.rebuildStyle();
- submit("TRMNE00203");
- fGetPatList();
-
- }
- /**
- * @group :
- * @ver : 2007.06.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 현재 시간 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fTimeSetting(){
- var d, s= "" ,t;
- d = new Date();
- if( d.getMinutes() >= 10 ) {
- if(d.getHours() >= 10 ) {
- t = d.getHours() + "" + d.getMinutes();
- } else {
- t = "0" + d.getHours() + "" + d.getMinutes();
- }
- } else {
- if(d.getHours() >= 10 ) {
- t = d.getHours() + "0" + d.getMinutes();
- } else {
- t = "0" + d.getHours() + "0" + d.getMinutes();
- }
- }
- return t;
- //model.setValue("/root/main/condition/outrmtm", t );
- }
-
- /**
- * @group :
- * @ver : 2007.06.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 재원 환자 조회 부분
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetPatList(){
- var sSrchData = "";
- var sSrchHeader = "section▩";
- var sSrchData = model.getValue("/root/main/condition/section")+"▩";
-
- model.removenode("/root/send");
- model.makeValue("/root/send/searchinfo", sSrchHeader + sSrchData);
- grd_patlist.allstyle("all", "background-color") = "white";
- submit("TXMNE00201");
-
- var tRow = grd_patlist.rows;
- for(i= 0 ; i < tRow ; i ++ ){
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+i+"]/dschdclrtyn") == "Y"){
- //퇴원예고 환자에 대해 셀 색상 지정
- grd_patlist.cellstyle("background-color", i, 0, i, 4) = "#ffd3ff";
- }
- }
- fGetParamSetting();
- fChangeFocusColor();
- //model.refresh();
- }
-
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 노드 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInotSetNode(){
- //model.removeNodeset("/root/main/inddpatlist/inddpatinfo");
- model.removeNodeset("/root/main/incplist/testinfo" );
- model.removeNodeset("/root/main/incplist/inginfo" );
- }
-
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 상단 퇴실 조건 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitSettingTop(flag){
- if(flag =="A"){
- model.setValue("/root/main/condition/section", "-");
- }
- //top 환자정보 초기화
- model.setValue("/root/main/condition/t_patinfo" , "");
- model.setValue("/root/main/condition/t_chosdt" , "");
- model.setValue("/root/main/condition/t_outrmdt" , "");
- model.setValue("/root/main/condition/t_calctm" , "");
- model.setValue("/root/main/condition/t_assgroom" , "");
- model.setValue("/root/main/condition/t_fstexamorddd" , "");
-
- //퇴원조건 부분 초기화
- model.setValue("/root/main/condition/outrmtp" , "");
- model.setValue("/root/main/condition/chnghospnm" , "");
- model.setValue("/root/main/condition/outrmcd" , "");
- model.setValue("/root/main/condition/dethdd" , "");
- model.setValue("/root/main/condition/dethtm" , "");
- model.setValue("/root/main/condition/pid" , "");
- model.setValue("/root/main/condition/healcaretgdyn" , "");
- model.setValue("/root/main/condition/proceraprvyn" , "");
-
- caption1.attribute("visibility") = "hidden"; // 마약 - 검사
- caption2.attribute("visibility") = "hidden"; // 전원병원
- //caption2.attribute("text") = "세부사항";
- caption4.attribute("visibility") = "hidden"; // 사망일시
- caption6.attribute("visibility") = "hidden"; // 퇴실정리
- ipt_chnghosnm.attribute("visibility") = "hidden";
- ipt_dethtm.attribute("visibility") = "hidden";
- ipt_dethdd.attribute("visibility") = "hidden";
- cmb_outrmcd.attribute("visibility") = "hidden";
- cmb_etc.attribute("visibility") = "hidden";
- chk_proceraprvyn.attribute("visibility") = "hidden";
- chk_healcaretgdyn.attribute("visibility") = "hidden";
- ipt_outrmetc.attribute("visibility") = "hidden";
- ipt_chnghospchoi.attribute("visibility") = "hidden";
-
- caption20.attribute("visibility") = "hidden";
- cmb_dschhosptype.attribute("visibility")= "hidden";
-
- model.makeValue("/root/main/condition/chnghospchoi", "");
-
-
- model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
-
- }
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 응급실 처방 조회 key설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetPatInfo(){
- var iRow = grd_patlist.row;
-
- var sSrchData = "";
- var sSrchHeader = "pid▦indd▦cretno▦instcd▦dschdclrdt▩";
- var sSrchData = model.getValue(xPathInddPationList+"["+iRow+"]/pid" )+"▦"
- + model.getValue(xPathInddPationList+"["+iRow+"]/indd" )+"▦"
- + model.getValue(xPathInddPationList+"["+iRow+"]/cretno")+"▦"
- + model.getValue(xPathInddPationList+"["+iRow+"]/instcd")+"▦"
- + model.getValue(xPathInddPationList+"["+iRow+"]/dschdclrdt")+"▩";
-
- model.removeNodeset("/root/send");
- return sSrchHeader + sSrchData;
- }
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 응급실 재원환자 선택 검사/약,주사 처방 조회&
- * 투약저장 정보 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectInddPatList(pFlag){
-
- // 검사, 약/주사 처방 조회
- if(pFlag == "S"){
- model.makeValue("/root/send/searchpat", fSetPatInfo() );
- model.setValue("/root/main/condition/researchflag", "N");
- }
-
- // 투약저장 정보 조회
- if(pFlag == "R"){
- if(model.getValue("/root/main/condition/researchflag") == "N"){
- model.makeValue("/root/send/researchpat",sSrchHeader+sSrchData );
- model.setValue("/root/main/condition/researchflag", "I");
- } else {
- model.makeValue("/root/send/searchpat", sSrchHeader+sSrchData );
- model.setValue("/root/main/condition/researchflag", "N");
- }
- }
-
- //grd_inglist.allstyle("all", "background-color") = "white";
-
- submit("TXMNE00202");
- grd_inglist.rebuildStyle();
-
- var tRow = grd_inglist.rows;
-
- for(i= 0 ; i < tRow ; i ++ ){
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
- //퇴원약 약 확인
- grd_inglist.cellstyle("background-color", i, 0, i, 21) = "#ccffff";
- }
- }
- //model.refresh();
- }
-
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 응급실퇴실정리 화면 콤포 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelctionOutRmCombo(pFlag){
-
- model.removeNodeset("/root/hidden/item");
-
- for(i=1; i <= getNodesetCount("/root/init/erbaselist/outrminfo");i++ ) {
- if(model.getValue("/root/init/erbaselist/outrminfo["+i+"]/supbasetypecd") == pFlag ){
- model.makeValue("/root/hidden/item["+i+"]/label", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/typenm"));
- model.makeValue("/root/hidden/item["+i+"]/value", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/basetypecd"));
- }
- }
- cmb_outrmcd.refresh();
- }
-
- function fSelctionInRmCombo(pFlag){
- model.removeNodeset("/root/hidden2/item");
-
- for(i=1; i <= getNodesetCount("/root/codeinfo/codeinfo/codelist");i++ ) {
- if(model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/supcdid") == pFlag ){
- model.makeValue("/root/hidden2/item["+i+"]/label", model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/cdnm"));
- model.makeValue("/root/hidden2/item["+i+"]/value", model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/cdid"));
- }
- }
- cmb_outhsrt.refresh();
- }
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면상단정보설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetParam(){
- // 응급환자 화면상단정보 설정
- if(grd_patlist.row < 1){
- return;
- } else {
- var sPid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid" );
- var sIndd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd" );
- var sCretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno" );
- var sInstcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd" );
-
- var param = "E▦"
- + sPid + "▦"
- + sIndd + "▦"
- + sCretno + "▦"
- + sInstcd + "▦"
- + "▦" ;
-
- setParameter("condparam", param);
-
- modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
- }
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 응급실 퇴실처리
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOutRmTret(){
- var flag = model.getValue(rdo_outrmflag.attribute("ref"));
- //var iRow = grd_patlist.row;
- var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, true);
-
- // 환자 선택 여부 체크
- if(model.getValue("/root/main/condition/pid") == "" ) {
- messageBox("환자가 선택되지", "E007");
- model.setFocus("grd_patlist");
- return;
- }
-
- // 입원으로 인한 퇴원 배정 병실 체크
- if(model.getValue("/root/main/condition/outrmtp") =="2" &&
- model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/assgroom") == ""){
- messageBox("입원 병실 배정이 되지 않았습니다.","E");
- return;
- }
-
- // 환자 퇴원예고 상태 체크
- if(( model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/dschdclrtyn") == "N" ||
- model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/dschdclrtyn") == "" ) &&
- model.getValue("/root/main/condition/outrmtp") != "2" ){
- messageBox("퇴원예고 환자가 아닙니다.", "E");
- model.setFocus("grd_patlist");
- return;
- }
- // P-Pneumonia 환자의 간호정보조사지 산소포화도 입력 여부 확인
- if( model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/oxyconcen") == "-" &&
- model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/recovwardcd") == "05" ) {
- messageBox("폐렴 대상자 입니다. 응급간호정보조사의 산소포화도를 기록하십시오 ","E");
-
- fSetParam("nm");
- modal("SMMNE04300","1","15","128");
-
- fGetPatList();
- fSelectPatList();
- return;
-
- }
-
- // 미확인 처방 체크 (2008.10.16)
- //if ((model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/uncnfmcnt") != "0")) {
- // messageBox("미확인 처방이 있습니다. Order Manage에서 처리하시기 바랍니다.", "E");
- // model.setFocus("grd_patlist");
- // return;
- //}
-
- // 퇴실일시 입력 체크
- if(model.getValue("/root/main/condition/outrmdd") == "" ||
- model.getValue("/root/main/condition/outrmtm")== ""){
- messageBox("퇴실일시를 입력하십시요.", "E");
- model.setFocus("ipt_outrddd");
- return;
- }
-
- // 퇴실일시 내원일시 비교 체크
- var eroutdt = model.getValue("/root/main/condition/outrmdd")
- + model.getValue("/root/main/condition/outrmtm");
-
- if(model.getValue("/root/main/condition/t_chosdt") > eroutdt ) {
- //messageBox("내원/퇴원 일시를 확인하십시요", "E");
- messageBox("퇴실일시는 내원일시 이후로 지정해야합니다.", "E");
- model.setFocus("ipt_outrdtm");
- return;
- }
-
- // 퇴실일시 초진진료일시 비교 체크 ('15.10.26 추가)
- if(model.getValue("/root/main/condition/t_fstexamorddd") > eroutdt ) {
- messageBox("퇴실일시는 초진진료일시 이후로 지정해야합니다.", "E");
- return;
- }
-
- // 퇴실일시 관련 제어
- var nowDate = fTimeSetting();
- var dd = getCurrentDate();
- var currentdt = dd + nowDate;
-
- if (eroutdt > currentdt) {
- messageBox("퇴실일시가 미래일시 입니다.", "E");
- model.setFocus("ipt_outrdtm");
- return;
- }
-
- // 퇴실구분 입력 체크
- if(model.getValue("/root/main/condition/outrmtp") == ""){
- messageBox("퇴실구분을 선택하십시요.", "E");
- model.setFocus("rdo_outrmflag");
- return;
- }
-
- // 세부사항 입력 체크
- if(model.getValue("/root/main/condition/outrmcd") == ""){
- messageBox("세부사항을 입력하십시요.", "E");
- model.setFocus("cmb_outrmcd");
- return;
- }
-
- // 사망일시 입력 체크
- if(model.getValue("/root/main/condition/outrmtp") == 6){
- if(model.getValue("/root/main/condition/dethdd") == "" ||
- model.getValue("/root/main/condition/dethtm") == "" ){
- messageBox("사망일시를 입력하십시요.", "E");
- model.setFocus("ipt_dethdd");
- return;
- }
- }
-
- // 161019_칠곡 센터승격으로 인한 수정_AYS
- // 최종진료 구역 체크('15.12.22 - AYS 추가)
- if(model.getValue("/root/main/condition/outarea") == ""){
- //if(model.getValue("/root/main/condition/outarea") == "" && model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") == "031"){
- messageBox("최종진료구역을 입력하십시요.", "E");
- model.setFocus("cmb_outarea");
- return;
- }
-
- // 161019_칠곡 센터승격으로 인한 수정_AYS
- // 입원세부 사항 체크('15.12.22 - AYS 추가)
- if(model.getValue("/root/main/condition/outrmtp") == 2){
- //if(model.getValue("/root/main/condition/outrmtp") == 2 && model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") == "031"){
- if(model.getValue("/root/main/condition/outhsrt") == ""){
- messageBox("입원세부 사항을 입력하십시요.", "E");
- model.setFocus("cmb_outhsrt");
- return;
- }
- }
-
- //퇴실구분(전원), 세부사항(기타다른사유로전원)일때 기타사유값 유무체크
- if(model.getValue("/root/main/condition/outrmtp") == 3){
- if(model.getValue("/root/main/condition/outrmcd") == "28") {
- if(model.getValue("/root/main/condition/chnghospchoi") =="") {
- messageBox("기타사유를 입력하십시요.", "E");
- model.setFocus("ipt_chnghospchoi");
- return;
- }
- }
- //전원병원구분 입력값 체크 추가
- if(model.getValue("/root/main/condition/dschhosptype") =="") {
- messageBox("전원병원 구분을 입력하십시요.", "E");
- model.setFocus("cmb_dschhosptype");
- return;
- }
-
- //응급당직의 SMS 발송
- fTransferSMS();
- }
-
- // 퇴실구분:귀가 and 세부사항: 기타다른상태로 귀가시 ==> 기타사유 입력 체크
- if( (model.getValue("/root/main/condition/outrmtp") == 1) && (model.getValue("/root/main/condition/outrmcd") == 18) ){
- if(model.getValue("/root/main/condition/outrmetc") == "" ){
- messageBox("기타사유를 입력하십시요.", "E");
- model.setFocus("ipt_outrmetc");
- return;
- }
- }
- //미시행 검사 처방 존재 여부 체크
- // var chktest = "Y";
- // for(i=1; i <= getNodesetCount("/root/init/erbaselist/outrminfo");i++ ) {
- // if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
- // chktest = "N";
- // }
- // }
- //
- // if( chktest == "N" ){
- // if ( model.getValue("/root/main/condition/outrmtp") == "2" ) {
- // var vbYes = messageBox("미시행 검사 처방이 존재합니다.","Q003");
- // if( vbYes != 6 ){
- // return;
- // }
- // }else{
- // messageBox("미시행 검사처방이 존재합니다.", "E");
- // model.setFocus("grd_testlist");
- // return;
- // }
- // }
-
- //미시행 약,주사 처방 존재 여부 체크
- var chking = "";
- for(i=1; i <= getNodesetCount("/root/main/incplist/inginfo"); i++ ) {
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ){
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
- chking = "OUT";
- }else{
- chking = "N";
- }
- }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "DC"){
- chking = "DC";
- }
- }
-
- if(chking == "OUT"){
- messageBox("퇴원약확인을 하지 않은 퇴원처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
- model.setFocus("btn_drugsave");
- return;
- }
-
- if(chking == "N"){
- messageBox("미시행 약/주사 처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
- model.setFocus("grd_inglist");
- return;
- }
-
- if(chking == "DC"){
- messageBox("반환요청 약/주사 처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
- model.setFocus("grd_inglist");
- return;
- }
- //퇴원후 외래 처방 체크 & 미시행 검사처방 체크
- var sOutPrcp = "";
- var sDefineCnt = 0;
- for(i=1 ; i < grd_testlist.rows ; i++){
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT" ){
- if(sOutPrcp == ""){
- sOutPrcp = "퇴원 후 외래 처방이 존재합니다.";
- }
- sOutPrcp += "\n" + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm") ;
- }else{
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "-"){
- sDefineCnt++;
- }
- }
- }
-
- if(sDefineCnt > 0){
- if(model.getValue("/root/main/condition/outrmtp") == "2"){
- messageBox(sDefineCnt+" 건의 상태 미설정 데이터가 존재합니다.\n미정설 데이터는 병동이관 됩니다.", "I");
- }else{
- messageBox("미시행 검사처방이 존재합니다.", "E");
- model.setFocus("grd_testlist");
- return;
- }
- }
-
-
- /* 2013.03.18 KJS 정보위원회 요청에 의해 수술료 체크 로직 삭제
- //-----------(20110228) 경북대
- // 수술료체크
- // * @desc : 체크기능(병동퇴실/응급실퇴실/dsc퇴실)
- // 환자정보 조회
- //model.removeNodeSet(xPatInfoPath);
- //var sPamInfo = getGlobalVariable("paminfo");
- //setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist"); //환자정보내리기
- //내려받기
- model.removenode("/root/main/paminfo");
- model.makeNode("/root/main/paminfo");
- var node = getGlobalVariable("paminfo");
- setCSVToNode("/root/main/paminfo", node);
-
- //체크
- var sschk = model.getValue("/root/main/paminfo/list/opfeechkyn"); //수술료체크여부
- var sspid = model.getValue("/root/main/paminfo/list/pid");
- var ssindd = model.getValue("/root/main/paminfo/list/indd");
- var ssdschdd = model.getValue("/root/main/condition/outrmdd"); //퇴원예정일
- //alert(sschk + "/" +sspid + "/" + ssindd + "/" + ssdschdd);
- if (sschk != "Y") {
- messageBox("다음팝업창에서 수술료여부 항목의 'N' 인 경우에 대한 수술료 입력을 의료진에 요청하십시오.", "E");
-
- setParameter("SPMMO21600_param", sspid + "|" + ssindd + "|" + ssdschdd )
- modal("SPMMO21600");
- clearParameter("SPMMO21600_param");
- return ;
- }
- //-----------(20110228) 경북대
- */
-
- var vbYes = messageBox("퇴실처리를 ", "Q004");
- if(vbYes == 6){
- clearParameter("SMMNE09300_pid");
- clearParameter("SMMNE09300_orddd");
- clearParameter("SMMNE09300_cretno");
- clearParameter("SMMNE09300_outrmcd");
- clearParameter("SMMNE09300_outrmdt");
-
- setParameter("SMMNE09300_pid", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid")) );
- setParameter("SMMNE09300_orddd", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("indd")) );
- setParameter("SMMNE09300_cretno", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("cretno")) );
- setParameter("SMMNE09300_outrmcd", cmb_outrmcd.label );
- setParameter("SMMNE09300_outrmdt", model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") );
-
- if (cmb_outrmcd.label == "") {
- messageBox("퇴실구분을 입력하세요", "E999");
- return;
- }
-
- if (model.getValue("/root/main/condition/outrmdd") == "" || model.getValue("/root/main/condition/outrmtm") == "") {
- messageBox("퇴실구분을 입력하세요", "E999");
- return;
- }
-
- //2013.11.27 KJS 응급간호요약지
- //modal("SMMNE09300");
-
- //응급관리료 체크
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/g3existyn") == "N"){
- var vbNo = messageBox("응급의학료 관리료 처방이 없습니다. 계속 퇴원진행을 ", "Q004");
- if(vbNo == 7){
- return;
- }
- }
-
- //퇴원후 외래 처방 확인 메시지
- if(sOutPrcp != ""){
- messageBox(sOutPrcp, "I");
- }
-
- //퇴원결정일시 셋팅(입원 : 입원결정일시 , 기타 : 퇴원예고일시)
- var dschdclrdt = "";
- if(rdo_outrmflag.value == "2"){
- dschdclrdt = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/inrsrvacptdt");
- }else{
- dschdclrdt = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/dschdclrdt");
- }
-
- // 2009-05-21 YCD TRIAGE 입력 데이터 검증 부분 추가
- var chktrnValue = fChkTriageData(iRow);
- if( chktrnValue == "false" || chktrnValue == "" ){
- return;
- }
-
- fChkOcrPrntList(iRow);
-
- //정상 퇴실시 type2 기록 parameter 설정
- var sTar_pid = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" );
- var sTar_indd = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" );
- var sTar_cretno = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" );
- var sTar_instcd = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/instcd" );
-
-
- var sChnghospnm = model.getValue("/root/main/condition/chnghospnm");
- var sChnghospcd = model.getValue("/root/main/condition/chnghospcd");
- var sChnghospnmetc = model.getValue("/root/main/condition/chnghospnmetc");
-
- if (sChnghospnm == "기타" && sChnghospnmetc != "") {
- sChnghospnm = sChnghospnmetc;
- /*if (sChnghospcd == "") {
- sChnghospcd = "H900000" + model.getValue("/root/main/condition/dschhosptype");
- }*/
- }
-
- var sSrchData = "";
- var sSrchHeader = "pid▦indd▦cretno▦visitno▦outrmdd▦outrmtm▦outrmcd▦chnghospnm▦chnghospcd▦dethdd▦dethtm▦dethyn▦healcaretgdyn▦proceraprvyn▦chnghospchoi▦eroutdt▦instcd▦dschdclrdt▦outrmtp▦outrmetc▦dschhosptype▦outarea▦outhsrt▩";
- var sSrchData = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" )+"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" )+"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" )+"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/visitno" )+"▦"
- + model.getValue("/root/main/condition/outrmdd" )+"▦"
- + model.getValue("/root/main/condition/outrmtm" )+"▦"
- + model.getValue("/root/main/condition/outrmcd" )+"▦"
- + sChnghospnm +"▦"
- + sChnghospcd +"▦"
- + model.getValue("/root/main/condition/dethdd" )+"▦"
- + model.getValue("/root/main/condition/dethtm" )+"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/dethyn" )+"▦"
- + model.getValue("/root/main/condition/healcaretgdyn" )+"▦"
- + model.getValue("/root/main/condition/proceraprvyn" )+"▦"
- + model.getValue("/root/main/condition/chnghospchoi" )+"▦"
- + eroutdt +"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/instcd" )+"▦"
- + dschdclrdt +"▦"
- + model.getValue("/root/main/condition/outrmtp" )+"▦"
- + model.getValue("/root/main/condition/outrmetc" )+"▦"
- + model.getValue("/root/main/condition/dschhosptype" )+"▦"
- + model.getValue("/root/main/condition/outarea" )+"▦"
- + model.getValue("/root/main/condition/outhsrt" )+"▩";
- //+ "er"+
-
- model.removenode("/root/send");
- model.makeValue("/root/send/outrmtret", sSrchHeader + sSrchData);
-
- var sSrchData = "";
- var sSrchHeader = "section▩";
- var sSrchData = model.getValue("/root/main/condition/section")+"▩";
-
- model.makeValue("/root/send/searchinfo", sSrchHeader + sSrchData);
-
- //선택 행 셀 색상 초기화
- //grd_patlist.allstyle("all", "background-color") = "white";
-
- model.makeValue("/root/temp/printinfo/erordeptnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("erordeptnm" )));
- model.makeValue("/root/temp/printinfo/patnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("patnm" )));
- model.makeValue("/root/temp/printinfo/pid" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid" )));
- model.makeValue("/root/temp/printinfo/chosdt" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("chosdt" )));
- model.makeValue("/root/temp/printinfo/dschdclrdt" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("dschdclrdt" )));
- model.makeValue("/root/temp/printinfo/outdt" , ipt_outrddd.value + ipt_outrmtm.value);
- model.makeValue("/root/temp/printinfo/ermedispclnm", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("ermedispclnm")));
- model.makeValue("/root/temp/printinfo/nursnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("nursnm" )));
- model.makeValue("/root/temp/printinfo/curdd" , getCurrentDate());
-
- var instcd = getUserInfo("dutplceinstcd");
- var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid");
- var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd");
- var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno");
- var prewardcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/prewardcd");
- var chngwardcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/wardcd");
-
- //alert(pid);
-
- if(submit("TXMNE00201", false)== true){
- //퇴실결과가 입원인 경우 타부서 미수행 진료재료 이관 2013.12.18 KJS
- if (model.getValue("/root/main/condition/outrmtp") == "2") {
- model.removenode("/root/send/prcpinfo");
- model.makeValue("/root/send/prcpinfo/instcd", instcd);
- model.makeValue("/root/send/prcpinfo/pid", pid);
- model.makeValue("/root/send/prcpinfo/indd", indd);
- model.makeValue("/root/send/prcpinfo/cretno", cretno);
- model.makeValue("/root/send/prcpinfo/prewardcd", prewardcd);
-
- submit("TRMNW01307");
-
- if(model.getValue("/root/main/prcpinfo/prcpyn") == "Y"){ // 부서이관 할 처방이 있는경우
- setParameter("PARAM1", instcd);
- setParameter("PARAM2", pid);
- setParameter("PARAM3", indd);
- setParameter("PARAM4", cretno);
- setParameter("PARAM5", prewardcd);
- setParameter("PARAM6", chngwardcd);
-
- open("SPMNW19001","1", "900", "450");
- }
- }
-
-
- if(flag != "2") {
-
- //model.copyNode("/root/temp/printinfo/rsrvinfo", model.getValue("/root/main/rsrvinfo"));
- model.makeNode("/root/temp/printinfo/rsrvinfo");
- copyNodesetType("/root/temp/printinfo/rsrvinfo", "/root/main/rsrvinfo");
- exeReportPreview("RPMNE00120","XMLSTR","/root/temp/printinfo", "", "true", "", "", "", "", "true", "", "", "", "");
- }
-
- TextStmtInfo = "";
- //20111208_KNUH_Start 간호일지 내역 부분 수정.
- //Type2 저장 부분
- if(model.getValue("/root/main/condition/outrmtp") == "1"){
- TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl");
- if(cmb_outrmcd.value == "18"){
- TextStmtInfo = cmb_outrmcd.label + "(" + model.getValue("/root/main/condition/outrmetc") + ")" ;
- }
- TextStmtInfo += ". 응급실 퇴실함.";
- }else if(model.getValue("/root/main/condition/outrmtp") == "3"){
- TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl");
- if(cmb_outrmcd.value == "28"){
- TextStmtInfo += "(" + ipt_chnghospchoi.value + ")" ;
- }
- TextStmtInfo += ". 응급실 퇴실함.";
- if(cmb_dschhosptype.label != ""){
- TextStmtInfo += "\n병원구분 : " + cmb_dschhosptype.label;
- }
- if(ipt_chnghosnm.value != ""){
- TextStmtInfo += " 병원명 : " + ipt_chnghosnm.value;
- }
- }else if(model.getValue("/root/main/condition/outrmtp") == "9"){
- TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
- }else if (model.getValue("/root/main/condition/outrmtp") == "8"){
- TextStmtInfo = ipt_chnghospchoi2.value + ". 응급실 퇴실함.";
- }else if (model.getValue("/root/main/condition/outrmtp") == "6"){
- TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
- } else{
- TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
- }
- //20111208_KNUH_End 간호일지 내역 부분 수정.
- setParameter("SMMNR03400_ParamBase", "recflag▦dutplaccd▦reclnkkey▩E▦010▦"+ sTar_pid + "," + sTar_indd + "," + sTar_cretno + "," + sTar_instcd+"▩");
- setParameter("SMMNR03400_ParamSaveText", "S▦A▦"+ipt_outrddd.value+ipt_outrmtm.value+"▦"+TextStmtInfo+"▩");
- modal("SMMNR03400");
-
- grd_patlist.rebuildStyle();
- ipt_chnghospchoi2.visible = false;
- fInitSettingTop();
- sTar_pid = "";
- sTar_indd = "";
- sTar_cretno = "";
- sTar_instcd = "";
-
- fInotSetNode();
- }else {
- //model.removeNodeset("/root/main/inddpatlist/inddpatinfo");
- //fGetPatList();
- //grd_patlist.rebuildStyle();
- fInotSetNode();
- }
-
- //var tRow = grd_patlist.rows;
-
- //for(i= 0 ; i < tRow ; i ++ ){
- // if(model.getValue("/root/main/inddpatlist/inddpatinfo["+i+"]/dschdclrtyn") == "Y"){
- // //퇴원예고 환자에 대해 셀 색상 지정
- // grd_patlist.cellstyle("background-color", i, 0, i, 4) = "#ffd3ff";
- // }
- //}
-
- fGetPatList();
- fSelectPatList();
-
- if(sTar_pid != ""){
- grd_patlist.row = grd_patlist.findRow(sTar_pid, 0, grd_patlist.colRef("pid"));
- grd_patlist.topRow = grd_patlist.row;
- }
- }else{
- return;
- }
- }
- /**
- * @group :
- * @ver : 2009.07.02
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 응급실 퇴실환자 재증명 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChkOcrPrntList(iRow){
- var ErOcrChkRtnValue = "true";
- model.removenode("/root/send");
-
- model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" ));
- model.makeValue("/root/send/reqdata/orddd" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" ));
- model.makeValue("/root/send/reqdata/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" ));
-
- submit("TRMNE00205", false);
-
- mesgcnt = 0 ;
- var sMsgCmmt = "";
- if(getNodesetCount("/root/init/ocrchkinfo/ocrchklist") > 0 ){
- for(var i = 1 ; i <= getNodesetCount("/root/init/ocrchkinfo/ocrchklist") ; i++){
- if(model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/eroutchkocr") == "Y"){
- mesgcnt++;
- }
- sMsgCmmt = model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/ocrfromrecdeptnm") + "에서 작성한 "
- + model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/ocrformnm") + "가(이) 있습니다. 확인하십시오.\n\n"
- }
- }
-
- if(rdo_outrmflag.value == "3" && mesgcnt == 0){
- messageBox("전원소견서 작성 내역이 존재하지 않습니다. 확인하십시요!" , "C000");
- }
-
- if(sMsgCmmt != ""){
- messageBox(sMsgCmmt , "I000");
- }
- }
- /**
- * @group :
- * @ver : 2009.05.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : TRIAGE 입력 데이터 검증 부분 추가
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChkTriageData(iRow){
- var ErOutChkRtnValue = "true";
- model.removenode("/root/send");
-
- model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" ));
- model.makeValue("/root/send/reqdata/orddd" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" ));
- model.makeValue("/root/send/reqdata/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" ));
- model.makeValue("/root/send/reqdata/chosdt" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/chosdt" ));
- model.makeValue("/root/send/reqdata/eroutdt" , ipt_outrddd.value + ipt_outrmtm.value + "00");
- model.makeValue("/root/send/reqdata/queryflag" , "K");
-
- /*
- model.makeValue("/root/send/reqdata/pid" , "19509091");
- model.makeValue("/root/send/reqdata/orddd" , "20081003");
- model.makeValue("/root/send/reqdata/cretno" , "1");
- model.makeValue("/root/send/reqdata/queryflag" , "K");
- */
-
-
- submit("TRMNE04403", false);
- if(getNodesetCount("/root/main/ertriage/ertriage") < 1 ){
- messageBox("TRIAGE 기록이 존재하지 않습니다.", "E");
- return "false";
- }
-
- var ce_chosdt = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt" ); //내원일시
- var ce_pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid" ); //환자번호
- var ce_indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd" ); //입원일자
- var ce_cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno" ); //생성번호
- var ce_instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd" ); //기관코드
- var ce_outrmcd = model.getValue("/root/main/condition/outrmtp" ); //퇴실구분
- var ce_outrmdt = model.getValue("/root/main/condition/outrmdd" ) //퇴실일자
- + model.getValue("/root/main/condition/outrmtm" ); //퇴실시간
- var tr_chkflag = model.getValue("/root/main/ertriage/ertriage/chkflag" ); //D : DOA 체크로직, E : 진료외 방문 체크로직, X : 기본 체크로직
- var tr_age = model.getValue("/root/main/ertriage/ertriage/age" ); //나이
- var tr_sex = model.getValue("/root/main/ertriage/ertriage/sex" ); //성별
- var tr_serdiagflag = model.getValue("/root/main/ertriage/ertriage/serdiagflag" ); //중증도구분
- var tr_mainsympcd = model.getValue("/root/main/ertriage/ertriage/mainsympcd" ); //주증상코드
- var tr_attackdd = model.getValue("/root/main/ertriage/ertriage/attackdd" ); //발병일자
- var tr_attacktm = model.getValue("/root/main/ertriage/ertriage/attacktm" ); //발병시간
- var tr_cscsflag = model.getValue("/root/main/ertriage/ertriage/cscsflag" ); //의식구분
- var tr_painflag = model.getValue("/root/main/ertriage/ertriage/painflag" ); //통증구분
- var tr_chospathflag = model.getValue("/root/main/ertriage/ertriage/chospathflag" ); //내원경로구분
- var tr_choswayflag = model.getValue("/root/main/ertriage/ertriage/choswayflag" ); //내원수단구분
- var tr_chosresnflag = model.getValue("/root/main/ertriage/ertriage/chosresnflag" ); //내원사유구분
- var tr_intenflag = model.getValue("/root/main/ertriage/ertriage/intenflag" ); //의도성구분
- var tr_injmechflag = model.getValue("/root/main/ertriage/ertriage/injmechflag" ); //손상기전구분
- var tr_acdownflag = model.getValue("/root/main/ertriage/ertriage/acdownflag" ); //사고본인구분
- var tr_highbp = model.getValue("/root/main/ertriage/ertriage/highbp" ); //수축기혈압
- var tr_lowbp = model.getValue("/root/main/ertriage/ertriage/lowbp" ); //이완기혈압
- var tr_mntpulsecnt = model.getValue("/root/main/ertriage/ertriage/mntpulsecnt" ); //분당맥박수
- var tr_mntbrethcnt = model.getValue("/root/main/ertriage/ertriage/mntbrethcnt" ); //분당호흡수
- var tr_chosbdtp = model.getValue("/root/main/ertriage/ertriage/chosbdtp" ); //내원시체온
- var tr_oxyconcen = model.getValue("/root/main/ertriage/ertriage/oxyconcen" ); //산소포화도
- var tr_algyflag = model.getValue("/root/main/ertriage/ertriage/algyflag" ); //알러지구분
- var tr_pasthistflag = model.getValue("/root/main/ertriage/ertriage/pasthistflag" ); //과거력구분
- var tr_proceqmtflag = model.getValue("/root/main/ertriage/ertriage/proceqmtflag" ); //보호장구구분
- var tr_patnm = model.getValue("/root/main/ertriage/ertriage/patnm" ); //환자성명
- var tr_algyetccnts = model.getValue("/root/main/ertriage/ertriage/algyetccnts" ); //알러지기타내용
- var tr_pasthistetccnts = model.getValue("/root/main/ertriage/ertriage/pasthistetccnts" ); //과거력기타내용
- var tr_fstexamorddd = model.getValue("/root/main/ertriage/ertriage/fstexamorddd" ); //초진진료일자
- var tr_fstexamordtm = model.getValue("/root/main/ertriage/ertriage/fstexamordtm" ); //초진진료시간
- var tr_mainsympcd1 = model.getValue("/root/main/ertriage/ertriage/mainsympcd1" ); //주증상코드
- var tr_mainsympcdno1 = model.getValue("/root/main/ertriage/ertriage/mainsympcdno1" ); //주중상코드번호
- var tr_mainsympnm1 = model.getValue("/root/main/ertriage/ertriage/mainsympnm1" ); //주증상명
- var tr_mainsympcd2 = model.getValue("/root/main/ertriage/ertriage/mainsympcd2" ); //주증상코드
- var tr_mainsympcdno2 = model.getValue("/root/main/ertriage/ertriage/mainsympcdno2" ); //주중상코드번호
- var tr_mainsympnm2 = model.getValue("/root/main/ertriage/ertriage/mainsympnm2" ); //주증상명
- var tr_etcsymp = model.getValue("/root/main/ertriage/ertriage/etcsymp" ); //기타증상
- var tr_acdowndetailflag = model.getValue("/root/main/ertriage/ertriage/acdowndetailflag" ); //교통사고 당사자상세구분
- var tr_inhosptype = model.getValue("/root/main/ertriage/ertriage/inhosptype" ); //전원보낸의료기관의유형
- var tr_dsid = model.getValue("/root/main/ertriage/ertriage/dsid" ); //재난번호
- var tr_reid = model.getValue("/root/main/ertriage/ertriage/reid" ); //구급활동일지일련번호
-
- if( (tr_highbp == "" || tr_lowbp == "" || tr_mntpulsecnt == "" || tr_mntbrethcnt == "" || tr_chosbdtp == "") && (tr_mainsympcd !="D0000001") ){
- messageBox("TRIAGE 기록 오류 : V/S 누락정보가 존재 합니다.","E");
- return "false";
- }
-
- if (tr_mainsympcd !="D0000001" ) // 신종플루 환자는 트리아제를 체크 하지 않는다...
- {
-
- switch(tr_chkflag){
- case "X" : //기본 체크 로직
-
- // V/S 간호사(15세 이상이며 사망환자가 아닐경우)
- if( tr_age >= 15 && ce_outrmcd != "4" ){
- if( tr_highbp == "" || (( tr_highbp > 300 || tr_highbp < 0 ) && tr_highbp != -1 && tr_highbp != 999 )) {
- messageBox("TRIAGE 기록 오류 : 수축기혈압은 0~300이어야 합니다.","E");
- return "false";
- }
-
- if( tr_lowbp == "" || (( tr_lowbp > 300 || tr_lowbp < 0 ) && tr_lowbp != -1 && tr_lowbp != 999 )) {
- messageBox("TRIAGE 기록 오류 : 이완기혈압은 0~300이어야 합니다.","E");
- return "false";
- }
-
- if( tr_mntpulsecnt == "" || (( tr_mntpulsecnt > 300 || tr_mntpulsecnt < 0 ) && tr_mntpulsecnt != -1 && tr_mntpulsecnt != 999 )) {
- messageBox("TRIAGE 기록 오류 : 분당맥박수는 0~300이어야 합니다.","E");
- return "false";
- }
-
- if( tr_mntbrethcnt == "" || (( tr_mntbrethcnt > 99 || tr_mntbrethcnt < 0 ) && tr_mntbrethcnt != -1 && tr_mntbrethcnt != 999 )) {
- messageBox("TRIAGE 기록 오류 : 분당호흡수는 0~99이어야 합니다.","E");
- return "false";
- }
-
- if( tr_chosbdtp == "" || (( tr_chosbdtp > 45 || tr_chosbdtp < 20 ) && tr_chosbdtp != -1 && tr_chosbdtp != 99.9 )) {
- messageBox("TRIAGE 기록 오류 : 내원시체온은 20.0~45.0이어야 합니다.","E");
- return "false";
- }
-
- // 15.12.23 - AYS 추가
- if( tr_oxyconcen == "" || (( tr_oxyconcen > 100 || tr_oxyconcen < 0 ) && tr_oxyconcen != -1 && tr_oxyconcen != 999 )) {
- messageBox("TRIAGE 기록 오류 : 산소포화도는 0~100이어야 합니다.","E");
- return "false";
- }
- //의사
- if( tr_cscsflag == "A" && tr_lowbp != -1 && tr_lowbp != 999 && tr_mntbrethcnt != -1 && tr_mntbrethcnt != 999 && ( tr_highbp <= 30 || tr_mntbrethcnt <= 6 ) ){
- messageBox("TRIAGE 기록 오류 : 의식구분이 Alert일 경우 수축기 혈압은 > 30 이여야 하며 호흡수는 > 6 이여야 합니다.","E");
- return "false";
- }
- }
- if( eval(tr_highbp) < eval(tr_lowbp) ){
- messageBox("TRIAGE 기록 오류 : 수축기 혈압이 이완기 혈압보다 낮게 기록되었습니다.","E");
- return "false";
- }
-
- if( ce_chosdt > getCurrentDate() + getCurrentTime() ){
- messageBox("내원 일시가 현재 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
- if ( tr_attackdd == "11111111" && tr_attacktm != "1111" ){
- messageBox("TRIAGE 기록 오류 : 발병 일자가 '11111111' 경우 발병 시간은 '1111'로 입력 되어야 합니다.","E");
- return "false";
- }
-
- if( tr_attackdd + tr_attacktm > getCurrentDate() + getCurrentTime() ){
- messageBox("TRIAGE 기록 오류 : 발병 일시가 현재 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
- if ( tr_attackdd + tr_attacktm > ce_chosdt ){
- messageBox("TRIAGE 기록 오류 : 발병 일시가 내원 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if( ce_chosdt > ce_outrmdt ){
- messageBox("내원 일시가 퇴원 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if( tr_mainsympcd == "" ){
- messageBox("TRIAGE 기록 오류 : 주증상 정보가 미입력되었습니다.", "E");
- return "false";
- }
-
- //발병일시 체크
- if( (tr_attackdd + tr_attacktm).length < 12 || tr_attackdd + tr_attacktm > ce_chosdt ) {
- messageBox("TRIAGE 기록 오류 : 발병일시를 확인하십시요.", "E");
- return "false";
- }
-
- if( tr_age <= 5 && tr_intenflag == "2" ){
- messageBox("TRIAGE 기록 오류 : 연령이 5세 이하인 경우 의도성 여부는 자살, 자해로 입력할 수 없습니다.", "E");
- return "false";
- }
-
- if( tr_cscsflag == "-" || tr_cscsflag == "" ){
- messageBox("TRIAGE 기록 오류 : 의식구분이 입력되지 않았습니다.", "E");
- return "false";
- }
- if( tr_choswayflag == "-" || tr_choswayflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원수단이 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( tr_chosresnflag == "-" || tr_chosresnflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원사유가 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( tr_chospathflag == "-" || tr_chospathflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원경로가 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( (tr_injmechflag == "01" || tr_injmechflag == "02" || tr_injmechflag == "03" || tr_injmechflag == "04" ||
- tr_injmechflag == "05" || tr_injmechflag == "06" || tr_injmechflag == "07" || tr_injmechflag == "08" ||
- tr_injmechflag == "09" ) && ( tr_acdowndetailflag == "" || tr_proceqmtflag == "" )){
- messageBox("TRIAGE 기록 오류 : 교통사고인 경우 교통사고 손상당사자 항목이 입력되어야 하고 \n또한 보호장구항목도 하나이상 입력되어야 합니다.","E");
- return "false";
- }
-
- if( tr_chosresnflag == "2" && ( tr_intenflag == "" || tr_intenflag == "-" || tr_injmechflag == "" || tr_injmechflag == "-" )){
- messageBox("TRIAGE 기록 오류 : 내원사유가 질병외인 경우 의도성, 손상기전 값은 모두 입력되어야 합니다.", "E");
- return "false";
- }
- if( tr_chospathflag == "2" && ( tr_inhosptype == "" || tr_inhosptype == "-" ) ){
- messageBox("TRIAGE 기록 오류 : 내원경로가 외부에서 전원일 경우 전원 보낸 의료기관 종류를 입력해야 합니다.","E");
- return "false";
- }
-
- if ( tr_choswayflag == "1" && ( tr_dsid == "" || tr_reid == "" ) ){
- messageBox("TRIAGE 기록 오류 : 내원수단이 119구급차일 경우 재난번호와 구급활동일지인련번호를 입력해야 합니다.","E");
- return "false";
- }
- break;
-
- case "E" : //진료외 방문 체크 로직
- if(tr_chosresnflag != "3"){
- messageBox("TRIAGE 기록 오류 : 내원사유를 진료외 방문으로 입력하십시오.", "E");
- return false;
- }
- break;
-
- case "D" : // DOA 환자 체크로직
- // V/S 간호사
- if( tr_chosbdtp == "" || (( tr_chosbdtp > 45 || tr_chosbdtp < 0 ) && tr_chosbdtp != -1 && tr_chosbdtp != 99.9 )) {
- messageBox("TRIAGE 기록 오류 : 내원시체온 정보 확인 하십시오.","E");
- return "false";
- }
-
- if( eval(tr_highbp) < eval(tr_lowbp) ){
- messageBox("TRIAGE 기록 오류 : 수축기 혈압이 이완기 혈압보다 낮게 기록되었습니다.","E");
- return "false";
- }
-
- // 의사
- if( tr_cscsflag != "U" ){
- messageBox("TRIAGE 기록 오류 : DOA환자일 경우 내원시 반응은 Unresponsive 이여야 합니다.","E");
- return "false";
- }
-
- if( ce_chosdt > getCurrentDate() + getCurrentTime() ){
- messageBox("내원 일시가 현재 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if ( tr_attackdd == "11111111" && tr_attacktm != "1111" ){
- messageBox("TRIAGE 기록 오류 : 발병 일자가 '11111111' 경우 발병 시간은 '1111'로 입력 되어야 합니다.","E");
- return "false";
- }
-
- if( tr_attackdd + tr_attacktm > getCurrentDate() + getCurrentTime() ){
- messageBox("TRIAGE 기록 오류 : 발병 일시가 현재 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if ( tr_attackdd + tr_attacktm > ce_chosdt ){
- messageBox("TRIAGE 기록 오류 : 발병 일시가 내원 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if( ce_chosdt > ce_outrmdt ){
- messageBox("내원 일시가 퇴원 일시보다 늦게 입력되었습니다.","E");
- return "false";
- }
-
- if( tr_mainsympcd == "" ){
- messageBox("TRIAGE 기록 오류 : 주증상 정보가 미입력되었습니다.", "E");
- return "false";
- }
-
- //발병일시 체크
- if( (tr_attackdd + tr_attacktm).length < 12 || tr_attackdd + tr_attacktm > ce_chosdt ) {
- messageBox("TRIAGE 기록 오류 : 발병일시를 확인하십시요.", "E");
- return "false";
- }
-
- if( tr_age <= 5 && tr_intenflag == "2"){
- messageBox("TRIAGE 기록 오류 : 연령이 5세 이하인 경우 의도성 여부는 자살, 자해로 입력할 수 없습니다.", "E");
- return "false";
- }
-
- if( tr_cscsflag == "-" || tr_cscsflag == "" ){
- messageBox("TRIAGE 기록 오류 : 의식구분이 입력되지 않았습니다.", "E");
- return "false";
- }
- if( tr_choswayflag == "-" || tr_choswayflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원수단이 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( tr_chosresnflag == "-" || tr_chosresnflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원사유가 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( tr_chospathflag == "-" || tr_chospathflag == "" ){
- messageBox("TRIAGE 기록 오류 : 내원경로가 입력되지 않았습니다.", "E");
- return "false";
- }
-
- if( (tr_injmechflag == "01" || tr_injmechflag == "02" || tr_injmechflag == "03" || tr_injmechflag == "04" ||
- tr_injmechflag == "05" || tr_injmechflag == "06" || tr_injmechflag == "07" || tr_injmechflag == "08" ||
- tr_injmechflag == "09" ) && ( tr_acdowndetailflag == "" || tr_proceqmtflag == "" ) ){
- messageBox("TRIAGE 기록 오류 : 교통사고인 경우 교통사고 손상당사자 항목이 입력되어야 하고 \n또한 보호장구항목도 하나이상 입력되어야 합니다.","E");
- return "false";
- }
- if(tr_chosresnflag == "2" && ( tr_intenflag == "" || tr_intenflag == "-" || tr_injmechflag == "" || tr_injmechflag == "-" )){
- messageBox("TRIAGE 기록 오류 : 내원사유가 질병외인 경우 의도성, 손상기전 값은 모두 입력되어야 합니다.", "E");
- return "false";
- }
- if( tr_chospathflag == "2" && ( tr_inhosptype == "" || tr_inhosptype == "-" ) ){
- messageBox("TRIAGE 기록 오류 : 내원경로가 외부에서 전원일 경우 전원 보낸 의료기관 종류를 입력해야 합니다.","E");
- return "false";
- }
-
- if ( tr_choswayflag == "1" && ( tr_dsid == "" || tr_reid == "" ) ){
- messageBox("TRIAGE 기록 오류 : 내원수단이 119구급차일 경우 재난번호와 구급활동일지인련번호를 입력해야 합니다.","E");
- return "false";
- }
-
- break;
- }
-
- }
- return ErOutChkRtnValue;
- }
-
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 선택 컨트롤
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectGridRowCtrl(pPath, pFlag){
- //선택row 초기화
- var iRow = "";
- var iRow = "";
- var sRow = "";
- var tRow = "";
- var chkNode1 = "";
- var chkNode2 = "";
-
- //검사 그리드 선택 시 발생
- if(pFlag == "T"){
- iRow = grd_testlist.row;
- sRow = grd_testlist.selectedRows;
- eRow = grd_testlist.selectedRow(0);
- tRow = grd_testlist.rows;
- chkNode1 = "/selectyn";
- chkNode2 = "/testtp";
-
-
- //약,주사 그리드 선택 시 발생
- }else if(pFlag == "I"){
- //grd_inglist.setfocus
- // model.setfocus("grd_inglist", true);
- iRow = grd_inglist.row;
- sRow = grd_inglist.selectedRows;
- eRow = grd_inglist.selectedRow(0);
- tRow = grd_inglist.rows;
- chkNode1 = "/selectyn";
- chkNode2 = "/prcpkindcdyn";
- //alert(sRow);
- }
- if(eRow < "0"){
- return;
- } else {
- if(pFlag == "T"){
- if(tRow != "1"){
- // ctrl키 누른 상태에서 그리드 클릭시 선택된 모든 행 상태값 변경
- if(event.ctrlKey == 1){
- if(model.getValue(pPath+"["+iRow+"]"+chkNode1) != "Y" ){
- //&& model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
- model.setValue(pPath+"["+iRow+"]"+chkNode1, "Y");
- } else {
- model.setValue(pPath+"["+iRow+"]"+chkNode1, "");
- }
- }
- // shift키 누른 상태에서 선택행과 마지막 선택행 사이의 그리드 상태값 변경
- else if(event.shiftKey == 1){
- for(i =1 ; i < tRow ; i++){
- model.setValue(pPath+"["+i+"]"+chkNode1, "");
- }
- if(iRow == eRow){
- for(i = iRow ; i < iRow+sRow ; i++) {
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
- // && model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }else{
- for(i = eRow; i <= iRow ; i ++ ){
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
- // && model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }
- }
- // 마우스 드래그를 하여 그리드의 로우 선택시 상태값 변경
- else {
- for(i =1 ; i < tRow ; i++){
- model.setValue(pPath+"["+i+"]"+chkNode1, "");
- }
- if((sRow == "1")&& (iRow != "0")){
- if(model.getValue(pPath+"["+eRow+"]"+chkNode1) != "Y" ){
- if(tRow ==1){
- return;
- }else{
- model.setValue(pPath+"["+eRow+"]"+chkNode1, "Y"); /////에러나는줄1
- }
- } else {
- model.setValue(pPath+"["+eRow+"]"+chkNode1, "");
- }
- } else {
- if (iRow != "0") {
- if(iRow == eRow){
- for(i = iRow ; i < iRow+sRow ; i++) {
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }else{
- for(i = eRow; i <= iRow ; i ++ ){
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }
- }// if irow end
- }
- }
- }
- }else if(pFlag == "I"){
- if(tRow != "1"){
- // ctrl키 누른 상태에서 그리드 클릭시 선택된 모든 행 상태값 변경
- if(event.ctrlKey == 1){
- if(model.getValue(pPath+"["+iRow+"]"+chkNode1) != "Y" ) {
- model.setValue(pPath+"["+iRow+"]"+chkNode1, "Y");
- } else {
- model.setValue(pPath+"["+iRow+"]"+chkNode1, "");
- }
- }
- // shift키 누른 상태에서 선택행과 마지막 선택행 사이의 그리드 상태값 변경
- else if(event.shiftKey == 1){
- for(i =1 ; i < tRow ; i++){
- model.setValue(pPath+"["+i+"]"+chkNode1, "");
- }
- if(iRow == eRow){
- for(i = iRow ; i < iRow+sRow ; i++) {
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }else{
- for(i = eRow; i <= iRow ; i ++ ){
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }
- }
- // 마우스 드래그를 하여 그리드의 로우 선택시 상태값 변경
- else {
- for(i =1 ; i < tRow ; i++){
- model.setValue(pPath+"["+i+"]"+chkNode1, "")
- //alert("2-"+chkNode1);;
- }
- //alert(sRow+'/'+iRow);
- if((sRow == "1") && (iRow != "0")){
- if(model.getValue(pPath+"["+eRow+"]"+chkNode1) != "Y" ) {
- if(tRow ==1){
- return;
- }else{
- model.setValue(pPath+"["+eRow+"]"+chkNode1, "Y"); ///////에러나는 줄2
- }
- } else {
- model.setValue(pPath+"["+eRow+"]"+chkNode1, "");
- }
- } else {
- if (iRow != "0") {
- if (iRow == eRow){
- for(i = iRow ; i < iRow+sRow ; i++) {
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }else{
- for(i = eRow; i <= iRow ; i ++ ){
- if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
- model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
- }
- }
- }
- } // if irow end
- }
- }
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약저장 이밴트 처리
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveDrugTret(){
- var pid = model.getValue("/root/hidden1/incplist/pid");
- var patnm = model.getValue("/root/hidden1/incplist/patnm");
- var sexage = model.getValue("/root/hidden1/incplist/sexage");
- var drugno = model.getValue("/root/main/incplist/inginfo["+1+"]/drugno");
- //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
- for(var i=1; i<grd_inglist.rows;i++) {
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/spcldrug") =="M") { //마약여부 확인
- var narcyn = "(마)";
- break;
- }
- else{
- var narcyn ="NONO";
- }
- }
- //alert("pid:"+pid+", patnm:"+patnm+", sexage:"+sexage+", drugno"+drugno+", narcyn"+narcyn);
- //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
-
- //미정의(사용하지 않음)
- if(model.getValue("/root/main/condition/researchflag") == "I"){
- fSelectInddPatList("S");
- }
- var datacheck2 = "N";
- var datacheck3 = "N";
- //퇴원약이면서 약국으로 전송하여 집계하지 않는 처방 검증
- //alert(grd_inglist.rows);
- for(i= 1 ; i < grd_inglist.rows; i++ ) {
- //alert(i);
- if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y" &&
- model.getvalue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ){
- datacheck2 = "Y";
- }
-
- if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") == "000"){
- datacheck2 = "C";
- }
-
- if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
- datacheck3 = "Y";
- }
- }
-
- //if(datacheck3 == "Y"){
- // var chkpid = "";
- // if(model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/dschdclrtyn") != "Y"){
- // fGetPatList();
- // }
- //}
- if(datacheck2 == "N" || grd_inglist.rows == "1" ){
- messageBox("미시행 퇴실처방이 존재하지", "E007");
- model.setFocus("btn_outsave");
- return;
- }else if(datacheck2 == "C"){
- messageBox("간호확인을 하지 않은 퇴원약이 존재합니다.", "E");
- return;
- }else{
- model.removenodeset("/root/send");
- model.makeValue("/root/send/searchpat", fSetPatInfo() );
- model.makeValue("/root/send/drugsaveinfo", grd_inglist.getUpdateDataAll("i"));
- model.removeNodeset("/root/main/incplist");
-
- submit("TXMNE00202", false);
- //messageBox("약국으로 퇴원약 전송 완료했습니다.","I");
- //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/drugno") != null) {
- var pid = model.getValue("/root/hidden1/incplist/pid");
- var patnm = model.getValue("/root/hidden1/incplist/patnm");
- var sexage = model.getValue("/root/hidden1/incplist/sexage");
- var drugno = model.getValue("/root/main/incplist/inginfo["+1+"]/drugno");
- for(var i=1; i<grd_inglist.rows;i++) {
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/spcldrug") =="M") { //마약여부 확인
- var narcyn = "(마)";
- break;
- }
- else{
- var narcyn ="";
- }
- }
- //-----(20110422) 막음
- //fERCareDrugNoLabel2(pid, patnm, sexage, drugno, narcyn, "(약국)", "(간호)");//투약번호표출력
- //-----(20110422) 막음
- fGetPatList();
- //model.refresh();
- }
- //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
- }
- }
-
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 퇴실구분 선택 및 콤보 옵션 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectOutRmCnts(){
- //퇴실구분 초기화
- model.setValue("/root/main/condition/outrmcd", "");
- var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
- ipt_outrmetc.attribute("left") = "490"; // 기타사유 창 위치변경]
- ipt_outrmetc.attribute("top") = "56"; // 기타사유 창 위치변경]
- ipt_outrmetc.visible = false;
-
- //20111202_KNUH_Start
- cmb_etc.attribute("left") = "490"; // 기타사유 창 위치변경]
- cmb_etc.attribute("top") = "56"; // 기타사유 창 위치변경]
- cmb_etc.visible = false;
- //20111202_KNUH_End
-
- // 귀가
- if(rdo_outrmflag.value == 1) {
- fSelctionOutRmCombo("BT1");
- }
-
- // 입원
- if(rdo_outrmflag.value == 2) {
- fSelctionOutRmCombo("BT3");
-
- //16.10.19_칠곡 센터승격으로 인한 수정
- caption24.visible = "visible"; // 입원경로 캡션
- cmb_outhsrt.visible = "visible"; // 입원경로 콤보박스
-
- //if(getUserInfo("dutplceinstcd") == "031"){
- // caption24.visible = "visible"; // 입원경로 캡션
- // cmb_outhsrt.visible = "visible"; // 입원경로 콤보박스
- //}
- //16.10.19_칠곡 센터승격으로 인한 수정
- } else {
- //16.10.19_칠곡 센터승격으로 인한 수정
- caption24.visible = false; // 입원경로 캡션
- cmb_outhsrt.visible = false; // 입원경로 콤보박스
- model.setValue("/root/main/condition/outhsrt", ""); // 입원경로 콤보박스 초기화
-
- //if(getUserInfo("dutplceinstcd") == "031"){
- // caption24.visible = false; // 입원경로 캡션
- // cmb_outhsrt.visible = false; // 입원경로 콤보박스
- // model.setValue("/root/main/condition/outhsrt", ""); // 입원경로 콤보박스 초기화
- //}
- //16.10.19_칠곡 센터승격으로 인한 수정
- }
-
- // 전원
- if(rdo_outrmflag.value==3){
- caption2.visible = "visible";
- caption1.visible="visible";
- caption20.visible = "visible";
- ipt_chnghosnm.visible="visible";
- chk_proceraprvyn.visible="visible";
- chk_healcaretgdyn.visible="visible";
- cmb_dschhosptype.visible = "visible";
- btn_hossear.visible = "visible"
-
- chk_proceraprvyn.value = "Y";
- chk_healcaretgdyn.value = "Y";
- fSelctionOutRmCombo("BT2");
- } else {
- caption2.visible = false;
- caption1.visible = false;
- ipt_chnghosnm.visible = false;
- ipt_chnghosnmetc.visible = false;
- chk_proceraprvyn.visible = false;
- chk_healcaretgdyn.visible = false;
- ipt_chnghospchoi.visible = false;
- caption20.visible = false;
- cmb_dschhosptype.visible = false;
- btn_hossear.visible = false;
-
- model.makeValue("/root/main/condition/chnghospchoi", "");
- model.setValue("/root/main/condition/chnghospnm", "");
- model.setValue("/root/main/condition/dschhosptype", "");
- model.refresh();
- }
-
- // 사망
- if(rdo_outrmflag.value == 6) {
- fSelctionOutRmCombo("BT4");
- ipt_dethtm.visible = "visible";
- ipt_dethdd.visible = "visible";
- caption4.visible = "visible";
-
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethyn") == "Y"){
- model.setValue("/root/main/condition/dethdd", model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethdd") );
- model.setValue("/root/main/condition/dethtm", model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethtm") );
- ipt_dethdd.refresh();
- ipt_dethtm.refresh();
- messageBox("사망 기록 내역이 존재합니다.", "I");
- }
- } else {
- model.setValue("/root/main/condition/dethdd", "");
- model.setValue("/root/main/condition/dethtm", "");
- ipt_dethtm.visible = false;
- caption4.visible = false;
- ipt_dethdd.visible = false;
- }
-
- // 기타, 미상
- if(rdo_outrmflag.value == 8 || rdo_outrmflag.value == 9 ){
- caption2.visible= false;
- cmb_outrmcd.visible= false;
- ipt_outrmetc.visible = false; // 기타사유
- cmb_etc.visible = false;
-
- caption20.visible = false;
- cmb_dschhosptype.visible = false;
- model.setValue("/root/main/condition/dschhosptype", "");
-
- if(rdo_outrmflag.value == 8){
- model.setValue("/root/main/condition/outrmcd", "88");
- // ipt_chnghospchoi.visible = false;
- ipt_chnghospchoi2.visible = true;
- ipt_chnghospchoi2.disabled = true;
- caption3.visible = true;
- model.setValue("/root/main/condition/chnghospchoi", "탈원");
- ipt_chnghospchoi.disabled = true;
- caption3.visible = true;
- model.refresh();
- //ipt_outrmetc.visible = "visible"; // 기타사유
- //caption2.visible= true;
- //caption2.attribute("text") = "기타사유";
- } else if (rdo_outrmflag.value == 9 ){
- model.setValue("/root/main/condition/outrmcd", "99");
- // ipt_chnghospchoi.visible = false;
- ipt_chnghospchoi2.visible = false;
- caption3.visible = false;
- model.setValue("/root/main/condition/chnghospchoi", "");
- ipt_chnghospchoi.disabled = false;
- ipt_chnghospchoi2.disabled = true;
- //ipt_outrmetc.visible = false; // 기타사유
- //caption2.visible= false;
- //caption2.attribute("text") = "세부사항";
- }
-
- } else {
- caption3.visible= true;
- //caption2.attribute("text") = "세부사항";
- cmb_outrmcd.visible= true;
- ipt_chnghospchoi2.visible = false;
- ipt_chnghospchoi2.disabled = false;
- ipt_chnghospchoi.visible = false;
- ipt_chnghospchoi.disabled = false; // 기타사유
- model.setValue("/root/main/condition/chnghospchoi", "");
- }
- }
- function fChangeOutRm(sFlag){
- if(sFlag != 2){
- for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "3"){
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "-");
- }
- }
- }
- }
-
-
- /**
- * @group :
- * @ver : 2007.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 왼쪽 마우스 클릭 메뉴
- * @param :
- * @return :
- * @---------------------------------------------------
- */
-
- function fPopupMenuInfo(pFlag){
- //마우스 오른쪽 버튼 클릭시 이밴트 발생
- if(event.button == 3){
- //검사탭에서 마우스 클릭시 발생
- if(pFlag == "T"){
- //선택없이 마우스 오른쪽 클릭으로 선택 이밴트
-
- // alert(grd_testlist.row +" : "+ grd_testlist.mouseRow +" : "+ grd_testlist.selectedRow(0) +" : "+grd_testlist.selectedRows);
- // alert(grd_testlist.selectedRow(0) +" : "+ grd_testlist.mouseRow);
- // alert((grd_testlist.row + grd_testlist.selectedRow(0) -1) +" : "+ grd_testlist.mouseRow);
- if(grd_testlist.selectedRows == 1 || (( grd_testlist.selectedRow(0) > grd_testlist.mouseRow) || ((grd_testlist.row + grd_testlist.selectedRows -1) < grd_testlist.mouseRow ))){
- for(var i = 1 ; i < grd_testlist.rows ; i++){
- model.setValue("/root/main/incplist/testinfo["+i+"]/selectyn", "");
- }
- grd_testlist.row = grd_testlist.mouseRow;
- }
-
- //선택행 선택 플래그 변경 후 DC팝업창 활성화
- if(grd_testlist.isCell(event.target) && grd_testlist.mouseRow >= grd_testlist.fixedrows){
- model.setValue("/root/main/incplist/testinfo["+grd_testlist.row+"]/selectyn", "Y");
-
- //퇴실구분에 따른 팝업목록 선택
- if( model.getValue("/root/main/condition/outrmtp") == ""){
- //window.setPopupMenu( true, "/root/codedata/popupmenu/grid00/item", "name", "func", true); //퇴원구분 미선택
- }else if(model.getValue("/root/main/condition/outrmtp") == "2"){
- window.setPopupMenu( true, "/root/codedata/popupmenu/grid01/item", "name", "func", true); //퇴원구분 입원 선택
- }else{
- window.setPopupMenu( true, "/root/codedata/popupmenu/grid02/item", "name", "func", true); //퇴원구분 선택(입원제외)
- }
- }else{
- window.setPopupMenu(false);
- }
- //약,주사탭에서 마우스 클릭시 발생
- }else{
- //선택없이 마우스 오른쪽 클릭으로 선택 이밴트
- if(grd_inglist.selectedRows == 1 || (( grd_inglist.selectedRow(0) > grd_inglist.mouseRow) || ((grd_inglist.row + grd_inglist.selectedRows -1) < grd_inglist.mouseRow ))){
- for(var i = 1 ; i < grd_inglist.rows ; i++){
- model.setValue("/root/main/incplist/inginfo["+i+"]/selectyn", "");
- }
- grd_inglist.row = grd_inglist.mouseRow;
- }
-
- //선택행 선택 플래그 변경 후 DC팝업창 활성화
- if(grd_inglist.isCell(event.target) && grd_inglist.mouseRow >= grd_inglist.fixedrows){
- model.setValue("/root/main/incplist/inginfo["+grd_inglist.row+"]/selectyn", "Y");
- window.setPopupMenu( true, "/root/codedata/popupmenu/grid10/item", "name", "func", true); //퇴원구분 미선택
- }else{
- window.setPopupMenu(false);
- }
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사, 약주사 오른쪽 팝업 메뉴 선택에 따른 처리
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChagnePrcpStat(pFlag){
- if(pFlag == ""){
- pFlag == "StatInit";
- }
-
- var sStatFlag = ""; // 1: DC, 2: Action, 3: 병동이관, -: 초기화
- var sTargetGrid = ""; // All : 검사, 약 전체 초기화, Test: 검사 초기화, Ing: 약주사 초기화
- var sExecFlag = "";
-
- //Param에 따른 상태값 설정
- if(pFlag == "StatInit"){
- sStatFlag = "-";
- sTargetGrid = "ALL";
- sExecFlag = "N";
- }else if(pFlag == "DefTestDC"){
- sStatFlag = "1";
- sTargetGrid = "Test";
- sExecFlag = "Y";
- }else if(pFlag == "DefTestAct"){
- sStatFlag = "2";
- sTargetGrid = "Test";
- sExecFlag = "Y";
- }else if(pFlag == "ChosTestInit"){
- sStatFlag = "-";
- sTargetGrid = "Test";
- sExecFlag = "N";
- }else if(pFlag == "ChosTestWard"){
- sStatFlag = "3";
- sTargetGrid = "Test";
- sExecFlag = "N";
- }else if(pFlag == "ChosTestDC"){
- sStatFlag = "1";
- sTargetGrid = "Test";
- sExecFlag = "N";
- }else if(pFlag == "ChosTestAct"){ // 검사 Acting
- sStatFlag = "2";
- sTargetGrid = "Test";
- sExecFlag = "N";
- }else if(pFlag == "DefIngDC"){
- sStatFlag = "1";
- sTargetGrid = "Ing";
- sExecFlag = "Y";
- }else if(pFlag == "ChosIngInit"){
- sStatFlag = "-";
- sTargetGrid = "Ing";
- sExecFlag = "N";
- }else if(pFlag == "ChosIngDC"){
- sStatFlag = "1";
- sTargetGrid = "Ing";
- sExecFlag = "N";
- }
-
- // alert(sExecFlag +" : "+ sTargetGrid +" : "+ sStatFlag );
-
- // 상태 변경및 실행 function 호출 부분
- if(sExecFlag != "" && sTargetGrid != "" && sStatFlag != ""){
-
- // 선택 바로 실시( Acting, D/C )
- if(sExecFlag == "Y"){
- if(sStatFlag == "1"){ // D/C
- fPrcpDC(sTargetGrid);
- }else if(sStatFlag == "2"){ // Action
- fSaveTestPrcp();
- }else if(sStatFlag == "3" || sStatFlag == "-" ){
- return;
- }
- // 상태 변경
- }else{
- fChangeStatCode(sStatFlag, sTargetGrid);
- }
- }
- }
- function fChangeStatCode(pStat, pTarget){
- //alert(pStat+'/'+pTarget);
- if(pTarget == "Test" ){
- for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
- var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
-
- //var selectchk = model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn");
- //alert(chkprcp+'/'+selectchk);
-
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn")=="Y"){ // 선택된 처방
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y" ||
- (model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "N" && (pStat == "3" || pStat == "-"))){ // 혈액처방이 아닌것 || 혈액처방이면서 병동이관
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){ // 미수행 처방 선택
- if((model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") == "M" && (pStat == "3" || pStat == "-") ) ||
- model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M" ){ // MSet처방
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/c2check") == "N" ||
- model.getValue("/root/main/incplist/testinfo["+i+"]/c2check") == "Y" && (pStat == "1" ||pStat == "3" || pStat == "-")){ //단순영상 처방
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
- }else{
- messageBox(chkprcp+" 처방은 강제 Acting 할 수 없는 단순 영상 처방입니다.","E");
- }
- }else{
- messageBox(chkprcp+" 처방은 MSet 처방입니다.\nD/C, 강제 Acting 할 수 없습니다.","E");
- }
- }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
- messageBox(chkprcp+" 처방은 퇴원 후 외래 검사 처방입니다.\n병동이관, D/C, 강제 Acting 할 수 없습니다.","E");
- }else{
- messageBox(chkprcp+" 처방은 시행된 검사 처방입니다.\n병동이관, D/C, 강제 Acting 할 수 없습니다.","E");
- }
- }else{
- if ((pStat == "1") && (model.getValue("/root/main/incplist/testinfo["+i+"]/dcyn")=="N")) {
- messageBox(chkprcp+" 처방은 혈액처방입니다.\n 처방상태가 처방/간호확인이 아니면 D/C할 수 없습니다..", "E");
- }
- else if ((pStat == "1") && (model.getValue("/root/main/incplist/testinfo["+i+"]/dcyn")=="Y")) {
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
- }
- else if (pStat == "2") {
- messageBox(chkprcp+" 처방은 혈액처방입니다.\n강제 Acting 할 수 없습니다.", "E");
- }
- else {
- //messageBox(chkprcp+" 처방은 혈액처방입니다.\n강제 Acting 할 수 없습니다.", "E");
- }
- }
- // 진검 B2 처방인 경우 바코드출력상태(400)이후만 강제Acting되도록
- //alert("ddd");
-
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/prcpclscd") == "B2" ){
- if((model.getValue("/root/main/incplist/testinfo["+i+"]/prcpstatcd") < "400" )&& (pStat == "2")){
- messageBox(chkprcp+"처방은 진검 처방입니다.\n바코드 발행 후 강제 Acting 하십시오.","E");
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "-");
- }else {
- //messageBox(chkprcp+"ddddddd처방은 진검 처방입니다.\n바코드 발행 후 강제 Acting 하십시오.","E");
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
- }
- }
-
-
- } // selectyn = 'Y' end
-
- } // for end
- } else if(pTarget == "Ing"){
- for(var i= 0 ; i <= getNodesetCount("/root/main/incplist/inginfo") ; i++){
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn")=="Y"){
- model.setValue("/root/main/incplist/inginfo["+i+"]/viewstat", pStat);
- }
- }
- } else if(pTarget == "All"){
- for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
- }
- for(var i= 0 ; i <= getNodesetCount("/root/main/incplist/inginfo") ; i++){
- model.setValue("/root/main/incplist/inginfo["+i+"]/viewstat", pStat);
- }
- }
- } // function end
-
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사, 약주사 DC 구현 부분
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrcpDC(pFlag){
-
- //------------------------------------------------------------------------------------------------------
- // 간호 확인 약처방을 의사가 D/C(반납)를 하였을 경우에 투약기록지로 가서 해결하라는 메세지를 보여준다
- // sdm
- //------------------------------------------------------------------------------------------------------
- var prcpddprcpno = ""; //------------(20080917)김보성
-
- if(messageBox ( "DC 처리를 ", "Q003" ) == "6"){
-
- var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
- var sHeaderData = "status▦prcpdd▦prcpno▦prcphistno▦instcd▩";
- var dcPrcpInfo = "";
- var dcMediPrcpInfo = "";
- var dcPrcpCnt = 0;
-
- if(pFlag == "Test"){
- //DC할 검사처방 확인
- var tRow = grd_testlist.rows;
- for(i=1 ; i < tRow ; i ++){
- var chkprcp = "";
- var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
- // 그리드에서 선택된 처방 선택
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn") == "Y" ){
- //선택된 처방 중 혈액 처방 제외
- if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){
- //미수행 처방 선택
- if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M"){
- dcPrcpInfo += "C▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd" ) + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno" ) + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno" ) + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/instcd" ) + "▩";
- dcPrcpCnt++;
- }else{
- messageBox(chkprcp+" 는 Mset 처방입니다.","E");
- }
- }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
- messageBox(chkprcp+"는 퇴원 후 외래 검사 처방입니다.","E");
- }else{
- messageBox(chkprcp+"는 이미 시행된 검사 처방입니다.","E");
- }
- }else{
- messageBox(chkprcp+"는 혈액 처방입니다.","E");
- }
- }
- }
- }else{
- //DC할 약/주사 처방 확인
-
- //------------------------------------------------------
- // var tRowChk = grd_inglist.rows ;
- // var chkDC="" ;
- // var chkYn="";
- // for (i=1 ; i< tRowChk ; i ++) {
- // if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn") == "Y" ){
- // var chk_execprcphistcd = model.getValue("/root/main/incplist/inginfo["+i+"]/execprcphistcd");
- // if (chk_execprcphistcd=="E") {
- // chkDC=chkDC + " "+chk_execprcphistcd;
- // chkYn="A";
- // }
- // }
- // }
- // if (chkYn=="A") {
- //
- // if (messageBox("간호 확인 후 의사 반환 처방이 있습니다-투약기록지 작성을 ","Q003")=="6") {
- // modal("SMMNR00600","1","15","128");
- // fGetPatList();
- // fSelectPatList();
- // return;
- // }
- // }else{
-
- //-------------------------------------------------------
-
- var tRow = grd_inglist.rows;
- var prcpno = "";
- var dcstatus = "";
-
- for(i=1 ; i < tRow ; i ++){
- var chkprcp = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpnm");
- // 그리드에서 선택된 처방 선택
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn") == "Y" ){
- //미수행 처방 선택 ( Actiong 완료, 퇴원약 약국전송 건 제외)
- if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y" ){
- messageBox(chkprcp + "는 퇴원약 처방입니다.\n퇴원 처방은 간호사가 D/C할 수 없습니다.","E");
- }else{
- if( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N"
- || model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "E" ){
- //약,주사 경우는 3개로 풀릴 수 있으므로 한개의 처방 번호만 넘기도록 함
- //if(prcpno != model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno"))
-
- //dcstatus E 이면 의사 후인증을 안타도록 "MEDI", N이면 후인증타도록 "CERT"
- dcstatus = ( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ? "CERT" : "MEDI");
- switch( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") ){
-
- case "N" : //정상처방인것이고 처방 인터페이스를 타면 의사 처방반환요청 상태인 "E"로 변경됨.
- // prcpno = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno");
- dcPrcpInfo += "C▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcphistno" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/instcd" ) + "▩";
- // dcPrcpCnt++;
- // //-----------------(20080926) 김보성
- // if (model.getValue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") >= "000" ) {
- // prcpddprcpno += "'" +
- // model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd") +
- // model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno") + "',";
- // }
-
- case "E" :
- /*의사반환요청들어온 처방이고 투약기록에서 DC최종 정리를 하고 후인증처리대상이 안됨.dcstatus "CERT"인것은 후인증관리에도 조회가 되어야한다.
- 투약기록을 태우기위한 파라미터 정의이므로 case "N" 에는 break가 없는게 정상임. 20100108 김홍점
- */
- prcpno = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno");
- dcMediPrcpInfo += dcstatus + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/prcphistno" ) + "▦"
- + model.getValue("/root/main/incplist/inginfo["+i+"]/instcd" ) + "▩";
- dcPrcpCnt++;
-
- //-----------------(20080926) 김보성
- if (model.getValue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") >= "000" ) {
- prcpddprcpno += "'" +
- model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd") +
- model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno") + "',";
- }
-
- break;
- }
-
- }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "DC"){
-
- messageBox(chkprcp+"는 반환요청된 처방입니다.","E");
- // }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "PRE"){
- //
- // messageBox(chkprcp+"는 \n\n 간호에서 '선'지정한 처방으로 투약기록이 안된 처방입니다","E");
- }else{
- messageBox(chkprcp+"는 이미 시행된 처방입니다.","E");
- }
- }
- }
- }
- }
- model.makeValue("/root/send/cond3" , sHeaderData+dcPrcpInfo );
- model.makeValue("/root/send/cond5" , sHeaderData+dcMediPrcpInfo );
-
- //저장구분정보(saveFlagInfo)
- model.setValue ( "/root/save/saveflaginfo/savedataflag" , "2" ); //저장자료구분 0:진단 및 처방, 1:진단, 2:처방, 4:임시저장
- model.setValue ( "/root/save/saveflaginfo/saveflag" , "E" ); //저장구분 O:외래, I:입원, E:응급, S:건진
- model.setValue ( "/root/save/saveflaginfo/prcpflag" , "0" ); //처방구분 0:의사처방, 2:간호, 3:지원부서, 5:Admission, 6:CP, 7:항암프로토콜, 8:임시처방
- model.setValue ( "/root/save/saveflaginfo/inptflag" , "3" ); //입력구분 (11:건진처방, 12:LIS장비IF, 13:기타LIS, 14:병리, 15:EMR기록, 16:원무)
- model.setValue ( "/root/save/saveflaginfo/pamflag" , "Y" ); //원무정보 처리구분 (Y/N) -> N일 경우 check하지 않음.
- model.setValue ( "/root/save/saveflaginfo/diagflag" , "Y" ); //진단정보 처리구분 (Y/N) -> N일 경우 check하지 않음. ('Y'이면 진단없이 처방 저장이 안됨)
- model.setValue ( "/root/save/saveflaginfo/prcperrflag" , "Y" ); //처방오류구분(Y/N) -> Y일 경우 의사처방과 동일하게 오류리스트를 반환, N이면 오류를 확인하지 않음
- model.setValue ( "/root/save/saveflaginfo/deptcd" , getUserInfo("dutplcecd") ); //부서코드
- model.setValue ( "/root/save/saveflaginfo/deptnm" , getUserInfo("dutplcenm") ); //부서명
- model.setValue ( "/root/save/saveflaginfo/userid" , getUserInfo("userid") ); //사용자ID
- model.setValue ( "/root/save/saveflaginfo/usernm" , getUserInfo("usernm") ); //사용자명
- model.setValue ( "/root/save/saveflaginfo/signyn" , "N" ); //전자서명여부
-
- var saveFlagInfoNodeList = model.instances(0).selectNodes( "/root/save/saveflaginfo" );
- model.makeValue ( "/root/send/cond1", getNodeListCSV(saveFlagInfoNodeList));
-
- //저장등록정보(saveRgstInfo)
- model.setValue ( "/root/save/savergstinfo/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid") ); // 등록번호(원무Key)
- model.setValue ( "/root/save/savergstinfo/orddd" , "-" ); // 진료일자(원무Key) - 입원일경우는 '-'
- model.setValue ( "/root/save/savergstinfo/indd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd") ); // 입원일자(원무Key)
- model.setValue ( "/root/save/savergstinfo/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno") ); // 생성번호(원무Key)
- model.setValue ( "/root/save/savergstinfo/orddeptcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/orddeptcd") ); // 진료과(원무)
- model.setValue ( "/root/save/savergstinfo/orddrid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/orddrid") ); // 진료의ID(원무)
- model.setValue ( "/root/save/savergstinfo/instcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") ); // 기관코드
-
- var saveRgstInfo = model.instances(0).selectNodes( "/root/save/savergstinfo" );
- model.makeValue ( "/root/send/cond2", getNodeListCSV(saveRgstInfo));
-
- // D/C할 처방이 없을 경우 return처리
- //alert( "d/c" + pFlag + "/" + dcPrcpCnt);
- if( dcPrcpCnt > 0 ){
- //-----------------------(20080917)김보성
- //약 D/C인 경우만
-
- if(pFlag != "Test") {
- //1. 인증을 위한 자료 추출
- prcpddprcpno = prcpddprcpno.substr(0,prcpddprcpno.length-1);
- //alert("prcpddprcpno:" + prcpddprcpno);
- fnSignSaveCall("30",prcpddprcpno);
-
- //----------------(20090923)
- if (getNodesetCount("/root/signinfo/signsave/signdata") > 0 ) {
- //2. 자료에 대해서 인증하기
- if ( fnSignSaveWork() == true) {
- //3. 인증자료를 묶음submit("TXMNP06013")
- var signsave = model.instances(0).selectNodes( "/root/signinfo/signsave/signdata" );
- model.makeValue ( "/root/send/cond4", getNodeListCSV(signsave));
- } else {
- return ; //---(20080922)
- }
- }
- //----------------(20090923)
- }
-
- //-----------------------(20080917)
- if(submit("TXMNE00203") == true ){
- if(getNodesetCount("/root/temp/errlist") > 0){
- var iNode = "/root/srcdata/list/patlist";
- fShowModal("SPMNE00200");
- }
- fSelectInddPatList("S");
- //-----------------------(20080917):김보성
-
- //약 D/C인 경우만
- if(pFlag != "Test") {
- //1. 일자별 인증을 위한 일자 추출
- var signDates = new Array;
- var signDateCnt = 0;
- var signdispdd = "";
- var sPathsignsave = "/root/signinfo/signsave/signdata";
- var rows = getNodesetCount(sPathsignsave);
-
- if (rows <= 0 ) return;
- for (var i=1;i<= rows ;i++) { //---(0922)
- signdispdd = model.getValue(sPathsignsave + "[" + i + "]/execdd");
- //alert( "전체loop:" + signdispdd + "/"+ medrexecdd + "/" + currentdd);
- if ( signDates.length == 0) {
- signDateCnt =0;
- signDates[signDateCnt] = "";
- }
- if (signdayFind(signDates,signdispdd) == true ) { //------(투약일자)
- signDateCnt ++;
- signDates[signDateCnt] = signdispdd;
- //alert("b:" + signDates[signDateCnt] +"/" + medrexecdd);
- }
- }
- //2. 투약기록을 일자별로 XLST를 만들기 위해서
- fnWorkddSign(signDates);
- }
- //-----------------------(20080917)
- }
- }
- }
- }
-
- function fShowModal(pProgID) {
- var xpos = event.screenX-300;
- var ypos = event.screenY-400;
- modal(pProgID, 1, xpos, ypos, pProgID, "/root/temp", "/root/result");
- var iProperties = getParameter("SendData");
- return iProperties
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 퇴실일시 확인 부분
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChkOutrmdd(){
- var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
- var nowDate = fTimeSetting(); //현재 시간 셋팅
- var checktime = model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") ; //체크할 시간 셋팅(퇴원일시)
- var dd = getCurrentDate();
- var currentdt = dd + nowDate;
-
- //내원시간, 퇴원시간 체크
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt") > checktime ){
- // model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
- // model.setValue("/root/main/condition/outrmtm", nowDate );
- // ipt_outrddd.refresh();
- // ipt_outrmtm.refresh();
- messageBox("선택일시가 내원일시보다 이전입니다.", "E");
- } else if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/fstexamorddd") > checktime) {
- messageBox("선택일시가 초진진료일시 보다 이전입니다.", "E");
- } else if(currentdt < checktime){
- // model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
- // model.setValue("/root/main/condition/outrmtm", nowDate );
- // ipt_outrddd.refresh();
- // ipt_outrmtm.refresh();
- messageBox("선택일시가 미래일시 입니다.", "E");
- }else {
- model.setValue("/root/main/condition/t_outrmdt", model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") );
- }
- output3.refresh();
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 기본 정보 설정 부분
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCalcChosOut(){
- var iRow = grd_patlist.row;
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt") == "" ||
- model.getValue("/root/main/condition/outrmdd") == ""){
- return;
- }
-
- //퇴실일시 확인 부분
- fChkOutrmdd();
-
- var CalcDate = "";
- //내원시간 세팅
- var chosyy = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(0,4);
- var chosmm = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(4,2);
- var chosdd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(6,2);
- var choshh = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(8,2);
- var chosnn = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(10,2);
-
- //퇴실시간 세팅
- var outrmyy = model.getValue("/root/main/condition/outrmdd").substr(0,4);
- var outrmmm = model.getValue("/root/main/condition/outrmdd").substr(4,2);
- var outrmdd = model.getValue("/root/main/condition/outrmdd").substr(6,2);
- var outrmhh = model.getValue("/root/main/condition/outrmtm").substr(0,2);
- var outrmnn = model.getValue("/root/main/condition/outrmtm").substr(2,2);
-
- //재실 시간 계산을 위하여 시간, 분 단위로 차이를 계산
- var rstFromTime = new Date(chosyy,chosmm-1,chosdd,choshh,chosnn,0);
- var rstEndTime = new Date(outrmyy, outrmmm-1,outrmdd,outrmhh,outrmnn,0);
- var diffnn = ((rstEndTime - rstFromTime) / (60*1000)) ;
- var diffhh = Math.ceil( (rstEndTime - rstFromTime) / ( 60*60*1000) ) ;
-
- //시간 : 분 구하기
- if(chosnn != outrmnn){
- calcdiffhh = diffhh -1;
- calcdiffnn = (diffnn - ((diffhh-1) * 60 ));
- //분이 정각일 경우
- }else{
- calcdiffhh = diffhh;
- calcdiffnn = "00"
- }
-
- //환자 기본정보 문장 생성
- CalcDate = calcdiffhh + "시간 "+ calcdiffnn + "분" ;
- return CalcDate;
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사 처방 강제 Action 처리 부분
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveTestPrcp(){
- //acting저장
- var datacheck2 = "N";
- var tRow = grd_testlist.rows;
-
- var vbYes = messageBox("선택된 처방 Acting","Q004");
- if( vbYes == 6 ){
-
- //마우스 드래그시 실시 검사 처방 여부 확인
- for(i= 1 ; i <tRow; i++ ) {
- if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
- var datacheck2 = "Y";
- }
- }
-
- if(datacheck2 == "N" || grd_testlist.rows == "1"){
- messageBox("미시행 검사 처방이 존재하지", "E007");
- model.setFocus("button3");
- return;
- }else{
- for(i=1 ; i < tRow ; i ++){
- var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn") == "Y" ){ // 드래그 선택여부 체크
- if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){ //
- if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){ // Acting여부 체크
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M" ){ // MSet처방
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat" , "2");
- }else{
- messageBox(chkprcp+"처방은 MSet 처방입니다.\n강제 Acting할 수 없습니다.","E");
- }
-
- }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
- messageBox(chkprcp+"는 퇴원 후 외래 처방입니다.\n강제 Acting 할 수 없습니다.","E");
- }else{
- messageBox(chkprcp+"는 이미 시행된 처방입니다.\n강제 Acting 할 수 없습니다.","E");
- }
- }else{
- messageBox(chkprcp+" 은 혈액처방 입니다.\n강제 Acting 할 수 없습니다.","E");
- }
-
- }
- } // for end
-
- model.removenodeset("/root/send");
- model.makeValue("/root/send/searchpat", fSetPatInfo() );
- model.makeValue("/root/send/prcplist", grd_testlist.getUpdateDataAll("i"));
- model.removeNodeset("/root/main/incplist");
- submit("TXMNE00204");
- model.refresh();
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.06.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 상단 정보 이용 환자 선택
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetParamSetting(){
- var chkPid = getPatientInfo("pid");
- var iTgPatRow = 0;
-
- if(chkPid != ""){
- var tRow = grd_patlist.rows;
- if(tRow == "1"){
- return;
- }else{
- for( i =0 ; i < tRow ; i++ ){
- iTgPatRow = grd_patlist.findRow(chkPid ,1, 3,true,true);
- }
- }
- }
- if(iTgPatRow > 0){
- grd_patlist.row = iTgPatRow;
- grd_patlist.topRow = iTgPatRow;
- fSelectPatList();
- }
-
- }
- /**
- * @group :
- * @ver : 2007.06.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 선택 검사/약,주사 처방조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectPatList(){
- if(grd_patlist.row < 1){
- return;
- }
-
- fResrchPatList(); //환자 재조회
- fSetParam(); //상단정보설정
- fSelectInddPatList("S"); //검사, 약주사, 마약 조회
- //** 마약Tab 활성화 기준설정_20090213(ByCY) **//
- model.refresh();
- if(btn_ingmv.selected == true) {
- btn_ingmv.dispatch("DOMActivate");
- }
- if(btn_testmv.selected == true) {
- btn_testmv.dispatch("DOMActivate");
- }
- //** 마약Tab 활성화 기준설정_20090213(ByCY) **//
- fInitSettingTop(); //퇴실처리 환자기본정보 초기화
- model.setValue("/root/main/condition/pid",model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid"));
-
- var tRow = grd_testlist.rows;
- var iRow = grd_inglist.rows;
- var maxDate = "";
- var minDate = "";
-
- for(i = 1 ; i < tRow ; i++){
- if(maxDate != ""){
- if(maxDate < model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd") ){
- maxDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
- }
- }else{
- maxDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
- }
-
- if(minDate != ""){
- if(minDate >= model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd") ){
- minDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
- }
- }else {
- minDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
- }
- }
-
- model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
- model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
-
- var t_patinfo = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid")+" "
- + model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/patnm")+" "
- + model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/sexage");
- var t_chosdt = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/chosdt");
- var t_outrmdt = model.getValue("/root/main/condition/outrmdd")
- + model.getValue("/root/main/condition/outrmtm");
- var t_calctm = fCalcChosOut();
- var t_assgroom = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/assgroom");
-
- // 15.10.26 - 초진진료일자 추가
- var t_fstexamorddd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/fstexamorddd");
- // 15.10.26 - 초진진료일자 추가
- model.setValue("/root/main/condition/t_patinfo" , t_patinfo );
- model.setValue("/root/main/condition/t_chosdt" , t_chosdt );
- model.setValue("/root/main/condition/t_outrmdt" , t_outrmdt );
- model.setValue("/root/main/condition/t_calctm" , t_calctm );
- model.setValue("/root/main/condition/t_assgroom" , t_assgroom );
- // 15.10.26 - 초진진료일자 추가
- model.setValue("/root/main/condition/t_fstexamorddd" , t_fstexamorddd );
- // 15.10.26 - 초진진료일자 추가
-
- ipt_chnghospchoi.visible = false;
- ipt_chnghospchoi2.visible = false;
- caption2.visible = false;
- caption3.visible = false;
-
- caption20.visible = false;
- cmb_dschhosptype.visible = false;
-
- model.makeValue("/root/main/condition/chnghospchoi","");
- model.setValue("/root/main/condition/dschhosptype", "");
- var fselectRow = grd_patlist.row;
- model.copyNode("/root/hidden1/incplist","/root/main/inddpatlist/inddpatinfo["+fselectRow+"]");
- if(model.getValue("/root/temp/patinforesrch/bloodinfo/bloodcomment") !='') { //임시저장한 수혈기록 존재여부
- button5.visible = true;
- output12.visible = true;
- } else {
- button5.visible = false;
- output12.visible = false;
- }
-
- model.refresh();
-
-
- var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid");
- var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd");
- var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno");
- var instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd");
- var orddeptcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddeptcd");
-
- model.removeNodeset("/root/send/req");
- model.makeValue("/root/send/req/pid", pid);
- model.makeValue("/root/send/req/indd", indd);
- model.makeValue("/root/send/req/cretno", cretno);
- model.makeValue("/root/send/req/orddeptcd", orddeptcd);
- model.makeValue("/root/send/req/instcd", instcd);
- model.makeValue("/root/send/req/dschdclrdt", model.getValue("/root/main/condition/outrmdd")); //예약정보 조회시 사용
- model.makeValue("/root/send/req/recflag", "01");
-
- //submit("TRMNW03601");
- submit("TRMNW10001");
-
- }
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사 일괄 DC 구현 부분(상태값으로 D/C 결정 된 처방 일괄 D/C)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrcpDCSave(pFlag, pCnt){
-
- var sHeaderData = "status▦prcpdd▦prcpno▦prcphistno▦instcd▩";
- var dcPrcpInfo = "";
- var dcPrcpCnt = 0;
-
- //DC할 검사처방 확인
- var tRow = grd_testlist.rows;
- for(i=1 ; i < tRow ; i ++){
- // 그리드에서 선택된 처방 선택
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "1" ){
- dcPrcpInfo += "C▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd" ) + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno" ) + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno") + "▦"
- + model.getValue("/root/main/incplist/testinfo["+i+"]/instcd" ) + "▩";
- dcPrcpCnt++;
- }
- }
-
- //alert(dcPrcpInfo);
- model.removenodeset("/root/send");
- model.makeValue("/root/send/cond3" , sHeaderData+dcPrcpInfo );
-
- //저장구분정보(saveFlagInfo)
- model.setValue ( "/root/save/saveflaginfo/savedataflag" , "2" ); //저장자료구분 0:진단 및 처방, 1:진단, 2:처방, 4:임시저장
- model.setValue ( "/root/save/saveflaginfo/saveflag" , "E" ); //저장구분 O:외래, I:입원, E:응급, S:건진
- model.setValue ( "/root/save/saveflaginfo/prcpflag" , "0" ); //처방구분 0:의사처방, 2:간호, 3:지원부서, 5:Admission, 6:CP, 7:항암프로토콜, 8:임시처방
- model.setValue ( "/root/save/saveflaginfo/inptflag" , "3" ); //입력구분 (11:건진처방, 12:LIS장비IF, 13:기타LIS, 14:병리, 15:EMR기록, 16:원무)
- model.setValue ( "/root/save/saveflaginfo/pamflag" , "Y" ); //원무정보 처리구분 (Y/N) -> N일 경우 check하지 않음.
- model.setValue ( "/root/save/saveflaginfo/diagflag" , "Y" ); //진단정보 처리구분 (Y/N) -> N일 경우 check하지 않음. ('Y'이면 진단없이 처방 저장이 안됨)
- model.setValue ( "/root/save/saveflaginfo/prcperrflag" , "Y" ); //처방오류구분(Y/N) -> Y일 경우 의사처방과 동일하게 오류리스트를 반환, N이면 오류를 확인하지 않음
- model.setValue ( "/root/save/saveflaginfo/deptcd" , getUserInfo("dutplcecd") ); //부서코드
- model.setValue ( "/root/save/saveflaginfo/deptnm" , getUserInfo("dutplcenm") ); //부서명
- model.setValue ( "/root/save/saveflaginfo/userid" , getUserInfo("userid") ); //사용자ID
- model.setValue ( "/root/save/saveflaginfo/usernm" , getUserInfo("usernm") ); //사용자명
- model.setValue ( "/root/save/saveflaginfo/signyn" , "N" ); //전자서명여부
-
- var saveFlagInfoNodeList = model.instances(0).selectNodes( "/root/save/saveflaginfo" );
- model.makeValue ( "/root/send/cond1", getNodeListCSV(saveFlagInfoNodeList));
-
- //저장등록정보(saveRgstInfo)
- model.setValue ( "/root/save/savergstinfo/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid") ); // 등록번호(원무Key)
- model.setValue ( "/root/save/savergstinfo/orddd" , "-" ); // 진료일자(원무Key) - 입원일경우는 '-'
- model.setValue ( "/root/save/savergstinfo/indd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd") ); // 입원일자(원무Key)
- model.setValue ( "/root/save/savergstinfo/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno") ); // 생성번호(원무Key)
- model.setValue ( "/root/save/savergstinfo/orddeptcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddeptcd") ); // 진료과(원무)
- model.setValue ( "/root/save/savergstinfo/orddrid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddrid") ); // 진료의ID(원무)
- model.setValue ( "/root/save/savergstinfo/instcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd") ); // 기관코드
-
- var saveRgstInfo = model.instances(0).selectNodes( "/root/save/savergstinfo" );
- model.makeValue ( "/root/send/cond2", getNodeListCSV(saveRgstInfo));
-
- // D/C할 처방이 없을 경우 return처리
- if( dcPrcpCnt > 0 ){
- if(submit("TXMNE00203") == true ){
- if(getNodesetCount("/root/temp/errlist") > 0){
- var iNode = "/root/srcdata/list/patlist";
- fShowModal("SPMNE00200");
- }
- if(pCnt < 1){
- fSelectInddPatList("S");
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.06.21
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사 처방 강제 Action 처리 부분(Acting상태값 처방 일괄 Acting)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveTestPrcpSave(){
- // 상태값 설저으로 인하여 Acting 조건 체크 로직 삭제 : 2008-01-21
- // var datacheck2 = "N";
- // var tRow = grd_testlist.rows;
- //
- // //마우스 드래그시 실시 검사 처방 여부 확인
- // for(i= 1 ; i <tRow; i++ ) {
- // if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
- // var datacheck2 = "Y";
- // }
- // }
- //
- // if(datacheck2 == "N" || grd_testlist.rows == "1"){
- // messageBox("미시행 검사 처방이 존재하지", "E007");
- // model.setFocus("button3");
- // return;
- // }else{
- // for(i=1 ; i < tRow ; i ++){
- // var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
- // if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "2" ){
- // if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){
- // if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "Y"){
- // messageBox(chkprcp+"는 이미 시행된 검사입니다.\n강제 Acting 할 수 없습니다.","I");
- // return;
- // }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
- // messageBox(chkprcp+"는 퇴원 후 외래 처방입니다.\n강제 Acting 할 수 없습니다.","I");
- // return;
- // }
- // }else{
- // messageBox(chkprcp +" 은 혈액처방 입니다.\n강제 Acting 할 수 없습니다.","E");
- // return;
- // }
- // }
- // }
- model.removenodeset("/root/send");
- model.makeValue("/root/send/searchpat", fSetPatInfo() );
- model.makeValue("/root/send/prcplist", grd_testlist.getUpdateDataAll("i"));
- model.removeNodeset("/root/main/incplist");
- submit("TXMNE00204");
-
- }
- /**
- * @group :
- * @ver : 2008.01.17
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검사처방 일괄 처리
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveTestPrcpAll(){
-
- model.removeNodeset("/root/testprcp/tmp");
- var tRow = grd_testlist.rows;
- var cntDC = 0;
- var cntACT = 0;
- var cntWard = 0 ;
-
- //상태 설정값 저장(병동이관)
- for(var i = 1 ; i<tRow ; i++){
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "1"){
- cntDC++;
- }
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "2"){
- cntACT++;
- }
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "3"){
- cntWard++;
- model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcpno" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno"));
- model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcphistno" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno"));
- model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcpdd" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd"));
- }
- }
-
- if(cntDC < 1 && cntACT < 1){
- messageBox("DC & Acting 할 처방이 존재하지 않습니다.", "I");
- return;
- }
-
- var vbYes = messageBox("DC : "+cntDC+" 건 Acting : "+cntACT+" 건 입니다.","Q004");
- if( vbYes == 6 ){
-
- if(cntDC > 0){ //DC 설정 스크립트 호출
- fPrcpDCSave("Test", cntACT);
- }
- if(cntACT > 0){ //Acting 설정 스크립트 호출
- fSaveTestPrcpSave();
- }
-
- //임시 저장된 상태 설정값 세팅(병동이관)
- for(var i = 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++ ){
- for(var j = 1 ; j <= getNodesetCount("/root/testprcp/tmp") ; j++ ){
- if(model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno") == model.getValue("/root/testprcp/tmp["+j+"]/prcpno") ){
- model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "3");
- }
- }
- }
- model.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2008.01.17
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 퇴원예고 환자 Cellstyle 변경 및 포커스 컬러 변경
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChangeFocusColor(){
- //var color = grd_patlist.cellstyle("background-color", grd_patlist.row, grd_patlist.col, grd_patlist.row, grd_patlist.col);
- //if(color == "#ffd3ff"){
- if(model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/dschdclrtyn") == "Y"){
- grd_patlist.cellstyle("background-color", grd_patlist.row, 0, grd_patlist.row, 4) = "#ffd3ff";
- grd_patlist.attribute("focuscolor") = "#00cc66";
- grd_patlist.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2008.01.17
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 클릭시 상대값 재조회(퇴원예고, 예정병실)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fResrchPatList(){
- var sRow = grd_patlist.row;
- var sSrchHeader = "pid▦indd▦cretno▩";
- var sSrchData = model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/pid" ) +"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/indd" ) +"▦"
- + model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/cretno") +"▩";
- model.removenode("/root/send");
- model.makeValue("/root/send/reqcond", sSrchHeader + sSrchData);
- if(submit("TRMNE00201", false) == true){
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/bedposcnts" , model.getValue("/root/temp/patinforesrch/patinfo/bedposcnts") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrtyn" , model.getValue("/root/temp/patinforesrch/patinfo/dschdclrtyn") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/chosdt" , model.getValue("/root/temp/patinforesrch/patinfo/chosdt") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrdt" , model.getValue("/root/temp/patinforesrch/patinfo/dschdclrdt") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/orddrid" , model.getValue("/root/temp/patinforesrch/patinfo/orddrid") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/roomcd" , model.getValue("/root/temp/patinforesrch/patinfo/roomcd") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/medispclid" , model.getValue("/root/temp/patinforesrch/patinfo/medispclid") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/assgroom" , model.getValue("/root/temp/patinforesrch/patinfo/assgroom") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/wardcd" , model.getValue("/root/temp/patinforesrch/patinfo/wardcd") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/prewardcd" , model.getValue("/root/temp/patinforesrch/patinfo/prewardcd") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/ordtype" , model.getValue("/root/temp/patinforesrch/patinfo/ordtype") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethdd" , model.getValue("/root/temp/patinforesrch/patinfo/dethdd") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethtm" , model.getValue("/root/temp/patinforesrch/patinfo/dethtm") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethyn" , model.getValue("/root/temp/patinforesrch/patinfo/dethyn") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/g3existyn" , model.getValue("/root/temp/patinforesrch/patinfo/g3existyn") );
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/inrsrvacptdt" , model.getValue("/root/temp/patinforesrch/patinfo/inrsrvacptdt") );
- //sdm
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/oxyconcen" , model.getValue("/root/temp/patinforesrch/patinfo/oxyconcen") );
- //model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/uncnfmcnt" , model.getValue("/root/temp/patinforesrch/patinfo/uncnfmcnt") );
- // 15.10.26 - 추가 AYS
- model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/fstexamorddd" , model.getValue("/root/temp/patinforesrch/patinfo/fstexamorddd") );
- // 15.10.26 - 추가 AYS
- model.removeNodeset("/root/temp/patinforesrch/patinfo");
- }
-
- if( model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrtyn") == "Y" ){
- fChangeFocusColor();
- //grd_patlist.cellstyle("background-color", sRow, 0, sRow, 4) = "#ffd3ff";
- //grd_patlist.attribute("focuscolor") = "#00cc66";
- }
- }
- //=====================================================================================
- // 아래는 약 D/C 시 투약기록에 반영및 투약기록 일자별 XSLT 생성하기(20080917) 김보성
- //=====================================================================================
- // 투약기록 통합기록을 위한 자료 추출질의문
- // prcpddprcpno으로 n개의 iprc에 대한 exip단위의 정보를 추출한다.
- function fnSignSaveCall(workflag, prcpddprcpno) {
- var sPathSign = "/root/signinfo";
- model.resetInstanceNode(sPathSign + "/reqsigncond");
- var pGrd = grd_patlist;
-
- var spid = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row + "]/pid"); //등록번호(필수)
- var sinstcd = getUserInfo("dutplceinstcd"); //기관코드(사용X)
- var sindd = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row +"]/indd"); //입원일자(필수)
- var scretno = ""; //생성번호(사용X)
- var sprcpdd = ""; //처방일자(PRN시 필수)
- var sprcpno = ""; //처방번호(확인사항)
- var sworkdd = ""; //투약일(일자그룹일때만 (필수))
- var slistflag = workflag; //작업구분(필수)
- var snursnm = getUserName(); //간호사명추가(필수)
- var shngnm = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row +"]/patnm"); //환자명추가 (필수)
- var smedrexecdd = ""; //화면에서저장할투약일자(사용X)
- var smedrexectm = ""; //화면에서저장할투약시간(사용X)
- var sprcpddprcpno = prcpddprcpno; //n개의 iprc
-
- model.setValue(sPathSign + "/reqsigncond/pid" ,spid ); //desc="등록번호"
- model.setValue(sPathSign + "/reqsigncond/instcd" ,sinstcd ); //desc="기관코드"
- model.setValue(sPathSign + "/reqsigncond/indd" ,sindd ); //desc="입원일자"
- model.setValue(sPathSign + "/reqsigncond/cretno" ,scretno ); //desc="생성번호"
- model.setValue(sPathSign + "/reqsigncond/prcpdd" ,sprcpdd ); //desc="처방일자"
- model.setValue(sPathSign + "/reqsigncond/prcpno" ,sprcpno ); //desc="처방번호"
- model.setValue(sPathSign + "/reqsigncond/workdd" ,sworkdd ); //desc="투약일"
- model.setValue(sPathSign + "/reqsigncond/listflag" ,slistflag ); //desc="작업구분"
- model.setValue(sPathSign + "/reqsigncond/nursnm" ,snursnm ); //desc="간호사명추가"
- model.setValue(sPathSign + "/reqsigncond/hngnm" ,shngnm ); //desc="환자명추가"
- model.setValue(sPathSign + "/reqsigncond/medrexecdd" ,smedrexecdd); //desc="화면에서저장할투약일자"
- model.setValue(sPathSign + "/reqsigncond/medrexectm" ,smedrexectm); //desc="화면에서저장할투약시간"
- model.setValue(sPathSign + "/reqsigncond/prcpddprcpno" ,sprcpddprcpno); //desc=""
- var sPathSign = "/root/signinfo";
- model.removenode(sPathSign + "/signsave/signdata");
- submit("TRMNR00608");
- }
-
- /**
- * @group :
- * @ver : 2008.08.31
- * @by : 김보성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 관련 인증저장(interface제공한 web에서 사용)(iprc단위 1개 처리용)
- * : 따라서 여러개의 iprc이면 n번 호출해야한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fnSignSaveWork() {
-
- var sSignPath = "/root/signinfo/signsave/signdata";
- var sSignPathCount = getNodesetCount(sSignPath);
- var sPathSignSave = "/root/signinfo/signsave/signdata";
- if ( sSignPathCount <= 0 ) {
- messageBox("자료가 존재하지 않습니다. ","E999");
- return false;
- }
-
- Sign.certreload = true ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 뜨도록 처리(20080922)
- model.removenode("/root/send/savedata");
- for(var j = 1; j <= getNodesetCount(sSignPath); j++){
- //alert("loop:"+j);
- sSignRow= j; //전역변수(프로그램내)
- if(Sign.signprocess() == false){//인증저장 데이터 생성fMake_SignData 호출
- Sign.certreload = false ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 안뜨도록 처리(20080922)
- return false;
- }
- Sign.certreload = false ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 안뜨도록 처리(20080922)
-
- model.setValue(sPathSignSave + "[" + j + "]/recdd", getCurrentDate()); //실제기록이 이루어진 기록일자
- model.setValue(sPathSignSave + "[" + j + "]/rectm", getCurrentTime()); //실제기록이 이루어진 기록시간
- model.setValue(sPathSignSave + "[" + j + "]/recsaveflag", "Y"); //전자서명인적정보변경여부
- model.setValue(sPathSignSave + "[" + j + "]/signflag", "02"); //서명자료구분(02:간호)
- model.setValue(sPathSignSave + "[" + j + "]/signgenrflag", "E"); //외래/입원구분
- model.setValue(sPathSignSave + "[" + j + "]/formcd", "0000002476"); //투약기록 서식번호
- model.setValue(sPathSignSave + "[" + j + "]/signbfcnts", Sign.signedInfos[1]); //인증할 데이터 정보(미기록 노드 제거된 정보)
- model.setValue(sPathSignSave + "[" + j + "]/signaftcnts", Sign.signedInfos[2]); //공인인증 처리후 데이터
- model.setValue(sPathSignSave + "[" + j + "]/signflagyn", "Y"); //비공식적으로 인증되지않도록 제어할수 있는기능
-
- //--------------------------(20080921)
- //건별인증은 통합기록조회에서 보이지 않고 일자별을 보이기 위해서
- //건별인증은 dispyn ='N'
- //하단의 일자별인 경우만 보임
- model.setValue(sPathSignSave + "[" + j + "]/dispyn", "N");
- //--------------------------(20080921)
- }
- return true;
- }
- //인증정보 말기
- function fMake_SignData(){
-
- //alert("fMake_SignData---------시작");
- /*
- <signinfo>
- <signdata>
- <pid>29953</pid>
- <hngnm>T입0820</hngnm>
- <prcpdd>20080821</prcpdd>
- <execdd>20080821</execdd>
- <prcpkindnm/>
- <prcpmixno/>
- <prcpcd>DSSL500</prcpcd>
- <prcpnm>Disal tab. 500mg (Salsalate)</prcpnm>
- <prcpvolnm>1500mg</prcpvolnm>
- <prcpqtynm>3T</prcpqtynm>
- <abbrnm>PO</abbrnm>
- <exectm>130000</exectm>
- <nursnm>김보성</nursnm>
- <execcarestatnm>정상투약</execcarestatnm>
- <carecfactnm> </carecfactnm>
- <orddrnm>김만수</orddrnm>
- </signdata>
- </signinfo>
- */
-
- var ssigndruglist = "/root/signinfo/signsave/signdata";
-
- var spid = model.getValue(ssigndruglist + "[" + sSignRow + "]/pid");
- var shngnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/hngnm");
- var sprcpdd = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpdd");
- var sexecdd = model.getValue(ssigndruglist + "[" + sSignRow + "]/execdd");
- /*
- ,CASE WHEN a.careprnexecflag = 'P' THEN 'PRN' ELSE '' END || ' ' ||
- CASE WHEN a.anticncrprtlno <> 0 THEN '항암' ELSE '' END || ' ' ||
- CASE WHEN a.dccountyn = 'Y' AND a.selfdrugflag = 'Y' THEN 'self D/C'
- WHEN a.dccountyn = 'Y' then 'D/C'
- WHEN a.selfdrugflag = 'Y' then 'self'
- END prcpkindnm
- //처방종류명 (다른업무에서 투약기록관련인증정보를 생성시 어려운 항목
- */
- var sprcpkindnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpkindnm");
- var sprcpmixno = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpmixno");
- var sprcpcd = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpcd");
- var sprcpnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpnm");
- var sprcpvolnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpvolnm");
- var sprcpqtynm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpqtynm");
- var sabbrnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/abbrnm");
- var sexectm = model.getValue(ssigndruglist + "[" + sSignRow + "]/exectm");
- var snursnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/nursnm");
- var sexeccarestatnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/execcarestatnm");
- var scarecfactnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/carecfactnm");
- var sorddrnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/orddrnm");
-
- model.resetInstanceNode("/root/send/signinfo/signdata");
- model.makeValue("/root/send/signinfo/signdata/pid", spid );
- model.makeValue("/root/send/signinfo/signdata/hngnm", shngnm );
- model.makeValue("/root/send/signinfo/signdata/prcpdd", sprcpdd ); //처방일자
- if(sexecdd == "00000000"){ //투약일자
- model.makeValue("/root/send/signinfo/signdata/execdd", "");
- }else{
- model.makeValue("/root/send/signinfo/signdata/execdd", sexecdd);
- }
-
- model.makeValue("/root/send/signinfo/signdata/prcpkindnm", sprcpkindnm );
- model.makeValue("/root/send/signinfo/signdata/prcpmixno", sprcpmixno ); //MIXNO
-
- model.makeValue("/root/send/signinfo/signdata/prcpcd", sprcpcd ); //처방코드
- model.makeValue("/root/send/signinfo/signdata/prcpnm", sprcpnm ); //처방명
- model.makeValue("/root/send/signinfo/signdata/prcpvolnm", sprcpvolnm ); //용량단위명칭(용량+용량단위명칭)
- model.makeValue("/root/send/signinfo/signdata/prcpqtynm", sprcpqtynm ); //수량단위명칭(수량+수량단위명칭)
- //투여방법약어명(다른업무에서 투약기록관련인증정보를 생성시 어려운 항목)
- model.makeValue("/root/send/signinfo/signdata/abbrnm", sabbrnm );
- if(sexectm == "000000"){ //투약시간
- model.makeValue("/root/send/signinfo/signdata/exectm", "");
- }else{
- model.makeValue("/root/send/signinfo/signdata/exectm", sexectm);
- }
- model.makeValue("/root/send/signinfo/signdata/nursnm", snursnm); //간호사명칭
- if(sexeccarestatnm == "") sexeccarestatnm = "N";
- //미확인,정상투약,투약X-반환가능,투약X-반환불가,퇴원당일남은약
- //(다른업무에서 투약기록관련인증정보를 생성시 정상투약,)
- model.makeValue("/root/send/signinfo/signdata/execcarestatnm", sexeccarestatnm);
- //간호사REMARK CODE에 대한 REMARK 명칭((다른업무에서 투약기록관련인증정보를 생성시 공백)
- model.makeValue("/root/send/signinfo/signdata/carecfactnm", scarecfactnm);
- //진료의명(다른업무에서 투약기록관련인증정보를 생성시 어려운 항목)
- model.makeValue("/root/send/signinfo/signdata/orddrnm", sorddrnm);
-
- Sign.addnode("/root/send/signinfo/signdata");
- //alert("fMake_SignData---------종료");
- //Sign.signedInfos[1] 는 없음
- //alert("fmake_signdata"+ Sign.signedInfos[1] );
- }
- //일자별 XSLT 생성작업
- function fnWorkddSign(signDates) {
- //-----------------------------------------------)
- // 투약기록을 일자별로 XLST를 만들기 위해서
- //-----------------------------------------------
- var sPathSign = "/root/signinfo";
- var pGrd = grd_patlist;
- var signDate = "";
-
- //alert(signDates.length);
- for (var i=0;i<signDates.length;i++) {
- signDate = "" + signDates[i];
- //alert("1:" + signDate);
- if ( signDate != "") {
- model.resetInstanceNode(sPathSign + "/reqsigncond");
- signDate = signDate.replace("-","");
- //alert("2:" + signDate);
-
- var spid = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/pid"); //등록번호 (필수)
- var sinstcd = "";//model.getValue("/root/main/inddpatlist/inddpatinfo/instcd"); //기관코드 (사용X)
- var sindd = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/indd"); //입원일자 (필수)
- var scretno = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/cretno");//생성번호 (사용X)
- var sprcpdd = ""; //처방일자 (PRN시 필수)
- var sprcpno = ""; //처방번호 (확인사항)
- var sworkdd = signDate; //model.getValue("/root/main/cond/orddd"); //투약일(일자그룹일때만 (필수)
- var slistflag = "90"; //작업구분 (필수)
- var snursnm = getUserName(); //간호사명추가 (필수)
- var shngnm = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/patnm") //환자명추가 (필수)
- var smedrexecdd = ""; //화면에서저장할투약일자(사용X)
- var smedrexectm = ""; //화면에서저장할투약시간(사용X)
-
- model.setValue(sPathSign + "/reqsigncond/pid" ,spid ); //desc="등록번호"
- model.setValue(sPathSign + "/reqsigncond/instcd" ,sinstcd ); //desc="기관코드"
- model.setValue(sPathSign + "/reqsigncond/indd" ,sindd ); //desc="입원일자"
- model.setValue(sPathSign + "/reqsigncond/cretno" ,scretno ); //desc="생성번호"
- model.setValue(sPathSign + "/reqsigncond/prcpdd" ,sprcpdd ); //desc="처방일자"
- model.setValue(sPathSign + "/reqsigncond/prcpno" ,sprcpno ); //desc="처방번호"
- model.setValue(sPathSign + "/reqsigncond/workdd" ,sworkdd ); //desc="투약일"
- model.setValue(sPathSign + "/reqsigncond/listflag" ,slistflag ); //desc="작업구분"
- model.setValue(sPathSign + "/reqsigncond/nursnm" ,snursnm ); //desc="간호사명추가"
- model.setValue(sPathSign + "/reqsigncond/hngnm" ,shngnm ); //desc="환자명추가"
- model.setValue(sPathSign + "/reqsigncond/medrexecdd" ,smedrexecdd); //desc="화면에서저장할투약일자"
- model.setValue(sPathSign + "/reqsigncond/medrexectm" ,smedrexectm); //desc="화면에서저장할투약시간"
-
- var pFlag = "Drug"; //저장구분 (Drug : 투약기록)
- var pNode1 = ""; //조회할 조건 PATH(의미없음)
- var pNode2 = "/root/signinfo/signdruginfo/signdruglist"; //Return 리스트 PATH
-
- //alert("signDate:" + i + "/" + signDate);
- //임시로 막음(test)
- fCare_SignNode(pFlag, pNode1, pNode2,spid,sindd,scretno,"E"); //-----(20080917)수정
- //fCare_SignNode(pFlag, pNode1, pNode2, pPid, pIndd, pCretno, pIoflag){
- }
- }
- }
-
- //일자별 인증정보를 묶을 일자를 찾는다
- //넣어야 할지는 판단한다.
- function signdayFind(signDates,findDate) {
- var sreturn = false;
- if (findDate == "00000000" || findDate == "") {
- } else {
- //alert("signDates.length:"+ signDates.length);
- for (var i=0;i<signDates.length;i++) {
- //alert("비교:" + signDates[i] + "/" + findDate);
- sreturn = true;
- if ( signDates[i] == findDate) {
- sreturn = false;
- break;
- }
- }
- }
- return sreturn;
- }
- //=====================================================================================
- //** 응급실에서 투약신청, 즉시불출신청시 투약번호라벨 출력 수정_20090522(ByJA) **//
- function fERCareDrugNoLabel2(pid, patnm, sexage, drugno, narcyn, fstcmd, scndcmd){
- //1. 바코드 라벨 설정값 조회
- var scrnid = "SMMNR00600";
- model.removeNodeset("/root/main/barcdprntsetup");
- fGetBarCodeInfo(scrnid); // CareCom.js
- lzzfMakeBrcdPrntObjHanDo("CommAX");
-
- //2. 바코드 라벨 환경설정
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
- var portOpenTF = fSetNursBarcdInfo(barcdRef); // CareCom.js 바코드프린터별 환경설정(Zebra,SATO)
-
- //3. 투약번호라벨 출력
- fPrtERCareDrugNoLabel("erdsch", barcdRef, pid, patnm, sexage, drugno, getCurrentDateTime(), fstcmd, scndcmd, narcyn, portOpenTF);
-
-
- /* 원본_20090522(ByJA)
- // 바코드OCX 생성
- if(document.all("CommAX") == null){
- lzzfMakeBrcdPrntObjHanDo("CommAX");
- }
-
- // 바코드 라벨 초기 설정값 조회
- var scrnid = "SMMNR00600";
- // fGetBarCodeInfo(scrnid); // CareCom.js
- model.removeNodeset("/root/main/barcdprntsetup");
- model.resetInstanceNode("/root/send/reqdata");
- model.makeValue("/root/send/scrnid", scrnid);
- submit("TRLLC90101");
-
- // 바코드 라벨 환경설정
- var sSndMsg = "";
- var portOpenTF = ""; //오픈 성공 여부
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
- // fSettingBarCode(barcdRef); // CareCom.js
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
- var sCommKind = model.getValue(barcdRef + "[1]/commkind");
- if(sCommKind == "01") {
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- }else if(sCommKind == "02") {
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm");
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit");
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit");
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate");
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity");
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm02/setupval"); // 20080802추가(ByJA)
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- portOpenTF = CommAX.PortOpen(true);
- }else if(sCommKind == "03") {
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
- if(portOpenTF == "TRUE"){
- var iLeft = model.getValue(barcdRef + "/blank/left");
- var iTop = model.getValue(barcdRef + "/blank/top");
-
- if(iLeft == "" || iLeft == "-"){
- iLeft = 0;
- }
- if(iTop == "" || iTop == "-"){
- iTop = 0;
- }
-
- // BP_StartFormat
- var sData = "^XA^LH0,20";
- var sFstData, sScndData;
-
- var prtdt = getCurrentDateTime().substr(0,4) + "/";
- prtdt += getCurrentDateTime().substr(4,2) + "/";
- prtdt += getCurrentDateTime().substr(6,2) + " ";
- prtdt += getCurrentDateTime().substr(9,2) + ":";
- prtdt += getCurrentDateTime().substr(11,2);
-
- sData += fCarePrintOutA (iLeft+ 50, iTop+10, 3, "N", pid, "");
- sData += fCarePrintOutH2 (iLeft+ 45, iTop+60, 3, "N", patnm, "");
- sData += fCarePrintOutA (iLeft+245, iTop+75, 4, "N", sexage, "");
- sData += fCarePrintOutA (iLeft+120, iTop+130, 5, "N", drugno, "");
- sData += fCarePrintOutH2 (iLeft+320, iTop+130, 4, "N", narcyn, "");
- sData += fCarePrintOutA (iLeft+ 60, iTop+205, 3, "N", prtdt, "");
-
- // (약국)
- sFstData = sData + fCarePrintOutH (iLeft+ 350, iTop+10, 3, "Y", fstcmd, "");
- sFstData += fCareBP_EndFormat("1");
- CommAX.SendMessage(sFstData);
-
- // (간호)
- sScndData = sData + fCarePrintOutH (iLeft+350, iTop+10, 3, "Y", scndcmd, "");
- sScndData += fCareBP_EndFormat("1");
- CommAX.SendMessage(sScndData);
-
- CommAX.PortOpen("false");
- } else {
- messageBox("투약번호표를 출력하지 못했습니다. 아래 사항을 확인하십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 연결 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 출력가능)", "I", "");
- return;
- }
- */
- }
- //** 응급실에서 투약신청, 즉시불출신청시 투약번호라벨 출력 추가_20081230(ByJA) **//
- function fTransferSMS(){
-
- var userid = getUserInfo("userid");
- var usernm = getUserInfo("usernm");
-
- var patnm = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/patnm");
- var bedposcnts = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/bedposcnts");
- var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid");
- var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd");
- var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno");
- var orddept = getPatientInfo("orddept");
- var instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd");
-
- var msg = orddept + " " + pid + " " + patnm + "(" + bedposcnts + ")님 전원퇴실입니다."
-
- var rtn = messageBox(msg + "\n\n응급당직교수에게 SMS를 전송하시겠습니까?", "Q999");
-
- if (rtn == 6) {
-
- model.removeNodeset("/root/main/callno");
- submit("TRMNE00206");
- var callno = model.getValue("/root/main/callno/callno");
-
- model.removeNodeset("/root/main/smsyn");
- model.makeValue("/root/send/smsmsg/log/pid", pid);
- model.makeValue("/root/send/smsmsg/log/indd", indd);
- model.makeValue("/root/send/smsmsg/log/cretno", cretno);
- submit("TRMNE00207");
- var smsyn = model.getValue("/root/main/smsyn/smsyn");
-
- if (smsyn == 'Y') {
- var rtn1 = messageBox("이미 응급당직교수에게 전원 퇴실에 대한 SMS가 발송된 환자입니다.\n\n다시한번 SMS를 전송하시겠습니까?", "Q999");
- }
-
- if (smsyn == 'N' || rtn1 == '6') {
-
- // 응급실 코디네이터 문자 추가 송부 관련 수정_AYS_16.06.16
- for(var i= 1 ; i <= getNodesetCount("/root/main/callno") ; i++){
- //alert("for callno : " + i + );
- model.makeValue("/root/send/smsmsg/recvr["+i+"]/usernm", usernm);
- model.makeValue("/root/send/smsmsg/recvr["+i+"]/userid", userid);
- model.makeValue("/root/send/smsmsg/recvr["+i+"]/mpphonno", model.getValue("/root/main/callno["+i+"]/callno"));
- model.makeValue("/root/send/smsmsg/recvr["+i+"]/usernm", "응급의료센터");
- }
-
- // model.makeValue("/root/send/smsmsg/recvr/usernm", usernm);
- // model.makeValue("/root/send/smsmsg/recvr/userid", userid);
- // model.makeValue("/root/send/smsmsg/recvr/mpphonno", callno);
- // model.makeValue("/root/send/smsmsg/recvr/usernm", "응급의료센터");
-
- model.makeValue("/root/send/smsmsg/req/calltype", "call");
- model.makeValue("/root/send/smsmsg/req/msgcnts", msg);
- if (instcd == "031") {
- model.makeValue("/root/send/smsmsg/req/calltelno", "0532005100");
- }
- else {
- model.makeValue("/root/send/smsmsg/req/calltelno", "0532002100");
- }
-
- model.makeValue("/root/send/smsmsg/info/pid", pid);
- model.makeValue("/root/send/smsmsg/info/indd", indd);
- model.makeValue("/root/send/smsmsg/info/userid", userid);
- model.makeValue("/root/send/smsmsg/info/cretno", cretno);
-
- if (submit("TXMNE00205") ) {
- messageBox("메시지 전송이 ", "I002");
- }
- }
- }
- }
|