123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 환자요약 ( MMR04800_환자요약.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var isUpdated = false;
- var instance = document.models(0).instances(0);
- var uInfo = getUserInfos();
- uInfo = uInfo.split("|");
- var pid = "";
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fInitalize()
- {
- fClose();
- model.removeNodeset("/root/temp/attach");
- window.modelesstopmost = true;
- model.makeValue("/root/init/uid", uInfo[0]);
- model.makeValue("/root/init/udeptcd", uInfo[8]);
-
- model.setValue("/root/init/reqmedireclist/diffdt", 12); //검색 디폴트 12개월
- fAddDateReq("today");
-
- fGetUserEnvOcsOrdAnsw("/root/send/reqdata", "/root/envinit/srchcond", "011");
- fGetUserEnvOcsOrdAnsw("/root/send/reqdata", "/root/envinit/srchday", "012");
-
- var srchcond = model.getValue("/root/envinit/srchcond/answcnt");
- var srchday = model.getValue("/root/envinit/srchday/answcnt");
-
- switch(srchcond)
- {
- case "001" :
- model.setValue("/root/init/schkind", "2");
- break;
- case "002" :
- model.setValue("/root/init/schkind", "3");
- break;
- case "003" :
- model.setValue("/root/init/schkind", "1");
- break;
- case "" :
- model.setValue("/root/init/schkind", "2");
- break;
- }
- radio1.refresh();
-
- switch(srchday)
- {
- case "001" :
- model.setValue("/root/init/reqmedireclist/diffdt", "1");
- break;
- case "002" :
- model.setValue("/root/init/reqmedireclist/diffdt", "3");
- break;
- case "003" :
- model.setValue("/root/init/reqmedireclist/diffdt", "6");
- break;
- case "004" :
- model.setValue("/root/init/reqmedireclist/diffdt", "12");
- break;
- case "005" :
- model.setValue("/root/init/reqmedireclist/diffdt", "-");
- break;
- }
- combo4.refresh();
- combo4.dispatch("xforms-value-changed");
-
- if (model.getValue("/root/send/pid") != opener.model.getValue("/root/main/paminfo/pid"))
- {
- pid = opener.window.javascript.getParameter("SSMMP04800_pid"); //부모창으로부터 환자등록번호를 파라미터로 받는다.
- if (pid == "")
- {
- pid = opener.model.getValue("/root/main/paminfo/pid");
- }
- if ( !isNull ( pid ) )
- {
- ipt_pid.value = pid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- model.setValue("/root/main/patinfo/patinfolist/pid", pid);
- fSelect_sub();
- }
- if (isPopup())
- {
- btn_detl.attribute("visibility") = "hidden";
- btn_close.attribute("visibility") = "visiblle";
- var list = getGlobalVariable("emr_gsv_cmmsrckcond");
- if(list != "" && list != null){
- model.removeNodeset("/root/send");
- setCSVToNode("/root",list,"send");
- }
- }
- grd_smmlist.autoresize = true;
- model.refresh();
- }
- }
- /**
- * @desc : 조회버튼 클릭
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSrchClick()
- {
- if (isPopup()) {
- fSelect_Pop();
- } else {
- fSelect_sub();
- }
- }
- function fAddrow_old(val, val2)
- {
- var nodelistSmm = instance.selectNodes("/root/main/smmlist");
- var nodelength = nodelistSmm.length;
- var smmcnts = model.getValue("/root/main/smmlist[1]/smmcnts");
-
- if (val == "true"){ //첨부파일인 경우
- if( val2 != "" ){//수정
- var fileupdata = messageBox(name + " 파일 수정을" , "S001");
- if(fileupdata == '6'){
- var maxsize = upload1.attribute("filesize");
- var files = window.fileDialog("open","|","false");
- var filelist = files.split("|");
- var filename = files.lastIndexOf("\\");
-
- for(var i = 0 ; i < filelist.length ; i++ ) {
- grd_smmlist.addRow();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
- grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
-
- if (!checkFileSize(upload1)){
- grd_attach.removeItem();
- messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
- }else{
- isUpdated = true;
- }
- }
- }
- }else{//신규
- var maxsize = upload1.attribute("filesize");
- var files = window.fileDialog("open","|","false");
- var filelist = files.split("|");
- var filename = files.lastIndexOf("\\");
-
- for(var i = 0 ; i < filelist.length ; i++ ) {
- grd_smmlist.addRow();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmcnts")) = files.substring(filename + 1);
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
- grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
-
- if (!checkFileSize(upload1)){
- grd_attach.removeItem();
- messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
- }else{
- isUpdated = true;
- }
- }
- }
- }else { //첨부파일이 아닌경우
- if(smmcnts != "" || nodelength == 0) { //첫줄에 추가셀 생성
- if (nodelength == 0) {
- grd_smmlist.addrow();
- } else {
- grd_smmlist.insertRow(1);
- }
- model.setValue("/root/main/smmlist[1]/smmdd", getCurrentDate());
- model.setValue("/root/main/smmlist[1]/delyn", 'N');
- }
- }
- grd_smmlist.row = 1;
- grd_smmlist.col = 4;
- }
- /**
- * @desc : 줄추가
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fAddrow(val)
- {
- var nodelistSmm = instance.selectNodes("/root/main/smmlist");
- var nodelength = nodelistSmm.length;
- var smmcnts = model.getValue("/root/main/smmlist[1]/smmcnts");
-
- if (val == "true"){ //첨부파일인 경우
- var maxsize = upload1.attribute("filesize");
-
- var files = window.fileDialog("open","|","false");
- var filelist = files.split("|");
- var filename = files.lastIndexOf("\\");
-
- if( files != ""){
- for(var i = 0 ; i < filelist.length ; i++ ) {
- grd_smmlist.addRow();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmcnts")) = files.substring(filename + 1);
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
- grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
- grd_attach.addRow();
- grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
- // grd_smmlist.isReadOnly(grd_smmlist.rows - 1 ,grd_smmlist.colRef("smmcnts")) = true;
- if (!checkFileSize(upload1)){
- grd_attach.removeItem();
- messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
- }else{
- isUpdated = true;
- }
- }
- }
- }else { //첨부파일이 아닌경우
- if(smmcnts != "" || nodelength == 0) { //첫줄에 추가셀 생성
- if (nodelength == 0) {
- grd_smmlist.addrow();
- } else {
- grd_smmlist.insertRow(1);
- }
- model.setValue("/root/main/smmlist[1]/smmdd", getCurrentDate());
- model.setValue("/root/main/smmlist[1]/delyn", 'N');
- }
- }
- grd_smmlist.row = 1;
- grd_smmlist.col = 4;
- }
- /**
- * @desc : 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSelect_sub()
- {
- var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
- if (srchpid != "")
- {
- model.removeNodeset("/root/main/smmlist");
- model.removeNodeset("/root/send");
-
- model.makeValue("/root/send/pid", srchpid);
- model.makeValue("/root/send/validyn", "Y");
- model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind"));
- model.makeValue("/root/send/getyn", "Y");
- model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
- model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
- model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn"));
-
- submit("TRMMR04800");
- grd_smmlist.resizeCells();
- model.refresh();
- fAddrow();
- }
- else
- {
- messageBox("환자번호가 ", "I004");
- return;
- }
- }
- /**
- * @desc : 팝업시 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSelect_Pop()
- {
- var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
- var gridnode = grd_smmlist.attribute("nodeset");
- if (srchpid != "")
- {
- model.removeNodeset("/root/main/smmlist");
- model.makeValue("/root/send/pid", srchpid);
- model.makeValue("/root/send/getyn", "Y");
- model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind"));
- model.makeValue("/root/send/validyn", model.getValue("/root/init/validyn"));
- model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
- model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
- model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn"));
- grd_smmlist.rebuildStyle();
- if (submit("TRMMR04800")) {
- /*
- var iCnt = getNodesetCount(gridnode);
- for (var i = 1; i <= iCnt; i++) {
- if (model.getValue(gridnode+"["+ i +"]/delyn") == "Y") {
- grd_smmlist.cellStyle("background-color", i, 0, i, grd_smmlist.cols-1) = "#808080";
- }
- }
- */
- }
- var reqnodeList = instance1.selectNodes("/root/send");
- if (reqnodeList.length > 0)
- {
- var csv = getNodeListCSV(reqnodeList);
- setGlobalVariable("emr_gsv_cmmsrckcond",csv);
- }
- grd_smmlist.resizeCells();
-
- if (model.getValue("/root/init/validyn") != 'D') { //삭제상태가 아닌 경우만
- fAddrow();
- }
- model.refresh();
- }
- else
- {
- messageBox("환자번호가 ", "I004");
- return;
- }
- }
- /**
- * @desc : 화면 컨트롤 설정
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fResizeGrup(flag, heig, wid)
- {
- body.attribute("height") = heig;
- body.attribute("width") = wid;
- var titHeight = parseInt(grup_title.attribute("height"));
- var tTop = parseInt(grup_top.attribute("top"));
- var tHeight = parseInt(grup_top.attribute("height"));
- var bTop = parseInt(grup_body.attribute("top"));
- var bHeight = parseInt(grup_body.attribute("height"));
- var mTop = parseInt(grup_bottom.attribute("top"));
- var mHeight = parseInt(grup_bottom.attribute("height"));
- if(flag == "1")
- {
- btn_excel.attribute("left") = wid - 4 - 56 + "px";
- grup_title.attribute("width") = wid - 2;
- grup_top.attribute("top") = 0;
- grup_top.attribute("height") = 0;
- grup_top.attribute("width") = 0;
- grup_top.attribute("visibility") = "hidden";
- grup_body.attribute("left") = 0;
- grup_body.attribute("top") = tTop;
- grup_body.attribute("height") = (heig - (tHeight + mHeight) + 1);
- grup_body.attribute("width") = wid - 2;
- grd_smmlist.attribute("left") = 0;
- grd_smmlist.attribute("border-style") = "none";
- grd_smmlist.attribute("height") = (heig - (tHeight + mHeight) + 1);
- grd_smmlist.attribute("width") = wid - 2;
- grup_bottom.attribute("left") = 0;
- grup_bottom.attribute("top") = (heig - mHeight - 2);
- grup_bottom.attribute("width") = wid - 2;
- line12.attribute("x1") = "1px";
- line12.attribute("x2") = wid - 2 + "px";
- line12.attribute("y1") = "24px";
- line12.attribute("y2") = "24px";
- line1.attribute("x1") = "1px";
- line1.attribute("x2") = wid - 2 + "px";
- line1.attribute("y1") = "0px";
- line1.attribute("y2") = "0px";
- line2.attribute("x1") = "1px";
- line2.attribute("x2") = wid - 2 + "px";
- line2.attribute("y1") = "0px";
- line2.attribute("y2") = "0px";
- btn_save.attribute("left") = wid - 4 - 56 + "px";
- btn_del.attribute("left") = wid - 6 - 112 + "px";
- btn_end.attribute("left") = wid - 8 - 168 + "px";
- btn_close.attribute("left") = wid - 10 - 224 + "px";
- }
- model.refresh();
- }
- /**
- * @desc : 저장
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- var g_changeYn = "N";
- function fSave()
- {
- var updateData = grd_smmlist.getUpdateData();
- var updateData = updateData.split("▩");
- var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
-
- if (srchpid != "")
- {
- if (updateData.length <= 3) {
- messageBox("저장할 내용이", "I004");
- return;
- }
-
- model.makeValue("/root/temp/pid", srchpid);
- model.makeValue("/root/temp/reqsmm", grd_smmlist.getUpdateData());
- model.makeValue("/root/temp/schkind", model.getValue("/root/init/schkind"));
- model.makeValue("/root/temp/getyn", "N");
- model.makeValue("/root/temp/validyn", model.getValue("/root/init/validyn"));
- model.makeValue("/root/temp/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
- model.makeValue("/root/temp/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
-
- if ( submit("TXMMR04801") )
- {
- grd_smmlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
- model.resetInstanceNode("/root/temp");
- if (isPopup()) {
- if (model.getValue("/root/main/patinfo/patinfolist/pid") == opener.model.getValue("/root/main/paminfo/pid"))
- {
- opener.window.javascript.setParameter("SSMMP04800_rtn", "Y");
- }
- }
- model.refresh();
- }
- }
- else
- {
- messageBox("환자번호가 ", "I004");
- return;
- }
- fAddrow();
- }
- /**
- * @desc : 삭제
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fDelRow()
- {
- for(var i = 1; i < grd_smmlist.Rows; i++)
- {
- if(grd_smmlist.isselected(i))
- {
- if((model.getValue("/root/main/smmlist["+i+"]/patsmmseq") == "") && (i != (grd_smmlist.Rows - 1)))
- {
- grd_smmlist.deleteRow(i);
- }
- else if(fChkAuth(i))
- {
- grd_smmlist.addStatus(i, "delete");
- }
- }
- }
-
- var rtn = messageBox("삭제", "S001");
-
- if (rtn == 6)
- {
- fSave();
- }
- else
- {
- grd_smmlist.clearStatus();
- }
- }
- /**
- * @desc : 기록종료
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fEndRec()
- {
- var j = 0;
- var uptArr = new Array();
- for(var i = 1; i < grd_smmlist.Rows; i++)
- {
- if(grd_smmlist.isselected(i) && fChkAuth(i) && model.getValue("/root/main/smmlist[" + i + "]/smmtodd") == "")
- {
- model.setValue("/root/main/smmlist[" + i + "]/smmtodd", getCurrentDate());
- grd_smmlist.addStatus(i, "update");
-
- uptArr[j] = i;
- j++;
- }
- }
-
- var rtn = messageBox("종료", "S001");//하시려면 예(Yes) 아니면 아니오(No)
-
- if (rtn == 6)
- {
- fSave();
- }
- else
- {
- for(var k = 0; k < uptArr.length; k++)
- {
- model.setValue("/root/main/smmlist[" + uptArr[k] + "]/smmtodd", "");
- }
- grd_smmlist.refresh();
- grd_smmlist.clearStatus();
- }
- }
- /**
- * @desc : 상세조회 클릭
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fClickPop()
- {
- modal("../../../emr/medirecweb/xrw/SSMMR04800_진료요약기록.xrw", 1, 0, 0, "", "", "");
- if(opener.window.javascript.getParameter("SSMMP04800_rtn") == "Y")
- fSelect_sub();
- g_changeYn = "N";
- }
- /**
- * @desc : 작성자와 사용자의 일치여부
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fChkAuth(selrow)
- {
- var recudpcd = model.getValue("/root/main/smmlist[" + selrow + "]/recdeptcd");
- var rtn = true;
- if(recudpcd != uInfo[8])
- {
- rtn = false;
- }
- return rtn;
- }
- /**
- * @desc : 창닫기전 변경된 내용 저장여부 확인
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fClose()
- {
- var updateData = grd_smmlist.getUpdateData();
- var updateData = updateData.split("▩");
- if (updateData.length > 3 && (isPopup()))
- {
- var rtn = messageBox("환자요약에 변경된 정보가 있습니다 ", "Q002");
- if (rtn == 6)
- fSave();
- }
- }
- /**
- * @desc : 환자번호 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈
- */
- function fPidKeyPress()
- {
- model.makeValue("/root/send/srchcond", "1");
- model.makeValue("/root/send/pid", ipt_pid.currentText);
- //inputEnterKey("btn_search", "DOMActivate");
- //환자등록번호 체크
- if(ipt_pid.currentText.length >= 1 )
- {
- if(submit("TRPMC02500"))
- {
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/main/patinfo/patinfolist") < 0 ) {
- model.resetInstanceNode("/root/main/patinfo/patinfolist");
- messageBox("없는 환자 번호 입니다.", "E999", "");
- model.refresh();
- }
- }
- }
- else
- {
- messageBox("환자등록번호를 정확히", "C001");
- }
- }
- /**
- * @desc : 환자이름 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈
- */
- function fPnmKeyPress()
- {
- model.makeValue("/root/send/srchcond", "2");
- model.makeValue("/root/send/hngnm", ipt_hngnm.currentText);
- inputEnterKey("btn_pinfosearch", "DOMActivate");
- }
- /**
- * @desc : 환자정보조회 팝업
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fPopPtinfo()
- {
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/send", "/root/send");
- model.resetInstanceNode("/root/send");
- fSelect_Pop();
- }
- /**
- * @desc : 상용구 팝업
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fPopCommUse()
- {
- setParameter("comn_chosflag", "C") // C : 상용구
- setParameter("comn_formprogflag", "A") // A: Summary, B : 주호소
- setParameter("openmode", "select");
- modal("SPMRF04900");
-
- var rtn = getParameter("comncnts"); //내용
- setParameter("comncnts", "");
-
- var re = /▦/i;
- var re1 = /▩/i;
-
- rtn = rtn.replace(re, "");
- rtn = rtn.replace(re1, "");
-
- var reccnts = model.getValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts");
- if (rtn == ""){
- return;
- }
- if (reccnts == ""){ // 요약내용이 없을경우
- model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", rtn);
- fAddrow();
- }else{
- model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", reccnts + " " + rtn);
- grd_smmlist.addStatus(grd_smmlist.row, "update");
- }
- model.refresh();
- grd_smmlist.resizeCells();
- }
- /**
- * @desc : 진료기록 리스트 조회조건 시작일, 종료일 셋팅
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fAddDateReq(diffFlag)
- {
- var frdd = model.getValue("/root/init/reqmedireclist/recfromdt");
- var todd = model.getValue("/root/init/reqmedireclist/rectodt");
- var srcdd = new Date();
- var destdd = new Date();
- var diffdt;
- if (diffFlag == "next")
- {
- srcdd = todd.toDate();
- srcdd = srcdd.getAddDate(1, "D");
- frdd = srcdd.getDateFormat();
-
- diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * 1;
- destdd = srcdd.getAddDate(diffdt, "M");
- todd = destdd.getDateFormat();
- model.makeValue("/root/init/allyn", "N");
- }
- else if (diffFlag == "back")
- {
- srcdd = frdd.toDate();
- srcdd = srcdd.getAddDate(-1, "D");
- todd = srcdd.getDateFormat();
-
- diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- destdd = srcdd.getAddDate(diffdt, "M");
- frdd = destdd.getDateFormat();
- model.makeValue("/root/init/allyn", "N");
- }
- else if (diffFlag == "today")
- {
- todd = getCurrentDate();
- var today = new Date();
- var frday = new Date();
- var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- frday = today.getAddDate(diffdt , "M");
- frdd = frday.getDateFormat();
- model.makeValue("/root/init/allyn", "N");
- }
- else
- {
- if (model.getValue("/root/init/reqmedireclist/diffdt") != "-")
- {
- var today = todd.toDate();
- var frday = new Date();
- var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- frday = today.getAddDate(diffdt , "M");
- frdd = frday.getDateFormat();
-
- button2.disabled = false;
- ipt_formrecdtfr.disabled = false;
- ipt_formrecdtto.disabled = false;
- button6.disabled = false;
- button3.disabled = false;
-
- model.makeValue("/root/init/allyn", "N");
- }
- else
- {
- button2.disabled = true;
- ipt_formrecdtfr.disabled = true;
- ipt_formrecdtto.disabled = true;
- button6.disabled = true;
- button3.disabled = true;
-
- model.makeValue("/root/init/allyn", "Y");
- }
- }
- model.setValue("/root/init/reqmedireclist/recfromdt", frdd);
- model.setValue("/root/init/reqmedireclist/rectodt", todd);
- ipt_formrecdtfr.refresh();
- ipt_formrecdtto.refresh();
- }
- function fDownLoad(){
- var i = grd_smmlist.row;
-
- if(model.getValue("/root/main/smmlist[" + i + "]/filexistyn") == "Y" ){
- var attfilepath = model.getValue("/root/main/smmlist["+i+"]/attfilepath");
- var filenm = model.getValue("/root/main/smmlist["+i+"]/attfilenm");
- var realfile = getActionURL("TRMMR04801") + "&attfilepath=" + attfilepath;
- var localfile = window.fileDialog("save", "|", false, filenm, "", "All Files(*.*)|*.*");
-
- if (localfile != "") {
- model.download(realfile, localfile);
- window.exec(localfile);
- }
- }else{
- messageBox("선택한 기록에 첨부파일이 존재하지 않습니다.","E");
- }
- }
|