123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- /*
-
- SPMNR05000_간호Item 시간변경.xrw(SPMNR05000.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xPrcpInfoPath = "/root/main/prcpinfo";
- var xClsListPath = "/root/main/clsinfo/clslist";
- var xTimeListPath = "/root/main/timeinfo/timelist";
- var xSaveInfoPath = "/root/main/saveinfo";
- var sTimeColor = "#fcd2c1";
- var PageFlag = "";
- var sApntseqno = "";
- var sSelectRow = "";
- var sPrcpdd = "";
- var sPrcpno = "";
- var sPrcpHistNo = "";
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- var sParamMsg = "";
- var sApntTMSpecList=""; // 기준시간setting
- var sRemainder = 0; // 나머지
- var sCareItemCD = "";
- var sFlag = "";
- var iRow = 0;
- var sStatus = "";
- if(checkOpener()){
- submit("TRMNR04901");
- sParamMsg = opener.javascript.getParameter("SPMNR05000_Param");
- model.setValue( xPrcpInfoPath+"/prcpnm", getArrayData(sParamMsg,1,0));
- model.setValue( xPrcpInfoPath+"/prcpcd", getArrayData(sParamMsg,1,1));
- model.setValue( xPrcpInfoPath+"/careitemcd", getArrayData(sParamMsg,1,2));
- model.setValue( xPrcpInfoPath+"/apnttmspec", getArrayData(sParamMsg,1,3));
- model.setValue( xSaveInfoPath+"/apnttmspec", getArrayData(sParamMsg,1,3));
- model.setValue( xPrcpInfoPath+"/supcd", getArrayData(sParamMsg,1,4));
- sApntseqno = getArrayData(sParamMsg,1,6);
- PageFlag = getArrayData(sParamMsg,1,5);
- sStatus = getArrayData(sParamMsg,1,7);
- sSelectRow = getArrayData(sParamMsg,1,8);
- }
- fSearchItem();
-
- if(sStatus == "I"){
- if(PageFlag == "B"){
- ipt_prcpnm.disabled = false;
- }else{
- if(getArrayData(sParamMsg,1,4) != ""){
- cmb_itemcls.disabled = true;
- }
- }
- btn_change.disabled = true;
- }else{
- if(PageFlag == "B"){
- ipt_prcpnm.disabled = false;
- cmb_item.disabled = true;
- cmb_itemcls.disabled = true;
- }else{
- if(getArrayData(sParamMsg,1,4) != ""){
- cmb_itemcls.disabled = true;
- }
- if(getArrayData(sParamMsg,1,2) != "" && getArrayData(sParamMsg,1,2) != getArrayData(sParamMsg,1,4)){
- cmb_item.disabled = true;
- }
- }
- btn_add.disabled = true;
- }
-
- if(PageFlag == "B"){
- caption14.attribute("text") = "지시처방 직접입력";
- }else{
- sPrcpdd = getArrayData(sParamMsg,1,8);
- sPrcpno = getArrayData(sParamMsg,1,9);
- sPrcpHistNo = getArrayData(sParamMsg,1,10);
- }
- // 시간 세팅
- model.removenodeset(xTimeListPath);
- var i = 1;
- for(iRow=1; iRow<=4; iRow++){
- grd_timelist.addRow(false);
- for(var iCol=1; iCol<=6; iCol++){
- if(i == 24){
- i=0;
- }
- model.setValue(xTimeListPath+"["+iRow+"]/time"+iCol,i);
- i++;
- }
- }
- grd_timelist.rebuild();
-
- sApntTMSpecList = model.getValue(xPrcpInfoPath+"/apnttmspec");
- if( sApntTMSpecList != ""){
- var sApntTMSpec = sApntTMSpecList.split(",");
- for(i=0; i<sApntTMSpec.length; i++){
- sRemainder = eval(sApntTMSpec[i]) % 6;
- if(sRemainder == 0) sRemainder += 6;
-
- setCellStyle("grd_timelist","0",sApntTMSpec[i],"time"+sRemainder , "equal");
- }
- }
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 클릭시
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClinckGridRow(){
- var iRow = grd_timelist.row;
- var iCol = grd_timelist.col;
- var sApntTMSpec = "";
- if(grd_timelist.cellStyle("background-color", iRow, iCol) == sTimeColor){
- grd_timelist.cellStyle("background-color", iRow, iCol) = "#ffffff";
- }else{
- grd_timelist.cellStyle("background-color", iRow, iCol) = sTimeColor;
- }
- for(var i = 1; i <= 4; i++){
- for(var j = 0; j < 6; j++){
- if(grd_timelist.cellStyle("background-color", i, j) == sTimeColor){
- if(sApntTMSpec == ""){
- sApntTMSpec = grd_timelist.labelmatrix(i,j);
- }else{
- sApntTMSpec += "," + grd_timelist.labelmatrix(i,j);
- }
- }
- }
- }
- model.setValue( xSaveInfoPath+"/apnttmspec", sApntTMSpec);
- grd_timelist.row = 0;
- grd_timelist.col = -1;
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 간호Item 또는 시간 setting 초기화
- * @param : pFlag ( time : 시간setting, item : 간호 Item)
- * @return :
- * @---------------------------------------------------
- */
-
- function fClearGrid(){
- grd_timelist.allstyle( "all", "background-color" ) = "#FFFFFF";
- model.setValue( xSaveInfoPath+"/apnttmspec", "");
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 간호Item 시간 Setting 전송
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSend(pFlag){
- var sApntTMSpec = model.getValue("/root/main/saveinfo/apnttmspec");
- var sCareItemCd = model.getValue("/root/main/prcpinfo/careitemcd");
- var sSupcd = model.getvalue("/root/main/prcpinfo/supcd");
- var sPrcpnm = model.getvalue("/root/main/prcpinfo/prcpnm");
-
- if(sApntTMSpec == ""){
- messageBox("시간을","C002");
- return;
- }
- if(sSupcd == ""){
- messageBox("간호 Item 분류를","C002");
- return;
- }
-
- var sCareItemNm = model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemnm");
- var sSupcdNm = model.getValue("/root/main/clsinfo/clslist[itemcd='"+sSupcd+"']/itemnm");
-
- if(PageFlag == "P"){
- var sReturnMsg = "flag▦careitemcd▦careitemnm▦apnttmspec▦supcd▦supnm▦apntflag▦prcpnm▦apntseqno▦rownum▦prcpdd▦prcpno▦prcphistno▩"+pFlag+"▦"+sCareItemCd+"▦"+sCareItemNm+"▦"+sApntTMSpec+"▦"+sSupcd+"▦"+sSupcdNm+"▦"+PageFlag+"▦"+"▦"+sApntseqno+"▦"+sSelectRow+"▦"+sPrcpdd+"▦"+sPrcpno+"▦"+sPrcpHistNo+"▩";
- var sReturnMsgItem = "careitemcd▦careitemnm▦supcd▦supnm▦clincobs▦intake▦output▦catheter▦careexec▦clincobsprcpyn▦cathprcpyn▦careexecprcpyn▦mainrecflag▦extyn▦itemorigincd▦instru▦instruprcpyn▦supsetno▩";
- sReturnMsgItem += sCareItemCd+"▦"+sCareItemNm+"▦"+sSupcd+"▦"+sSupcdNm+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobs" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/intake" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/output" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/catheter" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexec" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobsprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/cathprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexecprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/mainrecflag" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/extyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemorigincd" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instru" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instruprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/supsetno" )+"▩";
- opener.javascript.setParameter("SPMNR05000_Return",sReturnMsg);
- opener.javascript.setParameter("SPMNR05000_ReturnItem",sReturnMsgItem);
- window.close();
- }else{
- var sReturnMsg = "flag▦careitemcd▦careitemnm▦apnttmspec▦supcd▦supnm▦apntflag▦prcpnm▦apntseqno▦rownum▦prcpdd▦prcpno▦prcphistno▩"+pFlag+"▦"+sCareItemCd+"▦"+sCareItemNm+"▦"+sApntTMSpec+"▦"+sSupcd+"▦"+sSupcdNm+"▦"+PageFlag+"▦"+sPrcpnm+"▦"+sApntseqno+"▦"+sSelectRow+"▦"+"▦"+"▦"+"▩";
- var sReturnMsgItem = "careitemcd▦careitemnm▦supcd▦supnm▦clincobs▦intake▦output▦catheter▦careexec▦clincobsprcpyn▦cathprcpyn▦careexecprcpyn▦mainrecflag▦extyn▦itemorigincd▦instru▦instruprcpyn▦supsetno▩";
- sReturnMsgItem += sCareItemCd+"▦"+sCareItemNm+"▦"+sSupcd+"▦"+sSupcdNm+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobs" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/intake" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/output" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/catheter" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexec" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobsprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/cathprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexecprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/mainrecflag" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/extyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemorigincd" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instru" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instruprcpyn" )+"▦"
- + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/supsetno" )+"▩";
- opener.javascript.setParameter("SPMNR05000_Return",sReturnMsg);
- opener.javascript.setParameter("SPMNR05000_ReturnItem",sReturnMsgItem);
- window.close();
- }
- }
- /**
- * @group :
- * @ver : 2007.08.08
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Interval지정 시간 계산
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fIntervalCalculate(){
-
- grd_timelist.allstyle( "all", "background-color" ) = "#FFFFFF";
- var time = Number(model.getValue("/root/main/cond/time"));
- var interval = Number(model.getValue("/root/main/cond/interval"));
-
- if(time > 24 || time < 0){
- messageBox("시작시간 설정이 잘 못 되었습니다.", "I");
- model.setFocus("ipt_time");
- return;
- }
- if(interval < 1 || interval > 24){
- messageBox("Interval 설정이 잘 못 되었습니다.", "I");
- model.setFocus("ipt_interval");
- return;
- }
-
- if(time == 24){
- time = 0;
- }
-
- var curtime = time;
- var sApntTMSpecList = "";
- var cnt = 0;
- var sRemainder = "";
-
- while(curtime <= 24){
- if(cnt == 0){
- if(curtime == 24){
- sApntTMSpecList += "0";
- }else{
- sApntTMSpecList += curtime.toString();
- }
- }else{
- if(curtime == 24){
- if(time != 0 ){
- sApntTMSpecList += ",0";
- }
- }else{
- sApntTMSpecList += "," + curtime.toString();
- }
- }
- curtime += interval;
- cnt++;
- }
- if( sApntTMSpecList != ""){
- var sApntTMSpec = sApntTMSpecList.split(",");
- for(i=0; i<sApntTMSpec.length; i++){
- sRemainder = eval(sApntTMSpec[i]) % 6;
- if(sRemainder == 0) sRemainder += 6;
- setCellStyle("grd_timelist","0",sApntTMSpec[i],"time"+sRemainder , "equal");
- }
- }
-
- model.setValue(xSaveInfoPath + "/apnttmspec", sApntTMSpecList);
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2008.06.10
- * @by : 양천덕
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 분류별 Item List 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearchItem(){
- model.makeValue("/root/send/itemcd" , cmb_itemcls.value );
- submit("TRMNR05001");
- }
|