/** * @desc : È­¸éÃʱâÈ­ * * @param : * @return : * @author : °æºÏ´ëÇб³ * @--------------------------------------------------- */ function fInitialize(){ mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept" , "D"); //ºÎ¼­ÄÚµå ÄÞº¸ addComboInstance("/root/init/orddept", "deptcd^depthngnm", "Z^Àüü", "dept"); //ºÎ¼­ÄÞº¸ ÀüüÇ׸ñ Ãß°¡ model.setValue("/root/main/right_cond/orddeptcd", "Z"); model.setValue("/root/main/right_cond/srch_flag", "I"); model.setValue("/root/main/right_cond/srch_fromdd", getCurrentDate()); model.setValue("/root/main/right_cond/srch_todd", getCurrentDate()); model.setValue("/root/main/left_cond/srch_flag", "I"); model.setValue("/root/main/left_cond/srch_fromdd", getCurrentDate()); model.setValue("/root/main/left_cond/srch_todd", getCurrentDate()); grd_left.deleteRow(1); grd_right.deleteRow(1); model.refresh(); } /** * ÀúÀå Àü °Ë»öÁ¶°Ç üũ * @return */ function fCheck(){ if(model.getValue("/root/main/right_cond/srch_flag")=="A" && model.getValue("/root/main/right_cond/orddeptcd")=="Z"){ messageBox("Àç¿ø ÁßÀΠȯÀÚ¸¦ °Ë»ö½Ã Áø·á°ú ¼±ÅÃÀº", "I003"); return false; } if(model.getValue("/root/main/right_cond/pid")=="" && (model.getValue("/root/main/right_cond/orddeptcd")=="Z" || model.getValue("/root/main/right_cond/srch_flag")=="Z" )){ messageBox("Áø·á°ú ¶Ç´Â ±¸ºÐÀÌ ÀüüÀÏ °æ¿ì ȯÀÚ¹øÈ£´Â", "I003"); return false; } return true; } /** * ȯÀÚ°Ë»ö * @return */ function fRightSearch(){ if(fCheck()){ model.copyNode("/root/send/right/reqdata", "/root/main/right_cond"); submit("TRMRH00300"); }else{ return; } model.makeNode("/root/temp/right_chkyn"); // Áø´ÜÄڵ带 °Ë»öÇÏ´Â °æ¿ì ³ëµå°¡ »ç¶óÁ®¹ö¸®´Â Çö»ó¶§¹®¿¡ °Ë»öÇÏ¸é µ¿½Ã¿¡ ³ëµå »ý¼ºÇϵµ·Ï ¼³Á¤ model.setValue("/root/temp/right_chkyn", "N"); model.refresh(); } /** * ÀúÀåµÈ ȯÀÚ°Ë»ö * @return */ function fLeftSearch(){ model.removeNodeset("/root/send/left"); model.makeNode("/root/send/left/reqdata"); model.makeValue("/root/main/left_cond/recflag", "B"); model.copyNode("/root/send/left/reqdata", "/root/main/left_cond"); submit("TRMRH00310"); model.refresh(); } /** * °Ë»öµÈ ȯÀÚ¸¦ ´ë»óȯÀÚ·Î º¹»ç * @return */ function fCopyData(){ var rihgt_rows=grd_right.rows-grd_right.fixedRows; // ¿À¸¥ÂÊ ±×¸®µå ÇàÀÇ °¹¼ö var left_rows=grd_left.rows-grd_left.fixedRows; // ¿ÞÂÊ ±×¸®µå ÇàÀÇ °¹¼ö var j=left_rows+1; var lgrd_chk = false; // ¿ÞÂÊ ±×¸®µå¿¡ ¿À¸¥ÂÊ¿¡¼­ À̵¿ÇÒ·Á´Â ȯÀÚ°¡ ÀÖ´ÂÁö ¾ø´ÂÁö È®ÀÎÇÏ´Â Ç÷¡±× for(var i=1; i<=rihgt_rows; i++){ var chkyn=model.getValue("/root/main/grd_right["+i+"]/chkbox"); if(chkyn=="Y"){ var r_pid=model.getValue("/root/main/grd_right["+i+"]/pid"); var r_orddd=model.getValue("/root/main/grd_right["+i+"]/orddd"); var r_cretno=model.getValue("/root/main/grd_right["+i+"]/cretno"); for(var k=1; k<=left_rows; k++){ var l_pid=model.getValue("/root/main/grd_left["+k+"]/pid"); var l_orddd=model.getValue("/root/main/grd_left["+k+"]/orddd"); var l_cretno=model.getValue("/root/main/grd_left["+k+"]/cretno"); if(r_pid==l_pid && r_orddd==l_orddd && r_cretno==l_cretno){ lgrd_chk=true; break; } } if(lgrd_chk==true){ lgrd_chk = false; continue; } grd_left.addRow(); model.setValue("/root/main/grd_left["+j+"]/saveyn", "Y"); model.setValue("/root/main/grd_left["+j+"]/indxyn", "Y"); model.setValue("/root/main/grd_left["+j+"]/cdstyn", "N"); model.setValue("/root/main/grd_left["+j+"]/eduyn", "Y"); model.setValue("/root/main/grd_left["+j+"]/pid", model.getValue("/root/main/grd_right["+i+"]/pid")); model.setValue("/root/main/grd_left["+j+"]/hngnm", model.getValue("/root/main/grd_right["+i+"]/hngnm")); model.setValue("/root/main/grd_left["+j+"]/sex", model.getValue("/root/main/grd_right["+i+"]/sex")); model.setValue("/root/main/grd_left["+j+"]/age", model.getValue("/root/main/grd_right["+i+"]/age")); model.setValue("/root/main/grd_left["+j+"]/diagengnm", model.getValue("/root/main/grd_right["+i+"]/diagengnm")); model.setValue("/root/main/grd_left["+j+"]/orddd", model.getValue("/root/main/grd_right["+i+"]/orddd")); model.setValue("/root/main/grd_left["+j+"]/dschdd", model.getValue("/root/main/grd_right["+i+"]/dschdd")); model.setValue("/root/main/grd_left["+j+"]/telno", model.getValue("/root/main/grd_right["+i+"]/telno")); model.setValue("/root/main/grd_left["+j+"]/followup", ""); model.setValue("/root/main/grd_left["+j+"]/cretno", model.getValue("/root/main/grd_right["+i+"]/cretno")); model.setValue("/root/main/grd_left["+j+"]/ordtype", model.getValue("/root/main/grd_right["+i+"]/ordtype")); j++; } } model.refresh(); } /** * @desc : Áø´Ü ÆË¾÷ * @ * @param : * @return : * @--------------------------------------------------- */ function fClickPopUp(flag){ var instance = document.models(0).instances(0); var nodelistTemp = instance.selectNodes("/root/temp/selectdiaglist"); for (var i=1 ; i <= nodelistTemp.length ; i++) { model.destroy("/root/temp/selectdiaglist["+ i +"]"); } model.refresh(); modal("../../../emr/prcpmngtweb/xrw/SPMMO03200_Áø´ÜÆË¾÷.xrw", 1, 0, 0, "", "", ""); var sTmpdiagcd = ""; var sTmpdiagengnm = ""; var nodelistTemp = instance.selectNodes("/root/temp/selectdiaglist"); if(nodelistTemp.length >= 1){ sTmpdiagcd = model.getValue("/root/temp/selectdiaglist[1]/diagcd"); sTmpdiagengnm = model.getValue("/root/temp/selectdiaglist[1]/diagengnm"); if (flag == "1") { model.setValue("/root/main/right_cond/diagcd", sTmpdiagcd); } model.refresh(); } } /** * @desc : ÀúÀå * @ * @param : * @return : * @--------------------------------------------------- */ function fSave(){ var chk=false; var left_rows=grd_left.rows-grd_left.fixedRows; var savedata = "instcd¢Ëpid¢Ëorddd¢Ëcretno¢Ëordtype¢Ërecflag¢Ëindxyn¢Ëcdstyn¢Ëeduyn¢Ì"; var datapath = "/root/main/grd_left"; var srchdata = "pid¢Ësrch_flag¢Ësrch_fromdd¢Ësrch_todd¢Ërecflag¢Ì"; var srchpath = "/root/main/left_cond"; for(var i=1; i<=left_rows; i++){ var saveyn = model.getValue("/root/main/grd_left["+i+"]/saveyn"); if(saveyn=="Y"){ chk=true; savedata += getUserInfo("dutplceinstcd") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/pid") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/orddd") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/cretno") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/ordtype") + "¢Ë"; savedata += "B" + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/indxyn") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/cdstyn") + "¢Ë"; savedata += model.getValue(datapath+"["+ i +"]/eduyn") + "¢Ì"; } } if(chk==false){ messageBox("¼öÁ¤µÈ µ¥ÀÌÅͰ¡", "I004"); return; } if(model.getValue(srchpath+"/pid")==""){ srchdata += "-" + "¢Ë"; }else{ srchdata += model.getValue(srchpath+"/pid") + "¢Ë"; } srchdata += model.getValue(srchpath+"/srch_flag") + "¢Ë"; srchdata += model.getValue(srchpath+"/srch_fromdd") + "¢Ë"; srchdata += model.getValue(srchpath+"/srch_todd") + "¢Ë"; srchdata += "B" + "¢Ì"; model.removeNodeset("/root/send/left"); model.makeNode("/root/send/left"); model.makeValue("/root/send/left/reqdata", srchdata); model.makeValue("/root/send/left/savedata", savedata); submit("TXMRH00300"); model.refresh(); } /** * @desc : »óŰª º¯°æ * @ * @param : * @return : * @--------------------------------------------------- */ function fChangeData(){ if(grd_left.colRef("indxyn")==grd_left.col || grd_left.colRef("cdstyn")==grd_left.col || grd_left.colRef("eduyn")==grd_left.col){ model.setValue("/root/main/grd_left["+grd_left.row+"]/saveyn", "Y"); } model.refresh(); } /** * @desc : ¿À¸¥ÂÊ Àüü ¼±Åà ¹× Àüü ¼±ÅÃ ÇØÁ¦ * @ * @param : * @return : * @--------------------------------------------------- */ function fStatusyn(){ if(bool1.value == "Y"){ for(var i = 0 ; i < grd_right.rows ; i++){ grd_right.valueMatrix(i , grd_right.colRef("chkbox")) = "Y"; } }else{ for(var i = 0 ; i < grd_right.rows ; i++){ grd_right.valueMatrix(i , grd_right.colRef("chkbox")) = "N"; } } } /** * @desc : ÅëÇÕ±â·Ï ¿¬µ¿ * @ * @param : * @return : * @--------------------------------------------------- */ function fOpenRec(){ var row = grd_right.row; if(row >0){ setParameter("SMMRI00400_param_pid", model.getValue("/root/main/grd_right["+row+"]/pid")); setParameter("SMMRI00400_param_chosflag", model.getValue("/root/main/grd_right["+row+"]/ordtype")); setParameter("SMMRI00400_param_authflag", "N"); modal("SMMRI00400", 1, 0, 0, "", "", ""); } } /** * @desc : ÀúÀåµÈ ȯÀÚ »èÁ¦ * @ * @param : * @return : * @--------------------------------------------------- */ function fDeletePat(){ var row = grd_left.row; var savedata = "instcd¢Ëpid¢Ëorddd¢Ëcretno¢Ërecflag¢Ì"; var datapath = "/root/main/grd_left"; var srchdata = "pid¢Ësrch_flag¢Ësrch_fromdd¢Ësrch_todd¢Ërecflag¢Ì"; var srchpath = "/root/main/left_cond"; savedata += getUserInfo("dutplceinstcd") + "¢Ë"; savedata += model.getValue(datapath+"["+ row +"]/pid") + "¢Ë"; savedata += model.getValue(datapath+"["+ row +"]/orddd") + "¢Ë"; savedata += model.getValue(datapath+"["+ row +"]/cretno") + "¢Ë"; savedata += "B" + "¢Ì"; if(model.getValue(srchpath+"/pid")==""){ srchdata += "-" + "¢Ë"; }else{ srchdata += model.getValue(srchpath+"/pid") + "¢Ë"; } srchdata += model.getValue(srchpath+"/srch_flag") + "¢Ë"; srchdata += model.getValue(srchpath+"/srch_fromdd") + "¢Ë"; srchdata += model.getValue(srchpath+"/srch_todd") + "¢Ë"; srchdata += "B" + "¢Ì"; model.removeNodeset("/root/send/left"); model.makeNode("/root/send/left"); model.makeValue("/root/send/left/reqdata", srchdata); model.makeValue("/root/send/left/savedata", savedata); submit("TXMRH00310"); fLeftSearch(); model.refresh(); }