var instance; var uInfo; var pid = ""; function fInitalize() { model.setValue("/root/main/patinfo/patinfolist/pid" , model.getProperty("pid")); model.setValue("/root/main/patinfo/patinfolist/hngnm", model.getProperty("hngnm")); model.setValue("/root/main/cond/orddeptnm", model.getProperty("deptnm")); model.setValue("/root/main/cond/orddrnm", model.getProperty("medispclnm")); model.setValue("/root/main/cond/sexage", model.getProperty("sexage")); model.setValue("/root/main/cond/wardroomnm", model.getProperty("wardroomnm")); instance = model.instances.item(0); uInfo = getUserInfos(); uInfo = uInfo.split("|"); model.makeValue("/root/init/uid", uInfo[0]); model.makeValue("/root/init/udeptcd", uInfo[8]); model.setValue("/root/init/reqmedireclist/diffdt", 12); fAddDateReq("today"); var srchcond = model.getValue("/root/envinit/srchcond/answcnt"); var srchday = model.getValue("/root/envinit/srchday/answcnt"); switch(srchcond) { case "001" : model.setValue("/root/init/schkind", "2"); break; case "002" : model.setValue("/root/init/schkind", "3"); break; case "003" : model.setValue("/root/init/schkind", "1"); break; case "" : model.setValue("/root/init/schkind", "2"); break; } radio1.refresh(); switch(srchday) { case "001" : model.setValue("/root/init/reqmedireclist/diffdt", "1"); break; case "002" : model.setValue("/root/init/reqmedireclist/diffdt", "3"); break; case "003" : model.setValue("/root/init/reqmedireclist/diffdt", "6"); break; case "004" : model.setValue("/root/init/reqmedireclist/diffdt", "12"); break; case "005" : model.setValue("/root/init/reqmedireclist/diffdt", "-"); break; } combo4.refresh(); combo4.dispatch("xforms-value-changed"); pid = model.getProperty("pid"); if ( !isNull ( pid ) ) { model.setValue("/root/main/patinfo/patinfolist/pid", pid); fPidKeyPress(); fSelect_sub(); } if (isPopup()) { var list = getGlobalVariable("emr_gsv_cmmsrckcond"); if(list != "" && list != null){ model.removeNodeset("/root/send"); setCSVToNode("/root",list,"send"); } } else { } grd_smmlist.autoresize = true; model.refresh(); } function fSrchClick() { if (isPopup()) { fSelect_Pop(); } else { fSelect_sub(); } } function fAddrow() { var nodelistSmm = instance.selectNodes("/root/main/smmlist"); var nodelength = nodelistSmm.length; var smmcnts = model.getValue("/root/main/smmlist[1]/smmcnts"); if(smmcnts != "" || nodelength == 0) { if (nodelength == 0) { grd_smmlist.addRow(); } else { grd_smmlist.insertRow(1); } model.setValue("/root/main/smmlist[1]/smmdd", getCurrentDate()); grd_smmlist.setRow(1); grd_smmlist.setCol(3); } } function fSelect_sub() { var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid"); if (srchpid != "") { model.removeNodeset("/root/main/smmlist"); model.removeNodeset("/root/send"); model.makeValue("/root/send/pid", srchpid); model.makeValue("/root/send/validyn", "Y"); model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind")); model.makeValue("/root/send/getyn", "Y"); model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt")); model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt")); model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn")); var offset = parseInt(model.getValue("root/page/curpage")); if(offset == 1) { offset = offset - 1; } else { offset = (offset - 1) * 10; } model.makeValue("/root/send/reqdata/offset", String(offset)); model.makeValue("/root/send/reqdata/pagesize", model.getValue("root/page/pagesize")); submit("TRMOB00009"); var maxpage = parseInt(model.getValue("/root/main/smmlistcnt/maxcnt")); if(maxpage < 10) { model.setValue("/root/page/maxpage", "1"); } else { maxpage = (maxpage / 10) - ((maxpage % 10) / 10) + 1; model.setValue("/root/page/maxpage", String(maxpage)); } var reqnodeList = instance1.selectNodes("/root/send"); model.refresh(); } else { messageBox("ȯ�ڹ�ȣ�� ", "I004"); return; } } function fSelect_Pop() { var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid"); if (srchpid != "") { model.removeNodeset("/root/main/smmlist"); model.makeValue("/root/send/pid", srchpid); model.makeValue("/root/send/getyn", "Y"); model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind")); model.makeValue("/root/send/validyn", model.getValue("/root/init/validyn")); model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt")); model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt")); model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn")); var offset = parseInt(model.getValue("root/page/curpage")); if(offset == 1) { offset = offset - 1; } else { offset = (offset - 1) * 10; } model.makeValue("/root/send/reqdata/offset", String(offset)); model.makeValue("/root/send/reqdata/pagesize", model.getValue("root/page/pagesize")); submit("TRMOB00009"); var maxpage = parseInt(model.getValue("/root/main/smmlistcnt/maxcnt")); if(maxpage < 10) { model.setValue("/root/page/maxpage", "1"); } else { maxpage = (maxpage / 10) - ((maxpage % 10) / 10) + 1; model.setValue("/root/page/maxpage", String(maxpage)); } var reqnodeList = instance1.selectNodes("/root/send"); if (reqnodeList.length > 0) { } model.refresh(); } else { messageBox("ȯ�ڹ�ȣ�� ", "I004"); return; } } function fResizeGrup(flag, heig, wid) { body.setAttribute("height", heig); body.setAttribute("width", wid); var titHeight = parseInt(grup_title.attribute["height"]); var tTop = parseInt(grup_top.attribute["top"]); var tHeight = parseInt(grup_top.attribute["height"]); var bTop = parseInt(grup_body.attribute["top"]); var bHeight = parseInt(grup_body.attribute["height"]); var mTop = parseInt(grup_bottom.attribute["top"]); var mHeight = parseInt(grup_bottom.attribute["height"]); if(flag == "1") { btn_excel.setAttribute("left", wid - 4 - 56 + "px"); grup_title.setAttribute("width", wid - 2); grup_top.setAttribute("top", 0); grup_top.setAttribute("height", 0); grup_top.setAttribute("width", 0); grup_top.setAttribute("visibility", "hidden"); grup_body.setAttribute("left", 0); grup_body.setAttribute("top", tTop); grup_body.setAttribute("height", (heig - (tHeight + mHeight) + 1)); grup_body.setAttribute("width", wid - 2); grd_smmlist.setAttribute("left", 0); grd_smmlist.setAttribute("border-style", "none"); grd_smmlist.setAttribute("height", (heig - (tHeight + mHeight) + 1)); grd_smmlist.setAttribute("width", wid - 2); grup_bottom.setAttribute("left", 0); grup_bottom.setAttribute("top", (heig - mHeight - 2)); grup_bottom.setAttribute("width", wid - 2); line12.setAttribute("x1", "1px"); line12.setAttribute("x2", wid - 2 + "px"); line12.setAttribute("y1", "24px"); line12.setAttribute("y2", "24px"); line1.setAttribute("x1", "1px"); line1.setAttribute("x2", wid - 2 + "px"); line1.setAttribute("y1", "0px"); line1.setAttribute("y2", "0px"); line2.setAttribute("x1", "1px"); line2.setAttribute("x2", wid - 2 + "px"); line2.setAttribute("y1", "0px"); line2.setAttribute("y2", "0px"); btn_save.setAttribute("left", wid - 4 - 56 + "px"); btn_del.setAttribute("left", wid - 6 - 112 + "px"); btn_end.setAttribute("left", wid - 8 - 168 + "px"); } model.refresh(); } function fClickPop() { modal("../../../emr/medirecweb/xrw/SSMMR04800_�������.xrw", 1, 0, 0, "", "", ""); if(opener.window.getParameter("SSMMP04800_rtn") == "Y") fSelect_sub(); g_changeYn = "N"; } function fChkAuth(selrow) { var recudpcd = model.getValue("/root/main/smmlist[" + selrow + "]/recdeptcd"); var rtn = true; if(recudpcd != uInfo[8]) { rtn = false; } return rtn; } function fClose() { var updateData = grd_smmlist.getUpdateData(); var updateData = updateData.split("��"); if (updateData.length > 3 && (isPopup())) { var rtn = messageBox("ȯ�ڿ�࿡ ����� ������ �ֽ��ϴ� ", "Q002"); if (rtn == 6) fSave(); } } function fPidKeyPress() { var pid = model.getValue("/root/main/patinfo/patinfolist/pid"); model.makeValue("/root/send/srchcond", "1"); model.makeValue("/root/send/pid", pid); if(pid.length >= 1 ) { if(submit("TRPMC02500")) { if( getNodesetCount("/root/main/patinfo/patinfolist") > 0 ) { if (isPopup()) { } else { } } else { model.resetInstanceNode("/root/main/patinfo/patinfolist"); messageBox("��� ȯ�� ��ȣ �Դϴ�.", "E999", ""); model.refresh(); } } } else { messageBox("ȯ�ڵ�Ϲ�ȣ�� ��Ȯ��", "C001"); } } function fPnmKeyPress() { model.makeValue("/root/send/srchcond", "2"); model.makeValue("/root/send/hngnm", ipt_hngnm.m_heControl.value); inputEnterKey("btn_pinfosearch", "DOMActivate"); } function fPopPtinfo() { modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/send", "/root/send"); model.resetInstanceNode("/root/send"); fSelect_Pop(); } function fPopCommUse() { setParameter("comn_chosflag", "C") setParameter("comn_formprogflag", "A") setParameter("openmode", "select"); modal("SPMRF04900"); var rtn = getParameter("comncnts"); setParameter("comncnts", ""); var re = /��/i; var re1 = /��/i; rtn = rtn.replace(re, ""); rtn = rtn.replace(re1, ""); var reccnts = model.getValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts"); if (rtn == "") { return; } if (reccnts == "") { model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", rtn); fAddrow(); } else { model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", reccnts + " " + rtn); grd_smmlist.addStatus(grd_smmlist.row, "update"); } model.refresh(); } function fAddDateReq(diffFlag) { var frdd = model.getValue("/root/init/reqmedireclist/recfromdt"); var todd = model.getValue("/root/init/reqmedireclist/rectodt"); var srcdd = new Date(); var destdd = new Date(); var diffdt; if (diffFlag == "next") { srcdd = todd.toDate(); srcdd = srcdd.getAddDate(1, "D"); frdd = srcdd.getDateFormat(); diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * 1; destdd = srcdd.getAddDate(diffdt, "M"); todd = destdd.getDateFormat(); model.makeValue("/root/init/allyn", "N"); } else if (diffFlag == "back") { srcdd = frdd.toDate(); srcdd = srcdd.getAddDate(-1, "D"); todd = srcdd.getDateFormat(); diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1; destdd = srcdd.getAddDate(diffdt, "M"); frdd = destdd.getDateFormat(); model.makeValue("/root/init/allyn", "N"); } else if (diffFlag == "today") { todd = getCurrentDate(); var today = new Date(); var frday = new Date(); var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1; frday = today.getAddDate(diffdt , "M"); frdd = frday.getDateFormat(); model.makeValue("/root/init/allyn", "N"); } else { if (model.getValue("/root/init/reqmedireclist/diffdt") != "-") { var today = todd.toDate(); var frday = new Date(); var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1; frday = today.getAddDate(diffdt , "M"); frdd = frday.getDateFormat(); button2.setDisabled(false); ipt_formrecdtfr.setDisabled(false); ipt_formrecdtto.setDisabled(false); button6.setDisabled(false); button3.setDisabled(false); model.makeValue("/root/init/allyn", "N"); } else { button2.setDisabled(true); ipt_formrecdtfr.setDisabled(true); ipt_formrecdtto.setDisabled(true); button6.setDisabled(true); button3.setDisabled(true); model.makeValue("/root/init/allyn", "Y"); } } model.setValue("/root/init/reqmedireclist/recfromdt", frdd); model.setValue("/root/init/reqmedireclist/rectodt", todd); ipt_formrecdtfr.refresh(); ipt_formrecdtto.refresh(); }