/* ÀÀ±Þ¼¾ÅÍ ÀÇ»ç¼ÒÅëPg(SPMNE04800.xfm - JScript ) - Version : 1) : Ver.1.00.01 */ var xCmpgInfoPath = "/root/main/patcmpginfo"; var xPatInfoPath = "/root/main/cond/patinfo"; var xCmpglistPath = "/root/main/cmpginfo/cmpglist"; var iPid = ""; var iCretno = ""; var iIndd = ""; var iPname = ""; /** * @group : * @ver : 2009.06.05 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : ÃʱâÈ­ * @param : * @return : * @--------------------------------------------------- */ function fInit(){ //ÀÌÀü È­¸é¿¡¼­ ³Ñ¾î¿Â ȯÀÚÁ¤º¸ param/»ó´Ü¿¡ ȯÀÚÁ¤º¸°¡ Á¸ÀçÇÏ¸é ±× °ªÀ» ¼ÂÆÃÇØÁÜ(2009.06.14 JJE) var grb_patinfo1 = opener.javascript.getParameter ( "SPMNE04800_patinfo" ); var grb_patinfo2 = opener.javascript.getParameter ( "SPMNE04900_patinfo" ); var grb_patinfo3 = getPatientInfo("pid"); if( !isNull(grb_patinfo1) ){ iPid = grb_patinfo1.split("¢Ì")[0]; iCretno = grb_patinfo1.split("¢Ì")[1]; iIndd = grb_patinfo1.split("¢Ì")[2]; iPname = grb_patinfo1.split("¢Ì")[3]; }else if( !isNull(grb_patinfo2) ){ iPid = grb_patinfo2.split("¢Ì")[0]; iCretno = grb_patinfo2.split("¢Ì")[1]; iIndd = grb_patinfo2.split("¢Ì")[2]; iPname = grb_patinfo2.split("¢Ì")[3]; }else{ if( !isNull(grb_patinfo3) ){ iPid = grb_patinfo3; iCretno = getPatientInfoDetail("cretno"); iIndd = getPatientInfoDetail("indd"); iPname = getPatientInfo("pname"); } } if( !isNull(iPid) && !isNull(iCretno) && !isNull(iIndd) ){ model.setValue(xPatInfoPath + "/selpatinfo", iPid); model.setValue(xPatInfoPath + "/pid", iPid); model.setValue(xPatInfoPath + "/bedposcnts", ""); model.setValue(xPatInfoPath + "/patinfo", iPname + " " + iPid); } model.setValue("/root/main/cond/patlist/endyn" , "N"); model.setValue(xPatInfoPath + "/srchtype", "X"); model.setValue(xPatInfoPath + "/fromdd", getCurrentDate()); model.setValue(xPatInfoPath + "/todd" , getCurrentDate()); submit("TRMNE04801"); fGetNursHardCdInfo("'096'", getCurrentDate()); fSrchCMPGList("A"); model.refresh(); } /** * @group : * @ver : 2009.06.05 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : ¸Þ½ÃÁö ÄÞº¸ ¸®½ºÆ® º¯°æ * @param : * @return : * @--------------------------------------------------- */ function fChngMsgList(){ model.setValue(xCmpgInfoPath+"/trscnts", model.getValue(xCmpgInfoPath+"/selmsginfo")); model.setFocus("ipt_trscnts"); model.refresh(); } /** * @group : * @ver : 2009.06.05 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : ȯÀÚ ¸®½ºÆ® º¯°æ½Ã * @param : * @return : * @--------------------------------------------------- */ function fChngERPatList(){ var pid = model.getValue(xPatInfoPath+"/selpatinfo"); model.setValue(xPatInfoPath+"/pid", pid); model.setValue(xPatInfoPath+"/bedposcnts",model.getValue("/root/main/erpatinfo/erpatlist[pid='"+pid+"']/bedposcnts")); model.setValue(xPatInfoPath+"/patinfo",model.getValue("/root/main/erpatinfo/erpatlist[pid='"+pid+"']/patinfo")); model.setValue("/root/main/patcmpginfo/selmsginfo", ""); model.setValue("/root/main/patcmpginfo/ugcyyn", ""); model.setValue("/root/main/patcmpginfo/trscnts", ""); model.setValue(xPatInfoPath+"/histno",""); //Ű ÃʱâÈ­ (2009.06.14 JJE) model.refresh(); } /** * @group : * @ver : 2009.06.05 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀúÀå * @param :flag(I:insert or update, D:delete) * @return : * @--------------------------------------------------- */ function fSave(flag){ if( isNull(flag) ) flag = "I"; var pid = model.getValue(xPatInfoPath+"/pid"); var trscnts = model.getValue(xCmpgInfoPath+"/trscnts"); if( flag == "T" ){ model.removenodeset("/root/send"); model.makeNode("/root/send/savedata"); copyNodeListType("/root/send/savedata", "/root/main/cmpginfo/cmpglist", "replace", model, model); }else{ if(pid == ""){ messageBox("ȯÀÚ¸¦ ¼±ÅÃ","I008"); model.setFocus("cmb_selpatinfo"); return; } if(trscnts == ""){ messageBox("Àü´ÞÇÑ ³»¿ëÀ» ÀÔ·Â","I008"); model.setFocus("cmb_selmsginfo"); return; } model.removenodeset("/root/send"); model.makeNode("/root/send/savedata"); model.makeValue("/root/send/savedata/pid",pid); model.makeValue("/root/send/savedata/ugcyyn",model.getValue(xCmpgInfoPath+"/ugcyyn")); model.makeValue("/root/send/savedata/trscnts",trscnts); model.makeValue("/root/send/savedata/histcd","O"); model.makeValue("/root/send/savedata/bedposcnts", model.getValue(xPatInfoPath+"/bedposcnts")); model.makeValue("/root/send/savedata/histno", model.getValue(xPatInfoPath+"/histno")); } model.makeNode("/root/send/reqdata"); model.makeValue("/root/send/reqdata/endyn", model.getValue("/root/main/cond/patlist/endyn")); model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/cond/patlist/pid")); if( flag == "I" && !isNull(model.getValue(xPatInfoPath+"/histno")) ) flag = "U"; model.makeValue("/root/send/savedata/status", flag); if(submit("TXMNE04801") == true){ if(model.getValue("/root/main/cond/patinfo/status") != "T" ){ cmb_selmsginfo.value = ""; txt_trscnts.value = ""; model.setValue("/root/main/cond/patinfo/histno", ""); } fGridSetting(); } } /** * @group : * @ver : 2009.06.05 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀÇ»ç¼ÒÅë °ü·Ã ȯÀÚ ¸®½ºÆ® * @param : flag(P:¼öµ¿Á¶È¸, A:ÀÚµ¿Á¶È¸) * @return : * @--------------------------------------------------- */ function fSrchCMPGList(flag){ if( isNull(flag) ) flag = "A"; if( submit("TRMNE04802") ){ fGridSetting(); if( flag != "A" ){ //fClear(); //ÀçÁ¶È¸ ÈÄ »ó´Ü ÀԷºΠÃʱâÈ­ (2009.06.14 JJE) } } } function fGridSetting(){ grd_userlist.rebuildStyle(); for(var i = 1 ; i <= getNodesetCount("/root/main/cmpginfo/cmpglist") ; i++){ if(model.getValue("/root/main/cmpginfo/cmpglist["+i+"]/ugcyyn") == "Y"){ //grd_userlist.cellstyle("background-color", i, 0, i, grd_userlist.colRef("trscnts")) = "#ff0000"; grd_userlist.cellstyle("font-weight", i, 0, i, grd_userlist.colRef("trscnts")) = "bold"; grd_userlist.cellstyle("color", i, 0, i, grd_userlist.colRef("trscnts")) = "#ff5500"; } } } /** * @group : * @ver : 2009.06.14 * @by : ÀüÁöÀº * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀÇ»ç¼ÒÅë °ü·Ã ȯÀÚ ¸®½ºÆ®¸¦ ´õºíŬ¸¯ÇÏ¸é »ó´Ü ÀԷºο¡ °ªÀ» ¼ÂÆÃ * @param : falg (A:°£È£»ç-½Åû, R:»ç¿ø-Àü¼Û) * @return : * @--------------------------------------------------- */ function fDblclick(flag){ if( isNull(flag) ) flag = "A"; var iRow = grd_userlist.row; if( iRow > 0 && iRow <= grd_userlist.rows ){ var pid = model.getValue( xCmpglistPath + "[" + iRow + "]/pid"); var pname = model.getValue( xCmpglistPath + "[" + iRow + "]/hngnm"); var bedposcnts = model.getValue( xCmpglistPath + "[" + iRow + "]/bedposcnts"); var patinfo = pname + " " + pid; var trscnts = model.getValue( xCmpglistPath + "[" + iRow + "]/trscnts"); var ugcyyn = model.getValue( xCmpglistPath + "[" + iRow + "]/ugcyyn"); var histno = model.getValue( xCmpglistPath + "[" + iRow + "]/histno"); if( flag == "A" ){ model.setValue(xPatInfoPath + "/selpatinfo", pid); model.setValue(xPatInfoPath + "/pid", pid); model.setValue(xPatInfoPath + "/bedposcnts", bedposcnts); model.setValue(xPatInfoPath + "/patinfo", patinfo); model.setValue(xPatInfoPath + "/histno", histno); model.setValue(xCmpgInfoPath + "/trscnts", trscnts); model.setValue(xCmpgInfoPath + "/ugcyyn", ugcyyn); cmb_selpatinfo.refresh(); ipt_pid.refresh(); ipt_bedno.refresh(); ipt_patinfo.refresh(); txt_trscnts.refresh(); chk_ugcyyn.refresh(); } else if( flag == "T" ){ if(model.getValue(xCmpglistPath + "[" + iRow + "]/empid") != "" && rdo_endyn.value == "N"){ model.setValue(xCmpglistPath + "[" + iRow + "]/empid", ""); model.setValue(xCmpglistPath + "[" + iRow + "]/empnm", ""); model.setValue(xCmpglistPath + "[" + iRow + "]/status", ""); }else{ model.setValue(xCmpglistPath + "[" + iRow + "]/empid", getUserInfo("userid")); model.setValue(xCmpglistPath + "[" + iRow + "]/empnm", getUserInfo("usernm")); model.setValue(xCmpglistPath + "[" + iRow + "]/status", "T"); } } } } /** * @group : * @ver : 2009.06.14 * @by : ÀüÁöÀº * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀԷºΠÃʱâÈ­ * @param : * @return : * @--------------------------------------------------- */ function fClear(){ model.resetInstanceNode(xPatInfoPath); model.resetInstanceNode(xCmpgInfoPath); cmb_selmsginfo.refresh(); cmb_selpatinfo.refresh(); ipt_pid.refresh(); ipt_bedno.refresh(); ipt_patinfo.refresh(); txt_trscnts.refresh(); chk_ugcyyn.refresh(); }