123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 |
- /*
-
- 진술문 속성관리(SMMNR01700.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xCondPath = "/root/hidden/cond";
- var xRefPath = "/root/hidden/refinfo"; // 팝업 파라미터 경로
- var xRecPath = "/root/hidden/recinfo"; // 팝업 리턴 경로
- var xAttrListPath = "/root/main/attrinfo/attrlist"; // 속성 코드 경로
- var xDetlAttrPath = "/root/main/detlattrspec/detlattrlist"; // 상세 속성 코드 경로
- var xICNPInfoPath = "/root/main/icnplist"; // ICNP 용어 조회 경로
- var xMainCondPath = "/root/main/cond"; // 조건 정보
- var xPrcpSrchPath = "/root/main/prcpmappspec/prcplist";
- var xPrcpPath = "/root/main/prcpmappspec";
- /**
- * @group :
- * @ver : 2007.02.22
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
-
- function fInit(){
-
- model.setvalue("/root/hidden/cond/attrflag","C");
- model.setValue("/root/hidden/cond/attrnm","");
- if(model.getValue("/root/hidden/refinfo/flag") == "p"){
- btn_selattr1.visible = true;
- btn_selattr2.visible = true;
- }else{
- btn_selattr1.visible = false;
- btn_selattr2.visible = false;
- }
- fSearch();
- }
- /**
- * @group :
- * @ver : 2007.02.23
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 속성 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearch(pFlag){
- var sAttrFlag = model.getValue(xCondPath+"/attrflag");
- model.removenode("/root/send");
- switch(sAttrFlag){
- case 'C' :
- case 'A' :
- if(pFlag == null){
- model.setValue(xCondPath+"/attrnm","");
- }
- model.removenodeset(xAttrListPath);
- model.removenodeset(xDetlAttrPath);
- model.removenodeset(xICNPInfoPath+"/icnpinfo");
- model.removenodeset(xPrcpSrchPath);
- model.toggle("attrinfo1");
- break;
- case 'V' :
- grd_attrlist2.colHidden(3)=true;
- grd_attrlist2.colHidden(4)=false;
- model.removenodeset(xAttrListPath);
- model.removenodeset(xDetlAttrPath);
- model.removenodeset(xPrcpSrchPath);
- model.removenodeset(xICNPInfoPath+"/icnpinfo");
- model.toggle("attrinfo2");
- break;
- case 'F' :
- grd_attrlist2.colHidden(3)=false;
- grd_attrlist2.colHidden(4)=true;
- model.removenodeset(xDetlAttrPath);
- model.removenodeset(xPrcpSrchPath);
- model.toggle("attrinfo2");
- break;
- }
- model.makeValue("/root/send/attrflag",model.getValue(xCondPath+"/attrflag"));
- model.makeValue("/root/send/supcd","********");
- if(model.getValue("/root/hidden/cond/attrnm") != ""){
- model.makeValue("/root/send/attrnm",model.getValue(xCondPath+"/attrnm"));
- }
- submit("TRMNR01701");
- model.copyNode("/root/hidden/main","/root/main");
-
- }
- /**
- * @group :
- * @ver : 2007.02.28
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 클릭시
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOnClickedGrid(pFlag){
- var sAttrFlag = model.getValue(xCondPath+"/attrflag");
- var xPath = "";
- var sRow = 0;
- var sCol = 0;
- if(pFlag == "attr"){
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sRow = grd_detlattrlist.row;
- if(sRow < 1) return;
- model.makeValue("/root/send/attrcd", model.getValue(xDetlAttrPath+"["+sRow+"]/attrcd"));
- model.removenode(xICNPInfoPath+"/icnpinfo");
- model.makeValue(xICNPInfoPath+"/icnpinfo","");
- model.copyNode(xICNPInfoPath, xDetlAttrPath+"["+sRow+"]/icnpinfo");
- grd_detlattrlist.rebuild();
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sRow = grd_attrlist2.row;
- if(sRow < 1) return;
- model.removenode(xICNPInfoPath+"/icnpinfo");
- model.makeValue(xICNPInfoPath+"/icnpinfo","");
- model.copyNode(xICNPInfoPath, xAttrListPath+"["+sRow+"]/icnpinfo");
- grd_icnpinfo2.rebuild();
- break;
- }
-
- }else if(pFlag == "detlattr"){
- sRow = grd_attrlist1.row;
- if(sRow < 1) return;
- if(model.getValue(xAttrListPath+"["+sRow+"]/attrcd") == "") return;
-
- model.removenode(xICNPInfoPath+"/icnpinfo");
- model.removenodeset(xDetlAttrPath);
- model.removenode("/root/send");
- model.makeValue("/root/send/attrflag",model.getValue(xCondPath+"/attrflag"));
- model.makeValue("/root/send/supcd",model.getValue(xAttrListPath+"["+sRow+"]/attrcd"));
- submit("TRMNR01702");
- model.copyNode("/root/hidden/main","/root/main");
- }else if(pFlag == "prcp"){
- sRow = grd_detlattrlist.row;
- sCol = grd_detlattrlist.col;
- if(sRow < 1) return;
- if(grd_detlattrlist.colRef("prcpmappyn") != sCol) return;
-
- model.removenode(xICNPInfoPath+"/icnpinfo");
- model.makeValue(xICNPInfoPath+"/icnpinfo","");
- model.copyNode(xICNPInfoPath, xDetlAttrPath+"["+sRow+"]/icnpinfo");
- grd_icnpinfo1.rebuild();
- //매핑 처방 정보를 조회함
- var sAttrcd = grd_detlattrlist.valueMatrix(grd_detlattrlist.row, grd_detlattrlist.colRef("attrcd"));
- if( sAttrcd != ""){
- fInitPrcpObject();
- //model.removenode("/root/send");
- model.makeValue("/root/send/lnkflag", "A");
- model.makeValue("/root/send/lnkcd", sAttrcd);
- submit("TRMNR01703");
- }
-
-
- /*
- model.removenodeset(xPrcpSrchPath);
- model.removenode("/root/send");
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sRow = grd_detlattrlist.row;
- if(sRow < 1) return;
- model.makeValue("/root/send/attrcd", model.getValue("/root/main/detlattrspec/detlattrlist["+sRow+"]/attrcd"));
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sRow = grd_attrlist2.row;
- if(sRow < 1) return;
- model.makeValue("/root/send/attrcd", model.getValue("/root/main/attrinfo/attrlist["+sRow+"]/attrcd"));
- break;
- }
- model.makeValue("/root/send/attrflag",model.getValue("/root/hidden/cond/attrflag"));
- submit("TRMNR01703");
- model.copyNode("/root/hidden/main","/root/main");
- */
- }
- }
- /**
- * @group :
- * @ver : 2007.02.23
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 한줄 추가
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddGridRow(pFlag){
- var sAttrFlag = model.getValue("/root/hidden/cond/attrflag");
- var xPath = "";
- var sRow = 0;
- if(pFlag == "attr"){ // 속성
- xPath = "/root/main/attrinfo/attrlist";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- grd_attrlist1.addItem();
- sRow = grd_attrlist1.rows-grd_attrlist1.fixedrows;
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- grd_attrlist2.addItem();
- sRow = grd_attrlist2.rows-grd_attrlist2.fixedrows;
- break;
- }
- model.setValue(xPath+"["+sRow+"]/stat","I"); // 상태
- model.setValue(xPath+"["+sRow+"]/plnumchoiyn","N"); // 멀티선택여부
- model.setValue(xPath+"["+sRow+"]/difrecrefyn","N"); // 타기록참조여부
- model.setValue(xPath+"["+sRow+"]/refseq",0); // 정렬순서
- model.setValue(xPath+"["+sRow+"]/attrflag",sAttrFlag); // 속성구분
- model.setValue(xPath+"["+sRow+"]/lastupdtrid",getUserId()); // 등록자ID (세션 정보 읽어오기)
- model.setValue(xPath+"["+sRow+"]/lastupdtrnm",getUserName()); // 등록자 (세션 정보 읽어오기)
- model.setValue(xPath+"["+sRow+"]/supcd","********"); // 상위코드
- if(sAttrFlag == "V"){ // 수치속성
- model.setValue(xPath+"["+sRow+"]/attrnm","(수치)"); // 속성구분
- }
-
- }else if(pFlag == "detlattr"){ // 상세 속성
- var sSupAttrRow = grd_attrlist1.row;
- var xSupAttrPath = "/root/main/attrinfo/attrlist";
- if(sSupAttrRow < 1){
- messageBox("상위코드가","I004");
- return;
- }
-
- if(model.getValue(xSupAttrPath+"["+sSupAttrRow+"]/stat") == "I"){
- messageBox("상위코드가 저장되지","E007");
- return;
- }
-
- grd_detlattrlist.addItem();
- sRow=grd_detlattrlist.rows - grd_detlattrlist.fixedrows;
- xPath = "/root/main/detlattrspec/detlattrlist";
- model.setValue(xPath+"["+sRow+"]/stat","I"); // 상태
- model.setValue(xPath+"["+sRow+"]/refseq",0); // 정렬순서
- model.setValue(xPath+"["+sRow+"]/supcd",model.getValue(xSupAttrPath+"["+sSupAttrRow+"]/attrcd")); // 상위코드
- model.setValue(xPath+"["+sRow+"]/attrflag",sAttrFlag); // 속성구분
- model.setValue(xPath+"["+sRow+"]/lastupdtrid",getUserId()); // 등록자ID (세션 정보 읽어오기)
- model.setValue(xPath+"["+sRow+"]/lastupdtrnm",getUserName()); // 등록자 (세션 정보 읽어오기)
-
- }else if(pFlag == "prcp"){ // 처방 내역
- xPath = "/root/main/prcpmappspec/prcplist";
- var sAttrRow = "";
- var xAttrPath = "";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sAttrRow = grd_detlattrlist.row;
- xAttrPath = "/root/main/detlattrspec/detlattrlist";
- if(sAttrRow < 1){
- messageBox("속성코드가","I004");
- return;
- }
-
- if(model.getValue(xAttrPath+"["+sAttrRow+"]/stat") == "I"){
- messageBox("상세속성코드가 저장되지","E007");
- return;
- }
- grd_prcplist1.addItem();
- sRow = grd_prcplist1.rows-grd_prcplist1.fixedrows;
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sAttrRow = grd_attrlist2.row;
- xAttrPath = "/root/main/attrinfo/attrlist";
- if(sAttrRow < 1){
- messageBox("속성코드가","I004");
- return;
- }
-
- if(model.getValue(xAttrPath+"["+sAttrRow+"]/stat") == "I"){
- messageBox("속성코드가 저장되지","E007");
- return;
- }
- grd_prcplist2.addItem();
- sRow = grd_prcplist2.rows-grd_prcplist2.fixedrows;
- break;
- }
- model.setValue(xPath+"["+sRow+"]/stat","I"); // 상태
- model.setValue(xPath+"["+sRow+"]/attrcd",model.getValue(xAttrPath+"["+sAttrRow+"]/attrcd")); // 속성코드
- model.setValue(xPath+"["+sRow+"]/lastupdtrid",getUserId()); // 등록자ID
- model.setValue(xPath+"["+sRow+"]/lastupdtrnm",getUserName()); // 등록자
- }
-
- }
-
- /**
- * @group :
- * @ver : 2007.02.23
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 한줄 삭제
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelGridRow(pFlag){
- var sAttrFlag = model.getValue("/root/hidden/cond/attrflag");
- var xPath = "";
- var sRow = 0;
- var sStat = "";
- if(pFlag == "attr"){ // 속성
- xPath = "/root/main/attrinfo/attrlist";
- if(sAttrFlag == "C" || sAttrFlag =="A"){ // 코드속성, 사정도구
- sRow = grd_attrlist1.row;
- }else{ // 수치속성, 특수속성
- sRow = grd_attrlist2.row;
- }
-
- if(sRow < 1){
- messageBox("삭제할 수","I004");
- return;
- }
- sStat = model.getValue(xPath+"["+sRow+"]/stat");
- if(sStat == "I"){ // 신규
- if(sAttrFlag == "C" || sAttrFlag =="A"){ // 코드속성, 사정도구
- grd_attrlist1.deleteItem(sRow);
- }else{ // 수치속성, 특수속성
- grd_attrlist2.deleteItem(sRow);
- }
- }else if(sStat == "D"){
- model.setValue(xPath+"["+sRow+"]/stat","-");
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","D");
- grd_attrlist1.rowStatus(sRow) = 4;
- }
- }else if(pFlag == "detlattr"){
- xPath = "/root/main/detlattrspec/detlattrlist";
- sRow = grd_detlattrlist.row;
- if(sRow < 1){
- messageBox("삭제할 수","I004");
- return;
- }
- sStat = model.getValue(xPath+"["+sRow+"]/stat");
- if(sStat == "I"){ // 신규
- grd_detlattrlist.deleteItem(sRow);
- }else if(sStat == "D"){
- model.setValue(xPath+"["+sRow+"]/stat","-");
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","D");
- }
- }else if(pFlag == "prcp"){
- xPath = "/root/main/prcpmappspec/prcplist";
- if(sAttrFlag == "C" || sAttrFlag =="A"){ // 코드속성, 사정도구
- sRow = grd_prcplist1.row;
- }else{ // 수치속성, 특수속성
- sRow = grd_prcplist2.row;
- }
-
- if(sRow < 1){
- messageBox("삭제할 수","I004");
- return;
- }
- if(model.getValue(xPath+"["+sRow+"]/stat") == "I"){ // 신규
- if(sAttrFlag == "C" || sAttrFlag =="A"){ // 코드속성, 사정도구
- grd_prcplist1.deleteItem(sRow);
- }else{ // 수치속성, 특수속성
- grd_prcplist2.deleteItem(sRow);
- }
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","D");
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.02.26
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 저장
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSave(pFlag){
- var xPath = "";
- var sAttrFlag = model.getValue("/root/hidden/cond/attrflag");
- var sRow = 0;
- var sRowCnt = 0;
- var sStat = "";
- model.removenode("/root/send");
- if(pFlag == "attr"){
- xPath = "/root/main/attrinfo/attrlist";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sRowCnt = grd_attrlist1.rows-grd_attrlist1.fixedrows;
- /* xml 데이터는 인스턴스 하나로 xml 타입의 데이터를 만들수 있기에
- 그리드의 일부 노드로 xml 타입의 데이터를 만들 수 없다.
- 그래서 특정 인스턴스에 옮겼다가 xml 타입으로 변환한 후에 다시 읽어오는 식으로 사용함.
- 저장시 한꺼번에 여러 row을 저장하기 위한 작업임.
- */
- for(var i=1;i<=sRowCnt; i++){
- sStat = model.getValue(xAttrListPath+"["+i+"]/stat");
- if( sStat == "-" || sStat == "D") continue;
- model.copyNode(xRecPath+"/icnpinfo",xAttrListPath+"["+i+"]/icnpinfo/icnpinfo");
- model.setValue(xAttrListPath+"["+i+"]/icnpinfo",root.hidden.recinfo.icnpinfo.xml);
- }
- model.makeValue("/root/send/attrlist",grd_attrlist1.getupdatedataAll("i"));
-
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sRowCnt = grd_attrlist2.rows-grd_attrlist2.fixedrows;
- /* xml 데이터는 인스턴스 하나로 xml 타입의 데이터를 만들수 있기에
- 그리드의 일부 노드로 xml 타입의 데이터를 만들 수 없다.
- 그래서 특정 인스턴스에 옮겼다가 xml 타입으로 변환한 후에 다시 읽어오는 식으로 사용함.
- 저장시 한꺼번에 여러 row을 저장하기 위한 작업임.
- */
- for(var i=1;i<=sRowCnt; i++){
- sStat = model.getValue(xAttrListPath+"["+i+"]/stat");
- if( sStat == "-" || sStat == "D") continue;
- model.copyNode(xRecPath+"/icnpinfo",xAttrListPath+"["+i+"]/icnpinfo/icnpinfo");
- model.setValue(xAttrListPath+"["+i+"]/icnpinfo",root.hidden.recinfo.icnpinfo.xml);
- }
- model.makeValue("/root/send/attrlist",grd_attrlist2.getupdatedataAll("i"));
- break;
- }
- if(sRowCnt < 0){
- messageBox("처리할 데이터가 ","I004");
- return;
- }
- if(messageBox("","Q002") != 6) return;
- model.makeValue("/root/send/attrflag",model.getValue(xCondPath+"/attrflag"));
- model.makeValue("/root/send/supcd","********");
- submit("TXMNR01701");
- model.copyNode("/root/hidden/main","/root/main");
- }else if(pFlag == "detlattr"){
- xPath = "/root/main/attrinfo/attrlist";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sRow = grd_attrlist1.row;
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sRow = grd_attrlist2.row;
- break;
- }
- sRowCnt = grd_detlattrlist.rows-grd_detlattrlist.fixedrows;
- if(sRowCnt < 0){
- messageBox("처리할 데이터가 ","I004");
- return;
- }
- if(messageBox("","Q002") != 6) return;
- /* xml 데이터는 인스턴스 하나로 xml 타입의 데이터를 만들수 있기에
- 그리드의 일부 노드로 xml 타입의 데이터를 만들 수 없다.
- 그래서 특정 인스턴스에 옮겼다가 xml 타입으로 변환한 후에 다시 읽어오는 식으로 사용함.
- 저장시 한꺼번에 여러 row을 저장하기 위한 작업임.
- */
- for(var i=1;i<=sRowCnt; i++){
- sStat = model.getValue(xDetlAttrPath+"["+i+"]/stat");
- if( sStat == "-" || sStat == "D") continue;
- model.copyNode(xRecPath+"/icnpinfo",xDetlAttrPath+"["+i+"]/icnpinfo/icnpinfo");
- model.setValue(xDetlAttrPath+"["+i+"]/icnpinfo",root.hidden.recinfo.icnpinfo.xml);
- }
- model.makeValue("/root/send/attrlist",grd_detlattrlist.getupdatedataAll("i"));
- model.makeValue("/root/send/attrflag",model.getValue(xCondPath+"/attrflag"))
- model.makeValue("/root/send/supcd",model.getValue(xPath+"["+sRow+"]/attrcd"));
- submit("TXMNR01702");
- model.copyNode("/root/hidden/main","/root/main");
-
- }else if(pFlag == "prcp"){
- xPath = "/root/main/prcpmappspec/prcplist";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- model.makeValue("/root/send/prcplist",grd_prcplist1.getupdatedataAll("i"));
- sRow = grd_detlattrlist.row;
- sRowCnt = grd_prcplist1.rows-grd_prcplist1.fixedrows;
- model.makeValue("/root/send/attrcd", model.getValue("/root/main/detlattrspec/detlattrlist["+sRow+"]/attrcd"));
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- model.makeValue("/root/send/prcplist",grd_prcplist2.getupdatedataAll("i"));
- sRow = grd_attrlist2.row;
- sRowCnt = grd_prcplist2.rows-grd_prcplist2.fixedrows;
- model.makeValue("/root/send/attrcd", model.getValue("/root/main/attrinfo/attrlist["+sRow+"]/attrcd"));
- break;
- }
- if(sRowCnt < 1){
- messageBox("처리할 데이터가 ","I004");
- return;
- }
-
- if(grd_detlattrlist.valueMatrix(grd_detlattrlist.row, grd_detlattrlist.colRef("attrcd")) == ""){
- messageBox("매핑할 속성을","C002");
- return;
- }
-
- if(messageBox("","Q002") != 6) return;
- model.makeValue("/root/send/lnkflag", "A");
- model.makeValue("/root/send/lnkcd", grd_detlattrlist.valueMatrix(grd_detlattrlist.row, grd_detlattrlist.colRef("attrcd") ));
- model.makeValue("/root/send/attrflag", model.getValue("/root/hidden/cond/attrflag"));
- if(submit("TXMNR01703") == true){
- grd_detlattrlist.valueMatrix(grd_detlattrlist.row, grd_detlattrlist.colref("prcpmappyn")) = "Y";
- model.copyNode("/root/hidden/main","/root/main");
- }
- }
-
- }
- /**
- * @group :
- * @ver : 2007.02.26
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : grid의 컬럼 변경시..
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChangedGridCol(pFlag){
- var sAttrFlag = model.getValue(xCondPath+"/attrflag");
- var sRow = 0;
- var sCol = 0;
- var xPath = "";
- var xCPath = "";
-
-
- if(pFlag == "attr"){
- xPath = "/root/main/attrinfo/attrlist";
- xCPath = "/root/hidden/main/attrinfo/attrlist";
- if(sAttrFlag == "C" || sAttrFlag == "A"){
- sCol = grd_attrlist1.col;
- sRow = grd_attrlist1.row;
- }else if(sAttrFlag == "V" || sAttrFlag == "F"){
- sCol = grd_attrlist2.col;
- sRow = grd_attrlist2.row;
- }
- var sAttrNm = model.getValue(xPath+"["+sRow+"]/attrnm");
- var sLen = sAttrNm.length;
- if(sAttrNm != ""){
- if(sAttrNm.substr(0,1) != "("){
- sAttrNm = "("+sAttrNm;
- }
- if(sAttrNm.substr(sLen-1,1) != ")"){
- sAttrNm += ")";
- }
- model.setValue(xPath+"["+sRow+"]/attrnm",sAttrNm);
- }
- if(model.getValue(xPath+"["+sRow+"]/stat")=="I"){
- if(sAttrFlag=="V" && sCol == 4){
- var sUnitNm = model.getValue(xPath+"["+sRow+"]/unitnm");
- model.setValue(xPath+"[" + sRow + "]/desccnts", "수치정보 기록중 단위가 " + sUnitNm + "인 속성을 기록한다");
- }
- return; // 신규
- }
-
- sAttrCd = model.getValue(xPath+"["+sRow+"]/attrcd");
- // 데이터 변경 여부 check
- if( model.getValue(xPath+"["+sRow+"]/attrnm") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/attrnm") &&
- model.getValue(xPath+"["+sRow+"]/desccnts") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/desccnts") &&
- model.getValue(xPath+"["+sRow+"]/plnumchoiyn") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/plnumchoiyn") &&
- model.getValue(xPath+"["+sRow+"]/difrecrefyn") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/difrecrefyn") &&
- model.getValue(xPath+"["+sRow+"]/reftrgtnm") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/reftrgtnm") &&
- model.getValue(xPath+"["+sRow+"]/reftrgtcd") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/reftrgtcd") &&
- model.getValue(xPath+"["+sRow+"]/itemcd") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/itemcd") &&
- model.getValue(xPath+"["+sRow+"]/refseq") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/refseq") &&
- model.getValue(xPath+"["+sRow+"]/unitnm") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/unitnm")){
- model.setValue(xPath+"["+sRow+"]/stat","-");
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","U");
- if(model.getValue(xPath+"["+sRow+"]/attrnm") != model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/attrnm") ||
- model.getValue(xPath+"["+sRow+"]/unitnm") != model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/unitnm") ){
- model.setValue(xPath+"["+sRow+"]/stmtupdyn", "Y");
- model.setValue(xPath+"["+sRow+"]/beforeattrnm", model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/attrnm") );
- model.setValue(xPath+"["+sRow+"]/beforeunitnm", model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/unitnm") );
- }else{
- model.setValue(xPath+"["+sRow+"]/stmtupdyn", "N");
- }
- if(sAttrFlag=="V" && sCol == 4){
- var sUnitNm = model.getValue(xPath+"["+sRow+"]/unitnm");
- model.setValue(xPath+"[" + sRow + "]/desccnts", "수치정보 기록중 단위가 " + sUnitNm + "인 속성을 기록한다");
- }
- }
- }else if(pFlag == "detlattr"){
- xPath = "/root/main/detlattrspec/detlattrlist";
- xCPath = "/root/hidden/main/detlattrspec/detlattrlist";
- sRow = grd_detlattrlist.row;
- sCol = grd_detlattrlist.col;
- if(model.getValue(xPath+"["+sRow+"]/stat")=="I") return;
- sAttrCd = model.getValue(xPath+"["+sRow+"]/attrcd");
- // 데이터 변경 여부 check
- if( model.getValue(xPath+"["+sRow+"]/attrnm") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/attrnm") &&
- model.getValue(xPath+"["+sRow+"]/desccnts") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/desccnts") &&
- model.getValue(xPath+"["+sRow+"]/refseq") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/refseq") &&
- model.getValue(xPath+"["+sRow+"]/attrgrde") == model.getValue(xCPath+"[ attrcd = '"+sAttrCd+"']/attrgrde")){
- model.setValue(xPath+"["+sRow+"]/stat","-");
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","U");
- }
- }else if(pFlag == "prcp"){
- xPath = "/root/main/prcpmappspec/prcplist";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sRow = grd_prcplist1.row;
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sRow = grd_prcplist2.row;
- break;
- }
- if(model.getValue(xPath+"["+sRow+"]/stat")=="I") return;
- var sPrcpCd = model.getValue(xPath+"["+sRow+"]/prcpcd");
- if( model.getValue(xPath+"["+sRow+"]/prcpcd") == model.getValue(xCPath+"[ prcpcd = '"+sAttrCd+"']/prcpcd") &&
- model.getValue(xPath+"["+sRow+"]/size") == model.getValue(xCPath+"[ prcpcd = '"+sAttrCd+"']/size") &&
- model.getValue(xPath+"["+sRow+"]/qty") == model.getValue(xCPath+"[ prcpcd = '"+sAttrCd+"']/qty")){
- model.setValue(xPath+"["+sRow+"]/stat","-");
- }else{
- model.setValue(xPath+"["+sRow+"]/stat","U");
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.03.15
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 팝업 호출
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCallPopUp(pFlag){
- var sAttrFlag = model.getValue(xCondPath+"/attrflag");
- var sCol = -1;
- var xpos = event.screenX;
- var ypos = event.screenY;
- if(pFlag == "attr"){
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- sCol = grd_attrlist1.col;
- sRow = grd_attrlist1.row;
- if(sCol == 14){
- sTermInfo = fTermAnaly(model.getValue(xAttrListPath+"["+sRow+"]/attrnm"));
- model.removenode(xRefPath);
- model.removenodeset(xRecPath+"/icnpinfo");
- model.makeValue(xRefPath+"/terminfo",sTermInfo);
- model.makeValue(xRefPath+"/receiveref",xRecPath+"/icnpinfo");
- modal("SPMNR01500",1,xpos,ypos,"SPMNR01500",xRefPath,xRefPath);
-
- if(model.getValue(xRecPath+"/icnpinfo/icnp[1]/flag") != ""){
- model.copyNode(xAttrListPath+"["+ sRow+"]/icnpinfo/icnpinfo",xRecPath+"/icnpinfo");
- model.setValue(xAttrListPath+"["+ sRow+"]/icnpyn", "Y");
- if(model.getValue(xAttrListPath+"["+ sRow+"]/stat") == "-"){
- model.setValue(xAttrListPath+"["+ sRow+"]/stat","U");
- }
- grd_attrlist1.rebuild();
- }
- }
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- sCol = grd_attrlist2.col;
- sRow = grd_attrlist2.row;
- if(sCol == 14){
- if(sAttrFlag =="V")
- sTermInfo = fTermAnaly(model.getValue(xAttrListPath+"["+sRow+"]/unitnm"));
- else
- sTermInfo = fTermAnaly(model.getValue(xAttrListPath+"["+sRow+"]/attrnm"));
-
- if(sTermInfo == false){
- messageBox("입력된 속성이","I004");
- return;
- }
- model.removenode(xRefPath);
- model.removenodeset(xRecPath+"/icnpinfo/icnp"); // 팝업창에서 받아온 icnp 정보
- model.makeValue(xRefPath+"/terminfo",sTermInfo); // 팝업창에 넘길 속성 정보
- model.makeValue(xRefPath+"/receiveref",xRecPath+"/icnpinfo"); // 팝업창에서 받아올 icnp 정보 위치
- modal("SPMNR01500",1,xpos,ypos,"SPMNR01500",xRefPath,xRefPath);
-
- if(model.getValue(xRecPath+"/icnpinfo/icnp[1]/flag") != ""){ // 리턴된 데이터가 있는지 유무 체크
- model.makeValue(xAttrListPath+"["+ sRow+"]/icnpinfo/icnpinfo",""); // icnp정보가 DB에 저장된 후에는 icnpinfo 정보가 2레벨로 발생됨.
- model.copyNode(xAttrListPath+"["+ sRow+"]/icnpinfo/icnpinfo",xRecPath+"/icnpinfo");
- model.setValue(xAttrListPath+"["+ sRow+"]/icnpyn", "Y");
- if(model.getValue(xAttrListPath+"["+ sRow+"]/stat") == "-"){
- model.setValue(xAttrListPath+"["+ sRow+"]/stat","U");
- }
- grd_attrlist2.rebuild();
- }
- }
- break;
- }
- }else if(pFlag == "detlattr"){
- sCol = grd_detlattrlist.col;
- sRow = grd_detlattrlist.row;
- if(sCol == 14){
- sTermInfo = fTermAnaly(model.getValue(xDetlAttrPath+"["+sRow+"]/attrnm"));
-
- if(sTermInfo == false){
- messageBox("입력된 속성이","I004");
- return;
- }
- model.removenode(xRefPath);
- model.removenodeset(xRecPath+"/icnpinfo/icnp"); // 팝업창에서 받아온 icnp 정보
- model.makeValue(xRefPath+"/terminfo",sTermInfo); // 팝업창에 넘길 속성 정보
- model.makeValue(xRefPath+"/receiveref",xRecPath+"/icnpinfo"); // 팝업창에서 받아올 icnp 정보 위치
- modal("SPMNR01500",1,xpos,ypos,"SPMNR01500",xRefPath,xRefPath);
-
- if(model.getValue(xRecPath+"/icnpinfo/icnp[1]/flag") != ""){ // 리턴된 데이터가 있는지 유무 체크
- // icnp정보가 DB에 저장된 후에는 icnpinfo 정보가 2레벨로 발생되기에 노드를 하나 생성하여 저장함.
- model.makeValue(xDetlAttrPath+"["+ sRow+"]/icnpinfo/icnpinfo","");
- model.copyNode(xDetlAttrPath+"["+ sRow+"]/icnpinfo/icnpinfo",xRecPath+"/icnpinfo");
- model.setValue(xDetlAttrPath+"["+ sRow+"]/icnpyn", "Y");
- if(model.getValue(xDetlAttrPath+"["+ sRow+"]/stat") == "-"){
- model.setValue(xDetlAttrPath+"["+ sRow+"]/stat","U");
- }
- grd_detlattrlist.rebuild();
- }
- }
- //상세 속성별 처방 매핑 처리
- }else if(pFlag == "prcp"){
- if(model.getValue(xMainCondPath+"/prcpnm") == ""){
- messageBox("검색어를","C001");
- return;
- }
-
- if(grd_detlattrlist.row < 1 ){
- messageBox("상세 속성을","C002");
- return;
- }
-
- var iRow = 0;
-
- setParameter("prcpsrchflag","nm");
- setParameter("srchtextval",model.getValue(xMainCondPath+"/prcpnm"));
- setParameter("scrnflag","rec");
- setParameter("srchParam","srchSET");
- setParameter("rtnpath",xPrcpPath);
- //model.makeNode(xPrcpPath);
- modal("SPMNW11100");
-
- iRow = grd_prcplist1.rows - grd_prcplist1.fixedrows;
- if(model.getValue(xPrcpSrchPath+"["+iRow+"]/status") == "-" && iRow > 0){
- model.setValue(xPrcpSrchPath+"["+iRow+"]/status", "I");
- model.setValue(xMainCondPath+"/prcpnm","");
- grd_prcplist1.rebuild();
- model.refresh();
- }else{
- model.setValue(xMainCondPath+"/prcpnm","");
- return;
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.03.16
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 용어분석
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fTermAnaly(pTerm){
- if(pTerm == "") return false;
-
- var sTermInfo = "";
- var sTemp1 = pTerm.split("(");
- var sTemp2 = "";
- for(var i=0;i < sTemp1.length; i++){
- if(sTemp1[i] == "") continue;
- sTermInfo += sTemp1[i]+" ";
- }
- sTemp2 = sTermInfo.split(" ");
- sTermInfo = "";
- for(var i=0; i<sTemp2.length; i++){
- sTemp1 = sTemp2[i].split(")");
- for(var j=0; j<sTemp1.length; j++){
- if(sTemp1[j] == "") continue;
- sTermInfo += sTemp1[j]+" ";
- }
- }
- return sTermInfo;
- }
- /**
- * @group :
- * @ver : 2007.03.15
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 팝업 호출
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSendAttrInfo(){
- var sAttrFlag = model.getValue(xCondPath+"/attrflag");
- var iRow = 0;
- var sArrtInfoHeader = "attrcd▦attrnm▦attrflag▦plnumchoiyn▦refseq▩";
- var sAttrInfo = "";
- switch(sAttrFlag){
- case 'C' : // 코드속성
- case 'A' : // 사정도구
- iRow = grd_attrlist1.row;
- break;
- case 'V' : // 수치속성
- case 'F' : // 특수속성
- iRow = grd_attrlist2.row;
- break;
- }
- if(iRow < 1) return;
- sAttrInfo += model.getValue(xAttrListPath+"["+iRow+"]/attrcd")+"▦"
- + model.getValue(xAttrListPath+"["+iRow+"]/attrnm")+"▦"
- + sAttrFlag+"▦"
- + model.getValue(xAttrListPath+"["+iRow+"]/plnumchoiyn")+"▦"
- + model.getValue(xAttrListPath+"["+iRow+"]/refseq")+"▩";
- opener.javascript.setParameter("SMMNR01700_Retrun",sArrtInfoHeader+sAttrInfo);
- model.close();
- }
- /**
- * @group :
- * @ver : 2008.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 Object 컨트롤
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitPrcpObject(){
- btn_srchprcp.disabled = false;
- ipt_prcpnm.disabled = false;
- btn_saveprcp.disabled = false;
- }
- /**
- * @group :
- * @ver : 2008.07.07
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 상태변경(처방 삭제, 등록) 제어
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChngStatus(pFlag){
-
- switch(pFlag){
- case "prcp1" :
- if(grd_prcplist1.row < 1 ) return;
- var sStatus = grd_prcplist1.valueMatrix(grd_prcplist1.row, grd_prcplist1.colRef("status"));
- var sRow = grd_prcplist1.row;
- if(sStatus == "I"){
- grd_prcplist1.deleteRow(sRow);
- }else if(sStatus == "-"){
- grd_prcplist1.valueMatrix(grd_prcplist1.row, grd_prcplist1.colRef("status")) = "D";
- }else if(sStatus == "D"){
- grd_prcplist1.valueMatrix(grd_prcplist1.row, grd_prcplist1.colRef("status")) = "-";
- }
- break;
- case "prcp2" :
-
- break;
- }
- }
|