123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- var instance = document.models(0).instances(0);
- var pageInfo = new PAGEINFO();
- var nodelistMain = null;
- var nodelistTemp = null;
- /**
- * @group :
- * @ver : 2007.03.20
- * @by : ??????
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : ?????? Enable / Disable
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize() {
- model.removeNodeset("/root/main/selectdiaglist");
- grd_diaglist.col = 2;
- grd_diaglist.row = grd_diaglist.rows - 1;
- fAddrow();
- //dispOnLoadComplete("", model.getValue(pageInfo.formmastRef + "/formcd"));
- dispOnLoadComplete("", "0000000901");
- //parent.window.javascript.setParameter("loadformcd", model.getValue(pageInfo.formmastRef + "/formcd"));
- //parent.body.dispatch("onloadcomplete");
- //model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.03.20
- * @by : ??????
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : ?????? Enable / Disable
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGrdDelRow(){
- var iRow = grd_diaglist.row;
- var path = "/root/main/recinfo/grid";
- var nodelistJuh = instance.selectNodes(path);
- var nodelength = nodelistJuh.length;
- var smmcnts = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='0']/rectermnm");
- var smmcntcd = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='0']/rectermcd");
-
- if(nodelength > 0 && (smmcnts != "" || smmcntcd != "")){
- model.removeNode("/root/main/recinfo/grid[" + iRow + "]");
- model.removeNode("/root/tmpcc/selectdiaglist[" + iRow + "]");
- }
-
- var nodelist = model.instance1.selectNodes("/root/main/recinfo/grid");
- var totrow = nodelist.length;
- var irowcnt = 0;
- for(var i = 0; i < totrow; i++){
- var node = nodelist.item(i);
- var path1 = node.selectSingleNode("recitem[degnitemlevlcd='0000931.0000931']/rowno"); //주호소header
- var path2 = node.selectSingleNode("recitem[degnitemlevlcd='0000931.0000931.0000931']/rowno"); //주호소
- var path3 = node.selectSingleNode("recitem[degnitemlevlcd='0000931.0000931.0000168']/rowno"); //Comments
- var path4 = node.selectSingleNode("recitem[degnitemlevlcd='0000931.0000931.0000299']/rowno"); //발생일
-
- path1.text = irowcnt;
- path2.text = irowcnt;
- path3.text = irowcnt;
- path4.text = irowcnt;
- irowcnt++;
- }
-
- grd_diaglist.rebuild();
- //model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.03.20
- * @by : ??????
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : ?????? Enable / Disable
- * @param :
- * @return :
- * @---------------------------------------------------
- */
-
- function fClickPopUp()
- {
- setParameter("SPMRF04200_param_nodepath", "/root/tmpcc");
- modal("../../../emr/formngtweb/xrw/SPMRF04200_주호소팝업.xrw", 1, 0, 0, "", "", "");
- var dataYn = getParameter("MRF04200_DataYn");
- if(dataYn == "Y")
- {
- var iRow = grd_diaglist.row;
- var path = "/root/main/recinfo/grid";
- var nodelistJuh = instance.selectNodes(path);
- var nodelength = nodelistJuh.length;
- var smmcnts = model.getValue(path + "/grid[" + nodelength + "]/recitem/rectermnm");
- if (smmcnts == "")
- {
- model.removeNodeset("/root/main/recinfo/grid[" + nodelength + "]");
- model.removeNodeset("/root/main/selectdiaglist[" + nodelength + "]");
- grd_diaglist.refresh();
- }
- fReMakeInst();
- }
- }
- function fInitPage(colhide, heig, wid, ivwID)
- {
- body.attribute("height") = heig;
- body.attribute("width") = wid;
- grd_diaglist.attribute("height") = heig - 2;
- grd_diaglist.attribute("width") = wid - 4;
- grd_diaglist.extendLastCol = "scroll";
- if(colhide)
- {
- grd_diaglist.colhidden(0) = colhide;
- btn_pop.attribute("visibility") = "hidden";
- }
- if (ivwID != null && ivwID != "")
- gSendParentCallID = ivwID;
- body.refresh();
- }
- /**
- * @desc : 인스턴스 구조 변경
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReMakeInst()
- {
- var instance = document.models(0).instances(0);
- var iLeng = 0;
- var sTmpdiagcd = "";
- var sTmpdiagengnm = "";
- nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
- nodelistTemp = instance.selectNodes("/root/tmpcc/selectdiaglist");
- var iMainleng = nodelistMain.length;
- if(nodelistTemp.length >= 1){
- for(var i = 1; i <= nodelistTemp.length; i++)
- {
- //debugger;
- sTmpdiagcd = model.getValue("/root/tmpcc/selectdiaglist[" + i + "]/termcd");
- sTmpdiagengnm = model.getValue("/root/tmpcc/selectdiaglist[" + i + "]/termengnm");
- sComments = model.getValue("/root/tmpcc/selectdiaglist[" + i + "]/comments");
- sTmphappendd = model.getValue("/root/tmpcc/selectdiaglist[" + i + "]/happendd");
- // if(sTmphappendd == "" || sTmphappendd == null)
- // {
- // sTmphappendd = '-';
- // }
- //var iFndRow = getNodesetCnt(model, "/root/main/selectdiaglist/col[reccnts='" + sTmpdiagengnm + "']");
- var iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[reccnts ='" + sTmpdiagengnm + "' or rectermnm ='" + sTmpdiagengnm + "']");
- if(iFndRow > 0){
- iMainleng = iMainleng - 1;
- }else if(iFndRow <= 0){
- iLeng = i + iMainleng;
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermcd", sTmpdiagcd);
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/reccnts", sTmpdiagengnm);
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/cccnts", sComments);
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/cntsyn", "N");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/comp", "true");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/colno", "0");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/ccflag", "CC");
- if (sTmpdiagcd != "")
- {
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermflag", "004");
- }
- else
- {
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermflag", "");
- }
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/rectermcd", "");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/reccnts", sTmphappendd);
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/cntsyn", "Y");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/comp", "false");
- model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/colno", "2");
- }
- }
- }
- //debugger;
- makeProgInstance(pageInfo, instance, nodelistMain);
- fAddrow();
- }
- /**
- * @desc : 줄추가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddrow()
- {
- var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
- var nodelistJuh = instance.selectNodes(path1);
- var nodelength = nodelistJuh.length;
- var path2 = "/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]";
- copyNodeset("/root/tmp", path2, "replace", model, model);
-
- var smmcnts = model.getValue("/root/tmp/recitem[colno='0']/rectermnm");
- if(smmcnts != "" || nodelength == 0)
- {
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/rectermcd", "");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/reccnts", "-");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/cccnts", "");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/cntsyn", "N");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/comp", "true");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/colno", "0");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/ccflag", "CC");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/rectermflag", "");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/rectermcd", "");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/reccnts", "");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/cntsyn", "Y");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/comp", "false");
- model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/colno", "2");
- nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
- makeProgInstance(pageInfo, instance, nodelistMain);
- // grd_diaglist.row = nodelength + 1;
- // grd_diaglist.col = 2;
- // grd_diaglist.editCell();
- grd_diaglist.refresh();
- }
- }
- /**
- * @desc : 편집 후 termcd가 없는 경우 '-'를 넣어줌(저장문제)
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fEndEdit()
- {
- //debugger;
- var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
- var nodelistJuh = instance.selectNodes(path1);
- var nodelength = nodelistJuh.length;
- var smmcnts = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='0']/rectermnm");
-
- if(smmcnts != "")
- {
- model.setValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='0']/rectermcd", "-");
- }
-
- var sCcnm = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + grd_diaglist.row + "]/recitem[colno='0']/rectermnm");
-
- if (sCcnm == "")
- {
- fGrdDelRow();
- }
- }
- /**
- * @desc : 저장전 검사
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChkGrdPreSave()
- {
- var path = "/root/main/recinfo/recitem[degnitemno = '1']";
- var nodelistJuh = instance.selectNodes(path);
- var nodelength = (nodelistJuh.length);
- var smmcnts = "";
- var comment = "";
- var happendd = "";
- var sMsg = "";
- var rtn = true;
- for (var i = 1; i <= nodelength; i++)
- {
- smmcnts = model.getValue(path + "[" + i + "]/recitem[colno='0']/rectermnm");
- comment = model.getValue(path + "[" + i + "]/recitem[colno='0']/reccnts");
- happendd = model.getValue(path + "[" + i + "]/recitem[colno='2']/reccnts");
- if ((comment != "" || happendd != "") && smmcnts == "")
- {
- var sMsg = "주호소는";
- }
- }
- if(sMsg != "")
- {
- messageBox(sMsg, "I003");
- rtn = false;
- }
- return rtn;
- }
- /**
- * @desc : 상용구 팝업
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fPopCommUse()
- {
- setParameter("comn_chosflag", "C") // C : 상용구
- setParameter("comn_formprogflag", "B") // A: Summary, B : 주호소
- setParameter("openmode", "select");
-
- // 새로운 상용구 관리 Param 추가
- setParameter("deptflag", "U");
-
- //modal("SPMRF04700");
-
- var pageInfo = new PAGEINFO();
-
- //var grdNodeList = findNodeset(model, "/root/main/recinfo/grid[degnitemlevlcd = '0000931']");
- //var fstlevlitemcd = model.getValue(pageInfo.recItemRef + "[degnitemno='" + degnitemno + "']/fstlevlitemcd");
-
- setParameter("comn_degnitemcd", "0000931");
- setParameter("comn_srcformcd", "0000000901");
-
- modal("SPMRF04900",1 ,50, 50);
- var rtn = getParameter("comncnts"); //내용
- setParameter("comncnts", "");
- var grdNodeList = findNodeset(model, "/root/main/recinfo/grid[degnitemno = '1']");
- var rowno = grd_diaglist.row -1;
-
- var grdNode = "";
- var recitemNodelist = "";
- var recitemNode = "";
- var reccnts = "";
- var subnode = "";
- grdNode = grdNodeList.item(rowno);
- recitemNodelist = grdNode.selectSingleNode("recitem[colno='0']");
-
- if(recitemNodelist != null)
- {
- reccnts = recitemNodelist.selectSingleNode("rectermnm").text;
- }
-
- if (rtn == "")
- {
- return;
- }
- if (reccnts == "")
- {
- recitemNodelist.selectSingleNode("rectermnm'").text = rtn;
- fEndEdit();
- fAddrow();
- }
- else
- {
- recitemNodelist.selectSingleNode("rectermnm").text = reccnts + " " + rtn;
- }
- model.refresh();
- }
|