123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- 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();
- }
|