123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- /*
-
- 간호Item 시간Setting 관리(SMMNR04700.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xCondPath = "/root/main/cond";
- var xPrcpInfoPath = "/root/temp/prcpinfo";
- var xComPrcpListPath = "/root/main/comprcpinfo/comprcplist";
- var xDeptPrcpListPath = "/root/main/deptprcpinfo/deptprcplist";
- /**
- * @group :
- * @ver : 2007.08.06
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"),"orduseyn","W","/root/init/deptlist");// 병동정보
- model.setValue(xCondPath+"/deptcd", getUserInfo("posdeptcd"));
- model.makeValue("/root/send/deptcd", model.getValue(xCondPath+"/deptcd"));
- if(submit("TRMNR04701")){
- copyNodeset(xComPrcpListPath,xPrcpInfoPath+"/comprcplist");
- copyNodeset(xDeptPrcpListPath,xPrcpInfoPath+"/deptprcplist");
- grd_comprcplist.rebuild();
- grd_deptprcplist.rebuild();
- grd_comprcplist.resizeCells();
- grd_deptprcplist.resizeCells();
- for(iRow =grd_comprcplist.fixedrows; iRow <= grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_comprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_comprcplist.isReadOnly(iRow,1) = false;
- }
- }
-
- for(iRow =grd_deptprcplist.fixedrows; iRow <= grd_deptprcplist.rows-grd_deptprcplist.fixedrows; iRow++){
- if(model.getValue(xDeptPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_deptprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_deptprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_comprcplist,9,2,false);
- setTree(grd_deptprcplist,9,2,false);
- }
- }
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 지시처방 불러오기
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCallDirecPrcpInfo(){
- setParameter("SMMNR04800_SaveFlag","N");
- modal("SPMNR04800");
- if(getParameter("SMMNR04800_SaveFlag") == "Y"){
- fSearchItemSetting("com");
- }
-
- }
- /**
- * @group :
- * @ver : 2007.08.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 클릭시
- * @param : pFlag ( com : 공통Setting, dept : 부서Setting)
- * @return :
- * @---------------------------------------------------
- */
- function fClickedGridRow(pFlag){
- var iRow = 0;
- var iCol = 0;
- var sDepth = "";
- switch(pFlag){
- case "com" :
- iRow = grd_comprcplist.row;
- iCol = grd_comprcplist.col;
-
- if(iRow < 1 || iCol == 4) return;
- if(iCol == 1){
- grd_comprcplist.rowStatus(iRow) = 0;
- return;
- }
-
- sDepth = eval(model.getValue(xComPrcpListPath+"["+iRow+"]/depth"));
- if(sDepth == 1) return;
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/check") == "true"){
- model.setValue(xComPrcpListPath+"["+iRow+"]/check","false");
- }else{
- model.setValue(xComPrcpListPath+"["+iRow+"]/check","true");
- }
-
- break;
- case "dept":
- iRow = grd_deptprcplist.row;
- iCol = grd_deptprcplist.col;
- if(iCol == 1 || iCol == 4) return;
- if(iRow < 1) return;
- sDepth = eval(model.getValue(xDeptPrcpListPath+"["+iRow+"]/depth"));
- if(sDepth == 1) return;
-
- if(model.getValue(xDeptPrcpListPath+"["+iRow+"]/check") == "true"){
- model.setValue(xDeptPrcpListPath+"["+iRow+"]/check","false");
- grd_deptprcplist.rowStatus(iRow) = 0;
- }else{
- model.setValue(xDeptPrcpListPath+"["+iRow+"]/check","true");
- grd_deptprcplist.rowStatus(iRow) = 4;
- }
-
- break;
- }
- }
- /**
- * @group :
- * @ver : 2007.08.10
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 변경
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChangedGridRow(){
- var iRow = grd_deptprcplist.row;
- if(model.getValue(xDeptPrcpListPath+"["+iRow+"]/check") == "true"){
- grd_deptprcplist.rowStatus(iRow) = 4;
- }else{
- grd_deptprcplist.rowStatus(iRow) = 0;
- }
- }
- /**
- * @group :
- * @ver : 2007.08.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 더블 클릭시(시간Setting 화면 호출)
- * @param : pFlag ( com : 공통Setting, dept : 부서Setting)
- * @return :
- * @---------------------------------------------------
- */
- function fDblClickGridRow(pFlag){
- var iCol = 0;
- var iRow = 0;
- var sParamMsg = "";
- var sReturnMsg = "";
- var sPrcpCD = "";
- var sDepth = 0;
- var sStatus = 0;
- switch(pFlag){
- case "com" :
- iCol = grd_comprcplist.col;
- iRow = grd_comprcplist.row;
- sDepth = eval(model.getValue(xComPrcpListPath+"["+iRow+"]/depth"));
- if(sDepth == 1) return;
- if(iCol == 4){
- sPrcpCD = model.getValue(xComPrcpListPath+"["+iRow+"]/prcpcd");
- sParamMsg = "prcpnm▦prcpcd▦careitemnm▦careitemcd▦apnttmspec▦flag▩";
- sParamMsg += model.getValue(xComPrcpListPath+"["+iRow+"]/prcpnm") + "▦"
- + sPrcpCD + "▦"
- + model.getValue(xComPrcpListPath+"["+iRow+"]/careitemnm") + "▦"
- + model.getValue(xComPrcpListPath+"["+iRow+"]/careitemcd") + "▦"
- + model.getValue(xComPrcpListPath+"["+iRow+"]/apnttmspec") + "▦all▩";
- setParameter("SPMNR04900_Param",sParamMsg);
- setParameter("SPMNR04900_Return","");
- modal("SPMNR04900");
- sReturnMsg = getParameter("SPMNR04900_Return");
- if(sReturnMsg != ""){
- model.setValue(xComPrcpListPath+"["+iRow+"]/careitemnm",getArrayData(sReturnMsg,1,0));
- model.setValue(xComPrcpListPath+"["+iRow+"]/careitemcd",getArrayData(sReturnMsg,1,1));
- model.setValue(xComPrcpListPath+"["+iRow+"]/apnttmspec",getArrayData(sReturnMsg,1,2));
- model.setValue(xPrcpInfoPath+"/comprcplist[prcpcd ='"+sPrcpCD+"']/check", model.getValue(xComPrcpListPath+"["+iRow+"]/check"));
- if(instance1.selectSingleNode(xPrcpInfoPath+"/comprcplist[prcpcd ='"+sPrcpCD+"']").xml != instance1.selectSingleNode(xComPrcpListPath+"["+iRow+"]").xml){
- grd_comprcplist.rowStatus(iRow) = 2;
- model.setValue(xComPrcpListPath+"["+iRow+"]/check","false");
- }else{
- grd_comprcplist.rowStatus(iRow) = 0;
- }
- }
- }
- break;
- case "dept" :
- iCol = grd_deptprcplist.col;
- iRow = grd_deptprcplist.row;
- if(iRow < 1) return;
-
- sDepth = eval(model.getValue(xDeptPrcpListPath+"["+iRow+"]/depth"));
- if(sDepth == 1) return;
- if(iCol == 4){
- sStatus = grd_deptprcplist.rowStatus(iRow);
- sPrcpCD = model.getValue(xDeptPrcpListPath+"["+iRow+"]/prcpcd");
- sParamMsg = "prcpnm▦prcpcd▦careitemnm▦careitemcd▦apnttmspec▩";
- sParamMsg += model.getValue(xDeptPrcpListPath+"["+iRow+"]/prcpnm") + "▦"
- + sPrcpCD + "▦"
- + model.getValue(xDeptPrcpListPath+"["+iRow+"]/careitemnm") + "▦"
- + model.getValue(xDeptPrcpListPath+"["+iRow+"]/careitemcd") + "▦"
- + model.getValue(xDeptPrcpListPath+"["+iRow+"]/apnttmspec") + "▦dept▩";
- setParameter("SPMNR04900_Param",sParamMsg);
- setParameter("SPMNR04900_Return","");
- modal("SPMNR04900");
- sReturnMsg = getParameter("SPMNR04900_Return");
- if(sReturnMsg != ""){
- model.setValue(xDeptPrcpListPath+"["+iRow+"]/apnttmspec",getArrayData(sReturnMsg,1,2));
- if(sStatus == 1 || sStatus == 3) return;
-
- model.setValue(xPrcpInfoPath+"/deptprcplist[prcpcd ='"+sPrcpCD+"']/check", model.getValue(xDeptPrcpListPath+"["+iRow+"]/check"));
- if(instance1.selectSingleNode(xPrcpInfoPath+"/deptprcplist[prcpcd ='"+sPrcpCD+"']").xml != instance1.selectSingleNode(xDeptPrcpListPath+"["+iRow+"]").xml){
- grd_deptprcplist.rowStatus(iRow) = 2;
- model.setValue(xDeptPrcpListPath+"["+iRow+"]/check","false");
- }else{
- grd_deptprcplist.rowStatus(iRow) = 0;
- }
- }
- }
- break;
- }
- }
- /**
- * @group :
- * @ver : 2007.08.09
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 저장
- * @param : pFlag ( com : 공통Setting, dept : 부서Setting)
- * @return :
- * @---------------------------------------------------
- */
- function fSaveItem(pFlag){
- model.removenode("/root/send");
- switch(pFlag){
- case "com" :
- model.makeValue("/root/send/prcplist", grd_comprcplist.getUpdateData());
- model.makeValue("/root/send/deptcd","all");
- if(submit("TXMNR04701")){
- copyNodeset(xPrcpInfoPath+"/comprcplist",xComPrcpListPath,"replace");
- grd_comprcplist.rebuild();
- for(iRow =grd_comprcplist.fixedrows; iRow <= grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_comprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_comprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_comprcplist,9,2,false);
- }
- break;
- case "dept":
- model.makeValue("/root/send/prcplist", grd_deptprcplist.getUpdateData());
- model.makeValue("/root/send/deptcd",model.getValue("/root/main/cond/deptcd"));
- if(submit("TXMNR04702")){
- copyNodeset(xPrcpInfoPath+"/deptprcplist",xDeptPrcpListPath,"replace");
- grd_deptprcplist.rebuild();
- for(iRow =grd_deptprcplist.fixedrows; iRow <= grd_deptprcplist.rows-grd_deptprcplist.fixedrows; iRow++){
- if(model.getValue(xDeptPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_deptprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_deptprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_deptprcplist,9,2,false);
- }
- break;
- }
- }
- /**
- * @group :
- * @ver : 2007.08.10
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 선택이동
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSendItem(){
- var sDeptCD = model.getValue("/root/main/cond/deptcd");
- var iDeptPrcpRow=0;
- var sCareItemCD = "";
- var sPrcpCD = "";
- var iRow = 0;
- if(sDeptCD == ""){
- messageBox("부서를 먼저","C002");
- return;
- }
- for(iRow=grd_comprcplist.fixedrows; iRow<=(grd_comprcplist.rows-grd_comprcplist.fixedrows); iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/check") == "true"){
- if(grd_comprcplist.rowStatus(iRow) != 0){
- window.alert("공통 Setting에 저장하지 않은 데이터가 있습니다.","정보",64);
- return;
- }
- sCareItemCD = model.getValue(xComPrcpListPath+"["+iRow+"]/careitemcd");
- if(sCareItemCD == ""){
- messageBox("간호 Item은","I003");
- return;
- }
- }
- }
-
- for(var iRow=grd_comprcplist.fixedrows; iRow<=grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/check") == "true"){
- sPrcpCD = model.getValue(xComPrcpListPath+"["+iRow+"]/prcpcd");
- model.setValue(xComPrcpListPath+"["+iRow+"]/check","false");
- if(model.getValue(xDeptPrcpListPath+"[prcpcd='"+sPrcpCD+"']/prcpcd") != "") continue;
- grd_deptprcplist.addRow(false);
- iDeptPrcpRow = grd_deptprcplist.rows - grd_deptprcplist.fixedrows;
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/deptcd",sDeptCD);
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/prcpnm",model.getValue(xComPrcpListPath+"["+iRow+"]/prcpnm"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/careitemnm",model.getValue(xComPrcpListPath+"["+iRow+"]/careitemnm"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/apnttmspec",model.getValue(xComPrcpListPath+"["+iRow+"]/apnttmspec"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/careitemcd",model.getValue(xComPrcpListPath+"["+iRow+"]/careitemcd"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/prcpcd",model.getValue(xComPrcpListPath+"["+iRow+"]/prcpcd"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/instcd",model.getValue(xComPrcpListPath+"["+iRow+"]/instcd"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/depth",model.getValue(xComPrcpListPath+"["+iRow+"]/depth"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/prcpclscd1",model.getValue(xComPrcpListPath+"["+iRow+"]/prcpclscd1"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/prcpclscd2",model.getValue(xComPrcpListPath+"["+iRow+"]/prcpclscd2"));
- model.setValue(xDeptPrcpListPath+"["+iDeptPrcpRow+"]/prcpclscd3",model.getValue(xComPrcpListPath+"["+iRow+"]/prcpclscd3"));
-
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.08.10
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 Setting 리스트 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearchItemSetting(pFlag){
- model.removenode("/root/send");
- switch(pFlag){
- case "com" :
- model.makeValue("/root/send/deptcd","all");
- if(submit("TRMNR04704")){
- copyNodeset(xPrcpInfoPath+"/comprcplist",xComPrcpListPath,"replace");
- grd_comprcplist.rebuild();
- for(iRow =grd_comprcplist.fixedrows; iRow <= grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_comprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_comprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_comprcplist,9,2,false);
- }
- break;
- case "dept":
- model.makeValue("/root/send/deptcd",model.getValue("/root/main/cond/deptcd"));
- if(submit("TRMNR04703")){
- copyNodeset(xPrcpInfoPath+"/deptprcplist",xDeptPrcpListPath,"replace");
- grd_deptprcplist.rebuild();
- for(iRow =grd_deptprcplist.fixedrows; iRow <= grd_deptprcplist.rows-grd_deptprcplist.fixedrows; iRow++){
- if(model.getValue(xDeptPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_deptprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_deptprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_deptprcplist,9,2,false);
- }
- break;
- }
- }
- /**
- * @group :
- * @ver : 2007.08.10
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 삭제
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDeleteItem(pFlag){
- switch(pFlag){
- case "com" :
- for(iRow =grd_comprcplist.fixedrows; iRow <= grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/check") == 'true'){
- grd_comprcplist.rowStatus(iRow) = 4;
- }
- }
- model.makeValue("/root/send/prcplist", grd_comprcplist.getUpdateData());
- model.makeValue("/root/send/deptcd","all");
- if(submit("TXMNR04701")){
- copyNodeset(xPrcpInfoPath+"/comprcplist",xComPrcpListPath,"replace");
- grd_comprcplist.rebuild();
- for(iRow =grd_comprcplist.fixedrows; iRow <= grd_comprcplist.rows-grd_comprcplist.fixedrows; iRow++){
- if(model.getValue(xComPrcpListPath+"["+iRow+"]/depth") == "1"){
- grd_comprcplist.isReadOnly(iRow,1) = true;
- }else{
- grd_comprcplist.isReadOnly(iRow,1) = false;
- }
- }
- setTree(grd_comprcplist,9,2,false);
- }
- break;
- }
- }
|