123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- /**
- * @desc : 메인화면 로딩
- * @id :
- * @event : onclick
- * @return : void
- * @authur : 박종훈
- */
- function fReadyForm()
- {
- fReadyFormInitData();
- model.setValue("/root/init/reqmedireclist/diffdt", 12); //검색 디폴트 12개월
-
- fAddDateReq("today");
-
- var defltdeptcd = getUserInfo("dutplcecd");
-
- var defltdeptnm = model.getValue("/root/init/deptlist/dept[deptcd'" + defltdeptcd + "']/deptnm");
-
- if (defltdeptcd == "2280000000" || defltdeptnm == "")
- {
- defltdeptcd = "ALL";
- }
- model.setValue("/root/init/dept", defltdeptcd);
- model.refresh();
-
- ivw_reccnts.window.javascript.fInitPage(parseInt(ivw_reccnts.attribute("width")) , parseInt(ivw_reccnts.attribute("height")));
- ivw_reccnts1.window.javascript.fInitPage(parseInt(ivw_reccnts1.attribute("width")), parseInt(ivw_reccnts1.attribute("height")));
-
- var ctrl = document.controls("ipt_pid");
- if (ctrl != null)
- {
- model.setFocus(ctrl.attribute("id"));
- ctrl.dispatch("onkeyup");
- }
-
- //파라이터 처리(등록번호, 기록순번)
- var parampid = opener.window.javascript.getParameter("SPMMR07000_param_pid");
- var paramformrecseq = opener.window.javascript.getParameter("SPMMR07000_param_formrecseq");
- var srcformcd = opener.window.javascript.getParameter("SPMMR07000_param_srcformcd");
- var lastyn = opener.window.javascript.getParameter("SPMMR07000_param_lastyn");
-
- model.setValue("/root/init/reqmedireclist/srcformcd",srcformcd);
- model.setValue("/root/init/reqmedireclist/lastyn",lastyn);
-
- if(paramformrecseq != "")
- {
- ivw_reccnts.window.javascript.fClear();
- ivw_reccnts1.window.javascript.fClear();
- model.removeNodeset("/root/send/reqmedireclist");
- model.makeValue("/root/send/reqmedireclist/pid", "");
- model.makeValue("/root/send/reqmedireclist/formrecseq", paramformrecseq);
- model.makeValue("/root/send/reqmedireclist/formnm", "-");
-
-
- if (submit("TRMMR07001"))
- {
- var cnt = getNodesetCnt(model, "/root/main/mainlist/medireclist");
-
- if (cnt > 0)
- {
- model.setValue("/root/init/dept", "ALL");
- var sPid = model.getValue("/root/main/mainlist/medireclist/pid");
- ipt_pid.value = sPid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- }
- }
-
- }
- else if (parampid != "")
- {
- ipt_pid.value = parampid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- fRefMediRecList();
- }
- else
- {
- var pamInfoCvs = getGlobalVariable("paminfo"); //상단정보가 있을 경우는 검색
- if(pamInfoCvs != null && pamInfoCvs != "")
- { //cvs가 null이 아닌 경우에만 처리함.
- model.removeNodeSet ("/root/main/result/paminfo/list");
- setCSVToNode ("/root/main/result/paminfo", pamInfoCvs);
- var pid = model.getValue ("/root/main/result/paminfo/list/pid");
-
- ipt_pid.value = pid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- fRefMediRecList();
- }
- }
- }
- /**
- * @desc : 기록 목록 조회
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fRefMediRecList()
- {
- if (model.getValue("/root/main/patinfo/patinfolist/pid") == "")
- {
- messageBox("환자정보가 존재하지 않아 진행 ", "E001");
- return;
- }
-
- ivw_reccnts.window.javascript.fClear();
- ivw_reccnts1.window.javascript.fClear();
- model.removeNodeset("/root/main/mainlist/medireclist");
- model.removeNodeset("/root/main/histlist/rechistlist");
-
- model.removeNodeset("/root/send/reqmedireclist");
- model.makeValue("/root/send/reqmedireclist/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
- model.makeValue("/root/send/reqmedireclist/recfromdt", model.getValue("/root/init/reqmedireclist/recfromdt"));
- model.makeValue("/root/send/reqmedireclist/rectodt", model.getValue("/root/init/reqmedireclist/rectodt"));
- model.makeValue("/root/send/reqmedireclist/formrecdeptcd", model.getValue("/root/init/dept"));
- model.makeValue("/root/send/reqmedireclist/formrecseq", "0");
- model.makeValue("/root/send/reqmedireclist/srcformcd", model.getValue("/root/init/reqmedireclist/srcformcd"));
-
-
- var formnm = model.getValue("/root/init/formnm");
- if (formnm == "")
- {
- formnm = "-";
- }
- model.makeValue("/root/send/reqmedireclist/formnm", formnm);
- submit("TRMMR07001");
-
- var srcformcd = model.getValue("/root/init/reqmedireclist/srcformcd");
-
- if ( srcformcd != null )
- {
- fGetRecHist(grd_medireclist.valueMatrix(1, grd_medireclist.colref("formrecseq")));
- fGetRecCntsHist(grd_rechist.valueMatrix(1, grd_rechist.colref("rechistseq")), grd_rechist.valueMatrix(1, grd_rechist.colref("rowcolor")));
- }
-
- cnt = 0;
- var cnt = getNodesetCnt(model, "/root/main/mainlist/visitdept");
- if (cnt > 0)
- {
- var orddd = model.getValue("/root/send/reqmedireclist/orddd");
- var cretno = model.getValue("/root/send/reqmedireclist/cretno");
- var cnt2 = getNodesetCnt(model, "/root/main/mainlist/medireclist");
-
- if (cnt2 == 0)
- {
- for (var i = 1; i <= cnt; i++)
- {
- model.makeValue("/root/main/mainlist/medireclist["+i+"]/formrecdeptcd", model.getValue("/root/main/mainlist/visitdept["+i+"]/orddeptcd"));
- model.makeValue("/root/main/mainlist/medireclist["+i+"]/formrecdeptnm", model.getValue("/root/main/mainlist/visitdept["+i+"]/orddeptnm"));
-
- model.makeValue("/root/main/mainlist/medireclist["+i+"]/formnminfo", "호출과 미작성");
- model.makeValue("/root/main/mainlist/medireclist["+i+"]/orddd", orddd);
- model.makeValue("/root/main/mainlist/medireclist["+i+"]/cretno", cretno);
- }
- }
- else
- {
- var cond = "/root/main/mainlist/medireclist[orddd='#orddd#' and cretno='#cretno#' and formrecdeptcd='#deptcd#']";
- cond = cond.replace("#orddd#", orddd);
- cond = cond.replace("#cretno#", cretno);
-
- var stmt;
-
- for (var i = 1; i <= cnt; i++)
- {
- stmt = cond.replace("#deptcd#", model.getValue("/root/main/mainlist/visitdept["+i+"]/orddeptcd"));
-
- nodelist = instance1.selectNodes(stmt);
- cnt2 = getNodesetCnt(model, stmt);
-
- if (cnt2 == 0)
- {
- grd_medireclist.insertRow(1, "above");
-
- model.setValue("/root/main/mainlist/medireclist[1]/formrecdeptcd", model.getValue("/root/main/mainlist/visitdept["+i+"]/orddeptcd"));
- model.setValue("/root/main/mainlist/medireclist[1]/formrecdeptnm", model.getValue("/root/main/mainlist/visitdept["+i+"]/orddeptnm"));
-
- model.setValue("/root/main/mainlist/medireclist[1]/formnminfo", "호출과 미작성");
- model.setValue("/root/main/mainlist/medireclist[1]/orddd", orddd);
- model.setValue("/root/main/mainlist/medireclist[1]/cretno", cretno);
-
- }
- }
- }
-
- model.refresh();
- for (var i = 1; i <= grd_medireclist.rows; i++)
- {
- if (grd_medireclist.valueMatrix(i, grd_medireclist.colref("orddd")) == orddd &&
- grd_medireclist.valueMatrix(i, grd_medireclist.colref("cretno")) == cretno)
- grd_medireclist.rowStyle(i, "data", "color") = "blue";
- }
- }
- if (grd_medireclist.rows > 1)
- {
- grd_medireclist.row = 1;
- }
- }
- /**
- * @desc : 기록 이력 조회
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fGetRecHist(formrecseq)
- {
- ivw_reccnts.window.javascript.fClear();
- ivw_reccnts1.window.javascript.fClear();
- model.removeNodeset("/root/send/reqrechistlist");
- model.makeValue("/root/send/reqrechistlist/formrecseq", formrecseq);
- model.makeValue("/root/send/reqrechistlist/lastyn", model.getValue("/root/init/reqmedireclist/lastyn"));
-
-
- if(submit("TRMMR07002"))
- {
- // var rowcolor = "";
- // for (var i = 1; i <= grd_rechist.rows; i++)
- // {
- // rowcolor = grd_rechist.valueMatrix(i, grd_rechist.colref("rowcolor"));
- // grd_rechist.rowstyle(i, "data", "background-color") = "#" + rowcolor;
- // }
- }
- }
- /**
- * @desc : 기록 목록 내용 조회
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fGetRecCntsHist(rechistseq, rowcolor)
- {
- ivw_reccnts.window.javascript.fClear();
- ivw_reccnts.window.javascript.fRefRecViewByHistSeq(rechistseq);
-
- // if (rowcolor == "ccffff")
- // {
- // ivw_reccnts.window.javascript.fClear();
- // ivw_reccnts.window.javascript.fRefRecViewByHistSeq(rechistseq);
- // }
- // else
- // {
- // ivw_reccnts1.window.javascript.fClear();
- // ivw_reccnts1.window.javascript.fRefRecViewByHistSeq(rechistseq);
- // }
- }
- /**
- * @group :
- * @ver : 2009.03.25
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 마우스 오른쪽 버튼 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fMouseRight()
- {
- if(grd_rechist.isCell(event.target) && (grd_rechist.mouserow >= grd_rechist.fixedrows))
- {
- var loginuserid = getUserId();
-
- if (loginuserid == "97055522" || loginuserid == "99031128")
- {
- setPopupMenu("grd_rechist", false, "/root/init/cnstreqmsrght/mouserght", "label", "func");
- }
- }
- }
- /**
- * @desc : 진료기록 리스트 조회조건의 진료과 조회 및 서식즐겨찾기 조회
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fReadyFormInitData()
- {
- mmbfGetDeptCodeComboList("/root/send/reqdeptlist", "/root/init/deptlist", "A");
- model.setValue("/root/init/deptlist/dept[1]/deptcd", "ALL");
- model.setValue("/root/init/deptlist/dept[1]/depthngnm", "전체");
- }
- /**
- * @group :
- * @ver : 2009.03.25
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 마우스 오른쪽 버튼 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetReplaceImg()
- {
- var rechistseq = grd_rechist.valueMatrix(grd_rechist.row, grd_rechist.colref("rechistseq"));
-
- model.removeNodeset("/root/send/imgreplace");
- model.makeValue("/root/send/imgreplace/rechistseq", rechistseq);
-
- if (submit("TXMMR07001"))
- {
- var cnt = model.getValue("/root/main/replacecnt/cnfmcnt/updtdd");
- cnt = parseInt(cnt);
-
- if (cnt > 0)
- {
- messageBox("수정", "I001");
- }
- }
-
- }
- /**
- * @desc : 환자이름 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈
- */
- function fPnmKeyPress()
- {
- model.setValue("/root/source/srchcond", "2");
- model.setValue("/root/source/hngnm", ipt_hngnm.currentText);
- inputEnterKey("btn_search", "DOMActivate");
- }
- /**
- * @desc : 환자정보조회 팝업
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fPopPtinfo()
- {
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/source", "/root/send");
- model.resetInstanceNode("/root/source");
- }
- /**
- * @desc : 환자번호 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈(튜닝)
- */
- function fPidKeyPress()
- {
- model.setValue("/root/source/srchcond", "1");
- model.setValue("/root/source/pid", ipt_pid.currentText);
- //inputEnterKey("btn_search", "DOMActivate");
- //환자등록번호 체크
- if(ipt_pid.currentText.length >= 1 )
- {
- model.resetInstanceNode("/root/main/result/patinfo");
- model.makeNode("/root/main/result/patinfo");
- if(submit("TRPMC02500"))
- {
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 ){
- model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
- model.makeValue("/root/main/patinfo/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
- model.setValue("/root/main/popupendflag", "ok");
- model.refresh();
-
- oprnerId = opener.window.javascript.getScreenID();
- if(oprnerId == "SPMRC03200")
- {
- var keyparam = model.getValue("/root/main/patinfo/patinfolist/pid") + "▦" + model.getValue("/root/main/patinfo/patinfolist/hngnm") + "▦" + model.getValue("/root/main/patinfo/patinfolist/sex") + "▦" + model.getValue("/root/main/patinfo/patinfolist/age") + "▩";
- opener.window.javascript.fEnterPatinfo(keyparam);
- }
- }
- else
- {
- model.resetInstanceNode("/root/main/patinfo/patinfolist");
- messageBox("없는 등록번호 입니다.", "E999", "");
- }
- }
- }
- else
- {
- messageBox("등록번호를 정확히", "C001");
- }
- }
- /**
- * @desc : 미리보기 조회
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fShowMediRecCnt(formrecseq)
- {
- if (model.getValue("/root/main/paminfo/pid") == "")
- {
- return;
- }
- var cond = new COMN_CONT_RECCNTS();
- var instance = document.models(0).instances(0);
- var nodeReclist = instance.selectNodes("/root/main/mainlist/medireclist");
- var nodeReclistlength = nodeReclist.length;
-
- cond.pid = model.getValue("/root/main/paminfo/pid");
- cond.formrecdeptcd = model.getValue("/root/send/reqmedireclist/formrecdeptcd");
- cond.chosflag = model.getValue("/root/send/reqmedireclist/chosflag");
- cond.reclistlength = nodeReclistlength;
- if (formrecseq == "")
- {
- cond.recfromdt = model.getValue("/root/init/reqmedireclist/recfromdt");
- cond.rectodt = model.getValue("/root/init/reqmedireclist/rectodt");
- }
- else
- {
- cond.recfromdt = "";
- cond.rectodt = "";
- }
- cond.formrecseq = formrecseq;
- ivw_reccnts.window.javascript.fRefMediRecCnts(cond);
- swt_left.selectedIndex = 1;
- button15.selected = true;
- }
- /**
- * @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();
- }
- 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();
- }
- 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();
- }
- else
- {
- 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();
- }
- model.setValue("/root/init/reqmedireclist/recfromdt", frdd);
- model.setValue("/root/init/reqmedireclist/rectodt", todd);
- ipt_formrecdtfr.refresh();
- ipt_formrecdtto.refresh();
- }
- function fGetUserComnFormCd(srcformcd)
- {
- selnode = instance1.selectSingleNode("/root/main/tmpformlist/endformlist[srcformcd='"+srcformcd+"' and formuseflag='D' and formdeptcd='"+ getUserInfo("dutplcecd") +"']/formcd");
- if (selnode.text == "")
- {
- selnode = instance1.selectSingleNode("/root/main/tmpformlist/endformlist[srcformcd='"+srcformcd+"' and formuseflag='C']/formcd");
- }
- return selnode.text;
- }
|