1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525 |
- var allchkflag = "N";
- /**
- * @desc : 사용자의 권한을 체크하여 버튼셋팅.
- * btn_r 조회버튼, btn_x 저장 및 수정 버튼, btn_p : 출력버튼
- * @
- * @param :
- * @return :
- * @authur : 김선태 2007. 5. 8
- * @---------------------------------------------------
- */
- 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 : 폼초기화
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fFormInit()
- {
- // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
- mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/hardcd", 5501);
- // KNUH_20101207_박성호_end
-
- model.removeNodeset("/root/main/appchrt/appchrtlist");
- model.removeNodeset("/root/main/appchrt/chrtlist");
- model.removeNodeset("/root/main/appchrt/emrlist");
- model.removeNodeset("/root/main/appchrtlist");
- //버튼 권한 설정
- fchkAuth();
- //* 마스터 정보 가져오기..
- //공통코드 가져오기...
- //M0392:챠트미대출사유코드
- zbcfGetCodeList(new Array("M0392"), new Array("/root/init/M0392"));
- // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
- model.makeValue("/root/send/reqdata/ioflag" , "O");
- model.makeValue("/root/send/reqdata/useyn" , "Y");
- model.makeValue("/root/send/reqdata/allwardyn", "N");
- submit("TRMRC00100");
- //*/
- // 2009.01.12. 대출용도 셋 조회하기.. 사용자 직종코드 구하기..
- // 의사 : 03, 04, 05, 06
- // 간호사 : 11
- // 연구원, 연구직 : 0750, 0751 => 의사
- // 조교 : 0410 => 기타
- var jobkindcd = getUserInfo("jobkindcd");
- var dutplcecd = getUserInfo("dutplcecd");
- // 2009.02.13. 로그인 사용자의 원과를 셋하는 것으로 수정함... (보험팀 - 2개 unit 으로 구분됨 (4070300000,4070703000)) => 일단보류
- // getUserInfo(Key) => "userid|usernm|posinstcd|posinstnm|posdeptcd|posdeptnm|dutplceinstcd|dutplceinstnm|dutplcecd|dutplcenm|jobkindcd|jobkindnm|jobposcd|jobposnm|jobrespcd|jobrespnm|prfshipflagcd|prfshipflagnm|licnsno|specordyn|deptabbr|orddeptflag|wardflag|systemcd|systemnm|systeminstcd|systeminstnm|logindt|kmiip|kmiport|usergrp|ipaddr|dutinstcd|dutinstnm|dutunitcd|dutunitnm|mpphonno|orginstcd|orginstnm|orgdeptcd|orgdeptnm|userkindcd|ordsupdeptcd";
- // var dutplcecd = getUserInfo("posdeptcd");
- model.makeValue("/root/send/reqdata/drflag" , "");
- model.makeValue("/root/send/reqdata/nursflag", "");
- model.makeValue("/root/send/reqdata/deptcd" , "");
- if (jobkindcd == "0410" ) {
- model.makeValue("/root/send/reqdata/deptcd" , dutplcecd);
- } else if (jobkindcd == "0750" || jobkindcd == "0750" ) {
- model.makeValue("/root/send/reqdata/drflag" , "Y");
- } else if (jobkindcd.substring(0,2) == "03" || jobkindcd.substring(0,2) == "04" ||
- jobkindcd.substring(0,2) == "05" || jobkindcd.substring(0,2) == "06" ) {
- model.makeValue("/root/send/reqdata/drflag" , "Y");
- } else if (jobkindcd.substring(0,2) == "11") {
- model.makeValue("/root/send/reqdata/nursflag", "Y");
- } else {
- model.makeValue("/root/send/reqdata/deptcd" , dutplcecd);
- }
- submit("TRMRC01312");
- var cnt = getNodesetCnt(model, "/root/init/lendset/lendsetlist");
- if (cnt == 1) {
- var setcd = model.getValue("/root/init/lendset/lendsetlist[1]/setcd");
- model.makeValue("/root/send/reqdata/setcd" , setcd);
- } else {
- // 기타 셋코드 : 90000000000000101
- model.makeValue("/root/send/reqdata/setcd" , "90000000000000101");
- }
- // 2009.01.12. 대출용도 셋 아이템 조회하기..
- // 2009.02.02. 보험팀인데 직종구분 [ 1140 : 간호직 ]
- // 2009.02.13. 보험팀 - 2개 unit 으로 구분됨 (4070300000,4070703000)
- if (dutplcecd == "4070300000" || dutplcecd == "4070703000") {
- // 보험팀 (4070300000) 전체 셋코드 : 90000000000000053
- model.makeValue("/root/send/reqdata/setcd" , "90000000000000053");
- }
- if (dutplcecd == "4040800000") {
- // 원무팀 (4040800000) 전체 셋코드 : 90000000000000054
- model.makeValue("/root/send/reqdata/setcd" , "90000000000000054");
- }
-
- // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
- //if (dutplcecd == "3230000000") {
- if(model.getValue("/root/temp/hardcd/hardcd[hardcd='" + dutplcecd + "']/hardcd") != "")
- {
- // KNUH_20101207_박성호_end
- // 의료정보 (3230000000) 전체 셋코드 : 90000000000000060
- model.makeValue("/root/send/reqdata/setcd" , "90000000000000060");
- }
- model.makeValue("/root/send/reqdata/useyn" , "Y");
- submit("TRMRC01313");
- model.setValue("/root/condition/rendschedd" , getCurrentDate());
- model.setValue("/root/condition/rtnschedd" , getCurrentDate());
- model.setValue("/root/condition/ioflag" , "O");
- // 2009.02.13. 보험팀 - 2개 unit 으로 구분됨 (4070300000,4070703000)
- /*
- if (dutplcecd == "4070703000"){
- dutplcecd = "4070300000";
- }
- */
- // 응급의학과 (2280000000)인 경우.. 응급실진료참고 (006)
- // 응급의료센터 (2280200000)인 경우.. 응급실진료참고 (006)
- var rendcd = model.getValue("/root/init/lendsetitem/setitemlist[lenduseyn='Y']/rendcd");
- if (dutplcecd == "2280200000"){
- dutplcecd = "2280000000";
- }
- if (dutplcecd == "2280000000" || dutplcecd == "2280200000"){
- rendcd = "006";
- }
- model.setValue("/root/condition/rendcd" , rendcd);
- var deptcd = model.getValue("/root/init/lendmastinfo/lenddeptlist[lenddeptcd='"+ dutplcecd +"']/lenddeptcd");
- model.setValue("/root/condition/appdeptcd" , deptcd);
- // 2009.03.18. 대출과가 센터인 경우 진료과 조회하기...
- cmb_appdeptcd.dispatch("xforms-value-changed");
- if (deptcd != ""){
- var userid = model.getValue("/root/init/userlist/userlist/usercombo[userid='"+ getUserId() +"']/userid");
- model.setValue("/root/condition/lendmanid" , userid);
- model.setValue("/root/condition/lendman" , userid);
- }
- // 응급의료센터 (2280200000)인 경우.. 대출자 : 구 응급의학과
- /* 2009.01.14. 대출자 셋해주는 의미가 없어짐.. 구 응급의학과는 과거 부서코드이므로..
- if (dutplcecd == "2280200000"){
- model.setValue("/root/condition/lendmanid" , "12400000");
- model.setValue("/root/condition/lendman" , "12400000");
- }
- */
- model.setValue("/root/condition/appmanid" , getUserId());
- model.setValue("/root/condition/appman" , getUserName());
- model.setValue("/root/condition/pid" , getPatientId());
- // 신청내역 초기값
- model.setValue("/root/condition/applist/apprendcd" , rendcd);
- model.setValue("/root/condition/applist/appdeptcd" , deptcd);
- model.setValue("/root/condition/applist/lendmanid" , "");
- model.setValue("/root/condition/applist/appmanid" , getUserId());
- model.setValue("/root/condition/applist/appman" , getUserName());
- model.setValue("/root/condition/applist/appfromdd" , getCurrentDate());
- model.setValue("/root/condition/applist/apptodd" , getCurrentDate());
- // 대출내역 초기값
- model.setValue("/root/condition/lendlist/appdeptcd" , deptcd);
- model.setValue("/root/condition/lendlist/rendfromdd" , getCurrentDate());
- model.setValue("/root/condition/lendlist/rendtodd" , getCurrentDate());
- model.setValue("/root/condition/lendlist/lendmanid" , "");
- model.setValue("/root/condition/lendlist/appmanid" , getUserId());
- model.setValue("/root/condition/lendlist/appman" , getUserName());
- model.setValue("/root/condition/lendlist/apprendcd" , "ALL");
- model.setValue("/root/condition/lendlist/appfromdd" , "19000101");
- model.setValue("/root/condition/lendlist/apptodd" , getCurrentDate());
- model.setValue("/root/condition/lendlist/termdisabled" , "");
- model.refresh();
- var pid;
- if (isPopup() == true) {
- // param 환자정보
- pid = opener.javascript.getParameter("pid");
- }
- if ( pid == null || pid == "" ) {
- // 상단 환자정보
- var node = getGlobalVariable("paminfo");
- model.removeNodeset("/root/main/result/paminfo/list");
- setCSVToNode("/root/main/result/paminfo", node);
- pid = model.getValue("/root/main/result/paminfo/list/pid");
-
- // 상단 환자정보가 있는 경우 대출자는 상단의 의사아이디로 셋함.
- if ( pid == null ) { pid == ""; }
- if ( pid != "" ) {
- var orddrid = model.getValue("/root/main/result/paminfo/list/orddrid");
- model.setValue("/root/condition/lendmanid", orddrid);
- }
- }
- if ( pid == null ) { pid == ""; }
- if ( pid != "" ) {
- model.setValue("/root/condition/pid", pid);
- fGetChrtList();
- }
- // 차트 대출 신청 텝 선택..
- btn_rendlsit.dispatch("onclick");
- if (deptcd == ""){
- window.alert("대출과를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cmb_orddept");
- }
- }
- /**
- * @desc : 차트 대출 신청 후 신청 내역 텝으로 이동하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function faddchrt()
- {
- btn_addlist.dispatch("onclick");
- }
- /**
- * @desc : 환자의 차트 리스트 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fGetChrtList()
- {
- // 2008.10.23. 환자번호 조회해서 환자명 가져오기..
- fCheckPid(ipt_pid,"/root/condition/patnm");
- model.copyNode("/root/send/reqdata", "/root/condition");
- model.makeValue("/root/send/reqdata/applist/flag" , 'P');
-
- submit("TRMRC00144");
- // 2008.10.29. EMR 기록 조회
- submit("TRMRC00145");
- allchkflag = "N";
- // 2009.06.02. 의정부인 경우.. 응급실, 건진센터 구영상 조회하기..
- var instcd = getUserInfo("dutplceinstcd");
- if (instcd == "013") {
- submit("TRMRC00147");
- var msgER = "";
- var msgAH = "";
- var dataCnt = getNodesetCnt(model, "/root/main/appchrt/oldimglist");
- for (var i = 1 ; i <= dataCnt ; i++)
- {
- var cls = model.getValue("/root/main/appchrt/oldimglist["+ i +"]/cls");
- var cnt = model.getValue("/root/main/appchrt/oldimglist["+ i +"]/cnt");
- // 구영상 응급의학과
- if (cls == "E") {
- msgER = "▣ 구영상 응급의학과 (" + cnt + "건)";
- }
- // 구영상 건진
- if (cls == "S") {
- msgAH = "▣ 구영상 건진 (" + cnt + "건)";
- }
- }
- model.setValue("/root/hidden/cap_oldimgER", msgER);
- cap_oldimgER.refresh();
- model.setValue("/root/hidden/cap_oldimgAH", msgAH);
- cap_oldimgAH.refresh();
- }
- }
- /**
- * @desc : 환자의 차트 리스트 대출 신청 리스트 등록
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fAddChrtList()
- {
- var appdeptcd = model.getValue("/root/condition/appdeptcd");
- if (appdeptcd == ""){
- window.alert("대출과를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cmb_appdeptcd");
- return;
- }
-
- var lendmanid = model.getValue("/root/condition/lendmanid");
- if (lendmanid == ""){
- window.alert("대출자를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cmb_orddrid");
- return;
- }
-
- var rendcd = model.getValue("/root/condition/rendcd");
- if (rendcd == "-"){
- window.alert("대출용도을 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cbo_renduse");
- return;
- }
- // 2009.03.18. 대출과가 센터인 경우 진료과 선택 체킹하기...
- var orddeptkind = model.getValue("/root/condition/orddeptkind");
- var orddeptcd = model.getValue("/root/condition/orddeptcd");
- if (orddeptkind == "C" && orddeptcd == "-"){
- window.alert("대출과가 센터인 경우 진료과를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cmb_orddeptcd");
- return;
- }
- // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
- // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
- if (rendcd == "021" || rendcd == "022"){
- var msgcnts = model.getValue("/root/condition/msgcnts");
- msgcnts = msgcnts.getTrimLeft();
- msgcnts = msgcnts.getTrimRight();
- if (msgcnts.length == ""){
- window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("ipt_msgcnts");
- return;
- }
- // 팝업메세지 : 신청일 포함 3일후 대출 가능합니다..
- // window.alert("신청일 포함 3일후 대출 가능합니다..", "차트대출신청", 0 | 64);
- // 2009.02.17. 팝업메세지 수정 : 신청일로부터 3일 이후에 대출 가능합니다..
- window.alert("신청일로부터 3일 이후에 대출 가능합니다..", "차트대출신청", 0 | 64);
- }
- if (grd_chrtlist.rows < 1){
- window.alert("환자의 차트정보가 없습니다..", "차트대출신청", 0 | 64);
- return;
- }
- // 2009.02.05. 의사 아이디로 차트신청시 전달메세지, 연락처 항목을 필수 입력항목으로 체킹한다.
- // 의사 : 03, 04, 05, 06
- // 간호사 : 11
- // 연구원, 연구직 : 0750, 0751 => 의사
- // 조교 : 0410 => 기타
- var jobkindcd = getUserInfo("jobkindcd");
- var drflag = "N";
- var nursflag = "N";
- if (jobkindcd == "0410") {
- drflag = "N";
- } else if (jobkindcd == "0750" || jobkindcd == "0750" ) {
- drflag = "Y";
- } else if (jobkindcd.substring(0,2) == "03" || jobkindcd.substring(0,2) == "04" ||
- jobkindcd.substring(0,2) == "05" || jobkindcd.substring(0,2) == "06" ) {
- drflag = "Y";
- } else if (jobkindcd.substring(0,2) == "11") {
- nursflag = "Y";
- }
- if (drflag == "Y" || nursflag == "Y") {
- // 2009.03.02. 차트신청시 [ 003:접수외대출, 021:연구용, 022:임상연구용, 099:기타대출 ]
- // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
- if (rendcd == "003" || rendcd == "022" || rendcd == "021" || rendcd == "099"){
- var msgcnts = model.getValue("/root/condition/msgcnts");
- msgcnts = msgcnts.getTrimLeft();
- msgcnts = msgcnts.getTrimRight();
- if (msgcnts.length == ""){
- window.alert("반드시 전달메세지 (연구 제목 및 신청사유) 을 입력해 주십시오.." + jobkindcd, "차트대출신청", 0 | 64);
- model.setFocus("ipt_msgcnts");
- return;
- }
- }
- var appmantelno = model.getValue("/root/condition/appmantelno");
- appmantelno = appmantelno.getTrimLeft();
- appmantelno = appmantelno.getTrimRight();
- if (appmantelno.length == ""){
- window.alert("반드시 연락처를 입력해 주십시오.." + jobkindcd, "차트대출신청", 0 | 64);
- model.setFocus("ipt_apptelno");
- return;
- }
- }
- for( var i = 1 ; i < grd_chrtlist.rows ; i++){
- var chk = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/chkflag");
- if (chk == "Y"){
-
- var pid = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/pid");
- var pnm = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/pnm");
- var ioflag = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/ioflag");
- var medirecno = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/medirecno");
- var orddeptcd = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/orddeptcd");
- var depthngnm = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/depthngnm");
- var deptengabbr = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/deptengabbr");
- var lendyn = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/lendyn");
- var lenddept = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/lenddept");
- var tmpmedino = "";
-
- var ref = "/root/main/appchrt/appchrtlist";
- var cnt = getNodesetCnt(model, ref);
- for(var j = 1 ; j <= cnt ; j++){
- var tmp = model.getValue(ref + "[" + j + "]/medirecno");
- if(tmp == medirecno){
- tmpmedino = tmp;
- break;
- }
- }
- if(eval(tmpmedino) != eval(medirecno)){
- // 차트가 이미 대출인가??
- var lendyn = model.getValue("/root/main/appchrt/chrtlist["+ i +"]/lendyn");
- if (lendyn == "Y")
- {
- var msgRtn = messageBox("대출중입니다. 차트대출 신청", "S001");
- // return : yes=6, no=7, cancel=2
- if (msgRtn == "7") {
- continue;
- } else if (msgRtn == "2") {
- break;
- }
- }
- var addrow = cnt + 1;
- model.makeValue(ref + "[" + addrow + "]/pid" , pid);
- model.makeValue(ref + "[" + addrow + "]/pnm" , pnm);
- model.makeValue(ref + "[" + addrow + "]/ioflag" , ioflag);
- model.makeValue(ref + "[" + addrow + "]/medirecno" , medirecno);
- model.makeValue(ref + "[" + addrow + "]/orddeptcd" , orddeptcd);
- model.makeValue(ref + "[" + addrow + "]/depthngnm" , depthngnm);
- model.makeValue(ref + "[" + addrow + "]/deptengabbr", deptengabbr);
-
- var rendcd = model.getValue("/root/condition/rendcd");
- var rendschedd = model.getValue("/root/condition/rendschedd");
- var rtnschedd = model.getValue("/root/condition/rtnschedd");
- var appdeptcd = model.getValue("/root/condition/appdeptcd");
- // 2009.03.18. 진료과 , 센터 저장하기..
- var orddeptkind = model.getValue("/root/condition/orddeptkind");
- var centcd = "-";
- if (orddeptkind == "C") {
- centcd = model.getValue("/root/condition/appdeptcd");
- }
- var orddeptcd = model.getValue("/root/condition/orddeptcd");
- var lendmanid = model.getValue("/root/condition/lendmanid");
- var appmanid = model.getValue("/root/condition/appmanid");
- var appman = model.getValue("/root/condition/appman");
- var appmantelno = model.getValue("/root/condition/appmantelno");
- var msgcnts = model.getValue("/root/condition/msgcnts");
- var appdeptnm = model.getValue("/root/init/lendmastinfo/lenddeptlist[lenddeptcd='"+ appdeptcd +"']/lenddeptnm");
- var orddeptnm = model.getValue("/root/init/cntrsuborddeptlist/dept[deptcd='"+ orddeptcd +"']/depthngnm");
- var lendman = model.getValue("/root/init/userlist/userlist/usercombo[userid='"+ lendmanid +"']/usernm");
-
- model.makeValue(ref + "[" + addrow + "]/rendcd" , rendcd);
- model.makeValue(ref + "[" + addrow + "]/rendschedd" , rendschedd);
- model.makeValue(ref + "[" + addrow + "]/rtnschedd" , rtnschedd);
- model.makeValue(ref + "[" + addrow + "]/appdeptcd" , appdeptcd);
- model.makeValue(ref + "[" + addrow + "]/appdeptnm" , appdeptnm);
- model.makeValue(ref + "[" + addrow + "]/orddeptkind", orddeptkind);
- model.makeValue(ref + "[" + addrow + "]/centcd" , centcd);
- model.makeValue(ref + "[" + addrow + "]/orddeptcd" , orddeptcd);
- model.makeValue(ref + "[" + addrow + "]/orddeptnm" , orddeptnm);
- model.makeValue(ref + "[" + addrow + "]/lendmanid" , lendmanid);
- model.makeValue(ref + "[" + addrow + "]/lendman" , lendman);
- model.makeValue(ref + "[" + addrow + "]/appmanid" , appmanid);
- model.makeValue(ref + "[" + addrow + "]/appman" , appman);
- model.makeValue(ref + "[" + addrow + "]/appmantelno", appmantelno);
- model.makeValue(ref + "[" + addrow + "]/msgcnts" , msgcnts);
- }
- }
- }
- model.refresh();
- }
- /**
- * @desc : 환자의 차트 리스트 대출 신청 리스트 등록
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fSetRtnSchedd()
- {
- // 2009.02.05. 대출용도 에 따라 전달메세지 -> 연구용제목 으로 변경한다...
- var rendcd = model.getValue("/root/condition/rendcd");
- if (rendcd == '021' || rendcd == '022') {
- model.setValue("/root/hidden/caption", "연구용제목 :");
- cap_msgcnts.refresh();
- } else {
- model.setValue("/root/hidden/caption", "전달메세지 :");
- cap_msgcnts.refresh();
- }
- // 반납예정일 셋해주기...
- var rendcd = model.getValue("/root/condition/rendcd");
- var rendterm = model.getValue("/root/init/lendmastinfo/rendcdlist[rendcd='"+ rendcd +"']/defltrendterm");
- var rendunit = model.getValue("/root/init/lendmastinfo/rendcdlist[rendcd='"+ rendcd +"']/defltrendtermunit");
- var rendschedd = model.getValue("/root/condition/rendschedd");
- var tmp = rendschedd.toDate("YYYYMMDD");
- var rtnschedd = tmp.getAddDate(eval(rendterm), rendunit);
- model.setValue("/root/condition/rtnschedd", rtnschedd.getDateFormat());
- ipt_rtnschedd.refresh();
- }
- /**
- * @desc : 차트대출 신청하기 -> 신청내역으로 화면 이동하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fSetAppChrtList()
- {
- var ref = "/root/main/appchrt/appchrtlist";
- var grdObj = grd_appchrtlist;
- var savedata = "m▦medirecno▦rendcd▦rendschedd▦rendschetm▦lendmanid▦appmanid▦apptelno▦appdeptcd▦orddeptcd▦centcd▦msgcnts▩";
- var dataString = "";
- var dataCount = 0;
- for ( var i=1 ; i < grdObj.rows; i++)
- {
- var medirecno = model.getValue(ref + "[" + i + "]/medirecno");
- var rendcd = model.getValue(ref + "[" + i + "]/rendcd");
- var rendschedd = model.getValue(ref + "[" + i + "]/rendschedd");
- var lendmanid = model.getValue(ref + "[" + i + "]/lendmanid");
- var appmanid = model.getValue(ref + "[" + i + "]/appmanid");
- var apptelno = model.getValue(ref + "[" + i + "]/appmantelno");
- var appdeptcd = model.getValue(ref + "[" + i + "]/appdeptcd");
- var centcd = model.getValue(ref + "[" + i + "]/centcd");
- var orddeptcd = model.getValue(ref + "[" + i + "]/orddeptcd");
- var msgcnts = model.getValue(ref + "[" + i + "]/msgcnts");
- var rendschetm = getCurrentTime();
- rendschetm = rendschetm.substr(0,4);
- dataString = dataString + "i▦" + medirecno + "▦" + rendcd + "▦" + rendschedd + "▦" + rendschetm + "▦" ;
- dataString = dataString + lendmanid + "▦" + appmanid + "▦" + apptelno + "▦" + appdeptcd + "▦" + orddeptcd + "▦" + centcd + "▦" + msgcnts + "▩";
- dataCount = dataCount + 1;
- }
-
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- submit("TXMRC00300");
- alert("총 " + dataCount + " 건 챠트대출 신청되었습니다.");
- var appdeptcd = model.getValue("/root/condition/appdeptcd");
- var apprendcd = model.getValue("/root/condition/apprendcd");
- model.setValue("/root/condition/applist/appdeptcd" , appdeptcd);
- model.setValue("/root/condition/applist/apprendcd" , "ALL");
- // 신청 내역을 조회한다..
- btn_applist.dispatch("onclick");
- model.setValue("/root/condition/applist/lendmanid", "");
- model.setValue("/root/condition/applist/lendman" , "");
- model.setValue("/root/condition/applist/appmanid" , getUserId());
- model.setValue("/root/condition/applist/appman" , getUserName());
- model.setValue("/root/condition/applist/appfromdd", getCurrentDate());
- model.setValue("/root/condition/applist/apptodd" , getCurrentDate());
- // 신청 리스트는 지운다..
- model.removeNodeset("/root/main/appchrt/appchrtlist");
- model.refresh();
-
- btn_x_appsearch.dispatch("onclick");
- }
- }
- /**
- * @desc : 마우스 오른쪽 버튼 팝업창
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- */
- function fMouseRghtBtnPopup(gridObj, job)
- {
- if (event.button == 3) {
- if (gridObj.isCell(event.target)) {
- if (job == "1") {
- // 대출신청 예정목록 에서 삭제하기..
- if (gridObj.row > 0) {
- window.setPopupMenu(true, "/root/hidden/appchrtlist_menu/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else if (job == "2") {
- // 신청내역 리스트 에서 취소하기..
- if (gridObj.row > 0) {
- window.setPopupMenu(true, "/root/hidden/applist_menu/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else if (job == "3") {
- // 대출신청 예정목록 에서 신청내역 수정하기..
- if (gridObj.row > 0) {
- window.setPopupMenu(true, "/root/hidden/appchrtlist_menu/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else if (job == "4") {
- // 신청내역 리스트 에서 신청내역 수정하기..
- if (gridObj.row > 0) {
- window.setPopupMenu(true, "/root/hidden/applist_menu/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- }
- /**
- * @desc : 대출신청 예정목록 에서 삭제하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fdel_appchrtlist()
- {
- var ref = "/root/main/appchrt/appchrtlist";
- //선택되어 있는 행들에 delete flag 를 설정하고 숨긴다.
- for(var i=0; i < grd_appchrtlist.selectedRows; i++)
- {
- var row = grd_appchrtlist.selectedRow(i);
- model.makeValue(ref + "["+ row +"]/chk", "N");
- }
- model.refresh();
- var dataCnt = getNodeSetCnt(ref);
- for (var i=1 ; i <= dataCnt ; i++) {
- var chk = model.getValue(ref + "["+ i +"]/chk");
- if (chk == "N") {
- model.destroy(ref + "["+ i +"]");
- dataCnt = dataCnt - 1;
- i = i - 1;
- }
- }
- model.refresh();
- }
- /**
- * @desc : 신청내역 리스트 에서 취소하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fcancel_applist()
- {
- var ref = "/root/main/applist";
- var grdObj = grd_applist;
- var savedata = "m▦chrtseqno▦appdd▦appmanid▦appdeptcd▦appmanallyn▩";
- var dataString = "";
- var dataCount = 0;
- var appdd = model.getValue("/root/condition/applist/appdd");
- var appdeptcd = model.getValue("/root/condition/applist/appdeptcd");
- var appmanid = model.getValue("/root/condition/applist/appmanid");
- var appmanallyn = model.getValue("/root/condition/applist/appmanallyn");
- //선택되어 있는 행들을 신청 취소한다...
- for( var i=0; i < grdObj.selectedRows; i++)
- {
- var row = grdObj.selectedRow(i);
- var chrtseqno = model.getValue(ref + "[" + row + "]/chrtseqno");
- dataString = dataString + "u▦" + chrtseqno + "▦" + appdd + "▦" + appmanid + "▦" + appdeptcd + "▦" + appmanallyn + "▩";
- dataCount = dataCount + 1;
- }
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- submit("TXMRC00310");
- // fDisplayAppList();
- }
- }
- /**
- * @desc : 차트 대출 신청 내역 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fGetAppList()
- {
- var apprendcd = model.getValue("/root/condition/applist/apprendcd");
- var appdeptcd = model.getValue("/root/condition/applist/appdeptcd");
- var appmanid = model.getValue("/root/condition/applist/appmanid");
- var lendmanid = model.getValue("/root/condition/applist/lendmanid");
- var appfromdd = model.getValue("/root/condition/applist/appfromdd");
- var apptodd = model.getValue("/root/condition/applist/apptodd");
- model.makeValue("/root/send/reqdata/applist/apprendcd" , apprendcd);
- model.makeValue("/root/send/reqdata/applist/appdeptcd" , appdeptcd);
- model.makeValue("/root/send/reqdata/applist/appmanid" , appmanid);
- model.makeValue("/root/send/reqdata/applist/lendmanid" , lendmanid);
- model.makeValue("/root/send/reqdata/applist/appfromdd" , appfromdd);
- model.makeValue("/root/send/reqdata/applist/apptodd" , apptodd);
- model.refresh();
- submit("TRMRC00310");
- // fDisplayAppList();
- }
- /**
- * @desc : 차트 대출 신청 내역 디스플래이 해주기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.12
- * @---------------------------------------------------
- */
- function fDisplayAppList()
- {
- var grdObj = grd_applist;
- var ref = "/root/main/applist";
- // 2008.01.16. 상태에 따라 로우 색상 지정해 주기..
- for ( var i = 1; i < grdObj.rows; i++)
- {
- grdObj.rowstyle(i, "data", "background-color") = "#ffffff";
- var chrtlendyn = model.getValue(ref + "["+ i +"]/chrtlendyn");
- var unrendcd = model.getValue(ref + "["+ i +"]/unrendcd");
- var renddt = model.getValue(ref + "["+ i +"]/renddt");
- var delyn = model.getValue(ref + "["+ i +"]/delyn");
-
- if(chrtlendyn == "Y"){
- grdObj.rowstyle(i, "data", "background-color") = "#ffccff"; // 이미대출중
- }
- if(unrendcd != "00"){
- grdObj.rowstyle(i, "data", "background-color") = "#ffff99"; // 미대출처리
- }
- if(unrendcd != "00"){
- grdObj.rowstyle(i, "data", "background-color") = "#ffff99"; // 미대출처리 + 이미대출중
- }
- if(delyn != "N"){
- grdObj.rowstyle(i, "data", "background-color") = "#ff0000"; // 대출신청취소
- }
- if(renddt != ""){
- grdObj.rowstyle(i, "data", "background-color") = "#ccffcc"; // 대출완료
- }
- }
- }
- /**
- * @desc : 차트 대출 현황 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.21
- * @---------------------------------------------------
- */
- function fGetLendList()
- {
- var appdeptcd = model.getValue("/root/condition/lendlist/appdeptcd");
- var apprendcd = model.getValue("/root/condition/lendlist/apprendcd");
- var lendmanid = model.getValue("/root/condition/lendlist/lendmanid");
- var appmanid = model.getValue("/root/condition/lendlist/appmanid");
- var rendfromdd = model.getValue("/root/condition/lendlist/rendfromdd");
- var rendtodd = model.getValue("/root/condition/lendlist/rendtodd");
- var appfromdd = model.getValue("/root/condition/lendlist/appfromdd");
- var apptodd = model.getValue("/root/condition/lendlist/apptodd");
- model.makeValue("/root/send/reqdata/lendlist/appdeptcd" , appdeptcd);
- model.makeValue("/root/send/reqdata/lendlist/apprendcd" , apprendcd);
- model.makeValue("/root/send/reqdata/lendlist/lendmanid" , lendmanid);
- model.makeValue("/root/send/reqdata/lendlist/appmanid" , appmanid);
- model.makeValue("/root/send/reqdata/lendlist/rendfromdd", "");
- model.makeValue("/root/send/reqdata/lendlist/rendtodd" , "");
- model.makeValue("/root/send/reqdata/lendlist/appfromdd" , appfromdd);
- model.makeValue("/root/send/reqdata/lendlist/apptodd" , apptodd);
- submit("TRMRC00320");
- }
- /**
- * @desc : 사용자콤보 조회
- * @
- * @param : ref - reference path
- * rsltref - result reference path
- * deptcd - 부서코드
- * jobkindcd - 직종코드
- * jobposcd - 직책코드
- * specordyn - 선택진료여부
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fGetUserComboList(ref, rsltref, deptcd, jobkindcd, specordyn)
- {
- model.removeNode(ref);
- model.makeValue(ref + "/deptcd" , deptcd); //부서코드
- model.makeValue(ref + "/jobkindcd", jobkindcd); //직종코드(의사:0330)
- model.makeValue(ref + "/specordyn", specordyn); //선택진료여부
- model.removeNode(rsltref);
- model.makeValue(rsltref + "/userlist/usercombo[1]/usernm", '-');
- model.makeValue(rsltref + "/userlist/usercombo[1]/userid", '');
- model.refresh();
- submit("TRMMB04102", "false", ref, rsltref + "/userlist");
-
- cmb_orddrid.select(0);
- model.refresh();
- }
- /**
- * @desc : 대출자 조회
- * @
- * @param : refUserid - 대출자 ID, refUserDeptcd - 소속부서코드 ( posdeptcd )
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetUserid(refUserid, refUsernm, refUserDeptcd, cmbObj)
- {
- model.removenode("/root/hidden/tmp/tempuserinfo/list");
- model.reset("/root/hidden/tmp/tempuserinfo");
- var user = model.getValue(refUserid);
- var flag = "userid";
-
- if(isNaN(user)){
- flag = "usernm";
- }
-
- model.setValue("/root/hidden/tmp/userpopupinfo/param", "_OneS");
- model.setValue("/root/hidden/tmp/userpopupinfo/flag", flag);
- model.setValue("/root/hidden/tmp/userpopupinfo/searchitem", user);
-
- modal("SPZSU10103", "", "200", "200", "SPZSU10103","/root/hidden/tmp/userpopupinfo","/root/main/temp");
-
- var iParam = getParameter("SPZSU10103_");
- setCSVToNode("/root/hidden/tmp/tempuserinfo", iParam);
- clearParameter("SPZSU10103_");
-
- model.refresh();
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/hidden/tmp/tempuserinfo/list") > 0 ){
-
- var userid = model.getValue("/root/hidden/tmp/tempuserinfo/list/userid");
- var usernm = model.getValue("/root/hidden/tmp/tempuserinfo/list/usernm");
- var posdeptcd = model.getValue("/root/hidden/tmp/tempuserinfo/list/posdeptcd");
- if (!isNull(refUsernm)){
- if (isNaN(refUsernm)){
- model.makeValue(refUsernm, usernm);
- }
- }
- if (!isNull(refUserDeptcd)){
- if (isNaN(refUserDeptcd)){
- model.makeValue(refUserDeptcd, posdeptcd);
- }
- }
- if (cmbObj != null){
- fAddUser(userid, usernm, cmbObj)
- }
- model.makeValue(refUserid, userid);
- model.refresh();
- }
- }
- /**
- * @desc : 대출자ID, 대출자명 콤보에 추가하기
- * @
- * @param : refUserid - 대출자 ID, refUsernm - 대출자명
- * @return :
- * @authur : 이은영 2008.09.01
- * @---------------------------------------------------
- */
- function fAddUser(Userid, Usernm, cmbObj)
- {
- var ref = cmbObj.choices.itemset.attribute("nodeset");
- var cnt = getNodesetCnt(model, ref) + 1;
- var userid = model.getValue(ref + "[userid ='" + Userid + "']/userid");
- if (userid == ""){
- model.makeValue(ref + "["+ cnt +"]/userid", Userid);
- model.makeValue(ref + "["+ cnt +"]/usernm", Usernm);
- }
- }
- /**
- * @desc : 등록된 환자번호인지 체킹한다..
- * @
- * @param : iptObj - 환자번호 입력 컨트롤 (pid)
- * @return : pnm - 환자명
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fCheckPid(iptObj, refPnm)
- {
- model.makeValue("/root/send/req/srchcond", "1");
- model.makeValue("/root/send/req/pid", iptObj.currentText);
-
- //환자등록번호 체크
- if(iptObj.currentText.length > 0 ){
-
- model.resetInstanceNode("/root/main/result/patinfo");
- model.makeNode("/root/main/result/patinfo");
-
- if(submit("TRPMC02500", "", "/root/send/req", "/root/main/result/patinfo")){
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 ){
- model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
- //* 2009.04.07. 이중번호 메세지 ( 14257937 박용석 -> 13275912 신옥순 )
- var sBindPid = model.getValue("/root/main/result/patinfo/patinfolist/bindpid");
- if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' ){
- //합번된 등록번호 메세지 처리
- var sPid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
- var sHngnm = model.getValue("/root/main/result/patinfo/patinfolist/hngnm");
- var retValue = messageBox(sPid + " (" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
- if( retValue == '6' ){
- model.makeValue(iptObj.attribute("ref"), sBindPid);
- iptObj.refresh();
- fCheckPid(iptObj, refPnm);
- return "";
- }
- }
- //*/
- var pid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
- var pnm = model.getValue("/root/main/result/patinfo/patinfolist/hngnm");
- if (refPnm != null)
- {
- model.makeValue(refPnm, pnm);
- }
- return pnm;
- }else{
- model.resetInstanceNode("/root/main/patinfo/patinfolist");
- messageBox("없는 환자 번호 입니다.", "E999", "");
- model.refresh();
- return "";
- }
- }
-
- }else{
- messageBox("환자등록번호를 정확히", "C001");
- return "";
- }
- }
- /**
- * @desc : 환자등록번호 조회 팝업
- * @
- * @param : refPid - 환자번호 참고 node path
- * refPnm - 환자명 참고 node path
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetPid(refPid, refPnm)
- {
- //조회건수가 1건일 경우 팝업창을 바로 닫는다.
- model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
- model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "N");
- if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
- model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '2');
- }
-
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
- model.resetInstanceNode("/root/source");
- //환자번호 copy
- var popupendflag = model.getValue("/root/main/popupendflag");
-
- if (popupendflag == "ok")
- {
- model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
- if (refPnm == null) { refPnm = "" }
- if (refPnm != "") {
- model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- }
- model.refresh();
- }
- }
- /**
- * @desc : 대출현황에서 신청일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.10
- * @---------------------------------------------------
- */
- function fTermDisabled(chkObj, fromddObj, toddObj)
- {
- var termdisabled = chkObj.value;
- if (termdisabled == "Y") {
- model.setValue(fromddObj.attribute("ref"), getCurrentDate());
- model.setValue(toddObj.attribute("ref") , getCurrentDate());
- fromddObj.disabled = false;
- toddObj.disabled = false;
- } else {
- model.setValue(fromddObj.attribute("ref"), "19000101");
- model.setValue(toddObj.attribute("ref") , getCurrentDate());
- fromddObj.disabled = true;
- toddObj.disabled = true;
- }
- fromddObj.refresh();
- toddObj.refresh();
- }
- /**
- * @desc : 대출신쳥 목록에서 우클릭 메뉴 일괄변경 선택시 기본셋하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fCheckFlagDisabled1()
- {
- var ref = "/root/condition/updateapplist1";
- model.setValue(ref + "/chkrendcd" , "");
- model.setValue(ref + "/chklenddeptcd" , "");
- model.setValue(ref + "/chkmsgcnts" , "");
- model.setValue(ref + "/chkappmantelno", "");
- cbo_renduse1.disabled = true;
- cbo_appdeptcd1.disabled = true;
- cbo_orddeptcd1.disabled = true;
- cbo_lendmanid1.disabled = true;
- ipt_msgcnts1.disabled = true;
- ipt_appmantelno1.disabled = true;
- var rendcd = model.getValue("/root/init/lendsetitem/setitemlist[lenduseyn='Y']/rendcd");
- model.setValue(ref + "/rendcd" , rendcd);
- model.setValue(ref + "/appdeptcd" , "");
- model.setValue(ref + "/orddeptcd" , "");
- model.setValue(ref + "/centcd" , "");
- model.setValue(ref + "/lendmanid" , "");
- model.setValue(ref + "/msgcnts" , "");
- model.setValue(ref + "/appmantelno", "");
- grup_updateapplist1.refresh();
- }
- /**
- * @desc : 대출신쳥 목록에서 우클릭 메뉴 일괄변경 선택시 기본셋하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fCheckFlagDisabled2()
- {
- var ref = "/root/condition/updateapplist2";
- model.setValue(ref + "/chkrendcd" , "");
- model.setValue(ref + "/chklenddeptcd" , "");
- model.setValue(ref + "/chkmsgcnts" , "");
- model.setValue(ref + "/chkappmantelno", "");
- cbo_renduse2.disabled = true;
- cbo_appdeptcd2.disabled = true;
- cbo_orddeptcd2.disabled = true;
- cbo_lendmanid2.disabled = true;
- ipt_msgcnts2.disabled = true;
- ipt_appmantelno2.disabled = true;
- var rendcd = model.getValue("/root/init/lendsetitem/setitemlist[lenduseyn='Y']/rendcd");
- model.setValue(ref + "/rendcd" , rendcd);
- model.setValue(ref + "/appdeptcd" , "");
- model.setValue(ref + "/orddeptcd" , "");
- model.setValue(ref + "/centcd" , "");
- model.setValue(ref + "/lendmanid" , "");
- model.setValue(ref + "/msgcnts" , "");
- model.setValue(ref + "/appmantelno", "");
- grup_updateapplist2.refresh();
- }
- /**
- * @desc : 체크여부에 따라 컨트롤 disabled 값 셋하기.. true / false
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fDisabled(chkObj, Obj)
- {
- var disabled = chkObj.value;
- if (disabled == "Y") {
- Obj.disabled = false;
- } else {
- Obj.disabled = true;
- }
- Obj.refresh();
- }
- /**
- * @desc : 팝업폼 보여주기..
- * @
- * @param : job - 0:대출신청 예정목록 (일괄수정)
- * @ 1:신청내역 리스트 (일괄수정)
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fShowWndIptBox(job)
- {
- grup_updateapplist1.visible = "false";
- grup_updateapplist2.visible = "false";
- if (job == "0") {
- // 일괄 수정 항목 초기화..
- fCheckFlagDisabled1();
- // 2009.02.16. 대출신청 예정목록 (일괄수정)
- if (event.clientY < 500) {
- grup_updateapplist1.attribute("top") = event.clientY-100;
- } else {
- grup_updateapplist1.attribute("top") = 500;
- }
- grup_updateapplist1.visible = "true";
- }
- if (job == "1") {
- // 일괄 수정 항목 초기화..
- fCheckFlagDisabled2();
- // 2009.02.16. 신청내역 리스트 (일괄수정)
- if (event.clientY < 500) {
- grup_updateapplist2.attribute("top") = event.clientY-100;
- } else {
- grup_updateapplist2.attribute("top") = 500;
- }
- grup_updateapplist2.visible = "true";
- }
- }
- /**
- * @desc : 대출신청 예정목록 에서 신청내역 수정하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fmodify_applist()
- {
- if(grd_appchrtlist.row < 1){
- return;
- }
- // 2009.02.16 대출신청 예정목록 에서 신청내역 수정하기..
- fShowWndIptBox("0");
- }
- /**
- * @desc : 신청내역 리스트 에서 신청내역 수정하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fupdate_applist()
- {
- if(grd_applist.row < 1){
- return;
- }
- // 2009.02.16 신청내역 리스트 에서 신청내역 수정하기..
- fShowWndIptBox("1");
- }
- /**
- * @desc : 대출신청 예정목록 에서 신청내역 수정하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fModifyApplist()
- {
- var chkrendcd = model.getValue("/root/condition/updateapplist1/chkrendcd");
- var chklenddeptcd = model.getValue("/root/condition/updateapplist1/chklenddeptcd");
- var chkmsgcnts = model.getValue("/root/condition/updateapplist1/chkmsgcnts");
- var chkappmantelno = model.getValue("/root/condition/updateapplist1/chkappmantelno");
- var rendcd = model.getValue("/root/condition/updateapplist1/rendcd");
- var appdeptcd = model.getValue("/root/condition/updateapplist1/appdeptcd");
- var lendmanid = model.getValue("/root/condition/updateapplist1/lendmanid");
- var msgcnts = model.getValue("/root/condition/updateapplist1/msgcnts");
- var appmantelno = model.getValue("/root/condition/updateapplist1/appmantelno");
- // 2009.03.18. 진료과 , 센터 저장하기..
- var orddeptkind = model.getValue("/root/condition/updateapplist1/orddeptkind");
- var centcd = "-";
- if (orddeptkind == "C") {
- centcd = model.getValue("/root/condition/updateapplist1/appdeptcd");
- }
- var orddeptcd = model.getValue("/root/condition/updateapplist1/orddeptcd");
- // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
- // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
- if (rendcd == "021" || rendcd == "022"){
- msgcnts = msgcnts.getTrimLeft();
- msgcnts = msgcnts.getTrimRight();
- if (msgcnts.length == ""){
- window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("ipt_msgcnts1");
- return;
- }
- appmantelno = appmantelno.getTrimLeft();
- appmantelno = appmantelno.getTrimRight();
- if (appmantelno.length == ""){
- window.alert("반드시 연락처를 입력해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("ipt_appmantelno1");
- return;
- }
- }
- if (chklenddeptcd == "Y") {
- if (appdeptcd == "") {
- window.alert("대출과를 선택해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("cbo_appdeptcd1");
- return;
- }
- if (lendmanid == "") {
- window.alert("대출자를 선택해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("cbo_lendmanid1");
- return;
- }
- }
- // 2009.03.18. 대출과가 센터인 경우 진료과 선택 체킹하기...
- var orddeptkind = model.getValue("/root/condition/updateapplist1/orddeptkind");
- var orddeptcd = model.getValue("/root/condition/updateapplist1/orddeptcd");
- if (orddeptkind == "C" && orddeptcd == "-"){
- window.alert("대출과가 센터인 경우 진료과를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cbo_orddeptcd1");
- return;
- }
- var ref = "/root/main/appchrt/appchrtlist";
- var gridObj = grd_appchrtlist;
- // 선택된 항목에 대해서만 수정함..
- for(var i=0; i < gridObj.selectedRows; i++)
- {
- var row = gridObj.selectedRow(i);
- if (chkrendcd == "Y") {
- model.setValue(ref + "["+ row +"]/rendcd", rendcd);
- }
- if (chklenddeptcd == "Y") {
- model.setValue(ref + "["+ row +"]/appdeptcd" , appdeptcd);
- var appdeptnm = model.getValue("/root/init/lendmastinfo/lenddeptlist[lenddeptcd ='"+ appdeptcd +"']/lenddeptnm");
- model.setValue(ref + "["+ row +"]/appdeptnm" , appdeptnm);
- // 2009.03.18. 진료과 , 센터 저장하기..
- model.setValue(ref + "["+ row +"]/orddeptcd" , orddeptcd);
- var orddeptnm = model.getValue("/root/init/cntrsuborddeptlist1/dept[deptcd ='"+ orddeptcd +"']/depthngnm");
- model.setValue(ref + "["+ row +"]/orddeptnm" , orddeptnm);
- model.setValue(ref + "["+ row +"]/centcd" , centcd);
- model.setValue(ref + "["+ row +"]/lendmanid" , lendmanid);
- var lendman = model.getValue("/root/init/userlist1/userlist/usercombo[userid ='"+ lendmanid +"']/usernm");
- model.setValue(ref + "["+ row +"]/lendman" , lendman);
- }
- if (chkmsgcnts == "Y") {
- model.setValue(ref + "["+ row +"]/msgcnts" , msgcnts);
- }
- if (chkappmantelno == "Y") {
- model.setValue(ref + "["+ row +"]/appmantelno", appmantelno);
- }
- }
- model.refresh();
- grup_updateapplist1.visible = "false";
- }
- /**
- * @desc : 신청내역 리스트 에서 신청내역 수정하기..
- * @
- * @param :
- * @return :
- * @authur : 이은영 2009.02.16
- * @---------------------------------------------------
- */
- function fUpdateApplist()
- {
- var chkrendcd = model.getValue("/root/condition/updateapplist2/chkrendcd");
- var chklenddeptcd = model.getValue("/root/condition/updateapplist2/chklenddeptcd");
- var chkmsgcnts = model.getValue("/root/condition/updateapplist2/chkmsgcnts");
- var chkappmantelno = model.getValue("/root/condition/updateapplist2/chkappmantelno");
- var rendcd = model.getValue("/root/condition/updateapplist2/rendcd");
- var appdeptcd = model.getValue("/root/condition/updateapplist2/appdeptcd");
- var lendmanid = model.getValue("/root/condition/updateapplist2/lendmanid");
- var msgcnts = model.getValue("/root/condition/updateapplist2/msgcnts");
- var appmantelno = model.getValue("/root/condition/updateapplist2/appmantelno");
- // 2009.03.18. 진료과 , 센터 저장하기..
- var orddeptkind = model.getValue("/root/condition/updateapplist2/orddeptkind");
- var centcd = "-";
- if (orddeptkind == "C") {
- centcd = model.getValue("/root/condition/updateapplist2/appdeptcd");
- }
- var orddeptcd = model.getValue("/root/condition/updateapplist2/orddeptcd");
-
- // 2009.03.18. 대출과가 센터인 경우 진료과 선택 체킹하기...
- if (orddeptkind == "C" && orddeptcd == "-"){
- window.alert("대출과가 센터인 경우 진료과를 선택해주세요.", "차트대출신청", 0 | 64);
- model.setFocus("cbo_orddeptcd2");
- return;
- }
- // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
- // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
- if (rendcd == "021" || rendcd == "022"){
- msgcnts = msgcnts.getTrimLeft();
- msgcnts = msgcnts.getTrimRight();
- if (msgcnts.length == ""){
- window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("ipt_msgcnts2");
- return;
- }
- appmantelno = appmantelno.getTrimLeft();
- appmantelno = appmantelno.getTrimRight();
- if (appmantelno.length == ""){
- window.alert("반드시 연락처를 입력해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("ipt_appmantelno2");
- return;
- }
- }
- if (chklenddeptcd == "Y") {
- if (appdeptcd == "") {
- window.alert("대출과를 선택해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("cbo_appdeptcd2");
- return;
- }
- if (lendmanid == "") {
- window.alert("대출자를 선택해 주십시오..", "차트대출신청", 0 | 64);
- model.setFocus("cbo_lendmanid2");
- return;
- }
- }
- // 2009.02.05. 의사 아이디로 차트신청시 전달메세지, 연락처 항목을 필수 입력항목으로 체킹한다.
- // 의사 : 03, 04, 05, 06
- // 간호사 : 11
- // 연구원, 연구직 : 0750, 0751 => 의사
- // 조교 : 0410 => 기타
- var jobkindcd = getUserInfo("jobkindcd");
- var drflag = "N";
- var nursflag = "N";
- if (jobkindcd == "0410") {
- drflag = "N";
- } else if (jobkindcd == "0750" || jobkindcd == "0750" ) {
- drflag = "Y";
- } else if (jobkindcd.substring(0,2) == "03" || jobkindcd.substring(0,2) == "04" ||
- jobkindcd.substring(0,2) == "05" || jobkindcd.substring(0,2) == "06" ) {
- drflag = "Y";
- } else if (jobkindcd.substring(0,2) == "11") {
- nursflag = "Y";
- }
- if (drflag == "Y" || nursflag == "Y") {
- // 2009.03.02. 차트신청시 [ 003:접수외대출, 021:연구용, 022:임상연구용, 099:기타대출 ]
- // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
- if (rendcd == "003" || rendcd == "022" || rendcd == "021" || rendcd == "099"){
- msgcnts = msgcnts.getTrimLeft();
- msgcnts = msgcnts.getTrimRight();
- if (msgcnts.length == ""){
- window.alert("반드시 전달메세지 (연구 제목 및 신청사유) 을 입력해 주십시오.." + jobkindcd, "차트대출신청", 0 | 64);
- model.setFocus("ipt_msgcnts2");
- return;
- }
- }
- if (chkappmantelno == "Y") {
- appmantelno = appmantelno.getTrimLeft();
- appmantelno = appmantelno.getTrimRight();
- if (appmantelno.length == ""){
- window.alert("반드시 연락처를 입력해 주십시오.." + jobkindcd, "차트대출신청", 0 | 64);
- model.setFocus("ipt_apptelno2");
- return;
- }
- }
- }
- var ref = "/root/main/applist";
- var gridObj = grd_applist;
- var savedata = "m▦chrtseqno▦rendcd▦appdeptcd▦lendmanid▦chkmsgcnts▦msgcnts▦chkappmantelno▦appmantelno▦orddeptcd▦centcd▩";
- var dataString = "";
- var dataCount = 0;
- if (chkrendcd != "Y") {
- rendcd = "";
- }
- if (chklenddeptcd != "Y") {
- appdeptcd = "";
- lendmanid = "";
- }
- // 선택되어 있는 행들을 신청 수정한다...
- for( var i=0; i < gridObj.selectedRows; i++)
- {
- var row = gridObj.selectedRow(i);
- var chrtseqno = model.getValue(ref + "[" + row + "]/chrtseqno");
- dataString = dataString + "u▦" + chrtseqno + "▦" + rendcd + "▦" + appdeptcd + "▦" + lendmanid + "▦";
- dataString = dataString + chkmsgcnts + "▦" + msgcnts + "▦" + chkappmantelno + "▦" + appmantelno + "▦" + orddeptcd + "▦" + centcd + "▩";
- dataCount = dataCount + 1;
- }
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- submit("TXMRC00320");
- // 다시 조회하기..
- fGetAppList();
- }
- grup_updateapplist2.visible = "false";
- }
- /**
- * @desc : excel 저장 하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- 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 : 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();
- }
|