/* - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì TherapyÀÏÁ¤°ü¸® ( SMAEB02800_TherapyÀÏÁ¤°ü¸®.xrw - JScript ) - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì */ var sTHERPLIST_PATH = "/root/main/therpinfo/therplist"; /** * @desc : TherapyÀÏÁ¤°ü¸® ÃʱâÈ­ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fInitialize_SMAEB02800(){ //Á¶È¸±â°£ ½ÃÀÛÀÏÀÚ´Â ÇöÀç, Á¾·áÀÏÀÚ´Â 7ÀÏ ÈÄ·Î ¼³Á¤ÇÑ´Ù. model.setValue("/root/init/today", getCurrentDate()); model.setValue("/root/main/cond/fromdd", model.getValue("/root/init/today")); var todd = ((getCurrentDate()).toDate()).getAddDate(7); model.setValue("/root/main/cond/todd" , todd.getDateFormat()); //ÄÞº¸¹Ú½º¿¡ ¼³Á¤µÉ ºÎ¼­¸®½ºÆ® Á¶È¸ reqGetDeptList("/root/send/reqdata", "/root/init/deptlist", "", getUserInfo("dutplceinstcd")); //ÄÞº¸¹Ú½º¿¡ ¼³Á¤µÈ º´½Ç¸®½ºÆ® Á¶È¸ reqGetRoomList("3050123000"); //TherapyÀÏÁ¤¸®½ºÆ® ±×¸®µå ÃʱâÈ­ model.removeNodeset(sTHERPLIST_PATH); model.refresh(); } /** * @desc : Therapy ÀÏÁ¤¸®½ºÆ® ÇÑÁÙ Ãß°¡ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fAddRow(){ //±×¸®µå ÇÑÁÙ Ãß°¡ ÈÄ¿¡ refresh, disabled»óÅ À¯Áö ¸ðµÎ true grd_therapy.addRow(); var iRow = grd_therapy.row; model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/genrdd", model.getValue("/root/init/today")); //¿¹¾àÀÏÀÚ´Â ±âº»À» ÇöÀçÀÏÀÚ·Î ¼³Á¤ model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/rsrvdd", model.getValue("/root/init/today")); grd_therapy.col = 4; grd_therapy.editCell(); model.refresh(); } /** * @desc : Therapy ÀÏÁ¤ ÀúÀå * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fSaveTherapyInfo(){ if(fChkValidSaveData()==true){ model.setValue("/root/send/savedata", grd_therapy.getUpdateData()); submit("TXAEB02801"); } } /** * @desc : Therapy ÀÏÁ¤ Á¶È¸ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fReqTherapyInfo(){ model.copyNode("/root/send/reqdata", "/root/main/cond"); submit("TRAEB02801"); } /** * @desc : Therapy ÀÏÁ¤ »èÁ¦ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fDelRow(){ var iRow = grd_therapy.row; var iStatus = grd_therapy.rowStatus(iRow); if(iStatus == 1 || iStatus == 3){ grd_therapy.deleteRow(iRow); }else{ grd_therapy.rowStatus(iRow) = 4; } } /** * @desc : ȯÀÚÁ¤º¸ È®Àιöư Ŭ¸¯ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fClkCfrmBtn(){ var iRow = grd_patinfopopup.row; fSetPatInfo(iRow); group1.attribute("height") = 0; btn_add.disabled = false; btn_del.disabled = false; btn_save.disabled= false; btn_req.disabled = false; btn_getpatinfo.disabled = false; } /** * @desc : ȯÀÚÁ¤º¸ Á¶È¸ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fReqPatInfo(paramflag, param, param2){ var iRow = grd_therapy.row; if(reqPatInfo(paramflag, "otpt", param, param2) == true){ //ȯÀÚÁ¤º¸ Á¶È¸ var iCnt = getNodeSetCnt("/root/init/patnm/patnm"); if(iCnt > 1){ //Á¶È¸°á°ú°¡ µÎ ÁÙ ÀÌ»óÀÎ °æ¿ì, grid¸¦ È­¸é¿¡ º¸¿©ÁØ´Ù. group1.attribute("top") = 116 + (23 * (grd_therapy.rows - 2)); group1.attribute("height") = 170; btn_add.disabled = true; btn_del.disabled = true; btn_save.disabled= true; btn_req.disabled = true; btn_getpatinfo.disabled = true; }else{ fSetPatInfo(1); //Á¶È¸°á°ú°¡ ÇÑ ÁÙÀÎ °æ¿ì, grid¸¦ º¸¿©ÁÖ´Â °Í ¾øÀÌ ¹Ù·Î °á°ú°ªÀ» setting } }else{ model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , ""); model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", ""); model.refresh(); } } /** * @desc : ȯÀÚÁ¤º¸ ¼³Á¤ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fSetPatInfo(iRow){ sPid = model.getValue("/root/init/patnm/patnm[" + iRow + "]/pid"); sHngNM = model.getValue("/root/init/patnm/patnm[" + iRow + "]/hngnm"); sDeptCD = model.getValue("/root/init/patnm/patnm[" + iRow + "]/deptcd"); sDrID = model.getValue("/root/init/patnm/patnm[" + iRow + "]/drid"); sDrNM = model.getValue("/root/init/patnm/patnm[" + iRow + "]/drnm"); var iCurRow = grd_therapy.row; model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/pid", sPid); model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/hngnm", sHngNM); model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddeptcd", sDeptCD); model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddrid", sDrID); model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddrnm", sDrNM); model.refresh(); } /** * @desc : ȯÀÚÁ¤º¸ Ãë¼Ò¹öư Ŭ¸¯ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fClkCnClBtn(){ group1.attribute("height") = 0; btn_add.disabled = false; btn_del.disabled = false; btn_save.disabled= false; btn_req.disabled = false; btn_getpatinfo.disabled = false; } /** * @desc : ±×¸®µå input buttonŬ¸¯ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fClkGrdInptBtn(){ //model.setValue("/root/hidden/srchcond", "2"); modal("SPPMC02500", "1", 100, 100, "SPPMC02500", "/root/hidden", "/root/send"); var sPid = model.getValue("/root/main/patinfo/patinfolist/pid"); var sHngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm"); if(model.getValue("/root/main/popupendflag") != "cancel"){ var iRow = grd_therapy.row; model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , sPid); model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", sHngnm); } } /** * @desc : ±×¸®µå input buttonŬ¸¯ * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fClkGrdInptBtn(){ model.setValue("/root/hidden/srchcond", "2"); modal("SPPMC02500", "1", 100, 100, "SPPMC02500", "/root/hidden", "/root/send"); var sPid = model.getValue("/root/main/patinfo/patinfolist/pid"); var sHngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm"); if(model.getValue("/root/main/popupendflag") != "cancel"){ var iRow = grd_therapy.row; model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , sPid); model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", sHngnm); } } /** * @desc : ÀúÀåµ¥ÀÌÅÍÀÇ ¹«°á¼º°Ë»ç * @ * @param : * @return : * @author : ¿ÀÁöÈÆ * @--------------------------------------------------- */ function fChkValidSaveData(){ if(grd_therapy.rows < 2){ messageBox("ÀúÀåÇÒ ³»¿ªÀÌ", "I004"); return; } var sDoseVal = model.getValue(sTHERPLIST_PATH + "[doseval='" + "" + "']/rsrvdd"); var sRoomCD = model.getValue(sTHERPLIST_PATH + "[roomcd='" + "" + "']/rsrvdd"); var sPid = model.getValue(sTHERPLIST_PATH + "[pid='" + "" + "']/rsrvdd"); var sHngNM = model.getValue(sTHERPLIST_PATH + "[hngnm='" + "" + "']/rsrvdd"); var sDeptCD = model.getValue(sTHERPLIST_PATH + "[orddeptcd='" + "" + "']/rsrvdd"); if(sDoseVal != ""){ messageBox("Dose °ªÀ»", "C001"); return false; }else if(sRoomCD != ""){ messageBox("º´½ÇÀ» ", "C002"); return false; }else if(sPid != ""){ messageBox("µî·Ï¹øÈ£¸¦ ", "C001"); return false; }else if(sHngNM != ""){ messageBox("ȯÀÚ¸í¸¦ ", "C001"); return false; }else if(sDeptCD != ""){ messageBox("ºÎ¼­¸¦ ", "C001"); return false; }else{ return true; } }