123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- /*
-
- 과색인 관리(SMMRT01300.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
-
- var xCondPath = "/root/hidden/condition"; // 조회조건
- var xIndxInfoPath = "/root/main/indxinfo/deptindx"; // 색인정보
- var xIndxInfoBKPath = "/root/hidden/main/indxinfo/deptindx"; // 색인정보
- var xDeptIndxPath = "/root/main/deptindxlist/item"; // 과색인정보
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 과색인 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSrchDeptIndxList(){
- var sIndxFlag = model.getValue(xCondPath+"/indxflag");
- if(sIndxFlag == "0"){ // 진단
- cap_indxinfo.value = "진단 색인 정보";
- }else if(sIndxFlag == "9"){ // 수술
- cap_indxinfo.value = "수술 색인 정보";
- }else if(sIndxFlag == "2"){ // 주호소
- cap_indxinfo.value = "주호소 색인 정보";
- }
- if(model.getValue(xCondPath+"/srcheddeptcd") == ""){
- return;
- }
- model.removenodeset(xDeptIndxPath);
- //model.resetInstanceNode(xCondPath);
- model.removenode("/root/send");
- model.makeValue("/root/send/indxflag", model.getValue(xCondPath+"/indxflag"));
- model.makeValue("/root/send/deptcd", model.getValue(xCondPath+"/srcheddeptcd"));
- if(submit("TRMRT01301")){
- model.setValue(xCondPath+"/selectedindxcd","");
- trv_deptindx.rebuild();
- }
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 과색인 상세 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSrchIndxInfo(){
-
- ipt_deptindxcd.disabled = true;
-
- model.removenode("/root/send");
- model.makeValue("/root/send/deptindxcd", model.getValue(xCondPath+"/selectedindxcd"));
- model.makeValue("/root/send/deptcd", model.getValue(xCondPath+"/srcheddeptcd"));
- model.makeValue("/root/send/indxflag", model.getValue(xCondPath+"/indxflag"));
- if(submit("TRMRT01302")){
- model.makeValue(xCondPath+"/highestlvel","");
- model.copyNode("/root/hidden/main","/root/main");
- model.makeValue(xIndxInfoPath + "/deptnm", model.getValue(xCondPath + "/srcheddeptnm"));
- model.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 과색인 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInit(){
- model.makeValue(xIndxInfoPath+"/status","I");
- var sIndxflag = model.getValue(xCondPath+"/getdata/indxflag");
- if(sIndxflag != ""){
- model.setValue(xCondPath+"/indxflag", sIndxflag);
- model.setValue(xCondPath+"/srcheddeptnm", model.getValue(xCondPath+"/getdata/deptnm"));
- model.setValue(xCondPath+"/srcheddeptcd", model.getValue(xCondPath+"/getdata/deptcd"));
- fSrchDeptIndxList();
- opener.javascript.setParameter("saveyn","");
- }
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 색인 추가
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddIndx(){
- var sIndxFlag = model.getValue(xCondPath+"/indxflag");
- var sDeptCd = model.getValue(xCondPath+"/srcheddeptcd");
- var sUpIndxCd = model.getValue(xCondPath+"/selectedindxcd");
- if((trv_deptindx.focusIndex < 0) && (getNodesetCount(xDeptIndxPath) > 0)){
- messageBox("색인을 선택하지", "E007");
- }
-
- if(sIndxFlag == ""){
- messageBox("색인구분을","C002");
- return;
- }
- if(sDeptCd == ""){
- messageBox("부서를","C002");
- return;
- }
- fIndxClear();
- model.setValue(xCondPath+"/highestlvel","");
- model.makeValue(xIndxInfoPath+"/deptupindxcd", sUpIndxCd); // 상위색인코드
- model.makeValue(xIndxInfoPath+"/deptupindxnm", model.getValue(xDeptIndxPath+"[deptindxcd = '"+sUpIndxCd+"']/deptindxnm")); // 상위색인명
- if(getNodesetCount(xDeptIndxPath) == 0){
- model.makeValue(xIndxInfoPath+"/deptseqno", "0");
- }
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 색인 정보 Clear
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fIndxClear(){
-
- ipt_deptindxcd.disabled = false;
-
- var iIndx = trv_deptindx.focusIndex + 1;
-
- model.setValue("/root/hidden/condition/highestlvel","Y");
- model.makeValue(xIndxInfoPath+"/deptindxcd","");
- model.makeValue(xIndxInfoPath+"/deptindxflag", model.getValue(xCondPath+"/indxflag"));
- model.makeValue(xIndxInfoPath+"/deptindxnm","");
- model.makeValue(xIndxInfoPath+"/deptupindxcd","-");
- model.makeValue(xIndxInfoPath+"/deptupindxnm","");
- model.makeValue(xIndxInfoPath+"/deptnm",model.getValue(xCondPath+"/srcheddeptnm"));
- model.makeValue(xIndxInfoPath+"/deptcd",model.getValue(xCondPath+"/srcheddeptcd"));
-
- /*
- if(model.getValue("/root/hidden/condition/highestlvel") == "Y"){
- model.makeValue(xIndxInfoPath+"/deptindxcd","");
- model.makeValue(xIndxInfoPath+"/deptindxflag", model.getValue(xCondPath+"/indxflag"));
- model.makeValue(xIndxInfoPath+"/deptindxnm","");
- model.makeValue(xIndxInfoPath+"/deptupindxcd","-");
- model.makeValue(xIndxInfoPath+"/deptupindxnm","");
- model.makeValue(xIndxInfoPath+"/deptnm",model.getValue(xCondPath+"/srcheddeptnm"));
- model.makeValue(xIndxInfoPath+"/deptcd",model.getValue(xCondPath+"/srcheddeptcd"));
- } else if(model.getValue("/root/hidden/condition/highestlvel") == "N"){
- model.makeValue(xIndxInfoPath+"/deptindxflag", model.getValue(xCondPath+"/indxflag"));
- model.makeValue(xIndxInfoPath+"/deptupindxcd", model.getValue(xDeptIndxPath + "[" + iIndx + "]/deptupindxcd"));
- model.makeValue(xIndxInfoPath+"/deptupindxnm", model.getValue(xDeptIndxPath + "[" + iIndx + "]/deptindxnm"));
- model.makeValue(xIndxInfoPath+"/deptnm",model.getValue(xCondPath+"/srcheddeptnm"));
- model.makeValue(xIndxInfoPath+"/deptcd",model.getValue(xCondPath+"/srcheddeptcd"));
- }
- */
-
- model.makeValue(xIndxInfoPath+"/status","I"); // 상태
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 색인 정보 저장
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveIndxInfo(){
- var sStatus = model.getValue(xIndxInfoPath+"/status");
- var sIndxCd = model.getValue(xIndxInfoPath+"/deptindxcd");
- var rtn = 0;
- var sNodeInfo ="deptindxcd▦deptindxnm▩색인코드▦색인명";
-
- if(fChkValueEmpty(xIndxInfoPath,sNodeInfo)){
- return;
- }
- if(model.getValue(xDeptIndxPath+"[deptindxcd ='"+sIndxCd+"']/deptindxcd") != ""){
- if(sStatus == "I" || (sStatus == "U" && sIndxCd != model.getValue(xIndxInfoPath+"/srchdeptindxcd"))){
- messageBox("이미 등록된 색인코드","E008");
- return;
- }
- }
- if(sStatus == "U"){
- if( instance1.selectSingleNode(xIndxInfoPath).xml == instance1.selectSingleNode(xIndxInfoBKPath).xml){
- messageBox("변경된 데이터가","I004");
- return;
- }
- }
- if(sStatus != "D") {
- rtn = messageBox("","Q002");
- }else{
- rtn = messageBox("","Q001");
- }
- if(rtn != 6){
- if(sStatus == "D"){
- if( instance1.selectSingleNode(xIndxInfoPath).xml == instance1.selectSingleNode(xIndxInfoBKPath).xml){
- model.setValue(xIndxInfoPath+"/status", "-");
- }else{
- model.setValue(xIndxInfoPath+"/status", "U");
- }
- }
- return;
- }
- /*
- if(sStatus == "I" && model.getValue(xIndxInfoPath+"/deptupindxcd") == ""){
- model.setValue(xIndxInfoPath+"/deptupindxcd", model.getValue(xIndxInfoPath+"/deptindxcd"));
- }*/
- model.removenode("/root/send");
- model.makeValue("/root/send/srchedindxflag",model.getValue(xCondPath+"/indxflag"));
- model.makeValue("/root/send/srcheddeptcd", model.getValue(xCondPath+"/srcheddeptcd"));
- model.makeNode("/root/send/deptindxinfo");
- model.copyNode("/root/send/deptindxinfo", xIndxInfoPath);
- if(submit("TXMRT01301")){
- fIndxClear();
- if(model.getValue(xCondPath+"/getdata/indxflag") != "" &&
- model.getValue(xCondPath+"/getdata/deptcd") == model.getValue(xCondPath+"/srcheddeptcd")){
- opener.javascript.setParameter("saveyn","Y");
- }
- //model.refresh();
- //이윤주 수정(20130312)
- fSrchDeptIndxList();
- }
- }
- /**
- * @group :
- * @ver : 2007.04.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 빈 공백 check
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChkValueEmpty(pRef, pNodeInfo){
- var sNodeInfo = pNodeInfo.split("▩");
- var sNode = sNodeInfo[0].split("▦");
- var sNodeNm = sNodeInfo[1].split("▦");
- for(var i=0; i<sNode.length; i++){
- if(model.getValue(pRef+"/"+sNode[i]) == ""){
- messageBox(sNodeNm[i]+"는 ","I003");
- return true;
- }
- }
- return false;
- }
- /**
- * @desc : Drag & Drop
- *
- * @param : srcNodePos : 기존 색인위치
- * : targetNodePos : 바뀔 색인위치
- * @return :
- * @author : HIT EMR Team
- * @---------------------------------------------------
- */
- function fDragDropIndx(){
- if(model.getValue("/root/hidden/condition/selectedindxcd") == ""){
- return;
- }
- var treePath = "/root/main/deptindxlist/item";
- var node = root.main.deptindxlist.item;
- var ins = document.models(0).instances(0);
- var srcValue = trv_deptindx.item(trv_deptindx.mouseRow).value;
- //alert("drop=" + srcValue);
- var targetNode = ins.selectSingleNode(treePath + "[deptindxcd='"+srcValue+"']" );
- //alert(targetNode.xml);
- //alert("drag=" + trv_deptindx.value);
- var srcNode = ins.selectSingleNode(treePath + "[deptindxcd='"+trv_deptindx.value+"']");
- //alert(srcNode.xml);
- //alert(model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptseqno")+","+ model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptseqno"));
- if(model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptindxcd") != model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptindxcd")){
- var rtn = messageBox("색인 순서 변경을", "Q004");
- if((model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptupindxcd") == model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptupindxcd")) && (rtn == 6)){
- // 값은 level에서만 순서변경이 가능하다
- // indxseqno 값을 변경
- if(parseInt(model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptseqno")) < parseInt(model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptseqno"))){
- //alert("위로");
- model.makeValue("/root/send/reqdata/dragdrop/status", "PLUS");
- model.makeValue("/root/send/reqdata/dragdrop/deptindxcd", model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptindxcd"));
- model.makeValue("/root/send/reqdata/dragdrop/deptseqno", model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptseqno"));
- model.makeValue("/root/send/reqdata/dragdrop/predeptseqno", model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptseqno"));
- model.makeValue("/root/send/reqdata/dragdrop/deptcd", model.getValue(xCondPath+"/srcheddeptcd"));
- model.makeValue("/root/send/reqdata/dragdrop/indxflag", model.getValue("/root/hidden/condition/indxflag"));
- } else {
- //alert("아래로");
- model.makeValue("/root/send/reqdata/dragdrop/status", "MINUS");
- model.makeValue("/root/send/reqdata/dragdrop/deptindxcd", model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptindxcd"));
- model.makeValue("/root/send/reqdata/dragdrop/deptseqno", model.getValue(treePath + "[deptindxcd='"+srcValue+"']/deptseqno"));
- model.makeValue("/root/send/reqdata/dragdrop/predeptseqno", model.getValue(treePath + "[deptindxcd='"+trv_deptindx.value+"']/deptseqno"));
- model.makeValue("/root/send/reqdata/dragdrop/deptcd", model.getValue(xCondPath+"/srcheddeptcd"));
- model.makeValue("/root/send/reqdata/dragdrop/indxflag", model.getValue("/root/hidden/condition/indxflag"));
- }
- node.insertBefore(srcNode, targetNode);
- if(submit("TXMRT01302")){
- messageBox("색인변경이 ", "I001");
- }
- } else if(rtn == 6){
- messageBox("다른 Level로 색인변경을", "E001");
- }
- }
- fIndxClear();
- trv_deptindx.rebuild();
- }
|