123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- /**
- * @desc : 사용자의 권한을 체크하여 버튼셋팅.
- * btn_r 조회버튼, btn_x 저장 및 수정 버튼, btn_p : 출력버튼
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fchkAuth()
- {
-
- for(var i=0; i<= document.controls.length-1 ; i++){
- if(document.controls.item(i).elementName == "xforms:button"){
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_r_"){
- document.controls.item(i).disabled = !checkAuth("R");
- }
-
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_x_"){
- document.controls.item(i).disabled = !checkAuth("X");
- }
-
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_p_"){
- document.controls.item(i).disabled = !checkAuth("P");
- }
-
- }
- }
- }
- /**
- * @desc : excel 저장 하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fExcel(gridObj, title){
- if (title == null) { title = "" }
- var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != "") {
- gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
- }
- }
- /**
- * @desc : 폼초기화
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fFormInit()
- {
- // 컨트롤 권한 설정
- fchkAuth();
- // 초기화
- model.setValue("/root/condition/wardyn" , "N");
- model.setValue("/root/condition/searchflag" , "1");
- model.setValue("/root/condition/termflag" , "S");
- model.setValue("/root/condition/fromrenddd" , getCurrentDate());
- model.setValue("/root/condition/torenddd" , getCurrentDate());
- model.setValue("/root/condition/sortappdept", "Y");
- model.setValue("/root/condition/appdept" , "ALL");
-
- // tab 선택
- btn_deptlendlist.dispatch("onclick");
-
- // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
- submit("TRMRC00100");
- // 2009.03.06. 진료과/병동 리스트 셋해주기..
- copyNodeset("/root/init/appdept/deptlist", "/root/init/lendmastinfo/lenddeptlist[allwardyn='N']", "after"); // 진료과
- copyNodeset("/root/init/appward/wardlist", "/root/init/lendmastinfo/lenddeptlist[allwardyn='Y']", "after"); // 병동
- // 2009.03.06. 대출용도 셋 조회... (의료정보팀..3230000000)
- // 90000000000000055 예약
- // 90000000000000056 외래당일접수
- // 90000000000000057 병동/응급실
- // 90000000000000058 당일신청서
- // 90000000000000059 연구용
- // 90000000000000060 전체
-
- // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
- mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/hardcd", 5502);
- var deptcd = model.getValue("/root/temp/hardcd/hardcd/hardcd")
-
- //model.makeValue("/root/send/reqdata/deptcd" , "3230000000");
- model.makeValue("/root/send/reqdata/deptcd" , deptcd);
- // KNUH_20101207_박성호_end
-
- submit("TRMRC01312");
- // 2009.03.06. 선택된 대출용도 코드 리스트 스트링 만들기..
- // 초기화 선택 셋코드.. 외래당일접수..90000000000000056
- fGetChkRendCdList("90000000000000060");
- }
- /**
- * @desc : 내원구분 외래로 진료과/병동 셋해주기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fSetAppDeptList()
- {
- var wardyn = model.getValue("/root/condition/wardyn");
- if (wardyn == "N") {
- cbo_appdept.choices.itemset.attribute("nodeset") = "/root/init/appdept/deptlist";
- } else {
- cbo_appdept.choices.itemset.attribute("nodeset") = "/root/init/appward/wardlist";
- }
- model.setValue("/root/condition/appdept" , "ALL");
- cbo_appdept.refresh();
- }
- /**
- * @desc : 선택된 대출용도 코드 리스트 스트링 만들기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fGetChkRendCdList(setcd)
- {
- model.setValue("/root/condition/setcd" , setcd);
- submit("TRMRC01313");
- var ref = "/root/init/lendsetitem/setitemlist";
- var cnt = getNodesetCnt(model, ref);
- var chkrendcdlist = "";
- for ( var i = 1; i <= cnt; i++)
- {
- var rendcd = model.getValue(ref + "[" + i + "]/rendcd");
- var srchuseyn = model.getValue(ref + "[" + i + "]/srchuseyn");
- if (srchuseyn == "Y") {
- chkrendcdlist = chkrendcdlist + rendcd + "|";
- }
- }
- var rendcdlist = chkrendcdlist.split("|");
- if (rendcdlist.length > 0) {
- chkrendcdlist = chkrendcdlist.substring(0, chkrendcdlist.length -1);
- }
- model.setValue("/root/condition/chkrendcdlist", chkrendcdlist);
- chk_rendcd.refresh();
- }
- /**
- * @desc : 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.03.06.
- * @---------------------------------------------------
- */
- function fSearch()
- {
- // 2007.12.26. 대출용도 멀티로 조회하기.. ^^
- var rendcd = model.getValue("/root/condition/chkrendcdlist");
- var rendcdlist = "N";
- // 2009.01.12. 대출용도 선택항목이 전체인지 구분하기 위해서..
- var ref = "/root/init/lendsetitem/setitemlist";
- var cnt = getNodesetCnt(model, ref);
- var rendcdlist = rendcd.split("|");
- if (rendcdlist.length == 1) {
- rendcd = rendcd;
- } else if (rendcdlist.length == cnt) {
- rendcd = "ALL";
- } else {
- for (var i = 0 ; i < rendcdlist.length ; i++) {
- rendcd = rendcd.replace("|","','");
- }
- rendcdlist = "Y";
- rendcd = "'" + rendcd + "'";
- }
- model.setValue("/root/condition/rendcdlist", rendcdlist);
- model.setValue("/root/condition/rendcd", rendcd);
- model.refresh();
- // searchflag
- // 1. 외래현황
- // 2. 병동현황
- // 3. 부서별통계
- // 4. 용도별통계
- // 5. 대출자별통계
- var searchflag = model.getValue("/root/condition/searchflag");
- if (searchflag == "1") {
- btn_deptlendlist.dispatch("onclick");
- submit("TRMRC03601");
- } else if (searchflag == "2") {
- btn_wardlendlist.dispatch("onclick");
- submit("TRMRC03602");
- } else if (searchflag == "3") {
- btn_stslenddept.dispatch("onclick");
- submit("TRMRC03603");
- } else if (searchflag == "4") {
- btn_stsrendcd.dispatch("onclick");
- submit("TRMRC03604");
- } else if (searchflag == "5") {
- btn_stslendman.dispatch("onclick");
- submit("TRMRC03605");
- }
- }
- /**
- * @desc : 하드코드 조회
- * @
- * @param : ref - reference path
- * rsltref - result reference path
- * hardcd - 하드코드
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function mmbfGetHardCodeInfo(ref, rsltref, hardcd){
- var mmb_rsltref = "/root/hidden/mmb/hardcd";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
- model.removeNode(ref);
- model.makeValue(ref + "/hardcd", hardcd);
- if(submit("TRMMB04103", "false", ref, mmb_rsltref)==true){
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
- }
- model.refresh();
- }
|