/* Åõ¾à±â·Ï(SMMNR04500_Åõ¾à±â·Ï Á¶È¸.xrw - JScript ) - Version : 1) : Ver.1.00.01 */ var xCondPath = "/root/main/cond"; var xDrugListPath = "/root/main/druglist/druglist"; var xWardPatListPath = "/root/main/wardpatinfo/wardpatlist"; var xPatInfoPath = "/root/main/paminfo/pamlist"; var xDschPatInfoPath = "/root/main/patinfo/patinfolist"; /** * @group : * @ver : 2007.06.23 * @by : ÃÖ°æ¿ë * @--------------------------------------------------- * @type : function * @access : public * @desc : Åõ¾à±â·Ï Á¶È¸ ÃʱⰪ ¼ÂÆÃ ¹× ÃʱâÁ¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fInitialize(){ // ÀÏÀÚ ÃʱâÈ­ fnDateInit(); // ȯÀÚÁ¤º¸ Á¶È¸ var sPamInfo = getGlobalVariable("paminfo"); setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist"); var sPID = model.getValue(xPatInfoPath + "/pid"); var sIndd = model.getValue(xPatInfoPath + "/indd"); var sCretno = model.getValue(xPatInfoPath + "/cretno"); var sWardCd = model.getValue(xPatInfoPath + "/wardcd"); var sRoomCd = model.getValue(xPatInfoPath + "/roomcd"); submit("TRMNR00601"); grd_druglist.removeRow(true); grd_patlist.removeRow(true); if(sPID == ""){ model.setValue("/root/main/cond/wardcd", getUserInfo("dutplcecd")); fGetPatList(); //-----------------------------(20080906) fSetsettingrnid(); //-----------------------------(20080906) fGetRoomList(); }else if(model.getValue("/root/hidden/cond/pid") != ""){//º¸Çè model.setValue(xCondPath + "/pid", model.getValue("/root/hidden/cond/pid")); model.setValue(xCondPath + "/pid_search", model.getValue("/root/hidden/cond/pid")); model.setValue(xCondPath + "/indd", model.getValue("/root/hidden/cond/indd")); model.setValue(xCondPath + "/cretno", model.getValue("/root/hidden/cond/cretno")); //----------------(20080715) model.setValue(xCondPath + "/medfromdd", model.getValue("/root/hidden/cond/medrfromdd")); model.setValue(xCondPath + "/medtodd", model.getValue("/root/hidden/cond/medrtodd")); //------------------ fGetPatList(); //-----------------------------(20080906) fSetsettingrnid(); //-----------------------------(20080906) fGetRoomList(); grd_patlist.row = 1; grd_patlist.dispatch("onentercell"); fGetDrugList(); }else{//»ó´ÜÁ¤º¸ model.setValue(xCondPath + "/wardcd", sWardCd); fGetPatList(); //-----------------------------(20080906) fSetsettingrnid(); //-----------------------------(20080906) model.setValue(xCondPath + "/roomcd", sRoomCd); fGetRoomList(); for(var i = 1; i <= getNodesetCount(xWardPatListPath); i++){ if(model.getValue(xWardPatListPath + "[" + i + "]/pid") == sPID){ model.setFocus("grd_patlist"); grd_patlist.row = i; grd_patlist.dispatch("onentercell"); fGetDrugList(); } } } //¿øº» grd_druglist.frozenCols = grd_druglist.colRef("prcpvol"); grd_druglist.frozenCols = grd_druglist.colRef("abbrnm"); // [TASK¹øÈ£:33173] Åõ¾à±â·ÏÁ¶È¸ Ʋ °íÁ¤ : ~ °æ·Î±îÁö_20091008(ByJA) model.refresh(); } /** * @group : * @ver : 2008.09.06 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : ³»È¯ÀÚ°¡ ¼³Á¤µÇ¾î ÀÖÀ¸¸é ÀÚµ¿À¸·Î ³»È¯ÀÚ¼³Á¤½Ã۱â(¼º°ø) * @param : * @param : * @return : * @--------------------------------------------------- */ function fSetsettingrnid(){ var sUserId = getUserId(); var sUserIdFind = "" for(i = 1; i <= getNodesetCount("/root/main/wardpatinfo/settingrn"); i++ ) { sUserIdFind = model.getValue("/root/main/wardpatinfo/settingrn["+ i +"]/settingrnid"); if (sUserId == sUserIdFind) { model.setValue("/root/main/cond/settingrnid", sUserIdFind); model.refresh(); fGetPatList(); return; } } } /** * @group : * @ver : 2007.06.23 * @by : ÃÖ°æ¿ë * @--------------------------------------------------- * @type : function * @access : public * @desc : Åõ¾à±â·Ï º´µ¿º° º´½Ç ¸®½ºÆ® Á¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fGetRoomList(){ if(model.getValue(xCondPath + "/settingrnid") == ""){ model.setValue(xCondPath + "/roomflag", ""); }else{ model.setValue(xCondPath + "/roomflag", "settingrnid"); } model.resetInstanceNode("/root/send/reqdata"); model.copynode("/root/send/reqdata", xCondPath); //----------------------(20080922) model.removenodeset("/root/main/druglist/druglist"); //----------------------(20080922) submit("TRMNR00602"); } /** * @group : * @ver : 2007.06.23 * @by : ÃÖ°æ¿ë * @--------------------------------------------------- * @type : function * @access : public * @desc : Åõ¾à±â·Ï Á¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fGetDrugList(){ var row = grd_patlist.row; var pid = ""; var indd = ""; var cretno = ""; //---------------------(20080510) // ȯÀÚÁ¤º¸ º¸À̱â if (row > 0 ) { model.setValue("/root/main/pidinfo/roomcd", model.getValue(xWardPatListPath + "[" + row + "]/roomcd")); model.setValue("/root/main/pidinfo/pid", model.getValue(xWardPatListPath + "[" + row + "]/pid")); model.setValue("/root/main/pidinfo/patnm", model.getValue(xWardPatListPath + "[" + row + "]/patnm")); model.setValue("/root/main/pidinfo/sa", model.getValue(xWardPatListPath + "[" + row + "]/sexage")); model.setValue("/root/main/pidinfo/rrgstno", model.getValue(xWardPatListPath + "[" + row + "]/rrgstno")); } //------------------------------------------------- if(model.getValue(xCondPath + "/acpstatyn") == "true"){//µî·Ï¹øÈ£·Î Á¶È¸½Ã //model.resetInstanceNode("/root/send/reqdata"); model.setValue(xCondPath + "/pid", xCondPath + "/pid_search"); model.removeNode("/root/send/reqdata"); model.makeNode("/root/send/reqdata"); model.copynode("/root/send/reqdata", xCondPath); submit("TRMNR04501"); }else{//ȯÀÚ ¸®½ºÆ®¿¡¼­ Á¶È¸½Ã if(row > 0){ pid = model.getValue(xWardPatListPath + "[" + row + "]/pid"); indd = model.getValue(xWardPatListPath + "[" + row + "]/indd"); cretno = model.getValue(xWardPatListPath + "[" + row + "]/cretno"); model.setValue(xCondPath + "/pid", pid); model.setValue(xCondPath + "/indd", indd); model.setValue(xCondPath + "/cretno", cretno); //model.resetInstanceNode("/root/send/reqdata"); model.removeNode("/root/send/reqdata"); model.makeNode("/root/send/reqdata"); model.copynode("/root/send/reqdata", xCondPath); submit("TRMNR04501"); }else{ messageBox("ȯÀÚ ¸®½ºÆ®°¡ ¼±ÅõÇÁö","E007"); } } } /** * @group : * @ver : 2007.06.23 * @by : ÃÖ°æ¿ë * @--------------------------------------------------- * @type : function * @access : public * @desc : ȯÀÚ¸í Á¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fGetPatList(){ model.setValue(xCondPath + "/acpstatflag", "A");//Àç¿øÈ¯ÀÚ¸¸ model.resetInstanceNode("/root/send/reqdata"); model.copynode("/root/send/reqdata", xCondPath); submit("TRMNR00603"); } /** * @group : * @ver : 2008.05.10 * @by : ±èº¸¼º * @--------------------------------------------------- * @type : function * @access : public * @desc : Á¶È¸ÀÏÀÚ ÃʱâÈ­ * @param : * @param : * @return : * @--------------------------------------------------- */ function fnDateInit() { model.setValue("/root/main/cond/medfromdd", getDateAddc(getCurrentDate(), -7)); model.setValue("/root/main/cond/medtodd", getCurrentDate()); } /** * @group : * @ver : 2008.05.10 * @by : ±èº¸¼º * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀÔ¿øÀÏÀÚ Á¤º¸ Á¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fnhisindd() { var pGrd = grd_patlist; var row = pGrd.row; // if (row <= 1 ) return; if (bool_acptstat.value == "true") { cap_hisindd.visible = true; cbo_hisindd.visible = true; } else { cap_hisindd.visible = false; cbo_hisindd.visible = false; } //var pid = model.getValue(xWardPatListPath + "[" + row + "]/pid"); var pid = model.getValue("/root/main/cond/pid_search"); model.setValue(xCondPath + "/pid", pid); model.resetInstanceNode("/root/send/reqdata"); model.copynode("/root/send/reqdata", xCondPath); submit("TRMNR04502"); if (pid == '') return; if (cbo_hisindd.length < 1) { messageBox("ÀÔ¿øÁ¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù","E999"); } else { messageBox(cbo_hisindd.length + " °ÇÀÇ ÀÔ¿øÁ¤º¸°¡ Á¸ÀçÇÕ´Ï´Ù","E999"); fnhisinddmove(); } } /** * @group : * @ver : 2008.05.10 * @by : ±èº¸¼º * @--------------------------------------------------- * @type : function * @access : public * @desc : his indd -> Á¶È¸ÀÏÀÚ À̵¿ * @param : * @param : * @return : * @--------------------------------------------------- */ function fnhisinddmove() { var hisindd = model.getValue("/root/main/cond/hisindd"); if ( isNull(hisindd)) return; var indds = hisindd.split("-"); var indd = indds[0]; //ÀÔ¿øÀÏÀÚ var dschdd = indds[1]; //Åð¿øÀÏÀÚ var cretno = indds[2]; //ÀÔ¿ø»ý¼º¹øÈ£ (20080922) var medfromdd = indd; var medtodd = ( dschdd == "99991231" ? getCurrentDate() : dschdd ); var dschddM90 = medtodd.toDate().getAddDate(-90, "D").getDateFormat(); if ( dschddM90 > indd ){ medfromdd = dschddM90; } model.setValue("/root/main/cond/medfromdd", medfromdd); model.setValue("/root/main/cond/medtodd", medtodd); model.setValue("/root/main/cond/cretno", cretno); //---(20080922) model.setValue("/root/main/cond/indd", indd); //---(20080922) model.setValue("/root/main/cond/wardcd",""); //---(20080922) model.setValue("/root/main/cond/roomcd",""); //---(20080922) model.setValue("/root/main/cond/prcpkindcd",""); //---(20080922) model.setValue("/root/main/cond/prcpcd",""); //---(20080922) model.removenodeset("/root/main/wardpatinfo/wardpatlist"); //---(20080922) model.refresh(); inp_medfromdd.refresh(); inp_medtodd.refresh(); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ȯÀÚÁ¤º¸ °¡Á®¿À±â */ /* param : °Ë»ö±¸ºÐ */ /* return : */ /* --------------------------------------------------*/ function fSearchPatInfo(qryflag) { var sPath1 = "/root/main/cond"; var sPath2 = "/root/main/patinfo/patinfolist"; model.removenodeset("/root/temp/pidinfo"); model.makeValue("/root/temp/pidinfo/pid", model.getValue(sPath1 + "/pid_search")); model.makeValue("/root/temp/pidinfo/srchcond","1"); if (qryflag == "1") { model.makeValue("/root/temp/pidinfo/autoflag","Y"); } else { model.makeValue("/root/temp/pidinfo/autoflag","N"); } //modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send"); 17863430 //modal("../../../pam/commonweb/xrw/SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/source", "/root/send"); modal("SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/temp/pidinfo", "/root/send"); //ȯÀÚ¹øÈ£ copy var popupendflag = model.getValue("/root/main/popupendflag"); if (popupendflag == "ok"){ model.setValue(sPath1 + "/pid_search" , model.getValue(sPath2 + "/pid") ); model.setValue(sPath1 + "/hngnm_search", model.getValue(sPath2 + "/hngnm") ); model.setValue("/root/main/pidinfo/roomcd", ""); model.setValue("/root/main/pidinfo/pid", model.getValue(xDschPatInfoPath + "/pid")); model.setValue("/root/main/pidinfo/patnm", model.getValue(xDschPatInfoPath + "/hngnm")); model.setValue("/root/main/pidinfo/sa", model.getValue(xDschPatInfoPath + "/sex") + "/" + model.getValue(xDschPatInfoPath + "/age") ); model.setValue("/root/main/pidinfo/rrgstno",model.getValue(xDschPatInfoPath + "/rrgstno1") + "-" + model.getValue(xDschPatInfoPath + "/rrgstno2").substring(0,1) +"******"); } else { model.setValue("/root/main/pidinfo/roomcd", ""); model.setValue("/root/main/pidinfo/pid", ""); model.setValue("/root/main/pidinfo/patnm", ""); model.setValue("/root/main/pidinfo/sa", ""); model.setValue("/root/main/pidinfo/rrgstno",""); } model.refresh(); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ȯÀÚ¿¡ ´ëÇÑ ÀÔ¿øÁ¤º¸ ÃßÃâ */ /* param : °Ë»ö±¸ºÐ */ /* return : */ /* --------------------------------------------------*/ function fSearchPatInddInfo() { //µî·Ï¹øÈ£Ã¼Å© : ÀÌÀü ±â´ÉÀ¸·Î ¸·À½ if (model.getValue("/root/main/cond/hngnm_search") != "") { bool_acptstat.value = "true"; } //ÄÞº¸¿­±â fnhisindd(); model.setFocus("cbo_hisindd"); cbo_hisindd.select(0); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : È­¸éÃʱâÈ­(20080819) */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fQueryinit() { // ÀÏÀÚ ÃʱâÈ­ fnDateInit(); bool_acptstat.value = "false"; // ÄÞº¸¼û±â±â cap_hisindd.visible = false; cbo_hisindd.visible = false; // Á¶°Ç ÃʱâÈ­ model.setValue("/root/main/pidinfo/roomcd", ""); model.setValue("/root/main/pidinfo/pid", ""); model.setValue("/root/main/pidinfo/patnm", ""); model.setValue("/root/main/pidinfo/sa", ""); model.setValue("/root/main/pidinfo/rrgstno",""); model.refresh(); } /** * @group * @ver : 2009.06.16 * @by : ÃÖ¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : Ãâ·Â±â´É * @param : * @return : * @--------------------------------------------------- */ function fExecPrint(){ // Ãâ·ÂÇÒ µ¥ÀÌÅͰ¡ ¾ø´Â °æ¿ì if(getNodesetCount("/root/main/druglist/druglist")==0){ messageBox("Ãâ·ÂÇÒ µ¥ÀÌÅͰ¡", "I004"); return; }else{ model.removeNodeset("/root/hidden/druglist"); model.makeNode("/root/hidden/druglist"); model.copyNode("/root/hidden/druglist", "/root/main/druglist"); // for(var i=1;i