/*********************************************************************************************************************************************************** * * @ creat date - 2007.12.20 * @ author - dhkim * @ desc - SMARC00700_ÀÔ¿ø¼ö¼ú ȯÀÚÁ¶È¸.xrw¿¡¼­ »ç¿ëÇÏ´Â ½ºÅ©¸³Æ®ÀÌ´Ù. * Á¶È¸Á¶°ÇÀÇ ÀÇ·ÚȯÀÚüũ¹Ú½º°¡ üũµÇ¾îÀÖÁö ¾ÊÀ»¶§´Â ȯÀÚ¹øÈ£¸¦ Çʼö·Î Á¶È¸Á¶°ÇÀ¸·Î Áà¾ßÇÑ´Ù. * Á¶È¸ÇÏ¿© ±×¸®µå¿¡ Ãâ·ÂÇÒ¶§ ³»ºÎÀûÀ¸·Î key¸¦ ¸®ÅÏÇÏ¿© ±×¸®µå ´õºíŬ¸¯ À̺¥Æ® ¹ß»ý½Ã »ó´ÜÁ¤º¸¸¦ µî·ÏÇϰí ÀÇ·ÚȯÀÚµî·ÏÈ­¸éÀ» È£ÃâÇÑ´Ù. * ±×¸®µå¿¡ º´µ¿~ÁֹιøÈ£±îÁö Ʋ°íÁ¤ÇÑ´Ù. * ȯÀÚ¹øÈ£¸¦ ÀÔ·ÂÇÏ°í ¿£Å͸¦ ´©¸£¸é ȯÀÚ¸íÀ» Ãâ·ÂÇÑ´Ù. ¾ø´Â ¹øÈ£À϶§¿¡´Â ÆË¾÷È­¸éÀ» È£ÃâÇÑ´Ù. * ȯÀÚ¸íÀ» ÀÓ·ÂÇÏ°í ¿£Å͸¦ ´©¸£¸é ȯÀÚ¹øÈ£¸¦ Ãâ·ÂÇÑ´Ù. ¾ø´Â ¹øÈ£À̰ųª µ¿¸íÀÌÀÎÀ϶§¿¡´Â ÆË¾÷È­¸éÀ» È£ÃâÇÑ´Ù. **********************************************************************************************************************************************************/ var xSearchPath = '/root/main/search'; var xTempPath = '/root/temp'; var xSendpath = '/root/send'; var xGridPath = '/root/main/list/inpatlist'; var CurrentDate = getCurrentDate(); // ÃʱⰪ ¼ÂÆÃ function fInit(){ //º´¿ø±¸ºÐÄÚµå(°øÅëÄÚµå)Á¶È¸ model.removeNodeset('/root/init/cond/A0429'); zbcfGetCodeList(new Array('A0429'), new Array('/root/init/cond')); model.removeNodeset(xGridPath); //Á¶È¸Á¶°Ç ¼¼ÆÃ fSetCondition(); } /** * 2007.12.22 * ³»¿øÀÚ, Åð¿øÀÏÀÚ º°·Î ³¯Â¥¸¦ ¼¼ÆÃÇÑ´Ù. * default - ³»¿øÀÚ */ function fSetCondition(condflag){ if(condflag == null || condflag == '' ){ condflag = '1'; } //condflag : 1 (³»¿øÀÚ) , 2(Åð¿øÀÏÀÚ) //³»¿øÀÚ Á¶È¸´Â ÀßÂ¥ÀԷ¾ÈÇÔ.. Åð¿øÀÏÀÚ´Â Á¶È¸Á¶°Ç¿¡ ³¯Â¥¼±Åð¡´ÉÇϰí default´Â ¿À´Ã³¯Â¥¸¸ .. if(condflag == '1'){ model.setValue(xSearchPath + '/fromdd', ''); model.setValue(xSearchPath + '/todd', ''); ipt_fromdd.disabled = 'true'; ipt_todd.disabled = 'true'; model.setValue(xSearchPath + '/reqyn', 'CP'); }else if(condflag == '2' || condflag == '3'){ model.setValue(xSearchPath + '/fromdd', CurrentDate); model.setValue(xSearchPath + '/todd', CurrentDate); ipt_fromdd.disabled = 'false'; ipt_todd.disabled = 'false'; } model.setValue(xSearchPath + '/condflag', condflag); //model.setValue(xSearchPath + '/reqyn', 'CP'); model.refresh(); } /** * 2007.12.21 * ȯÀÚ¹øÈ£ ÀԷ½à ȯÀÚ¸í Ãâ·Â * ȯÀÚ¸í ÀԷ½à ȯÀÚ¹øÈ£ Ãâ·Â * ÀÔ·ÂÇÑ °ªÀÌ Á¸ÀçÇÏÁö¾ÊÀ¸¸é ÆË¾÷È£Ãâ */ function fGetPatientInfo(srchcond, keyword){ model.removeNodeset(xSendpath ); model.removeNodeset(xTempPath ); model.makeValue(xSendpath + '/reqdata/srchcond', srchcond);//1:ȯÀÚ¹øÈ£Á¶È¸, 2:ȯÀÚ¸íÁ¶È¸ if(srchcond == '1'){ model.makeValue(xSendpath + '/reqdata/pid', keyword); }else if(srchcond == '2'){ model.makeValue(xSendpath + '/reqdata/hngnm', keyword); } if(submit('TRARC00702')){ if(getNodesetCount(xTempPath + '/patientinfo') != 1){ fPopupWindowPatient(srchcond, keyword); }else if(getNodesetCount(xTempPath + '/patientinfo') == 1){ model.setValue(xSearchPath + '/pid', model.getValue(xTempPath + '/patientinfo/pid')); model.setValue(xSearchPath + '/hngnm', model.getValue(xTempPath + '/patientinfo/hngnm')); model.refresh(); } } } /** * 2007.12.21 * ¿ø¹«ÆÀÀÇ È¯ÀÚÁ¶È¸ÆË¾÷À» È£ÃâÇÑ´Ù. */ function fPopupWindowPatient(srchcond, keyword){ //parameter°ª ¼¼ÆÃ model.removeNodeset(xTempPath ); model.makeValue(xTempPath + '/pid', keyword==''? ipt_pid.currentText : keyword); model.makeValue(xTempPath + '/hngnm', keyword==''? ipt_hngnm.currentText : keyword); model.makeValue(xTempPath + '/srchcond', srchcond); //¿ø¹«ÆÀÀÇ È¯ÀÚ¸íÀ» ¹Þ¾Æ¿À´Â ÆË¾÷âÀ» ¶ç¿î´Ù. modal('SPPMC02500', '1','150', '150', 'SPPMC02500', xTempPath , xSendpath ); //ÆË¾÷ÀÇ result´Â /root/main/patinfo/patinfolist ¿¡ µé¾î¿Â´Ù. model.removeNodeset(xSearchPath + '/pid'); model.removeNodeset(xSearchPath + '/hngnm'); model.makeValue(xSearchPath + '/pid', model.getValue('/root/main/patinfo/patinfolist/pid')); model.makeValue(xSearchPath + '/hngnm', model.getValue('/root/main/patinfo/patinfolist/hngnm')); model.refresh(); } /** * 2007.12.20 * Á¶È¸¹öư(btn_search) Ŭ¸¯ À̺¥Æ® ¹ß»ý½Ã ÀÔ¿ø/¼ö¼úȯÀÚ³»¿ªÀ» Á¶È¸ÇÑ´Ù. * Á¶È¸Á¶°Ç : condflag(Àç¿øÀÚ:1, Åð¿øÀÏÀÚ:2, ÀÔ¿øÀÏÀÚ:3), fromdd(½ÃÀÛÀÏ), todd(Á¾·áÀÏ), pid(µî·Ï¹øÈ£), hngnm(ȯÀÚ¸í), opyn(¼ö¼úȯÀÚüũ), reqyn(ÀÇ·ÚȯÀÚüũ) * ÀÇ·ÚȯÀÚ°¡ üũµÈ »óŰ¡ ¾Æ´Ï¸é Á¶È¸Á¶°Ç¿¡ ȯÀÚ¹øÈ£ Çʼö·Î ³Ñ°Ü¾ßÇÑ´Ù. * */ function fSearch(){ var reqyn = model.getValue(xSearchPath + '/reqyn'); //Á¶È¸Á¶°ÇÀÇ ÀÇ·ÚȯÀÚ chk trueÀ϶§ÀÇ °ª:CP var opyn = model.getValue(xSearchPath + '/opyn'); //Á¶È¸Á¶°ÇÀÇ ¼ö¼úȯÀÚ chk trueÀ϶§ÀÇ °ª:E var pid = ipt_pid.currentText; //ȯÀÚµî·Ï¹øÈ£ var hngnm = ipt_hngnm.currentText; //ȯÀÚ¸í var condflag = model.getValue(xSearchPath + '/condflag'); //Á¶È¸Á¶°Ç var fromdd = model.getValue(xSearchPath + '/fromdd'); var todd = model.getValue(xSearchPath + '/todd'); /* if(reqyn != 'CP'){ if (pid.length < 2 && hngnm.length < 2) { messageBox( 'ȯÀÚ¹øÈ£ ¶Ç´Â ȯÀÚ¸íÀ» 2ÀÚ¸® ÀÌ»ó', 'C001' ); return; } } */ if (condflag == "1") { if(reqyn != 'CP'){ /* if (pid.length < 2 && hngnm.length < 2) { messageBox( 'ȯÀÚ¹øÈ£ ¶Ç´Â ȯÀÚ¸íÀ» 2ÀÚ¸® ÀÌ»ó', 'C001' ); return; } */ } } else { if( ! isValidDateTime( fromdd, 'YYYYMMDD') || ! isValidDateTime( todd, 'YYYYMMDD') ){ messageBox("ÀÔ·ÂÇϽŠÀÏÀÚ±¸ºÐÀÌ Á¤È®ÇÑ ³¯Â¥Å¸ÀÔÀÌ ¾Æ´Õ´Ï´Ù.", "E999", ""); return; } if( getDateInterval(fromdd, todd) > 31 ){ messageBox("Á¶È¸°¡´ÉÇÑ ÃÖ´ë ±â°£Àº 1´ÞÀÔ´Ï´Ù. ÀÏÀÚ±¸ºÐ¿¡¼­ ³¯Â¥¸¦ ¼öÁ¤Çϼ¼¿ä!", "E999", ""); return; } if( getDateInterval(fromdd, todd) < 0 ){ messageBox("ÀÏÀÚ±¸ºÐ¿¡¼­ ½ÃÀÛÀÏÀÚ°¡ Á¾·áÀÏÀÚº¸´Ù ¹Ì·¡ÀÏÀÚ ÀÔ´Ï´Ù. È®ÀÎÇϼ¼¿ä!", "E999", ""); return; } if (hngnm.length > 0 && hngnm.length < 2) { messageBox( 'ȯÀÚ¸íÀ» 2ÀÚ¸® ÀÌ»ó', 'C001' ); return; } } model.removeNodeset(xSearchPath); model.makeValue(xSearchPath + '/condflag', condflag); model.makeValue(xSearchPath + '/reqyn', reqyn); model.makeValue(xSearchPath + '/pid', pid); model.makeValue(xSearchPath + '/hngnm', hngnm); model.makeValue(xSearchPath + '/fromdd', fromdd); model.makeValue(xSearchPath + '/todd', todd); model.makeValue(xSearchPath + '/opyn', opyn); if(!submit('TRARC00701', false)){ messageBox('Á¶È¸¸¦', 'E009'); return ; }else{ model.refresh(); } } /* * ±×¸®µå ´õºíŬ¸¯ À̺¥Æ® ¹ß»ý½Ã »ó´ÜÁ¤º¸ ¿Ã¸®°í ÀÇ·ÚȯÀÚµî·Ï ÆË¾÷ È£Ãâ */ function fOpen(){ var mainObj = getMainViewer(); var curRow = grd_list.row; //±×¸®µå¿¡¼­ ÇØ´ç ȯÀÚ ¼±Åà if (curRow < 1) return; var pid = model.getValue(xGridPath + '[' + curRow + ']/pid'); var orddd = model.getValue(xGridPath + '[' + curRow + ']/indd'); var cretno = model.getValue(xGridPath + '[' + curRow + ']/cretno'); var instcd = model.getValue(xGridPath + '[' + curRow + ']/instcd'); var acptseqno = model.getValue(xGridPath + '[' + curRow + ']/seqno'); var dschdd = model.getValue(xGridPath + '[' + curRow + ']/dschdd'); var indschacptstat = model.getValue(xGridPath + '[' + curRow + ']/indschacptstat'); var ordtype = model.getValue(xGridPath + '[' + curRow + ']/ordtype'); var curdate = getCurrentDate(); if (ordtype == "E") { curdate = orddd; } else if (ordtype == "I") { if (indschacptstat == "D") { curdate = dschdd; } else if (indschacptstat == "T") { if (dschdd != "99991231") { curdate = dschdd; } } } else { ordtype = "I"; if (indschacptstat == "D") { curdate = dschdd; } } //var condparam = 'I¢Ë' + pid + '¢Ë' + orddd + '¢Ë' + cretno + '¢Ë' + instcd + '¢Ë' + curdate; var condparam = ordtype + '¢Ë' + pid + '¢Ë' + orddd + '¢Ë' + cretno + '¢Ë' + instcd + '¢Ë' + curdate; setParameter('condparam', condparam); modal('SPMMO08900', 1, '', '', '', '', '', 'left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;'); //open('SPARC00100',1,1,1); var curEmrRecObj = getOpenWindow("SPARC00100"); //Ȱ¼ºÈ­µÈ Áø·á±â·Ï È­¸é object loading //var curCpObj = mainObj.javascript.getOpenWindow("SPARC00100"); //Ȱ¼ºÈ­µÈ CP Main È­¸é object loading //alert(curCpObj); if (curEmrRecObj != null) { curEmrRecObj.javascript.fInit(); } else { //curCpObj.javascript.fInit(); open("SPARC00100",1,1,1, "SPARC00100", "", "", "", false); } }